Skip to content

ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.

Migrate UI components to SCSS .ui-* classes

Juan Denis6dc9bd76aef8
diff --git a/frontend/src/components/ui/alert-dialog.jsx b/frontend/src/components/ui/alert-dialog.jsx
index 332189e6..5c047402 100644
--- a/frontend/src/components/ui/alert-dialog.jsx
+++ b/frontend/src/components/ui/alert-dialog.jsx
@@ -11,7 +11,7 @@ const AlertDialogOverlay = React.forwardRef(({ className, ...props }, ref) => (
<AlertDialogPrimitive.Overlay
ref={ref}
className={cn(
- 'fixed inset-0 z-50 bg-black/80',
+ 'ui-dialog-overlay',
'data-[state=open]:animate-in data-[state=closed]:animate-out',
'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
className
@@ -27,13 +27,10 @@ const AlertDialogContent = React.forwardRef(({ className, ...props }, ref) => (
<AlertDialogPrimitive.Content
ref={ref}
className={cn(
- 'fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2',
- 'gap-4 bg-card border border-border rounded-xl p-6 shadow-lg duration-200',
+ 'ui-dialog-content',
'data-[state=open]:animate-in data-[state=closed]:animate-out',
'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
'data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95',
- 'data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%]',
- 'data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]',
className
)}
{...props}
@@ -43,23 +40,19 @@ const AlertDialogContent = React.forwardRef(({ className, ...props }, ref) => (
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
function AlertDialogHeader({ className, ...props }) {
- return (
- <div className={cn('flex flex-col space-y-2 text-center sm:text-left', className)} {...props} />
- );
+ return <div className={cn('ui-dialog-header', className)} {...props} />;
}
AlertDialogHeader.displayName = 'AlertDialogHeader';
function AlertDialogFooter({ className, ...props }) {
- return (
- <div className={cn('flex flex-col-reverse gap-2 sm:flex-row sm:justify-end', className)} {...props} />
- );
+ return <div className={cn('ui-dialog-footer', className)} {...props} />;
}
AlertDialogFooter.displayName = 'AlertDialogFooter';
const AlertDialogTitle = React.forwardRef(({ className, ...props }, ref) => (
<AlertDialogPrimitive.Title
ref={ref}
- className={cn('text-base font-semibold text-foreground leading-tight', className)}
+ className={cn('ui-dialog-title', className)}
{...props}
/>
));
@@ -68,7 +61,7 @@ AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
const AlertDialogDescription = React.forwardRef(({ className, ...props }, ref) => (
<AlertDialogPrimitive.Description
ref={ref}
- className={cn('text-sm text-muted-foreground', className)}
+ className={cn('ui-dialog-description', className)}
{...props}
/>
));
diff --git a/frontend/src/components/ui/badge.jsx b/frontend/src/components/ui/badge.jsx
index 68d5490f..b1b92ccb 100644
--- a/frontend/src/components/ui/badge.jsx
+++ b/frontend/src/components/ui/badge.jsx
@@ -1,36 +1,24 @@
import * as React from 'react';
-import { cva } from 'class-variance-authority';
import { cn } from '@/lib/utils';
-const badgeVariants = cva(
- 'inline-flex min-h-6 items-center justify-center gap-1.5 whitespace-nowrap rounded-full border px-2.5 py-1 text-xs font-semibold leading-none transition-colors',
- {
- variants: {
- variant: {
- default: 'border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80',
- secondary: 'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80',
- destructive: 'border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80',
- outline: 'text-foreground border-border',
- success: 'border-transparent bg-green-500/15 text-green-400 border-green-500/20',
- warning: 'border-transparent bg-yellow-500/15 text-yellow-400 border-yellow-500/20',
- info: 'border-transparent bg-blue-500/15 text-blue-400 border-blue-500/20',
- },
- },
- defaultVariants: {
- variant: 'default',
- },
- }
-);
-
+// Styling lives in styles/components/_badges.scss via the
+// `[data-slot="badge"][data-variant="..."]` selectors. This component is
+// just a thin wrapper that sets those data attributes.
function Badge({ className, variant, ...props }) {
return (
<span
data-slot="badge"
data-variant={variant || 'default'}
- className={cn(badgeVariants({ variant }), className)}
+ className={cn(className)}
{...props}
/>
);
}
+// Backwards-compat shim: a few callers still import { badgeVariants }.
+// It now just returns a className string (no cva).
+function badgeVariants() {
+ return '';
+}
+
export { Badge, badgeVariants };
diff --git a/frontend/src/components/ui/button.jsx b/frontend/src/components/ui/button.jsx
index d3942e70..d798414d 100644
--- a/frontend/src/components/ui/button.jsx
+++ b/frontend/src/components/ui/button.jsx
@@ -1,50 +1,47 @@
import * as React from 'react';
import { Slot } from '@radix-ui/react-slot';
-import { cva } from 'class-variance-authority';
import { cn } from '@/lib/utils';
-const buttonVariants = cva(
- 'inline-flex items-center justify-center text-center gap-2 whitespace-nowrap rounded-md text-sm font-medium leading-none transition-all disabled:pointer-events-none disabled:opacity-60 [&_svg]:pointer-events-none [&_svg:not([class*="size-"])]:size-4 shrink-0 cursor-pointer',
- {
- variants: {
- variant: {
- default: 'bg-primary text-primary-foreground shadow-xs hover:bg-primary/90',
- destructive: 'bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/90',
- outline: 'border border-border bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground',
- secondary: 'bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80',
- ghost: 'hover:bg-accent hover:text-accent-foreground',
- link: 'text-primary underline-offset-4 hover:underline',
- },
- size: {
- default: 'h-10 min-w-24 px-5 py-0',
- sm: 'h-8 min-w-[4.5rem] rounded-md gap-1.5 px-3.5 py-0 text-xs',
- lg: 'h-11 min-w-32 rounded-lg px-7 py-0 text-base',
- icon: 'size-10 min-w-0 p-0 [&_svg:not([class*="size-"])]:size-[18px]',
- },
- },
- defaultVariants: {
- variant: 'default',
- size: 'default',
- },
- compoundVariants: [
- {
- variant: 'ghost',
- size: 'icon',
- className: 'border border-border bg-transparent text-muted-foreground shadow-xs hover:bg-accent hover:text-accent-foreground',
- },
- ],
- }
-);
+// Map shadcn-style `variant` prop to our SCSS .btn-* classes.
+// SCSS owns all geometry, color and hover state — see styles/components/_buttons.scss
+const VARIANT_CLASS = {
+ default: 'btn-primary',
+ primary: 'btn-primary',
+ destructive: 'btn-danger',
+ danger: 'btn-danger',
+ outline: 'btn-secondary',
+ secondary: 'btn-soft',
+ ghost: 'btn-ghost',
+ link: 'btn-link',
+};
+
+const SIZE_CLASS = {
+ default: '',
+ md: '',
+ sm: 'btn-sm',
+ lg: 'btn-lg',
+ icon: 'btn-icon',
+};
+
+function buttonVariants({ variant = 'default', size = 'default', className } = {}) {
+ return cn(
+ 'btn',
+ VARIANT_CLASS[variant] ?? VARIANT_CLASS.default,
+ SIZE_CLASS[size] ?? '',
+ className,
+ );
+}
function Button({ className, variant, size, asChild = false, ...props }) {
const Comp = asChild ? Slot : 'button';
return (
<Comp
data-slot="button"
- className={cn(buttonVariants({ variant, size, className }))}
+ className={buttonVariants({ variant, size, className })}
{...props}
/>
);
}
export { Button, buttonVariants };
+
diff --git a/frontend/src/components/ui/card.jsx b/frontend/src/components/ui/card.jsx
index 4b95d528..06db6c5e 100644
--- a/frontend/src/components/ui/card.jsx
+++ b/frontend/src/components/ui/card.jsx
@@ -2,63 +2,27 @@ import * as React from 'react';
import { cn } from '@/lib/utils';
function Card({ className, ...props }) {
- return (
- <div
- data-slot="card"
- className={cn('bg-card text-card-foreground rounded-xl border border-border shadow-sm', className)}
- {...props}
- />
- );
+ return <div data-slot="card" className={cn('ui-card', className)} {...props} />;
}
function CardHeader({ className, ...props }) {
- return (
- <div
- data-slot="card-header"
- className={cn('flex flex-col gap-1.5 p-6', className)}
- {...props}
- />
- );
+ return <div data-slot="card-header" className={cn('ui-card-header', className)} {...props} />;
}
function CardTitle({ className, ...props }) {
- return (
- <div
- data-slot="card-title"
- className={cn('leading-none font-semibold text-foreground', className)}
- {...props}
- />
- );
+ return <div data-slot="card-title" className={cn('ui-card-title', className)} {...props} />;
}
function CardDescription({ className, ...props }) {
- return (
- <div
- data-slot="card-description"
- className={cn('text-muted-foreground text-sm', className)}
- {...props}
- />
- );
+ return <div data-slot="card-description" className={cn('ui-card-description', className)} {...props} />;
}
function CardContent({ className, ...props }) {
- return (
- <div
- data-slot="card-content"
- className={cn('p-6 pt-0', className)}
- {...props}
- />
- );
+ return <div data-slot="card-content" className={cn('ui-card-content', className)} {...props} />;
}
function CardFooter({ className, ...props }) {
- return (
- <div
- data-slot="card-footer"
- className={cn('flex items-center p-6 pt-0', className)}
- {...props}
- />
- );
+ return <div data-slot="card-footer" className={cn('ui-card-footer', className)} {...props} />;
}
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };
diff --git a/frontend/src/components/ui/checkbox.jsx b/frontend/src/components/ui/checkbox.jsx
index ad4cd079..1a2f5a03 100644
--- a/frontend/src/components/ui/checkbox.jsx
+++ b/frontend/src/components/ui/checkbox.jsx
@@ -7,18 +7,11 @@ const Checkbox = React.forwardRef(({ className, ...props }, ref) => (
<CheckboxPrimitive.Root
ref={ref}
data-slot="checkbox"
- className={cn(
- 'peer size-4 shrink-0 rounded-sm border border-border shadow-xs',
- 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',
- 'disabled:cursor-not-allowed disabled:opacity-50',
- 'data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=checked]:border-primary',
- 'transition-colors',
- className
- )}
+ className={cn('peer ui-checkbox', className)}
{...props}
>
- <CheckboxPrimitive.Indicator className={cn('flex items-center justify-center text-current')}>
- <Check className="size-3.5" />
+ <CheckboxPrimitive.Indicator>
+ <Check />
</CheckboxPrimitive.Indicator>
</CheckboxPrimitive.Root>
));
diff --git a/frontend/src/components/ui/dialog.jsx b/frontend/src/components/ui/dialog.jsx
index bb9d2c43..f5e3fb1d 100644
--- a/frontend/src/components/ui/dialog.jsx
+++ b/frontend/src/components/ui/dialog.jsx
@@ -12,7 +12,7 @@ const DialogOverlay = React.forwardRef(({ className, ...props }, ref) => (
<DialogPrimitive.Overlay
ref={ref}
className={cn(
- 'fixed inset-0 z-50 bg-black/80',
+ 'ui-dialog-overlay',
'data-[state=open]:animate-in data-[state=closed]:animate-out',
'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
className
@@ -28,20 +28,17 @@ const DialogContent = React.forwardRef(({ className, children, ...props }, ref)
<DialogPrimitive.Content
ref={ref}
className={cn(
- 'fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2',
- 'gap-4 bg-card border border-border rounded-xl p-6 shadow-lg duration-200',
+ 'ui-dialog-content',
'data-[state=open]:animate-in data-[state=closed]:animate-out',
'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
'data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95',
- 'data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%]',
- 'data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]',
className
)}
{...props}
>
{children}
- <DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-card disabled:pointer-events-none">
- <X className="size-4 text-muted-foreground" />
+ <DialogPrimitive.Close className="ui-dialog-close">
+ <X />
<span className="sr-only">Close</span>
</DialogPrimitive.Close>
</DialogPrimitive.Content>
@@ -50,23 +47,19 @@ const DialogContent = React.forwardRef(({ className, children, ...props }, ref)
DialogContent.displayName = DialogPrimitive.Content.displayName;
function DialogHeader({ className, ...props }) {
- return (
- <div className={cn('flex flex-col space-y-1.5 text-left', className)} {...props} />
- );
+ return <div className={cn('ui-dialog-header', className)} {...props} />;
}
DialogHeader.displayName = 'DialogHeader';
function DialogFooter({ className, ...props }) {
- return (
- <div className={cn('flex flex-col-reverse gap-2 sm:flex-row sm:justify-end', className)} {...props} />
- );
+ return <div className={cn('ui-dialog-footer', className)} {...props} />;
}
DialogFooter.displayName = 'DialogFooter';
const DialogTitle = React.forwardRef(({ className, ...props }, ref) => (
<DialogPrimitive.Title
ref={ref}
- className={cn('text-lg font-semibold leading-none tracking-tight text-foreground', className)}
+ className={cn('ui-dialog-title', className)}
{...props}
/>
));
@@ -75,7 +68,7 @@ DialogTitle.displayName = DialogPrimitive.Title.displayName;
const DialogDescription = React.forwardRef(({ className, ...props }, ref) => (
<DialogPrimitive.Description
ref={ref}
- className={cn('text-sm text-muted-foreground', className)}
+ className={cn('ui-dialog-description', className)}
{...props}
/>
));
diff --git a/frontend/src/components/ui/input.jsx b/frontend/src/components/ui/input.jsx
index 11c65183..b7d8fd3e 100644
--- a/frontend/src/components/ui/input.jsx
+++ b/frontend/src/components/ui/input.jsx
@@ -6,15 +6,7 @@ function Input({ className, type, ...props }) {
<input
type={type}
data-slot="input"
- className={cn(
- 'flex h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-sm text-foreground shadow-xs transition-[color,box-shadow] outline-none',
- 'placeholder:text-muted-foreground',
- 'file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground',
- 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]',
- 'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',
- 'aria-invalid:border-destructive aria-invalid:ring-destructive/20',
- className
- )}
+ className={cn('ui-input', className)}
{...props}
/>
);
diff --git a/frontend/src/components/ui/label.jsx b/frontend/src/components/ui/label.jsx
index 0fef65e2..5b9bca96 100644
--- a/frontend/src/components/ui/label.jsx
+++ b/frontend/src/components/ui/label.jsx
@@ -6,11 +6,7 @@ function Label({ className, ...props }) {
return (
<LabelPrimitive.Root
data-slot="label"
- className={cn(
- 'flex items-center gap-2 text-sm leading-none font-medium select-none',
- 'peer-disabled:cursor-not-allowed peer-disabled:opacity-50',
- className
- )}
+ className={cn('ui-label', className)}
{...props}
/>
);
diff --git a/frontend/src/components/ui/select.jsx b/frontend/src/components/ui/select.jsx
index 60490374..3c681858 100644
--- a/frontend/src/components/ui/select.jsx
+++ b/frontend/src/components/ui/select.jsx
@@ -10,19 +10,12 @@ const SelectValue = SelectPrimitive.Value;
const SelectTrigger = React.forwardRef(({ className, children, ...props }, ref) => (
<SelectPrimitive.Trigger
ref={ref}
- className={cn(
- 'flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs',
- 'placeholder:text-muted-foreground text-foreground',
- 'focus:outline-none focus:ring-[3px] focus:ring-ring/50 focus:border-ring',
- 'disabled:cursor-not-allowed disabled:opacity-50',
- '[&>span]:line-clamp-1',
- className
- )}
+ className={cn('ui-select-trigger', className)}
{...props}
>
{children}
<SelectPrimitive.Icon asChild>
- <ChevronDown className="size-4 opacity-50 shrink-0" />
+ <ChevronDown className="ui-select-icon" />
</SelectPrimitive.Icon>
</SelectPrimitive.Trigger>
));
@@ -31,10 +24,10 @@ SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
const SelectScrollUpButton = React.forwardRef(({ className, ...props }, ref) => (
<SelectPrimitive.ScrollUpButton
ref={ref}
- className={cn('flex cursor-default items-center justify-center py-1', className)}
+ className={cn('ui-select-scroll-button', className)}
{...props}
>
- <ChevronUp className="size-4" />
+ <ChevronUp size={16} />
</SelectPrimitive.ScrollUpButton>
));
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
@@ -42,10 +35,10 @@ SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
const SelectScrollDownButton = React.forwardRef(({ className, ...props }, ref) => (
<SelectPrimitive.ScrollDownButton
ref={ref}
- className={cn('flex cursor-default items-center justify-center py-1', className)}
+ className={cn('ui-select-scroll-button', className)}
{...props}
>
- <ChevronDown className="size-4" />
+ <ChevronDown size={16} />
</SelectPrimitive.ScrollDownButton>
));
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
@@ -55,27 +48,17 @@ const SelectContent = React.forwardRef(({ className, children, position = 'poppe
<SelectPrimitive.Content
ref={ref}
className={cn(
- 'relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border border-border bg-popover text-popover-foreground shadow-md',
+ 'ui-select-content',
'data-[state=open]:animate-in data-[state=closed]:animate-out',
'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
'data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95',
- 'data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2',
- 'data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
- position === 'popper' &&
- 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',
className
)}
position={position}
{...props}
>
<SelectScrollUpButton />
- <SelectPrimitive.Viewport
- className={cn(
- 'p-1',
- position === 'popper' &&
- 'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]'
- )}
- >
+ <SelectPrimitive.Viewport className="ui-select-viewport">
{children}
</SelectPrimitive.Viewport>
<SelectScrollDownButton />
@@ -87,7 +70,7 @@ SelectContent.displayName = SelectPrimitive.Content.displayName;
const SelectLabel = React.forwardRef(({ className, ...props }, ref) => (
<SelectPrimitive.Label
ref={ref}
- className={cn('px-2 py-1.5 text-xs font-semibold text-muted-foreground', className)}
+ className={cn('ui-select-label', className)}
{...props}
/>
));
@@ -96,17 +79,12 @@ SelectLabel.displayName = SelectPrimitive.Label.displayName;
const SelectItem = React.forwardRef(({ className, children, ...props }, ref) => (
<SelectPrimitive.Item
ref={ref}
- className={cn(
- 'relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none',
- 'focus:bg-accent focus:text-accent-foreground',
- 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
- className
- )}
+ className={cn('ui-select-item', className)}
{...props}
>
- <span className="absolute left-2 flex size-3.5 items-center justify-center">
+ <span className="ui-select-item-indicator">
<SelectPrimitive.ItemIndicator>
- <Check className="size-4" />
+ <Check />
</SelectPrimitive.ItemIndicator>
</span>
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
@@ -117,7 +95,7 @@ SelectItem.displayName = SelectPrimitive.Item.displayName;
const SelectSeparator = React.forwardRef(({ className, ...props }, ref) => (
<SelectPrimitive.Separator
ref={ref}
- className={cn('-mx-1 my-1 h-px bg-border', className)}
+ className={cn('ui-select-separator', className)}
{...props}
/>
));
diff --git a/frontend/src/components/ui/sheet.jsx b/frontend/src/components/ui/sheet.jsx
index b8d0e8de..ecf812a5 100644
--- a/frontend/src/components/ui/sheet.jsx
+++ b/frontend/src/components/ui/sheet.jsx
@@ -1,7 +1,6 @@
import * as React from 'react';
import * as SheetPrimitive from '@radix-ui/react-dialog';
import { X } from 'lucide-react';
-import { cva } from 'class-variance-authority';
import { cn } from '@/lib/utils';
const Sheet = SheetPrimitive.Root;
@@ -13,7 +12,7 @@ const SheetOverlay = React.forwardRef(({ className, ...props }, ref) => (
<SheetPrimitive.Overlay
ref={ref}
className={cn(
- 'fixed inset-0 z-50 bg-black/80',
+ 'ui-sheet-overlay',
'data-[state=open]:animate-in data-[state=closed]:animate-out',
'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
className
@@ -23,27 +22,29 @@ const SheetOverlay = React.forwardRef(({ className, ...props }, ref) => (
));
SheetOverlay.displayName = SheetPrimitive.Overlay.displayName;
-const sheetVariants = cva(
- 'fixed z-50 flex flex-col gap-4 bg-card border-border p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out',
- {
- variants: {
- side: {
- top: 'inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top',
- bottom: 'inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom',
- left: 'inset-y-0 left-0 h-full w-full border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-md',
- right: 'inset-y-0 right-0 h-full w-full border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-md',
- },
- },
- defaultVariants: { side: 'right' },
- }
-);
+const SHEET_SIDE_ANIM = {
+ top: 'data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top',
+ bottom: 'data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom',
+ left: 'data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left',
+ right: 'data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right',
+};
const SheetContent = React.forwardRef(({ side = 'right', className, children, ...props }, ref) => (
<SheetPortal>
<SheetOverlay />
- <SheetPrimitive.Content ref={ref} className={cn(sheetVariants({ side }), className)} {...props}>
- <SheetPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring">
- <X className="size-4 text-muted-foreground" />
+ <SheetPrimitive.Content
+ ref={ref}
+ className={cn(
+ 'ui-sheet-content',
+ `ui-sheet-content--${side}`,
+ 'data-[state=open]:animate-in data-[state=closed]:animate-out',
+ SHEET_SIDE_ANIM[side],
+ className
+ )}
+ {...props}
+ >
+ <SheetPrimitive.Close className="ui-sheet-close">
+ <X />
<span className="sr-only">Close</span>
</SheetPrimitive.Close>
{children}
@@ -53,22 +54,22 @@ const SheetContent = React.forwardRef(({ side = 'right', className, children, ..
SheetContent.displayName = SheetPrimitive.Content.displayName;
function SheetHeader({ className, ...props }) {
- return <div className={cn('flex flex-col space-y-2 text-center sm:text-left', className)} {...props} />;
+ return <div className={cn('ui-sheet-header', className)} {...props} />;
}
SheetHeader.displayName = 'SheetHeader';
function SheetFooter({ className, ...props }) {
- return <div className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)} {...props} />;
+ return <div className={cn('ui-sheet-footer', className)} {...props} />;
}
SheetFooter.displayName = 'SheetFooter';
const SheetTitle = React.forwardRef(({ className, ...props }, ref) => (
- <SheetPrimitive.Title ref={ref} className={cn('text-lg font-semibold text-foreground', className)} {...props} />
+ <SheetPrimitive.Title ref={ref} className={cn('ui-sheet-title', className)} {...props} />
));
SheetTitle.displayName = SheetPrimitive.Title.displayName;
const SheetDescription = React.forwardRef(({ className, ...props }, ref) => (
- <SheetPrimitive.Description ref={ref} className={cn('text-sm text-muted-foreground', className)} {...props} />
+ <SheetPrimitive.Description ref={ref} className={cn('ui-sheet-description', className)} {...props} />
));
SheetDescription.displayName = SheetPrimitive.Description.displayName;
diff --git a/frontend/src/components/ui/switch.jsx b/frontend/src/components/ui/switch.jsx
index d8cdf63d..6d151316 100644
--- a/frontend/src/components/ui/switch.jsx
+++ b/frontend/src/components/ui/switch.jsx
@@ -6,21 +6,10 @@ const Switch = React.forwardRef(({ className, ...props }, ref) => (
<SwitchPrimitive.Root
ref={ref}
data-slot="switch"
- className={cn(
- 'peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-xs',
- 'transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',
- 'disabled:cursor-not-allowed disabled:opacity-50',
- 'data-[state=checked]:bg-primary data-[state=unchecked]:bg-input',
- className
- )}
+ className={cn('peer ui-switch', className)}
{...props}
>
- <SwitchPrimitive.Thumb
- className={cn(
- 'pointer-events-none block size-4 rounded-full bg-background shadow-lg ring-0 transition-transform',
- 'data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0'
- )}
- />
+ <SwitchPrimitive.Thumb className="ui-switch-thumb" />
</SwitchPrimitive.Root>
));
Switch.displayName = SwitchPrimitive.Root.displayName;
diff --git a/frontend/src/components/ui/table.jsx b/frontend/src/components/ui/table.jsx
index eb441991..85d373d6 100644
--- a/frontend/src/components/ui/table.jsx
+++ b/frontend/src/components/ui/table.jsx
@@ -2,77 +2,44 @@ import * as React from 'react';
import { cn } from '@/lib/utils';
const Table = React.forwardRef(({ className, ...props }, ref) => (
- <div className="relative w-full overflow-auto">
- <table
- ref={ref}
- className={cn('w-full caption-bottom text-sm', className)}
- {...props}
- />
+ <div className="ui-table-wrapper">
+ <table ref={ref} className={cn('ui-table', className)} {...props} />
</div>
));
Table.displayName = 'Table';
const TableHeader = React.forwardRef(({ className, ...props }, ref) => (
- <thead ref={ref} className={cn('[&_tr]:border-b [&_tr]:border-border', className)} {...props} />
+ <thead ref={ref} className={cn('ui-table-header', className)} {...props} />
));
TableHeader.displayName = 'TableHeader';
const TableBody = React.forwardRef(({ className, ...props }, ref) => (
- <tbody ref={ref} className={cn('[&_tr:last-child]:border-0', className)} {...props} />
+ <tbody ref={ref} className={cn('ui-table-body', className)} {...props} />
));
TableBody.displayName = 'TableBody';
const TableFooter = React.forwardRef(({ className, ...props }, ref) => (
- <tfoot
- ref={ref}
- className={cn('border-t border-border bg-muted/50 font-medium [&>tr]:last:border-b-0', className)}
- {...props}
- />
+ <tfoot ref={ref} className={cn('ui-table-footer', className)} {...props} />
));
TableFooter.displayName = 'TableFooter';
const TableRow = React.forwardRef(({ className, ...props }, ref) => (
- <tr
- ref={ref}
- className={cn(
- 'border-b border-border transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted',
- className
- )}
- {...props}
- />
+ <tr ref={ref} className={cn('ui-table-row', className)} {...props} />
));
TableRow.displayName = 'TableRow';
const TableHead = React.forwardRef(({ className, ...props }, ref) => (
- <th
- ref={ref}
- className={cn(
- 'h-10 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',
- className
- )}
- {...props}
- />
+ <th ref={ref} className={cn('ui-table-head', className)} {...props} />
));
TableHead.displayName = 'TableHead';
const TableCell = React.forwardRef(({ className, ...props }, ref) => (
- <td
- ref={ref}
- className={cn(
- 'p-4 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',
- className
- )}
- {...props}
- />
+ <td ref={ref} className={cn('ui-table-cell', className)} {...props} />
));
TableCell.displayName = 'TableCell';
const TableCaption = React.forwardRef(({ className, ...props }, ref) => (
- <caption
- ref={ref}
- className={cn('mt-4 text-sm text-muted-foreground', className)}
- {...props}
- />
+ <caption ref={ref} className={cn('ui-table-caption', className)} {...props} />
));
TableCaption.displayName = 'TableCaption';
diff --git a/frontend/src/components/ui/tabs.jsx b/frontend/src/components/ui/tabs.jsx
index 9207d977..6ab2c29e 100644
--- a/frontend/src/components/ui/tabs.jsx
+++ b/frontend/src/components/ui/tabs.jsx
@@ -161,7 +161,7 @@ const TabsList = React.forwardRef(({ className, children, ...props }, ref) => {
<PopoverContent
align="end"
sideOffset={6}
- className="w-auto min-w-[12rem] p-1"
+ className="ui-popover-content"
>
<div className="tabs-overflow-list">
{hiddenIndices.map((idx) => {
diff --git a/frontend/src/components/ui/textarea.jsx b/frontend/src/components/ui/textarea.jsx
index 89449135..6f9d4a19 100644
--- a/frontend/src/components/ui/textarea.jsx
+++ b/frontend/src/components/ui/textarea.jsx
@@ -5,15 +5,7 @@ function Textarea({ className, ...props }) {
return (
<textarea
data-slot="textarea"
- className={cn(
- 'border-input flex min-h-[60px] w-full rounded-md border bg-transparent px-3 py-2 text-sm text-foreground shadow-xs',
- 'placeholder:text-muted-foreground',
- 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] focus-visible:outline-none',
- 'disabled:cursor-not-allowed disabled:opacity-50',
- 'aria-invalid:border-destructive aria-invalid:ring-destructive/20',
- 'transition-[color,box-shadow]',
- className
- )}
+ className={cn('ui-textarea', className)}
{...props}
/>
);
diff --git a/frontend/src/styles/components/_buttons.scss b/frontend/src/styles/components/_buttons.scss
index 76373667..b112a3b6 100644
--- a/frontend/src/styles/components/_buttons.scss
+++ b/frontend/src/styles/components/_buttons.scss
@@ -1,20 +1,78 @@
// ============================================
// BUTTON COMPONENTS
// ============================================
+//
+// Single source of truth for buttons. Designed so that:
+// - Height is controlled ONLY by the size class (no padding-y math)
+// - Horizontal padding is consistent regardless of icon presence
+// - Icon + text spacing uses `gap`, not padding tricks
+// - Variants set color/background/border only — never geometry
+//
+// Class API (kept stable for backwards compatibility):
+// Base: .btn
+// Variants: .btn-primary .btn-secondary .btn-soft
+// .btn-danger .btn-ghost .btn-link
+// Sizes: (default) .btn-sm .btn-lg .btn-icon
+// Modifiers: .btn-full .btn-loading .btn-expand
+// ============================================
.btn {
- @include button-base();
+ // Layout
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ gap: $space-2;
+ flex-shrink: 0;
+ white-space: nowrap;
+ text-align: center;
+ vertical-align: middle;
+
+ // Geometry — default (md) size
+ height: 40px;
+ min-width: 96px;
+ padding: 0 $space-5;
+ border-radius: $radius-lg;
+ border: 1px solid transparent;
+
+ // Typography
+ font-family: inherit;
+ font-size: $font-size-base; // 14px
+ font-weight: $font-weight-medium;
+ line-height: 1;
+
+ // Behaviour
+ cursor: pointer;
+ user-select: none;
+ background: none;
+ color: inherit;
+ @include transition();
svg {
width: 16px;
height: 16px;
+ flex-shrink: 0;
+ }
+
+ &:disabled,
+ &[aria-disabled='true'] {
+ opacity: 0.55;
+ cursor: not-allowed;
+ pointer-events: none;
+ }
+
+ &:focus-visible {
+ outline: 2px solid $accent-primary;
+ outline-offset: 2px;
}
}
-// Primary button (accent color)
+// --------------------------------------------
+// Variants
+// --------------------------------------------
+
.btn-primary {
background-color: $accent-primary;
- color: white;
+ color: #fff;
box-shadow: $shadow-accent;
&:hover:not(:disabled) {
@@ -22,7 +80,7 @@
}
}
-// Secondary button (outlined)
+// Outlined neutral button (shadcn "outline")
.btn-secondary {
background-color: transparent;
border-color: $border-active;
@@ -33,17 +91,25 @@
}
}
-// Danger button
+// Filled neutral / soft button (shadcn "secondary")
+.btn-soft {
+ background-color: $bg-secondary;
+ color: $text-primary;
+
+ &:hover:not(:disabled) {
+ background-color: $bg-hover;
+ }
+}
+
.btn-danger {
background: $danger;
- color: white;
+ color: #fff;
&:hover:not(:disabled) {
background: $danger-hover;
}
}
-// Ghost button (no border)
.btn-ghost {
background: transparent;
color: $text-secondary;
@@ -54,39 +120,98 @@
}
}
+.btn-link {
+ height: auto;
+ min-width: 0;
+ padding: 0;
+ background: transparent;
+ color: $accent-primary;
+ text-decoration: none;
+
+ &:hover:not(:disabled) {
+ text-decoration: underline;
+ }
+}
+
+// --------------------------------------------
// Size variants
+// --------------------------------------------
+
.btn-sm {
- padding: $space-1 $space-2;
- font-size: $font-size-xs + 1;
+ height: 32px;
+ min-width: 72px;
+ padding: 0 $space-3 + 2; // 14px
+ font-size: $font-size-sm + 1; // 13px
+ border-radius: $radius-md;
+ gap: $space-1 + 2; // 6px
+
+ svg {
+ width: 14px;
+ height: 14px;
+ }
}
.btn-lg {
- padding: $space-3 $space-6;
- font-size: $font-size-base;
-}
+ height: 44px;
+ min-width: 128px;
+ padding: 0 $space-6 + 4; // 28px
+ font-size: $font-size-md; // 16px
-// Full width
-.btn-full {
- width: 100%;
- justify-content: center;
+ svg {
+ width: 18px;
+ height: 18px;
+ }
}
-// Icon only button
+// Icon-only square button — matches default height so it lines up
+// next to regular buttons in toolbars.
.btn-icon {
- padding: $space-2;
+ width: 40px;
+ height: 40px;
+ min-width: 0;
+ padding: 0;
svg {
width: 18px;
height: 18px;
}
+
+ &.btn-sm {
+ width: 32px;
+ height: 32px;
+
+ svg {
+ width: 16px;
+ height: 16px;
+ }
+ }
+
+ &.btn-lg {
+ width: 44px;
+ height: 44px;
+
+ svg {
+ width: 20px;
+ height: 20px;
+ }
+ }
+}
+
+// --------------------------------------------
+// Modifiers
+// --------------------------------------------
+
+.btn-full {
+ width: 100%;
}
-// Expand/collapse button
.btn-expand {
background: none;
border: none;
color: $text-tertiary;
cursor: pointer;
+ height: auto;
+ min-width: 0;
padding: $space-1 $space-2;
font-size: $font-size-sm;
@include flex-start();
@@ -98,16 +223,5 @@
}
}
-// Loading state (see _spinner.scss for spinner-specific styles)
-.btn-loading {
- position: relative;
- pointer-events: none;
- color: transparent !important;
-
- .spinner {
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- }
-}
+// Loading state styling lives in _spinner.scss alongside .spinner overrides.
+
diff --git a/frontend/src/styles/components/_ui.scss b/frontend/src/styles/components/_ui.scss
new file mode 100644
index 00000000..53a63eb0
--- /dev/null
+++ b/frontend/src/styles/components/_ui.scss
@@ -0,0 +1,611 @@
+// ============================================
+// SHADCN-STYLE UI COMPONENT CLASSES
+// ============================================
+//
+// SCSS classes used by `frontend/src/components/ui/*.jsx`.
+// These are paired one-to-one with React components so that
+// geometry/color/typography lives in SCSS only — JSX just composes
+// classes. tailwindcss-animate utility classes (animate-in, slide-in-from-*)
+// remain in JSX because they are behavior-only and don't conflict.
+//
+// Naming convention: `.ui-<component>-<part>` to avoid collisions with
+// existing legacy classes like `.card`, `.tab`, `.modal` that are
+// referenced from many places.
+// ============================================
+
+// --------------------------------------------
+// LABEL
+// --------------------------------------------
+.ui-label {
+ display: inline-flex;
+ align-items: center;
+ gap: $space-2;
+ font-size: $font-size-sm + 1;
+ font-weight: $font-weight-medium;
+ line-height: 1;
+ color: $text-secondary;
+ user-select: none;
+
+ &[data-disabled='true'],
+ .peer:disabled ~ & {
+ opacity: 0.5;
+ cursor: not-allowed;
+ }
+}
+
+// --------------------------------------------
+// INPUT / TEXTAREA shared styles
+// --------------------------------------------
+%ui-field-base {
+ display: block;
+ width: 100%;
+ padding: 0 $space-3 + 1; // 13px
+ background: $bg-body;
+ border: 1px solid $border-subtle;
+ border-radius: $radius-lg;
+ color: $text-primary;
+ font-family: inherit;
+ font-size: $font-size-base;
+ line-height: 1.5;
+ @include transition(border-color);
+
+ &::placeholder {
+ color: $text-tertiary;
+ }
+
+ &:focus,
+ &:focus-visible {
+ border-color: $accent-primary;
+ outline: none;
+ box-shadow: 0 0 0 3px fade($accent-primary-raw, 18%);
+ }
+
+ &:disabled,
+ &[aria-disabled='true'] {
+ opacity: 0.55;
+ cursor: not-allowed;
+ }
+
+ &[aria-invalid='true'] {
+ border-color: $danger;
+ box-shadow: 0 0 0 3px fade($danger, 18%);
+ }
+}
+
+.ui-input {
+ @extend %ui-field-base;
+ height: 40px;
+
+ &::file-selector-button {
+ margin-right: $space-3;
+ padding: 0 $space-2;
+ height: 28px;
+ background: transparent;
+ border: none;
+ color: $text-primary;
+ font-weight: $font-weight-medium;
+ font-size: $font-size-sm + 1;
+ cursor: pointer;
+ }
+}
+
+.ui-textarea {
+ @extend %ui-field-base;
+ min-height: 80px;
+ padding-top: $space-2 + 1;
+ padding-bottom: $space-2 + 1;
+ resize: vertical;
+}
+
+// --------------------------------------------
+// CHECKBOX (Radix)
+// --------------------------------------------
+.ui-checkbox {
+ flex-shrink: 0;
+ width: 16px;
+ height: 16px;
+ border: 1px solid $border-active;
+ border-radius: $radius-sm;
+ background: $bg-body;
+ cursor: pointer;
+ @include transition();
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ color: #fff;
+
+ &:focus-visible {
+ outline: 2px solid $accent-primary;
+ outline-offset: 2px;
+ }
+
+ &:disabled,
+ &[data-disabled] {
+ opacity: 0.5;
+ cursor: not-allowed;
+ }
+
+ &[data-state='checked'] {
+ background: $accent-primary;
+ border-color: $accent-primary;
+ }
+
+ svg {
+ width: 12px;
+ height: 12px;
+ }
+}
+
+// --------------------------------------------
+// SWITCH (Radix)
+// --------------------------------------------
+.ui-switch {
+ position: relative;
+ flex-shrink: 0;
+ width: 36px;
+ height: 20px;
+ padding: 0;
+ border: none;
+ border-radius: $radius-full;
+ background: $bg-tertiary;
+ cursor: pointer;
+ @include transition(background-color);
+
+ &:focus-visible {
+ outline: 2px solid $accent-primary;
+ outline-offset: 2px;
+ }
+
+ &:disabled,
+ &[data-disabled] {
+ opacity: 0.5;
+ cursor: not-allowed;
+ }
+
+ &[data-state='checked'] {
+ background: $accent-primary;
+ }
+
+ .ui-switch-thumb {
+ display: block;
+ width: 16px;
+ height: 16px;
+ margin: 2px;
+ background: #fff;
+ border-radius: 50%;
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
+ transition: transform 150ms ease;
+ transform: translateX(0);
+ }
+
+ &[data-state='checked'] .ui-switch-thumb {
+ transform: translateX(16px);
+ }
+}
+
+// --------------------------------------------
+// CARD (shadcn-style)
+// --------------------------------------------
+.ui-card {
+ background: $bg-card;
+ color: $text-primary;
+ border: 1px solid $border-subtle;
+ border-radius: $radius-xl;
+ box-shadow: $shadow-sm;
+ display: flex;
+ flex-direction: column;
+}
+
+.ui-card-header {
+ display: flex;
+ flex-direction: column;
+ gap: $space-1 + 2; // 6px
+ padding: $space-6;
+}
+
+.ui-card-title {
+ font-size: $font-size-md;
+ font-weight: $font-weight-semibold;
+ line-height: 1.2;
+ color: $text-primary;
+ margin: 0;
+}
+
+.ui-card-description {
+ font-size: $font-size-sm + 1;
+ color: $text-tertiary;
+ line-height: 1.45;
+ margin: 0;
+}
+
+.ui-card-content {
+ padding: 0 $space-6 $space-6;
+ flex: 1;
+}
+
+.ui-card-footer {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ padding: 0 $space-6 $space-6;
+}
+
+// --------------------------------------------
+// TABLE (shadcn-style)
+// --------------------------------------------
+.ui-table-wrapper {
+ position: relative;
+ width: 100%;
+ overflow-x: auto;
+ @include custom-scrollbar();
+}
+
+.ui-table {
+ width: 100%;
+ caption-side: bottom;
+ border-collapse: collapse;
+ font-size: $font-size-sm + 1;
+}
+
+.ui-table-header tr {
+ border-bottom: 1px solid $border-default;
+}
+
+.ui-table-body tr:not(:last-child) {
+ border-bottom: 1px solid $border-subtle;
+}
+
+.ui-table-footer {
+ border-top: 1px solid $border-default;
+ background: fade($bg-hover-raw, 50%);
+ font-weight: $font-weight-medium;
+
+ tr:last-child {
+ border-bottom: 0;
+ }
+}
+
+.ui-table-row {
+ @include transition(background-color);
+
+ &:hover {
+ background: fade($bg-hover-raw, 50%);
+ }
+
+ &[data-state='selected'] {
+ background: $bg-hover;
+ }
+}
+
+.ui-table-head {
+ height: 40px;
+ padding: 0 $space-4;
+ text-align: left;
+ vertical-align: middle;
+ color: $text-tertiary;
+ font-weight: $font-weight-medium;
+ font-size: $font-size-xs + 1;
+}
+
+.ui-table-cell {
+ padding: $space-3 + 1 $space-4; // 13px 16px
+ vertical-align: middle;
+ color: $text-primary;
+}
+
+.ui-table-caption {
+ margin-top: $space-4;
+ color: $text-tertiary;
+ font-size: $font-size-sm + 1;
+}
+
+// --------------------------------------------
+// DIALOG / ALERT DIALOG (Radix)
+// --------------------------------------------
+.ui-dialog-overlay {
+ position: fixed;
+ inset: 0;
+ z-index: $z-modal-backdrop;
+ background: rgba(0, 0, 0, 0.7);
+ backdrop-filter: blur(4px);
+}
+
+.ui-dialog-content {
+ position: fixed;
+ left: 50%;
+ top: 50%;
+ z-index: $z-modal-backdrop + 1;
+ width: calc(100% - #{$space-8});
+ max-width: 560px;
+ max-height: calc(100vh - #{$space-10});
+ transform: translate(-50%, -50%);
+ display: flex;
+ flex-direction: column;
+ gap: $space-4;
+ padding: $space-6;
+ background: $bg-card;
+ border: 1px solid $border-subtle;
+ border-radius: $radius-2xl;
+ box-shadow: $shadow-lg;
+ overflow-y: auto;
+ @include custom-scrollbar();
+
+ &:focus,
+ &:focus-visible {
+ outline: none;
+ }
+}
+
+.ui-dialog-close {
+ position: absolute;
+ top: $space-4;
+ right: $space-4;
+ width: 28px;
+ height: 28px;
+ padding: 0;
+ background: transparent;
+ border: none;
+ border-radius: $radius-sm;
+ color: $text-tertiary;
+ cursor: pointer;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ @include transition();
+
+ &:hover {
+ color: $text-primary;
+ background: $bg-hover;
+ }
+
+ &:focus-visible {
+ outline: 2px solid $accent-primary;
+ outline-offset: 2px;
+ }
+
+ svg {
+ width: 16px;
+ height: 16px;
+ }
+}
+
+.ui-dialog-header {
+ display: flex;
+ flex-direction: column;
+ gap: $space-1 + 2;
+ text-align: left;
+}
+
+.ui-dialog-footer {
+ display: flex;
+ flex-direction: column-reverse;
+ gap: $space-2;
+ margin-top: $space-2;
+
+ @media (min-width: $breakpoint-sm) {
+ flex-direction: row;
+ justify-content: flex-end;
+ }
+}
+
+.ui-dialog-title {
+ font-size: $font-size-lg;
+ font-weight: $font-weight-semibold;
+ line-height: 1.2;
+ color: $text-primary;
+ margin: 0;
+}
+
+.ui-dialog-description {
+ font-size: $font-size-sm + 1;
+ color: $text-tertiary;
+ line-height: 1.5;
+ margin: 0;
+}
+
+// --------------------------------------------
+// SHEET (Radix Dialog used as side drawer)
+// --------------------------------------------
+.ui-sheet-overlay {
+ @extend .ui-dialog-overlay;
+}
+
+.ui-sheet-content {
+ position: fixed;
+ z-index: $z-modal-backdrop + 1;
+ display: flex;
+ flex-direction: column;
+ gap: $space-4;
+ padding: $space-6;
+ background: $bg-card;
+ border-color: $border-subtle;
+ box-shadow: $shadow-lg;
+ overflow-y: auto;
+ @include custom-scrollbar();
+
+ &:focus,
+ &:focus-visible {
+ outline: none;
+ }
+
+ &--top {
+ top: 0;
+ left: 0;
+ right: 0;
+ border-bottom: 1px solid $border-subtle;
+ }
+
+ &--bottom {
+ bottom: 0;
+ left: 0;
+ right: 0;
+ border-top: 1px solid $border-subtle;
+ }
+
+ &--left {
+ top: 0;
+ bottom: 0;
+ left: 0;
+ width: 100%;
+ max-width: 28rem;
+ border-right: 1px solid $border-subtle;
+ }
+
+ &--right {
+ top: 0;
+ bottom: 0;
+ right: 0;
+ width: 100%;
+ max-width: 28rem;
+ border-left: 1px solid $border-subtle;
+ }
+}
+
+.ui-sheet-close {
+ @extend .ui-dialog-close;
+}
+
+.ui-sheet-header {
+ @extend .ui-dialog-header;
+}
+
+.ui-sheet-footer {
+ @extend .ui-dialog-footer;
+}
+
+.ui-sheet-title {
+ @extend .ui-dialog-title;
+}
+
+.ui-sheet-description {
+ @extend .ui-dialog-description;
+}
+
+// --------------------------------------------
+// SELECT (Radix)
+// --------------------------------------------
+.ui-select-trigger {
+ @extend %ui-field-base;
+ height: 40px;
+ display: inline-flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: $space-2;
+ cursor: pointer;
+ text-align: left;
+
+ &[data-placeholder] {
+ color: $text-tertiary;
+ }
+
+ > span {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+
+ .ui-select-icon {
+ width: 16px;
+ height: 16px;
+ color: $text-tertiary;
+ flex-shrink: 0;
+ }
+}
+
+.ui-select-content {
+ position: relative;
+ z-index: $z-tooltip;
+ min-width: 8rem;
+ max-height: 24rem;
+ overflow: hidden;
+ background: $bg-elevated;
+ border: 1px solid $border-subtle;
+ border-radius: $radius-lg;
+ box-shadow: $shadow-md;
+ color: $text-primary;
+}
+
+.ui-select-viewport {
+ padding: $space-1;
+}
+
+.ui-select-scroll-button {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ height: 24px;
+ cursor: default;
+ color: $text-tertiary;
+}
+
+.ui-select-label {
+ padding: $space-1 + 2 $space-2;
+ font-size: $font-size-xs + 1;
+ font-weight: $font-weight-semibold;
+ color: $text-tertiary;
+ text-transform: uppercase;
+ letter-spacing: 0.04em;
+}
+
+.ui-select-item {
+ position: relative;
+ display: flex;
+ align-items: center;
+ width: 100%;
+ padding: $space-2 $space-2 $space-2 $space-8;
+ border-radius: $radius-md;
+ font-size: $font-size-sm + 1;
+ color: $text-primary;
+ cursor: default;
+ user-select: none;
+ outline: none;
+ @include transition(background-color);
+
+ &[data-highlighted],
+ &:focus {
+ background: $bg-hover;
+ color: $text-primary;
+ }
+
+ &[data-disabled] {
+ opacity: 0.5;
+ pointer-events: none;
+ }
+
+ .ui-select-item-indicator {
+ position: absolute;
+ left: $space-2;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ width: 16px;
+ height: 16px;
+ color: $accent-primary;
+
+ svg {
+ width: 14px;
+ height: 14px;
+ }
+ }
+}
+
+.ui-select-separator {
+ height: 1px;
+ margin: $space-1 -#{$space-1};
+ background: $border-subtle;
+}
+
+// --------------------------------------------
+// POPOVER (Radix)
+// --------------------------------------------
+.ui-popover-content {
+ z-index: $z-tooltip;
+ min-width: 12rem;
+ padding: $space-1;
+ background: $bg-elevated;
+ border: 1px solid $border-subtle;
+ border-radius: $radius-lg;
+ box-shadow: $shadow-md;
+ color: $text-primary;
+ outline: none;
+}
diff --git a/frontend/src/styles/main.scss b/frontend/src/styles/main.scss
index 417613c1..fb7864eb 100644
--- a/frontend/src/styles/main.scss
+++ b/frontend/src/styles/main.scss
@@ -61,6 +61,7 @@
@import 'components/_contribution-graph';
@import 'components/_command-palette';
@import 'components/_logs-drawer';
+@import 'components/_ui';
// --------------------------------------------
// 5. PAGE-SPECIFIC STYLES