@logicplanes/kaeso-ui 0.4.3 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ai/component-guides.md +279 -98
- package/ai/component-registry.json +352 -236
- package/ai/component-registry.md +241 -219
- package/ai/icons.md +2 -2
- package/ai/tokens.md +18 -14
- package/dist/blocks/delete-resource.js +3 -3
- package/dist/blocks/delete-resource.js.map +1 -1
- package/dist/blocks/pages.js +47 -42
- package/dist/blocks/pages.js.map +1 -1
- package/dist/blocks/resource-list.js +68 -55
- package/dist/blocks/resource-list.js.map +1 -1
- package/dist/chunks/agent-avatar-DHieggHK.js +188 -0
- package/dist/chunks/agent-avatar-DHieggHK.js.map +1 -0
- package/dist/chunks/app-frame-DysOel2X.js +232 -0
- package/dist/chunks/app-frame-DysOel2X.js.map +1 -0
- package/dist/chunks/arrow-focus-B0KdRFX8.js +20 -0
- package/dist/chunks/arrow-focus-B0KdRFX8.js.map +1 -0
- package/dist/chunks/avatar-CYNMK7uY.js +110 -0
- package/dist/chunks/avatar-CYNMK7uY.js.map +1 -0
- package/dist/chunks/badge-C0GC3B9X.js +27 -0
- package/dist/chunks/badge-C0GC3B9X.js.map +1 -0
- package/dist/chunks/banner-B3DGLTBu.js +88 -0
- package/dist/chunks/banner-B3DGLTBu.js.map +1 -0
- package/dist/chunks/button-IblhXUyZ.js +202 -0
- package/dist/chunks/button-IblhXUyZ.js.map +1 -0
- package/dist/chunks/{calendar-BWaf2MXc.js → calendar-Dc6_dl0f.js} +4 -4
- package/dist/chunks/calendar-Dc6_dl0f.js.map +1 -0
- package/dist/chunks/checkbox-9tbimmF3.js +141 -0
- package/dist/chunks/checkbox-9tbimmF3.js.map +1 -0
- package/dist/chunks/{cn-Dj6sRgkF.js → cn-BjnOAUrA.js} +45 -4
- package/dist/chunks/cn-BjnOAUrA.js.map +1 -0
- package/dist/chunks/code-block-64e-Cy1S.js +346 -0
- package/dist/chunks/code-block-64e-Cy1S.js.map +1 -0
- package/dist/chunks/code-block-KIvuE8jg.js +352 -0
- package/dist/chunks/code-block-KIvuE8jg.js.map +1 -0
- package/dist/chunks/{code-tqj0uhBL.js → code-xqjww4Pv.js} +5 -6
- package/dist/chunks/code-xqjww4Pv.js.map +1 -0
- package/dist/chunks/combobox-DkcjkWc6.js +352 -0
- package/dist/chunks/combobox-DkcjkWc6.js.map +1 -0
- package/dist/chunks/command-list-CypqsC4T.js +456 -0
- package/dist/chunks/command-list-CypqsC4T.js.map +1 -0
- package/dist/chunks/{copy-button-FJvPJn72.js → copy-button-CwU8t_9_.js} +22 -15
- package/dist/chunks/copy-button-CwU8t_9_.js.map +1 -0
- package/dist/chunks/core-CmK-8ObW.js +505 -0
- package/dist/chunks/core-CmK-8ObW.js.map +1 -0
- package/dist/chunks/data-table-CqY8_6IS.js +581 -0
- package/dist/chunks/data-table-CqY8_6IS.js.map +1 -0
- package/dist/chunks/date-popup-DAnjptFt.js +58 -0
- package/dist/chunks/date-popup-DAnjptFt.js.map +1 -0
- package/dist/chunks/{de-CPXJh9cq.js → de-CqC4aSIV.js} +81 -40
- package/dist/chunks/de-CqC4aSIV.js.map +1 -0
- package/dist/chunks/{dialog-Cg9A_6SF.js → dialog-2zb6ClNR.js} +156 -134
- package/dist/chunks/dialog-2zb6ClNR.js.map +1 -0
- package/dist/chunks/disclosure-BtYRTDO3.js +22 -0
- package/dist/chunks/disclosure-BtYRTDO3.js.map +1 -0
- package/dist/chunks/domain-obd_w9xk.js +28 -0
- package/dist/chunks/domain-obd_w9xk.js.map +1 -0
- package/dist/chunks/{empty-DvhyMXQq.js → empty-BpiUgGzm.js} +2 -2
- package/dist/chunks/{empty-DvhyMXQq.js.map → empty-BpiUgGzm.js.map} +1 -1
- package/dist/chunks/{field-TviMvYa2.js → field-D7m-yl-D.js} +37 -34
- package/dist/chunks/field-D7m-yl-D.js.map +1 -0
- package/dist/chunks/{icon-D7ja-_Yk.js → icon-CBzOwqrX.js} +7 -6
- package/dist/chunks/{icon-D7ja-_Yk.js.map → icon-CBzOwqrX.js.map} +1 -1
- package/dist/chunks/icon-CPJWE2N-.js +95 -0
- package/dist/chunks/{icon-DVooQfk4.js.map → icon-CPJWE2N-.js.map} +1 -1
- package/dist/chunks/{icon-button-CrdF_eMG.js → icon-button-Dfwpvmav.js} +7 -6
- package/dist/chunks/icon-button-Dfwpvmav.js.map +1 -0
- package/dist/chunks/{identity-BmhQ6BQ-.js → identity-3Foi5F8w.js} +7 -7
- package/dist/chunks/{identity-BmhQ6BQ-.js.map → identity-3Foi5F8w.js.map} +1 -1
- package/dist/chunks/{input-2VJuj_M4.js → input-Bo5-UZg2.js} +15 -9
- package/dist/chunks/input-Bo5-UZg2.js.map +1 -0
- package/dist/chunks/{input-group-DQ_4DoXg.js → input-group-jPcK9T_a.js} +42 -29
- package/dist/chunks/input-group-jPcK9T_a.js.map +1 -0
- package/dist/chunks/iso-field-DoqHBg8n.js +52 -0
- package/dist/chunks/iso-field-DoqHBg8n.js.map +1 -0
- package/dist/chunks/json-view-DZ2nL2Ir.js +253 -0
- package/dist/chunks/json-view-DZ2nL2Ir.js.map +1 -0
- package/dist/chunks/{kbd-BF1vKXJf.js → kbd-8A0ML_up.js} +30 -28
- package/dist/chunks/kbd-8A0ML_up.js.map +1 -0
- package/dist/chunks/label-DW24Aj0Z.js +26 -0
- package/dist/chunks/label-DW24Aj0Z.js.map +1 -0
- package/dist/chunks/{link-KWI7PevW.js → link-CMjkcLQK.js} +14 -14
- package/dist/chunks/link-CMjkcLQK.js.map +1 -0
- package/dist/chunks/list-B4G-sWwV.js +540 -0
- package/dist/chunks/list-B4G-sWwV.js.map +1 -0
- package/dist/chunks/{loader-DCfPndXa.js → loader-zo8CCIGJ.js} +2 -2
- package/dist/chunks/{loader-DCfPndXa.js.map → loader-zo8CCIGJ.js.map} +1 -1
- package/dist/chunks/markdown-C565aBR7.js +338 -0
- package/dist/chunks/markdown-C565aBR7.js.map +1 -0
- package/dist/chunks/menu-Clvv6ftq.js +485 -0
- package/dist/chunks/menu-Clvv6ftq.js.map +1 -0
- package/dist/chunks/merge-refs-BN1FyQt9.js +20 -0
- package/dist/chunks/merge-refs-BN1FyQt9.js.map +1 -0
- package/dist/chunks/meter-CASMHlxl.js +100 -0
- package/dist/chunks/meter-CASMHlxl.js.map +1 -0
- package/dist/chunks/nav-sheet-Dt6JSvzX.js +67 -0
- package/dist/chunks/nav-sheet-Dt6JSvzX.js.map +1 -0
- package/dist/chunks/{nav-wordmark-_pjheAsZ.js → nav-wordmark-J4pB_vjr.js} +4 -8
- package/dist/chunks/nav-wordmark-J4pB_vjr.js.map +1 -0
- package/dist/chunks/page-header-kS5tdmvb.js +45 -0
- package/dist/chunks/page-header-kS5tdmvb.js.map +1 -0
- package/dist/chunks/pagination-D7fAm8qg.js +147 -0
- package/dist/chunks/pagination-D7fAm8qg.js.map +1 -0
- package/dist/chunks/picker-popover-1FHb1LQG.js +119 -0
- package/dist/chunks/picker-popover-1FHb1LQG.js.map +1 -0
- package/dist/chunks/popover-Bl5QYqnh.js +51 -0
- package/dist/chunks/popover-Bl5QYqnh.js.map +1 -0
- package/dist/chunks/{portal-context-BBbzDKmY.js → portal-context-CTatR2Z8.js} +14 -4
- package/dist/chunks/portal-context-CTatR2Z8.js.map +1 -0
- package/dist/chunks/{radio-CDDFpdtL.js → radio-C6GtzF_t.js} +38 -23
- package/dist/chunks/radio-C6GtzF_t.js.map +1 -0
- package/dist/chunks/range-popup-lGiZsG3s.js +160 -0
- package/dist/chunks/range-popup-lGiZsG3s.js.map +1 -0
- package/dist/chunks/reasoning-frame-C3HdQRRS.js +51 -0
- package/dist/chunks/reasoning-frame-C3HdQRRS.js.map +1 -0
- package/dist/chunks/release-art-ChiT4T2S.js +582 -0
- package/dist/chunks/release-art-ChiT4T2S.js.map +1 -0
- package/dist/chunks/rights-B68ocZuq.js +312 -0
- package/dist/chunks/rights-B68ocZuq.js.map +1 -0
- package/dist/chunks/{scroll-area-D8MD7Vpo.js → scroll-area-_Ljh4-bG.js} +11 -6
- package/dist/chunks/scroll-area-_Ljh4-bG.js.map +1 -0
- package/dist/chunks/section-CFBYhsUi.js +77 -0
- package/dist/chunks/section-CFBYhsUi.js.map +1 -0
- package/dist/chunks/section-header-DU1Q4Tdf.js +28 -0
- package/dist/chunks/section-header-DU1Q4Tdf.js.map +1 -0
- package/dist/chunks/segmented-D9i1avik.js +119 -0
- package/dist/chunks/segmented-D9i1avik.js.map +1 -0
- package/dist/chunks/select-BqjmQOqx.js +222 -0
- package/dist/chunks/select-BqjmQOqx.js.map +1 -0
- package/dist/chunks/{separator-D7TzNHmX.js → separator-BNWf6BBj.js} +13 -8
- package/dist/chunks/separator-BNWf6BBj.js.map +1 -0
- package/dist/chunks/sidebar-Dq7oGOje.js +664 -0
- package/dist/chunks/sidebar-Dq7oGOje.js.map +1 -0
- package/dist/chunks/{sidebar-menu-BN3jkTlK.js → sidebar-menu-QSSNu1jJ.js} +2 -2
- package/dist/chunks/{sidebar-menu-BN3jkTlK.js.map → sidebar-menu-QSSNu1jJ.js.map} +1 -1
- package/dist/chunks/{skeleton-Dcz57Zyp.js → skeleton-D-qk3mes.js} +3 -3
- package/dist/chunks/skeleton-D-qk3mes.js.map +1 -0
- package/dist/chunks/slider-CcE8GtuV.js +58 -0
- package/dist/chunks/slider-CcE8GtuV.js.map +1 -0
- package/dist/chunks/{status-dot-QJTF0Yv4.js → status-dot-CP6runiC.js} +4 -4
- package/dist/chunks/{status-dot-QJTF0Yv4.js.map → status-dot-CP6runiC.js.map} +1 -1
- package/dist/chunks/{styles-CVJU9t9v.js → styles-hkFkoBbi.js} +2 -2
- package/dist/chunks/{styles-CVJU9t9v.js.map → styles-hkFkoBbi.js.map} +1 -1
- package/dist/chunks/{swap-text-Dr0Irxz6.js → swap-text-SlUjrTlG.js} +3 -3
- package/dist/chunks/swap-text-SlUjrTlG.js.map +1 -0
- package/dist/chunks/switch-ngywMQdl.js +76 -0
- package/dist/chunks/switch-ngywMQdl.js.map +1 -0
- package/dist/chunks/table-CTK5E0J7.js +102 -0
- package/dist/chunks/table-CTK5E0J7.js.map +1 -0
- package/dist/chunks/tag-BGr6lTSV.js +100 -0
- package/dist/chunks/tag-BGr6lTSV.js.map +1 -0
- package/dist/chunks/{text-CIXH8rmT.js → text-DkKdTVUf.js} +9 -9
- package/dist/chunks/text-DkKdTVUf.js.map +1 -0
- package/dist/chunks/{textarea--4FRL3Pb.js → textarea-CO0HP6fK.js} +47 -36
- package/dist/chunks/textarea-CO0HP6fK.js.map +1 -0
- package/dist/chunks/timeseries-Ck-q0wWn.js +381 -0
- package/dist/chunks/timeseries-Ck-q0wWn.js.map +1 -0
- package/dist/chunks/toolbar-u0Gm7Q7-.js +61 -0
- package/dist/chunks/toolbar-u0Gm7Q7-.js.map +1 -0
- package/dist/chunks/tooltip-Tkm-urbi.js +202 -0
- package/dist/chunks/tooltip-Tkm-urbi.js.map +1 -0
- package/dist/chunks/tooltip-root-BC_RNNiP.js +70 -0
- package/dist/chunks/tooltip-root-BC_RNNiP.js.map +1 -0
- package/dist/chunks/truncated-d1afmUJT.js +33 -0
- package/dist/chunks/truncated-d1afmUJT.js.map +1 -0
- package/dist/chunks/use-coarse-pointer-Ml5oE6oX.js +28 -0
- package/dist/chunks/use-coarse-pointer-Ml5oE6oX.js.map +1 -0
- package/dist/chunks/use-hydrating-COtYVRo4.js +8 -0
- package/dist/chunks/use-hydrating-COtYVRo4.js.map +1 -0
- package/dist/chunks/use-scroll-fade-uc8mWSDX.js +30 -0
- package/dist/chunks/use-scroll-fade-uc8mWSDX.js.map +1 -0
- package/dist/chunks/{zh-CN-29X4CDLE.js → zh-CN-BlpsT6d_.js} +80 -39
- package/dist/chunks/zh-CN-BlpsT6d_.js.map +1 -0
- package/dist/components/agent-avatar.js +1 -1
- 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 +22 -22
- 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 +235 -160
- package/dist/components/charts/bar.js.map +1 -1
- package/dist/components/charts/donut.js +144 -99
- package/dist/components/charts/donut.js.map +1 -1
- package/dist/components/charts/gauge.js +61 -49
- package/dist/components/charts/gauge.js.map +1 -1
- package/dist/components/charts/heatmap.js +179 -70
- package/dist/components/charts/heatmap.js.map +1 -1
- package/dist/components/charts/sankey.js +144 -77
- package/dist/components/charts/sankey.js.map +1 -1
- package/dist/components/charts/sparkline.js +54 -38
- package/dist/components/charts/sparkline.js.map +1 -1
- package/dist/components/charts/timeseries.js +1 -1
- package/dist/components/charts.js +2 -2
- package/dist/components/checkbox.js +1 -1
- package/dist/components/code-block.js +4 -3
- package/dist/components/code.js +1 -1
- package/dist/components/collapsible.js +77 -1
- package/dist/components/collapsible.js.map +1 -0
- package/dist/components/combobox.js +1 -1
- package/dist/components/command-list.js +2 -2
- package/dist/components/command-palette.js +89 -66
- package/dist/components/command-palette.js.map +1 -1
- package/dist/components/copy-button.js +1 -1
- package/dist/components/data-table.js +1 -459
- package/dist/components/date-picker.js +162 -151
- package/dist/components/date-picker.js.map +1 -1
- package/dist/components/dialog.js +74 -63
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/display-options.js +76 -64
- 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/figure.js +2 -2
- package/dist/components/filter-chip.js +36 -27
- package/dist/components/filter-chip.js.map +1 -1
- package/dist/components/filter-row.js +4 -4
- package/dist/components/filter-row.js.map +1 -1
- package/dist/components/flow.js +94 -63
- package/dist/components/flow.js.map +1 -1
- package/dist/components/heading.js +1 -1
- package/dist/components/icon-button.js +1 -1
- package/dist/components/icon.js +2 -2
- package/dist/components/input.js +176 -98
- package/dist/components/input.js.map +1 -1
- package/dist/components/kaeso/conversation.js +51 -46
- package/dist/components/kaeso/conversation.js.map +1 -1
- package/dist/components/kaeso/identity.js +1 -1
- package/dist/components/kaeso/moments.js +23 -20
- package/dist/components/kaeso/moments.js.map +1 -1
- package/dist/components/kaeso/rights.js +1 -1
- package/dist/components/kaeso/usage.js +90 -74
- package/dist/components/kaeso/usage.js.map +1 -1
- package/dist/components/kaeso.js +200 -187
- package/dist/components/kaeso.js.map +1 -1
- package/dist/components/kbd.js +1 -1
- package/dist/components/key-value.js +32 -47
- package/dist/components/key-value.js.map +1 -1
- package/dist/components/label.js +1 -25
- package/dist/components/layout.js +2 -2
- package/dist/components/layout.js.map +1 -1
- package/dist/components/link.js +1 -1
- package/dist/components/list.js +1 -1
- package/dist/components/loader.js +11 -10
- package/dist/components/loader.js.map +1 -1
- 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 +644 -529
- package/dist/components/playground.js.map +1 -1
- package/dist/components/popover.js +4 -4
- package/dist/components/popover.js.map +1 -1
- package/dist/components/portal.js +1 -1
- package/dist/components/qr-code.js +2 -2
- package/dist/components/qr-code.js.map +1 -1
- package/dist/components/radio.js +1 -1
- package/dist/components/release-art.js +1 -1
- 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 +39 -46
- package/dist/components/settings.js.map +1 -1
- package/dist/components/sheet.js +10 -9
- 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 +98 -84
- 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 +73 -55
- 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 +5 -2
- package/dist/components/theme-menu.js.map +1 -1
- package/dist/components/theme-select.js +1 -1
- package/dist/components/thumbnail.js +35 -24
- package/dist/components/thumbnail.js.map +1 -1
- package/dist/components/timeline.js +51 -35
- package/dist/components/timeline.js.map +1 -1
- package/dist/components/toast.js +76 -66
- package/dist/components/toast.js.map +1 -1
- package/dist/components/toc.js +14 -8
- package/dist/components/toc.js.map +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/i18n-provider.js +1 -1
- package/dist/index.js +101 -101
- package/dist/kaeso.css +605 -67
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/types/blocks/delete-resource/delete-resource.d.ts +2 -2
- package/dist/types/components/agent-avatar/agent-avatar.d.ts +24 -19
- package/dist/types/components/badge/badge.d.ts +3 -3
- package/dist/types/components/banner/banner.d.ts +3 -3
- package/dist/types/components/button/button.d.ts +2 -2
- package/dist/types/components/button-group/button-group.d.ts +1 -1
- package/dist/types/components/charts/domain.d.ts +11 -0
- package/dist/types/components/charts/marks.d.ts +1 -0
- package/dist/types/components/code/code.d.ts +3 -3
- package/dist/types/components/code-block/diff-view.d.ts +30 -0
- package/dist/types/components/code-block/diff.d.ts +26 -0
- package/dist/types/components/code-block/docs.d.ts +14 -0
- package/dist/types/components/code-block/index.d.ts +1 -0
- package/dist/types/components/code-block/json-view.d.ts +2 -1
- package/dist/types/components/code-block/numbers.d.ts +1 -0
- package/dist/types/components/collapsible/collapsible.d.ts +2 -2
- package/dist/types/components/collapsible/disclosure.d.ts +2 -0
- package/dist/types/components/data-table/data-table.d.ts +6 -5
- package/dist/types/components/data-table/docs.d.ts +1 -0
- package/dist/types/components/data-table/time-columns.d.ts +1 -0
- package/dist/types/components/date-picker/focus-day.d.ts +1 -0
- package/dist/types/components/date-picker/iso-field.d.ts +8 -1
- package/dist/types/components/dialog/dialog.d.ts +7 -7
- package/dist/types/components/field/field.d.ts +1 -1
- package/dist/types/components/flow/flow.d.ts +1 -1
- package/dist/types/components/icon-button/icon-button.d.ts +1 -1
- package/dist/types/components/input/input-group.d.ts +2 -0
- package/dist/types/components/input/number-input.d.ts +4 -4
- package/dist/types/components/input/otp-input.d.ts +3 -3
- package/dist/types/components/kaeso/client-button.d.ts +2 -1
- package/dist/types/components/kaeso/provider-picker.d.ts +1 -0
- package/dist/types/components/kaeso/rights.d.ts +1 -1
- package/dist/types/components/kaeso/role-picker.d.ts +1 -0
- package/dist/types/components/key-value/key-value.d.ts +2 -2
- package/dist/types/components/layout/layout.d.ts +2 -2
- package/dist/types/components/link/link.d.ts +4 -4
- package/dist/types/components/list/list.d.ts +2 -2
- package/dist/types/components/menu/menu.d.ts +2 -1
- package/dist/types/components/menu/styles.d.ts +3 -3
- package/dist/types/components/meter/meter.d.ts +3 -3
- package/dist/types/components/page-header/page-header.d.ts +1 -1
- package/dist/types/components/pagination/pagination.d.ts +2 -2
- package/dist/types/components/playground/prompt-suggestions.d.ts +1 -0
- package/dist/types/components/playground/reasoning-frame.d.ts +14 -0
- package/dist/types/components/playground/reasoning.d.ts +1 -0
- package/dist/types/components/popover/popover.d.ts +1 -1
- package/dist/types/components/scroll-area/scroll-area.d.ts +2 -2
- package/dist/types/components/section/section-header.d.ts +6 -0
- package/dist/types/components/segmented/segmented.d.ts +1 -0
- package/dist/types/components/select/select.d.ts +1 -1
- package/dist/types/components/sheet/sheet.d.ts +3 -3
- package/dist/types/components/sidebar/sidebar.d.ts +1 -0
- package/dist/types/components/slider/slider.d.ts +2 -2
- package/dist/types/components/stat/stat.d.ts +1 -1
- package/dist/types/components/tabs/tabs.d.ts +6 -4
- package/dist/types/components/text/truncated.d.ts +7 -0
- package/dist/types/components/timeline/timeline.d.ts +5 -5
- package/dist/types/components/toc/toc.d.ts +1 -1
- package/dist/types/components/toolbar/toolbar.d.ts +1 -1
- package/dist/types/components/tooltip/tooltip.d.ts +2 -2
- package/dist/types/components/tooltip/trigger-props.d.ts +1 -0
- package/dist/types/hooks/use-coarse-pointer.d.ts +1 -0
- package/dist/types/hooks/use-hydrating.d.ts +1 -0
- package/dist/types/icons/groups.d.ts +1 -1
- package/dist/types/icons/vocabulary.d.ts +5 -0
- package/dist/types/utils/arrow-focus.d.ts +4 -1
- package/dist/types/utils/cn.d.ts +33 -0
- package/dist/types/utils/portal-context.d.ts +7 -1
- package/dist/utils.js +2 -2
- package/foundations/accessibility.md +3 -2
- package/foundations/color.md +5 -1
- package/foundations/elevation.md +1 -0
- package/foundations/motion.md +1 -1
- package/foundations/shape.md +2 -2
- package/foundations/typography.md +12 -12
- package/package.json +2 -2
- package/dist/chunks/agent-avatar-0pdBTWkR.js +0 -171
- package/dist/chunks/agent-avatar-0pdBTWkR.js.map +0 -1
- package/dist/chunks/app-frame-DogGRmsu.js +0 -221
- package/dist/chunks/app-frame-DogGRmsu.js.map +0 -1
- package/dist/chunks/arrow-focus-BcySmwwU.js +0 -11
- package/dist/chunks/arrow-focus-BcySmwwU.js.map +0 -1
- package/dist/chunks/avatar-CWbdwbJv.js +0 -83
- package/dist/chunks/avatar-CWbdwbJv.js.map +0 -1
- package/dist/chunks/badge-C2KtxCLB.js +0 -26
- package/dist/chunks/badge-C2KtxCLB.js.map +0 -1
- package/dist/chunks/banner-BA2ALw9M.js +0 -85
- package/dist/chunks/banner-BA2ALw9M.js.map +0 -1
- package/dist/chunks/button-CzuxqawA.js +0 -164
- package/dist/chunks/button-CzuxqawA.js.map +0 -1
- package/dist/chunks/calendar-BWaf2MXc.js.map +0 -1
- package/dist/chunks/checkbox-CQjwCPkc.js +0 -126
- package/dist/chunks/checkbox-CQjwCPkc.js.map +0 -1
- package/dist/chunks/cn-Dj6sRgkF.js.map +0 -1
- package/dist/chunks/code-block-D5A-CGXG.js +0 -330
- package/dist/chunks/code-block-D5A-CGXG.js.map +0 -1
- package/dist/chunks/code-tqj0uhBL.js.map +0 -1
- package/dist/chunks/collapsible-CKrCX_T9.js +0 -87
- package/dist/chunks/collapsible-CKrCX_T9.js.map +0 -1
- package/dist/chunks/combobox-DjDI7SUC.js +0 -319
- package/dist/chunks/combobox-DjDI7SUC.js.map +0 -1
- package/dist/chunks/command-list-C2Y7V_lt.js +0 -418
- package/dist/chunks/command-list-C2Y7V_lt.js.map +0 -1
- package/dist/chunks/copy-button-FJvPJn72.js.map +0 -1
- package/dist/chunks/core-BYns5ytV.js +0 -472
- package/dist/chunks/core-BYns5ytV.js.map +0 -1
- package/dist/chunks/date-popup-CPA_zt6o.js +0 -35
- package/dist/chunks/date-popup-CPA_zt6o.js.map +0 -1
- package/dist/chunks/de-CPXJh9cq.js.map +0 -1
- package/dist/chunks/dialog-Cg9A_6SF.js.map +0 -1
- package/dist/chunks/field-TviMvYa2.js.map +0 -1
- package/dist/chunks/hidden-description-B2zSmLcn.js +0 -23
- package/dist/chunks/hidden-description-B2zSmLcn.js.map +0 -1
- package/dist/chunks/icon-DVooQfk4.js +0 -94
- package/dist/chunks/icon-button-CrdF_eMG.js.map +0 -1
- package/dist/chunks/input-2VJuj_M4.js.map +0 -1
- package/dist/chunks/input-group-DQ_4DoXg.js.map +0 -1
- package/dist/chunks/iso-field-B2rTwiBo.js +0 -33
- package/dist/chunks/iso-field-B2rTwiBo.js.map +0 -1
- package/dist/chunks/json-view-Dqd2TDkc.js +0 -175
- package/dist/chunks/json-view-Dqd2TDkc.js.map +0 -1
- package/dist/chunks/kbd-BF1vKXJf.js.map +0 -1
- package/dist/chunks/link-KWI7PevW.js.map +0 -1
- package/dist/chunks/list-M1csq-d4.js +0 -494
- package/dist/chunks/list-M1csq-d4.js.map +0 -1
- package/dist/chunks/markdown-DULktoTK.js +0 -313
- package/dist/chunks/markdown-DULktoTK.js.map +0 -1
- package/dist/chunks/menu-DEmBfdPm.js +0 -450
- package/dist/chunks/menu-DEmBfdPm.js.map +0 -1
- package/dist/chunks/meter-Bj4N3Xuh.js +0 -84
- package/dist/chunks/meter-Bj4N3Xuh.js.map +0 -1
- package/dist/chunks/nav-sheet-CzgIwgAm.js +0 -60
- package/dist/chunks/nav-sheet-CzgIwgAm.js.map +0 -1
- package/dist/chunks/nav-wordmark-_pjheAsZ.js.map +0 -1
- package/dist/chunks/page-header-DL2y2iZp.js +0 -41
- package/dist/chunks/page-header-DL2y2iZp.js.map +0 -1
- package/dist/chunks/pagination-Cn_qF4cg.js +0 -86
- package/dist/chunks/pagination-Cn_qF4cg.js.map +0 -1
- package/dist/chunks/picker-popover-BxyU1U9F.js +0 -106
- package/dist/chunks/picker-popover-BxyU1U9F.js.map +0 -1
- package/dist/chunks/popover-DNN4S47w.js +0 -50
- package/dist/chunks/popover-DNN4S47w.js.map +0 -1
- package/dist/chunks/portal-context-BBbzDKmY.js.map +0 -1
- package/dist/chunks/radio-CDDFpdtL.js.map +0 -1
- package/dist/chunks/range-popup-CRyWYUB1.js +0 -128
- package/dist/chunks/range-popup-CRyWYUB1.js.map +0 -1
- package/dist/chunks/release-art-ZwfFQImt.js +0 -561
- package/dist/chunks/release-art-ZwfFQImt.js.map +0 -1
- package/dist/chunks/rights-Cyp0Pzp-.js +0 -279
- package/dist/chunks/rights-Cyp0Pzp-.js.map +0 -1
- package/dist/chunks/scroll-area-D8MD7Vpo.js.map +0 -1
- package/dist/chunks/scroll-parent-WXvzQcUo.js +0 -14
- package/dist/chunks/scroll-parent-WXvzQcUo.js.map +0 -1
- package/dist/chunks/section-Ce1efbsP.js +0 -87
- package/dist/chunks/section-Ce1efbsP.js.map +0 -1
- package/dist/chunks/segmented-CErcoxwi.js +0 -114
- package/dist/chunks/segmented-CErcoxwi.js.map +0 -1
- package/dist/chunks/select-x4XVsdCI.js +0 -210
- package/dist/chunks/select-x4XVsdCI.js.map +0 -1
- package/dist/chunks/separator-D7TzNHmX.js.map +0 -1
- package/dist/chunks/sidebar-3r1ZRXlN.js +0 -621
- package/dist/chunks/sidebar-3r1ZRXlN.js.map +0 -1
- package/dist/chunks/skeleton-Dcz57Zyp.js.map +0 -1
- package/dist/chunks/slider-Ci83PGtj.js +0 -57
- package/dist/chunks/slider-Ci83PGtj.js.map +0 -1
- package/dist/chunks/swap-text-Dr0Irxz6.js.map +0 -1
- package/dist/chunks/switch-BNMq_kGt.js +0 -59
- package/dist/chunks/switch-BNMq_kGt.js.map +0 -1
- package/dist/chunks/table-BeOSKl_3.js +0 -84
- package/dist/chunks/table-BeOSKl_3.js.map +0 -1
- package/dist/chunks/tag-D_M1s2qS.js +0 -87
- package/dist/chunks/tag-D_M1s2qS.js.map +0 -1
- package/dist/chunks/text-CIXH8rmT.js.map +0 -1
- package/dist/chunks/textarea--4FRL3Pb.js.map +0 -1
- package/dist/chunks/timeseries-D1xjRXfk.js +0 -339
- package/dist/chunks/timeseries-D1xjRXfk.js.map +0 -1
- package/dist/chunks/toolbar-WA_oZgu-.js +0 -37
- package/dist/chunks/toolbar-WA_oZgu-.js.map +0 -1
- package/dist/chunks/tooltip-OcwO0VUT.js +0 -154
- package/dist/chunks/tooltip-OcwO0VUT.js.map +0 -1
- package/dist/chunks/tooltip-root-DzahJDVj.js +0 -60
- package/dist/chunks/tooltip-root-DzahJDVj.js.map +0 -1
- package/dist/chunks/zh-CN-29X4CDLE.js.map +0 -1
- package/dist/components/data-table.js.map +0 -1
- package/dist/components/label.js.map +0 -1
|
@@ -1,117 +1,142 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as e } from "../chunks/cn-
|
|
2
|
+
import { t as e } from "../chunks/cn-BjnOAUrA.js";
|
|
3
3
|
import { t } from "../chunks/use-controllable-B5Fd12Bx.js";
|
|
4
4
|
import { i as n, r } from "../chunks/context-BELWW79w.js";
|
|
5
|
-
import { formatContext as i, formatDuration as a, formatNumber as o,
|
|
6
|
-
import {
|
|
7
|
-
import { t as
|
|
8
|
-
import { n as
|
|
9
|
-
import { t as
|
|
10
|
-
import { a as
|
|
11
|
-
import { o as
|
|
12
|
-
import { r as
|
|
13
|
-
import { r as
|
|
14
|
-
import { r as
|
|
15
|
-
import { n as
|
|
16
|
-
import { i as
|
|
17
|
-
import { r as
|
|
18
|
-
import { a as
|
|
19
|
-
import { i as
|
|
20
|
-
import { c as
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
5
|
+
import { formatContext as i, formatDuration as a, formatNumber as o, formatPrice as s, formatUSD as c } from "../format.js";
|
|
6
|
+
import { r as l } from "../chunks/tooltip-Tkm-urbi.js";
|
|
7
|
+
import { t as u } from "../chunks/use-truncated-CW0hByYt.js";
|
|
8
|
+
import { n as d } from "../chunks/button-IblhXUyZ.js";
|
|
9
|
+
import { t as f } from "../chunks/icon-button-Dfwpvmav.js";
|
|
10
|
+
import { a as p, o as m, s as h } from "../chunks/field-D7m-yl-D.js";
|
|
11
|
+
import { o as g, r as _ } from "../chunks/textarea-CO0HP6fK.js";
|
|
12
|
+
import { r as v } from "../chunks/slider-CcE8GtuV.js";
|
|
13
|
+
import { r as y } from "../chunks/switch-ngywMQdl.js";
|
|
14
|
+
import { r as b } from "../chunks/segmented-D9i1avik.js";
|
|
15
|
+
import { n as x, r as S } from "../chunks/select-BqjmQOqx.js";
|
|
16
|
+
import { i as C } from "../chunks/popover-Bl5QYqnh.js";
|
|
17
|
+
import { r as w } from "../chunks/combobox-DkcjkWc6.js";
|
|
18
|
+
import { a as T, t as E } from "../chunks/command-list-CypqsC4T.js";
|
|
19
|
+
import { i as ee, r as D } from "../chunks/picker-popover-1FHb1LQG.js";
|
|
20
|
+
import { c as O, f as k, s as A, t as j } from "../chunks/identity-3Foi5F8w.js";
|
|
21
|
+
import { t as M } from "../chunks/reasoning-frame-C3HdQRRS.js";
|
|
22
|
+
import { r as N } from "../chunks/markdown-C565aBR7.js";
|
|
23
|
+
import { Children as te, createContext as ne, forwardRef as P, isValidElement as re, useCallback as F, useContext as ie, useEffect as I, useId as L, useLayoutEffect as ae, useMemo as R, useRef as z, useState as B, useSyncExternalStore as oe } from "react";
|
|
24
|
+
import { Fragment as se, jsx as V, jsxs as H } from "react/jsx-runtime";
|
|
25
|
+
import { Add01Icon as U, ArrowLeft01Icon as W, ArrowRight01Icon as G, Cancel01Icon as K, SlidersHorizontalIcon as ce } from "@hugeicons/core-free-icons";
|
|
26
26
|
//#region src/components/playground/composer.tsx
|
|
27
|
-
var
|
|
27
|
+
var q = { size: {
|
|
28
28
|
md: { classes: "rounded-frame" },
|
|
29
29
|
sm: { classes: "rounded-frame" }
|
|
30
|
-
} },
|
|
31
|
-
function
|
|
30
|
+
} }, le = { size: "md" }, J = "(pointer: coarse)";
|
|
31
|
+
function ue(e) {
|
|
32
32
|
if (typeof window > "u" || !window.matchMedia) return () => {};
|
|
33
|
-
let t = window.matchMedia(
|
|
33
|
+
let t = window.matchMedia(J);
|
|
34
34
|
return t.addEventListener?.("change", e), () => t.removeEventListener?.("change", e);
|
|
35
35
|
}
|
|
36
|
-
var de = () => typeof window < "u" && !!window.matchMedia?.(
|
|
37
|
-
let
|
|
38
|
-
let e =
|
|
39
|
-
e && (e.style.
|
|
40
|
-
}, [
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
36
|
+
var de = () => typeof window < "u" && !!window.matchMedia?.(J).matches, fe = () => oe(ue, de, () => !1), Y = /* @__PURE__ */ P(function({ value: r, defaultValue: i = "", onValueChange: a, onSubmit: o, onStop: s, submitOn: c = "enter", streaming: l = !1, loading: u = !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: w }, T) {
|
|
37
|
+
let E = n(), ee = m ?? E("composer.placeholder", "Write a prompt"), D = h ?? E("composer.prompt", "Prompt"), O = y ?? E("composer.send", "Send"), k = b ?? E("composer.stop", "Stop"), [A, j] = t(r, i, a), M = L(), N = z(null), te = _ === "sm" ? 1 : 2, ne = F(() => {
|
|
38
|
+
let e = N.current;
|
|
39
|
+
e && (e.style.setProperty("--scroll-area-overflow-y-start", `${Math.max(0, e.scrollTop)}px`), e.style.setProperty("--scroll-area-overflow-y-end", `${Math.max(0, e.scrollHeight - e.clientHeight - e.scrollTop)}px`));
|
|
40
|
+
}, []), P = F(() => {
|
|
41
|
+
let e = N.current;
|
|
42
|
+
e && (e.style.height = "auto", e.style.height = `${Math.min(Math.max(e.scrollHeight, te * 20 + 16), g * 20 + 16)}px`, ne());
|
|
43
|
+
}, [
|
|
44
|
+
g,
|
|
45
|
+
te,
|
|
46
|
+
ne
|
|
47
|
+
]);
|
|
48
|
+
ae(P, [P, A]);
|
|
49
|
+
let re = A.trim() === "", ie = !f && !l && !u && !re, I = () => {
|
|
50
|
+
ie && (o?.(A), p && r === void 0 && j(""));
|
|
51
|
+
}, R = fe(), B = c === "enter" && !R, oe = (e) => {
|
|
52
|
+
e.key === "Enter" && (e.nativeEvent.isComposing || e.keyCode === 229 || (e.metaKey || e.ctrlKey || B && !e.shiftKey && !e.altKey) && (e.preventDefault(), I()));
|
|
46
53
|
};
|
|
47
|
-
return /* @__PURE__ */
|
|
54
|
+
return /* @__PURE__ */ H("form", {
|
|
48
55
|
onSubmit: (e) => {
|
|
49
|
-
e.preventDefault(),
|
|
56
|
+
e.preventDefault(), I();
|
|
50
57
|
},
|
|
51
58
|
onMouseDown: (e) => {
|
|
52
|
-
|
|
59
|
+
if (f || e.button !== 0 || !e.currentTarget.contains(e.target)) return;
|
|
60
|
+
let t = e.target.closest("textarea, button, a, input, select, label, [role], [tabindex]");
|
|
61
|
+
t && e.currentTarget.contains(t) || (e.preventDefault(), N.current?.focus());
|
|
53
62
|
},
|
|
54
63
|
...C ? { "data-force": C } : {},
|
|
55
64
|
...f ? { "data-disabled": "" } : {},
|
|
56
|
-
className: e("flex min-w-0 cursor-text flex-col material-composer transition-control",
|
|
57
|
-
children: [
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
"aria-label": D,
|
|
68
|
-
"aria-keyshortcuts": L ? "Enter Meta+Enter Control+Enter" : "Meta+Enter Control+Enter",
|
|
69
|
-
...L ? { enterKeyHint: "send" } : {},
|
|
70
|
-
autoFocus: x,
|
|
71
|
-
...S ? { name: S } : {},
|
|
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"
|
|
73
|
-
}), /* @__PURE__ */ V("div", {
|
|
74
|
-
className: "flex min-w-0 items-center gap-8 p-8 pt-4",
|
|
75
|
-
children: [/* @__PURE__ */ B("div", {
|
|
76
|
-
className: "flex min-w-0 flex-1 items-center gap-4",
|
|
77
|
-
children: v
|
|
78
|
-
}), l ? /* @__PURE__ */ B(u, {
|
|
79
|
-
type: "button",
|
|
80
|
-
size: "sm",
|
|
81
|
-
variant: "secondary",
|
|
82
|
-
reserveLabels: [O, k],
|
|
83
|
-
onClick: () => s?.(),
|
|
65
|
+
className: e("flex min-w-0 cursor-text flex-col material-composer transition-control", q.size[_].classes, f && "cursor-not-allowed", w),
|
|
66
|
+
children: [
|
|
67
|
+
/* @__PURE__ */ V("textarea", {
|
|
68
|
+
ref: (e) => {
|
|
69
|
+
N.current = e, typeof T == "function" ? T(e) : T && (T.current = e);
|
|
70
|
+
},
|
|
71
|
+
rows: te,
|
|
72
|
+
value: A,
|
|
73
|
+
onChange: (e) => j(e.target.value),
|
|
74
|
+
onKeyDown: oe,
|
|
75
|
+
onScroll: ne,
|
|
84
76
|
disabled: f,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
disabled:
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
77
|
+
placeholder: ee,
|
|
78
|
+
"aria-label": D,
|
|
79
|
+
...l && !re ? { "aria-describedby": M } : {},
|
|
80
|
+
"aria-keyshortcuts": B ? "Enter Meta+Enter Control+Enter" : "Meta+Enter Control+Enter",
|
|
81
|
+
...B ? { enterKeyHint: "send" } : {},
|
|
82
|
+
autoFocus: x,
|
|
83
|
+
...S ? { name: S } : {},
|
|
84
|
+
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 scroll-fade-y placeholder:text-fg-tertiary disabled:cursor-not-allowed disabled:text-fg-disabled disabled:placeholder:text-fg-disabled"
|
|
85
|
+
}),
|
|
86
|
+
/* @__PURE__ */ V("span", {
|
|
87
|
+
id: M,
|
|
88
|
+
className: "sr-only",
|
|
89
|
+
children: E("composer.stopToSend", "A response is arriving; stop it to send this prompt.")
|
|
90
|
+
}),
|
|
91
|
+
/* @__PURE__ */ H("div", {
|
|
92
|
+
className: "flex min-w-0 items-center gap-8 p-8 pt-4 controls-on-fill",
|
|
93
|
+
children: [/* @__PURE__ */ V("div", {
|
|
94
|
+
className: "flex min-w-0 flex-1 items-center gap-4",
|
|
95
|
+
children: v
|
|
96
|
+
}), l ? /* @__PURE__ */ V(d, {
|
|
97
|
+
type: "button",
|
|
98
|
+
size: "sm",
|
|
99
|
+
variant: "secondary",
|
|
100
|
+
reserveLabels: [O, k],
|
|
101
|
+
onClick: () => s?.(),
|
|
102
|
+
disabled: f,
|
|
103
|
+
children: k
|
|
104
|
+
}) : /* @__PURE__ */ V(d, {
|
|
105
|
+
type: "submit",
|
|
106
|
+
size: "sm",
|
|
107
|
+
variant: "primary",
|
|
108
|
+
reserveLabels: [O, k],
|
|
109
|
+
loading: u,
|
|
110
|
+
disabled: !ie && !u,
|
|
111
|
+
children: O
|
|
112
|
+
})]
|
|
113
|
+
})
|
|
114
|
+
]
|
|
96
115
|
});
|
|
97
116
|
});
|
|
98
|
-
process.env.NODE_ENV !== "production" && (
|
|
117
|
+
process.env.NODE_ENV !== "production" && (Y.displayName = "Composer");
|
|
99
118
|
//#endregion
|
|
100
119
|
//#region src/components/playground/compare-grid.tsx
|
|
101
|
-
var
|
|
120
|
+
var X = { divider: {
|
|
102
121
|
hairline: { classes: "hairline-l" },
|
|
103
122
|
none: { classes: "" }
|
|
104
|
-
} },
|
|
123
|
+
} }, Z = { divider: "hairline" }, pe = /* @__PURE__ */ ne({
|
|
105
124
|
index: 0,
|
|
106
125
|
count: 1,
|
|
107
126
|
divider: "hairline",
|
|
108
|
-
add: null
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
127
|
+
add: null,
|
|
128
|
+
removing: () => {}
|
|
129
|
+
}), me = "button:not([disabled]), [href], input:not([disabled]), select, textarea, [tabindex]:not([tabindex='-1'])";
|
|
130
|
+
function he(e, t) {
|
|
131
|
+
let n = e?.querySelector("header");
|
|
132
|
+
((t ? n?.querySelector(t) : null) ?? n?.querySelector(me))?.focus({ preventScroll: !0 });
|
|
133
|
+
}
|
|
134
|
+
var ge = /* @__PURE__ */ P(function({ children: t, "aria-label": r, onAdd: i, addLabel: a, max: o = 4, active: s, onActiveChange: c, divider: l = "hairline", className: u }, d) {
|
|
135
|
+
let p = n(), m = te.toArray(t).filter(re), h = m.length, g = z(null), [_, v] = B(0), y = Math.min(s ?? _, Math.max(0, h - 1)), b = z(null), x = z(c);
|
|
136
|
+
ae(() => {
|
|
112
137
|
x.current = c;
|
|
113
138
|
});
|
|
114
|
-
let S =
|
|
139
|
+
let S = F((e) => {
|
|
115
140
|
let t = g.current?.children[e], n = g.current;
|
|
116
141
|
if (!t || !n) return;
|
|
117
142
|
b.current = n.scrollLeft === t.offsetLeft ? null : e;
|
|
@@ -124,28 +149,44 @@ var J = { divider: {
|
|
|
124
149
|
let t = Math.max(0, Math.min(h - 1, e));
|
|
125
150
|
v(t), c?.(t), S(t);
|
|
126
151
|
};
|
|
127
|
-
|
|
152
|
+
I(() => {
|
|
128
153
|
s !== void 0 && S(s);
|
|
129
154
|
}, [s, S]);
|
|
130
|
-
let
|
|
131
|
-
|
|
132
|
-
|
|
155
|
+
let w = z(h), T = z(!1), E = z(null);
|
|
156
|
+
ae(() => {
|
|
157
|
+
let e = g.current?.children;
|
|
158
|
+
if (h > w.current) v(h - 1), x.current?.(h - 1), S(h - 1), T.current && he(e?.[h - 1]);
|
|
159
|
+
else if (h < w.current && E.current !== null) {
|
|
160
|
+
let t = Math.min(E.current, h - 1);
|
|
161
|
+
he(e?.[t], "[data-compare-remove]");
|
|
162
|
+
}
|
|
163
|
+
T.current = !1, E.current = null, w.current = h;
|
|
133
164
|
}, [h, S]);
|
|
134
|
-
let
|
|
165
|
+
let ee = F((e) => {
|
|
166
|
+
E.current = e;
|
|
167
|
+
}, []), [D, O] = B(null), k = F(() => {
|
|
135
168
|
let e = g.current;
|
|
136
169
|
if (!e) return;
|
|
137
170
|
let t = e.scrollWidth - e.clientWidth - e.scrollLeft;
|
|
138
171
|
e.style.setProperty("--k-fade-start", e.scrollLeft > 1 ? "24px" : "0px"), e.style.setProperty("--k-fade-end", t > 1 ? "24px" : "0px");
|
|
172
|
+
let n = {
|
|
173
|
+
overflow: e.scrollWidth - e.clientWidth > 1,
|
|
174
|
+
start: e.scrollLeft <= 1,
|
|
175
|
+
end: t <= 1
|
|
176
|
+
};
|
|
177
|
+
O((e) => e && e.overflow === n.overflow && e.start === n.start && e.end === n.end ? e : n);
|
|
139
178
|
}, []);
|
|
140
|
-
|
|
179
|
+
ae(() => {
|
|
141
180
|
let e = g.current;
|
|
142
181
|
if (!e || typeof ResizeObserver > "u") return;
|
|
143
|
-
|
|
144
|
-
let t = new ResizeObserver(
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
182
|
+
k();
|
|
183
|
+
let t = new ResizeObserver(k);
|
|
184
|
+
t.observe(e);
|
|
185
|
+
for (let n of e.children) t.observe(n);
|
|
186
|
+
return () => t.disconnect();
|
|
187
|
+
}, [k, h]);
|
|
188
|
+
let A = () => {
|
|
189
|
+
k();
|
|
149
190
|
let e = g.current, t = e?.children[0];
|
|
150
191
|
if (!e || !t || !t.offsetWidth) return;
|
|
151
192
|
let n = Math.max(0, Math.min(h - 1, Math.round(e.scrollLeft / t.offsetWidth)));
|
|
@@ -154,75 +195,96 @@ var J = { divider: {
|
|
|
154
195
|
b.current = null;
|
|
155
196
|
}
|
|
156
197
|
n !== y && (v(n), c?.(n));
|
|
157
|
-
},
|
|
198
|
+
}, j = () => {
|
|
158
199
|
b.current = null;
|
|
159
|
-
},
|
|
160
|
-
icon:
|
|
200
|
+
}, M = h >= o, N = i ? /* @__PURE__ */ V(f, {
|
|
201
|
+
icon: U,
|
|
161
202
|
"aria-label": a ?? p("compareGrid.addModel", "Add model"),
|
|
162
203
|
size: "sm",
|
|
163
|
-
onClick:
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
204
|
+
onClick: () => {
|
|
205
|
+
T.current = !0, i();
|
|
206
|
+
},
|
|
207
|
+
disabled: M,
|
|
208
|
+
...M ? { disabledReason: p("compareGrid.compareUpTo", "Compare up to {max} at once", { max: o }) } : {}
|
|
209
|
+
}) : null, ne = m[y]?.props.label ?? "", P = D?.overflow ? "flex" : "flex md:hidden", ie = D?.overflow ? D.start : y === 0, L = D?.overflow ? D.end : y >= h - 1, R = {
|
|
210
|
+
index: y + 1,
|
|
211
|
+
count: h
|
|
212
|
+
};
|
|
213
|
+
return /* @__PURE__ */ H("div", {
|
|
214
|
+
ref: d,
|
|
169
215
|
role: "group",
|
|
170
216
|
"aria-label": r,
|
|
171
217
|
className: e("flex h-full min-h-0 min-w-0 flex-col", u),
|
|
172
|
-
children: [h > 1 ||
|
|
173
|
-
className: "
|
|
218
|
+
children: [(h > 1 || D?.overflow) && /* @__PURE__ */ H("div", {
|
|
219
|
+
className: e("h-44 shrink-0 items-center gap-4 px-24 hairline-b", P),
|
|
174
220
|
children: [
|
|
175
|
-
/* @__PURE__ */
|
|
176
|
-
icon:
|
|
221
|
+
/* @__PURE__ */ V(f, {
|
|
222
|
+
icon: W,
|
|
177
223
|
"aria-label": p("compareGrid.previousColumn", "Previous column"),
|
|
178
224
|
size: "sm",
|
|
179
|
-
disabled:
|
|
225
|
+
disabled: ie,
|
|
180
226
|
onClick: () => C(y - 1)
|
|
181
227
|
}),
|
|
182
|
-
/* @__PURE__ */
|
|
228
|
+
/* @__PURE__ */ H("span", {
|
|
183
229
|
"aria-live": "polite",
|
|
184
230
|
className: "min-w-0 flex-1 truncate text-center text-small text-fg-secondary tabular",
|
|
185
|
-
children: [/* @__PURE__ */
|
|
231
|
+
children: [/* @__PURE__ */ V("span", {
|
|
186
232
|
className: "sr-only",
|
|
187
|
-
children: p("compareGrid.
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
233
|
+
children: p("compareGrid.namedPosition", "{label}, {index} of {count}", {
|
|
234
|
+
label: ne,
|
|
235
|
+
...R
|
|
236
|
+
})
|
|
237
|
+
}), /* @__PURE__ */ V("span", {
|
|
238
|
+
"aria-hidden": !0,
|
|
239
|
+
children: p("compareGrid.position", "{index} of {count}", R)
|
|
191
240
|
})]
|
|
192
241
|
}),
|
|
193
|
-
/* @__PURE__ */
|
|
194
|
-
icon:
|
|
242
|
+
/* @__PURE__ */ V(f, {
|
|
243
|
+
icon: G,
|
|
195
244
|
"aria-label": p("compareGrid.nextColumn", "Next column"),
|
|
196
245
|
size: "sm",
|
|
197
|
-
disabled:
|
|
246
|
+
disabled: L,
|
|
198
247
|
onClick: () => C(y + 1)
|
|
199
248
|
}),
|
|
200
|
-
|
|
249
|
+
N && /* @__PURE__ */ V("span", {
|
|
250
|
+
className: "contents md:hidden",
|
|
251
|
+
children: N
|
|
252
|
+
})
|
|
201
253
|
]
|
|
202
|
-
})
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
254
|
+
}), /* @__PURE__ */ H("div", {
|
|
255
|
+
className: "flex min-h-0 min-w-0 flex-1",
|
|
256
|
+
children: [/* @__PURE__ */ V("div", {
|
|
257
|
+
ref: g,
|
|
258
|
+
onScroll: A,
|
|
259
|
+
onPointerDown: j,
|
|
260
|
+
onWheel: j,
|
|
261
|
+
onTouchStart: j,
|
|
262
|
+
onKeyDown: j,
|
|
263
|
+
className: "relative min-h-0 min-w-0 flex-1 compare-grid",
|
|
264
|
+
children: m.map((e, t) => /* @__PURE__ */ V(pe.Provider, {
|
|
265
|
+
value: {
|
|
266
|
+
index: t,
|
|
267
|
+
count: h,
|
|
268
|
+
divider: l,
|
|
269
|
+
add: h === 1 ? N : null,
|
|
270
|
+
removing: ee
|
|
271
|
+
},
|
|
272
|
+
children: e
|
|
273
|
+
}, e.key ?? t))
|
|
274
|
+
}), N && /* @__PURE__ */ V("div", {
|
|
275
|
+
className: e("hidden w-56 shrink-0 flex-col md:flex", X.divider[l].classes),
|
|
276
|
+
children: /* @__PURE__ */ V("div", {
|
|
277
|
+
className: "flex h-52 shrink-0 items-center justify-center hairline-b",
|
|
278
|
+
children: N
|
|
279
|
+
})
|
|
280
|
+
})]
|
|
219
281
|
})]
|
|
220
282
|
});
|
|
221
283
|
});
|
|
222
|
-
process.env.NODE_ENV !== "production" && (
|
|
223
|
-
function
|
|
224
|
-
let t =
|
|
225
|
-
return
|
|
284
|
+
process.env.NODE_ENV !== "production" && (ge.displayName = "CompareGrid");
|
|
285
|
+
function _e(e) {
|
|
286
|
+
let t = z(null), n = z(null), r = z(!0);
|
|
287
|
+
return I(() => {
|
|
226
288
|
let i = t.current, a = n.current;
|
|
227
289
|
if (!e || !i || !a || typeof ResizeObserver > "u") return;
|
|
228
290
|
let o = i.scrollTop, s = () => {
|
|
@@ -242,48 +304,54 @@ function he(e) {
|
|
|
242
304
|
content: n
|
|
243
305
|
};
|
|
244
306
|
}
|
|
245
|
-
var
|
|
246
|
-
let p = n(), { index: m, count: h, divider: g, add: _ } =
|
|
247
|
-
return /* @__PURE__ */
|
|
248
|
-
ref:
|
|
307
|
+
var ve = /* @__PURE__ */ P(function({ label: t, header: r, actions: i, children: a, footer: o, onRemove: s, removeLabel: c, stickToEnd: l = !0, className: u }, d) {
|
|
308
|
+
let p = n(), { index: m, count: h, divider: g, add: _, removing: v } = ie(pe), { body: y, content: b } = _e(l);
|
|
309
|
+
return /* @__PURE__ */ H("section", {
|
|
310
|
+
ref: d,
|
|
249
311
|
"aria-label": t,
|
|
250
|
-
className: e("row-span-3 grid min-h-0 min-w-0 snap-start snap-always grid-rows-subgrid", m > 0 &&
|
|
312
|
+
className: e("row-span-3 grid min-h-0 min-w-0 snap-start snap-always grid-rows-subgrid", m > 0 && X.divider[g].classes, u),
|
|
251
313
|
children: [
|
|
252
|
-
/* @__PURE__ */
|
|
314
|
+
/* @__PURE__ */ H("header", {
|
|
253
315
|
className: "flex h-52 min-w-0 items-center gap-4 px-24 hairline-b",
|
|
254
316
|
children: [
|
|
255
|
-
/* @__PURE__ */
|
|
317
|
+
/* @__PURE__ */ V("div", {
|
|
256
318
|
className: "flex min-w-0 flex-1 items-center",
|
|
257
319
|
children: r
|
|
258
320
|
}),
|
|
259
321
|
i,
|
|
260
|
-
s && h > 1 && /* @__PURE__ */
|
|
261
|
-
|
|
322
|
+
s && h > 1 && /* @__PURE__ */ V(f, {
|
|
323
|
+
"data-compare-remove": "",
|
|
324
|
+
icon: K,
|
|
262
325
|
"aria-label": c ?? p("compareGrid.remove", "Remove {label}", { label: t }),
|
|
263
326
|
size: "sm",
|
|
264
|
-
onClick:
|
|
327
|
+
onClick: () => {
|
|
328
|
+
v(m), s();
|
|
329
|
+
}
|
|
265
330
|
}),
|
|
266
|
-
_ && /* @__PURE__ */
|
|
267
|
-
className: "
|
|
331
|
+
_ && /* @__PURE__ */ V("span", {
|
|
332
|
+
className: "flex shrink-0 md:hidden",
|
|
268
333
|
children: _
|
|
269
334
|
})
|
|
270
335
|
]
|
|
271
336
|
}),
|
|
272
|
-
/* @__PURE__ */
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
"aria-label": p("compareGrid.thread", "{label} thread", { label: t }),
|
|
276
|
-
role: "region",
|
|
277
|
-
className: "relative min-h-0 overflow-y-auto overscroll-contain scrollbar-quiet scroll-fade-y focus-ring-inset",
|
|
278
|
-
children: /* @__PURE__ */ B("div", {
|
|
337
|
+
/* @__PURE__ */ V("div", {
|
|
338
|
+
className: "min-h-0 min-w-0 compare-thread",
|
|
339
|
+
children: /* @__PURE__ */ V("div", {
|
|
279
340
|
ref: y,
|
|
280
|
-
|
|
281
|
-
|
|
341
|
+
tabIndex: 0,
|
|
342
|
+
"aria-label": p("compareGrid.thread", "{label} thread", { label: t }),
|
|
343
|
+
role: "region",
|
|
344
|
+
className: "relative h-full min-h-0 overflow-y-auto overscroll-contain outline-none scrollbar-quiet scroll-fade-y",
|
|
345
|
+
children: /* @__PURE__ */ V("div", {
|
|
346
|
+
ref: b,
|
|
347
|
+
className: "flex min-h-full flex-col px-24 pt-16 pb-24",
|
|
348
|
+
children: a
|
|
349
|
+
})
|
|
282
350
|
})
|
|
283
351
|
}),
|
|
284
|
-
o != null && /* @__PURE__ */
|
|
352
|
+
o != null && /* @__PURE__ */ V("footer", {
|
|
285
353
|
className: "flex min-h-44 min-w-0 items-start px-24 pt-12 pb-12",
|
|
286
|
-
children: /* @__PURE__ */
|
|
354
|
+
children: /* @__PURE__ */ V("div", {
|
|
287
355
|
className: "min-w-0 px-12",
|
|
288
356
|
children: o
|
|
289
357
|
})
|
|
@@ -291,12 +359,12 @@ var Z = /* @__PURE__ */ N(function({ label: t, header: r, actions: i, children:
|
|
|
291
359
|
]
|
|
292
360
|
});
|
|
293
361
|
});
|
|
294
|
-
process.env.NODE_ENV !== "production" && (
|
|
295
|
-
var
|
|
362
|
+
process.env.NODE_ENV !== "production" && (ve.displayName = "CompareGrid.Column");
|
|
363
|
+
var ye = /* @__PURE__ */ Object.assign(ge, { Column: ve }), be = { state: {
|
|
296
364
|
done: { classes: "" },
|
|
297
365
|
live: { classes: "" }
|
|
298
|
-
} },
|
|
299
|
-
function
|
|
366
|
+
} }, Q = { state: "done" };
|
|
367
|
+
function xe(e) {
|
|
300
368
|
let t = e.trim().split("\n");
|
|
301
369
|
for (let e = t.length - 1; e >= 0; e--) {
|
|
302
370
|
let n = (t[e] ?? "").replace(/[*_`#>]+/g, "").trim();
|
|
@@ -304,76 +372,74 @@ function ye(e) {
|
|
|
304
372
|
}
|
|
305
373
|
return "";
|
|
306
374
|
}
|
|
307
|
-
var
|
|
308
|
-
let
|
|
309
|
-
return /* @__PURE__ */ V(
|
|
310
|
-
ref:
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
className: "min-w-0 flex-1 truncate text-fg-tertiary group-data-panel-open/think:invisible",
|
|
330
|
-
children: g
|
|
331
|
-
})
|
|
332
|
-
]
|
|
333
|
-
}), /* @__PURE__ */ B(G.Panel, {
|
|
334
|
-
className: "collapse-motion",
|
|
335
|
-
children: /* @__PURE__ */ V("div", {
|
|
336
|
-
className: "flex gap-12 pt-4 pb-8 pl-12",
|
|
337
|
-
children: [/* @__PURE__ */ B("span", {
|
|
338
|
-
"aria-hidden": !0,
|
|
339
|
-
className: "w-1 shrink-0 rounded-pill bg-line"
|
|
340
|
-
}), f ?? /* @__PURE__ */ B(j, {
|
|
341
|
-
text: t,
|
|
342
|
-
size: "small",
|
|
343
|
-
tone: "secondary",
|
|
344
|
-
streaming: r,
|
|
345
|
-
collapseAfter: 0,
|
|
346
|
-
wrapCode: !0,
|
|
347
|
-
className: "min-w-0 flex-1"
|
|
348
|
-
})]
|
|
349
|
-
})
|
|
350
|
-
})]
|
|
375
|
+
var Se = /* @__PURE__ */ P(function({ text: e = "", live: t = !1, duration: r, title: i, hint: o, open: s, defaultOpen: c, onOpenChange: l, children: u, className: d, "data-force": f }, p) {
|
|
376
|
+
let m = n(), h = i ?? (!t && r !== void 0 ? m("responseView.thoughtFor", "Thought for {duration}", { duration: a(r) }) : m("responseView.thinking", "Thinking"));
|
|
377
|
+
return /* @__PURE__ */ V(M, {
|
|
378
|
+
ref: p,
|
|
379
|
+
heading: h,
|
|
380
|
+
preview: o ?? (t ? xe(e) : ""),
|
|
381
|
+
previewHidden: o === void 0,
|
|
382
|
+
live: t,
|
|
383
|
+
open: s,
|
|
384
|
+
defaultOpen: c,
|
|
385
|
+
onOpenChange: l,
|
|
386
|
+
className: d,
|
|
387
|
+
"data-force": f,
|
|
388
|
+
children: u ?? /* @__PURE__ */ V(N, {
|
|
389
|
+
text: e,
|
|
390
|
+
size: "small",
|
|
391
|
+
tone: "secondary",
|
|
392
|
+
streaming: t,
|
|
393
|
+
collapseAfter: 0,
|
|
394
|
+
wrapCode: !0,
|
|
395
|
+
className: "min-w-0"
|
|
396
|
+
})
|
|
351
397
|
});
|
|
352
398
|
});
|
|
353
|
-
process.env.NODE_ENV !== "production" && (
|
|
399
|
+
process.env.NODE_ENV !== "production" && (Se.displayName = "Reasoning");
|
|
354
400
|
//#endregion
|
|
355
401
|
//#region src/components/playground/response-view.tsx
|
|
356
|
-
var
|
|
402
|
+
var Ce = { status: {
|
|
357
403
|
pending: { classes: "" },
|
|
358
404
|
streaming: { classes: "" },
|
|
359
405
|
done: { classes: "" },
|
|
360
406
|
stopped: { classes: "" },
|
|
361
407
|
incomplete: { classes: "" },
|
|
362
408
|
error: { classes: "" }
|
|
363
|
-
} },
|
|
364
|
-
function
|
|
409
|
+
} }, we = { status: "done" };
|
|
410
|
+
function Te(e, t) {
|
|
365
411
|
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");
|
|
366
412
|
}
|
|
367
|
-
var
|
|
368
|
-
|
|
369
|
-
|
|
413
|
+
var Ee = /* @__PURE__ */ V("span", {
|
|
414
|
+
"aria-hidden": !0,
|
|
415
|
+
"data-caret": "",
|
|
416
|
+
className: "ml-2 inline-block h-16 w-2 rounded-pill bg-fg-tertiary align-text-bottom animate-pulse-quiet forced-line reduced:animate-none"
|
|
417
|
+
});
|
|
418
|
+
function De(e, t) {
|
|
419
|
+
let [n, r] = B(""), i = z(e);
|
|
420
|
+
return I(() => {
|
|
421
|
+
let n = i.current;
|
|
422
|
+
i.current = e, e === "pending" || e === "streaming" ? r("") : (n === "pending" || n === "streaming") && e !== "error" && r(t);
|
|
423
|
+
}, [e, t]), n;
|
|
424
|
+
}
|
|
425
|
+
var Oe = /* @__PURE__ */ P(function({ text: t = "", reasoning: r, status: i = "done", reasoningDuration: a, reasoningOpen: o, defaultReasoningOpen: s, onReasoningOpenChange: c, incompleteReason: l, error: u, onRetry: f, footer: p, "aria-label": m, className: h }, g) {
|
|
426
|
+
let _ = n(), v = m ?? _("responseView.response", "Response"), y = L(), b = i === "pending" || i === "streaming", x = t.trim() !== "", S = !!r && r.trim() !== "", C = b && S && !x, w = De(i, i === "stopped" ? _("responseView.endedStopped", "{label} stopped", { label: v }) : i === "incomplete" ? _("responseView.endedIncomplete", "{label}: {reason}", {
|
|
427
|
+
label: v,
|
|
428
|
+
reason: Te(_, l)
|
|
429
|
+
}) : _("responseView.endedDone", "{label} finished", { label: v })), T = f ? /* @__PURE__ */ V(d, {
|
|
430
|
+
size: "sm",
|
|
431
|
+
variant: "secondary",
|
|
432
|
+
onClick: f,
|
|
433
|
+
children: _("responseView.retry", "Retry")
|
|
434
|
+
}) : null;
|
|
435
|
+
return /* @__PURE__ */ H("article", {
|
|
370
436
|
ref: g,
|
|
371
437
|
"aria-label": v,
|
|
372
438
|
"aria-busy": b || void 0,
|
|
373
439
|
"aria-describedby": y,
|
|
374
440
|
className: e("flex min-w-0 flex-col gap-8", h),
|
|
375
441
|
children: [
|
|
376
|
-
S && /* @__PURE__ */
|
|
442
|
+
S && /* @__PURE__ */ V(Se, {
|
|
377
443
|
text: r,
|
|
378
444
|
live: C,
|
|
379
445
|
duration: a,
|
|
@@ -381,213 +447,215 @@ var Ce = /* @__PURE__ */ N(function({ text: t = "", reasoning: r, status: i = "d
|
|
|
381
447
|
defaultOpen: s,
|
|
382
448
|
onOpenChange: c
|
|
383
449
|
}),
|
|
384
|
-
x ? /* @__PURE__ */
|
|
450
|
+
x ? /* @__PURE__ */ V(N, {
|
|
385
451
|
text: t,
|
|
386
452
|
size: "lg",
|
|
387
453
|
streaming: b,
|
|
388
454
|
collapseAfter: 0,
|
|
389
455
|
wrapCode: !0,
|
|
390
|
-
|
|
391
|
-
|
|
456
|
+
trailing: i === "streaming" ? Ee : void 0,
|
|
457
|
+
className: "markdown-text-inset"
|
|
458
|
+
}) : b && !S ? /* @__PURE__ */ V("div", {
|
|
392
459
|
"aria-hidden": !0,
|
|
393
|
-
|
|
460
|
+
"data-pending": "",
|
|
461
|
+
className: "flex h-22 items-center px-12",
|
|
462
|
+
children: /* @__PURE__ */ V("span", { className: "h-16 w-2 rounded-pill bg-fg-tertiary animate-pulse-quiet forced-line reduced:animate-none" })
|
|
394
463
|
}) : null,
|
|
395
|
-
i === "stopped" && /* @__PURE__ */
|
|
396
|
-
className: "flex min-h-
|
|
397
|
-
children: [/* @__PURE__ */
|
|
398
|
-
className: "text-small text-fg-tertiary",
|
|
399
|
-
children: x ? _("responseView.stopped", "Stopped") : _("responseView.stoppedBeforeResponse", "Stopped before a response")
|
|
400
|
-
}), f && /* @__PURE__ */ B(u, {
|
|
401
|
-
size: "xs",
|
|
402
|
-
variant: "ghost",
|
|
403
|
-
onClick: f,
|
|
404
|
-
children: _("responseView.retry", "Retry")
|
|
405
|
-
})]
|
|
406
|
-
}),
|
|
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", {
|
|
464
|
+
(i === "stopped" || i === "incomplete") && /* @__PURE__ */ H("div", {
|
|
465
|
+
className: "flex min-h-32 flex-wrap items-center gap-x-12 gap-y-4 px-12",
|
|
466
|
+
children: [/* @__PURE__ */ V("span", {
|
|
410
467
|
className: "text-small text-fg-secondary",
|
|
411
|
-
children:
|
|
412
|
-
}),
|
|
413
|
-
size: "xs",
|
|
414
|
-
variant: "ghost",
|
|
415
|
-
onClick: f,
|
|
416
|
-
children: _("responseView.retry", "Retry")
|
|
417
|
-
})]
|
|
468
|
+
children: i === "incomplete" ? Te(_, l) : x ? _("responseView.stopped", "Stopped") : _("responseView.stoppedBeforeResponse", "Stopped before a response")
|
|
469
|
+
}), T]
|
|
418
470
|
}),
|
|
419
|
-
i === "error" && /* @__PURE__ */
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
471
|
+
i === "error" && /* @__PURE__ */ H("div", {
|
|
472
|
+
className: "flex flex-col items-start gap-8 px-12",
|
|
473
|
+
children: [/* @__PURE__ */ H("div", {
|
|
474
|
+
role: "alert",
|
|
475
|
+
className: "flex min-w-0 flex-col gap-4",
|
|
476
|
+
children: [/* @__PURE__ */ V("span", {
|
|
424
477
|
className: "text-small font-medium text-fg",
|
|
425
|
-
children: x ? _("responseView.
|
|
426
|
-
}),
|
|
427
|
-
|
|
428
|
-
text: d,
|
|
478
|
+
children: x ? _("responseView.failedPartway", "The response failed partway") : _("responseView.noResponse", "No response")
|
|
479
|
+
}), u && /* @__PURE__ */ V(N, {
|
|
480
|
+
text: u,
|
|
429
481
|
size: "small",
|
|
430
482
|
tone: "secondary",
|
|
431
483
|
className: "max-w-prose min-w-0"
|
|
432
|
-
})
|
|
433
|
-
|
|
434
|
-
size: "xs",
|
|
435
|
-
variant: "secondary",
|
|
436
|
-
onClick: f,
|
|
437
|
-
className: "mt-4",
|
|
438
|
-
children: _("responseView.retry", "Retry")
|
|
439
|
-
})
|
|
440
|
-
]
|
|
484
|
+
})]
|
|
485
|
+
}), T]
|
|
441
486
|
}),
|
|
442
|
-
i === "done" && !x && /* @__PURE__ */
|
|
487
|
+
i === "done" && !x && /* @__PURE__ */ V("span", {
|
|
443
488
|
className: "px-12 text-small text-fg-tertiary",
|
|
444
489
|
children: _("responseView.noText", "The model returned no text")
|
|
445
490
|
}),
|
|
446
|
-
p,
|
|
447
|
-
|
|
491
|
+
p != null && /* @__PURE__ */ V("div", {
|
|
492
|
+
className: "min-w-0 px-12",
|
|
493
|
+
children: p
|
|
494
|
+
}),
|
|
495
|
+
/* @__PURE__ */ V("span", {
|
|
448
496
|
id: y,
|
|
449
497
|
className: "sr-only",
|
|
450
498
|
children: i === "pending" ? _("responseView.waiting", "Waiting for the response") : i === "streaming" ? _("responseView.responding", "Responding") : ""
|
|
499
|
+
}),
|
|
500
|
+
/* @__PURE__ */ V("span", {
|
|
501
|
+
role: "status",
|
|
502
|
+
className: "sr-only",
|
|
503
|
+
children: w
|
|
451
504
|
})
|
|
452
505
|
]
|
|
453
506
|
});
|
|
454
507
|
});
|
|
455
|
-
process.env.NODE_ENV !== "production" && (
|
|
456
|
-
var
|
|
508
|
+
process.env.NODE_ENV !== "production" && (Oe.displayName = "ResponseView");
|
|
509
|
+
var ke = {
|
|
457
510
|
2: "line-clamp-2",
|
|
458
511
|
3: "line-clamp-3",
|
|
459
512
|
4: "line-clamp-4",
|
|
460
513
|
6: "line-clamp-6"
|
|
461
|
-
},
|
|
462
|
-
let s = n(), c = i ?? s("userMessage.prompt", "Prompt"),
|
|
463
|
-
return /* @__PURE__ */
|
|
514
|
+
}, Ae = /* @__PURE__ */ P(function({ children: t, maxLines: r = 4, "aria-label": i, className: a }, o) {
|
|
515
|
+
let s = n(), c = i ?? s("userMessage.prompt", "Prompt"), l = s("userMessage.showAll", "Show all"), f = s("userMessage.showLess", "Show less"), [p, m] = B(!1), h = L(), g = z(null), _ = u(g, r > 0 && !p);
|
|
516
|
+
return /* @__PURE__ */ H("div", {
|
|
464
517
|
ref: o,
|
|
465
518
|
role: "group",
|
|
466
519
|
"aria-label": c,
|
|
467
|
-
className: e("flex min-w-0 flex-col items-start gap-2
|
|
468
|
-
children: [/* @__PURE__ */
|
|
469
|
-
|
|
470
|
-
|
|
520
|
+
className: e("flex min-w-0 flex-col items-start gap-2", a),
|
|
521
|
+
children: [/* @__PURE__ */ V("p", {
|
|
522
|
+
id: h,
|
|
523
|
+
ref: g,
|
|
524
|
+
className: e("max-w-prose min-w-0 px-12 text-body font-medium whitespace-pre-wrap wrap-break-word text-fg-secondary", r !== 0 && !p && ke[r]),
|
|
471
525
|
children: t
|
|
472
|
-
}), (
|
|
473
|
-
size: "
|
|
474
|
-
variant: "
|
|
475
|
-
|
|
526
|
+
}), (_ || p) && /* @__PURE__ */ V(d, {
|
|
527
|
+
size: "sm",
|
|
528
|
+
variant: "quiet",
|
|
529
|
+
"aria-expanded": p,
|
|
530
|
+
"aria-controls": h,
|
|
531
|
+
reserveLabels: [l, f],
|
|
476
532
|
onClick: () => m((e) => !e),
|
|
477
|
-
|
|
478
|
-
children: p ? f : d
|
|
533
|
+
children: p ? f : l
|
|
479
534
|
})]
|
|
480
535
|
});
|
|
481
536
|
});
|
|
482
|
-
process.env.NODE_ENV !== "production" && (
|
|
483
|
-
var
|
|
484
|
-
return /* @__PURE__ */
|
|
537
|
+
process.env.NODE_ENV !== "production" && (Ae.displayName = "UserMessage");
|
|
538
|
+
var je = /* @__PURE__ */ P(function({ children: t, className: n }, r) {
|
|
539
|
+
return /* @__PURE__ */ V("div", {
|
|
485
540
|
ref: r,
|
|
486
541
|
className: e("flex min-w-0 flex-col gap-32", n),
|
|
487
542
|
children: t
|
|
488
543
|
});
|
|
489
544
|
});
|
|
490
|
-
process.env.NODE_ENV !== "production" && (
|
|
545
|
+
process.env.NODE_ENV !== "production" && (je.displayName = "Thread");
|
|
491
546
|
//#endregion
|
|
492
547
|
//#region src/components/playground/response-metrics.tsx
|
|
493
|
-
var
|
|
548
|
+
var Me = { size: {
|
|
494
549
|
sm: { classes: "text-caption gap-x-12 gap-y-2" },
|
|
495
550
|
md: { classes: "text-small gap-x-16 gap-y-4" }
|
|
496
|
-
} },
|
|
497
|
-
function
|
|
551
|
+
} }, Ne = { size: "sm" };
|
|
552
|
+
function Pe(e) {
|
|
498
553
|
return !Number.isFinite(e) || e < 0 ? "—" : a(e, { precise: !0 });
|
|
499
554
|
}
|
|
500
|
-
function
|
|
501
|
-
let [t, n] =
|
|
502
|
-
return
|
|
555
|
+
function Fe(e) {
|
|
556
|
+
let [t, n] = B(() => Date.now());
|
|
557
|
+
return I(() => {
|
|
503
558
|
if (e === void 0) return;
|
|
504
559
|
n(Date.now());
|
|
505
560
|
let t = setInterval(() => n(Date.now()), 100);
|
|
506
561
|
return () => clearInterval(t);
|
|
507
562
|
}, [e]), e === void 0 ? void 0 : Math.max(0, t - e);
|
|
508
563
|
}
|
|
509
|
-
function
|
|
510
|
-
return /[1-9]/.test(e) ? s(e
|
|
564
|
+
function Ie(e) {
|
|
565
|
+
return /[1-9]/.test(e) ? s(e) : c("0", { decimals: 0 });
|
|
511
566
|
}
|
|
512
567
|
function $(e) {
|
|
513
568
|
return typeof e == "number" && Number.isFinite(e);
|
|
514
569
|
}
|
|
515
|
-
function
|
|
516
|
-
return /* @__PURE__ */
|
|
570
|
+
function Le({ label: e, reserve: t, children: n }) {
|
|
571
|
+
return /* @__PURE__ */ H("div", {
|
|
517
572
|
className: "flex items-baseline gap-4 whitespace-nowrap",
|
|
518
|
-
children: [/* @__PURE__ */
|
|
573
|
+
children: [/* @__PURE__ */ V("dt", {
|
|
519
574
|
className: "text-fg-tertiary",
|
|
520
|
-
children:
|
|
521
|
-
}), /* @__PURE__ */
|
|
522
|
-
className:
|
|
523
|
-
children:
|
|
575
|
+
children: e
|
|
576
|
+
}), /* @__PURE__ */ H("dd", {
|
|
577
|
+
className: "inline-grid justify-items-start text-fg-secondary tabular",
|
|
578
|
+
children: [/* @__PURE__ */ V("span", {
|
|
579
|
+
className: "col-start-1 row-start-1",
|
|
580
|
+
children: n
|
|
581
|
+
}), /* @__PURE__ */ V("span", {
|
|
582
|
+
"aria-hidden": !0,
|
|
583
|
+
"data-reserve": t,
|
|
584
|
+
className: "invisible col-start-1 row-start-1 reserve-text"
|
|
585
|
+
})]
|
|
524
586
|
})]
|
|
525
587
|
});
|
|
526
588
|
}
|
|
527
|
-
var
|
|
528
|
-
let
|
|
529
|
-
if (!
|
|
530
|
-
ref:
|
|
531
|
-
"aria-label":
|
|
532
|
-
className: e(
|
|
589
|
+
var Re = /* @__PURE__ */ P(function({ timeToFirstToken: t, duration: r, inputTokens: i, outputTokens: c, reasoningTokens: l, reasoning: u, live: d = !1, startedAt: f, cost: p, size: m = "sm", className: h }, g) {
|
|
590
|
+
let _ = n(), v = Fe(d && f !== void 0 && !$(r) ? f : void 0), y = $(i) || $(c), b = p != null && p !== "", x = e("flex min-w-0 flex-wrap items-baseline", Me.size[m].classes, h);
|
|
591
|
+
if (!d && !y && !b && !$(t) && !$(r) && !$(l)) return /* @__PURE__ */ V("dl", {
|
|
592
|
+
ref: g,
|
|
593
|
+
"aria-label": _("responseMetrics.metrics", "Metrics"),
|
|
594
|
+
className: e(x, m === "sm" ? "min-h-16" : "min-h-18")
|
|
533
595
|
});
|
|
534
|
-
let
|
|
596
|
+
let S = (e) => d || e, C = /* @__PURE__ */ H("span", {
|
|
535
597
|
className: "text-fg-tertiary",
|
|
536
|
-
children: [/* @__PURE__ */
|
|
598
|
+
children: [/* @__PURE__ */ V("span", {
|
|
537
599
|
"aria-hidden": !0,
|
|
538
600
|
children: "—"
|
|
539
|
-
}), /* @__PURE__ */
|
|
601
|
+
}), /* @__PURE__ */ V("span", {
|
|
540
602
|
className: "sr-only",
|
|
541
|
-
children:
|
|
603
|
+
children: d ? _("responseMetrics.notYetKnown", "not yet known") : _("responseMetrics.notReported", "not reported")
|
|
542
604
|
})]
|
|
543
|
-
})
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
605
|
+
}), w = (e) => e < 1e4 ? _("format.seconds", "{s} s", { s: o(Math.floor(e / 100) / 10, {
|
|
606
|
+
minimumFractionDigits: 1,
|
|
607
|
+
maximumFractionDigits: 1
|
|
608
|
+
}) }) : e < 6e4 ? _("format.seconds", "{s} s", { s: o(Math.floor(e / 1e3)) }) : a(Math.floor(e / 1e3) * 1e3), T = Pe(8880);
|
|
609
|
+
return /* @__PURE__ */ H("dl", {
|
|
610
|
+
ref: g,
|
|
611
|
+
"aria-label": _("responseMetrics.metrics", "Metrics"),
|
|
612
|
+
className: x,
|
|
548
613
|
children: [
|
|
549
|
-
|
|
550
|
-
label:
|
|
551
|
-
|
|
552
|
-
children: $(t) ?
|
|
614
|
+
S($(t)) && /* @__PURE__ */ V(Le, {
|
|
615
|
+
label: _("responseMetrics.firstToken", "First token"),
|
|
616
|
+
reserve: T,
|
|
617
|
+
children: $(t) ? Pe(t) : C
|
|
553
618
|
}),
|
|
554
|
-
|
|
555
|
-
label:
|
|
556
|
-
|
|
557
|
-
children: $(r) ?
|
|
619
|
+
S($(r)) && /* @__PURE__ */ V(Le, {
|
|
620
|
+
label: _("responseMetrics.total", "Total"),
|
|
621
|
+
reserve: T,
|
|
622
|
+
children: $(r) ? Pe(r) : v === void 0 ? C : /* @__PURE__ */ V("span", {
|
|
558
623
|
className: "text-fg-tertiary",
|
|
559
|
-
children:
|
|
624
|
+
children: w(v)
|
|
560
625
|
})
|
|
561
626
|
}),
|
|
562
|
-
|
|
563
|
-
label:
|
|
564
|
-
|
|
565
|
-
|
|
627
|
+
S(y) && /* @__PURE__ */ V(Le, {
|
|
628
|
+
label: _("responseMetrics.tokens", "Tokens"),
|
|
629
|
+
reserve: _("responseMetrics.tokensValue", "{input} in · {output} out", {
|
|
630
|
+
input: o(8888),
|
|
631
|
+
output: o(888)
|
|
632
|
+
}),
|
|
633
|
+
children: y ? _("responseMetrics.tokensValue", "{input} in · {output} out", {
|
|
566
634
|
input: $(i) ? o(i) : "—",
|
|
567
|
-
output: $(
|
|
568
|
-
}) :
|
|
635
|
+
output: $(c) ? o(c) : "—"
|
|
636
|
+
}) : C
|
|
569
637
|
}),
|
|
570
|
-
($(
|
|
571
|
-
label:
|
|
572
|
-
|
|
573
|
-
children: $(
|
|
638
|
+
($(l) || u) && /* @__PURE__ */ V(Le, {
|
|
639
|
+
label: _("responseMetrics.reasoning", "Reasoning"),
|
|
640
|
+
reserve: o(888),
|
|
641
|
+
children: $(l) ? o(l) : C
|
|
574
642
|
}),
|
|
575
|
-
b
|
|
576
|
-
label:
|
|
577
|
-
|
|
578
|
-
children:
|
|
643
|
+
S(b) && /* @__PURE__ */ V(Le, {
|
|
644
|
+
label: _("responseMetrics.cost", "Cost"),
|
|
645
|
+
reserve: s("0.008888"),
|
|
646
|
+
children: b ? Ie(p) : C
|
|
579
647
|
})
|
|
580
648
|
]
|
|
581
649
|
});
|
|
582
650
|
});
|
|
583
|
-
process.env.NODE_ENV !== "production" && (
|
|
651
|
+
process.env.NODE_ENV !== "production" && (Re.displayName = "ResponseMetrics");
|
|
584
652
|
//#endregion
|
|
585
653
|
//#region src/components/playground/parameter-panel.tsx
|
|
586
|
-
var
|
|
654
|
+
var ze = { layout: {
|
|
587
655
|
popover: { classes: "w-full gap-20" },
|
|
588
656
|
panel: { classes: "w-full gap-24" }
|
|
589
|
-
} },
|
|
590
|
-
function
|
|
657
|
+
} }, Be = { layout: "popover" };
|
|
658
|
+
function Ve(e) {
|
|
591
659
|
return [
|
|
592
660
|
{
|
|
593
661
|
value: "none",
|
|
@@ -619,26 +687,25 @@ function Ie(e) {
|
|
|
619
687
|
}
|
|
620
688
|
];
|
|
621
689
|
}
|
|
622
|
-
function
|
|
623
|
-
let f =
|
|
690
|
+
function He({ label: t, value: r, unset: i, min: a, max: s, step: c, digits: l, disabled: u, onChange: d }) {
|
|
691
|
+
let f = n(), p = o(r, {
|
|
624
692
|
minimumFractionDigits: l,
|
|
625
693
|
maximumFractionDigits: l
|
|
626
694
|
});
|
|
627
|
-
return /* @__PURE__ */
|
|
695
|
+
return /* @__PURE__ */ H("div", {
|
|
628
696
|
className: "flex flex-col gap-8",
|
|
629
|
-
children: [/* @__PURE__ */
|
|
697
|
+
children: [/* @__PURE__ */ H("div", {
|
|
630
698
|
className: "flex items-baseline justify-between gap-12",
|
|
631
|
-
children: [/* @__PURE__ */
|
|
632
|
-
id: f,
|
|
699
|
+
children: [/* @__PURE__ */ V("span", {
|
|
633
700
|
className: e("text-body font-medium", u ? "text-fg-disabled" : "text-fg"),
|
|
634
701
|
children: t
|
|
635
|
-
}), /* @__PURE__ */
|
|
702
|
+
}), /* @__PURE__ */ V("span", {
|
|
636
703
|
className: e("text-small tabular", i ? "text-fg-tertiary" : "text-fg-secondary"),
|
|
637
|
-
children: i ?
|
|
704
|
+
children: i ? f("parameterPanel.valueDefault", "{value} (default)", { value: p }) : p
|
|
638
705
|
})]
|
|
639
|
-
}), /* @__PURE__ */
|
|
706
|
+
}), /* @__PURE__ */ V("div", {
|
|
640
707
|
className: "px-8",
|
|
641
|
-
children: /* @__PURE__ */
|
|
708
|
+
children: /* @__PURE__ */ V(v, {
|
|
642
709
|
"aria-label": t,
|
|
643
710
|
min: a,
|
|
644
711
|
max: s,
|
|
@@ -654,186 +721,206 @@ function Le({ label: t, value: r, unset: i, min: a, max: s, step: c, digits: l,
|
|
|
654
721
|
})]
|
|
655
722
|
});
|
|
656
723
|
}
|
|
657
|
-
var
|
|
658
|
-
let
|
|
724
|
+
var Ue = /* @__PURE__ */ P(function({ value: t, onValueChange: r, defaults: i, instructions: a = !0, sampling: s = !0, reasoning: c = !1, maxOutputTokensLimit: l, disabled: u = !1, layout: f = "popover", className: p }, m) {
|
|
725
|
+
let h = n(), v = (e) => r({
|
|
659
726
|
...t,
|
|
660
727
|
...e
|
|
661
|
-
}),
|
|
662
|
-
return /* @__PURE__ */
|
|
663
|
-
ref:
|
|
664
|
-
className: e("flex min-w-0 flex-col",
|
|
728
|
+
}), y = Ve(h), x = c === !0 ? y : Array.isArray(c) ? y.filter((e) => c.includes(e.value)) : [], C = t.temperature !== void 0 || t.topP !== void 0 || t.maxOutputTokens !== void 0 || t.reasoningEffort !== void 0 || t.reasoningSummary !== void 0;
|
|
729
|
+
return /* @__PURE__ */ H("div", {
|
|
730
|
+
ref: m,
|
|
731
|
+
className: e("flex min-w-0 flex-col", ze.layout[f].classes, p),
|
|
665
732
|
children: [
|
|
666
|
-
a && /* @__PURE__ */
|
|
667
|
-
label:
|
|
733
|
+
a && /* @__PURE__ */ V(_, {
|
|
734
|
+
label: h("parameterPanel.systemInstructions", "System instructions"),
|
|
668
735
|
rows: 3,
|
|
669
736
|
maxRows: 8,
|
|
670
|
-
placeholder:
|
|
737
|
+
placeholder: h("parameterPanel.instructionsPlaceholder", "You are a helpful assistant."),
|
|
671
738
|
value: t.instructions ?? "",
|
|
672
|
-
disabled:
|
|
673
|
-
onChange: (e) =>
|
|
739
|
+
disabled: u,
|
|
740
|
+
onChange: (e) => v({ instructions: e.target.value === "" ? void 0 : e.target.value })
|
|
674
741
|
}),
|
|
675
|
-
|
|
676
|
-
label:
|
|
742
|
+
s && /* @__PURE__ */ H(se, { children: [/* @__PURE__ */ V(He, {
|
|
743
|
+
label: h("parameterPanel.temperature", "Temperature"),
|
|
677
744
|
value: t.temperature ?? i?.temperature ?? 1,
|
|
678
745
|
unset: t.temperature === void 0,
|
|
679
746
|
min: 0,
|
|
680
747
|
max: 2,
|
|
681
748
|
step: .05,
|
|
682
749
|
digits: 2,
|
|
683
|
-
disabled:
|
|
684
|
-
onChange: (e) =>
|
|
685
|
-
}), /* @__PURE__ */
|
|
686
|
-
label:
|
|
750
|
+
disabled: u,
|
|
751
|
+
onChange: (e) => v({ temperature: e })
|
|
752
|
+
}), /* @__PURE__ */ V(He, {
|
|
753
|
+
label: h("parameterPanel.topP", "Top P"),
|
|
687
754
|
value: t.topP ?? i?.topP ?? 1,
|
|
688
755
|
unset: t.topP === void 0,
|
|
689
756
|
min: 0,
|
|
690
757
|
max: 1,
|
|
691
758
|
step: .01,
|
|
692
759
|
digits: 2,
|
|
693
|
-
disabled:
|
|
694
|
-
onChange: (e) =>
|
|
760
|
+
disabled: u,
|
|
761
|
+
onChange: (e) => v({ topP: e })
|
|
695
762
|
})] }),
|
|
696
|
-
/* @__PURE__ */
|
|
697
|
-
label:
|
|
763
|
+
/* @__PURE__ */ V(g, {
|
|
764
|
+
label: h("parameterPanel.maxOutputTokens", "Max output tokens"),
|
|
698
765
|
size: "sm",
|
|
699
|
-
placeholder:
|
|
766
|
+
placeholder: h("parameterPanel.modelDefault", "Model default"),
|
|
700
767
|
align: "start",
|
|
701
768
|
min: "1",
|
|
702
|
-
...
|
|
769
|
+
...l ? {
|
|
770
|
+
max: String(l),
|
|
771
|
+
description: h("parameterPanel.maxOutputTokensLimit", "Up to {max} for this model", { max: o(l) })
|
|
772
|
+
} : {},
|
|
703
773
|
step: "256",
|
|
704
774
|
value: t.maxOutputTokens === void 0 ? "" : String(t.maxOutputTokens),
|
|
705
|
-
disabled:
|
|
775
|
+
disabled: u,
|
|
706
776
|
onValueChange: (e) => {
|
|
707
777
|
let t = Number(e);
|
|
708
|
-
|
|
778
|
+
v({ maxOutputTokens: e.trim() === "" || !Number.isFinite(t) || t <= 0 ? void 0 : Math.round(t) });
|
|
709
779
|
}
|
|
710
780
|
}),
|
|
711
|
-
|
|
712
|
-
label:
|
|
781
|
+
x.length > 0 && /* @__PURE__ */ H(se, { children: [/* @__PURE__ */ V(S, {
|
|
782
|
+
label: h("parameterPanel.reasoningEffort", "Reasoning effort"),
|
|
713
783
|
size: "sm",
|
|
714
784
|
fullWidth: !0,
|
|
715
|
-
disabled:
|
|
785
|
+
disabled: u,
|
|
716
786
|
value: t.reasoningEffort ?? "default",
|
|
717
787
|
options: [{
|
|
718
788
|
value: "default",
|
|
719
|
-
label:
|
|
720
|
-
}, ...
|
|
721
|
-
onValueChange: (e) =>
|
|
722
|
-
}), /* @__PURE__ */
|
|
789
|
+
label: h("parameterPanel.modelDefault", "Model default")
|
|
790
|
+
}, ...x],
|
|
791
|
+
onValueChange: (e) => v({ reasoningEffort: e === "default" ? void 0 : e })
|
|
792
|
+
}), /* @__PURE__ */ H("div", {
|
|
723
793
|
className: "flex flex-col gap-8",
|
|
724
|
-
children: [/* @__PURE__ */
|
|
725
|
-
className: e("text-body font-medium",
|
|
726
|
-
children:
|
|
727
|
-
}), /* @__PURE__ */
|
|
728
|
-
"aria-label":
|
|
794
|
+
children: [/* @__PURE__ */ V("span", {
|
|
795
|
+
className: e("text-body font-medium", u ? "text-fg-disabled" : "text-fg"),
|
|
796
|
+
children: h("parameterPanel.reasoningSummary", "Reasoning summary")
|
|
797
|
+
}), /* @__PURE__ */ V(b, {
|
|
798
|
+
"aria-label": h("parameterPanel.reasoningSummary", "Reasoning summary"),
|
|
729
799
|
size: "sm",
|
|
730
800
|
fullWidth: !0,
|
|
731
|
-
disabled:
|
|
801
|
+
disabled: u,
|
|
732
802
|
value: t.reasoningSummary ?? "auto",
|
|
733
803
|
options: [
|
|
734
804
|
{
|
|
735
805
|
value: "auto",
|
|
736
|
-
label:
|
|
806
|
+
label: h("parameterPanel.summaryAuto", "Auto")
|
|
737
807
|
},
|
|
738
808
|
{
|
|
739
809
|
value: "concise",
|
|
740
|
-
label:
|
|
810
|
+
label: h("parameterPanel.summaryConcise", "Concise")
|
|
741
811
|
},
|
|
742
812
|
{
|
|
743
813
|
value: "detailed",
|
|
744
|
-
label:
|
|
814
|
+
label: h("parameterPanel.summaryDetailed", "Detailed")
|
|
745
815
|
},
|
|
746
816
|
{
|
|
747
817
|
value: "off",
|
|
748
|
-
label:
|
|
818
|
+
label: h("parameterPanel.summaryOff", "Off")
|
|
749
819
|
}
|
|
750
820
|
],
|
|
751
|
-
onValueChange: (e) =>
|
|
821
|
+
onValueChange: (e) => v({ reasoningSummary: e === "auto" ? void 0 : e })
|
|
752
822
|
})]
|
|
753
823
|
})] }),
|
|
754
|
-
/* @__PURE__ */
|
|
824
|
+
/* @__PURE__ */ V("div", {
|
|
755
825
|
className: "flex justify-end",
|
|
756
|
-
children: /* @__PURE__ */
|
|
826
|
+
children: /* @__PURE__ */ V(d, {
|
|
757
827
|
size: "sm",
|
|
758
828
|
variant: "ghost",
|
|
759
|
-
disabled:
|
|
829
|
+
disabled: u || !C,
|
|
760
830
|
onClick: () => r(t.instructions === void 0 ? {} : { instructions: t.instructions }),
|
|
761
|
-
children:
|
|
831
|
+
children: h("parameterPanel.resetToDefaults", "Reset to defaults")
|
|
762
832
|
})
|
|
763
833
|
})
|
|
764
834
|
]
|
|
765
835
|
});
|
|
766
836
|
});
|
|
767
|
-
process.env.NODE_ENV !== "production" && (
|
|
768
|
-
var
|
|
769
|
-
let u = n(),
|
|
770
|
-
return /* @__PURE__ */
|
|
837
|
+
process.env.NODE_ENV !== "production" && (Ue.displayName = "ParameterPanel");
|
|
838
|
+
var We = /* @__PURE__ */ P(function({ trigger: e, title: t, open: r, defaultOpen: i, onOpenChange: a, side: o = "bottom", align: s = "end", ...c }, l) {
|
|
839
|
+
let u = n(), d = t ?? u("parameterPopover.parameters", "Parameters");
|
|
840
|
+
return /* @__PURE__ */ H(C, {
|
|
771
841
|
trapFocus: !0,
|
|
772
842
|
...r === void 0 ? {} : { open: r },
|
|
773
843
|
...i === void 0 ? {} : { defaultOpen: i },
|
|
774
844
|
...a ? { onOpenChange: a } : {},
|
|
775
|
-
children: [/* @__PURE__ */
|
|
776
|
-
icon:
|
|
777
|
-
"aria-label":
|
|
845
|
+
children: [/* @__PURE__ */ V(C.Trigger, { children: e ?? /* @__PURE__ */ V(f, {
|
|
846
|
+
icon: ce,
|
|
847
|
+
"aria-label": d,
|
|
778
848
|
size: "sm"
|
|
779
|
-
}) }), /* @__PURE__ */
|
|
849
|
+
}) }), /* @__PURE__ */ V(C.Content, {
|
|
780
850
|
ref: l,
|
|
781
|
-
|
|
851
|
+
"aria-label": d,
|
|
782
852
|
side: o,
|
|
783
853
|
align: s,
|
|
784
854
|
className: "w-320 max-w-(--available-width)",
|
|
785
|
-
children: /* @__PURE__ */
|
|
855
|
+
children: /* @__PURE__ */ H("div", {
|
|
856
|
+
className: "relative",
|
|
857
|
+
children: [
|
|
858
|
+
/* @__PURE__ */ V("p", {
|
|
859
|
+
className: "mb-16 flex min-h-32 items-center pr-40 text-body font-semibold text-fg",
|
|
860
|
+
children: d
|
|
861
|
+
}),
|
|
862
|
+
/* @__PURE__ */ V(Ue, { ...c }),
|
|
863
|
+
/* @__PURE__ */ V("div", {
|
|
864
|
+
className: "absolute top-0 right-0",
|
|
865
|
+
children: /* @__PURE__ */ V(C.Close, { children: /* @__PURE__ */ V(f, {
|
|
866
|
+
icon: K,
|
|
867
|
+
"aria-label": u("parameterPopover.close", "Close parameters"),
|
|
868
|
+
size: "sm"
|
|
869
|
+
}) })
|
|
870
|
+
})
|
|
871
|
+
]
|
|
872
|
+
})
|
|
786
873
|
})]
|
|
787
874
|
});
|
|
788
875
|
});
|
|
789
|
-
process.env.NODE_ENV !== "production" && (
|
|
876
|
+
process.env.NODE_ENV !== "production" && (We.displayName = "ParameterPopover");
|
|
790
877
|
//#endregion
|
|
791
878
|
//#region src/components/playground/model-picker.tsx
|
|
792
|
-
var
|
|
879
|
+
var Ge = {
|
|
793
880
|
ghost: "header",
|
|
794
881
|
default: "default"
|
|
795
|
-
},
|
|
796
|
-
ghost: { classes:
|
|
797
|
-
default: { classes:
|
|
798
|
-
} },
|
|
799
|
-
function
|
|
882
|
+
}, Ke = { appearance: {
|
|
883
|
+
ghost: { classes: x.appearance.header.classes },
|
|
884
|
+
default: { classes: x.appearance.default.classes }
|
|
885
|
+
} }, qe = { appearance: "ghost" }, Je = "", Ye = "*";
|
|
886
|
+
function Xe({ option: t, query: n, providerLabel: r }) {
|
|
800
887
|
let a = t.model ?? t.value, o = [t.context ? i(t.context) : "", t.price ?? ""].filter(Boolean).join(" · ");
|
|
801
|
-
return /* @__PURE__ */
|
|
802
|
-
r !== void 0 && /* @__PURE__ */
|
|
888
|
+
return /* @__PURE__ */ H(se, { children: [
|
|
889
|
+
r !== void 0 && /* @__PURE__ */ V("span", {
|
|
803
890
|
"aria-hidden": !0,
|
|
804
891
|
className: "flex",
|
|
805
|
-
children: /* @__PURE__ */
|
|
892
|
+
children: /* @__PURE__ */ V(O, {
|
|
806
893
|
provider: t.provider,
|
|
807
894
|
name: r
|
|
808
895
|
})
|
|
809
896
|
}),
|
|
810
|
-
/* @__PURE__ */
|
|
897
|
+
/* @__PURE__ */ H("span", {
|
|
811
898
|
className: "flex min-w-0 flex-1 items-baseline gap-8",
|
|
812
|
-
children: [/* @__PURE__ */
|
|
899
|
+
children: [/* @__PURE__ */ V("span", {
|
|
813
900
|
className: "min-w-0 shrink truncate",
|
|
814
|
-
children: /* @__PURE__ */
|
|
901
|
+
children: /* @__PURE__ */ V(w, {
|
|
815
902
|
text: t.name ?? a,
|
|
816
903
|
query: n
|
|
817
904
|
})
|
|
818
|
-
}), t.name && t.name !== a && /* @__PURE__ */
|
|
905
|
+
}), t.name && t.name !== a && /* @__PURE__ */ V("span", {
|
|
819
906
|
className: "min-w-0 flex-1 truncate mono text-small font-regular text-fg-tertiary",
|
|
820
|
-
children: /* @__PURE__ */
|
|
907
|
+
children: /* @__PURE__ */ V(w, {
|
|
821
908
|
text: a,
|
|
822
909
|
query: n
|
|
823
910
|
})
|
|
824
911
|
})]
|
|
825
912
|
}),
|
|
826
|
-
t.capabilities && t.capabilities.length > 0 && /* @__PURE__ */
|
|
913
|
+
t.capabilities && t.capabilities.length > 0 && /* @__PURE__ */ V(j, {
|
|
827
914
|
capabilities: t.capabilities,
|
|
828
915
|
className: "hidden sm:flex"
|
|
829
916
|
}),
|
|
830
|
-
(t.note ?? o) && /* @__PURE__ */
|
|
917
|
+
(t.note ?? o) && /* @__PURE__ */ V("span", {
|
|
831
918
|
className: e("shrink-0 text-caption font-regular tabular", t.note ? "text-fg-secondary" : "hidden text-fg-tertiary sm:inline"),
|
|
832
919
|
children: t.note ?? o
|
|
833
920
|
})
|
|
834
921
|
] });
|
|
835
922
|
}
|
|
836
|
-
function
|
|
923
|
+
function Ze(e, t, n) {
|
|
837
924
|
let r = e.model ?? e.value, i = t(e.provider);
|
|
838
925
|
return {
|
|
839
926
|
value: e.value,
|
|
@@ -843,7 +930,7 @@ function Ke(e, t, n) {
|
|
|
843
930
|
i,
|
|
844
931
|
e.provider
|
|
845
932
|
],
|
|
846
|
-
render: ({ query: t }) => /* @__PURE__ */
|
|
933
|
+
render: ({ query: t }) => /* @__PURE__ */ V(Xe, {
|
|
847
934
|
option: e,
|
|
848
935
|
query: t,
|
|
849
936
|
...n ? { providerLabel: i } : {}
|
|
@@ -851,34 +938,34 @@ function Ke(e, t, n) {
|
|
|
851
938
|
...e.disabled ? { disabled: !0 } : {}
|
|
852
939
|
};
|
|
853
940
|
}
|
|
854
|
-
function
|
|
941
|
+
function Qe(e, t, n, r) {
|
|
855
942
|
return n ? t.flatMap((t) => {
|
|
856
943
|
let n = e.filter((e) => e.provider === t);
|
|
857
944
|
return n.length ? [{
|
|
858
945
|
id: `provider:${t}`,
|
|
859
946
|
label: r(t),
|
|
860
|
-
leading: /* @__PURE__ */
|
|
947
|
+
leading: /* @__PURE__ */ V("span", {
|
|
861
948
|
"aria-hidden": !0,
|
|
862
949
|
className: "flex",
|
|
863
|
-
children: /* @__PURE__ */
|
|
950
|
+
children: /* @__PURE__ */ V(O, {
|
|
864
951
|
provider: t,
|
|
865
952
|
name: r(t),
|
|
866
953
|
size: "sm"
|
|
867
954
|
})
|
|
868
955
|
}),
|
|
869
956
|
count: n.length,
|
|
870
|
-
items: n.map((e) =>
|
|
957
|
+
items: n.map((e) => Ze(e, r, !1))
|
|
871
958
|
}] : [];
|
|
872
959
|
}) : [{
|
|
873
960
|
id: "models",
|
|
874
|
-
items: e.map((e) =>
|
|
961
|
+
items: e.map((e) => Ze(e, r, !0))
|
|
875
962
|
}];
|
|
876
963
|
}
|
|
877
|
-
function
|
|
878
|
-
let n = r(), i =
|
|
964
|
+
function $e(e, t) {
|
|
965
|
+
let n = r(), i = R(() => new Map(t.map((e) => [e.id, e])), [t]), a = F((e) => k(e, i.get(e)?.name), [i]);
|
|
879
966
|
return {
|
|
880
967
|
nameOf: a,
|
|
881
|
-
providerOrder:
|
|
968
|
+
providerOrder: R(() => [...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" })), [
|
|
882
969
|
e,
|
|
883
970
|
i,
|
|
884
971
|
a,
|
|
@@ -886,202 +973,230 @@ function Je(e, t) {
|
|
|
886
973
|
])
|
|
887
974
|
};
|
|
888
975
|
}
|
|
889
|
-
function
|
|
890
|
-
let { nameOf: r, providerOrder: i } =
|
|
891
|
-
return
|
|
976
|
+
function et(e, { providers: t = [], groupByProvider: n } = {}) {
|
|
977
|
+
let { nameOf: r, providerOrder: i } = $e(e, t), a = n ?? i.length > 1;
|
|
978
|
+
return R(() => Qe(e, i, a, r), [
|
|
892
979
|
e,
|
|
893
980
|
i,
|
|
894
981
|
a,
|
|
895
982
|
r
|
|
896
983
|
]);
|
|
897
984
|
}
|
|
898
|
-
var
|
|
899
|
-
let { options: i, providers: a = [], recent: s = [], groupByProvider: c, placeholder: l, "aria-label": u, appearance: d = "ghost", size:
|
|
900
|
-
b === void 0 && I(e),
|
|
901
|
-
}, [
|
|
902
|
-
|
|
903
|
-
let
|
|
904
|
-
let e = new Set(
|
|
905
|
-
|
|
985
|
+
var tt = /* @__PURE__ */ P(function(t, r) {
|
|
986
|
+
let { options: i, providers: a = [], recent: s = [], groupByProvider: c, placeholder: l, "aria-label": u, appearance: d = "ghost", size: f = "sm", fullWidth: g, disabled: _, invalid: v, open: b, onOpenChange: x, "data-force": C, className: w, label: k, description: j, error: M, optional: N, required: te, layout: ne } = t, P = n(), re = p(), F = m(t), [ie, I] = B(!1), L = b ?? ie, ae = (e) => {
|
|
987
|
+
b === void 0 && I(e), x?.(e);
|
|
988
|
+
}, [z, oe] = B(() => t.defaultValue ?? (t.multiple ? [] : null)), U = t.value === void 0 ? z : t.value, W = Array.isArray(U) ? U : U ? [U] : [], G = t.multiple ? void 0 : t.allLabel, [K, ce] = B(""), [q, le] = B(null), [J, ue] = B(!1), [de, fe] = B(L);
|
|
989
|
+
L !== de && (fe(L), L && (ce(""), le(null)));
|
|
990
|
+
let Y = R(() => new Map(i.map((e) => [e.value, e])), [i]), { nameOf: X, providerOrder: Z } = $e(i, a), pe = c ?? Z.length > 1, me = i.some((e) => e.deprecated && !W.includes(e.value)), he = W.join("\0"), ge = R(() => {
|
|
991
|
+
let e = new Set(he.split("\0")), t = (t) => (J || !t.deprecated || e.has(t.value)) && (!q || t.provider === q), n = [];
|
|
992
|
+
G && !q && n.push({
|
|
906
993
|
id: "all",
|
|
907
994
|
items: [{
|
|
908
|
-
value:
|
|
909
|
-
label:
|
|
995
|
+
value: Je,
|
|
996
|
+
label: G
|
|
910
997
|
}]
|
|
911
998
|
});
|
|
912
|
-
let r =
|
|
999
|
+
let r = K.trim() || q ? [] : s.flatMap((e) => Y.get(e) && t(Y.get(e)) ? [Ze(Y.get(e), X, !0)] : []);
|
|
913
1000
|
return r.length && n.push({
|
|
914
1001
|
id: "recent",
|
|
915
1002
|
label: P("modelPicker.recent", "Recent"),
|
|
916
1003
|
items: r
|
|
917
|
-
}), [...n, ...
|
|
1004
|
+
}), [...n, ...Qe(i.filter(t), Z, pe, X)];
|
|
918
1005
|
}, [
|
|
919
1006
|
i,
|
|
920
|
-
|
|
921
|
-
|
|
1007
|
+
Z,
|
|
1008
|
+
pe,
|
|
922
1009
|
s,
|
|
923
|
-
|
|
924
|
-
G,
|
|
1010
|
+
Y,
|
|
925
1011
|
K,
|
|
926
1012
|
q,
|
|
927
|
-
|
|
928
|
-
|
|
1013
|
+
J,
|
|
1014
|
+
he,
|
|
1015
|
+
G,
|
|
929
1016
|
P,
|
|
930
|
-
|
|
1017
|
+
X
|
|
931
1018
|
]), _e = (e) => {
|
|
932
1019
|
if (t.multiple) {
|
|
933
|
-
let n =
|
|
934
|
-
t.value === void 0 &&
|
|
935
|
-
} else t.value === void 0 &&
|
|
936
|
-
}, ve =
|
|
937
|
-
let e =
|
|
1020
|
+
let n = W.includes(e) ? W.filter((t) => t !== e) : [...W, e];
|
|
1021
|
+
t.value === void 0 && oe(n), t.onValueChange?.(n);
|
|
1022
|
+
} else t.value === void 0 && oe(e === Je ? null : e), t.onValueChange?.(e), ae(!1);
|
|
1023
|
+
}, ve = R(() => {
|
|
1024
|
+
let e = K.trim(), t = new Set(he.split("\0")), n = /* @__PURE__ */ new Map();
|
|
938
1025
|
for (let r of i) {
|
|
939
|
-
if (r.deprecated && !
|
|
1026
|
+
if (r.deprecated && !J && !t.has(r.value)) continue;
|
|
940
1027
|
let i = r.model ?? r.value;
|
|
941
|
-
e &&
|
|
1028
|
+
e && T(e, [
|
|
942
1029
|
r.name ?? i,
|
|
943
1030
|
i,
|
|
944
|
-
|
|
1031
|
+
X(r.provider),
|
|
945
1032
|
r.provider
|
|
946
1033
|
]) <= 0 || n.set(r.provider, (n.get(r.provider) ?? 0) + 1);
|
|
947
1034
|
}
|
|
948
|
-
return
|
|
1035
|
+
return Z.filter((e) => n.has(e) || e === q).map((e) => ({
|
|
949
1036
|
id: e,
|
|
950
1037
|
count: n.get(e) ?? 0
|
|
951
1038
|
}));
|
|
952
1039
|
}, [
|
|
953
1040
|
i,
|
|
954
|
-
X,
|
|
955
|
-
G,
|
|
956
|
-
q,
|
|
957
1041
|
Z,
|
|
958
1042
|
K,
|
|
959
|
-
|
|
960
|
-
|
|
1043
|
+
J,
|
|
1044
|
+
he,
|
|
1045
|
+
q,
|
|
1046
|
+
X
|
|
1047
|
+
]), ye = pe && Z.length > 1 ? /* @__PURE__ */ V(S, {
|
|
961
1048
|
"aria-label": P("modelPicker.provider", "Provider"),
|
|
962
1049
|
size: "sm",
|
|
963
1050
|
appearance: "ghost",
|
|
964
|
-
value:
|
|
965
|
-
onValueChange: (e) =>
|
|
1051
|
+
value: q ?? Ye,
|
|
1052
|
+
onValueChange: (e) => le(e === Ye ? null : e),
|
|
966
1053
|
options: [{
|
|
967
|
-
value:
|
|
1054
|
+
value: Ye,
|
|
968
1055
|
label: P("modelPicker.everyProvider", "All providers")
|
|
969
1056
|
}, ...ve.map(({ id: e, count: t }) => ({
|
|
970
1057
|
value: e,
|
|
971
|
-
textValue:
|
|
972
|
-
label: /* @__PURE__ */
|
|
1058
|
+
textValue: X(e),
|
|
1059
|
+
label: /* @__PURE__ */ H("span", {
|
|
973
1060
|
className: "flex min-w-0 items-center gap-8",
|
|
974
1061
|
children: [
|
|
975
|
-
/* @__PURE__ */
|
|
1062
|
+
/* @__PURE__ */ V("span", {
|
|
976
1063
|
"aria-hidden": !0,
|
|
977
1064
|
className: "flex shrink-0",
|
|
978
|
-
children: /* @__PURE__ */
|
|
1065
|
+
children: /* @__PURE__ */ V(O, {
|
|
979
1066
|
provider: e,
|
|
980
1067
|
size: "sm"
|
|
981
1068
|
})
|
|
982
1069
|
}),
|
|
983
|
-
/* @__PURE__ */
|
|
1070
|
+
/* @__PURE__ */ V("span", {
|
|
984
1071
|
className: "min-w-0 truncate",
|
|
985
|
-
children:
|
|
1072
|
+
children: X(e)
|
|
986
1073
|
}),
|
|
987
|
-
/* @__PURE__ */
|
|
1074
|
+
/* @__PURE__ */ V("span", {
|
|
988
1075
|
className: "shrink-0 text-fg-tertiary tabular",
|
|
989
1076
|
children: o(t)
|
|
990
1077
|
})
|
|
991
1078
|
]
|
|
992
1079
|
})
|
|
993
1080
|
}))]
|
|
994
|
-
}) : null, be = ye ||
|
|
1081
|
+
}) : null, be = ye || me ? /* @__PURE__ */ H(se, { children: [ye, me && /* @__PURE__ */ V(y, {
|
|
995
1082
|
size: "sm",
|
|
996
|
-
label: P("modelPicker.showDeprecated", "
|
|
997
|
-
checked:
|
|
998
|
-
onCheckedChange:
|
|
999
|
-
})] }) : void 0, Q =
|
|
1083
|
+
label: P("modelPicker.showDeprecated", "Show deprecated"),
|
|
1084
|
+
checked: J,
|
|
1085
|
+
onCheckedChange: ue
|
|
1086
|
+
})] }) : void 0, Q = W[0] ? Y.get(W[0]) : void 0, xe = t.multiple ? Q ? W.length === 1 ? /* @__PURE__ */ V(A, {
|
|
1000
1087
|
provider: Q.provider,
|
|
1001
|
-
providerName:
|
|
1088
|
+
providerName: X(Q.provider),
|
|
1002
1089
|
model: Q.model ?? Q.value,
|
|
1003
1090
|
...Q.name ? { name: Q.name } : {}
|
|
1004
|
-
}) :
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1091
|
+
}) : /* @__PURE__ */ H("span", {
|
|
1092
|
+
className: "flex min-w-0 items-center",
|
|
1093
|
+
children: [
|
|
1094
|
+
/* @__PURE__ */ V("span", {
|
|
1095
|
+
className: "min-w-0 truncate",
|
|
1096
|
+
children: Q.name ?? Q.model ?? Q.value
|
|
1097
|
+
}),
|
|
1098
|
+
" ",
|
|
1099
|
+
/* @__PURE__ */ V("span", {
|
|
1100
|
+
className: "shrink-0 pl-4 tabular",
|
|
1101
|
+
children: P("select.more", "+{count}", { count: String(W.length - 1) })
|
|
1102
|
+
})
|
|
1103
|
+
]
|
|
1104
|
+
}) : void 0 : Q ? /* @__PURE__ */ V(A, {
|
|
1008
1105
|
provider: Q.provider,
|
|
1009
|
-
providerName:
|
|
1106
|
+
providerName: X(Q.provider),
|
|
1010
1107
|
model: Q.model ?? Q.value,
|
|
1011
1108
|
...Q.name ? { name: Q.name } : {}
|
|
1012
|
-
}) :
|
|
1109
|
+
}) : U === Je || U === null && G ? G : void 0, Se = u ?? (typeof k == "string" ? k : P("modelPicker.model", "Model")), Ce = /* @__PURE__ */ V(D, {
|
|
1013
1110
|
title: Se,
|
|
1014
1111
|
width: "lg",
|
|
1015
|
-
open:
|
|
1112
|
+
open: L,
|
|
1016
1113
|
onOpenChange: ae,
|
|
1017
|
-
trigger: /* @__PURE__ */
|
|
1114
|
+
trigger: /* @__PURE__ */ V(ee, {
|
|
1018
1115
|
ref: r,
|
|
1019
|
-
appearance:
|
|
1020
|
-
size:
|
|
1116
|
+
appearance: Ge[d],
|
|
1117
|
+
size: f,
|
|
1021
1118
|
...F.controlProps,
|
|
1022
|
-
...u || !
|
|
1119
|
+
...u || !k ? { "aria-label": Se } : {},
|
|
1023
1120
|
..._ ? { disabled: _ } : {},
|
|
1024
|
-
...
|
|
1121
|
+
...v ? { invalid: v } : {},
|
|
1025
1122
|
...g ? { fullWidth: g } : {},
|
|
1026
1123
|
...C ? { "data-force": C } : {},
|
|
1124
|
+
...Q && !t.multiple ? { title: Q.name && Q.name !== (Q.model ?? Q.value) ? `${Q.name} · ${Q.model ?? Q.value}` : Q.model ?? Q.value } : {},
|
|
1027
1125
|
placeholder: l ?? (t.multiple ? P("modelPicker.chooseSome", "Choose models") : P("modelPicker.choose", "Choose a model")),
|
|
1028
|
-
className: e("max-w-full", !(
|
|
1126
|
+
className: e("max-w-full", !(k || j || M) && w),
|
|
1029
1127
|
children: xe
|
|
1030
1128
|
}),
|
|
1031
|
-
children: /* @__PURE__ */
|
|
1129
|
+
children: /* @__PURE__ */ V(E, {
|
|
1032
1130
|
groups: ge,
|
|
1033
1131
|
"aria-label": Se,
|
|
1034
|
-
value: t.multiple ?
|
|
1132
|
+
value: t.multiple ? W : W[0] ?? (G ? Je : null),
|
|
1035
1133
|
...t.multiple ? { multiple: !0 } : {},
|
|
1036
1134
|
onSelect: _e,
|
|
1037
|
-
query:
|
|
1038
|
-
onQueryChange:
|
|
1135
|
+
query: K,
|
|
1136
|
+
onQueryChange: ce,
|
|
1039
1137
|
placeholder: P("modelPicker.search", "Search models"),
|
|
1040
1138
|
emptyText: P("modelPicker.noMatch", "No models match"),
|
|
1041
1139
|
toolbar: be,
|
|
1042
1140
|
autoFocus: !0
|
|
1043
1141
|
})
|
|
1044
1142
|
});
|
|
1045
|
-
return re ? Ce :
|
|
1046
|
-
label:
|
|
1143
|
+
return re ? Ce : h({
|
|
1144
|
+
label: k,
|
|
1047
1145
|
description: j,
|
|
1048
1146
|
error: M,
|
|
1049
|
-
optional:
|
|
1050
|
-
required:
|
|
1147
|
+
optional: N,
|
|
1148
|
+
required: te,
|
|
1051
1149
|
layout: ne,
|
|
1052
1150
|
id: F.wrapId,
|
|
1053
1151
|
disabled: _,
|
|
1054
|
-
className:
|
|
1152
|
+
className: w
|
|
1055
1153
|
}, Ce);
|
|
1056
1154
|
});
|
|
1057
|
-
process.env.NODE_ENV !== "production" && (
|
|
1155
|
+
process.env.NODE_ENV !== "production" && (tt.displayName = "ModelPicker");
|
|
1058
1156
|
//#endregion
|
|
1059
1157
|
//#region src/components/playground/prompt-suggestions.tsx
|
|
1060
|
-
var
|
|
1158
|
+
var nt = { align: {
|
|
1061
1159
|
start: { classes: "items-stretch" },
|
|
1062
1160
|
center: { classes: "items-center text-center" }
|
|
1063
|
-
} },
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
"
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1161
|
+
} }, rt = { align: "start" };
|
|
1162
|
+
function it({ prompt: t, align: n, force: r, onSelect: i }) {
|
|
1163
|
+
let a = z(null), o = u(a);
|
|
1164
|
+
return /* @__PURE__ */ V("li", {
|
|
1165
|
+
className: e("flex min-w-0", n === "center" && "justify-center"),
|
|
1166
|
+
children: /* @__PURE__ */ V(l, {
|
|
1167
|
+
content: t,
|
|
1168
|
+
disabled: !o,
|
|
1169
|
+
shape: "multiline",
|
|
1170
|
+
children: /* @__PURE__ */ V("button", {
|
|
1072
1171
|
type: "button",
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1172
|
+
...r ? { "data-force": r } : {},
|
|
1173
|
+
onClick: () => i(t),
|
|
1174
|
+
className: e("flex h-36 max-w-full min-w-0 cursor-pointer items-center rounded-pill px-16 text-body text-fg-secondary transition-control hover:bg-fill-1 hover:text-fg focus-visible:text-fg active:bg-fill-2 active:text-fg focus-ring-inset coarse:h-44", n === "start" && "flex-1"),
|
|
1175
|
+
children: /* @__PURE__ */ V("span", {
|
|
1176
|
+
ref: a,
|
|
1076
1177
|
className: "min-w-0 truncate",
|
|
1077
1178
|
children: t
|
|
1078
1179
|
})
|
|
1079
1180
|
})
|
|
1181
|
+
})
|
|
1182
|
+
});
|
|
1183
|
+
}
|
|
1184
|
+
var at = /* @__PURE__ */ P(function({ suggestions: t, onSelect: r, "aria-label": i, align: a = "start", className: o, "data-force": s }, c) {
|
|
1185
|
+
let l = n(), u = i ?? l("promptSuggestions.examplePrompts", "Example prompts");
|
|
1186
|
+
return /* @__PURE__ */ V("ul", {
|
|
1187
|
+
ref: c,
|
|
1188
|
+
"aria-label": u,
|
|
1189
|
+
className: e("flex min-w-0 flex-col gap-2", nt.align[a].classes, o),
|
|
1190
|
+
children: t.slice(0, 3).map((e, t) => /* @__PURE__ */ V(it, {
|
|
1191
|
+
prompt: e,
|
|
1192
|
+
align: a,
|
|
1193
|
+
force: s,
|
|
1194
|
+
onSelect: r
|
|
1080
1195
|
}, t))
|
|
1081
1196
|
});
|
|
1082
1197
|
});
|
|
1083
|
-
process.env.NODE_ENV !== "production" && (
|
|
1198
|
+
process.env.NODE_ENV !== "production" && (at.displayName = "PromptSuggestions");
|
|
1084
1199
|
//#endregion
|
|
1085
|
-
export {
|
|
1200
|
+
export { ye as CompareGrid, Y as Composer, Z as KAESO_COMPARE_GRID_DEFAULT_VARIANTS, X as KAESO_COMPARE_GRID_VARIANTS, le as KAESO_COMPOSER_DEFAULT_VARIANTS, q as KAESO_COMPOSER_VARIANTS, qe as KAESO_MODEL_PICKER_DEFAULT_VARIANTS, Ke as KAESO_MODEL_PICKER_VARIANTS, Be as KAESO_PARAMETER_PANEL_DEFAULT_VARIANTS, ze as KAESO_PARAMETER_PANEL_VARIANTS, rt as KAESO_PROMPT_SUGGESTIONS_DEFAULT_VARIANTS, nt as KAESO_PROMPT_SUGGESTIONS_VARIANTS, Q as KAESO_REASONING_DEFAULT_VARIANTS, be as KAESO_REASONING_VARIANTS, Ne as KAESO_RESPONSE_METRICS_DEFAULT_VARIANTS, Me as KAESO_RESPONSE_METRICS_VARIANTS, we as KAESO_RESPONSE_VIEW_DEFAULT_VARIANTS, Ce as KAESO_RESPONSE_VIEW_VARIANTS, tt as ModelPicker, Ue as ParameterPanel, We as ParameterPopover, at as PromptSuggestions, Se as Reasoning, Re as ResponseMetrics, Oe as ResponseView, je as Thread, Ae as UserMessage, Pe as formatLatency, et as useModelGroups };
|
|
1086
1201
|
|
|
1087
1202
|
//# sourceMappingURL=playground.js.map
|