@vvedantb/ui 0.64.0 → 0.66.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/README.md CHANGED
@@ -1531,7 +1531,7 @@ import { AppWordmark, Button, Card, Tabs, TabsList, TabsTrigger, cn, createTheme
1531
1531
  The root's exports, without:
1532
1532
 
1533
1533
  - the artifact viewers (`src/artifacts`: `ArtifactFrame`, `ArtifactViewer`, ...), which import `@vvedantb/server`;
1534
- - `ConvexClerkProvider`, `useStableAuth`, `createUseStableAuth`, `resetStableAuthSession` and `useEnsureUser`, which import `convex` or `@clerk/clerk-react`.
1534
+ - `ConvexClerkProvider`, `useStableAuth`, `createUseStableAuth`, `resetStableAuthSession` and `useEnsureUser`, which import `convex` or `@clerk/react`.
1535
1535
 
1536
1536
  Every other name is the same binding as in the root. `src/client-exports.test.ts` keeps the two in step, and `app/tests-node/client-graph.test.mjs` checks that the entry's module graph has no `@vvedantb/server`, convex, Clerk or `node:` import. The root is unchanged.
1537
1537
 
@@ -1847,7 +1847,7 @@ AI surfaces that came from an app, exported from the root. Fills use `surface-se
1847
1847
  - `ActivityQuestionCard` (`questions`, `answers`): the read-only record of a multiple-choice question and its answer.
1848
1848
  - `AgentTrace`, `AgentTraceLine` (`status`: `AgentTraceStatus`, `running | error | pending`), `AgentTraceIcon` (`iconKey` crossfades a swap), `AgentTraceTitle` (`shimmer`), `AgentTraceDescription`, `AgentTraceCollapsible`, `AgentTraceCollapsibleTrigger` (`trailing`: controls beside the trigger), `AgentTraceCollapsibleContent`: one agent step as one line, with an optional fold.
1849
1849
  - `AgentPlan*`, `TestResults*` / `TestSuite*` / `TestResult*` (one test: `TestResult`, `TestResultStatusIndicator`, `TestResultName`, `TestResultDuration`, `TestResultError`, `TestResultErrorMessage`, `TestResultErrorStack`), `WebPreview*` (with `useWebPreview`), `ContextUsage*` (context window usage in a hover card: `ContextUsage`, `ContextUsageTrigger`, `ContextUsageContent`, `ContextUsageContentHeader` / `Body` / `Footer`, `ContextUsageInput`, `ContextUsageOutput`, `ContextUsageCacheRead`, `ContextUsageCacheWrite`, deprecated `ContextUsageCache`).
1850
- - `ModelPicker` (button and popover; `simpleLadder` opens on a discrete slider; the one model picker), `ModelPickerContent` (the searchable model and account list, for menus; pair it with `modelPickerSurfaceClass`), `ModelOption`, `ModelAccount`, `findModelOption`, `formatModelDisplayLabel`, `getProviderLabel`, `ProviderIcon` (`claude`, `codex`, `opencode`, `cursor`).
1850
+ - `ModelPicker` (button and popover; `simpleLadder` opens on a discrete slider; the one model picker). Its `traits` prop is required: the selected model's trait controls (`ModelPickerTraits`, the `TraitsPanel` props). The picker pins them above the list and sums them up on the trigger (`modelPickerTraitSummary`: reasoning level, "1M", "No thinking", and a bolt for Fast). Pass `null` only where runs take no traits. `ModelPickerContent` (the searchable model and account list, for menus; pair it with `modelPickerSurfaceClass`), `ModelOption`, `ModelAccount`, `findModelOption`, `formatModelDisplayLabel`, `getProviderLabel`, `ProviderIcon` (`claude`, `codex`, `opencode`, `cursor`).
1851
1851
  - Deprecated, removed in the next minor release: `ModelSelector*` and `PromptInputModelSelect*` (use `ModelPicker`). Behaviour is unchanged, except `ModelSelectorLogo`: it now renders `ProviderIcon` and fetches nothing (it loaded `https://models.dev/logos/<provider>.svg`). `anthropic`, `google-vertex-anthropic` and `claude` show the Claude mark, `openai` and `codex` the OpenAI mark, `opencode` and `cursor` their marks; any other id shows a neutral CPU glyph. It takes SVG props and `size` (default 12) and keeps the `"<provider> logo"` name. `ModelSelectorLogoGroup` styles `svg` children.
1852
1852
 
1853
1853
  ### App config entries
@@ -1928,6 +1928,6 @@ A fixture that renders the main components against sample light and dark RGB var
1928
1928
 
1929
1929
  The components that came from the app (loaders, `ListRow`, `Surface`, `BorderBeam`, `Avatar`, `StatusDot`, kanban and the sortable list, activity, agent trace, agent plan, test results, the model picker and markdown) render on plain `tokens.css` in light and dark in `tokens/examples/tokens-moved/`.
1930
1930
 
1931
- `@clerk/clerk-react`, `convex`, `@tanstack/react-hotkeys`, `motion`, `zod` and `@vvedantb/server` (0.13.0) are optional peers (`peerDependenciesMeta`), so the package manager does not install or warn about them. The root still imports each of them statically from some module (`useStableAuth` and `ConvexClerkProvider` import Clerk; `ConvexClerkProvider` and `useEnsureUser` import `convex/react`; the artifact viewers import `@vvedantb/server`; the motion presets, `ConfirmSkipHint` and others import the rest). So an app that imports `@vvedantb/ui` must have all six resolvable, even if it uses none of those exports: a bundler resolves every import before it tree-shakes. `app/tests-node/convex-esm.test.mjs` pins which root modules import `convex` and Clerk, and `app/tests-node/artifacts-esm.test.mjs` which import `@vvedantb/server`.
1931
+ `@clerk/react`, `convex`, `@tanstack/react-hotkeys`, `motion`, `zod` and `@vvedantb/server` (0.13.0) are optional peers (`peerDependenciesMeta`), so the package manager does not install or warn about them. The root still imports each of them statically from some module (`useStableAuth` and `ConvexClerkProvider` import Clerk; `ConvexClerkProvider` and `useEnsureUser` import `convex/react`; the artifact viewers import `@vvedantb/server`; the motion presets, `ConfirmSkipHint` and others import the rest). So an app that imports `@vvedantb/ui` must have all six resolvable, even if it uses none of those exports: a bundler resolves every import before it tree-shakes. `app/tests-node/convex-esm.test.mjs` pins which root modules import `convex` and Clerk, and `app/tests-node/artifacts-esm.test.mjs` which import `@vvedantb/server`.
1932
1932
 
1933
1933
  Full documentation: the repository `README.md`. Upgrading from `@vvedantb/tokens`, `@vvedantb/shell` or `@vvedantb/app-kit`: `MIGRATION.md`.
@@ -1,4 +1,4 @@
1
- import { useAuth } from "@clerk/clerk-react";
1
+ import { useAuth } from "@clerk/react";
2
2
  import { useEffect, useState } from "react";
3
3
 
4
4
  /** The two Clerk `useAuth` fields the hook reads. */
@@ -64,6 +64,6 @@ export function createUseStableAuth<T extends ClerkAuthSlice>(
64
64
  };
65
65
  }
66
66
 
67
- /** `useAuth` from `@clerk/clerk-react` with the 2000 ms debounce. */
67
+ /** `useAuth` from `@clerk/react` with the 2000 ms debounce. */
68
68
  export const useStableAuth: () => ReturnType<typeof useAuth> =
69
69
  createUseStableAuth(useAuth);
@@ -1,4 +1,4 @@
1
- import { useAuth as useClerkAuth } from "@clerk/clerk-react";
1
+ import { useAuth as useClerkAuth } from "@clerk/react";
2
2
  import { ConvexProvider, type ConvexReactClient } from "convex/react";
3
3
  import { ConvexProviderWithClerk } from "convex/react-clerk";
4
4
  import type { ComponentProps, ReactNode } from "react";
@@ -9,7 +9,7 @@ export type ConvexClerkUseAuth = ComponentProps<typeof ConvexProviderWithClerk>[
9
9
  export type ConvexClerkProviderProps = {
10
10
  /** No client (for example no Convex URL configured): children render without a provider. */
11
11
  client: ConvexReactClient | null | undefined;
12
- /** Default: `useAuth` from `@clerk/clerk-react`. */
12
+ /** Default: `useAuth` from `@clerk/react`. */
13
13
  useAuth?: ConvexClerkUseAuth;
14
14
  /** `false` renders a plain `ConvexProvider` (no Clerk auth). Default `true`. */
15
15
  clerk?: boolean;
@@ -1,4 +1,4 @@
1
- import { useAuth } from "@clerk/clerk-react";
1
+ import { useAuth } from "@clerk/react";
2
2
  import { useEffect, useState } from "react";
3
3
 
4
4
  /** The two Clerk `useAuth` fields the hook reads. */
@@ -50,5 +50,5 @@ export function createUseStableAuth(useAuthHook, options = {}) {
50
50
  };
51
51
  }
52
52
 
53
- /** `useAuth` from `@clerk/clerk-react` with the 2000 ms debounce. */
53
+ /** `useAuth` from `@clerk/react` with the 2000 ms debounce. */
54
54
  export const useStableAuth = createUseStableAuth(useAuth);
@@ -1,4 +1,4 @@
1
- import { useAuth as useClerkAuth } from "@clerk/clerk-react";
1
+ import { useAuth as useClerkAuth } from "@clerk/react";
2
2
  import { ConvexProvider } from "convex/react";
3
3
  import { ConvexProviderWithClerk } from "convex/react-clerk";
4
4
 
@@ -13,6 +13,7 @@ export const Image = t0 => {
13
13
  base64: t4,
14
14
  uint8Array: _uint8Array,
15
15
  mediaType: t5,
16
+ providerMetadata: _providerMetadata,
16
17
  ...props
17
18
  } = t0;
18
19
  base64 = t4;
@@ -7,6 +7,7 @@ import { useCn, useUiConfig } from "../ui/ui-config.js";
7
7
  import { ProviderIcon } from "./provider-icon.js";
8
8
  import { ModelPickerContent, buildPickerInstances, providerInstanceInitials, teamInstanceKey } from "./model-picker-content.js";
9
9
  import { findModelOption, formatModelDisplayLabel, getProviderLabel } from "./model-picker-types.js";
10
+ import { TraitsPanel } from "./prompt-input-traits.js";
10
11
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
12
  export { findModelOption, formatModelDisplayLabel, getProviderLabel };
12
13
  /** Embeddable picker body — use in menus/submenus; use `ModelPicker` for button triggers. */
@@ -32,13 +33,42 @@ const TRIGGER_CLASS =
32
33
  * sync so trigger vs embed surfaces cannot drift.
33
34
  */
34
35
  export const modelPickerSurfaceClass = "w-100 max-w-[calc(100vw-1rem)] overflow-hidden rounded-menu border-0 bg-transparent p-0 shadow-none";
36
+
37
+ /**
38
+ * The selected model's trait controls (reasoning, thinking, context window,
39
+ * Fast). `ModelPicker` pins them above the model list and sums them up on the
40
+ * trigger, so every picker shows traits the same way.
41
+ */
42
+
43
+ /**
44
+ * What the trigger shows after the model name: the reasoning level, "1M" when
45
+ * the 1M context is on, "No thinking" when thinking is off, joined by " · ",
46
+ * and whether Fast is on (the bolt). Only traits the model supports count.
47
+ */
48
+ export function modelPickerTraitSummary(traits) {
49
+ const {
50
+ config
51
+ } = traits;
52
+ const parts = [];
53
+ if (config.reasoning) {
54
+ parts.push(traits.getLevelLabel(traits.effortLevel ?? config.reasoning.default));
55
+ }
56
+ if (config.contextWindow1m && traits.use1mContext) parts.push("1M");
57
+ if (config.thinkingToggle && !traits.thinkingEnabled) {
58
+ parts.push("No thinking");
59
+ }
60
+ return {
61
+ suffix: parts.length > 0 ? parts.join(" · ") : undefined,
62
+ fast: Boolean(config.fastMode && traits.fastMode)
63
+ };
64
+ }
35
65
  /**
36
66
  * Button + popover model picker (create modal, composers, toolbars).
37
67
  * For context/dropdown menus, embed `ModelPickerContent` with
38
68
  * `modelPickerSurfaceClass` instead of nesting this popover.
39
69
  */
40
70
  export function ModelPicker(t0) {
41
- const $ = _c(100);
71
+ const $ = _c(105);
42
72
  const {
43
73
  value,
44
74
  onValueChange,
@@ -50,9 +80,7 @@ export function ModelPicker(t0) {
50
80
  onAccountChange,
51
81
  onSelectionChange,
52
82
  canSelectTeamWhilePersonal: t2,
53
- triggerSuffix,
54
- header,
55
- showFastIcon,
83
+ traits,
56
84
  simpleLadder,
57
85
  simpleLadderSnap
58
86
  } = t0;
@@ -60,6 +88,29 @@ export function ModelPicker(t0) {
60
88
  const canSelectTeamWhilePersonal = t2 === undefined ? true : t2;
61
89
  const merge = useCn();
62
90
  const config = useUiConfig("ModelPicker");
91
+ let t3;
92
+ if ($[0] !== traits) {
93
+ t3 = traits === null ? null : modelPickerTraitSummary(traits);
94
+ $[0] = traits;
95
+ $[1] = t3;
96
+ } else {
97
+ t3 = $[1];
98
+ }
99
+ const summary = t3;
100
+ const triggerSuffix = summary?.suffix;
101
+ let t4;
102
+ if ($[2] !== disabled || $[3] !== traits) {
103
+ t4 = traits === null ? undefined : /*#__PURE__*/_jsx(TraitsPanel, {
104
+ ...traits,
105
+ disabled: disabled
106
+ });
107
+ $[2] = disabled;
108
+ $[3] = traits;
109
+ $[4] = t4;
110
+ } else {
111
+ t4 = $[4];
112
+ }
113
+ const header = t4;
63
114
  const [open, setOpen] = useState(false);
64
115
  const [advanced, setAdvanced] = useState(false);
65
116
  const [previewId, setPreviewId] = useState(null);
@@ -75,17 +126,17 @@ export function ModelPicker(t0) {
75
126
  let t11;
76
127
  let t12;
77
128
  let t13;
78
- let t3;
79
- let t4;
129
+ let t14;
130
+ let t15;
80
131
  let t5;
81
132
  let t6;
82
133
  let t7;
83
134
  let t8;
84
135
  let t9;
85
136
  let triggerLabel;
86
- if ($[0] !== accountId || $[1] !== accounts || $[2] !== advanced || $[3] !== className || $[4] !== config?.badgeRing?.trigger || $[5] !== config?.classes?.trigger || $[6] !== disabled || $[7] !== displayValue || $[8] !== merge || $[9] !== onAccountChange || $[10] !== onSelectionChange || $[11] !== onValueChange || $[12] !== open || $[13] !== options || $[14] !== showFastIcon || $[15] !== simpleLadder || $[16] !== simpleLadderSnap || $[17] !== value) {
137
+ if ($[5] !== accountId || $[6] !== accounts || $[7] !== advanced || $[8] !== className || $[9] !== config?.badgeRing?.trigger || $[10] !== config?.classes?.trigger || $[11] !== disabled || $[12] !== displayValue || $[13] !== merge || $[14] !== onAccountChange || $[15] !== onSelectionChange || $[16] !== onValueChange || $[17] !== open || $[18] !== options || $[19] !== simpleLadder || $[20] !== simpleLadderSnap || $[21] !== summary?.fast || $[22] !== value) {
87
138
  const selectedModel = findModelOption(displayValue, options);
88
- if ($[37] !== options || $[38] !== simpleLadder) {
139
+ if ($[42] !== options || $[43] !== simpleLadder) {
89
140
  ladderSteps = [];
90
141
  if (simpleLadder) {
91
142
  for (const id of simpleLadder) {
@@ -95,16 +146,16 @@ export function ModelPicker(t0) {
95
146
  }
96
147
  }
97
148
  }
98
- $[37] = options;
99
- $[38] = simpleLadder;
100
- $[39] = ladderSteps;
149
+ $[42] = options;
150
+ $[43] = simpleLadder;
151
+ $[44] = ladderSteps;
101
152
  } else {
102
- ladderSteps = $[39];
153
+ ladderSteps = $[44];
103
154
  }
104
155
  showLadder = ladderSteps.length >= 2 && !advanced;
105
156
  const preferredSnap = simpleLadderSnap ?? value;
106
157
  snappedAmong = ladderSteps[0]?.id ?? value;
107
- if ($[40] !== ladderSteps || $[41] !== preferredSnap || $[42] !== value) {
158
+ if ($[45] !== ladderSteps || $[46] !== preferredSnap || $[47] !== value) {
108
159
  for (const step of ladderSteps) {
109
160
  if (step.id === value || step.id === preferredSnap) {
110
161
  snappedAmong = step.id;
@@ -113,21 +164,21 @@ export function ModelPicker(t0) {
113
164
  }
114
165
  }
115
166
  }
116
- $[40] = ladderSteps;
117
- $[41] = preferredSnap;
118
- $[42] = value;
119
- $[43] = snappedAmong;
167
+ $[45] = ladderSteps;
168
+ $[46] = preferredSnap;
169
+ $[47] = value;
170
+ $[48] = snappedAmong;
120
171
  } else {
121
- snappedAmong = $[43];
172
+ snappedAmong = $[48];
122
173
  }
123
174
  triggerLabel = selectedModel ? selectedModel.label : "Select model";
124
175
  const instances = buildPickerInstances(options, accounts);
125
176
  const selectedAccount = accountId ? accounts?.find(account => account.id === accountId) : undefined;
126
177
  const activeInstance = (selectedAccount ? instances.find(instance_0 => instance_0.key === selectedAccount.id) : undefined) ?? (selectedModel ? instances.find(instance => instance.key === teamInstanceKey(selectedModel.provider)) : undefined) ?? instances[0];
127
178
  const showAccountBadge = Boolean(selectedAccount && instances.filter(instance_1 => instance_1.provider === selectedAccount.provider).length > 1);
128
- let t14;
129
- if ($[44] !== onAccountChange || $[45] !== onSelectionChange || $[46] !== onValueChange) {
130
- t14 = (modelId, nextAccountId) => {
179
+ let t16;
180
+ if ($[49] !== onAccountChange || $[50] !== onSelectionChange || $[51] !== onValueChange) {
181
+ t16 = (modelId, nextAccountId) => {
131
182
  if (onSelectionChange) {
132
183
  onSelectionChange(modelId, nextAccountId);
133
184
  } else {
@@ -135,14 +186,14 @@ export function ModelPicker(t0) {
135
186
  onAccountChange?.(nextAccountId);
136
187
  }
137
188
  };
138
- $[44] = onAccountChange;
139
- $[45] = onSelectionChange;
140
- $[46] = onValueChange;
141
- $[47] = t14;
189
+ $[49] = onAccountChange;
190
+ $[50] = onSelectionChange;
191
+ $[51] = onValueChange;
192
+ $[52] = t16;
142
193
  } else {
143
- t14 = $[47];
194
+ t16 = $[52];
144
195
  }
145
- commit = t14;
196
+ commit = t16;
146
197
  accountForModel = modelId_0 => {
147
198
  const option_0 = options.find(entry_0 => entry_0.id === modelId_0);
148
199
  if (!option_0) {
@@ -154,38 +205,38 @@ export function ModelPicker(t0) {
154
205
  return null;
155
206
  };
156
207
  T1 = Popover;
157
- t12 = open;
158
- if ($[48] === Symbol.for("react.memo_cache_sentinel")) {
159
- t13 = next => {
208
+ t14 = open;
209
+ if ($[53] === Symbol.for("react.memo_cache_sentinel")) {
210
+ t15 = next => {
160
211
  setOpen(next);
161
212
  if (!next) {
162
213
  setAdvanced(false);
163
214
  setPreviewId(null);
164
215
  }
165
216
  };
166
- $[48] = t13;
217
+ $[53] = t15;
167
218
  } else {
168
- t13 = $[48];
219
+ t15 = $[53];
169
220
  }
170
221
  T0 = PopoverTrigger;
171
- t11 = true;
172
- t3 = "button";
173
- t4 = "combobox";
174
- t5 = open;
175
- t6 = "select-trigger";
176
- const t15 = config?.classes?.trigger ?? TRIGGER_CLASS;
177
- if ($[49] !== className || $[50] !== merge || $[51] !== t15) {
178
- t7 = merge(t15, className);
179
- $[49] = className;
180
- $[50] = merge;
181
- $[51] = t15;
182
- $[52] = t7;
222
+ t13 = true;
223
+ t5 = "button";
224
+ t6 = "combobox";
225
+ t7 = open;
226
+ t8 = "select-trigger";
227
+ const t17 = config?.classes?.trigger ?? TRIGGER_CLASS;
228
+ if ($[54] !== className || $[55] !== merge || $[56] !== t17) {
229
+ t9 = merge(t17, className);
230
+ $[54] = className;
231
+ $[55] = merge;
232
+ $[56] = t17;
233
+ $[57] = t9;
183
234
  } else {
184
- t7 = $[52];
235
+ t9 = $[57];
185
236
  }
186
- t8 = disabled;
187
- if ($[53] !== showFastIcon) {
188
- t9 = showFastIcon ? /*#__PURE__*/_jsx("span", {
237
+ t10 = disabled;
238
+ if ($[58] !== summary?.fast) {
239
+ t11 = summary?.fast ? /*#__PURE__*/_jsx("span", {
189
240
  title: "Fast",
190
241
  className: "inline-flex shrink-0",
191
242
  children: /*#__PURE__*/_jsx(IconBolt, {
@@ -193,12 +244,12 @@ export function ModelPicker(t0) {
193
244
  "aria-hidden": true
194
245
  })
195
246
  }) : null;
196
- $[53] = showFastIcon;
197
- $[54] = t9;
247
+ $[58] = summary?.fast;
248
+ $[59] = t11;
198
249
  } else {
199
- t9 = $[54];
250
+ t11 = $[59];
200
251
  }
201
- t10 = activeInstance && selectedAccount && showAccountBadge ? /*#__PURE__*/_jsxs("span", {
252
+ t12 = activeInstance && selectedAccount && showAccountBadge ? /*#__PURE__*/_jsxs("span", {
202
253
  className: "relative isolate inline-flex size-4 shrink-0 items-center justify-center",
203
254
  children: [/*#__PURE__*/_jsx(ProviderIcon, {
204
255
  provider: selectedModel?.provider ?? "claude",
@@ -215,152 +266,152 @@ export function ModelPicker(t0) {
215
266
  provider: selectedModel?.provider ?? "claude",
216
267
  size: 14
217
268
  });
218
- $[0] = accountId;
219
- $[1] = accounts;
220
- $[2] = advanced;
221
- $[3] = className;
222
- $[4] = config?.badgeRing?.trigger;
223
- $[5] = config?.classes?.trigger;
224
- $[6] = disabled;
225
- $[7] = displayValue;
226
- $[8] = merge;
227
- $[9] = onAccountChange;
228
- $[10] = onSelectionChange;
229
- $[11] = onValueChange;
230
- $[12] = open;
231
- $[13] = options;
232
- $[14] = showFastIcon;
233
- $[15] = simpleLadder;
234
- $[16] = simpleLadderSnap;
235
- $[17] = value;
236
- $[18] = T0;
237
- $[19] = T1;
238
- $[20] = accountForModel;
239
- $[21] = commit;
240
- $[22] = ladderSteps;
241
- $[23] = showLadder;
242
- $[24] = snappedAmong;
243
- $[25] = t10;
244
- $[26] = t11;
245
- $[27] = t12;
246
- $[28] = t13;
247
- $[29] = t3;
248
- $[30] = t4;
249
- $[31] = t5;
250
- $[32] = t6;
251
- $[33] = t7;
252
- $[34] = t8;
253
- $[35] = t9;
254
- $[36] = triggerLabel;
269
+ $[5] = accountId;
270
+ $[6] = accounts;
271
+ $[7] = advanced;
272
+ $[8] = className;
273
+ $[9] = config?.badgeRing?.trigger;
274
+ $[10] = config?.classes?.trigger;
275
+ $[11] = disabled;
276
+ $[12] = displayValue;
277
+ $[13] = merge;
278
+ $[14] = onAccountChange;
279
+ $[15] = onSelectionChange;
280
+ $[16] = onValueChange;
281
+ $[17] = open;
282
+ $[18] = options;
283
+ $[19] = simpleLadder;
284
+ $[20] = simpleLadderSnap;
285
+ $[21] = summary?.fast;
286
+ $[22] = value;
287
+ $[23] = T0;
288
+ $[24] = T1;
289
+ $[25] = accountForModel;
290
+ $[26] = commit;
291
+ $[27] = ladderSteps;
292
+ $[28] = showLadder;
293
+ $[29] = snappedAmong;
294
+ $[30] = t10;
295
+ $[31] = t11;
296
+ $[32] = t12;
297
+ $[33] = t13;
298
+ $[34] = t14;
299
+ $[35] = t15;
300
+ $[36] = t5;
301
+ $[37] = t6;
302
+ $[38] = t7;
303
+ $[39] = t8;
304
+ $[40] = t9;
305
+ $[41] = triggerLabel;
255
306
  } else {
256
- T0 = $[18];
257
- T1 = $[19];
258
- accountForModel = $[20];
259
- commit = $[21];
260
- ladderSteps = $[22];
261
- showLadder = $[23];
262
- snappedAmong = $[24];
263
- t10 = $[25];
264
- t11 = $[26];
265
- t12 = $[27];
266
- t13 = $[28];
267
- t3 = $[29];
268
- t4 = $[30];
269
- t5 = $[31];
270
- t6 = $[32];
271
- t7 = $[33];
272
- t8 = $[34];
273
- t9 = $[35];
274
- triggerLabel = $[36];
307
+ T0 = $[23];
308
+ T1 = $[24];
309
+ accountForModel = $[25];
310
+ commit = $[26];
311
+ ladderSteps = $[27];
312
+ showLadder = $[28];
313
+ snappedAmong = $[29];
314
+ t10 = $[30];
315
+ t11 = $[31];
316
+ t12 = $[32];
317
+ t13 = $[33];
318
+ t14 = $[34];
319
+ t15 = $[35];
320
+ t5 = $[36];
321
+ t6 = $[37];
322
+ t7 = $[38];
323
+ t8 = $[39];
324
+ t9 = $[40];
325
+ triggerLabel = $[41];
275
326
  }
276
- let t14;
277
- if ($[55] !== triggerSuffix) {
278
- t14 = triggerSuffix ? /*#__PURE__*/_jsxs("span", {
327
+ let t16;
328
+ if ($[60] !== triggerSuffix) {
329
+ t16 = triggerSuffix ? /*#__PURE__*/_jsxs("span", {
279
330
  className: "text-muted-foreground/70",
280
331
  children: [" \xB7 ", triggerSuffix]
281
332
  }) : null;
282
- $[55] = triggerSuffix;
283
- $[56] = t14;
333
+ $[60] = triggerSuffix;
334
+ $[61] = t16;
284
335
  } else {
285
- t14 = $[56];
336
+ t16 = $[61];
286
337
  }
287
- let t15;
288
- if ($[57] !== t14 || $[58] !== triggerLabel) {
289
- t15 = /*#__PURE__*/_jsxs("span", {
338
+ let t17;
339
+ if ($[62] !== t16 || $[63] !== triggerLabel) {
340
+ t17 = /*#__PURE__*/_jsxs("span", {
290
341
  className: "whitespace-nowrap text-left max-sm:min-w-0 max-sm:truncate",
291
- children: [triggerLabel, t14]
342
+ children: [triggerLabel, t16]
292
343
  });
293
- $[57] = t14;
294
- $[58] = triggerLabel;
295
- $[59] = t15;
344
+ $[62] = t16;
345
+ $[63] = triggerLabel;
346
+ $[64] = t17;
296
347
  } else {
297
- t15 = $[59];
348
+ t17 = $[64];
298
349
  }
299
- let t16;
300
- if ($[60] === Symbol.for("react.memo_cache_sentinel")) {
301
- t16 = /*#__PURE__*/_jsx(IconChevronDown, {
350
+ let t18;
351
+ if ($[65] === Symbol.for("react.memo_cache_sentinel")) {
352
+ t18 = /*#__PURE__*/_jsx(IconChevronDown, {
302
353
  size: 12,
303
354
  className: "shrink-0 opacity-60",
304
355
  "aria-hidden": true
305
356
  });
306
- $[60] = t16;
357
+ $[65] = t18;
307
358
  } else {
308
- t16 = $[60];
359
+ t18 = $[65];
309
360
  }
310
- let t17;
311
- if ($[61] !== t10 || $[62] !== t15 || $[63] !== t3 || $[64] !== t4 || $[65] !== t5 || $[66] !== t6 || $[67] !== t7 || $[68] !== t8 || $[69] !== t9) {
312
- t17 = /*#__PURE__*/_jsxs("button", {
313
- type: t3,
314
- role: t4,
315
- "aria-expanded": t5,
316
- "data-slot": t6,
317
- className: t7,
318
- disabled: t8,
319
- children: [t9, t10, t15, t16]
361
+ let t19;
362
+ if ($[66] !== t10 || $[67] !== t11 || $[68] !== t12 || $[69] !== t17 || $[70] !== t5 || $[71] !== t6 || $[72] !== t7 || $[73] !== t8 || $[74] !== t9) {
363
+ t19 = /*#__PURE__*/_jsxs("button", {
364
+ type: t5,
365
+ role: t6,
366
+ "aria-expanded": t7,
367
+ "data-slot": t8,
368
+ className: t9,
369
+ disabled: t10,
370
+ children: [t11, t12, t17, t18]
320
371
  });
321
- $[61] = t10;
322
- $[62] = t15;
323
- $[63] = t3;
324
- $[64] = t4;
325
- $[65] = t5;
326
- $[66] = t6;
327
- $[67] = t7;
328
- $[68] = t8;
329
- $[69] = t9;
330
- $[70] = t17;
372
+ $[66] = t10;
373
+ $[67] = t11;
374
+ $[68] = t12;
375
+ $[69] = t17;
376
+ $[70] = t5;
377
+ $[71] = t6;
378
+ $[72] = t7;
379
+ $[73] = t8;
380
+ $[74] = t9;
381
+ $[75] = t19;
331
382
  } else {
332
- t17 = $[70];
383
+ t19 = $[75];
333
384
  }
334
- let t18;
335
- if ($[71] !== T0 || $[72] !== t11 || $[73] !== t17) {
336
- t18 = /*#__PURE__*/_jsx(T0, {
337
- asChild: t11,
338
- children: t17
385
+ let t20;
386
+ if ($[76] !== T0 || $[77] !== t13 || $[78] !== t19) {
387
+ t20 = /*#__PURE__*/_jsx(T0, {
388
+ asChild: t13,
389
+ children: t19
339
390
  });
340
- $[71] = T0;
341
- $[72] = t11;
342
- $[73] = t17;
343
- $[74] = t18;
391
+ $[76] = T0;
392
+ $[77] = t13;
393
+ $[78] = t19;
394
+ $[79] = t20;
344
395
  } else {
345
- t18 = $[74];
396
+ t20 = $[79];
346
397
  }
347
- const t19 = showLadder ? "w-56 p-3" : modelPickerSurfaceClass;
348
- let t20;
349
- if ($[75] !== showLadder) {
350
- t20 = event => {
398
+ const t21 = showLadder ? "w-56 p-3" : modelPickerSurfaceClass;
399
+ let t22;
400
+ if ($[80] !== showLadder) {
401
+ t22 = event => {
351
402
  if (showLadder) {
352
403
  return;
353
404
  }
354
405
  event.preventDefault();
355
406
  };
356
- $[75] = showLadder;
357
- $[76] = t20;
407
+ $[80] = showLadder;
408
+ $[81] = t22;
358
409
  } else {
359
- t20 = $[76];
410
+ t22 = $[81];
360
411
  }
361
- let t21;
362
- if ($[77] !== accountForModel || $[78] !== accountId || $[79] !== accounts || $[80] !== canSelectTeamWhilePersonal || $[81] !== commit || $[82] !== disabled || $[83] !== displayValue || $[84] !== header || $[85] !== ladderSteps || $[86] !== options || $[87] !== showLadder || $[88] !== snappedAmong) {
363
- t21 = showLadder ? /*#__PURE__*/_jsx(SimpleModelLadder, {
412
+ let t23;
413
+ if ($[82] !== accountForModel || $[83] !== accountId || $[84] !== accounts || $[85] !== canSelectTeamWhilePersonal || $[86] !== commit || $[87] !== disabled || $[88] !== displayValue || $[89] !== header || $[90] !== ladderSteps || $[91] !== options || $[92] !== showLadder || $[93] !== snappedAmong) {
414
+ t23 = showLadder ? /*#__PURE__*/_jsx(SimpleModelLadder, {
364
415
  value: displayValue,
365
416
  steps: ladderSteps,
366
417
  snappedId: snappedAmong,
@@ -382,52 +433,52 @@ export function ModelPicker(t0) {
382
433
  },
383
434
  header: header
384
435
  });
385
- $[77] = accountForModel;
386
- $[78] = accountId;
387
- $[79] = accounts;
388
- $[80] = canSelectTeamWhilePersonal;
389
- $[81] = commit;
390
- $[82] = disabled;
391
- $[83] = displayValue;
392
- $[84] = header;
393
- $[85] = ladderSteps;
394
- $[86] = options;
395
- $[87] = showLadder;
396
- $[88] = snappedAmong;
397
- $[89] = t21;
436
+ $[82] = accountForModel;
437
+ $[83] = accountId;
438
+ $[84] = accounts;
439
+ $[85] = canSelectTeamWhilePersonal;
440
+ $[86] = commit;
441
+ $[87] = disabled;
442
+ $[88] = displayValue;
443
+ $[89] = header;
444
+ $[90] = ladderSteps;
445
+ $[91] = options;
446
+ $[92] = showLadder;
447
+ $[93] = snappedAmong;
448
+ $[94] = t23;
398
449
  } else {
399
- t21 = $[89];
450
+ t23 = $[94];
400
451
  }
401
- let t22;
402
- if ($[90] !== t19 || $[91] !== t20 || $[92] !== t21) {
403
- t22 = /*#__PURE__*/_jsx(PopoverContent, {
452
+ let t24;
453
+ if ($[95] !== t21 || $[96] !== t22 || $[97] !== t23) {
454
+ t24 = /*#__PURE__*/_jsx(PopoverContent, {
404
455
  align: "start",
405
- className: t19,
406
- onOpenAutoFocus: t20,
407
- children: t21
456
+ className: t21,
457
+ onOpenAutoFocus: t22,
458
+ children: t23
408
459
  });
409
- $[90] = t19;
410
- $[91] = t20;
411
- $[92] = t21;
412
- $[93] = t22;
460
+ $[95] = t21;
461
+ $[96] = t22;
462
+ $[97] = t23;
463
+ $[98] = t24;
413
464
  } else {
414
- t22 = $[93];
465
+ t24 = $[98];
415
466
  }
416
- let t23;
417
- if ($[94] !== T1 || $[95] !== t12 || $[96] !== t13 || $[97] !== t18 || $[98] !== t22) {
418
- t23 = /*#__PURE__*/_jsxs(T1, {
419
- open: t12,
420
- onOpenChange: t13,
421
- children: [t18, t22]
467
+ let t25;
468
+ if ($[99] !== T1 || $[100] !== t14 || $[101] !== t15 || $[102] !== t20 || $[103] !== t24) {
469
+ t25 = /*#__PURE__*/_jsxs(T1, {
470
+ open: t14,
471
+ onOpenChange: t15,
472
+ children: [t20, t24]
422
473
  });
423
- $[94] = T1;
424
- $[95] = t12;
425
- $[96] = t13;
426
- $[97] = t18;
427
- $[98] = t22;
428
- $[99] = t23;
474
+ $[99] = T1;
475
+ $[100] = t14;
476
+ $[101] = t15;
477
+ $[102] = t20;
478
+ $[103] = t24;
479
+ $[104] = t25;
429
480
  } else {
430
- t23 = $[99];
481
+ t25 = $[104];
431
482
  }
432
- return t23;
483
+ return t25;
433
484
  }
@@ -47,7 +47,7 @@ export function AnimatedCounter(t0) {
47
47
  } else {
48
48
  t6 = $[2];
49
49
  }
50
- const springValue = useSpring(0, t6);
50
+ const springValue = useSpring(animateOnView ? 0 : value, t6);
51
51
  let t7;
52
52
  if ($[3] !== formatValue) {
53
53
  t7 = v => formatValue(v);
package/dist/src/index.js CHANGED
@@ -202,6 +202,7 @@ export { ProductHero } from "./marketing/ProductHero.js";
202
202
  export { ProductHeroOrbit } from "./marketing/ProductHeroOrbit.js";
203
203
  export { PROJECT_V_HOME_URL } from "./marketing/projectV.js";
204
204
  export { PricingModal, V_PRO_APP_BENEFITS } from "./marketing/PricingModal.js";
205
+ export { VProPricingModal } from "./marketing/VProPricingModal.js";
205
206
  // App helpers: confirm skip, update watcher, settings chrome, stable auth, Convex provider, VITE env and ensure-user.
206
207
  export * from "../app/src/index.js";
207
208
 
@@ -0,0 +1,83 @@
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { Show } from "@clerk/react";
3
+ import { CheckoutButton } from "@clerk/react/experimental";
4
+ import { PricingModal } from "./PricingModal.js";
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ /** V Pro upgrade dialog: `PricingModal` with Clerk checkout on the Pro plan card. */
7
+ export function VProPricingModal(t0) {
8
+ const $ = _c(16);
9
+ let planId;
10
+ let props;
11
+ let renderCheckout;
12
+ let t1;
13
+ let t2;
14
+ let t3;
15
+ if ($[0] !== t0) {
16
+ ({
17
+ planId,
18
+ proPlanId: t1,
19
+ checkoutEnabled: t2,
20
+ signedInOnly: t3,
21
+ renderCheckout,
22
+ ...props
23
+ } = t0);
24
+ $[0] = t0;
25
+ $[1] = planId;
26
+ $[2] = props;
27
+ $[3] = renderCheckout;
28
+ $[4] = t1;
29
+ $[5] = t2;
30
+ $[6] = t3;
31
+ } else {
32
+ planId = $[1];
33
+ props = $[2];
34
+ renderCheckout = $[3];
35
+ t1 = $[4];
36
+ t2 = $[5];
37
+ t3 = $[6];
38
+ }
39
+ const proPlanId = t1 === undefined ? "pro" : t1;
40
+ const checkoutEnabled = t2 === undefined ? true : t2;
41
+ const signedInOnly = t3 === undefined ? true : t3;
42
+ let t4;
43
+ if ($[7] !== checkoutEnabled || $[8] !== planId || $[9] !== proPlanId || $[10] !== renderCheckout || $[11] !== signedInOnly) {
44
+ t4 = (button, plan, period) => {
45
+ if (!checkoutEnabled || plan.id !== proPlanId) {
46
+ return button;
47
+ }
48
+ if (renderCheckout) {
49
+ return renderCheckout(button, plan, period);
50
+ }
51
+ const checkout = /*#__PURE__*/_jsx(CheckoutButton, {
52
+ planId: planId,
53
+ planPeriod: period === "year" ? "annual" : "month",
54
+ children: button
55
+ });
56
+ return signedInOnly ? /*#__PURE__*/_jsx(Show, {
57
+ when: "signed-in",
58
+ children: checkout
59
+ }) : checkout;
60
+ };
61
+ $[7] = checkoutEnabled;
62
+ $[8] = planId;
63
+ $[9] = proPlanId;
64
+ $[10] = renderCheckout;
65
+ $[11] = signedInOnly;
66
+ $[12] = t4;
67
+ } else {
68
+ t4 = $[12];
69
+ }
70
+ let t5;
71
+ if ($[13] !== props || $[14] !== t4) {
72
+ t5 = /*#__PURE__*/_jsx(PricingModal, {
73
+ ...props,
74
+ renderCheckout: t4
75
+ });
76
+ $[13] = props;
77
+ $[14] = t4;
78
+ $[15] = t5;
79
+ } else {
80
+ t5 = $[15];
81
+ }
82
+ return t5;
83
+ }
@@ -8,7 +8,7 @@ import { extendTailwindMerge } from "tailwind-merge";
8
8
  const twMerge = extendTailwindMerge({
9
9
  extend: {
10
10
  theme: {
11
- borderRadius: ["field", "surface", "menu", "menu-item", "control"]
11
+ radius: ["field", "surface", "menu", "menu-item", "control"]
12
12
  }
13
13
  }
14
14
  });
package/package.json CHANGED
@@ -1,16 +1,15 @@
1
1
  {
2
2
  "name": "@vvedantb/ui",
3
- "version": "0.64.0",
3
+ "version": "0.66.0",
4
4
  "license": "MIT",
5
5
  "description": "Shared React 19 UI for web apps: one main JavaScript entry (primitives, shell pieces, app helpers including the Convex and Clerk provider, VITE env parsing and ensure-user, artifact viewers over the @vvedantb/server artifacts core, native tokens), third-party brand logos (also @vvedantb/ui/logos), motion-driven animated SVG icons (@vvedantb/ui/icons/animated), a client entry without @vvedantb/server, convex or Clerk for Chrome extensions, design-token CSS, shared Tailwind v4 CSS, a Tailwind preset and packaged Instrument Sans fonts.",
6
6
  "type": "module",
7
7
  "publishConfig": {
8
- "access": "public",
9
- "provenance": true
8
+ "access": "public"
10
9
  },
11
10
  "repository": {
12
11
  "type": "git",
13
- "url": "git+https://github.com/vvedantb/packages.git",
12
+ "url": "git+https://github.com/vvedantb/v.git",
14
13
  "directory": "packages/ui"
15
14
  },
16
15
  "exports": {
@@ -101,13 +100,13 @@
101
100
  "@dnd-kit/sortable": "^10.0.0",
102
101
  "@dnd-kit/utilities": "^3.2.2",
103
102
  "@web-kits/motion-blur": "^0.1.0",
104
- "dayjs": "^1.11.13",
103
+ "dayjs": "^1.11.23",
105
104
  "katex": "^0.16.45",
106
105
  "media-chrome": "^4.14.0",
107
106
  "react-day-picker": "^9.14.0"
108
107
  },
109
108
  "peerDependencies": {
110
- "@clerk/clerk-react": ">=5",
109
+ "@clerk/react": ">=6",
111
110
  "@json-render/core": ">=0.21.0",
112
111
  "@json-render/react": ">=0.21.0",
113
112
  "@radix-ui/react-accordion": "^1.2.12",
@@ -131,93 +130,93 @@
131
130
  "@radix-ui/react-use-controllable-state": "^1.2.2",
132
131
  "@radix-ui/react-visually-hidden": "^1.2.3",
133
132
  "@streamdown/cjk": "*",
134
- "@streamdown/code": "*",
133
+ "@streamdown/code": "^2",
135
134
  "@streamdown/math": "*",
136
135
  "@streamdown/mermaid": "*",
137
- "@tabler/icons-react": "^3.35.0",
138
- "@tanstack/react-hotkeys": "*",
139
- "@vvedantb/server": ">=0.17.1",
140
- "ai": ">=5.0.0",
136
+ "@tabler/icons-react": "^3.52.0",
137
+ "@tanstack/react-hotkeys": "^0.27.0",
138
+ "@vvedantb/server": ">=0.18.0",
139
+ "ai": "^7",
141
140
  "class-variance-authority": "^0.7.1",
142
141
  "clsx": "^2.1.1",
143
142
  "cmdk": "^1.1.1",
144
143
  "convex": "^1.24.0",
145
144
  "embla-carousel-react": "^8.6.0",
146
- "motion": ">=12.0.0",
145
+ "motion": "^13",
147
146
  "nanoid": "^5.1.0",
148
147
  "radix-ui": "^1.4.0",
149
148
  "react": ">=19.0.0",
150
149
  "react-dom": ">=19.0.0",
151
- "shiki": "^3.0.0",
150
+ "shiki": "^4",
152
151
  "sonner": "^2.0.3",
153
152
  "streamdown": "^2.3.0",
154
- "tailwind-merge": "^2.6.0",
153
+ "tailwind-merge": "^3",
155
154
  "use-stick-to-bottom": "^1.1.0",
156
155
  "vaul": "^1.1.0",
157
- "zod": "^3.25.0 || ^4.0.0"
156
+ "zod": "^4.0.0"
158
157
  },
159
158
  "devDependencies": {
160
- "@clerk/clerk-react": "^5.0.0",
159
+ "@clerk/react": "6.19.4",
161
160
  "@json-render/core": "0.21.0",
162
161
  "@json-render/react": "0.21.0",
163
- "@radix-ui/react-accordion": "^1.2.12",
164
- "@radix-ui/react-checkbox": "^1.3.3",
165
- "@radix-ui/react-collapsible": "^1.1.12",
166
- "@radix-ui/react-context-menu": "^2.2.15",
167
- "@radix-ui/react-dialog": "^1.1.15",
168
- "@radix-ui/react-dropdown-menu": "^2.1.16",
169
- "@radix-ui/react-hover-card": "^1.1.15",
170
- "@radix-ui/react-label": "^2.1.8",
171
- "@radix-ui/react-popover": "^1.1.15",
172
- "@radix-ui/react-progress": "^1.1.8",
173
- "@radix-ui/react-scroll-area": "^1.2.10",
174
- "@radix-ui/react-select": "^2.2.6",
175
- "@radix-ui/react-separator": "^1.1.8",
176
- "@radix-ui/react-slider": "^1.4.7",
177
- "@radix-ui/react-slot": "^1.2.4",
178
- "@radix-ui/react-switch": "^1.1.7",
179
- "@radix-ui/react-tabs": "^1.1.13",
180
- "@radix-ui/react-tooltip": "^1.2.8",
181
- "@radix-ui/react-use-controllable-state": "^1.2.2",
182
- "@radix-ui/react-visually-hidden": "^1.2.3",
183
- "@streamdown/cjk": "*",
184
- "@streamdown/code": "*",
185
- "@streamdown/math": "*",
186
- "@streamdown/mermaid": "*",
187
- "@tabler/icons-react": "^3.35.0",
188
- "@tailwindcss/node": "4.3.3",
189
- "@tanstack/react-hotkeys": "^0.13.0",
190
- "@types/react": "^19.1.0",
191
- "@types/react-dom": "^19.1.0",
192
- "ai": "^5.0.0",
162
+ "@radix-ui/react-accordion": "1.2.20",
163
+ "@radix-ui/react-checkbox": "1.3.11",
164
+ "@radix-ui/react-collapsible": "1.1.20",
165
+ "@radix-ui/react-context-menu": "2.3.7",
166
+ "@radix-ui/react-dialog": "1.1.23",
167
+ "@radix-ui/react-dropdown-menu": "2.1.24",
168
+ "@radix-ui/react-hover-card": "1.1.23",
169
+ "@radix-ui/react-label": "2.1.15",
170
+ "@radix-ui/react-popover": "1.1.23",
171
+ "@radix-ui/react-progress": "1.1.16",
172
+ "@radix-ui/react-scroll-area": "1.2.18",
173
+ "@radix-ui/react-select": "2.3.7",
174
+ "@radix-ui/react-separator": "1.1.15",
175
+ "@radix-ui/react-slider": "1.4.7",
176
+ "@radix-ui/react-slot": "1.3.3",
177
+ "@radix-ui/react-switch": "1.3.7",
178
+ "@radix-ui/react-tabs": "1.1.21",
179
+ "@radix-ui/react-tooltip": "1.2.16",
180
+ "@radix-ui/react-use-controllable-state": "1.2.6",
181
+ "@radix-ui/react-visually-hidden": "1.2.11",
182
+ "@streamdown/cjk": "^1.0.4",
183
+ "@streamdown/code": "2.0.1",
184
+ "@streamdown/math": "^1.0.3",
185
+ "@streamdown/mermaid": "^1.0.3",
186
+ "@tabler/icons-react": "^3.52.0",
187
+ "@tailwindcss/node": "4.3.5",
188
+ "@tanstack/react-hotkeys": "0.27.2",
189
+ "@types/node": "22.20.5",
190
+ "@types/react": "19.3.0",
191
+ "@types/react-dom": "19.3.0",
192
+ "ai": "7.0.179",
193
193
  "class-variance-authority": "^0.7.1",
194
194
  "clsx": "^2.1.1",
195
195
  "cmdk": "^1.1.1",
196
- "convex": "^1.47.0",
196
+ "convex": "1.48.0",
197
197
  "embla-carousel-react": "^8.6.0",
198
198
  "esbuild": "0.28.2",
199
- "happy-dom": "^18.0.0",
200
- "motion": "^12.0.0",
201
- "nanoid": "^5.1.0",
202
- "next-themes": "0.4.6",
203
- "radix-ui": "^1.4.0",
204
- "react": "^19.1.0",
205
- "react-dom": "^19.1.0",
206
- "shiki": "^3.0.0",
207
- "sonner": "^2.0.3",
208
- "streamdown": "^2.7.1",
209
- "tailwind-merge": "^2.6.0",
210
- "tailwindcss": "4.3.3",
199
+ "happy-dom": "21.0.4",
200
+ "motion": "13.5.1",
201
+ "nanoid": "^5.1.16",
202
+ "next-themes": "^0.4.6",
203
+ "radix-ui": "^1.6.7",
204
+ "react": "19.3.0",
205
+ "react-dom": "19.3.0",
206
+ "shiki": "4.6.0",
207
+ "sonner": "^2.0.8",
208
+ "streamdown": "2.7.1",
209
+ "tailwind-merge": "3.7.1",
210
+ "tailwindcss": "4.3.5",
211
211
  "typescript": "7.0.2",
212
- "use-stick-to-bottom": "^1.1.0",
213
- "vaul": "^1.1.0",
214
- "vitest": "^3.2.0",
215
- "zod": "^4.0.0",
216
- "zod3": "npm:zod@^3.25.76",
217
- "@vvedantb/server": "0.17.1"
212
+ "use-stick-to-bottom": "^1.1.6",
213
+ "vaul": "^1.1.2",
214
+ "vitest": "5.1.1",
215
+ "zod": "4.6.6",
216
+ "@vvedantb/server": "0.18.0"
218
217
  },
219
218
  "peerDependenciesMeta": {
220
- "@clerk/clerk-react": {
219
+ "@clerk/react": {
221
220
  "optional": true
222
221
  },
223
222
  "convex": {
@@ -1,8 +1,8 @@
1
- import type { Experimental_GeneratedImage } from "ai";
1
+ import type { GeneratedFile } from "ai";
2
2
 
3
3
  import { cn } from "../utils/cn";
4
4
 
5
- export type ImageProps = Experimental_GeneratedImage & {
5
+ export type ImageProps = GeneratedFile & {
6
6
  className?: string;
7
7
  alt?: string;
8
8
  };
@@ -11,6 +11,7 @@ export const Image = ({
11
11
  base64,
12
12
  uint8Array: _uint8Array,
13
13
  mediaType,
14
+ providerMetadata: _providerMetadata,
14
15
  ...props
15
16
  }: ImageProps) => (
16
17
  <img
@@ -1,4 +1,4 @@
1
- import { useState, type ReactNode } from "react";
1
+ import { useState } from "react";
2
2
  import { IconBolt, IconChevronDown } from "@tabler/icons-react";
3
3
  import { SimpleModelLadder } from "./simple-model-ladder";
4
4
  import { Popover, PopoverContent, PopoverTrigger } from "../ui/popover";
@@ -17,6 +17,7 @@ import {
17
17
  formatModelDisplayLabel,
18
18
  getProviderLabel,
19
19
  } from "./model-picker-types";
20
+ import { TraitsPanel, type TraitsMenuProps } from "./prompt-input-traits";
20
21
 
21
22
  export type { ModelAccount, ModelOption };
22
23
  export { findModelOption, formatModelDisplayLabel, getProviderLabel };
@@ -49,6 +50,39 @@ const TRIGGER_CLASS =
49
50
  export const modelPickerSurfaceClass =
50
51
  "w-100 max-w-[calc(100vw-1rem)] overflow-hidden rounded-menu border-0 bg-transparent p-0 shadow-none";
51
52
 
53
+ /**
54
+ * The selected model's trait controls (reasoning, thinking, context window,
55
+ * Fast). `ModelPicker` pins them above the model list and sums them up on the
56
+ * trigger, so every picker shows traits the same way.
57
+ */
58
+ export type ModelPickerTraits = Omit<TraitsMenuProps, "className" | "disabled">;
59
+
60
+ /**
61
+ * What the trigger shows after the model name: the reasoning level, "1M" when
62
+ * the 1M context is on, "No thinking" when thinking is off, joined by " · ",
63
+ * and whether Fast is on (the bolt). Only traits the model supports count.
64
+ */
65
+ export function modelPickerTraitSummary(traits: ModelPickerTraits): {
66
+ suffix: string | undefined;
67
+ fast: boolean;
68
+ } {
69
+ const { config } = traits;
70
+ const parts: string[] = [];
71
+ if (config.reasoning) {
72
+ parts.push(
73
+ traits.getLevelLabel(traits.effortLevel ?? config.reasoning.default),
74
+ );
75
+ }
76
+ if (config.contextWindow1m && traits.use1mContext) parts.push("1M");
77
+ if (config.thinkingToggle && !traits.thinkingEnabled) {
78
+ parts.push("No thinking");
79
+ }
80
+ return {
81
+ suffix: parts.length > 0 ? parts.join(" · ") : undefined,
82
+ fast: Boolean(config.fastMode && traits.fastMode),
83
+ };
84
+ }
85
+
52
86
  export interface ModelPickerProps<TModel extends string = string> {
53
87
  value: TModel;
54
88
  onValueChange: (model: TModel) => void;
@@ -77,14 +111,10 @@ export interface ModelPickerProps<TModel extends string = string> {
77
111
  */
78
112
  canSelectTeamWhilePersonal?: boolean;
79
113
  /**
80
- * Compact label after the model name on the trigger (e.g. the active
81
- * reasoning level).
114
+ * The selected model's traits. Required so no picker drops them by
115
+ * accident: pass `null` only where runs take no traits.
82
116
  */
83
- triggerSuffix?: string;
84
- /** Pinned above the model list — typically trait controls. */
85
- header?: ReactNode;
86
- /** Bolt before the provider icon when Fast mode is on. */
87
- showFastIcon?: boolean;
117
+ traits: ModelPickerTraits | null;
88
118
  /**
89
119
  * Simple-view capability ladder (cheapest → strongest). When at least two of
90
120
  * these ids are in `options`, the popover opens on a discrete slider;
@@ -111,14 +141,18 @@ export function ModelPicker<TModel extends string>({
111
141
  onAccountChange,
112
142
  onSelectionChange,
113
143
  canSelectTeamWhilePersonal = true,
114
- triggerSuffix,
115
- header,
116
- showFastIcon,
144
+ traits,
117
145
  simpleLadder,
118
146
  simpleLadderSnap,
119
147
  }: ModelPickerProps<TModel>) {
120
148
  const merge = useCn();
121
149
  const config = useUiConfig("ModelPicker");
150
+ const summary = traits === null ? null : modelPickerTraitSummary(traits);
151
+ const triggerSuffix = summary?.suffix;
152
+ const header =
153
+ traits === null ? undefined : (
154
+ <TraitsPanel {...traits} disabled={disabled} />
155
+ );
122
156
  const [open, setOpen] = useState(false);
123
157
  const [advanced, setAdvanced] = useState(false);
124
158
  const [previewId, setPreviewId] = useState<TModel | null>(null);
@@ -208,7 +242,7 @@ export function ModelPicker<TModel extends string>({
208
242
  )}
209
243
  disabled={disabled}
210
244
  >
211
- {showFastIcon ? (
245
+ {summary?.fast ? (
212
246
  <span title="Fast" className="inline-flex shrink-0">
213
247
  <IconBolt size={12} aria-hidden />
214
248
  </span>
@@ -30,7 +30,8 @@ export function AnimatedCounter({
30
30
  }: AnimatedCounterProps) {
31
31
  const ref = useRef<HTMLSpanElement>(null);
32
32
  const isInView = useInView(ref, { once: true, margin: "-50px" });
33
- const springValue = useSpring(0, { stiffness: 100 / duration, damping: 30, restDelta: 0.01 });
33
+ // Start at `value` when not waiting for view, so remounts do not flash zeros.
34
+ const springValue = useSpring(animateOnView ? 0 : value, { stiffness: 100 / duration, damping: 30, restDelta: 0.01 });
34
35
  const displayValue = useTransform(springValue, (v) => formatValue(v));
35
36
 
36
37
  useEffect(() => {
package/src/index.ts CHANGED
@@ -383,6 +383,8 @@ export type {
383
383
  PricingPlanAppBenefit,
384
384
  PricingPlanBenefit,
385
385
  } from "./marketing/PricingModal";
386
+ export { VProPricingModal } from "./marketing/VProPricingModal";
387
+ export type { VProPricingModalProps } from "./marketing/VProPricingModal";
386
388
 
387
389
  // App helpers: confirm skip, update watcher, settings chrome, stable auth, Convex provider, VITE env and ensure-user.
388
390
  export * from "../app/src/index";
@@ -0,0 +1,48 @@
1
+ import type { ReactElement, ReactNode } from "react";
2
+ import { Show } from "@clerk/react";
3
+ import { CheckoutButton } from "@clerk/react/experimental";
4
+ import {
5
+ PricingModal,
6
+ type PricingModalMultiProps,
7
+ type PricingModalPeriod,
8
+ type PricingPlan,
9
+ } from "./PricingModal";
10
+
11
+ export type VProPricingModalProps = Omit<PricingModalMultiProps, "renderCheckout"> & {
12
+ /** Clerk Billing plan id passed to `CheckoutButton`. */
13
+ planId: string;
14
+ /** Id of the plan card that gets checkout. Default `"pro"`. */
15
+ proPlanId?: string;
16
+ /** Set `false` to return the bare button, for example when Clerk is not configured. Default `true`. */
17
+ checkoutEnabled?: boolean;
18
+ /** Wrap checkout in Clerk `<Show when="signed-in">`. Default `true`. */
19
+ signedInOnly?: boolean;
20
+ /** Replaces the default `CheckoutButton` wiring, for apps with their own auth flow. */
21
+ renderCheckout?: (button: ReactElement, plan: PricingPlan, period: PricingModalPeriod) => ReactNode;
22
+ };
23
+
24
+ /** V Pro upgrade dialog: `PricingModal` with Clerk checkout on the Pro plan card. */
25
+ export function VProPricingModal({
26
+ planId,
27
+ proPlanId = "pro",
28
+ checkoutEnabled = true,
29
+ signedInOnly = true,
30
+ renderCheckout,
31
+ ...props
32
+ }: VProPricingModalProps) {
33
+ return (
34
+ <PricingModal
35
+ {...props}
36
+ renderCheckout={(button: ReactElement, plan: PricingPlan, period: PricingModalPeriod) => {
37
+ if (!checkoutEnabled || plan.id !== proPlanId) return button;
38
+ if (renderCheckout) return renderCheckout(button, plan, period);
39
+ const checkout = (
40
+ <CheckoutButton planId={planId} planPeriod={period === "year" ? "annual" : "month"}>
41
+ {button}
42
+ </CheckoutButton>
43
+ );
44
+ return signedInOnly ? <Show when="signed-in">{checkout}</Show> : checkout;
45
+ }}
46
+ />
47
+ );
48
+ }
package/src/ui/tabs.tsx CHANGED
@@ -3,8 +3,8 @@ import * as TabsPrimitive from "@radix-ui/react-tabs";
3
3
  import { cva, type VariantProps } from "class-variance-authority";
4
4
  import { assignRef } from "../utils/ref";
5
5
  import { syncTabsPill, type TabsPillMotion } from "./tabsSliding";
6
- import { useCn, useUiConfig } from "./ui-config";
7
6
  import type { TabsTransitionVariant } from "./tabs-transition";
7
+ import { useCn, useUiConfig } from "./ui-config";
8
8
 
9
9
  const Tabs = TabsPrimitive.Root;
10
10
 
package/src/utils/cn.ts CHANGED
@@ -8,7 +8,7 @@ import { extendTailwindMerge } from "tailwind-merge";
8
8
  const twMerge = extendTailwindMerge({
9
9
  extend: {
10
10
  theme: {
11
- borderRadius: ["field", "surface", "menu", "menu-item", "control"],
11
+ radius: ["field", "surface", "menu", "menu-item", "control"],
12
12
  },
13
13
  },
14
14
  });
@@ -7,8 +7,8 @@
7
7
  "build": "vite build"
8
8
  },
9
9
  "devDependencies": {
10
- "@tailwindcss/vite": "4.3.3",
11
- "tailwindcss": "4.3.3",
10
+ "@tailwindcss/vite": "4.3.5",
11
+ "tailwindcss": "4.3.5",
12
12
  "vite": "^7.0.0"
13
13
  }
14
14
  }
@@ -7,8 +7,8 @@
7
7
  "build": "vite build"
8
8
  },
9
9
  "devDependencies": {
10
- "@tailwindcss/vite": "4.3.3",
11
- "tailwindcss": "4.3.3",
10
+ "@tailwindcss/vite": "4.3.5",
11
+ "tailwindcss": "4.3.5",
12
12
  "vite": "^7.0.0"
13
13
  }
14
14
  }
@@ -7,8 +7,8 @@
7
7
  "build": "vite build"
8
8
  },
9
9
  "devDependencies": {
10
- "@tailwindcss/vite": "4.3.3",
11
- "tailwindcss": "4.3.3",
10
+ "@tailwindcss/vite": "4.3.5",
11
+ "tailwindcss": "4.3.5",
12
12
  "vite": "^7.0.0"
13
13
  }
14
14
  }