Skip to content

Commit 0649299

Browse files
fix(web): add a sidebar variant to the alert primitive
1 parent ff103d8 commit 0649299

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

‎apps/web/src/components/sidebar/SidebarThreadUndoNotice.tsx‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,8 @@ export function SidebarThreadUndoNotice() {
1414
const shortcut = shortcutLabelForCommand(keybindings, "thread.undo");
1515

1616
return (
17-
<Alert
18-
role="status"
19-
className="rounded-lg border-sidebar-border bg-sidebar-control-surface px-2 py-1.5 dark:bg-sidebar-control-surface"
20-
>
21-
<AlertDescription className="block text-[11px] leading-4 text-sidebar-muted-foreground">
17+
<Alert role="status" variant="sidebar">
18+
<AlertDescription>
2219
{notice.action} {notice.count} thread{notice.count === 1 ? "" : "s"},{" "}
2320
<InlineButton
2421
underline

‎apps/web/src/components/ui/alert.tsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ const alertVariants = cva("relative rounded-xl border px-3.5 py-3 text-card-fore
1111
variants: {
1212
variant: {
1313
default: "bg-transparent dark:bg-input/32 [&_svg]:text-muted-foreground",
14+
sidebar:
15+
"rounded-lg border-sidebar-border bg-sidebar-control-surface px-2 py-1.5 text-[11px] leading-4 [&_[data-slot=alert-description]]:block [&_[data-slot=alert-description]]:text-sidebar-muted-foreground",
1416
error:
1517
"border-error/32 bg-error-surface text-error-foreground [&_[data-slot=alert-description]]:text-error-foreground/80 [&_svg]:text-error",
1618
info: "border-info/32 bg-info/4 [&_svg]:text-info",

0 commit comments

Comments
 (0)