Files
Inboxintel/frontend/src/components/ui/button.jsx
T
cesnimda 9ae61432ba feat(ui): F1+F2 — component primitives + rebuilt app shell
F1: shadcn-style primitive set in components/ui (Button, Card, Badge, Input,
Switch, Separator, Skeleton, Tooltip, DropdownMenu, Dialog, Sheet, Tabs, Table,
Toast+useToast, ThemeToggle, PageHeader/StatCard/EmptyState) on Radix + cva.

F2: Layout rebuilt on the new system — sidebar with primary nav (lucide icons)
+ favorites/saved-searches/mailbox/smart-folder sections, sticky topbar with
search, sync status, theme toggle, digest toggle, and an account dropdown. All
prior behavior preserved (auth, sync, collapse/section persistence, "/" search
focus). App wrapped in ToastProvider + TooltipProvider. Build green.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-30 23:51:45 +02:00

35 lines
1.5 KiB
React

import { forwardRef } from 'react';
import { cva } from 'class-variance-authority';
import { cn } from '../../lib/utils.js';
const buttonVariants = cva(
'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0',
{
variants: {
variant: {
primary: 'bg-primary text-primary-foreground hover:bg-primary/90 shadow-sm',
secondary: 'bg-muted text-foreground hover:bg-muted/70',
outline: 'border border-border bg-card hover:bg-muted text-foreground',
ghost: 'hover:bg-muted text-foreground',
danger: 'bg-danger text-danger-foreground hover:bg-danger/90 shadow-sm',
'danger-outline': 'border border-danger/40 text-danger hover:bg-danger/10',
link: 'text-primary underline-offset-4 hover:underline',
},
size: {
sm: 'h-8 px-3 text-xs',
md: 'h-9 px-4',
lg: 'h-10 px-6',
icon: 'h-9 w-9',
'icon-sm': 'h-8 w-8',
},
},
defaultVariants: { variant: 'primary', size: 'md' },
}
);
const Button = forwardRef(function Button({ className, variant, size, ...props }, ref) {
return <button ref={ref} className={cn(buttonVariants({ variant, size }), className)} {...props} />;
});
export { Button, buttonVariants };