@mcp-b/react-components 0.14.1 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AgentActivity-BNUNrP9O.d.ts +36 -0
- package/dist/{AgentChat-Cgb1xuT7.d.ts → AgentChat-CrlpbvQJ.d.ts} +62 -8
- package/dist/{CodeBlock-DUh9WOGo.d.ts → CodeBlock-BRajW4QU.d.ts} +1 -1
- package/dist/{CodeBlock-BUFXG8HW.js → CodeBlock-BmB4Xaqq.js} +15 -4
- package/dist/{FileTree-mpEIcfzA.js → FileTree-CkVbIMWV.js} +82 -89
- package/dist/Message-BkMdE3bS.js +375 -0
- package/dist/{ModelSelector-DVgVBdvw.js → ModelSelector-SlJNgwKY.js} +17 -8
- package/dist/{PromptInput-ClNqBiIw.d.ts → PromptInput-BWTuXMOD.d.ts} +123 -5
- package/dist/ResponsiveSidebarShell-Dd9DCcBT.d.ts +67 -0
- package/dist/{Select-Dl_vF_Bt.d.ts → Select-BeEsefzh.d.ts} +12 -2
- package/dist/{ThinkChat-7DQ2CogF.js → ThinkChat-CzC-zNGA.js} +27 -37
- package/dist/{ThinkChatActivity-m9orbdeI.d.ts → ThinkChatActivity-BFQnb2ct.d.ts} +3 -10
- package/dist/ThinkChatActivitySummary-BPmu9a-c.d.ts +39 -0
- package/dist/{ThinkChatToolParts-Cv4o7j6F.d.ts → ThinkChatToolParts-CSzVwMXf.d.ts} +62 -3
- package/dist/ThinkExecutionRun-ChhWhOoU.d.ts +30 -0
- package/dist/Toggle-CAAlNl-M.d.ts +69 -0
- package/dist/ToggleGroup-8hPv-b69.d.ts +73 -0
- package/dist/Workspace-D39LxGvP.d.ts +62 -0
- package/dist/WorkspaceFile-DOZkPwzu.d.ts +106 -0
- package/dist/WorkspaceFileView-rSN_yT0L.js +744 -0
- package/dist/WorkspaceLink-DIPbXrUM.js +337 -0
- package/dist/WorkspaceLink-DK1DWMHe.d.ts +89 -0
- package/dist/components/Activity.d.ts +27 -1
- package/dist/components/Activity.js +33 -15
- package/dist/components/AgentActivity.d.ts +2 -0
- package/dist/components/AgentActivity.js +45 -0
- package/dist/components/AgentActivityPreview.d.ts +46 -0
- package/dist/components/AgentActivityPreview.js +94 -0
- package/dist/components/AgentAttention.d.ts +73 -0
- package/dist/components/AgentAttention.js +85 -0
- package/dist/components/AgentChat.d.ts +2 -2
- package/dist/components/AgentChat.js +231 -205
- package/dist/components/AgentChatMessageEditor.d.ts +29 -0
- package/dist/components/AgentChatMessageEditor.js +92 -0
- package/dist/components/AgentChatTurnError.d.ts +17 -0
- package/dist/components/AgentChatTurnError.js +40 -0
- package/dist/components/AgentConnection.d.ts +12 -17
- package/dist/components/AgentConnection.js +99 -91
- package/dist/components/AppFrame.d.ts +24 -0
- package/dist/components/AppFrame.js +25 -0
- package/dist/components/AppTopBar.d.ts +71 -0
- package/dist/components/AppTopBar.js +82 -0
- package/dist/components/Artifact.js +1 -1
- package/dist/components/BrowserLiveView.js +1 -1
- package/dist/components/BrowserReplay.js +1 -1
- package/dist/components/BrowserRunPanel.js +1 -1
- package/dist/components/Card.d.ts +3 -0
- package/dist/components/Card.js +2 -1
- package/dist/components/ChainOfThought.d.ts +1 -1
- package/dist/components/ChainOfThought.js +1 -1
- package/dist/components/ChatGptSignInScreen.js +2 -2
- package/dist/components/Checkbox.js +5 -13
- package/dist/components/CheckboxGroup.d.ts +58 -2
- package/dist/components/CheckboxGroup.js +59 -1
- package/dist/components/CodeBlock.d.ts +1 -1
- package/dist/components/CodeBlock.js +1 -1
- package/dist/components/CodexModelSelector.js +1 -1
- package/dist/components/Commit.js +2 -2
- package/dist/components/ContextMenu.js +1 -1
- package/dist/components/Conversation.js +1 -1
- package/dist/components/DescriptionList.d.ts +12 -0
- package/dist/components/DescriptionList.js +11 -0
- package/dist/components/DescriptionListParts.d.ts +37 -0
- package/dist/components/DescriptionListParts.js +35 -0
- package/dist/components/EnvironmentVariables.js +2 -2
- package/dist/components/Fieldset.d.ts +13 -1
- package/dist/components/Fieldset.js +11 -2
- package/dist/components/FileTree.js +1 -1
- package/dist/components/IconButton.d.ts +33 -0
- package/dist/components/IconButton.js +27 -0
- package/dist/components/McpConnectionRequest.d.ts +44 -0
- package/dist/components/McpConnectionRequest.js +122 -0
- package/dist/components/McpServerPicker.d.ts +48 -23
- package/dist/components/McpServerPicker.js +238 -189
- package/dist/components/Menubar.js +1 -1
- package/dist/components/Message.d.ts +1 -0
- package/dist/components/Message.js +1 -285
- package/dist/components/MessageScroller.js +1 -1
- package/dist/components/ModelSelector.d.ts +15 -3
- package/dist/components/ModelSelector.js +1 -1
- package/dist/components/NaniteScene.d.ts +10 -1
- package/dist/components/NaniteScene.js +36 -1
- package/dist/components/Pricing.d.ts +37 -0
- package/dist/components/Pricing.js +17 -0
- package/dist/components/PricingBillingToggle.d.ts +23 -0
- package/dist/components/PricingBillingToggle.js +86 -0
- package/dist/components/PricingConfirmationDialog.d.ts +25 -0
- package/dist/components/PricingConfirmationDialog.js +57 -0
- package/dist/components/PricingFAQ.d.ts +18 -0
- package/dist/components/PricingFAQ.js +27 -0
- package/dist/components/PricingPage.d.ts +2 -38
- package/dist/components/PricingPage.js +39 -359
- package/dist/components/PricingPlanCard.d.ts +22 -0
- package/dist/components/PricingPlanCard.js +109 -0
- package/dist/components/PricingUsageCalculator.d.ts +22 -0
- package/dist/components/PricingUsageCalculator.js +96 -0
- package/dist/components/PromptInput.d.ts +2 -2
- package/dist/components/PromptInput.js +210 -15
- package/dist/components/Queue.js +1 -1
- package/dist/components/Reasoning.d.ts +2 -1
- package/dist/components/Reasoning.js +14 -29
- package/dist/components/ResizableSidePanel.d.ts +57 -0
- package/dist/components/ResizableSidePanel.js +151 -0
- package/dist/components/ResponsiveSidebarShell.d.ts +2 -0
- package/dist/components/ResponsiveSidebarShell.js +129 -0
- package/dist/components/Select.d.ts +2 -2
- package/dist/components/Select.js +11 -2
- package/dist/components/Slider.d.ts +13 -1
- package/dist/components/Slider.js +11 -0
- package/dist/components/Sources.js +1 -1
- package/dist/components/Stepper.d.ts +4 -0
- package/dist/components/Stepper.js +5 -3
- package/dist/components/SubagentRun.d.ts +86 -0
- package/dist/components/SubagentRun.js +108 -0
- package/dist/components/SubagentRunDetails.d.ts +44 -0
- package/dist/components/SubagentRunDetails.js +48 -0
- package/dist/components/SubagentRunIndicator.d.ts +22 -0
- package/dist/components/SubagentRunIndicator.js +33 -0
- package/dist/components/SubagentRunList.d.ts +25 -0
- package/dist/components/SubagentRunList.js +26 -0
- package/dist/components/SubagentRunSelector.d.ts +47 -0
- package/dist/components/SubagentRunSelector.js +55 -0
- package/dist/components/Task.js +1 -1
- package/dist/components/Terminal.js +2 -2
- package/dist/components/TestResults.js +1 -1
- package/dist/components/Textarea.d.ts +21 -0
- package/dist/components/Textarea.js +19 -0
- package/dist/components/ThemeModeControl.d.ts +24 -0
- package/dist/components/ThemeModeControl.js +52 -0
- package/dist/components/ThemeProvider.d.ts +38 -0
- package/dist/components/ThemeProvider.js +80 -0
- package/dist/components/ThinkChat.d.ts +34 -7
- package/dist/components/ThinkChat.js +7 -4
- package/dist/components/ThinkChatActivity.d.ts +3 -2
- package/dist/components/ThinkChatActivity.js +18 -297
- package/dist/components/ThinkChatActivitySummary.d.ts +2 -0
- package/dist/components/ThinkChatActivitySummary.js +421 -0
- package/dist/components/ThinkChatToolPanels.d.ts +15 -5
- package/dist/components/ThinkChatToolPanels.js +116 -9
- package/dist/components/ThinkChatToolParts.d.ts +2 -2
- package/dist/components/ThinkChatToolParts.js +51 -9
- package/dist/components/ThinkExecutionDetail.d.ts +20 -0
- package/dist/components/ThinkExecutionDetail.js +80 -0
- package/dist/components/ThinkExecutionRun.d.ts +2 -0
- package/dist/components/ThinkExecutionRun.js +72 -0
- package/dist/components/ThinkExecutionStatus.d.ts +22 -0
- package/dist/components/ThinkExecutionStatus.js +36 -0
- package/dist/components/ThinkExecutionWorkbench.d.ts +7 -0
- package/dist/components/ThinkExecutionWorkbench.js +69 -225
- package/dist/components/ThinkFullApp.d.ts +58 -14
- package/dist/components/ThinkFullApp.js +129 -160
- package/dist/components/ThinkFullAppViewSwitch.d.ts +31 -0
- package/dist/components/ThinkFullAppViewSwitch.js +34 -0
- package/dist/components/ThinkRoutine.d.ts +36 -0
- package/dist/components/ThinkRoutine.js +15 -0
- package/dist/components/ThinkRoutineBrowser.d.ts +25 -0
- package/dist/components/ThinkRoutineBrowser.js +156 -0
- package/dist/components/ThinkRoutineDetail.d.ts +24 -0
- package/dist/components/ThinkRoutineDetail.js +102 -0
- package/dist/components/ThinkRoutineForm.d.ts +32 -0
- package/dist/components/ThinkRoutineForm.js +151 -0
- package/dist/components/ThinkRoutineLibrary.d.ts +74 -0
- package/dist/components/ThinkRoutineLibrary.js +178 -0
- package/dist/components/ThinkRoutineRuns.d.ts +24 -0
- package/dist/components/ThinkRoutineRuns.js +68 -0
- package/dist/components/ThinkThreadPicker.d.ts +18 -1
- package/dist/components/ThinkThreadPicker.js +51 -5
- package/dist/components/ThinkThreadShell.d.ts +12 -9
- package/dist/components/ThinkThreadShell.js +17 -137
- package/dist/components/Toggle.d.ts +1 -68
- package/dist/components/ToggleGroup.d.ts +1 -72
- package/dist/components/Tooltip.d.ts +3 -1
- package/dist/components/Tooltip.js +4 -2
- package/dist/components/WebPreview.js +1 -1
- package/dist/components/Workspace.d.ts +2 -0
- package/dist/components/Workspace.js +424 -0
- package/dist/components/WorkspaceBrowser.d.ts +32 -0
- package/dist/components/WorkspaceBrowser.js +103 -0
- package/dist/components/WorkspaceExplorer.d.ts +12 -79
- package/dist/components/WorkspaceExplorer.js +116 -330
- package/dist/components/WorkspaceFile.d.ts +2 -0
- package/dist/components/WorkspaceFile.js +195 -0
- package/dist/components/WorkspaceFileView.d.ts +26 -0
- package/dist/components/WorkspaceFileView.js +2 -0
- package/dist/components/WorkspaceHeader.d.ts +35 -0
- package/dist/components/WorkspaceHeader.js +51 -0
- package/dist/components/WorkspaceLink.d.ts +2 -0
- package/dist/components/WorkspaceLink.js +2 -0
- package/dist/components/icons.d.ts +2 -2
- package/dist/components/icons.js +2 -2
- package/dist/{copy-button-DUMLYdsk.js → copy-button-Dejn5heL.js} +1 -1
- package/dist/icons-CpfUer49.js +85 -0
- package/dist/{icons-CUCz_Sft.d.ts → icons-GQd1xF4e.d.ts} +51 -1
- package/dist/styles/activity-header.css +75 -0
- package/dist/styles/activity.css +49 -63
- package/dist/styles/agent-activity-preview-overlay.css +80 -0
- package/dist/styles/agent-activity-preview.css +235 -0
- package/dist/styles/agent-attention.css +122 -0
- package/dist/styles/agent-chat.css +141 -4
- package/dist/styles/app-frame.css +15 -0
- package/dist/styles/app-top-bar.css +100 -0
- package/dist/styles/avatar.css +0 -1
- package/dist/styles/browser-control-overlay.css +184 -0
- package/dist/styles/card.css +21 -0
- package/dist/styles/checkbox-group.css +69 -0
- package/dist/styles/description-list.css +50 -0
- package/dist/styles/fieldset.css +11 -0
- package/dist/styles/index.css +15 -2
- package/dist/styles/mcp-connection-request.css +60 -0
- package/dist/styles/mcp-server-picker.css +95 -68
- package/dist/styles/message.css +4 -43
- package/dist/styles/nanite-scene.css +16 -0
- package/dist/styles/pricing-page.css +21 -27
- package/dist/styles/prompt-input.css +225 -32
- package/dist/styles/reasoning.css +1 -55
- package/dist/styles/recipes.css +23 -15
- package/dist/styles/resizable-side-panel.css +66 -0
- package/dist/styles/responsive-sidebar-shell.css +169 -0
- package/dist/styles/select.css +10 -0
- package/dist/styles/stepper.css +13 -0
- package/dist/styles/streamdown.css +0 -4
- package/dist/styles/subagent-run.css +205 -0
- package/dist/styles/textarea.css +20 -0
- package/dist/styles/theme-mode-control.css +72 -0
- package/dist/styles/think-execution-status.css +49 -0
- package/dist/styles/think-execution-workbench.css +8 -72
- package/dist/styles/think-full-app.css +106 -131
- package/dist/styles/think-routine-library.css +491 -0
- package/dist/styles/think-thread-picker.css +47 -3
- package/dist/styles/toggle-group.css +7 -0
- package/dist/styles/workspace-explorer.css +511 -64
- package/dist/utils/codex-model-catalog.d.ts +4 -4
- package/dist/utils/mcp-server-catalog.d.ts +82 -78
- package/dist/utils/mcp-server-catalog.js +64 -41
- package/dist/utils/structured-code.d.ts +1 -1
- package/dist/utils/theme.d.ts +22 -0
- package/dist/utils/theme.js +55 -0
- package/package.json +34 -28
- package/dist/icons-Ba9THQKz.js +0 -64
- package/dist/styles/think-resize-handle.css +0 -33
- package/dist/styles/think-thread-shell.css +0 -219
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
2
|
+
import { O as MinusIcon, S as InfoIcon, o as CheckIcon } from "../icons-CpfUer49.js";
|
|
3
|
+
import { Button } from "./Button.js";
|
|
4
|
+
import { Separator } from "./Separator.js";
|
|
5
|
+
import { Tooltip } from "./Tooltip.js";
|
|
6
|
+
import { Badge } from "./Badge.js";
|
|
7
|
+
import { Card } from "./Card.js";
|
|
8
|
+
import { getPlanPrice, getPlanYearlySavings } from "./Pricing.js";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
//#region src/components/PricingPlanCard.tsx
|
|
11
|
+
function getPlanActionLabel(plan, action) {
|
|
12
|
+
if (action === "current") return "Current Plan";
|
|
13
|
+
if (action === "upgrade") return "Upgrade";
|
|
14
|
+
if (action === "downgrade") return "Downgrade";
|
|
15
|
+
if (action === "switch") return "Switch Plan";
|
|
16
|
+
return plan.cta ?? "Get Started";
|
|
17
|
+
}
|
|
18
|
+
/** A single plan card with shared Badge, Button, Separator, and Tooltip primitives. */
|
|
19
|
+
function PricingPlanCard({ plan, billingPeriod, action = "select", onSelect, className }) {
|
|
20
|
+
const price = getPlanPrice(plan, billingPeriod);
|
|
21
|
+
const yearlySavings = getPlanYearlySavings(plan);
|
|
22
|
+
return /* @__PURE__ */ jsxs(Card, {
|
|
23
|
+
hover: true,
|
|
24
|
+
className: cx("pricing-page__plan", className),
|
|
25
|
+
"data-popular": plan.popular || void 0,
|
|
26
|
+
children: [
|
|
27
|
+
plan.popular ? /* @__PURE__ */ jsx(Badge, {
|
|
28
|
+
color: "success",
|
|
29
|
+
className: "pricing-page__popular-badge",
|
|
30
|
+
children: "Most Popular"
|
|
31
|
+
}) : null,
|
|
32
|
+
/* @__PURE__ */ jsxs("div", {
|
|
33
|
+
className: "pricing-page__plan-header",
|
|
34
|
+
children: [/* @__PURE__ */ jsx("h2", {
|
|
35
|
+
className: "pricing-page__plan-name",
|
|
36
|
+
children: plan.name
|
|
37
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
38
|
+
className: "pricing-page__plan-description",
|
|
39
|
+
children: plan.description
|
|
40
|
+
})]
|
|
41
|
+
}),
|
|
42
|
+
/* @__PURE__ */ jsxs("div", {
|
|
43
|
+
className: "pricing-page__plan-price",
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ jsxs("span", {
|
|
46
|
+
className: "pricing-page__price-amount",
|
|
47
|
+
children: ["$", price]
|
|
48
|
+
}),
|
|
49
|
+
/* @__PURE__ */ jsx("span", {
|
|
50
|
+
className: "pricing-page__price-period",
|
|
51
|
+
children: "/month"
|
|
52
|
+
}),
|
|
53
|
+
billingPeriod === "yearly" && yearlySavings > 0 ? /* @__PURE__ */ jsxs("span", {
|
|
54
|
+
className: "pricing-page__price-savings",
|
|
55
|
+
children: [
|
|
56
|
+
"Save $",
|
|
57
|
+
yearlySavings,
|
|
58
|
+
"/year"
|
|
59
|
+
]
|
|
60
|
+
}) : null
|
|
61
|
+
]
|
|
62
|
+
}),
|
|
63
|
+
/* @__PURE__ */ jsx(Button, {
|
|
64
|
+
variant: action === "current" || !plan.popular ? "outline" : "normal",
|
|
65
|
+
className: "pricing-page__plan-cta",
|
|
66
|
+
onClick: () => onSelect?.(plan),
|
|
67
|
+
disabled: action === "current",
|
|
68
|
+
children: getPlanActionLabel(plan, action)
|
|
69
|
+
}),
|
|
70
|
+
/* @__PURE__ */ jsx(Separator, { className: "pricing-page__features-separator" }),
|
|
71
|
+
/* @__PURE__ */ jsx("ul", {
|
|
72
|
+
className: "pricing-page__features",
|
|
73
|
+
children: plan.features.map((feature) => /* @__PURE__ */ jsxs("li", {
|
|
74
|
+
className: "pricing-page__feature",
|
|
75
|
+
"data-included": feature.included || void 0,
|
|
76
|
+
children: [
|
|
77
|
+
/* @__PURE__ */ jsx("span", {
|
|
78
|
+
className: "pricing-page__feature-icon",
|
|
79
|
+
"aria-hidden": "true",
|
|
80
|
+
children: feature.included ? /* @__PURE__ */ jsx(CheckIcon, {}) : /* @__PURE__ */ jsx(MinusIcon, {})
|
|
81
|
+
}),
|
|
82
|
+
/* @__PURE__ */ jsxs("span", {
|
|
83
|
+
className: "pricing-page__feature-name",
|
|
84
|
+
children: [feature.name, feature.limit ? /* @__PURE__ */ jsxs("span", {
|
|
85
|
+
className: "pricing-page__feature-limit",
|
|
86
|
+
children: [
|
|
87
|
+
"(",
|
|
88
|
+
feature.limit,
|
|
89
|
+
")"
|
|
90
|
+
]
|
|
91
|
+
}) : null]
|
|
92
|
+
}),
|
|
93
|
+
feature.tooltip ? /* @__PURE__ */ jsxs(Tooltip.Root, { children: [/* @__PURE__ */ jsx(Tooltip.Trigger, {
|
|
94
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
95
|
+
variant: "ghost",
|
|
96
|
+
color: "neutral",
|
|
97
|
+
size: "icon-sm",
|
|
98
|
+
"aria-label": `More information about ${feature.name}`
|
|
99
|
+
}),
|
|
100
|
+
children: /* @__PURE__ */ jsx(InfoIcon, { size: 14 })
|
|
101
|
+
}), /* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsx(Tooltip.Positioner, { children: /* @__PURE__ */ jsx(Tooltip.Popup, { children: feature.tooltip }) }) })] }) : null
|
|
102
|
+
]
|
|
103
|
+
}, feature.name))
|
|
104
|
+
})
|
|
105
|
+
]
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
//#endregion
|
|
109
|
+
export { PricingPlanCard };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { UsageTier } from "./Pricing.js";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/PricingUsageCalculator.d.ts
|
|
5
|
+
interface PricingUsageCalculatorProps {
|
|
6
|
+
usageTiers: readonly UsageTier[];
|
|
7
|
+
maxUsage?: number;
|
|
8
|
+
usageUnit?: string;
|
|
9
|
+
defaultUsage?: number;
|
|
10
|
+
/** Additional class name for placement in a consuming layout. */
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
/** Self-contained usage estimator composed from Card, Slider, Progress, and Separator. */
|
|
14
|
+
declare function PricingUsageCalculator({
|
|
15
|
+
usageTiers,
|
|
16
|
+
maxUsage,
|
|
17
|
+
usageUnit,
|
|
18
|
+
defaultUsage,
|
|
19
|
+
className
|
|
20
|
+
}: PricingUsageCalculatorProps): React.JSX.Element;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { PricingUsageCalculator, PricingUsageCalculatorProps };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
2
|
+
import { Separator } from "./Separator.js";
|
|
3
|
+
import { Slider } from "./Slider.js";
|
|
4
|
+
import { Card } from "./Card.js";
|
|
5
|
+
import { formatPricingUsage, getUsagePrice } from "./Pricing.js";
|
|
6
|
+
import { Progress } from "./Progress.js";
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
//#region src/components/PricingUsageCalculator.tsx
|
|
10
|
+
/** Self-contained usage estimator composed from Card, Slider, Progress, and Separator. */
|
|
11
|
+
function PricingUsageCalculator({ usageTiers, maxUsage = 1e5, usageUnit = "API calls", defaultUsage = 5e4, className }) {
|
|
12
|
+
const [usage, setUsage] = React.useState(Math.min(defaultUsage, maxUsage));
|
|
13
|
+
return /* @__PURE__ */ jsxs(Card, {
|
|
14
|
+
className: cx("pricing-page__calculator", className),
|
|
15
|
+
children: [
|
|
16
|
+
/* @__PURE__ */ jsx("h2", {
|
|
17
|
+
className: "pricing-page__calculator-title",
|
|
18
|
+
children: "Estimate your usage"
|
|
19
|
+
}),
|
|
20
|
+
/* @__PURE__ */ jsxs("p", {
|
|
21
|
+
className: "pricing-page__calculator-description",
|
|
22
|
+
children: ["Adjust the slider to see pricing based on your expected ", usageUnit]
|
|
23
|
+
}),
|
|
24
|
+
/* @__PURE__ */ jsxs(Slider.Root, {
|
|
25
|
+
value: usage,
|
|
26
|
+
onValueChange: (value) => setUsage(typeof value === "number" ? value : value[0] ?? 0),
|
|
27
|
+
min: 0,
|
|
28
|
+
max: maxUsage,
|
|
29
|
+
step: Math.ceil(maxUsage / 100),
|
|
30
|
+
className: "pricing-page__calculator-slider",
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ jsxs("div", {
|
|
33
|
+
className: "pricing-page__calculator-labels",
|
|
34
|
+
children: [/* @__PURE__ */ jsxs(Slider.Label, { children: ["Monthly ", usageUnit] }), /* @__PURE__ */ jsx(Slider.Value, {
|
|
35
|
+
className: "pricing-page__calculator-value",
|
|
36
|
+
children: () => formatPricingUsage(usage)
|
|
37
|
+
})]
|
|
38
|
+
}),
|
|
39
|
+
/* @__PURE__ */ jsx(Slider.Control, { children: /* @__PURE__ */ jsxs(Slider.Track, { children: [/* @__PURE__ */ jsx(Slider.Indicator, {}), /* @__PURE__ */ jsx(Slider.Thumb, {})] }) }),
|
|
40
|
+
/* @__PURE__ */ jsxs("div", {
|
|
41
|
+
className: "pricing-page__calculator-range",
|
|
42
|
+
"aria-hidden": "true",
|
|
43
|
+
children: [/* @__PURE__ */ jsx("span", { children: "0" }), /* @__PURE__ */ jsx("span", { children: formatPricingUsage(maxUsage) })]
|
|
44
|
+
})
|
|
45
|
+
]
|
|
46
|
+
}),
|
|
47
|
+
/* @__PURE__ */ jsx(Separator, { className: "pricing-page__calculator-separator" }),
|
|
48
|
+
/* @__PURE__ */ jsxs("div", {
|
|
49
|
+
className: "pricing-page__calculator-result",
|
|
50
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
51
|
+
className: "pricing-page__calculator-result-label",
|
|
52
|
+
children: "Estimated monthly cost"
|
|
53
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
54
|
+
className: "pricing-page__calculator-result-price",
|
|
55
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
56
|
+
className: "pricing-page__calculator-amount",
|
|
57
|
+
children: ["$", getUsagePrice(usageTiers, usage)]
|
|
58
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
59
|
+
className: "pricing-page__calculator-period",
|
|
60
|
+
children: "/month"
|
|
61
|
+
})]
|
|
62
|
+
})]
|
|
63
|
+
}),
|
|
64
|
+
/* @__PURE__ */ jsx("div", {
|
|
65
|
+
className: "pricing-page__tiers",
|
|
66
|
+
children: usageTiers.map((tier) => {
|
|
67
|
+
const active = usage >= tier.limit;
|
|
68
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
69
|
+
className: "pricing-page__tier",
|
|
70
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
71
|
+
className: "pricing-page__tier-info",
|
|
72
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
73
|
+
className: "pricing-page__tier-label",
|
|
74
|
+
children: tier.label
|
|
75
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
76
|
+
className: "pricing-page__tier-price",
|
|
77
|
+
children: [
|
|
78
|
+
"$",
|
|
79
|
+
tier.price,
|
|
80
|
+
"/mo"
|
|
81
|
+
]
|
|
82
|
+
})]
|
|
83
|
+
}), /* @__PURE__ */ jsx(Progress.Root, {
|
|
84
|
+
"aria-label": `Progress toward ${tier.label}`,
|
|
85
|
+
value: active ? 100 : tier.limit > 0 ? usage / tier.limit * 100 : 0,
|
|
86
|
+
color: active ? "success" : "primary",
|
|
87
|
+
children: /* @__PURE__ */ jsx(Progress.Track, { children: /* @__PURE__ */ jsx(Progress.Indicator, {}) })
|
|
88
|
+
})]
|
|
89
|
+
}, tier.label);
|
|
90
|
+
})
|
|
91
|
+
})
|
|
92
|
+
]
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
//#endregion
|
|
96
|
+
export { PricingUsageCalculator };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
export { AttachmentsContext, PendingToolApproval, PermissionMode, PromptInput, PromptInputActionAddAttachments, PromptInputActionAddAttachmentsProps, PromptInputActionAddScreenshot, PromptInputActionAddScreenshotProps, PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuContentProps, PromptInputActionMenuItem, PromptInputActionMenuItemProps, PromptInputActionMenuProps, PromptInputActionMenuTrigger, PromptInputActionMenuTriggerProps, PromptInputApproval, PromptInputApprovalProps, PromptInputAttachment, PromptInputAttachmentProps, PromptInputAttachments, PromptInputAttachmentsProps, PromptInputBody, PromptInputBodyProps, PromptInputButton, PromptInputButtonProps, PromptInputButtonTooltip, PromptInputCommand, PromptInputCommandEmpty, PromptInputCommandEmptyProps, PromptInputCommandGroup, PromptInputCommandGroupProps, PromptInputCommandInput, PromptInputCommandInputProps, PromptInputCommandItem, PromptInputCommandItemProps, PromptInputCommandList, PromptInputCommandListProps, PromptInputCommandProps, PromptInputCommandSeparator, PromptInputCommandSeparatorProps, PromptInputControllerProps, PromptInputDictation, PromptInputDictationProps, PromptInputFooter, PromptInputFooterProps, PromptInputHeader, PromptInputHeaderProps, PromptInputHoverCard, PromptInputHoverCardContent, PromptInputHoverCardContentProps, PromptInputHoverCardProps, PromptInputHoverCardTrigger, PromptInputHoverCardTriggerProps, PromptInputMessage, PromptInputPermissionSelector, PromptInputPermissionSelectorProps, PromptInputProps, PromptInputProvider, PromptInputProviderProps, PromptInputSelect, PromptInputSelectProps, PromptInputSubmit, PromptInputSubmitProps, PromptInputTab, PromptInputTabBody, PromptInputTabBodyProps, PromptInputTabItem, PromptInputTabItemProps, PromptInputTabLabel, PromptInputTabLabelProps, PromptInputTabProps, PromptInputTabsList, PromptInputTabsListProps, PromptInputTextarea, PromptInputTextareaProps, PromptInputTools, PromptInputToolsProps, PromptInputTooltipConfig, TextInputContext, TooltipSide, getApprovalRequestId, getApprovalStateKey, getPendingToolApprovals, usePromptInputAttachments, usePromptInputController, useProviderAttachments };
|
|
1
|
+
import { $ as PromptInputDictation, A as PromptInputCommandComposerProps, At as PromptInputTabLabelProps, B as PromptInputCommandItem, Bt as TooltipSide, C as PromptInputBody, Ct as PromptInputSubmitProps, D as PromptInputButtonTooltip, Dt as PromptInputTabItem, E as PromptInputButtonProps, Et as PromptInputTabBodyProps, F as PromptInputCommandGroupLabel, Ft as PromptInputTextareaProps, G as PromptInputCommandSeparator, Gt as usePromptInputController, H as PromptInputCommandList, Ht as getApprovalStateKey, I as PromptInputCommandGroupLabelProps, It as PromptInputTools, J as PromptInputContextAction, K as PromptInputCommandSeparatorProps, Kt as useProviderAttachments, L as PromptInputCommandGroupProps, Lt as PromptInputToolsProps, M as PromptInputCommandEmpty, Mt as PromptInputTabsList, N as PromptInputCommandEmptyProps, Nt as PromptInputTabsListProps, O as PromptInputCommand, Ot as PromptInputTabItemProps, P as PromptInputCommandGroup, Pt as PromptInputTextarea, Q as PromptInputControllerProps, R as PromptInputCommandInput, Rt as PromptInputTooltipConfig, S as PromptInputAttachmentsProps, St as PromptInputSubmit, T as PromptInputButton, Tt as PromptInputTabBody, U as PromptInputCommandListProps, Ut as getPendingToolApprovals, V as PromptInputCommandItemProps, Vt as getApprovalRequestId, W as PromptInputCommandProps, Wt as usePromptInputAttachments, X as PromptInputContextSelector, Y as PromptInputContextItem, Z as PromptInputContextSelectorProps, _ as PromptInputApproval, _t as PromptInputReference, a as PromptInputActionAddAttachments, at as PromptInputHoverCard, b as PromptInputAttachmentProps, bt as PromptInputSelect, c as PromptInputActionAddScreenshotProps, ct as PromptInputHoverCardProps, d as PromptInputActionMenuContentProps, dt as PromptInputMessage, et as PromptInputDictationProps, f as PromptInputActionMenuItem, ft as PromptInputPermissionSelector, g as PromptInputActionMenuTriggerProps, gt as PromptInputProviderProps, h as PromptInputActionMenuTrigger, ht as PromptInputProvider, i as PromptInput, it as PromptInputHeaderProps, j as PromptInputCommandDefinition, jt as PromptInputTabProps, k as PromptInputCommandComposer, kt as PromptInputTabLabel, l as PromptInputActionMenu, lt as PromptInputHoverCardTrigger, m as PromptInputActionMenuProps, mt as PromptInputProps, n as PendingToolApproval, nt as PromptInputFooterProps, o as PromptInputActionAddAttachmentsProps, ot as PromptInputHoverCardContent, p as PromptInputActionMenuItemProps, pt as PromptInputPermissionSelectorProps, q as PromptInputCommandTrigger, r as PermissionMode, rt as PromptInputHeader, s as PromptInputActionAddScreenshot, st as PromptInputHoverCardContentProps, t as AttachmentsContext, tt as PromptInputFooter, u as PromptInputActionMenuContent, ut as PromptInputHoverCardTriggerProps, v as PromptInputApprovalProps, vt as PromptInputReferences, w as PromptInputBodyProps, wt as PromptInputTab, x as PromptInputAttachments, xt as PromptInputSelectProps, y as PromptInputAttachment, yt as PromptInputReferencesProps, z as PromptInputCommandInputProps, zt as TextInputContext } from "../PromptInput-BWTuXMOD.js";
|
|
2
|
+
export { AttachmentsContext, PendingToolApproval, PermissionMode, PromptInput, PromptInputActionAddAttachments, PromptInputActionAddAttachmentsProps, PromptInputActionAddScreenshot, PromptInputActionAddScreenshotProps, PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuContentProps, PromptInputActionMenuItem, PromptInputActionMenuItemProps, PromptInputActionMenuProps, PromptInputActionMenuTrigger, PromptInputActionMenuTriggerProps, PromptInputApproval, PromptInputApprovalProps, PromptInputAttachment, PromptInputAttachmentProps, PromptInputAttachments, PromptInputAttachmentsProps, PromptInputBody, PromptInputBodyProps, PromptInputButton, PromptInputButtonProps, PromptInputButtonTooltip, PromptInputCommand, PromptInputCommandComposer, PromptInputCommandComposerProps, PromptInputCommandDefinition, PromptInputCommandEmpty, PromptInputCommandEmptyProps, PromptInputCommandGroup, PromptInputCommandGroupLabel, PromptInputCommandGroupLabelProps, PromptInputCommandGroupProps, PromptInputCommandInput, PromptInputCommandInputProps, PromptInputCommandItem, PromptInputCommandItemProps, PromptInputCommandList, PromptInputCommandListProps, PromptInputCommandProps, PromptInputCommandSeparator, PromptInputCommandSeparatorProps, PromptInputCommandTrigger, PromptInputContextAction, PromptInputContextItem, PromptInputContextSelector, PromptInputContextSelectorProps, PromptInputControllerProps, PromptInputDictation, PromptInputDictationProps, PromptInputFooter, PromptInputFooterProps, PromptInputHeader, PromptInputHeaderProps, PromptInputHoverCard, PromptInputHoverCardContent, PromptInputHoverCardContentProps, PromptInputHoverCardProps, PromptInputHoverCardTrigger, PromptInputHoverCardTriggerProps, PromptInputMessage, PromptInputPermissionSelector, PromptInputPermissionSelectorProps, PromptInputProps, PromptInputProvider, PromptInputProviderProps, PromptInputReference, PromptInputReferences, PromptInputReferencesProps, PromptInputSelect, PromptInputSelectProps, PromptInputSubmit, PromptInputSubmitProps, PromptInputTab, PromptInputTabBody, PromptInputTabBodyProps, PromptInputTabItem, PromptInputTabItemProps, PromptInputTabLabel, PromptInputTabLabelProps, PromptInputTabProps, PromptInputTabsList, PromptInputTabsListProps, PromptInputTextarea, PromptInputTextareaProps, PromptInputTools, PromptInputToolsProps, PromptInputTooltipConfig, TextInputContext, TooltipSide, getApprovalRequestId, getApprovalStateKey, getPendingToolApprovals, usePromptInputAttachments, usePromptInputController, useProviderAttachments };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
2
|
-
import { D as
|
|
2
|
+
import { B as SpinnerIcon, D as MicrophoneIcon, F as PlusIcon, J as WrenchIcon, N as PencilIcon, U as StopIcon, V as SquareIcon, Y as XIcon, i as ArrowUpIcon, j as PaperclipIcon, k as MonitorIcon, o as CheckIcon, q as WarningIcon, s as ChevronDownIcon, v as FileIcon, y as FolderIcon } from "../icons-CpfUer49.js";
|
|
3
3
|
import { Button } from "./Button.js";
|
|
4
4
|
import { Tooltip } from "./Tooltip.js";
|
|
5
5
|
import { t as AttachmentPreview } from "../attachment-preview-DIs50Q0h.js";
|
|
6
|
-
import { Combobox } from "./Combobox.js";
|
|
7
6
|
import { Menu } from "./Menu.js";
|
|
7
|
+
import { Combobox } from "./Combobox.js";
|
|
8
8
|
import { Select } from "./Select.js";
|
|
9
9
|
import { Tabs } from "./Tabs.js";
|
|
10
10
|
import * as React from "react";
|
|
@@ -818,15 +818,12 @@ function PromptInputPermissionSelector({ value, onValueChange, question = "How s
|
|
|
818
818
|
side: "top",
|
|
819
819
|
sideOffset: 6,
|
|
820
820
|
children: /* @__PURE__ */ jsx(Tooltip.Popup, { children: selected.label })
|
|
821
|
-
}) })] }), /* @__PURE__ */ jsx(Menu.Portal, { children: /* @__PURE__ */ jsx(Menu.Positioner, { children: /* @__PURE__ */
|
|
821
|
+
}) })] }), /* @__PURE__ */ jsx(Menu.Portal, { children: /* @__PURE__ */ jsx(Menu.Positioner, { children: /* @__PURE__ */ jsx(Menu.Popup, {
|
|
822
822
|
className: "prompt-input__permissions-menu",
|
|
823
|
-
children:
|
|
824
|
-
className: "prompt-input__permissions-question",
|
|
825
|
-
children: question
|
|
826
|
-
}), /* @__PURE__ */ jsx(Menu.RadioGroup, {
|
|
823
|
+
children: /* @__PURE__ */ jsxs(Menu.RadioGroup, {
|
|
827
824
|
value,
|
|
828
825
|
onValueChange: (mode) => onValueChange(mode),
|
|
829
|
-
children: PERMISSION_MODES.map((mode) => /* @__PURE__ */ jsxs(Menu.RadioItem, {
|
|
826
|
+
children: [/* @__PURE__ */ jsx(Menu.GroupLabel, { children: question }), PERMISSION_MODES.map((mode) => /* @__PURE__ */ jsxs(Menu.RadioItem, {
|
|
830
827
|
value: mode.value,
|
|
831
828
|
closeOnClick: true,
|
|
832
829
|
className: "prompt-input__permissions-option",
|
|
@@ -840,13 +837,15 @@ function PromptInputPermissionSelector({ value, onValueChange, question = "How s
|
|
|
840
837
|
children: mode.description
|
|
841
838
|
})]
|
|
842
839
|
}), /* @__PURE__ */ jsx(Menu.RadioItemIndicator, { className: "prompt-input__permissions-check" })]
|
|
843
|
-
}, mode.value))
|
|
844
|
-
})
|
|
840
|
+
}, mode.value))]
|
|
841
|
+
})
|
|
845
842
|
}) }) })] });
|
|
846
843
|
}
|
|
847
|
-
function PromptInputSubmit({ className, status = "ready", onStop, variant = "normal", color = "primary", size = "icon-
|
|
848
|
-
const
|
|
849
|
-
const
|
|
844
|
+
function PromptInputSubmit({ className, status = "ready", onStop, variant = "normal", color = "primary", size = "icon-xs", onClick, children, label, allowSubmitWhileBusy = false, hasContent = false, ref, ...props }) {
|
|
845
|
+
const isBusy = status === "submitted" || status === "streaming";
|
|
846
|
+
const isQueueing = isBusy && allowSubmitWhileBusy && hasContent;
|
|
847
|
+
const isStopping = isBusy && !isQueueing;
|
|
848
|
+
const resolvedLabel = label ?? (isQueueing ? "Queue message" : defaultSubmitLabel(status));
|
|
850
849
|
return /* @__PURE__ */ jsx(Button, {
|
|
851
850
|
ref,
|
|
852
851
|
type: isStopping ? "button" : "submit",
|
|
@@ -865,7 +864,7 @@ function PromptInputSubmit({ className, status = "ready", onStop, variant = "nor
|
|
|
865
864
|
}
|
|
866
865
|
},
|
|
867
866
|
...props,
|
|
868
|
-
children: children ?? defaultSubmitIcon(status)
|
|
867
|
+
children: children ?? (isQueueing ? /* @__PURE__ */ jsx(ArrowUpIcon, {}) : defaultSubmitIcon(status))
|
|
869
868
|
});
|
|
870
869
|
}
|
|
871
870
|
function getPausedExecution(part) {
|
|
@@ -1176,8 +1175,204 @@ function PromptInputCommandList({ className, ref, ...props }) {
|
|
|
1176
1175
|
}
|
|
1177
1176
|
const PromptInputCommandEmpty = Combobox.Empty;
|
|
1178
1177
|
const PromptInputCommandGroup = Combobox.Group;
|
|
1178
|
+
const PromptInputCommandGroupLabel = Combobox.GroupLabel;
|
|
1179
1179
|
const PromptInputCommandItem = Combobox.Item;
|
|
1180
1180
|
const PromptInputCommandSeparator = Combobox.Separator;
|
|
1181
|
+
/**
|
|
1182
|
+
* Controlled PromptInput textarea with slash-command discovery. The host owns
|
|
1183
|
+
* both the command catalog and the draft policy applied after selection.
|
|
1184
|
+
*/
|
|
1185
|
+
function PromptInputCommandComposer({ commands, mentionCommands, value, onValueChange, onCommandSelect, emptyMessage = "No commands found.", mentionEmptyMessage = "No MCP servers found.", onKeyDown, ref, ...textareaProps }) {
|
|
1186
|
+
const inputRef = React.useRef(null);
|
|
1187
|
+
const [dismissedValue, setDismissedValue] = React.useState(null);
|
|
1188
|
+
React.useImperativeHandle(ref, () => inputRef.current, []);
|
|
1189
|
+
const match = /^\s*([/@])([^\n]*)$/u.exec(value);
|
|
1190
|
+
const trigger = match?.[1];
|
|
1191
|
+
const sourceCommands = trigger === "@" ? mentionCommands ?? [] : commands;
|
|
1192
|
+
const normalizedQuery = (match?.[2]?.trim() ?? "").toLocaleLowerCase();
|
|
1193
|
+
const filtered = sourceCommands.filter((command) => {
|
|
1194
|
+
if (!normalizedQuery) return true;
|
|
1195
|
+
return [
|
|
1196
|
+
command.label,
|
|
1197
|
+
command.value,
|
|
1198
|
+
command.description,
|
|
1199
|
+
...command.keywords ?? []
|
|
1200
|
+
].filter((term) => Boolean(term)).some((term) => term.toLocaleLowerCase().includes(normalizedQuery));
|
|
1201
|
+
});
|
|
1202
|
+
const hasTriggeredCatalog = trigger === "/" ? commands.length > 0 : trigger === "@" && mentionCommands !== void 0;
|
|
1203
|
+
const open = Boolean(match && hasTriggeredCatalog) && dismissedValue !== value;
|
|
1204
|
+
const groups = Array.from(new Set(filtered.map((command) => command.group ?? ""))).map((label) => ({
|
|
1205
|
+
label,
|
|
1206
|
+
items: filtered.filter((command) => (command.group ?? "") === label)
|
|
1207
|
+
}));
|
|
1208
|
+
return /* @__PURE__ */ jsxs(PromptInputCommand.Root, {
|
|
1209
|
+
items: groups,
|
|
1210
|
+
filteredItems: groups,
|
|
1211
|
+
filter: null,
|
|
1212
|
+
value: null,
|
|
1213
|
+
inputValue: value,
|
|
1214
|
+
open,
|
|
1215
|
+
autoHighlight: true,
|
|
1216
|
+
itemToStringLabel: (command) => command.label,
|
|
1217
|
+
itemToStringValue: (command) => command.value,
|
|
1218
|
+
onInputValueChange: (next, { reason }) => {
|
|
1219
|
+
if (reason !== "input-change") return;
|
|
1220
|
+
setDismissedValue(null);
|
|
1221
|
+
onValueChange(String(next));
|
|
1222
|
+
},
|
|
1223
|
+
onOpenChange: (nextOpen) => {
|
|
1224
|
+
if (!nextOpen) setDismissedValue(value);
|
|
1225
|
+
},
|
|
1226
|
+
onValueChange: (command, { reason }) => {
|
|
1227
|
+
if (!command || Array.isArray(command) || reason !== "item-press") return;
|
|
1228
|
+
onCommandSelect(command, trigger ?? "/");
|
|
1229
|
+
},
|
|
1230
|
+
children: [/* @__PURE__ */ jsx(PromptInputCommandInput, { render: /* @__PURE__ */ jsx(PromptInputTextarea, {
|
|
1231
|
+
...textareaProps,
|
|
1232
|
+
ref: inputRef,
|
|
1233
|
+
value,
|
|
1234
|
+
onKeyDown
|
|
1235
|
+
}) }), /* @__PURE__ */ jsx(Combobox.Portal, { children: /* @__PURE__ */ jsx(Combobox.Positioner, {
|
|
1236
|
+
anchor: () => inputRef.current?.closest(".prompt-input__body") ?? null,
|
|
1237
|
+
side: "top",
|
|
1238
|
+
sideOffset: 8,
|
|
1239
|
+
align: "start",
|
|
1240
|
+
className: "prompt-input__command-positioner",
|
|
1241
|
+
children: /* @__PURE__ */ jsxs(Combobox.Popup, {
|
|
1242
|
+
className: "prompt-input__command-popup",
|
|
1243
|
+
children: [/* @__PURE__ */ jsx(PromptInputCommandList, {
|
|
1244
|
+
"data-command-trigger": trigger,
|
|
1245
|
+
children: (group) => /* @__PURE__ */ jsxs(PromptInputCommandGroup, {
|
|
1246
|
+
items: group.items,
|
|
1247
|
+
children: [group.label ? /* @__PURE__ */ jsx(PromptInputCommandGroupLabel, { children: group.label }) : null, /* @__PURE__ */ jsx(Combobox.Collection, { children: (command) => /* @__PURE__ */ jsxs(PromptInputCommandItem, {
|
|
1248
|
+
value: command,
|
|
1249
|
+
disabled: command.disabled,
|
|
1250
|
+
className: "prompt-input__command-item",
|
|
1251
|
+
children: [command.icon ? /* @__PURE__ */ jsx("span", {
|
|
1252
|
+
className: "prompt-input__command-icon",
|
|
1253
|
+
children: command.icon
|
|
1254
|
+
}) : null, /* @__PURE__ */ jsxs("span", {
|
|
1255
|
+
className: "prompt-input__command-copy",
|
|
1256
|
+
children: [
|
|
1257
|
+
/* @__PURE__ */ jsx("span", {
|
|
1258
|
+
className: "prompt-input__command-label",
|
|
1259
|
+
children: command.label
|
|
1260
|
+
}),
|
|
1261
|
+
command.description ? /* @__PURE__ */ jsx("span", {
|
|
1262
|
+
className: "prompt-input__command-description",
|
|
1263
|
+
children: command.description
|
|
1264
|
+
}) : null,
|
|
1265
|
+
command.meta ? /* @__PURE__ */ jsx("span", {
|
|
1266
|
+
className: "prompt-input__command-meta",
|
|
1267
|
+
children: command.meta
|
|
1268
|
+
}) : null
|
|
1269
|
+
]
|
|
1270
|
+
})]
|
|
1271
|
+
}, command.id) })]
|
|
1272
|
+
}, group.label || "ungrouped")
|
|
1273
|
+
}), /* @__PURE__ */ jsx(PromptInputCommandEmpty, { children: trigger === "@" ? mentionEmptyMessage : emptyMessage })]
|
|
1274
|
+
})
|
|
1275
|
+
}) })]
|
|
1276
|
+
});
|
|
1277
|
+
}
|
|
1278
|
+
/** Removable inline context selected from slash-command or mention pickers. */
|
|
1279
|
+
function PromptInputReferences({ references, onRemove, className, ref, ...props }) {
|
|
1280
|
+
if (!references.length) return null;
|
|
1281
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1282
|
+
ref,
|
|
1283
|
+
className: cx("prompt-input__references", className),
|
|
1284
|
+
role: "group",
|
|
1285
|
+
"aria-label": "Selected context",
|
|
1286
|
+
...props,
|
|
1287
|
+
children: references.map((reference) => /* @__PURE__ */ jsxs(Button, {
|
|
1288
|
+
type: "button",
|
|
1289
|
+
variant: "ghost",
|
|
1290
|
+
color: "primary",
|
|
1291
|
+
size: "lg",
|
|
1292
|
+
className: "prompt-input__reference",
|
|
1293
|
+
"aria-label": `Remove ${reference.label}`,
|
|
1294
|
+
onClick: () => onRemove(reference),
|
|
1295
|
+
children: [
|
|
1296
|
+
reference.icon ? /* @__PURE__ */ jsx("span", {
|
|
1297
|
+
className: "prompt-input__reference-icon",
|
|
1298
|
+
children: reference.icon
|
|
1299
|
+
}) : null,
|
|
1300
|
+
/* @__PURE__ */ jsx("span", {
|
|
1301
|
+
className: "prompt-input__reference-label",
|
|
1302
|
+
children: reference.label
|
|
1303
|
+
}),
|
|
1304
|
+
/* @__PURE__ */ jsx(XIcon, {
|
|
1305
|
+
className: "prompt-input__reference-remove",
|
|
1306
|
+
size: 14
|
|
1307
|
+
})
|
|
1308
|
+
]
|
|
1309
|
+
}, `${reference.trigger ?? "reference"}:${reference.id}`))
|
|
1310
|
+
});
|
|
1311
|
+
}
|
|
1312
|
+
/** Controlled composer-footer picker for a host-owned folder or working context. */
|
|
1313
|
+
function PromptInputContextSelector({ items, value, onValueChange, categoryLabel = "Folder", unavailableLabel = "Folder unavailable", action }) {
|
|
1314
|
+
const selected = items.find((item) => item.value === value);
|
|
1315
|
+
const displayLabel = selected?.label ?? unavailableLabel;
|
|
1316
|
+
const fullLabel = selected?.description ? `${displayLabel} — ${selected.description}` : displayLabel;
|
|
1317
|
+
const trigger = /* @__PURE__ */ jsx(Menu.Trigger, {
|
|
1318
|
+
unstyled: true,
|
|
1319
|
+
render: /* @__PURE__ */ jsxs(PromptInputButton, {
|
|
1320
|
+
size: "xs",
|
|
1321
|
+
className: "prompt-input__context-trigger",
|
|
1322
|
+
"aria-label": `${categoryLabel}: ${fullLabel}`,
|
|
1323
|
+
"data-unavailable": !selected || selected.unavailable || void 0,
|
|
1324
|
+
children: [
|
|
1325
|
+
/* @__PURE__ */ jsx(FolderIcon, { size: 14 }),
|
|
1326
|
+
categoryLabel ? /* @__PURE__ */ jsx("span", {
|
|
1327
|
+
className: "prompt-input__context-category",
|
|
1328
|
+
children: categoryLabel
|
|
1329
|
+
}) : null,
|
|
1330
|
+
/* @__PURE__ */ jsx("span", {
|
|
1331
|
+
className: "prompt-input__context-value",
|
|
1332
|
+
children: displayLabel
|
|
1333
|
+
}),
|
|
1334
|
+
/* @__PURE__ */ jsx(ChevronDownIcon, {
|
|
1335
|
+
className: "prompt-input__context-chevron",
|
|
1336
|
+
size: 12
|
|
1337
|
+
})
|
|
1338
|
+
]
|
|
1339
|
+
})
|
|
1340
|
+
});
|
|
1341
|
+
return /* @__PURE__ */ jsxs(Menu.Root, { children: [/* @__PURE__ */ jsxs(Tooltip.Root, { children: [/* @__PURE__ */ jsx(Tooltip.Trigger, { render: trigger }), /* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsx(Tooltip.Positioner, {
|
|
1342
|
+
side: "top",
|
|
1343
|
+
sideOffset: 6,
|
|
1344
|
+
children: /* @__PURE__ */ jsx(Tooltip.Popup, { children: fullLabel })
|
|
1345
|
+
}) })] }), /* @__PURE__ */ jsx(Menu.Portal, { children: /* @__PURE__ */ jsx(Menu.Positioner, { children: /* @__PURE__ */ jsxs(Menu.Popup, {
|
|
1346
|
+
className: "prompt-input__context-menu",
|
|
1347
|
+
children: [/* @__PURE__ */ jsxs(Menu.RadioGroup, {
|
|
1348
|
+
value,
|
|
1349
|
+
onValueChange: (next) => onValueChange(String(next)),
|
|
1350
|
+
children: [/* @__PURE__ */ jsx(Menu.GroupLabel, { children: categoryLabel }), items.map((item) => /* @__PURE__ */ jsxs(Menu.RadioItem, {
|
|
1351
|
+
value: item.value,
|
|
1352
|
+
disabled: item.unavailable,
|
|
1353
|
+
closeOnClick: true,
|
|
1354
|
+
className: "prompt-input__context-option",
|
|
1355
|
+
children: [
|
|
1356
|
+
/* @__PURE__ */ jsx(FolderIcon, { size: 14 }),
|
|
1357
|
+
/* @__PURE__ */ jsxs("span", {
|
|
1358
|
+
className: "prompt-input__context-option-copy",
|
|
1359
|
+
children: [/* @__PURE__ */ jsx("span", { children: item.label }), item.description ? /* @__PURE__ */ jsx("span", {
|
|
1360
|
+
className: "prompt-input__context-description",
|
|
1361
|
+
children: item.description
|
|
1362
|
+
}) : null]
|
|
1363
|
+
}),
|
|
1364
|
+
/* @__PURE__ */ jsx(Menu.RadioItemIndicator, {
|
|
1365
|
+
className: "prompt-input__context-check",
|
|
1366
|
+
children: /* @__PURE__ */ jsx(CheckIcon, { size: 14 })
|
|
1367
|
+
})
|
|
1368
|
+
]
|
|
1369
|
+
}, item.value))]
|
|
1370
|
+
}), action ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Menu.Separator, {}), /* @__PURE__ */ jsx(Menu.Item, {
|
|
1371
|
+
onClick: action.onSelect,
|
|
1372
|
+
children: action.label
|
|
1373
|
+
})] }) : null]
|
|
1374
|
+
}) }) })] });
|
|
1375
|
+
}
|
|
1181
1376
|
function defaultSubmitIcon(status) {
|
|
1182
1377
|
switch (status) {
|
|
1183
1378
|
case "submitted": return /* @__PURE__ */ jsx(SpinnerIcon, { className: "prompt-input__submit-spinner" });
|
|
@@ -1269,4 +1464,4 @@ function createId() {
|
|
|
1269
1464
|
return globalThis.crypto?.randomUUID?.() ?? `prompt-input-${Date.now()}-${Math.random()}`;
|
|
1270
1465
|
}
|
|
1271
1466
|
//#endregion
|
|
1272
|
-
export { PromptInput, PromptInputActionAddAttachments, PromptInputActionAddScreenshot, PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuItem, PromptInputActionMenuTrigger, PromptInputApproval, PromptInputAttachment, PromptInputAttachments, PromptInputBody, PromptInputButton, PromptInputCommand, PromptInputCommandEmpty, PromptInputCommandGroup, PromptInputCommandInput, PromptInputCommandItem, PromptInputCommandList, PromptInputCommandSeparator, PromptInputDictation, PromptInputFooter, PromptInputHeader, PromptInputHoverCard, PromptInputHoverCardContent, PromptInputHoverCardTrigger, PromptInputPermissionSelector, PromptInputProvider, PromptInputSelect, PromptInputSubmit, PromptInputTab, PromptInputTabBody, PromptInputTabItem, PromptInputTabLabel, PromptInputTabsList, PromptInputTextarea, PromptInputTools, getApprovalRequestId, getApprovalStateKey, getPendingToolApprovals, usePromptInputAttachments, usePromptInputController, useProviderAttachments };
|
|
1467
|
+
export { PromptInput, PromptInputActionAddAttachments, PromptInputActionAddScreenshot, PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuItem, PromptInputActionMenuTrigger, PromptInputApproval, PromptInputAttachment, PromptInputAttachments, PromptInputBody, PromptInputButton, PromptInputCommand, PromptInputCommandComposer, PromptInputCommandEmpty, PromptInputCommandGroup, PromptInputCommandGroupLabel, PromptInputCommandInput, PromptInputCommandItem, PromptInputCommandList, PromptInputCommandSeparator, PromptInputContextSelector, PromptInputDictation, PromptInputFooter, PromptInputHeader, PromptInputHoverCard, PromptInputHoverCardContent, PromptInputHoverCardTrigger, PromptInputPermissionSelector, PromptInputProvider, PromptInputReferences, PromptInputSelect, PromptInputSubmit, PromptInputTab, PromptInputTabBody, PromptInputTabItem, PromptInputTabLabel, PromptInputTabsList, PromptInputTextarea, PromptInputTools, getApprovalRequestId, getApprovalStateKey, getPendingToolApprovals, usePromptInputAttachments, usePromptInputController, useProviderAttachments };
|
package/dist/components/Queue.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Collapsible } from "./Collapsible.js";
|
|
2
2
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
3
|
-
import {
|
|
3
|
+
import { l as ChevronRightIcon, o as CheckIcon, p as DotIcon, v as FileIcon } from "../icons-CpfUer49.js";
|
|
4
4
|
import { Button } from "./Button.js";
|
|
5
5
|
import { Badge } from "./Badge.js";
|
|
6
6
|
import { ScrollArea } from "./ScrollArea.js";
|
|
@@ -27,7 +27,8 @@ interface ReasoningProps extends Omit<React.ComponentProps<typeof Collapsible.Ro
|
|
|
27
27
|
/**
|
|
28
28
|
* A collapsible "thinking" block for showing model reasoning (e.g. DeepSeek
|
|
29
29
|
* R1, OpenAI o-series). Auto-expands while streaming and collapses when done.
|
|
30
|
-
* Adapted from Vercel AI Elements and
|
|
30
|
+
* Adapted from Vercel AI Elements and composed from the design system's
|
|
31
|
+
* existing Collapsible and Activity presentation primitives.
|
|
31
32
|
*
|
|
32
33
|
* @example
|
|
33
34
|
* ```tsx
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Collapsible } from "./Collapsible.js";
|
|
2
2
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { B as SpinnerIcon } from "../icons-CpfUer49.js";
|
|
4
|
+
import { ActivityContent, ActivityText, ActivityTrigger } from "./Activity.js";
|
|
5
|
+
import { f as MessageResponse } from "../Message-BkMdE3bS.js";
|
|
5
6
|
import * as React from "react";
|
|
6
|
-
import { jsx
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
8
|
//#region src/components/Reasoning.tsx
|
|
8
9
|
const ReasoningContext = React.createContext(null);
|
|
9
10
|
const AUTO_CLOSE_DELAY_MS = 1e3;
|
|
@@ -16,7 +17,8 @@ function useReasoning() {
|
|
|
16
17
|
/**
|
|
17
18
|
* A collapsible "thinking" block for showing model reasoning (e.g. DeepSeek
|
|
18
19
|
* R1, OpenAI o-series). Auto-expands while streaming and collapses when done.
|
|
19
|
-
* Adapted from Vercel AI Elements and
|
|
20
|
+
* Adapted from Vercel AI Elements and composed from the design system's
|
|
21
|
+
* existing Collapsible and Activity presentation primitives.
|
|
20
22
|
*
|
|
21
23
|
* @example
|
|
22
24
|
* ```tsx
|
|
@@ -101,8 +103,8 @@ function Reasoning({ className, isStreaming = false, duration, open, defaultOpen
|
|
|
101
103
|
value: ctx,
|
|
102
104
|
children: /* @__PURE__ */ jsx(Collapsible.Root, {
|
|
103
105
|
ref,
|
|
104
|
-
"data-slot": "reasoning
|
|
105
|
-
className: cx("reasoning", className),
|
|
106
|
+
"data-slot": "reasoning",
|
|
107
|
+
className: cx("activity", "reasoning", className),
|
|
106
108
|
open: currentOpen,
|
|
107
109
|
onOpenChange: handleOpenChange,
|
|
108
110
|
"data-streaming": isStreaming ? "" : void 0,
|
|
@@ -123,30 +125,14 @@ function defaultGetThinkingMessage(isStreaming, duration) {
|
|
|
123
125
|
*/
|
|
124
126
|
function ReasoningTrigger({ className, children, getThinkingMessage = defaultGetThinkingMessage, ref, ...props }) {
|
|
125
127
|
const { isStreaming, duration } = useReasoning();
|
|
126
|
-
|
|
127
|
-
ref,
|
|
128
|
-
className: cx("reasoning__trigger", className),
|
|
129
|
-
"data-streaming": isStreaming ? "" : void 0,
|
|
130
|
-
...props,
|
|
131
|
-
unstyled: true,
|
|
132
|
-
children
|
|
133
|
-
});
|
|
134
|
-
return /* @__PURE__ */ jsxs(Collapsible.Trigger, {
|
|
128
|
+
return /* @__PURE__ */ jsx(ActivityTrigger, {
|
|
135
129
|
ref,
|
|
136
130
|
"data-slot": "reasoning-trigger",
|
|
137
131
|
className: cx("reasoning__trigger", className),
|
|
138
132
|
"data-streaming": isStreaming ? "" : void 0,
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
className: "reasoning__trigger-label",
|
|
143
|
-
children: getThinkingMessage(isStreaming, duration)
|
|
144
|
-
}), /* @__PURE__ */ jsx("span", {
|
|
145
|
-
"data-slot": "reasoning-trigger-icon",
|
|
146
|
-
className: "reasoning__trigger-icon",
|
|
147
|
-
"aria-hidden": "true",
|
|
148
|
-
children: /* @__PURE__ */ jsx(ChevronRightIcon, {})
|
|
149
|
-
})]
|
|
133
|
+
icon: children == null && isStreaming ? /* @__PURE__ */ jsx(SpinnerIcon, {}) : void 0,
|
|
134
|
+
label: children ?? getThinkingMessage(isStreaming, duration),
|
|
135
|
+
...props
|
|
150
136
|
});
|
|
151
137
|
}
|
|
152
138
|
/**
|
|
@@ -154,13 +140,12 @@ function ReasoningTrigger({ className, children, getThinkingMessage = defaultGet
|
|
|
154
140
|
* long-form text; a muted left border visually distinguishes the block.
|
|
155
141
|
*/
|
|
156
142
|
function ReasoningContent({ className, children, ref, ...props }) {
|
|
157
|
-
return /* @__PURE__ */ jsx(
|
|
143
|
+
return /* @__PURE__ */ jsx(ActivityContent, {
|
|
158
144
|
ref,
|
|
159
145
|
"data-slot": "reasoning-content",
|
|
160
146
|
className: cx("reasoning__content", className),
|
|
161
147
|
...props,
|
|
162
|
-
|
|
163
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
148
|
+
children: /* @__PURE__ */ jsx(ActivityText, {
|
|
164
149
|
className: "reasoning__text",
|
|
165
150
|
children: typeof children === "string" ? /* @__PURE__ */ jsx(MessageResponse, { children }) : children
|
|
166
151
|
})
|