@vvedantb/ui 0.66.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/dist/shell/src/SidebarAccountMenu.js +1 -1
- 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/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/package.json +3 -3
- package/shell/src/SidebarAccountMenu.tsx +1 -1
- package/src/ai-elements/__snapshots__/queue.test.tsx.snap +2 -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/ui/_menu-classes.ts +7 -0
- package/src/ui/context-menu.tsx +5 -2
- package/src/ui/dropdown-menu.tsx +5 -2
|
@@ -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
|
}),
|
|
@@ -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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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",
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
"@streamdown/mermaid": "*",
|
|
136
136
|
"@tabler/icons-react": "^3.52.0",
|
|
137
137
|
"@tanstack/react-hotkeys": "^0.27.0",
|
|
138
|
-
"@vvedantb/server": ">=0.
|
|
138
|
+
"@vvedantb/server": ">=0.19.0",
|
|
139
139
|
"ai": "^7",
|
|
140
140
|
"class-variance-authority": "^0.7.1",
|
|
141
141
|
"clsx": "^2.1.1",
|
|
@@ -213,7 +213,7 @@
|
|
|
213
213
|
"vaul": "^1.1.2",
|
|
214
214
|
"vitest": "5.1.1",
|
|
215
215
|
"zod": "4.6.6",
|
|
216
|
-
"@vvedantb/server": "0.
|
|
216
|
+
"@vvedantb/server": "0.19.0"
|
|
217
217
|
},
|
|
218
218
|
"peerDependenciesMeta": {
|
|
219
219
|
"@clerk/react": {
|
|
@@ -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,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
|
/>
|
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) ? (
|