@vvedantb/ui 0.65.0 → 0.67.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 +2 -2
- package/app/src/auth/useStableAuth.ts +2 -2
- package/app/src/convex/ConvexClerkProvider.tsx +2 -2
- package/dist/app/src/auth/useStableAuth.js +2 -2
- package/dist/app/src/convex/ConvexClerkProvider.js +1 -1
- package/dist/shell/src/SidebarAccountMenu.js +1 -1
- package/dist/src/ai-elements/image.js +1 -0
- package/dist/src/ai-elements/message.js +3 -2
- package/dist/src/ai-elements/queue.js +2 -1
- package/dist/src/artifacts/artifact-card.js +1 -1
- package/dist/src/artifacts/artifact-viewer.js +2 -1
- package/dist/src/icons/animated/animated-counter.js +1 -1
- package/dist/src/index.js +1 -0
- package/dist/src/marketing/VProPricingModal.js +83 -0
- package/dist/src/ui/_menu-classes.js +6 -0
- package/dist/src/ui/context-menu.js +40 -34
- package/dist/src/ui/dropdown-menu.js +40 -34
- package/dist/src/utils/cn.js +1 -1
- package/package.json +65 -66
- package/shell/src/SidebarAccountMenu.tsx +1 -1
- package/src/ai-elements/__snapshots__/queue.test.tsx.snap +2 -2
- package/src/ai-elements/image.tsx +3 -2
- package/src/ai-elements/message.tsx +3 -2
- package/src/ai-elements/queue.tsx +2 -1
- package/src/artifacts/artifact-card.tsx +1 -1
- package/src/artifacts/artifact-viewer.tsx +2 -1
- package/src/icons/animated/animated-counter.tsx +2 -1
- package/src/index.ts +2 -0
- package/src/marketing/VProPricingModal.tsx +48 -0
- package/src/ui/_menu-classes.ts +7 -0
- package/src/ui/context-menu.tsx +5 -2
- package/src/ui/dropdown-menu.tsx +5 -2
- package/src/ui/tabs.tsx +1 -1
- package/src/utils/cn.ts +1 -1
- package/tokens/examples/compat-shadcn-rgb/package.json +2 -2
- package/tokens/examples/toaster/package.json +2 -2
- package/tokens/examples/tokens-moved/package.json +2 -2
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/
|
|
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
|
|
|
@@ -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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
53
|
+
/** `useAuth` from `@clerk/react` with the 2000 ms debounce. */
|
|
54
54
|
export const useStableAuth = createUseStableAuth(useAuth);
|
|
@@ -115,7 +115,7 @@ export function SidebarAccountMenu(t0) {
|
|
|
115
115
|
onSelect: () => request(() => setSignOutOpen(true), () => {
|
|
116
116
|
handleSignOut();
|
|
117
117
|
}),
|
|
118
|
-
|
|
118
|
+
variant: "destructive",
|
|
119
119
|
title: skipConfirmTitle("Sign out"),
|
|
120
120
|
children: [/*#__PURE__*/_jsx(IconLogout, {
|
|
121
121
|
size: itemIconSize
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { destructiveGhostClass } from "../ui/_menu-classes.js";
|
|
2
3
|
import { Button } from "../ui/button.js";
|
|
3
4
|
import { ButtonGroup, ButtonGroupText } from "../ui/button-group.js";
|
|
4
5
|
import { ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuTrigger } from "../ui/context-menu.js";
|
|
@@ -1334,7 +1335,7 @@ function _temp(action) {
|
|
|
1334
1335
|
return /*#__PURE__*/_jsx(ContextMenuItem, {
|
|
1335
1336
|
disabled: action.disabled,
|
|
1336
1337
|
startContent: action.icon,
|
|
1337
|
-
|
|
1338
|
+
variant: action.destructive ? "destructive" : "default",
|
|
1338
1339
|
onSelect: action.onSelect,
|
|
1339
1340
|
children: action.label
|
|
1340
1341
|
}, action.key);
|
|
@@ -1349,7 +1350,7 @@ function _temp3(action_0) {
|
|
|
1349
1350
|
tooltipSide: "bottom",
|
|
1350
1351
|
tooltipClassName: "max-sm:hidden",
|
|
1351
1352
|
disabled: action_0.disabled,
|
|
1352
|
-
className: action_0.destructive ?
|
|
1353
|
+
className: action_0.destructive ? destructiveGhostClass : undefined,
|
|
1353
1354
|
onClick: action_0.onSelect,
|
|
1354
1355
|
children: action_0.icon
|
|
1355
1356
|
}, action_0.key);
|
|
@@ -3,6 +3,7 @@ import { createContext, useContext, useState } from "react";
|
|
|
3
3
|
import { motion, AnimatePresence } from "motion/react";
|
|
4
4
|
import { cn } from "../utils/cn.js";
|
|
5
5
|
import { flatPanelSubtleClass, flatPanelSubtleHoverClass } from "../ui/surface-classes.js";
|
|
6
|
+
import { destructiveGhostClass } from "../ui/_menu-classes.js";
|
|
6
7
|
import { Button } from "../ui/button.js";
|
|
7
8
|
import { Badge } from "../ui/badge.js";
|
|
8
9
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../ui/collapsible.js";
|
|
@@ -633,7 +634,7 @@ function QueueWidgetItem(t0) {
|
|
|
633
634
|
size: "sm",
|
|
634
635
|
variant: "ghost",
|
|
635
636
|
onClick: onRemove,
|
|
636
|
-
className:
|
|
637
|
+
className: `h-6 w-6 p-0 ${destructiveGhostClass}`,
|
|
637
638
|
children: /*#__PURE__*/_jsx(IconTrash, {
|
|
638
639
|
size: 13
|
|
639
640
|
})
|
|
@@ -313,7 +313,7 @@ export function ArtifactCard(t0) {
|
|
|
313
313
|
}
|
|
314
314
|
function _temp2(action) {
|
|
315
315
|
return {
|
|
316
|
-
|
|
316
|
+
variant: action.destructive ? "destructive" : "default",
|
|
317
317
|
startContent: action.icon,
|
|
318
318
|
title: action.destructive ? skipConfirmTitle(action.label) : undefined,
|
|
319
319
|
endContent: action.destructive ? /*#__PURE__*/_jsx(ConfirmSkipHint, {}) : undefined,
|
|
@@ -3,6 +3,7 @@ import { IconCopy, IconDownload, IconExternalLink, IconPencil, IconTrash } from
|
|
|
3
3
|
import { ARTIFACT_FORMAT_FILES } from "@vvedantb/server";
|
|
4
4
|
import { skipConfirmTitle } from "../../app/src/confirm/ConfirmSkipHint.js";
|
|
5
5
|
import { Artifact, ArtifactAction, ArtifactActions, ArtifactHeader, ArtifactTitle } from "../ai-elements/artifact.js";
|
|
6
|
+
import { destructiveGhostClass } from "../ui/_menu-classes.js";
|
|
6
7
|
import { TooltipProvider } from "../ui/tooltip.js";
|
|
7
8
|
import { cn } from "../utils/cn.js";
|
|
8
9
|
import { useArtifactEditDialogs } from "./artifact-dialogs.js";
|
|
@@ -211,7 +212,7 @@ export function ArtifactViewer(t0) {
|
|
|
211
212
|
tooltip: skipConfirmTitle("Delete"),
|
|
212
213
|
label: "Delete",
|
|
213
214
|
size: "icon-sm",
|
|
214
|
-
className: cn("h-8 min-w-8",
|
|
215
|
+
className: cn("h-8 min-w-8", destructiveGhostClass),
|
|
215
216
|
icon: /*#__PURE__*/_jsx(IconTrash, {
|
|
216
217
|
size: 16
|
|
217
218
|
}),
|
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
|
+
}
|
|
@@ -21,6 +21,12 @@ export const triggerZoomAnimateClass = "origin-[var(--radix-popper-transform-ori
|
|
|
21
21
|
export const menuContentClass = ["z-50 min-w-[12rem] overflow-hidden p-1 outline-none max-sm:max-h-[85dvh] max-sm:overflow-y-auto", menuSurfaceClass, triggerZoomAnimateClass].join(" ");
|
|
22
22
|
export const menuSubTriggerClass = "flex cursor-pointer select-none items-center gap-2 rounded-menu-item px-2.5 py-1.5 max-sm:min-h-10 text-sm text-foreground outline-none transition-[background-color,color] focus:bg-default focus:text-foreground data-[highlighted]:bg-default data-[highlighted]:text-foreground data-[state=open]:bg-default data-[disabled]:cursor-not-allowed [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0";
|
|
23
23
|
export const menuItemClass = "relative flex cursor-pointer select-none items-center gap-2 rounded-menu-item px-2.5 py-1.5 max-sm:min-h-10 text-sm outline-none transition-[background-color,color] focus:bg-default focus:text-foreground data-[highlighted]:bg-default data-[highlighted]:text-foreground data-[disabled]:pointer-events-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0 [&_svg]:pointer-events-none";
|
|
24
|
+
|
|
25
|
+
/** Added to a menu item with `variant="destructive"`: red text, and a red wash on highlight. */
|
|
26
|
+
export const menuItemDestructiveClass = "text-danger focus:bg-danger/10 focus:text-danger data-[highlighted]:bg-danger/10 data-[highlighted]:text-danger";
|
|
27
|
+
|
|
28
|
+
/** Red text and a red wash on hover, for a quiet (ghost) icon button that deletes. */
|
|
29
|
+
export const destructiveGhostClass = "text-danger hover:bg-danger/10 hover:text-danger";
|
|
24
30
|
export const menuCheckboxRadioItemClass = "relative flex cursor-pointer select-none items-center rounded-menu-item py-1.5 max-sm:min-h-10 pl-8 pr-2.5 text-sm outline-none transition-[background-color,color] focus:bg-default focus:text-foreground data-[highlighted]:bg-default data-[highlighted]:text-foreground data-[disabled]:pointer-events-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50";
|
|
25
31
|
export const menuLabelClass = "px-2.5 py-1.5 text-xs font-medium uppercase tracking-widest text-muted-foreground";
|
|
26
32
|
export const menuSeparatorClass = "-mx-1 my-1 h-px bg-separator";
|
|
@@ -2,7 +2,7 @@ import { c as _c } from "react/compiler-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
|
4
4
|
import { IconCheck, IconChevronRight, IconCircleFilled } from "@tabler/icons-react";
|
|
5
|
-
import { menuCheckboxRadioItemClass, menuContentClass, menuItemClass, menuLabelClass, menuSeparatorClass, menuShortcutClass, menuSubTriggerClass } from "./_menu-classes.js";
|
|
5
|
+
import { menuCheckboxRadioItemClass, menuContentClass, menuItemClass, menuItemDestructiveClass, menuLabelClass, menuSeparatorClass, menuShortcutClass, menuSubTriggerClass } from "./_menu-classes.js";
|
|
6
6
|
import { MenuItemRow, SubTriggerRow, suppressAltKeyDown } from "./_menu-parts.js";
|
|
7
7
|
import { useCn, useUiConfig } from "./ui-config.js";
|
|
8
8
|
|
|
@@ -308,7 +308,7 @@ const ContextMenuContent = /*#__PURE__*/React.forwardRef((t0, ref) => {
|
|
|
308
308
|
});
|
|
309
309
|
ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
|
|
310
310
|
const ContextMenuItem = /*#__PURE__*/React.forwardRef((t0, ref) => {
|
|
311
|
-
const $ = _c(
|
|
311
|
+
const $ = _c(28);
|
|
312
312
|
let asChild;
|
|
313
313
|
let children;
|
|
314
314
|
let className;
|
|
@@ -317,10 +317,12 @@ const ContextMenuItem = /*#__PURE__*/React.forwardRef((t0, ref) => {
|
|
|
317
317
|
let inset;
|
|
318
318
|
let props;
|
|
319
319
|
let startContent;
|
|
320
|
+
let variant;
|
|
320
321
|
if ($[0] !== t0) {
|
|
321
322
|
({
|
|
322
323
|
className,
|
|
323
324
|
inset,
|
|
325
|
+
variant,
|
|
324
326
|
startContent,
|
|
325
327
|
description,
|
|
326
328
|
endContent,
|
|
@@ -337,6 +339,7 @@ const ContextMenuItem = /*#__PURE__*/React.forwardRef((t0, ref) => {
|
|
|
337
339
|
$[6] = inset;
|
|
338
340
|
$[7] = props;
|
|
339
341
|
$[8] = startContent;
|
|
342
|
+
$[9] = variant;
|
|
340
343
|
} else {
|
|
341
344
|
asChild = $[1];
|
|
342
345
|
children = $[2];
|
|
@@ -346,58 +349,61 @@ const ContextMenuItem = /*#__PURE__*/React.forwardRef((t0, ref) => {
|
|
|
346
349
|
inset = $[6];
|
|
347
350
|
props = $[7];
|
|
348
351
|
startContent = $[8];
|
|
352
|
+
variant = $[9];
|
|
349
353
|
}
|
|
350
354
|
const item = useUiConfig("ContextMenu")?.classes?.item;
|
|
351
355
|
const merge = useCn();
|
|
352
356
|
const t1 = item ?? menuItemClass;
|
|
353
357
|
const t2 = inset && "pl-8";
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
$[10] =
|
|
359
|
-
$[11] =
|
|
360
|
-
$[12] =
|
|
361
|
-
$[13] =
|
|
358
|
+
const t3 = variant === "destructive" && menuItemDestructiveClass;
|
|
359
|
+
let t4;
|
|
360
|
+
if ($[10] !== className || $[11] !== merge || $[12] !== t1 || $[13] !== t2 || $[14] !== t3) {
|
|
361
|
+
t4 = merge(t1, t2, t3, className);
|
|
362
|
+
$[10] = className;
|
|
363
|
+
$[11] = merge;
|
|
364
|
+
$[12] = t1;
|
|
365
|
+
$[13] = t2;
|
|
366
|
+
$[14] = t3;
|
|
367
|
+
$[15] = t4;
|
|
362
368
|
} else {
|
|
363
|
-
|
|
369
|
+
t4 = $[15];
|
|
364
370
|
}
|
|
365
|
-
let
|
|
366
|
-
if ($[
|
|
367
|
-
|
|
371
|
+
let t5;
|
|
372
|
+
if ($[16] !== asChild || $[17] !== children || $[18] !== description || $[19] !== endContent || $[20] !== startContent) {
|
|
373
|
+
t5 = asChild || startContent === undefined && description === undefined && endContent === undefined ? children : /*#__PURE__*/_jsx(MenuItemRow, {
|
|
368
374
|
startContent: startContent,
|
|
369
375
|
description: description,
|
|
370
376
|
endContent: endContent,
|
|
371
377
|
children: children
|
|
372
378
|
});
|
|
373
|
-
$[
|
|
374
|
-
$[
|
|
375
|
-
$[
|
|
376
|
-
$[
|
|
377
|
-
$[
|
|
378
|
-
$[
|
|
379
|
+
$[16] = asChild;
|
|
380
|
+
$[17] = children;
|
|
381
|
+
$[18] = description;
|
|
382
|
+
$[19] = endContent;
|
|
383
|
+
$[20] = startContent;
|
|
384
|
+
$[21] = t5;
|
|
379
385
|
} else {
|
|
380
|
-
|
|
386
|
+
t5 = $[21];
|
|
381
387
|
}
|
|
382
|
-
let
|
|
383
|
-
if ($[
|
|
384
|
-
|
|
388
|
+
let t6;
|
|
389
|
+
if ($[22] !== asChild || $[23] !== props || $[24] !== ref || $[25] !== t4 || $[26] !== t5) {
|
|
390
|
+
t6 = /*#__PURE__*/_jsx(ContextMenuPrimitive.Item, {
|
|
385
391
|
ref: ref,
|
|
386
392
|
asChild: asChild,
|
|
387
|
-
className:
|
|
393
|
+
className: t4,
|
|
388
394
|
...props,
|
|
389
|
-
children:
|
|
395
|
+
children: t5
|
|
390
396
|
});
|
|
391
|
-
$[
|
|
392
|
-
$[
|
|
393
|
-
$[
|
|
394
|
-
$[
|
|
395
|
-
$[
|
|
396
|
-
$[
|
|
397
|
+
$[22] = asChild;
|
|
398
|
+
$[23] = props;
|
|
399
|
+
$[24] = ref;
|
|
400
|
+
$[25] = t4;
|
|
401
|
+
$[26] = t5;
|
|
402
|
+
$[27] = t6;
|
|
397
403
|
} else {
|
|
398
|
-
|
|
404
|
+
t6 = $[27];
|
|
399
405
|
}
|
|
400
|
-
return
|
|
406
|
+
return t6;
|
|
401
407
|
});
|
|
402
408
|
ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
|
|
403
409
|
const ContextMenuCheckboxItem = /*#__PURE__*/React.forwardRef((t0, ref) => {
|
|
@@ -2,7 +2,7 @@ import { c as _c } from "react/compiler-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
4
4
|
import { IconCheck, IconChevronRight, IconCircleFilled } from "@tabler/icons-react";
|
|
5
|
-
import { menuCheckboxRadioItemClass, menuContentClass, menuItemClass, menuLabelClass, menuSeparatorClass, menuShortcutClass, menuSubTriggerClass } from "./_menu-classes.js";
|
|
5
|
+
import { menuCheckboxRadioItemClass, menuContentClass, menuItemClass, menuItemDestructiveClass, menuLabelClass, menuSeparatorClass, menuShortcutClass, menuSubTriggerClass } from "./_menu-classes.js";
|
|
6
6
|
import { fitViewportClass, MenuItemRow, SubTriggerRow, suppressAltKeyDown } from "./_menu-parts.js";
|
|
7
7
|
import { restoreModalScrollLock } from "./overlay-a11y.js";
|
|
8
8
|
import { useCn, useUiConfig } from "./ui-config.js";
|
|
@@ -316,7 +316,7 @@ const DropdownMenuContent = /*#__PURE__*/React.forwardRef((t0, ref) => {
|
|
|
316
316
|
});
|
|
317
317
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
318
318
|
const DropdownMenuItem = /*#__PURE__*/React.forwardRef((t0, ref) => {
|
|
319
|
-
const $ = _c(
|
|
319
|
+
const $ = _c(28);
|
|
320
320
|
let asChild;
|
|
321
321
|
let children;
|
|
322
322
|
let className;
|
|
@@ -325,10 +325,12 @@ const DropdownMenuItem = /*#__PURE__*/React.forwardRef((t0, ref) => {
|
|
|
325
325
|
let inset;
|
|
326
326
|
let props;
|
|
327
327
|
let startContent;
|
|
328
|
+
let variant;
|
|
328
329
|
if ($[0] !== t0) {
|
|
329
330
|
({
|
|
330
331
|
className,
|
|
331
332
|
inset,
|
|
333
|
+
variant,
|
|
332
334
|
startContent,
|
|
333
335
|
description,
|
|
334
336
|
endContent,
|
|
@@ -345,6 +347,7 @@ const DropdownMenuItem = /*#__PURE__*/React.forwardRef((t0, ref) => {
|
|
|
345
347
|
$[6] = inset;
|
|
346
348
|
$[7] = props;
|
|
347
349
|
$[8] = startContent;
|
|
350
|
+
$[9] = variant;
|
|
348
351
|
} else {
|
|
349
352
|
asChild = $[1];
|
|
350
353
|
children = $[2];
|
|
@@ -354,25 +357,28 @@ const DropdownMenuItem = /*#__PURE__*/React.forwardRef((t0, ref) => {
|
|
|
354
357
|
inset = $[6];
|
|
355
358
|
props = $[7];
|
|
356
359
|
startContent = $[8];
|
|
360
|
+
variant = $[9];
|
|
357
361
|
}
|
|
358
362
|
const item = useUiConfig("DropdownMenu")?.classes?.item;
|
|
359
363
|
const merge = useCn();
|
|
360
364
|
const t1 = item ?? menuItemClass;
|
|
361
365
|
const t2 = inset && "pl-8";
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
$[10] =
|
|
367
|
-
$[11] =
|
|
368
|
-
$[12] =
|
|
369
|
-
$[13] =
|
|
366
|
+
const t3 = variant === "destructive" && menuItemDestructiveClass;
|
|
367
|
+
let t4;
|
|
368
|
+
if ($[10] !== className || $[11] !== merge || $[12] !== t1 || $[13] !== t2 || $[14] !== t3) {
|
|
369
|
+
t4 = merge(t1, t2, t3, className);
|
|
370
|
+
$[10] = className;
|
|
371
|
+
$[11] = merge;
|
|
372
|
+
$[12] = t1;
|
|
373
|
+
$[13] = t2;
|
|
374
|
+
$[14] = t3;
|
|
375
|
+
$[15] = t4;
|
|
370
376
|
} else {
|
|
371
|
-
|
|
377
|
+
t4 = $[15];
|
|
372
378
|
}
|
|
373
|
-
let
|
|
374
|
-
if ($[
|
|
375
|
-
|
|
379
|
+
let t5;
|
|
380
|
+
if ($[16] !== asChild || $[17] !== children || $[18] !== description || $[19] !== endContent || $[20] !== startContent) {
|
|
381
|
+
t5 = asChild || startContent === undefined && description === undefined && endContent === undefined ? children : endContent !== undefined ? /*#__PURE__*/_jsx(MenuItemRow, {
|
|
376
382
|
startContent: startContent,
|
|
377
383
|
description: description,
|
|
378
384
|
endContent: endContent,
|
|
@@ -388,34 +394,34 @@ const DropdownMenuItem = /*#__PURE__*/React.forwardRef((t0, ref) => {
|
|
|
388
394
|
})]
|
|
389
395
|
})]
|
|
390
396
|
});
|
|
391
|
-
$[
|
|
392
|
-
$[
|
|
393
|
-
$[
|
|
394
|
-
$[
|
|
395
|
-
$[
|
|
396
|
-
$[
|
|
397
|
+
$[16] = asChild;
|
|
398
|
+
$[17] = children;
|
|
399
|
+
$[18] = description;
|
|
400
|
+
$[19] = endContent;
|
|
401
|
+
$[20] = startContent;
|
|
402
|
+
$[21] = t5;
|
|
397
403
|
} else {
|
|
398
|
-
|
|
404
|
+
t5 = $[21];
|
|
399
405
|
}
|
|
400
|
-
let
|
|
401
|
-
if ($[
|
|
402
|
-
|
|
406
|
+
let t6;
|
|
407
|
+
if ($[22] !== asChild || $[23] !== props || $[24] !== ref || $[25] !== t4 || $[26] !== t5) {
|
|
408
|
+
t6 = /*#__PURE__*/_jsx(DropdownMenuPrimitive.Item, {
|
|
403
409
|
ref: ref,
|
|
404
410
|
asChild: asChild,
|
|
405
|
-
className:
|
|
411
|
+
className: t4,
|
|
406
412
|
...props,
|
|
407
|
-
children:
|
|
413
|
+
children: t5
|
|
408
414
|
});
|
|
409
|
-
$[
|
|
410
|
-
$[
|
|
411
|
-
$[
|
|
412
|
-
$[
|
|
413
|
-
$[
|
|
414
|
-
$[
|
|
415
|
+
$[22] = asChild;
|
|
416
|
+
$[23] = props;
|
|
417
|
+
$[24] = ref;
|
|
418
|
+
$[25] = t4;
|
|
419
|
+
$[26] = t5;
|
|
420
|
+
$[27] = t6;
|
|
415
421
|
} else {
|
|
416
|
-
|
|
422
|
+
t6 = $[27];
|
|
417
423
|
}
|
|
418
|
-
return
|
|
424
|
+
return t6;
|
|
419
425
|
});
|
|
420
426
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
421
427
|
const DropdownMenuCheckboxItem = /*#__PURE__*/React.forwardRef((t0, ref) => {
|
package/dist/src/utils/cn.js
CHANGED
|
@@ -8,7 +8,7 @@ import { extendTailwindMerge } from "tailwind-merge";
|
|
|
8
8
|
const twMerge = extendTailwindMerge({
|
|
9
9
|
extend: {
|
|
10
10
|
theme: {
|
|
11
|
-
|
|
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.
|
|
3
|
+
"version": "0.67.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/
|
|
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.
|
|
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/
|
|
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.
|
|
138
|
-
"@tanstack/react-hotkeys": "
|
|
139
|
-
"@vvedantb/server": ">=0.
|
|
140
|
-
"ai": "
|
|
136
|
+
"@tabler/icons-react": "^3.52.0",
|
|
137
|
+
"@tanstack/react-hotkeys": "^0.27.0",
|
|
138
|
+
"@vvedantb/server": ">=0.19.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": "
|
|
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": "^
|
|
150
|
+
"shiki": "^4",
|
|
152
151
|
"sonner": "^2.0.3",
|
|
153
152
|
"streamdown": "^2.3.0",
|
|
154
|
-
"tailwind-merge": "^
|
|
153
|
+
"tailwind-merge": "^3",
|
|
155
154
|
"use-stick-to-bottom": "^1.1.0",
|
|
156
155
|
"vaul": "^1.1.0",
|
|
157
|
-
"zod": "^
|
|
156
|
+
"zod": "^4.0.0"
|
|
158
157
|
},
|
|
159
158
|
"devDependencies": {
|
|
160
|
-
"@clerk/
|
|
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": "
|
|
164
|
-
"@radix-ui/react-checkbox": "
|
|
165
|
-
"@radix-ui/react-collapsible": "
|
|
166
|
-
"@radix-ui/react-context-menu": "
|
|
167
|
-
"@radix-ui/react-dialog": "
|
|
168
|
-
"@radix-ui/react-dropdown-menu": "
|
|
169
|
-
"@radix-ui/react-hover-card": "
|
|
170
|
-
"@radix-ui/react-label": "
|
|
171
|
-
"@radix-ui/react-popover": "
|
|
172
|
-
"@radix-ui/react-progress": "
|
|
173
|
-
"@radix-ui/react-scroll-area": "
|
|
174
|
-
"@radix-ui/react-select": "
|
|
175
|
-
"@radix-ui/react-separator": "
|
|
176
|
-
"@radix-ui/react-slider": "
|
|
177
|
-
"@radix-ui/react-slot": "
|
|
178
|
-
"@radix-ui/react-switch": "
|
|
179
|
-
"@radix-ui/react-tabs": "
|
|
180
|
-
"@radix-ui/react-tooltip": "
|
|
181
|
-
"@radix-ui/react-use-controllable-state": "
|
|
182
|
-
"@radix-ui/react-visually-hidden": "
|
|
183
|
-
"@streamdown/cjk": "
|
|
184
|
-
"@streamdown/code": "
|
|
185
|
-
"@streamdown/math": "
|
|
186
|
-
"@streamdown/mermaid": "
|
|
187
|
-
"@tabler/icons-react": "^3.
|
|
188
|
-
"@tailwindcss/node": "4.3.
|
|
189
|
-
"@tanstack/react-hotkeys": "
|
|
190
|
-
"@types/
|
|
191
|
-
"@types/react
|
|
192
|
-
"
|
|
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": "
|
|
196
|
+
"convex": "1.48.0",
|
|
197
197
|
"embla-carousel-react": "^8.6.0",
|
|
198
198
|
"esbuild": "0.28.2",
|
|
199
|
-
"happy-dom": "
|
|
200
|
-
"motion": "
|
|
201
|
-
"nanoid": "^5.1.
|
|
202
|
-
"next-themes": "0.4.6",
|
|
203
|
-
"radix-ui": "^1.
|
|
204
|
-
"react": "
|
|
205
|
-
"react-dom": "
|
|
206
|
-
"shiki": "
|
|
207
|
-
"sonner": "^2.0.
|
|
208
|
-
"streamdown": "
|
|
209
|
-
"tailwind-merge": "
|
|
210
|
-
"tailwindcss": "4.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.
|
|
213
|
-
"vaul": "^1.1.
|
|
214
|
-
"vitest": "
|
|
215
|
-
"zod": "
|
|
216
|
-
"
|
|
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.19.0"
|
|
218
217
|
},
|
|
219
218
|
"peerDependenciesMeta": {
|
|
220
|
-
"@clerk/
|
|
219
|
+
"@clerk/react": {
|
|
221
220
|
"optional": true
|
|
222
221
|
},
|
|
223
222
|
"convex": {
|
|
@@ -4,8 +4,8 @@ exports[`vibot Queue widget DOM > renders the closed widget 1`] = `"<div class="
|
|
|
4
4
|
|
|
5
5
|
exports[`vibot Queue widget DOM > renders the editing state, then saves the trimmed text 1`] = `"<div class="group relative p-2.5 rounded-lg transition-[background-color,transform] duration-150 ease-out active:scale-[0.99] hover:bg-surface-secondary"><div class="flex flex-col gap-2"><textarea class="flex w-full max-sm:min-w-0 rounded-field border border-border bg-field-background px-3.5 py-2.5 text-base sm:pointer-fine:text-sm placeholder:text-field-placeholder disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-hidden focus-visible:border-focus-border focus-visible:ring-1 focus-visible:ring-focus-ring min-h-[60px]">Draft</textarea><div class="flex justify-end gap-2"><button class="inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium tracking-normal transition-[transform,background-color,box-shadow,opacity,border-color] duration-200 ease-smooth focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 active:scale-[0.96] active:duration-[var(--motion-fast,150ms)] [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 text-muted-foreground hover:bg-surface-tertiary hover:text-foreground text-xs max-sm:hit-target rounded-full h-7 px-2"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-x"><path d="M18 6l-12 12"></path><path d="M6 6l12 12"></path></svg><span class="ml-1 text-xs">Cancel</span></button><button class="inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium tracking-normal transition-[transform,background-color,box-shadow,opacity,border-color] duration-200 ease-smooth focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 active:scale-[0.96] active:duration-[var(--motion-fast,150ms)] [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 bg-primary text-primary-foreground hover:-translate-y-0.5 hover:opacity-90 text-xs max-sm:hit-target rounded-full h-7 px-2"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-check"><path d="M5 12l5 5l10 -10"></path></svg><span class="ml-1 text-xs">Save</span></button></div></div></div>"`;
|
|
6
6
|
|
|
7
|
-
exports[`vibot Queue widget DOM > renders the editing state, then saves the trimmed text 2`] = `"<div class="group relative p-2.5 rounded-lg transition-[background-color,transform] duration-150 ease-out active:scale-[0.99] hover:bg-surface-secondary"><div class="flex items-center gap-2"><p class="text-sm text-foreground/90 flex-1 truncate">Draft</p><div class="flex items-center gap-1.5 shrink-0"></div><div class="flex items-center gap-1 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity"><button class="inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium tracking-normal transition-[transform,background-color,box-shadow,opacity,border-color] duration-200 ease-smooth focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 active:scale-[0.96] active:duration-[var(--motion-fast,150ms)] [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 text-muted-foreground hover:bg-surface-tertiary hover:text-foreground text-xs max-sm:hit-target rounded-full h-6 w-6 p-0"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-edit"><path d="M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1"></path><path d="M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415"></path><path d="M16 5l3 3"></path></svg></button><button class="inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium tracking-normal transition-[transform,background-color,box-shadow,opacity,border-color] duration-200 ease-smooth focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 active:scale-[0.96] active:duration-[var(--motion-fast,150ms)] [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0
|
|
7
|
+
exports[`vibot Queue widget DOM > renders the editing state, then saves the trimmed text 2`] = `"<div class="group relative p-2.5 rounded-lg transition-[background-color,transform] duration-150 ease-out active:scale-[0.99] hover:bg-surface-secondary"><div class="flex items-center gap-2"><p class="text-sm text-foreground/90 flex-1 truncate">Draft</p><div class="flex items-center gap-1.5 shrink-0"></div><div class="flex items-center gap-1 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity"><button class="inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium tracking-normal transition-[transform,background-color,box-shadow,opacity,border-color] duration-200 ease-smooth focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 active:scale-[0.96] active:duration-[var(--motion-fast,150ms)] [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 text-muted-foreground hover:bg-surface-tertiary hover:text-foreground text-xs max-sm:hit-target rounded-full h-6 w-6 p-0"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-edit"><path d="M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1"></path><path d="M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415"></path><path d="M16 5l3 3"></path></svg></button><button class="inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium tracking-normal transition-[transform,background-color,box-shadow,opacity,border-color] duration-200 ease-smooth focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 active:scale-[0.96] active:duration-[var(--motion-fast,150ms)] [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 text-xs max-sm:hit-target rounded-full h-6 w-6 p-0 text-danger hover:bg-danger/10 hover:text-danger"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-trash"><path d="M4 7l16 0"></path><path d="M10 11l0 6"></path><path d="M14 11l0 6"></path><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"></path><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"></path></svg></button></div></div></div>"`;
|
|
8
8
|
|
|
9
9
|
exports[`vibot Queue widget DOM > renders the header with a custom class 1`] = `"<button type="button" class="flex items-center justify-between w-full px-4 py-2.5 bg-surface-secondary text-foreground border-0 shadow-none backdrop-blur-none transition-[background-color,transform] duration-150 ease-out active:scale-[0.99] hover:bg-surface-tertiary rounded-t-2xl group x"><div class="flex items-center gap-2"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-stack-2 text-muted-foreground"><path d="M12 4l-8 4l8 4l8 -4l-8 -4"></path><path d="M4 12l8 4l8 -4"></path><path d="M4 16l8 4l8 -4"></path></svg><span class="text-sm font-medium text-foreground">Queued Messages</span><div class="inline-flex items-center gap-1 rounded-full border px-2.5 py-1 font-medium tracking-normal transition-colors focus:outline-none focus:ring-2 focus:ring-focus-ring focus:ring-offset-2 focus:ring-offset-background border-separator bg-default text-default-foreground text-xs">1</div></div><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-chevron-down text-muted-foreground transition-transform duration-200 ease-out"><path d="M6 9l6 6l6 -6"></path></svg></button>"`;
|
|
10
10
|
|
|
11
|
-
exports[`vibot Queue widget DOM > renders the open widget 1`] = `"<div class="w-full overflow-hidden mb-2" style="height: auto; opacity: 1;"><button type="button" class="flex items-center justify-between w-full px-4 py-2.5 bg-surface-secondary text-foreground border-0 shadow-none backdrop-blur-none transition-[background-color,transform] duration-150 ease-out active:scale-[0.99] hover:bg-surface-tertiary rounded-t-2xl group"><div class="flex items-center gap-2"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-stack-2 text-muted-foreground"><path d="M12 4l-8 4l8 4l8 -4l-8 -4"></path><path d="M4 12l8 4l8 -4"></path><path d="M4 16l8 4l8 -4"></path></svg><span class="text-sm font-medium text-foreground">Queued Messages</span><div class="inline-flex items-center gap-1 rounded-full border px-2.5 py-1 font-medium tracking-normal transition-colors focus:outline-none focus:ring-2 focus:ring-focus-ring focus:ring-offset-2 focus:ring-offset-background border-separator bg-default text-default-foreground text-xs">3</div></div><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-chevron-down text-muted-foreground transition-transform duration-200 ease-out rotate-180"><path d="M6 9l6 6l6 -6"></path></svg></button><div class="overflow-hidden" style="height: auto; opacity: 1;"><div class="bg-surface-secondary text-foreground border-0 shadow-none backdrop-blur-none rounded-b-2xl"><div dir="ltr" data-slot="scroll-area" class="relative max-h-[240px]" style="position: relative; --radix-scroll-area-corner-width: 0px; --radix-scroll-area-corner-height: 0px;"><style>[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}</style><div data-radix-scroll-area-viewport="" data-slot="scroll-area-viewport" class="size-full rounded-[inherit] outline-hidden" style="overflow-x: hidden; overflow-y: scroll;"><div style="min-width: 100%; display: table;"><div class="p-2 space-y-1.5"><div class="group relative p-2.5 rounded-lg transition-[background-color,transform] duration-150 ease-out active:scale-[0.99] hover:bg-surface-secondary"><div class="flex items-center gap-2"><img alt="Ada" class="size-5 rounded-full shrink-0" src="https://example.com/ada.png"><p class="text-sm text-foreground/90 flex-1 truncate">Fix the build</p><div class="flex items-center gap-1.5 shrink-0"><div class="inline-flex items-center gap-1 rounded-full border py-1 font-medium tracking-normal transition-colors focus:outline-none focus:ring-2 focus:ring-focus-ring focus:ring-offset-2 focus:ring-offset-background border-separator bg-transparent text-muted-foreground text-xs h-5 px-1.5">claude-sonnet</div><div class="inline-flex items-center gap-1 rounded-full border py-1 font-medium tracking-normal transition-colors focus:outline-none focus:ring-2 focus:ring-focus-ring focus:ring-offset-2 focus:ring-offset-background border-separator bg-transparent text-muted-foreground text-xs h-5 px-1.5">Terse</div></div><div class="flex items-center gap-1 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity"><button class="inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium tracking-normal transition-[transform,background-color,box-shadow,opacity,border-color] duration-200 ease-smooth focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 active:scale-[0.96] active:duration-[var(--motion-fast,150ms)] [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 text-muted-foreground hover:bg-surface-tertiary hover:text-foreground text-xs max-sm:hit-target rounded-full h-6 w-6 p-0"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-edit"><path d="M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1"></path><path d="M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415"></path><path d="M16 5l3 3"></path></svg></button><button class="inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium tracking-normal transition-[transform,background-color,box-shadow,opacity,border-color] duration-200 ease-smooth focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 active:scale-[0.96] active:duration-[var(--motion-fast,150ms)] [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 hover:bg-surface-tertiary text-xs max-sm:hit-target rounded-full h-6 w-6 p-0 text-danger hover:text-danger"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-trash"><path d="M4 7l16 0"></path><path d="M10 11l0 6"></path><path d="M14 11l0 6"></path><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"></path><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"></path></svg></button></div></div></div><div class="group relative p-2.5 rounded-lg transition-[background-color,transform] duration-150 ease-out active:scale-[0.99] hover:bg-surface-secondary extra"><div class="flex items-center gap-2"><p class="text-sm text-foreground/90 flex-1 truncate">Plain</p><div class="flex items-center gap-1.5 shrink-0"><div class="inline-flex items-center gap-1 rounded-full border py-1 font-medium tracking-normal transition-colors focus:outline-none focus:ring-2 focus:ring-focus-ring focus:ring-offset-2 focus:ring-offset-background border-separator bg-transparent text-muted-foreground text-xs h-5 px-1.5">Bob</div></div><div class="flex items-center gap-1 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity"><button class="inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium tracking-normal transition-[transform,background-color,box-shadow,opacity,border-color] duration-200 ease-smooth focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 active:scale-[0.96] active:duration-[var(--motion-fast,150ms)] [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 text-muted-foreground hover:bg-surface-tertiary hover:text-foreground text-xs max-sm:hit-target rounded-full h-6 w-6 p-0"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-edit"><path d="M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1"></path><path d="M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415"></path><path d="M16 5l3 3"></path></svg></button><button class="inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium tracking-normal transition-[transform,background-color,box-shadow,opacity,border-color] duration-200 ease-smooth focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 active:scale-[0.96] active:duration-[var(--motion-fast,150ms)] [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 hover:bg-surface-tertiary text-xs max-sm:hit-target rounded-full h-6 w-6 p-0 text-danger hover:text-danger"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-trash"><path d="M4 7l16 0"></path><path d="M10 11l0 6"></path><path d="M14 11l0 6"></path><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"></path><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"></path></svg></button></div></div></div><div class="group relative p-2.5 rounded-lg transition-[background-color,transform] duration-150 ease-out active:scale-[0.99] hover:bg-surface-secondary"><div class="flex items-center gap-2"><p class="text-sm text-foreground/90 flex-1 truncate">Bare</p><div class="flex items-center gap-1.5 shrink-0"></div><div class="flex items-center gap-1 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity"><button class="inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium tracking-normal transition-[transform,background-color,box-shadow,opacity,border-color] duration-200 ease-smooth focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 active:scale-[0.96] active:duration-[var(--motion-fast,150ms)] [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 text-muted-foreground hover:bg-surface-tertiary hover:text-foreground text-xs max-sm:hit-target rounded-full h-6 w-6 p-0"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-edit"><path d="M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1"></path><path d="M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415"></path><path d="M16 5l3 3"></path></svg></button><button class="inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium tracking-normal transition-[transform,background-color,box-shadow,opacity,border-color] duration-200 ease-smooth focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 active:scale-[0.96] active:duration-[var(--motion-fast,150ms)] [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 hover:bg-surface-tertiary text-xs max-sm:hit-target rounded-full h-6 w-6 p-0 text-danger hover:text-danger"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-trash"><path d="M4 7l16 0"></path><path d="M10 11l0 6"></path><path d="M14 11l0 6"></path><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"></path><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"></path></svg></button></div></div></div></div></div></div></div></div></div></div>"`;
|
|
11
|
+
exports[`vibot Queue widget DOM > renders the open widget 1`] = `"<div class="w-full overflow-hidden mb-2" style="height: auto; opacity: 1;"><button type="button" class="flex items-center justify-between w-full px-4 py-2.5 bg-surface-secondary text-foreground border-0 shadow-none backdrop-blur-none transition-[background-color,transform] duration-150 ease-out active:scale-[0.99] hover:bg-surface-tertiary rounded-t-2xl group"><div class="flex items-center gap-2"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-stack-2 text-muted-foreground"><path d="M12 4l-8 4l8 4l8 -4l-8 -4"></path><path d="M4 12l8 4l8 -4"></path><path d="M4 16l8 4l8 -4"></path></svg><span class="text-sm font-medium text-foreground">Queued Messages</span><div class="inline-flex items-center gap-1 rounded-full border px-2.5 py-1 font-medium tracking-normal transition-colors focus:outline-none focus:ring-2 focus:ring-focus-ring focus:ring-offset-2 focus:ring-offset-background border-separator bg-default text-default-foreground text-xs">3</div></div><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-chevron-down text-muted-foreground transition-transform duration-200 ease-out rotate-180"><path d="M6 9l6 6l6 -6"></path></svg></button><div class="overflow-hidden" style="height: auto; opacity: 1;"><div class="bg-surface-secondary text-foreground border-0 shadow-none backdrop-blur-none rounded-b-2xl"><div dir="ltr" data-slot="scroll-area" class="relative max-h-[240px]" style="position: relative; --radix-scroll-area-corner-width: 0px; --radix-scroll-area-corner-height: 0px;"><style>[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}</style><div data-radix-scroll-area-viewport="" data-slot="scroll-area-viewport" class="size-full rounded-[inherit] outline-hidden" style="overflow-x: hidden; overflow-y: scroll;"><div style="min-width: 100%; display: table;"><div class="p-2 space-y-1.5"><div class="group relative p-2.5 rounded-lg transition-[background-color,transform] duration-150 ease-out active:scale-[0.99] hover:bg-surface-secondary"><div class="flex items-center gap-2"><img alt="Ada" class="size-5 rounded-full shrink-0" src="https://example.com/ada.png"><p class="text-sm text-foreground/90 flex-1 truncate">Fix the build</p><div class="flex items-center gap-1.5 shrink-0"><div class="inline-flex items-center gap-1 rounded-full border py-1 font-medium tracking-normal transition-colors focus:outline-none focus:ring-2 focus:ring-focus-ring focus:ring-offset-2 focus:ring-offset-background border-separator bg-transparent text-muted-foreground text-xs h-5 px-1.5">claude-sonnet</div><div class="inline-flex items-center gap-1 rounded-full border py-1 font-medium tracking-normal transition-colors focus:outline-none focus:ring-2 focus:ring-focus-ring focus:ring-offset-2 focus:ring-offset-background border-separator bg-transparent text-muted-foreground text-xs h-5 px-1.5">Terse</div></div><div class="flex items-center gap-1 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity"><button class="inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium tracking-normal transition-[transform,background-color,box-shadow,opacity,border-color] duration-200 ease-smooth focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 active:scale-[0.96] active:duration-[var(--motion-fast,150ms)] [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 text-muted-foreground hover:bg-surface-tertiary hover:text-foreground text-xs max-sm:hit-target rounded-full h-6 w-6 p-0"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-edit"><path d="M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1"></path><path d="M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415"></path><path d="M16 5l3 3"></path></svg></button><button class="inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium tracking-normal transition-[transform,background-color,box-shadow,opacity,border-color] duration-200 ease-smooth focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 active:scale-[0.96] active:duration-[var(--motion-fast,150ms)] [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 text-xs max-sm:hit-target rounded-full h-6 w-6 p-0 text-danger hover:bg-danger/10 hover:text-danger"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-trash"><path d="M4 7l16 0"></path><path d="M10 11l0 6"></path><path d="M14 11l0 6"></path><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"></path><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"></path></svg></button></div></div></div><div class="group relative p-2.5 rounded-lg transition-[background-color,transform] duration-150 ease-out active:scale-[0.99] hover:bg-surface-secondary extra"><div class="flex items-center gap-2"><p class="text-sm text-foreground/90 flex-1 truncate">Plain</p><div class="flex items-center gap-1.5 shrink-0"><div class="inline-flex items-center gap-1 rounded-full border py-1 font-medium tracking-normal transition-colors focus:outline-none focus:ring-2 focus:ring-focus-ring focus:ring-offset-2 focus:ring-offset-background border-separator bg-transparent text-muted-foreground text-xs h-5 px-1.5">Bob</div></div><div class="flex items-center gap-1 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity"><button class="inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium tracking-normal transition-[transform,background-color,box-shadow,opacity,border-color] duration-200 ease-smooth focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 active:scale-[0.96] active:duration-[var(--motion-fast,150ms)] [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 text-muted-foreground hover:bg-surface-tertiary hover:text-foreground text-xs max-sm:hit-target rounded-full h-6 w-6 p-0"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-edit"><path d="M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1"></path><path d="M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415"></path><path d="M16 5l3 3"></path></svg></button><button class="inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium tracking-normal transition-[transform,background-color,box-shadow,opacity,border-color] duration-200 ease-smooth focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 active:scale-[0.96] active:duration-[var(--motion-fast,150ms)] [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 text-xs max-sm:hit-target rounded-full h-6 w-6 p-0 text-danger hover:bg-danger/10 hover:text-danger"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-trash"><path d="M4 7l16 0"></path><path d="M10 11l0 6"></path><path d="M14 11l0 6"></path><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"></path><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"></path></svg></button></div></div></div><div class="group relative p-2.5 rounded-lg transition-[background-color,transform] duration-150 ease-out active:scale-[0.99] hover:bg-surface-secondary"><div class="flex items-center gap-2"><p class="text-sm text-foreground/90 flex-1 truncate">Bare</p><div class="flex items-center gap-1.5 shrink-0"></div><div class="flex items-center gap-1 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity"><button class="inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium tracking-normal transition-[transform,background-color,box-shadow,opacity,border-color] duration-200 ease-smooth focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 active:scale-[0.96] active:duration-[var(--motion-fast,150ms)] [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 text-muted-foreground hover:bg-surface-tertiary hover:text-foreground text-xs max-sm:hit-target rounded-full h-6 w-6 p-0"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-edit"><path d="M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1"></path><path d="M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415"></path><path d="M16 5l3 3"></path></svg></button><button class="inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium tracking-normal transition-[transform,background-color,box-shadow,opacity,border-color] duration-200 ease-smooth focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 active:scale-[0.96] active:duration-[var(--motion-fast,150ms)] [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 text-xs max-sm:hit-target rounded-full h-6 w-6 p-0 text-danger hover:bg-danger/10 hover:text-danger"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-trash"><path d="M4 7l16 0"></path><path d="M10 11l0 6"></path><path d="M14 11l0 6"></path><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"></path><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"></path></svg></button></div></div></div></div></div></div></div></div></div></div>"`;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GeneratedFile } from "ai";
|
|
2
2
|
|
|
3
3
|
import { cn } from "../utils/cn";
|
|
4
4
|
|
|
5
|
-
export type ImageProps =
|
|
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,5 +1,6 @@
|
|
|
1
1
|
import type { UIMessage } from "ai";
|
|
2
2
|
import type { ComponentProps, HTMLAttributes, ReactElement, ReactNode } from "react";
|
|
3
|
+
import { destructiveGhostClass } from "../ui/_menu-classes";
|
|
3
4
|
import { Button } from "../ui/button";
|
|
4
5
|
import { ButtonGroup, ButtonGroupText } from "../ui/button-group";
|
|
5
6
|
import {
|
|
@@ -137,7 +138,7 @@ export const MessageContextMenu = ({
|
|
|
137
138
|
key={action.key}
|
|
138
139
|
disabled={action.disabled}
|
|
139
140
|
startContent={action.icon}
|
|
140
|
-
|
|
141
|
+
variant={action.destructive ? "destructive" : "default"}
|
|
141
142
|
onSelect={action.onSelect}
|
|
142
143
|
>
|
|
143
144
|
{action.label}
|
|
@@ -197,7 +198,7 @@ export const MessageHoverActions = ({
|
|
|
197
198
|
// Narrow: the toolbar sits on the bubble corner and a tooltip below it would cover the text.
|
|
198
199
|
tooltipClassName="max-sm:hidden"
|
|
199
200
|
disabled={action.disabled}
|
|
200
|
-
className={action.destructive ?
|
|
201
|
+
className={action.destructive ? destructiveGhostClass : undefined}
|
|
201
202
|
onClick={action.onSelect}
|
|
202
203
|
>
|
|
203
204
|
{action.icon}
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
flatPanelSubtleClass,
|
|
12
12
|
flatPanelSubtleHoverClass,
|
|
13
13
|
} from "../ui/surface-classes";
|
|
14
|
+
import { destructiveGhostClass } from "../ui/_menu-classes";
|
|
14
15
|
import { Button } from "../ui/button";
|
|
15
16
|
import { Badge } from "../ui/badge";
|
|
16
17
|
import {
|
|
@@ -354,7 +355,7 @@ function QueueWidgetItem({
|
|
|
354
355
|
size="sm"
|
|
355
356
|
variant="ghost"
|
|
356
357
|
onClick={onRemove}
|
|
357
|
-
className=
|
|
358
|
+
className={`h-6 w-6 p-0 ${destructiveGhostClass}`}
|
|
358
359
|
>
|
|
359
360
|
<IconTrash size={13} />
|
|
360
361
|
</Button>
|
|
@@ -106,7 +106,7 @@ export function ArtifactCard({
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
const itemProps = (action: MenuAction) => ({
|
|
109
|
-
|
|
109
|
+
variant: action.destructive ? ("destructive" as const) : ("default" as const),
|
|
110
110
|
startContent: action.icon,
|
|
111
111
|
title: action.destructive ? skipConfirmTitle(action.label) : undefined,
|
|
112
112
|
endContent: action.destructive ? <ConfirmSkipHint /> : undefined,
|
|
@@ -3,6 +3,7 @@ import { IconCopy, IconDownload, IconExternalLink, IconPencil, IconTrash } from
|
|
|
3
3
|
import { ARTIFACT_FORMAT_FILES } from "@vvedantb/server";
|
|
4
4
|
import { skipConfirmTitle } from "../../app/src/confirm/ConfirmSkipHint";
|
|
5
5
|
import { Artifact, ArtifactAction, ArtifactActions, ArtifactHeader, ArtifactTitle } from "../ai-elements/artifact";
|
|
6
|
+
import { destructiveGhostClass } from "../ui/_menu-classes";
|
|
6
7
|
import { TooltipProvider } from "../ui/tooltip";
|
|
7
8
|
import { cn } from "../utils/cn";
|
|
8
9
|
import { useArtifactEditDialogs, type ArtifactEditCallbacks } from "./artifact-dialogs";
|
|
@@ -112,7 +113,7 @@ export function ArtifactViewer({
|
|
|
112
113
|
tooltip={skipConfirmTitle("Delete")}
|
|
113
114
|
label="Delete"
|
|
114
115
|
size="icon-sm"
|
|
115
|
-
className={cn(actionClass,
|
|
116
|
+
className={cn(actionClass, destructiveGhostClass)}
|
|
116
117
|
icon={<IconTrash size={16} />}
|
|
117
118
|
onClick={(event) => edit.requestDelete(event)}
|
|
118
119
|
/>
|
|
@@ -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
|
-
|
|
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/_menu-classes.ts
CHANGED
|
@@ -36,6 +36,13 @@ export const menuSubTriggerClass =
|
|
|
36
36
|
export const menuItemClass =
|
|
37
37
|
"relative flex cursor-pointer select-none items-center gap-2 rounded-menu-item px-2.5 py-1.5 max-sm:min-h-10 text-sm outline-none transition-[background-color,color] focus:bg-default focus:text-foreground data-[highlighted]:bg-default data-[highlighted]:text-foreground data-[disabled]:pointer-events-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0 [&_svg]:pointer-events-none";
|
|
38
38
|
|
|
39
|
+
/** Added to a menu item with `variant="destructive"`: red text, and a red wash on highlight. */
|
|
40
|
+
export const menuItemDestructiveClass =
|
|
41
|
+
"text-danger focus:bg-danger/10 focus:text-danger data-[highlighted]:bg-danger/10 data-[highlighted]:text-danger";
|
|
42
|
+
|
|
43
|
+
/** Red text and a red wash on hover, for a quiet (ghost) icon button that deletes. */
|
|
44
|
+
export const destructiveGhostClass = "text-danger hover:bg-danger/10 hover:text-danger";
|
|
45
|
+
|
|
39
46
|
export const menuCheckboxRadioItemClass =
|
|
40
47
|
"relative flex cursor-pointer select-none items-center rounded-menu-item py-1.5 max-sm:min-h-10 pl-8 pr-2.5 text-sm outline-none transition-[background-color,color] focus:bg-default focus:text-foreground data-[highlighted]:bg-default data-[highlighted]:text-foreground data-[disabled]:pointer-events-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50";
|
|
41
48
|
|
package/src/ui/context-menu.tsx
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
menuCheckboxRadioItemClass,
|
|
10
10
|
menuContentClass,
|
|
11
11
|
menuItemClass,
|
|
12
|
+
menuItemDestructiveClass,
|
|
12
13
|
menuLabelClass,
|
|
13
14
|
menuSeparatorClass,
|
|
14
15
|
menuShortcutClass,
|
|
@@ -123,6 +124,8 @@ const ContextMenuItem = React.forwardRef<
|
|
|
123
124
|
React.ComponentRef<typeof ContextMenuPrimitive.Item>,
|
|
124
125
|
React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> & {
|
|
125
126
|
inset?: boolean;
|
|
127
|
+
/** `"destructive"` shows red text and a red highlight, for delete and similar. Default `"default"`. */
|
|
128
|
+
variant?: "default" | "destructive";
|
|
126
129
|
/** Leading icon or mark. Ignored with `asChild`. */
|
|
127
130
|
startContent?: React.ReactNode;
|
|
128
131
|
/** Second line under the label. Ignored with `asChild`. */
|
|
@@ -132,7 +135,7 @@ const ContextMenuItem = React.forwardRef<
|
|
|
132
135
|
}
|
|
133
136
|
>(
|
|
134
137
|
(
|
|
135
|
-
{ className, inset, startContent, description, endContent, children, asChild, ...props },
|
|
138
|
+
{ className, inset, variant, startContent, description, endContent, children, asChild, ...props },
|
|
136
139
|
ref,
|
|
137
140
|
) => {
|
|
138
141
|
const item = useUiConfig("ContextMenu")?.classes?.item;
|
|
@@ -141,7 +144,7 @@ const ContextMenuItem = React.forwardRef<
|
|
|
141
144
|
<ContextMenuPrimitive.Item
|
|
142
145
|
ref={ref}
|
|
143
146
|
asChild={asChild}
|
|
144
|
-
className={merge(item ?? menuItemClass, inset && "pl-8", className)}
|
|
147
|
+
className={merge(item ?? menuItemClass, inset && "pl-8", variant === "destructive" && menuItemDestructiveClass, className)}
|
|
145
148
|
{...props}
|
|
146
149
|
>
|
|
147
150
|
{asChild || (startContent === undefined && description === undefined && endContent === undefined) ? (
|
package/src/ui/dropdown-menu.tsx
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
menuCheckboxRadioItemClass,
|
|
10
10
|
menuContentClass,
|
|
11
11
|
menuItemClass,
|
|
12
|
+
menuItemDestructiveClass,
|
|
12
13
|
menuLabelClass,
|
|
13
14
|
menuSeparatorClass,
|
|
14
15
|
menuShortcutClass,
|
|
@@ -155,6 +156,8 @@ const DropdownMenuItem = React.forwardRef<
|
|
|
155
156
|
React.ComponentRef<typeof DropdownMenuPrimitive.Item>,
|
|
156
157
|
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {
|
|
157
158
|
inset?: boolean;
|
|
159
|
+
/** `"destructive"` shows red text and a red highlight, for delete and similar. Default `"default"`. */
|
|
160
|
+
variant?: "default" | "destructive";
|
|
158
161
|
/** Leading icon or mark. Ignored with `asChild`. */
|
|
159
162
|
startContent?: React.ReactNode;
|
|
160
163
|
/** Second line under the label. Ignored with `asChild`. */
|
|
@@ -164,7 +167,7 @@ const DropdownMenuItem = React.forwardRef<
|
|
|
164
167
|
}
|
|
165
168
|
>(
|
|
166
169
|
(
|
|
167
|
-
{ className, inset, startContent, description, endContent, children, asChild, ...props },
|
|
170
|
+
{ className, inset, variant, startContent, description, endContent, children, asChild, ...props },
|
|
168
171
|
ref,
|
|
169
172
|
) => {
|
|
170
173
|
const item = useUiConfig("DropdownMenu")?.classes?.item;
|
|
@@ -173,7 +176,7 @@ const DropdownMenuItem = React.forwardRef<
|
|
|
173
176
|
<DropdownMenuPrimitive.Item
|
|
174
177
|
ref={ref}
|
|
175
178
|
asChild={asChild}
|
|
176
|
-
className={merge(item ?? menuItemClass, inset && "pl-8", className)}
|
|
179
|
+
className={merge(item ?? menuItemClass, inset && "pl-8", variant === "destructive" && menuItemDestructiveClass, className)}
|
|
177
180
|
{...props}
|
|
178
181
|
>
|
|
179
182
|
{asChild || (startContent === undefined && description === undefined && endContent === undefined) ? (
|
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
|
-
|
|
11
|
+
radius: ["field", "surface", "menu", "menu-item", "control"],
|
|
12
12
|
},
|
|
13
13
|
},
|
|
14
14
|
});
|