@constructive-io/ui 0.13.0 → 0.14.1
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/dist/{ai-B7XNnqYL.js → ai-4JrVVL3q.js} +311 -213
- package/dist/ai-4JrVVL3q.js.map +1 -0
- package/dist/{ai-DJ-YPj8c.cjs → ai-B08ufcbD.cjs} +309 -211
- package/dist/ai-B08ufcbD.cjs.map +1 -0
- package/dist/components/ai/index.cjs +1 -1
- package/dist/components/ai/index.d.cts +1 -1
- package/dist/components/ai/index.d.ts +1 -1
- package/dist/components/ai/index.js +1 -1
- package/dist/components/autocomplete.cjs +1 -1
- package/dist/components/autocomplete.js +1 -1
- package/dist/components/button.cjs +3 -3
- package/dist/components/button.cjs.map +1 -1
- package/dist/components/button.d.cts +1 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/button.js +3 -3
- package/dist/components/button.js.map +1 -1
- package/dist/components/collapsible.cjs +1 -1
- package/dist/components/collapsible.cjs.map +1 -1
- package/dist/components/collapsible.js +1 -1
- package/dist/components/collapsible.js.map +1 -1
- package/dist/components/combobox.cjs +1 -1
- package/dist/components/combobox.js +1 -1
- package/dist/components/command.cjs +8 -3
- package/dist/components/command.cjs.map +1 -1
- package/dist/components/command.d.cts +4 -1
- package/dist/components/command.d.ts +4 -1
- package/dist/components/command.js +8 -3
- package/dist/components/command.js.map +1 -1
- package/dist/components/dropdown-menu.cjs +2 -2
- package/dist/components/dropdown-menu.cjs.map +1 -1
- package/dist/components/dropdown-menu.js +2 -2
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/input-otp.cjs +1 -1
- package/dist/components/input-otp.js +1 -1
- package/dist/components/item.d.cts +1 -1
- package/dist/components/item.d.ts +1 -1
- package/dist/components/multi-select.cjs +1 -1
- package/dist/components/multi-select.js +1 -1
- package/dist/components/popover.cjs +7 -0
- package/dist/components/popover.cjs.map +1 -1
- package/dist/components/popover.d.cts +7 -1
- package/dist/components/popover.d.ts +7 -1
- package/dist/components/popover.js +7 -1
- package/dist/components/popover.js.map +1 -1
- package/dist/components/select.cjs +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/tabs.cjs +5 -2
- package/dist/components/tabs.cjs.map +1 -1
- package/dist/components/tabs.js +5 -2
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/toggle-group.cjs +1 -1
- package/dist/components/toggle-group.js +1 -1
- package/dist/components/workspace-kit/index.cjs +51 -21
- package/dist/components/workspace-kit/index.cjs.map +1 -1
- package/dist/components/workspace-kit/index.d.cts +18 -6
- package/dist/components/workspace-kit/index.d.ts +18 -6
- package/dist/components/workspace-kit/index.js +51 -21
- package/dist/components/workspace-kit/index.js.map +1 -1
- package/dist/{fluid-highlight-DxWeZ7iu.js → fluid-highlight-CNELHV8o.js} +26 -11
- package/dist/fluid-highlight-CNELHV8o.js.map +1 -0
- package/dist/{fluid-highlight-AW-OITqJ.cjs → fluid-highlight-YWFRZXsw.cjs} +30 -9
- package/dist/fluid-highlight-YWFRZXsw.cjs.map +1 -0
- package/dist/{index-z3LqQ5L5.d.ts → index-Cluc_xc5.d.ts} +23 -14
- package/dist/{index-CiO-3M_X.d.cts → index-DXoG0ghv.d.cts} +23 -14
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/{theme-DTTTlylA.d.ts → theme-CKpIa4Fj.d.cts} +42 -26
- package/dist/{theme-DTTTlylA.d.cts → theme-CKpIa4Fj.d.ts} +42 -26
- package/dist/theme-dials-config.d.cts +1 -1
- package/dist/theme-dials-config.d.ts +1 -1
- package/dist/theme-presets.d.cts +1 -1
- package/dist/theme-presets.d.ts +1 -1
- package/dist/{theme-tuning-TJ76tnxZ.d.cts → theme-tuning-CTOHSrsh.d.cts} +2 -2
- package/dist/{theme-tuning-DjgDvV8V.d.ts → theme-tuning-DOko6Pmy.d.ts} +2 -2
- package/dist/theme-tuning.d.cts +1 -1
- package/dist/theme-tuning.d.ts +1 -1
- package/dist/theme.cjs +28 -22
- package/dist/theme.cjs.map +1 -1
- package/dist/theme.d.cts +1 -1
- package/dist/theme.d.ts +1 -1
- package/dist/theme.js +28 -22
- package/dist/theme.js.map +1 -1
- package/package.json +5 -2
- package/src/styles/globals.css +43 -25
- package/dist/ai-B7XNnqYL.js.map +0 -1
- package/dist/ai-DJ-YPj8c.cjs.map +0 -1
- package/dist/fluid-highlight-AW-OITqJ.cjs.map +0 -1
- package/dist/fluid-highlight-DxWeZ7iu.js.map +0 -1
|
@@ -5,15 +5,17 @@ import { Badge } from "./components/badge.js";
|
|
|
5
5
|
import { Kbd } from "./components/kbd.js";
|
|
6
6
|
import { Spinner } from "./components/spinner.js";
|
|
7
7
|
import { Alert, AlertDescription, AlertTitle } from "./components/alert.js";
|
|
8
|
+
import { n as unscaledRect } from "./fluid-highlight-CNELHV8o.js";
|
|
8
9
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./components/tooltip.js";
|
|
9
|
-
import { Popover, PopoverContent, PopoverTrigger } from "./components/popover.js";
|
|
10
|
+
import { Popover, PopoverContent, PopoverTrigger, popoverSurfaceClass } from "./components/popover.js";
|
|
11
|
+
import { t as useMergedRefs } from "./compose-refs-Mbma1O3M.js";
|
|
10
12
|
import { Collapsible, CollapsibleContent as CollapsiblePanel, CollapsibleTrigger } from "./components/collapsible.js";
|
|
11
13
|
import { Avatar, AvatarFallback, AvatarImage } from "./components/avatar.js";
|
|
12
14
|
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "./components/command.js";
|
|
13
15
|
import * as React$1 from "react";
|
|
14
16
|
import { useEffect, useRef, useState } from "react";
|
|
15
17
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
-
import { ArrowDown, ArrowUp, BookOpen, Bot, Brain, Check, CheckCircle2, ChevronDown, ChevronRight, Circle, CircleAlert, CircleCheck, CircleDashed, CircleDollarSign, CircleHelp, CircleX, Copy, ExternalLink, FileCode2, FileText, Gauge, Globe, ListChecks, Loader2, Paperclip, RefreshCw, RotateCcw,
|
|
18
|
+
import { ArrowDown, ArrowUp, Ban, BookOpen, Bot, Brain, Check, CheckCircle2, ChevronDown, ChevronRight, ChevronUp, Circle, CircleAlert, CircleCheck, CircleDashed, CircleDollarSign, CircleHelp, CircleX, Copy, ExternalLink, FileCode2, FileText, Gauge, Globe, ListChecks, Loader2, Paperclip, RefreshCw, RotateCcw, Sparkles, Terminal, ThumbsDown, ThumbsUp, TriangleAlert, Upload, X } from "lucide-react";
|
|
17
19
|
import { highlight } from "sugar-high";
|
|
18
20
|
import { c, css, diff, go, java, python, rust } from "sugar-high/presets";
|
|
19
21
|
|
|
@@ -608,6 +610,7 @@ function MessageContent({ className, markdown = false, streaming = false, childr
|
|
|
608
610
|
const contentClassName = cn("min-w-0 max-w-[min(100%,42rem)] text-sm leading-relaxed text-foreground [overflow-wrap:anywhere]", typeof children === "string" && !markdown && "whitespace-pre-wrap", className);
|
|
609
611
|
if (markdown && typeof children === "string") return /* @__PURE__ */ jsx(Markdown, {
|
|
610
612
|
"data-slot": "message-content",
|
|
613
|
+
dir: "auto",
|
|
611
614
|
streaming,
|
|
612
615
|
className: contentClassName,
|
|
613
616
|
...props,
|
|
@@ -615,6 +618,7 @@ function MessageContent({ className, markdown = false, streaming = false, childr
|
|
|
615
618
|
});
|
|
616
619
|
return /* @__PURE__ */ jsx("div", {
|
|
617
620
|
"data-slot": "message-content",
|
|
621
|
+
dir: "auto",
|
|
618
622
|
className: contentClassName,
|
|
619
623
|
...props,
|
|
620
624
|
children
|
|
@@ -879,8 +883,9 @@ function useChatContainer() {
|
|
|
879
883
|
* Scroll region for chat transcripts with stick-to-bottom tracking.
|
|
880
884
|
* Pair with ScrollButton for jump-to-latest.
|
|
881
885
|
*/
|
|
882
|
-
function ChatContainer({ className, children, bottomThreshold = 48, autoScroll = true, ...props }) {
|
|
886
|
+
function ChatContainer({ className, children, bottomThreshold = 48, autoScroll = true, ref, ...props }) {
|
|
883
887
|
const scrollRef = React$1.useRef(null);
|
|
888
|
+
const mergedRef = useMergedRefs(scrollRef, ref);
|
|
884
889
|
const [isAtBottom, setIsAtBottom] = React$1.useState(true);
|
|
885
890
|
const isAtBottomRef = React$1.useRef(true);
|
|
886
891
|
const scrollToBottom = React$1.useCallback((behavior = "smooth") => {
|
|
@@ -927,7 +932,7 @@ function ChatContainer({ className, children, bottomThreshold = 48, autoScroll =
|
|
|
927
932
|
scrollToBottom
|
|
928
933
|
},
|
|
929
934
|
children: /* @__PURE__ */ jsx("div", {
|
|
930
|
-
ref:
|
|
935
|
+
ref: mergedRef,
|
|
931
936
|
"data-slot": "chat-container",
|
|
932
937
|
"data-at-bottom": isAtBottom ? "true" : "false",
|
|
933
938
|
className: cn("relative min-h-0 flex-1 overflow-y-auto overscroll-contain", className),
|
|
@@ -960,7 +965,7 @@ function ScrollButton({ className, visible, label = "Scroll to latest", onClick,
|
|
|
960
965
|
type,
|
|
961
966
|
"aria-label": label,
|
|
962
967
|
"data-slot": "scroll-button",
|
|
963
|
-
className: cn("absolute bottom-4 left-1/2 z-10 flex size-9 -translate-x-1/2 items-center justify-center", "rounded-full border border-border bg-background/95 text-muted-foreground", "shadow-lg backdrop-blur-md", "dark:border-border dark:bg-card/90 dark:shadow-black/40", "outline-none transition-[transform,
|
|
968
|
+
className: cn("absolute bottom-4 left-1/2 z-10 flex size-9 -translate-x-1/2 items-center justify-center", "rounded-full border border-border bg-background/95 text-muted-foreground", "shadow-lg backdrop-blur-md", "dark:border-border dark:bg-card/90 dark:shadow-black/40", "outline-none transition-[transform,box-shadow] duration-(--duration-moderate) ease-out", "hover:border-border hover:bg-accent hover:text-foreground hover:shadow-lg", "focus-visible:ring-[3px] focus-visible:ring-ring/50", "motion-safe:active:scale-[0.96]", "animate-[fade-in_150ms_ease-out] motion-reduce:animate-none", className),
|
|
964
969
|
onClick: (event) => {
|
|
965
970
|
scrollToBottom("smooth");
|
|
966
971
|
onClick?.(event);
|
|
@@ -1052,7 +1057,7 @@ function Reasoning({ children, content, isStreaming = false, durationMs = null,
|
|
|
1052
1057
|
className: cn("w-full", className),
|
|
1053
1058
|
"data-slot": "reasoning",
|
|
1054
1059
|
children: [/* @__PURE__ */ jsxs(CollapsibleTrigger, {
|
|
1055
|
-
className: cn("group flex w-fit max-w-full items-center gap-1.5 rounded-md px-1.5 py-1.5 text-start text-[0.8125rem]", "text-muted-foreground transition-[box-shadow] duration-(--duration-moderate) hover:bg-accent hover:text-foreground", "focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50"),
|
|
1060
|
+
className: cn("group -mx-1.5 flex w-fit max-w-full items-center gap-1.5 rounded-md px-1.5 py-1.5 text-start text-[0.8125rem]", "text-muted-foreground transition-[box-shadow] duration-(--duration-moderate) hover:bg-accent hover:text-foreground", "focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50"),
|
|
1056
1061
|
children: [
|
|
1057
1062
|
/* @__PURE__ */ jsx(Brain, { className: "size-3.5 shrink-0 opacity-80" }),
|
|
1058
1063
|
isStreaming ? /* @__PURE__ */ jsx(TextShimmer, {
|
|
@@ -1419,11 +1424,11 @@ function formatValue(value) {
|
|
|
1419
1424
|
}
|
|
1420
1425
|
function StatusIcon({ status }) {
|
|
1421
1426
|
switch (status) {
|
|
1422
|
-
case "pending": return /* @__PURE__ */ jsx(
|
|
1423
|
-
case "running": return /* @__PURE__ */ jsx(
|
|
1424
|
-
case "success": return /* @__PURE__ */ jsx(CheckCircle2, { className: "size-3.5 text-success" });
|
|
1425
|
-
case "error": return /* @__PURE__ */ jsx(CircleX, { className: "size-3.5 text-destructive" });
|
|
1426
|
-
case "aborted": return /* @__PURE__ */ jsx(
|
|
1427
|
+
case "pending": return /* @__PURE__ */ jsx(CircleDashed, { className: "size-3.5 shrink-0 text-muted-foreground" });
|
|
1428
|
+
case "running": return /* @__PURE__ */ jsx(Loader2, { className: "size-3.5 shrink-0 animate-spin text-muted-foreground motion-reduce:animate-none" });
|
|
1429
|
+
case "success": return /* @__PURE__ */ jsx(CheckCircle2, { className: "size-3.5 shrink-0 text-success" });
|
|
1430
|
+
case "error": return /* @__PURE__ */ jsx(CircleX, { className: "size-3.5 shrink-0 text-destructive" });
|
|
1431
|
+
case "aborted": return /* @__PURE__ */ jsx(Ban, { className: "size-3.5 shrink-0 text-muted-foreground" });
|
|
1427
1432
|
}
|
|
1428
1433
|
}
|
|
1429
1434
|
function statusBadge(status) {
|
|
@@ -1470,6 +1475,8 @@ function Tool({ name, status: statusProp = "pending", summary, input, output, er
|
|
|
1470
1475
|
children: name
|
|
1471
1476
|
}),
|
|
1472
1477
|
summary ? /* @__PURE__ */ jsx("span", {
|
|
1478
|
+
dir: "auto",
|
|
1479
|
+
title: typeof summary === "string" ? summary : void 0,
|
|
1473
1480
|
className: "min-w-0 truncate font-mono text-muted-foreground",
|
|
1474
1481
|
children: summary
|
|
1475
1482
|
}) : null
|
|
@@ -1487,6 +1494,8 @@ function Tool({ name, status: statusProp = "pending", summary, input, output, er
|
|
|
1487
1494
|
children: name
|
|
1488
1495
|
}),
|
|
1489
1496
|
summary ? /* @__PURE__ */ jsx("span", {
|
|
1497
|
+
dir: "auto",
|
|
1498
|
+
title: typeof summary === "string" ? summary : void 0,
|
|
1490
1499
|
className: cn("min-w-0 truncate rounded-md bg-muted px-1.5 py-0.5 font-mono text-[0.71875rem] text-muted-foreground"),
|
|
1491
1500
|
children: summary
|
|
1492
1501
|
}) : null,
|
|
@@ -1607,7 +1616,7 @@ function ToolGroup({ label, children, defaultOpen = true, className }) {
|
|
|
1607
1616
|
className: cn("-mx-1.5 flex w-fit items-center gap-1.5 rounded-md px-1.5 py-1.5 text-[0.78125rem]", "text-muted-foreground hover:bg-accent hover:text-foreground"),
|
|
1608
1617
|
children: [/* @__PURE__ */ jsx(ChevronDown, {
|
|
1609
1618
|
"data-slot": "collapsible-icon",
|
|
1610
|
-
className: "size-3"
|
|
1619
|
+
className: "size-3.5 shrink-0"
|
|
1611
1620
|
}), /* @__PURE__ */ jsx("span", {
|
|
1612
1621
|
className: "tabular-nums",
|
|
1613
1622
|
children: label
|
|
@@ -1628,7 +1637,7 @@ function ToolGroup({ label, children, defaultOpen = true, className }) {
|
|
|
1628
1637
|
/**
|
|
1629
1638
|
* Human-in-the-loop approval: simple confirm/skip or multi-question flow.
|
|
1630
1639
|
*/
|
|
1631
|
-
function ApprovalCard({ title, description, questions, confirmLabel = "Confirm", skipLabel = "Skip", destructive = false, preview, onConfirm, onSkip, onDismiss, className, defaultSent = false }) {
|
|
1640
|
+
function ApprovalCard({ title, description, questions, confirmLabel = "Confirm", skipLabel = "Skip", destructive = false, preview, eyebrow, onConfirm, onSkip, onDismiss, className, defaultSent = false }) {
|
|
1632
1641
|
const multi = Boolean(questions?.length);
|
|
1633
1642
|
const [qi, setQi] = React$1.useState(0);
|
|
1634
1643
|
const [answers, setAnswers] = React$1.useState({});
|
|
@@ -1687,13 +1696,20 @@ function ApprovalCard({ title, description, questions, confirmLabel = "Confirm",
|
|
|
1687
1696
|
className: "flex items-start justify-between gap-2 px-3 pt-3",
|
|
1688
1697
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
1689
1698
|
className: "min-w-0 space-y-1",
|
|
1690
|
-
children: [
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1699
|
+
children: [
|
|
1700
|
+
eyebrow ? /* @__PURE__ */ jsx("div", {
|
|
1701
|
+
className: "mb-1.5 flex min-h-4 items-center gap-1.5 text-xs text-muted-foreground [&_svg]:size-3.5 [&_svg]:shrink-0",
|
|
1702
|
+
children: eyebrow
|
|
1703
|
+
}) : null,
|
|
1704
|
+
title ? /* @__PURE__ */ jsx("div", {
|
|
1705
|
+
className: "text-[0.8125rem] font-medium text-pretty text-foreground [overflow-wrap:anywhere]",
|
|
1706
|
+
children: title
|
|
1707
|
+
}) : null,
|
|
1708
|
+
description ? /* @__PURE__ */ jsx("div", {
|
|
1709
|
+
className: "text-xs text-pretty text-muted-foreground [overflow-wrap:anywhere]",
|
|
1710
|
+
children: description
|
|
1711
|
+
}) : null
|
|
1712
|
+
]
|
|
1697
1713
|
}), onDismiss ? /* @__PURE__ */ jsx(Button, {
|
|
1698
1714
|
type: "button",
|
|
1699
1715
|
variant: "ghost",
|
|
@@ -1708,10 +1724,10 @@ function ApprovalCard({ title, description, questions, confirmLabel = "Confirm",
|
|
|
1708
1724
|
children: preview
|
|
1709
1725
|
}) : null,
|
|
1710
1726
|
/* @__PURE__ */ jsxs("div", {
|
|
1711
|
-
className: "flex flex-wrap items-center justify-end gap-1.5
|
|
1727
|
+
className: "flex flex-wrap items-center justify-end gap-1.5 p-3",
|
|
1712
1728
|
children: [onSkip ? /* @__PURE__ */ jsx(Button, {
|
|
1713
1729
|
type: "button",
|
|
1714
|
-
variant: "
|
|
1730
|
+
variant: "secondary",
|
|
1715
1731
|
size: "sm",
|
|
1716
1732
|
wrap: true,
|
|
1717
1733
|
onClick: onSkip,
|
|
@@ -1746,7 +1762,7 @@ function ApprovalCard({ title, description, questions, confirmLabel = "Confirm",
|
|
|
1746
1762
|
}), /* @__PURE__ */ jsxs("div", {
|
|
1747
1763
|
className: "flex shrink-0 items-center gap-1",
|
|
1748
1764
|
children: [/* @__PURE__ */ jsx("div", {
|
|
1749
|
-
className: "flex items-center gap-0.5",
|
|
1765
|
+
className: cn("flex items-center gap-0.5", progress.length < 2 && "hidden"),
|
|
1750
1766
|
"aria-hidden": true,
|
|
1751
1767
|
children: progress.map((on, i) => /* @__PURE__ */ jsx("span", { className: cn("h-1 rounded-full transition-[width,background-color] duration-(--duration-slow)", on ? "w-3 bg-primary" : "w-1.5 bg-border") }, i))
|
|
1752
1768
|
}), onDismiss ? /* @__PURE__ */ jsx(Button, {
|
|
@@ -1767,9 +1783,9 @@ function ApprovalCard({ title, description, questions, confirmLabel = "Confirm",
|
|
|
1767
1783
|
type: "button",
|
|
1768
1784
|
"aria-pressed": on,
|
|
1769
1785
|
onClick: () => toggleOption(option.id),
|
|
1770
|
-
className: cn("-mx-1.5 flex min-h-10
|
|
1786
|
+
className: cn("-mx-1.5 flex min-h-10 gap-2 rounded-md px-1.5 py-1.5 text-start text-[0.8125rem]", option.description ? "items-start" : "items-center", "transition-[box-shadow] duration-(--duration-moderate) hover:bg-accent", "focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50", on && "bg-accent"),
|
|
1771
1787
|
children: [/* @__PURE__ */ jsx("span", {
|
|
1772
|
-
className: cn("
|
|
1788
|
+
className: cn("flex size-4 shrink-0 items-center justify-center rounded-full border", option.description && "mt-0.5", on ? "border-primary bg-primary text-primary-foreground" : "border-border"),
|
|
1773
1789
|
children: on ? /* @__PURE__ */ jsx(Check, {
|
|
1774
1790
|
className: "size-2.5",
|
|
1775
1791
|
strokeWidth: 3
|
|
@@ -2157,9 +2173,9 @@ function InlineDiff({ source, className, maxLines = 40 }) {
|
|
|
2157
2173
|
hidden > 0 ? /* @__PURE__ */ jsxs("div", {
|
|
2158
2174
|
className: "border-t border-border px-2.5 py-1 text-[0.6875rem] text-muted-foreground",
|
|
2159
2175
|
children: [
|
|
2160
|
-
"+",
|
|
2161
2176
|
hidden,
|
|
2162
|
-
" more
|
|
2177
|
+
" more ",
|
|
2178
|
+
hidden === 1 ? "line" : "lines"
|
|
2163
2179
|
]
|
|
2164
2180
|
}) : null
|
|
2165
2181
|
]
|
|
@@ -2470,7 +2486,9 @@ function PlanTracker({ plan, streaming = false, className, flushBottom = true, d
|
|
|
2470
2486
|
className: "min-w-0 flex-1 truncate font-medium tabular-nums",
|
|
2471
2487
|
children: `${total}/${total} done`
|
|
2472
2488
|
}) : focusStep ? /* @__PURE__ */ jsxs("span", {
|
|
2473
|
-
|
|
2489
|
+
dir: "auto",
|
|
2490
|
+
title: focusStep.label,
|
|
2491
|
+
className: "min-w-0 flex-1 truncate font-medium [text-align:match-parent]",
|
|
2474
2492
|
children: [/* @__PURE__ */ jsxs("span", {
|
|
2475
2493
|
className: "me-1.5 font-mono text-[0.75rem] font-normal tabular-nums text-muted-foreground/60",
|
|
2476
2494
|
children: [
|
|
@@ -2501,9 +2519,13 @@ function PlanTracker({ plan, streaming = false, className, flushBottom = true, d
|
|
|
2501
2519
|
}
|
|
2502
2520
|
function PlanRow({ step }) {
|
|
2503
2521
|
return /* @__PURE__ */ jsxs("li", {
|
|
2504
|
-
className: "flex items-
|
|
2505
|
-
children: [/* @__PURE__ */ jsx(
|
|
2506
|
-
className:
|
|
2522
|
+
className: "flex items-start gap-2 rounded-md px-1.5 py-1 text-[0.8125rem]",
|
|
2523
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
2524
|
+
className: "flex h-5 shrink-0 items-center",
|
|
2525
|
+
children: /* @__PURE__ */ jsx(StepIcon, { status: step.status })
|
|
2526
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
2527
|
+
dir: "auto",
|
|
2528
|
+
className: cn("min-w-0 flex-1 leading-5 text-pretty [overflow-wrap:anywhere] [text-align:match-parent]", step.status === "done" ? "text-muted-foreground line-through" : "text-foreground"),
|
|
2507
2529
|
children: step.label
|
|
2508
2530
|
})]
|
|
2509
2531
|
});
|
|
@@ -3126,21 +3148,23 @@ const iconEnterClass = "transition-[opacity,scale,filter] duration-300 ease-[cub
|
|
|
3126
3148
|
const STATUS_LABEL = {
|
|
3127
3149
|
pending: "Queued",
|
|
3128
3150
|
running: "Running",
|
|
3129
|
-
done: "Done"
|
|
3151
|
+
done: "Done",
|
|
3152
|
+
error: "Failed"
|
|
3130
3153
|
};
|
|
3131
3154
|
/** Delay between rows as a trace enters, so it reads top to bottom. */
|
|
3132
3155
|
const ROW_STAGGER_MS = 80;
|
|
3133
3156
|
/**
|
|
3134
|
-
* Quiet tool-call trace: a heading row
|
|
3135
|
-
*
|
|
3157
|
+
* Quiet tool-call trace: a heading row, then one row per call hung from a
|
|
3158
|
+
* single rail under the heading glyph. Each row morphs from spinner to check
|
|
3159
|
+
* as the call settles, or to an alert when it fails.
|
|
3136
3160
|
*/
|
|
3137
3161
|
function ToolTrace({ title = "Read tools", icon, steps, className, ...props }) {
|
|
3138
3162
|
return /* @__PURE__ */ jsxs("ol", {
|
|
3139
3163
|
"data-slot": "tool-trace",
|
|
3140
|
-
className: cn("flex flex-col
|
|
3164
|
+
className: cn("flex flex-col", className),
|
|
3141
3165
|
...props,
|
|
3142
3166
|
children: [/* @__PURE__ */ jsxs("li", {
|
|
3143
|
-
className: "flex h-7 items-center gap-2",
|
|
3167
|
+
className: "mb-1 flex h-7 items-center gap-2",
|
|
3144
3168
|
children: [/* @__PURE__ */ jsx(MarkTile, { children: icon ?? /* @__PURE__ */ jsx(BookOpen, {}) }), /* @__PURE__ */ jsx("span", {
|
|
3145
3169
|
className: "text-[0.8125rem] text-foreground",
|
|
3146
3170
|
children: title
|
|
@@ -3150,18 +3174,17 @@ function ToolTrace({ title = "Read tools", icon, steps, className, ...props }) {
|
|
|
3150
3174
|
return /* @__PURE__ */ jsxs("li", {
|
|
3151
3175
|
"data-status": status,
|
|
3152
3176
|
style: { animationDelay: `${(index + 1) * ROW_STAGGER_MS}ms` },
|
|
3153
|
-
className: "
|
|
3177
|
+
className: "ms-2 flex h-8 animate-[ai-fade-up_var(--duration-slow)_var(--ease-out)_both] items-center gap-2 border-s border-subtle-foreground/25 ps-3 motion-reduce:animate-none",
|
|
3154
3178
|
children: [
|
|
3155
|
-
/* @__PURE__ */ jsx("span", {
|
|
3156
|
-
"aria-hidden": "true",
|
|
3157
|
-
className: "absolute -top-2 left-2 h-2 w-px -translate-x-1/2 bg-subtle-foreground/35"
|
|
3158
|
-
}),
|
|
3159
3179
|
/* @__PURE__ */ jsxs("span", {
|
|
3160
3180
|
className: "grid size-4 shrink-0 place-items-center text-subtle-foreground",
|
|
3161
3181
|
children: [status === "done" ? /* @__PURE__ */ jsx(Check, {
|
|
3162
3182
|
"aria-hidden": "true",
|
|
3163
3183
|
className: cn("size-3", iconEnterClass),
|
|
3164
3184
|
strokeWidth: 2
|
|
3185
|
+
}) : status === "error" ? /* @__PURE__ */ jsx(CircleAlert, {
|
|
3186
|
+
"aria-hidden": "true",
|
|
3187
|
+
className: cn("size-3.5 text-destructive", iconEnterClass)
|
|
3165
3188
|
}) : /* @__PURE__ */ jsx(Spinner, {
|
|
3166
3189
|
"aria-hidden": "true",
|
|
3167
3190
|
role: void 0,
|
|
@@ -3177,7 +3200,7 @@ function ToolTrace({ title = "Read tools", icon, steps, className, ...props }) {
|
|
|
3177
3200
|
children: step.icon
|
|
3178
3201
|
}) : null,
|
|
3179
3202
|
/* @__PURE__ */ jsx("span", {
|
|
3180
|
-
className: cn("truncate text-[0.8125rem]", status === "running" ? "text-foreground" : "text-muted-foreground"),
|
|
3203
|
+
className: cn("truncate text-[0.8125rem]", status === "running" || status === "error" ? "text-foreground" : "text-muted-foreground"),
|
|
3181
3204
|
children: step.label
|
|
3182
3205
|
})
|
|
3183
3206
|
]
|
|
@@ -3409,25 +3432,24 @@ function costTier(share, free) {
|
|
|
3409
3432
|
return Math.min(COST_TIERS, Math.max(1, Math.ceil(share * COST_TIERS)));
|
|
3410
3433
|
}
|
|
3411
3434
|
/**
|
|
3412
|
-
* Relative cost as a row of building blocks: one to four filled in
|
|
3413
|
-
*
|
|
3414
|
-
* faster than a continuous bar and keep the list calm while scanning.
|
|
3435
|
+
* Relative cost as a row of building blocks: one to four filled, stepping up in height like a stack being built.
|
|
3436
|
+
* Discrete tiers read faster than a continuous bar, and the muted fill keeps the list calm while scanning.
|
|
3415
3437
|
*/
|
|
3416
3438
|
function CostBlocks({ tier }) {
|
|
3417
3439
|
return /* @__PURE__ */ jsx("span", {
|
|
3418
3440
|
role: "img",
|
|
3419
3441
|
"aria-label": `Cost tier ${tier} of ${COST_TIERS}`,
|
|
3420
|
-
className: "flex h-
|
|
3442
|
+
className: "flex h-2.5 shrink-0 items-end gap-0.5",
|
|
3421
3443
|
children: Array.from({ length: COST_TIERS }, (_, index) => /* @__PURE__ */ jsx("span", {
|
|
3422
3444
|
"aria-hidden": "true",
|
|
3423
|
-
className: cn("w-
|
|
3424
|
-
style: { height: `${
|
|
3445
|
+
className: cn("w-[3px] rounded-[1px]", index < tier ? "bg-muted-foreground" : "bg-[color-mix(in_oklab,currentColor_14%,transparent)]"),
|
|
3446
|
+
style: { height: `${4 + index * 2}px` }
|
|
3425
3447
|
}, index))
|
|
3426
3448
|
});
|
|
3427
3449
|
}
|
|
3428
3450
|
function PriceText({ pricing }) {
|
|
3429
3451
|
return /* @__PURE__ */ jsxs("span", {
|
|
3430
|
-
className: "text-
|
|
3452
|
+
className: "text-[0.6875rem] text-muted-foreground tabular-nums",
|
|
3431
3453
|
children: [
|
|
3432
3454
|
formatPrice(pricing.input, pricing.currency),
|
|
3433
3455
|
/* @__PURE__ */ jsx("span", {
|
|
@@ -3442,7 +3464,7 @@ function PriceText({ pricing }) {
|
|
|
3442
3464
|
const MAX_ROW_TAGS = 2;
|
|
3443
3465
|
function Tag({ tag }) {
|
|
3444
3466
|
return /* @__PURE__ */ jsx("span", {
|
|
3445
|
-
className: cn("shrink-0 text-
|
|
3467
|
+
className: cn("shrink-0 text-[0.6875rem] font-medium", tag === "new" ? "text-link" : tag === "deprecated" ? "text-subtle-foreground line-through" : "text-muted-foreground"),
|
|
3446
3468
|
children: TAG_LABEL[tag]
|
|
3447
3469
|
});
|
|
3448
3470
|
}
|
|
@@ -3455,46 +3477,70 @@ function ModelGlyph({ model }) {
|
|
|
3455
3477
|
})
|
|
3456
3478
|
});
|
|
3457
3479
|
}
|
|
3458
|
-
/**
|
|
3480
|
+
/**
|
|
3481
|
+
* A model's reasoning levels as compact radio rows. The description of the level under the pointer (or the chosen
|
|
3482
|
+
* one) shows once below them, in a slot sized to the longest so the card holds still while moving through them.
|
|
3483
|
+
*/
|
|
3459
3484
|
function LevelMenu({ model, levelId, onPick }) {
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
return /* @__PURE__ */
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3485
|
+
const [peek, setPeek] = React$1.useState();
|
|
3486
|
+
const levels = model.levels ?? [];
|
|
3487
|
+
const shown = peek ?? levelId;
|
|
3488
|
+
const described = levels.some((level) => level.description);
|
|
3489
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
3490
|
+
/* @__PURE__ */ jsxs("p", {
|
|
3491
|
+
className: "flex h-6 items-center justify-between gap-2 px-2 text-[0.6875rem] text-subtle-foreground",
|
|
3492
|
+
children: ["Reasoning", levels.length > 1 ? /* @__PURE__ */ jsxs("span", {
|
|
3493
|
+
"aria-hidden": "true",
|
|
3494
|
+
className: "hidden items-center gap-0.5 pointer-fine:flex",
|
|
3495
|
+
children: [/* @__PURE__ */ jsx(Kbd, {
|
|
3496
|
+
className: "h-4 min-w-4 text-[0.625rem]",
|
|
3497
|
+
children: "←"
|
|
3498
|
+
}), /* @__PURE__ */ jsx(Kbd, {
|
|
3499
|
+
className: "h-4 min-w-4 text-[0.625rem]",
|
|
3500
|
+
children: "→"
|
|
3501
|
+
})]
|
|
3502
|
+
}) : null]
|
|
3503
|
+
}),
|
|
3504
|
+
/* @__PURE__ */ jsx("div", {
|
|
3505
|
+
role: "radiogroup",
|
|
3506
|
+
"aria-label": `${model.name} reasoning level`,
|
|
3507
|
+
onPointerLeave: () => setPeek(void 0),
|
|
3508
|
+
className: "flex flex-col",
|
|
3509
|
+
children: levels.map((level) => {
|
|
3510
|
+
const checked = level.id === levelId;
|
|
3511
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
3512
|
+
type: "button",
|
|
3513
|
+
role: "radio",
|
|
3514
|
+
"aria-checked": checked,
|
|
3515
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
3516
|
+
onPointerEnter: () => setPeek(level.id),
|
|
3517
|
+
onFocus: () => setPeek(level.id),
|
|
3518
|
+
onBlur: () => setPeek(void 0),
|
|
3519
|
+
onClick: () => onPick(level.id),
|
|
3520
|
+
className: cn("flex h-7 w-full cursor-pointer items-center gap-2 rounded-sm px-2 text-start text-[0.8125rem] outline-none pointer-coarse:h-11", "hover:bg-overlay-hover focus-visible:ring-[3px] focus-visible:ring-ring/50", checked ? "font-medium text-foreground" : "text-foreground/80"),
|
|
3479
3521
|
children: [/* @__PURE__ */ jsx("span", {
|
|
3480
|
-
className:
|
|
3522
|
+
className: "min-w-0 flex-1 truncate",
|
|
3481
3523
|
children: level.label
|
|
3482
|
-
}),
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
})
|
|
3486
|
-
}
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3524
|
+
}), /* @__PURE__ */ jsx(Check, {
|
|
3525
|
+
"aria-hidden": "true",
|
|
3526
|
+
className: cn("size-3.5 shrink-0", checked ? "opacity-100" : "opacity-0")
|
|
3527
|
+
})]
|
|
3528
|
+
}, level.id);
|
|
3529
|
+
})
|
|
3530
|
+
}),
|
|
3531
|
+
described ? /* @__PURE__ */ jsx("div", {
|
|
3532
|
+
className: "grid px-2 pt-1 pb-1.5 text-[0.6875rem] leading-4 text-pretty text-muted-foreground",
|
|
3533
|
+
children: levels.map((level) => /* @__PURE__ */ jsx("p", {
|
|
3534
|
+
"aria-hidden": level.id !== shown,
|
|
3535
|
+
className: cn("[grid-area:1/1]", level.id === shown ? "visible" : "invisible"),
|
|
3536
|
+
children: level.description
|
|
3537
|
+
}, level.id))
|
|
3538
|
+
}) : null
|
|
3539
|
+
] });
|
|
3493
3540
|
}
|
|
3494
3541
|
/**
|
|
3495
|
-
* The side card for the active model: what it is, its reasoning levels
|
|
3496
|
-
*
|
|
3497
|
-
* never changes size while moving through it.
|
|
3542
|
+
* The side card for the active model: what it is, its reasoning levels, and its prices. It opens beside the list like
|
|
3543
|
+
* a submenu, so the list never changes size while moving through it.
|
|
3498
3544
|
*/
|
|
3499
3545
|
function ModelDetails({ model, levelId, onPickLevel }) {
|
|
3500
3546
|
const level = levelOf(model, levelId);
|
|
@@ -3521,55 +3567,38 @@ function ModelDetails({ model, levelId, onPickLevel }) {
|
|
|
3521
3567
|
];
|
|
3522
3568
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3523
3569
|
/* @__PURE__ */ jsxs("div", {
|
|
3524
|
-
className: "
|
|
3525
|
-
children: [/* @__PURE__ */ jsx(
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
className: "truncate text-xs text-muted-foreground",
|
|
3534
|
-
children: model.description ?? model.provider
|
|
3535
|
-
})]
|
|
3570
|
+
className: "px-2 pt-1.5 pb-2",
|
|
3571
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
3572
|
+
dir: "auto",
|
|
3573
|
+
title: model.name,
|
|
3574
|
+
className: "truncate text-[0.8125rem] font-medium text-foreground",
|
|
3575
|
+
children: model.name
|
|
3576
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
3577
|
+
className: "line-clamp-2 text-[0.6875rem] leading-4 text-pretty text-muted-foreground",
|
|
3578
|
+
children: model.description ?? model.provider
|
|
3536
3579
|
})]
|
|
3537
3580
|
}),
|
|
3581
|
+
model.levels?.length ? /* @__PURE__ */ jsx(LevelMenu, {
|
|
3582
|
+
model,
|
|
3583
|
+
levelId: level?.id,
|
|
3584
|
+
onPick: onPickLevel
|
|
3585
|
+
}) : null,
|
|
3538
3586
|
/* @__PURE__ */ jsx("div", {
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
model,
|
|
3542
|
-
levelId: level?.id,
|
|
3543
|
-
onPick: onPickLevel
|
|
3544
|
-
})
|
|
3587
|
+
"aria-hidden": "true",
|
|
3588
|
+
className: "mx-2 h-px bg-border/70"
|
|
3545
3589
|
}),
|
|
3546
3590
|
/* @__PURE__ */ jsx("dl", {
|
|
3547
|
-
className: "grid grid-cols-2 gap-x-3 gap-y-
|
|
3591
|
+
className: "grid grid-cols-2 gap-x-3 gap-y-1.5 px-2 pt-2 pb-1.5",
|
|
3548
3592
|
children: facts.map((fact) => /* @__PURE__ */ jsxs("div", {
|
|
3549
3593
|
className: "min-w-0",
|
|
3550
3594
|
children: [/* @__PURE__ */ jsx("dt", {
|
|
3551
|
-
className: "truncate text-[0.6875rem] leading-4 text-
|
|
3595
|
+
className: "truncate text-[0.6875rem] leading-4 text-subtle-foreground",
|
|
3552
3596
|
children: fact.label
|
|
3553
3597
|
}), /* @__PURE__ */ jsx("dd", {
|
|
3554
3598
|
className: "truncate text-xs leading-4 text-foreground tabular-nums",
|
|
3555
3599
|
children: fact.value
|
|
3556
3600
|
})]
|
|
3557
3601
|
}, fact.label))
|
|
3558
|
-
}),
|
|
3559
|
-
/* @__PURE__ */ jsxs("p", {
|
|
3560
|
-
className: "hidden h-8 items-center gap-1 border-t border-border px-3 text-[0.6875rem] text-muted-foreground pointer-fine:flex",
|
|
3561
|
-
children: [
|
|
3562
|
-
model.levels && model.levels.length > 1 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3563
|
-
/* @__PURE__ */ jsx(Kbd, { children: "←" }),
|
|
3564
|
-
/* @__PURE__ */ jsx(Kbd, { children: "→" }),
|
|
3565
|
-
/* @__PURE__ */ jsx("span", {
|
|
3566
|
-
className: "me-2",
|
|
3567
|
-
children: "level"
|
|
3568
|
-
})
|
|
3569
|
-
] }) : null,
|
|
3570
|
-
/* @__PURE__ */ jsx(Kbd, { children: "↵" }),
|
|
3571
|
-
/* @__PURE__ */ jsx("span", { children: "choose" })
|
|
3572
|
-
]
|
|
3573
3602
|
})
|
|
3574
3603
|
] });
|
|
3575
3604
|
}
|
|
@@ -3581,6 +3610,8 @@ function inTriangle(point, a, b, c) {
|
|
|
3581
3610
|
const d3 = side(point, c, a);
|
|
3582
3611
|
return !((d1 < 0 || d2 < 0 || d3 < 0) && (d1 > 0 || d2 > 0 || d3 > 0));
|
|
3583
3612
|
}
|
|
3613
|
+
/** One shared empty list, so leaving the section props out doesn't rebuild the sections on every render. */
|
|
3614
|
+
const NO_IDS = [];
|
|
3584
3615
|
/** How long a row crossed on the way to the side card waits before taking it over. */
|
|
3585
3616
|
const PANEL_INTENT_MS = 240;
|
|
3586
3617
|
/**
|
|
@@ -3590,7 +3621,7 @@ const PANEL_INTENT_MS = 240;
|
|
|
3590
3621
|
* with its reasoning levels.
|
|
3591
3622
|
* Controlled: the host owns the selection and persists recents.
|
|
3592
3623
|
*/
|
|
3593
|
-
function ModelSelector({ models, value, onValueChange, pinnedIds =
|
|
3624
|
+
function ModelSelector({ models, value, onValueChange, pinnedIds = NO_IDS, recentIds = NO_IDS, recommendedIds = NO_IDS, priceDisplay: priceDisplayProp = "meter", allowPriceToggle, disabled, align = "start", side = "top", triggerClassName, levelClassName, contentClassName, label = "Model" }) {
|
|
3594
3625
|
const [open, setOpen] = React$1.useState(false);
|
|
3595
3626
|
const [query, setQuery] = React$1.useState("");
|
|
3596
3627
|
const [highlighted, setHighlighted] = React$1.useState("");
|
|
@@ -3602,7 +3633,10 @@ function ModelSelector({ models, value, onValueChange, pinnedIds = [], recentIds
|
|
|
3602
3633
|
top: 0,
|
|
3603
3634
|
side: "right"
|
|
3604
3635
|
});
|
|
3636
|
+
/** The list's height when filtering starts, held so a short result list doesn't move the search field. */
|
|
3637
|
+
const [listHeight, setListHeight] = React$1.useState();
|
|
3605
3638
|
const contentRef = React$1.useRef(null);
|
|
3639
|
+
const listRef = React$1.useRef(null);
|
|
3606
3640
|
const panelRef = React$1.useRef(null);
|
|
3607
3641
|
const trail = React$1.useRef([]);
|
|
3608
3642
|
const intentTimer = React$1.useRef(void 0);
|
|
@@ -3702,7 +3736,7 @@ function ModelSelector({ models, value, onValueChange, pinnedIds = [], recentIds
|
|
|
3702
3736
|
const box = content.getBoundingClientRect();
|
|
3703
3737
|
const rows = Array.from(content.querySelectorAll("[data-model-value]"));
|
|
3704
3738
|
const row = rows.find((element) => element.dataset.modelValue === active) ?? rows.find((element) => element.dataset.modelValue?.endsWith(`::${value.modelId}`));
|
|
3705
|
-
const rowTop = row ? row
|
|
3739
|
+
const rowTop = row ? unscaledRect(row, content, box).top - 4 : 0;
|
|
3706
3740
|
const top = Math.round(Math.min(Math.max(8 - box.top, rowTop), window.innerHeight - box.top - card.offsetHeight - 8));
|
|
3707
3741
|
const side = box.right + card.offsetWidth + 8 > window.innerWidth ? "left" : "right";
|
|
3708
3742
|
setPanel((current) => current.top === top && current.side === side ? current : {
|
|
@@ -3739,12 +3773,12 @@ function ModelSelector({ models, value, onValueChange, pinnedIds = [], recentIds
|
|
|
3739
3773
|
const trailing = (model, pricing) => {
|
|
3740
3774
|
if (model.disabled && model.disabledReason) return /* @__PURE__ */ jsx("span", {
|
|
3741
3775
|
title: model.disabledReason,
|
|
3742
|
-
className: "truncate text-
|
|
3776
|
+
className: "truncate text-[0.6875rem] text-muted-foreground",
|
|
3743
3777
|
children: model.disabledReason
|
|
3744
3778
|
});
|
|
3745
3779
|
if (priceDisplay === "none" || !pricing) return null;
|
|
3746
3780
|
if (isFree(pricing)) return /* @__PURE__ */ jsx("span", {
|
|
3747
|
-
className: "text-
|
|
3781
|
+
className: "text-[0.6875rem] font-medium text-muted-foreground",
|
|
3748
3782
|
children: "Free"
|
|
3749
3783
|
});
|
|
3750
3784
|
if (priceDisplay === "price") return /* @__PURE__ */ jsx(PriceText, { pricing });
|
|
@@ -3754,6 +3788,7 @@ function ModelSelector({ models, value, onValueChange, pinnedIds = [], recentIds
|
|
|
3754
3788
|
const level = levelOf(model, levelFor(model));
|
|
3755
3789
|
const pricing = pricingOf(model, level);
|
|
3756
3790
|
const tags = model.tags?.filter((tag) => !(tag === "free" && isFree(pricing) && priceDisplay !== "none"));
|
|
3791
|
+
const current = model.id === value.modelId;
|
|
3757
3792
|
return /* @__PURE__ */ jsxs(CommandItem, {
|
|
3758
3793
|
value: `${section}::${model.id}`,
|
|
3759
3794
|
"data-model-value": `${section}::${model.id}`,
|
|
@@ -3765,37 +3800,38 @@ function ModelSelector({ models, value, onValueChange, pinnedIds = [], recentIds
|
|
|
3765
3800
|
],
|
|
3766
3801
|
disabled: model.disabled,
|
|
3767
3802
|
onSelect: () => choose(model),
|
|
3768
|
-
className: "h-
|
|
3803
|
+
className: "h-7.5 gap-2 rounded-sm px-2 py-0 pointer-coarse:h-11",
|
|
3769
3804
|
children: [
|
|
3770
3805
|
/* @__PURE__ */ jsx(ModelGlyph, { model }),
|
|
3771
3806
|
/* @__PURE__ */ jsxs("span", {
|
|
3772
3807
|
className: "flex min-w-0 flex-1 items-baseline gap-1.5",
|
|
3773
3808
|
children: [
|
|
3774
3809
|
/* @__PURE__ */ jsx("span", {
|
|
3810
|
+
dir: "auto",
|
|
3775
3811
|
title: model.name,
|
|
3776
|
-
className: "truncate text-foreground",
|
|
3812
|
+
className: "min-w-0 truncate text-[0.8125rem] font-medium text-foreground",
|
|
3777
3813
|
children: model.name
|
|
3778
3814
|
}),
|
|
3779
3815
|
level ? /* @__PURE__ */ jsx("span", {
|
|
3780
3816
|
title: level.label,
|
|
3781
|
-
className: "shrink truncate text-muted-foreground",
|
|
3817
|
+
className: "min-w-0 shrink-[8] truncate text-[0.6875rem] text-muted-foreground",
|
|
3782
3818
|
children: level.label
|
|
3783
3819
|
}) : null,
|
|
3784
3820
|
tags?.slice(0, MAX_ROW_TAGS).map((tag) => /* @__PURE__ */ jsx(Tag, { tag }, tag)),
|
|
3785
3821
|
tags && tags.length > MAX_ROW_TAGS ? /* @__PURE__ */ jsxs("span", {
|
|
3786
3822
|
title: tags.slice(MAX_ROW_TAGS).map((tag) => TAG_LABEL[tag]).join(", "),
|
|
3787
|
-
className: "shrink-0 text-
|
|
3823
|
+
className: "shrink-0 text-[0.6875rem] text-muted-foreground tabular-nums",
|
|
3788
3824
|
children: ["+", tags.length - MAX_ROW_TAGS]
|
|
3789
3825
|
}) : null
|
|
3790
3826
|
]
|
|
3791
3827
|
}),
|
|
3792
3828
|
/* @__PURE__ */ jsx("span", {
|
|
3793
|
-
className: "flex min-w-
|
|
3829
|
+
className: "flex min-w-10 shrink-0 justify-end text-muted-foreground",
|
|
3794
3830
|
children: trailing(model, pricing)
|
|
3795
3831
|
}),
|
|
3796
3832
|
/* @__PURE__ */ jsx(Check, {
|
|
3797
3833
|
"aria-hidden": "true",
|
|
3798
|
-
className: cn("size-3.5 shrink-0 text-foreground",
|
|
3834
|
+
className: cn("size-3.5 shrink-0 text-foreground", current ? "opacity-100" : "opacity-0")
|
|
3799
3835
|
})
|
|
3800
3836
|
]
|
|
3801
3837
|
}, `${section}::${model.id}`);
|
|
@@ -3807,6 +3843,7 @@ function ModelSelector({ models, value, onValueChange, pinnedIds = [], recentIds
|
|
|
3807
3843
|
setOpen(next);
|
|
3808
3844
|
if (next) {
|
|
3809
3845
|
setQuery("");
|
|
3846
|
+
setListHeight(void 0);
|
|
3810
3847
|
setPendingLevels({});
|
|
3811
3848
|
const home = [...sections.browsing, ...sections.all].find((section) => section.items.some((model) => model.id === value.modelId));
|
|
3812
3849
|
if (home) setHighlighted(`${home.id}::${value.modelId}`);
|
|
@@ -3816,28 +3853,29 @@ function ModelSelector({ models, value, onValueChange, pinnedIds = [], recentIds
|
|
|
3816
3853
|
"aria-label": selected ? `${label}: ${selected.name}${selectedLevel ? `, ${selectedLevel.label}` : ""}` : label,
|
|
3817
3854
|
disabled,
|
|
3818
3855
|
onClick: (event) => event.stopPropagation(),
|
|
3819
|
-
className: cn("flex h-
|
|
3856
|
+
className: cn("relative flex h-7 max-w-full min-w-0 cursor-pointer items-center gap-1.5 rounded-md px-1.5 text-xs font-medium text-foreground/85 outline-none", "hover:bg-overlay-hover hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 data-popup-open:bg-overlay-hover data-popup-open:text-foreground", "before:absolute before:inset-x-0 before:-inset-y-1.5", "transition-transform duration-(--duration-fast) motion-safe:active:scale-[0.96] disabled:cursor-not-allowed disabled:opacity-64", triggerClassName),
|
|
3820
3857
|
children: [
|
|
3821
3858
|
selected ? /* @__PURE__ */ jsx(ModelGlyph, { model: selected }) : null,
|
|
3822
3859
|
/* @__PURE__ */ jsx("span", {
|
|
3860
|
+
dir: "auto",
|
|
3823
3861
|
title: selected?.name ?? "Choose a model",
|
|
3824
3862
|
className: "truncate",
|
|
3825
3863
|
children: selected?.name ?? "Choose a model"
|
|
3826
3864
|
}),
|
|
3827
3865
|
selectedLevel ? /* @__PURE__ */ jsx("span", {
|
|
3828
3866
|
title: selectedLevel.label,
|
|
3829
|
-
className: "truncate text-muted-foreground",
|
|
3867
|
+
className: cn("truncate font-normal text-muted-foreground", levelClassName),
|
|
3830
3868
|
children: selectedLevel.label
|
|
3831
3869
|
}) : null,
|
|
3832
3870
|
/* @__PURE__ */ jsx(ChevronDown, {
|
|
3833
3871
|
"aria-hidden": "true",
|
|
3834
|
-
className: "size-3
|
|
3872
|
+
className: "size-3 shrink-0 text-muted-foreground"
|
|
3835
3873
|
})
|
|
3836
3874
|
]
|
|
3837
3875
|
}), /* @__PURE__ */ jsxs(PopoverContent, {
|
|
3838
3876
|
side,
|
|
3839
3877
|
align,
|
|
3840
|
-
className: cn("relative w-[min(
|
|
3878
|
+
className: cn(popoverSurfaceClass, "relative w-[min(17rem,calc(100vw-1.5rem))] p-0 max-sm:overflow-y-auto sm:overflow-visible", contentClassName),
|
|
3841
3879
|
children: [/* @__PURE__ */ jsx("div", {
|
|
3842
3880
|
ref: contentRef,
|
|
3843
3881
|
onPointerMove: (event) => {
|
|
@@ -3853,28 +3891,35 @@ function ModelSelector({ models, value, onValueChange, pinnedIds = [], recentIds
|
|
|
3853
3891
|
loop: true,
|
|
3854
3892
|
className: "rounded-[inherit]",
|
|
3855
3893
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
3856
|
-
className: "
|
|
3894
|
+
className: "mx-1 flex items-center gap-1 border-b border-border/70 py-1 *:data-[slot=command-input-wrapper]:min-w-0 *:data-[slot=command-input-wrapper]:flex-1 *:data-[slot=command-input-wrapper]:p-0",
|
|
3857
3895
|
children: [/* @__PURE__ */ jsx(CommandInput, {
|
|
3858
3896
|
value: query,
|
|
3859
|
-
onValueChange:
|
|
3897
|
+
onValueChange: (next) => {
|
|
3898
|
+
if (next && !query && listRef.current) setListHeight(listRef.current.offsetHeight);
|
|
3899
|
+
if (!next) setListHeight(void 0);
|
|
3900
|
+
setQuery(next);
|
|
3901
|
+
},
|
|
3860
3902
|
placeholder: "Search models",
|
|
3861
|
-
className: "
|
|
3903
|
+
className: "gap-2 px-2 [&_input]:h-7 [&_input]:text-[0.8125rem] [&_svg]:size-3.5"
|
|
3862
3904
|
}), canTogglePrice ? /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, { render: /* @__PURE__ */ jsx("button", {
|
|
3863
3905
|
type: "button",
|
|
3864
3906
|
"aria-label": "Show prices per million tokens",
|
|
3865
3907
|
"aria-pressed": priceDisplay === "price",
|
|
3866
3908
|
onClick: () => setPriceDisplay((current) => current === "price" ? "meter" : "price"),
|
|
3867
|
-
className: cn("
|
|
3909
|
+
className: cn("grid size-6 shrink-0 cursor-pointer place-items-center rounded-sm outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50", priceDisplay === "price" ? "bg-overlay-hover text-foreground" : "text-muted-foreground hover:bg-overlay-hover hover:text-foreground"),
|
|
3868
3910
|
children: /* @__PURE__ */ jsx(CircleDollarSign, {
|
|
3869
3911
|
"aria-hidden": "true",
|
|
3870
|
-
className: "size-
|
|
3912
|
+
className: "size-3.5"
|
|
3871
3913
|
})
|
|
3872
3914
|
}) }), /* @__PURE__ */ jsx(TooltipContent, { children: priceDisplay === "price" ? "Show relative cost" : "Show prices per 1M tokens" })] }) : null]
|
|
3873
3915
|
}), /* @__PURE__ */ jsxs(CommandList, {
|
|
3874
|
-
|
|
3916
|
+
ref: listRef,
|
|
3917
|
+
density: "compact",
|
|
3918
|
+
style: listHeight ? { height: listHeight } : void 0,
|
|
3919
|
+
className: "max-h-[min(20rem,50vh)]",
|
|
3875
3920
|
onScroll: placePanel,
|
|
3876
3921
|
children: [/* @__PURE__ */ jsx(CommandEmpty, {
|
|
3877
|
-
className: "py-6 text-center text-
|
|
3922
|
+
className: "py-6 text-center text-[0.8125rem] text-muted-foreground",
|
|
3878
3923
|
children: "No models matched"
|
|
3879
3924
|
}), visible.map((section) => /* @__PURE__ */ jsx(CommandGroup, {
|
|
3880
3925
|
heading: section.label,
|
|
@@ -3890,7 +3935,7 @@ function ModelSelector({ models, value, onValueChange, pinnedIds = [], recentIds
|
|
|
3890
3935
|
if (active && active !== highlighted) setHighlighted(active);
|
|
3891
3936
|
},
|
|
3892
3937
|
style: panel.side === "below" ? void 0 : { top: panel.top },
|
|
3893
|
-
className: cn(panel.side === "below" ? "border-t border-border" : cn("absolute w-
|
|
3938
|
+
className: cn("p-1", panel.side === "below" ? "mx-1 border-t border-border/70 px-0" : cn(popoverSurfaceClass, "absolute w-56", panel.side === "right" ? "left-full ml-1.5" : "right-full mr-1.5")),
|
|
3894
3939
|
children: /* @__PURE__ */ jsx(ModelDetails, {
|
|
3895
3940
|
model: detailModel,
|
|
3896
3941
|
levelId: levelFor(detailModel),
|
|
@@ -3975,41 +4020,44 @@ function PromptInputAttachments({ className, ...props }) {
|
|
|
3975
4020
|
|
|
3976
4021
|
//#endregion
|
|
3977
4022
|
//#region src/components/ai/ask-card.tsx
|
|
3978
|
-
|
|
3979
|
-
|
|
4023
|
+
function QuestionHeading({ id, icon, children }) {
|
|
4024
|
+
const glyph = icon === void 0 ? /* @__PURE__ */ jsx(CircleHelp, {}) : icon;
|
|
3980
4025
|
return /* @__PURE__ */ jsxs("div", {
|
|
3981
|
-
className: "flex
|
|
3982
|
-
children: [/* @__PURE__ */ jsx(
|
|
4026
|
+
className: "flex items-start gap-2",
|
|
4027
|
+
children: [glyph ? /* @__PURE__ */ jsx("span", {
|
|
3983
4028
|
"aria-hidden": "true",
|
|
3984
|
-
className: "
|
|
3985
|
-
|
|
4029
|
+
className: "flex h-5 shrink-0 items-center text-muted-foreground [&_svg]:size-4",
|
|
4030
|
+
children: glyph
|
|
4031
|
+
}) : null, /* @__PURE__ */ jsx("p", {
|
|
3986
4032
|
id,
|
|
3987
|
-
className: "min-w-0 text-pretty text-sm text-foreground [overflow-wrap:anywhere]",
|
|
4033
|
+
className: "min-w-0 text-pretty text-sm font-medium text-foreground [overflow-wrap:anywhere]",
|
|
3988
4034
|
children
|
|
3989
4035
|
})]
|
|
3990
4036
|
});
|
|
3991
4037
|
}
|
|
3992
|
-
|
|
4038
|
+
/** Radio dot: a ring at rest, a filled disc with a pip once chosen. */
|
|
4039
|
+
function RadioMark({ checked }) {
|
|
3993
4040
|
return /* @__PURE__ */ jsx("span", {
|
|
3994
4041
|
"aria-hidden": "true",
|
|
3995
|
-
className: cn("grid size-
|
|
3996
|
-
children
|
|
4042
|
+
className: cn("mt-0.5 grid size-4 shrink-0 place-items-center rounded-full border", checked ? "border-primary bg-primary" : "border-subtle-foreground/50"),
|
|
4043
|
+
children: checked ? /* @__PURE__ */ jsx("span", { className: cn("size-1.5 rounded-full bg-primary-foreground", iconEnterClass) }) : null
|
|
3997
4044
|
});
|
|
3998
4045
|
}
|
|
3999
|
-
function AskQuestionField({ question, choice, onChoose, otherLabel, disabled }) {
|
|
4046
|
+
function AskQuestionField({ question, choice, onChoose, otherLabel, icon, disabled }) {
|
|
4000
4047
|
const headingId = React$1.useId();
|
|
4001
4048
|
const otherValue = choice && "other" in choice ? choice.other : "";
|
|
4002
|
-
const rowClass = "flex min-h-
|
|
4049
|
+
const rowClass = "-mx-1.5 flex min-h-8 items-start gap-2.5 rounded-md px-1.5 py-1.5 text-start text-sm outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50";
|
|
4003
4050
|
return /* @__PURE__ */ jsxs("div", {
|
|
4004
|
-
className: "flex flex-col gap-
|
|
4051
|
+
className: "flex flex-col gap-2",
|
|
4005
4052
|
children: [/* @__PURE__ */ jsx(QuestionHeading, {
|
|
4006
4053
|
id: headingId,
|
|
4054
|
+
icon,
|
|
4007
4055
|
children: question.question
|
|
4008
4056
|
}), /* @__PURE__ */ jsxs("div", {
|
|
4009
4057
|
role: "radiogroup",
|
|
4010
4058
|
"aria-labelledby": headingId,
|
|
4011
|
-
className: "flex flex-col gap-
|
|
4012
|
-
children: [question.options.map((option
|
|
4059
|
+
className: "flex flex-col gap-0.5",
|
|
4060
|
+
children: [question.options.map((option) => {
|
|
4013
4061
|
const checked = Boolean(choice && "option" in choice && choice.option === option.id);
|
|
4014
4062
|
return /* @__PURE__ */ jsxs("button", {
|
|
4015
4063
|
type: "button",
|
|
@@ -4017,21 +4065,15 @@ function AskQuestionField({ question, choice, onChoose, otherLabel, disabled })
|
|
|
4017
4065
|
"aria-checked": checked,
|
|
4018
4066
|
disabled,
|
|
4019
4067
|
onClick: () => onChoose({ option: option.id }),
|
|
4020
|
-
className: cn(rowClass, "cursor-pointer disabled:cursor-not-allowed disabled:opacity-64", checked ? "
|
|
4021
|
-
children: [/* @__PURE__ */ jsx(
|
|
4022
|
-
active: checked,
|
|
4023
|
-
children: KEYS[index]
|
|
4024
|
-
}), /* @__PURE__ */ jsx("span", {
|
|
4068
|
+
className: cn(rowClass, "cursor-pointer hover:bg-overlay-hover disabled:cursor-not-allowed disabled:opacity-64", checked ? "bg-overlay-hover text-foreground" : "text-muted-foreground hover:text-foreground"),
|
|
4069
|
+
children: [/* @__PURE__ */ jsx(RadioMark, { checked }), /* @__PURE__ */ jsx("span", {
|
|
4025
4070
|
className: "min-w-0 flex-1 [overflow-wrap:anywhere]",
|
|
4026
4071
|
children: option.label
|
|
4027
4072
|
})]
|
|
4028
4073
|
}, option.id);
|
|
4029
4074
|
}), question.allowOther !== false ? /* @__PURE__ */ jsxs("label", {
|
|
4030
|
-
className: cn(rowClass, "cursor-text focus-within:
|
|
4031
|
-
children: [/* @__PURE__ */ jsx(
|
|
4032
|
-
active: Boolean(otherValue),
|
|
4033
|
-
children: KEYS[question.options.length]
|
|
4034
|
-
}), /* @__PURE__ */ jsx("input", {
|
|
4075
|
+
className: cn(rowClass, "cursor-text focus-within:bg-overlay-hover", otherValue && "bg-overlay-hover"),
|
|
4076
|
+
children: [/* @__PURE__ */ jsx(RadioMark, { checked: Boolean(otherValue) }), /* @__PURE__ */ jsx("input", {
|
|
4035
4077
|
type: "text",
|
|
4036
4078
|
value: otherValue,
|
|
4037
4079
|
disabled,
|
|
@@ -4058,16 +4100,22 @@ function AnswerChip({ children, muted }) {
|
|
|
4058
4100
|
});
|
|
4059
4101
|
}
|
|
4060
4102
|
/**
|
|
4061
|
-
* Inline clarifying questions from an agent. Each question
|
|
4062
|
-
* options plus a free-text row;
|
|
4063
|
-
* question
|
|
4103
|
+
* Inline clarifying questions from an agent, one at a time. Each question
|
|
4104
|
+
* offers its options as radio rows plus a free-text row; Continue moves to the
|
|
4105
|
+
* next question and submits after the last. The card settles into a one-line
|
|
4106
|
+
* summary per question once answered or skipped.
|
|
4064
4107
|
*/
|
|
4065
|
-
function AskCard({ questions, answer, onSubmit, onSkip, continueLabel = "Continue", skipLabel = "Skip", otherLabel = "Something else", disabled, className, ...props }) {
|
|
4108
|
+
function AskCard({ questions, answer, onSubmit, onSkip, continueLabel = "Continue", skipLabel = "Skip", otherLabel = "Something else", eyebrow, icon, disabled, className, ...props }) {
|
|
4066
4109
|
const [choices, setChoices] = React$1.useState({});
|
|
4067
|
-
const
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4110
|
+
const [page, setPage] = React$1.useState(0);
|
|
4111
|
+
const answered = (question) => {
|
|
4112
|
+
const choice = question ? choices[question.id] : void 0;
|
|
4113
|
+
return Boolean(choice && ("option" in choice || choice.other.trim().length > 0));
|
|
4114
|
+
};
|
|
4115
|
+
const complete = questions.every(answered);
|
|
4116
|
+
const current = questions[Math.min(page, questions.length - 1)];
|
|
4117
|
+
const last = page >= questions.length - 1;
|
|
4118
|
+
const paged = questions.length > 1;
|
|
4071
4119
|
if (answer) return /* @__PURE__ */ jsx("div", {
|
|
4072
4120
|
"data-slot": "ask-card",
|
|
4073
4121
|
"data-state": "answered",
|
|
@@ -4077,55 +4125,105 @@ function AskCard({ questions, answer, onSubmit, onSkip, continueLabel = "Continu
|
|
|
4077
4125
|
const choice = "choices" in answer ? answer.choices[question.id] : void 0;
|
|
4078
4126
|
const label = choice ? "option" in choice ? question.options.find((option) => option.id === choice.option)?.label : `“${choice.other}”` : void 0;
|
|
4079
4127
|
return /* @__PURE__ */ jsxs("div", {
|
|
4080
|
-
className: "flex
|
|
4081
|
-
children: [
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
/* @__PURE__ */ jsx("p", {
|
|
4128
|
+
className: "flex items-start gap-2",
|
|
4129
|
+
children: [/* @__PURE__ */ jsx(CircleHelp, {
|
|
4130
|
+
"aria-hidden": "true",
|
|
4131
|
+
className: "mt-0.5 size-4 shrink-0 text-muted-foreground"
|
|
4132
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
4133
|
+
className: "flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",
|
|
4134
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
4087
4135
|
className: "min-w-0 text-pretty text-sm text-foreground [overflow-wrap:anywhere]",
|
|
4088
4136
|
children: question.question
|
|
4089
|
-
}),
|
|
4090
|
-
label ? /* @__PURE__ */ jsx(AnswerChip, { children: label }) : /* @__PURE__ */ jsx(AnswerChip, {
|
|
4137
|
+
}), label ? /* @__PURE__ */ jsx(AnswerChip, { children: label }) : /* @__PURE__ */ jsx(AnswerChip, {
|
|
4091
4138
|
muted: true,
|
|
4092
4139
|
children: "Skipped"
|
|
4093
|
-
})
|
|
4094
|
-
]
|
|
4140
|
+
})]
|
|
4141
|
+
})]
|
|
4095
4142
|
}, question.id);
|
|
4096
4143
|
})
|
|
4097
4144
|
});
|
|
4098
4145
|
return /* @__PURE__ */ jsxs("div", {
|
|
4099
4146
|
"data-slot": "ask-card",
|
|
4100
4147
|
"data-state": "open",
|
|
4101
|
-
className: cn("flex animate-[ai-fade-up_var(--duration-slow)_var(--ease-out)_both] flex-col gap-3 rounded-xl bg-card p-
|
|
4148
|
+
className: cn("flex animate-[ai-fade-up_var(--duration-slow)_var(--ease-out)_both] flex-col gap-3 rounded-xl bg-card p-3 shadow-card motion-reduce:animate-none", className),
|
|
4102
4149
|
...props,
|
|
4103
|
-
children: [
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4150
|
+
children: [
|
|
4151
|
+
eyebrow ? /* @__PURE__ */ jsx("div", {
|
|
4152
|
+
className: "-mb-1 flex min-h-4 items-center gap-1.5 text-xs text-muted-foreground [&_svg]:size-3.5 [&_svg]:shrink-0",
|
|
4153
|
+
children: eyebrow
|
|
4154
|
+
}) : null,
|
|
4155
|
+
current ? /* @__PURE__ */ jsx("div", {
|
|
4156
|
+
className: "animate-[ai-fade-up_var(--duration-slow)_var(--ease-out)_both] motion-reduce:animate-none",
|
|
4157
|
+
children: /* @__PURE__ */ jsx(AskQuestionField, {
|
|
4158
|
+
question: current,
|
|
4159
|
+
choice: choices[current.id],
|
|
4160
|
+
disabled,
|
|
4161
|
+
otherLabel,
|
|
4162
|
+
icon,
|
|
4163
|
+
onChoose: (choice) => setChoices((value) => {
|
|
4164
|
+
const next = { ...value };
|
|
4165
|
+
if (choice) next[current.id] = choice;
|
|
4166
|
+
else delete next[current.id];
|
|
4167
|
+
return next;
|
|
4168
|
+
})
|
|
4169
|
+
})
|
|
4170
|
+
}, current.id) : null,
|
|
4171
|
+
/* @__PURE__ */ jsxs("div", {
|
|
4172
|
+
className: "flex flex-wrap items-center gap-2",
|
|
4173
|
+
children: [paged ? /* @__PURE__ */ jsxs("div", {
|
|
4174
|
+
className: "-ms-1 flex items-center text-xs text-muted-foreground tabular-nums",
|
|
4175
|
+
children: [
|
|
4176
|
+
/* @__PURE__ */ jsx(Button, {
|
|
4177
|
+
size: "icon-xs",
|
|
4178
|
+
variant: "ghost",
|
|
4179
|
+
"aria-label": "Previous question",
|
|
4180
|
+
disabled: page === 0,
|
|
4181
|
+
onClick: () => setPage(page - 1),
|
|
4182
|
+
children: /* @__PURE__ */ jsx(ChevronUp, { "aria-hidden": "true" })
|
|
4183
|
+
}),
|
|
4184
|
+
/* @__PURE__ */ jsxs("span", {
|
|
4185
|
+
"aria-hidden": "true",
|
|
4186
|
+
children: [
|
|
4187
|
+
page + 1,
|
|
4188
|
+
"/",
|
|
4189
|
+
questions.length
|
|
4190
|
+
]
|
|
4191
|
+
}),
|
|
4192
|
+
/* @__PURE__ */ jsxs("span", {
|
|
4193
|
+
className: "sr-only",
|
|
4194
|
+
children: [
|
|
4195
|
+
"Question ",
|
|
4196
|
+
page + 1,
|
|
4197
|
+
" of ",
|
|
4198
|
+
questions.length
|
|
4199
|
+
]
|
|
4200
|
+
}),
|
|
4201
|
+
/* @__PURE__ */ jsx(Button, {
|
|
4202
|
+
size: "icon-xs",
|
|
4203
|
+
variant: "ghost",
|
|
4204
|
+
"aria-label": "Next question",
|
|
4205
|
+
disabled: last || !answered(current),
|
|
4206
|
+
onClick: () => setPage(page + 1),
|
|
4207
|
+
children: /* @__PURE__ */ jsx(ChevronDown, { "aria-hidden": "true" })
|
|
4208
|
+
})
|
|
4209
|
+
]
|
|
4210
|
+
}) : null, /* @__PURE__ */ jsxs("div", {
|
|
4211
|
+
className: "ms-auto flex flex-wrap items-center gap-1.5",
|
|
4212
|
+
children: [onSkip ? /* @__PURE__ */ jsx(Button, {
|
|
4213
|
+
size: "sm",
|
|
4214
|
+
variant: "secondary",
|
|
4215
|
+
disabled,
|
|
4216
|
+
onClick: onSkip,
|
|
4217
|
+
children: skipLabel
|
|
4218
|
+
}) : null, /* @__PURE__ */ jsx(Button, {
|
|
4219
|
+
size: "sm",
|
|
4220
|
+
disabled: disabled || (last ? !complete : !answered(current)),
|
|
4221
|
+
onClick: () => last ? onSubmit?.(choices) : setPage(page + 1),
|
|
4222
|
+
children: continueLabel
|
|
4223
|
+
})]
|
|
4224
|
+
})]
|
|
4113
4225
|
})
|
|
4114
|
-
|
|
4115
|
-
className: "flex flex-wrap items-center gap-2",
|
|
4116
|
-
children: [/* @__PURE__ */ jsx(Button, {
|
|
4117
|
-
size: "xs",
|
|
4118
|
-
disabled: disabled || !complete,
|
|
4119
|
-
onClick: () => onSubmit?.(choices),
|
|
4120
|
-
children: continueLabel
|
|
4121
|
-
}), onSkip ? /* @__PURE__ */ jsx(Button, {
|
|
4122
|
-
size: "xs",
|
|
4123
|
-
variant: "outline",
|
|
4124
|
-
disabled,
|
|
4125
|
-
onClick: onSkip,
|
|
4126
|
-
children: skipLabel
|
|
4127
|
-
}) : null]
|
|
4128
|
-
})]
|
|
4226
|
+
]
|
|
4129
4227
|
});
|
|
4130
4228
|
}
|
|
4131
4229
|
|
|
@@ -4283,4 +4381,4 @@ function AgentDraftCard({ name, badge = "Draft", schedule, tools = [], steps = [
|
|
|
4283
4381
|
|
|
4284
4382
|
//#endregion
|
|
4285
4383
|
export { useChatContainer as $, PromptSuggestions as A, normalizeToolStatus as B, TaskRow as C, DiffTable as D, PlanTracker as E, Sources as F, ThinkingTrace as G, ChainOfThoughtStep as H, ApprovalCard as I, formatDuration as J, Reasoning as K, StatusIcon as L, InlineDiff as M, lineDiff as N, StreamingText as O, Source as P, ChatContainerContent as Q, Tool as R, TaskList as S, formatCompact as T, Step as U, ChainOfThought as V, Steps as W, ScrollButton as X, SystemMessage as Y, ChatContainer as Z, AiImage as _, AgentLoader as _t, PromptInputAttachments as a, MessageAvatar as at, ContextCard as b, UsageNotice as c, renderBasicMarkdown as ct, PromptInputTrayRow as d, PromptInput as dt, ResponseStream as et, ThinkingStatus as f, PromptInputAction as ft, iconEnterClass as g, usePromptInput as gt, MarkTile as h, PromptInputTextarea as ht, PromptInputAttachment as i, MessageActions as it, FeedbackBar as j, PromptSuggestion as k, usageTone as l, STREAM_THROTTLE_MS as lt, ToolTrace as m, PromptInputBody as mt, ConnectPrompt as n, Message as nt, CostBlocks as o, MessageContent as ot, formatElapsed as p, PromptInputActions as pt, ThinkingBar as q, AskCard as r, MessageAction as rt, ModelSelector as s, Markdown as st, AgentDraftCard as t, CodeBlock as tt, PromptInputTray as u, useThrottledText as ut, FileUpload as v, Loader as vt, ContextRing as w, ContextCards as x, RecommendationCard as y, TextShimmer as yt, ToolGroup as z };
|
|
4286
|
-
//# sourceMappingURL=ai-
|
|
4384
|
+
//# sourceMappingURL=ai-4JrVVL3q.js.map
|