refactor: improve auth defaults, update UI, and docs
- Provide fallback values for auth environment variables - Refine global CSS styles and typography - Update application metadata descriptions - Add toast error handling to clients page - Formalize phase implementation guidelines in AGENTS.md
This commit is contained in:
1 parent
df14ee1a9a
commit
fde2c86b1e
48 files changed
+1062
-1665
No files matched your search
@@ -42,10 +42,10 @@ export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
||||
};
|
||||
|
||||
const sizeStyles = {
|
||||
default: 'min-h-10 px-4 text-[13.5px] gap-2',
|
||||
sm: 'h-9 px-3 text-[12.5px] gap-1.5',
|
||||
xs: 'h-8 px-2.5 text-[12px] gap-1.5',
|
||||
icon: 'w-9 h-9 p-0',
|
||||
default: 'min-h-8.5 px-3 text-[12px] gap-1.5',
|
||||
sm: 'h-7.5 px-2.5 text-[11.5px] gap-1.5',
|
||||
xs: 'h-7 px-2 text-[11px] gap-1',
|
||||
icon: 'w-7.5 h-7.5 p-0',
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -61,15 +61,15 @@ export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
||||
{...props}
|
||||
>
|
||||
{loading ? (
|
||||
<Icon name="Loader2" size={size === 'sm' || size === 'xs' ? 12 : 14} className="animate-spin" />
|
||||
<Icon name="Loader2" size={11} className="animate-spin" />
|
||||
) : (
|
||||
icon && iconPosition === 'left' && (
|
||||
<Icon name={icon} size={size === 'sm' || size === 'xs' ? 12 : 14} />
|
||||
<Icon name={icon} size={11} />
|
||||
)
|
||||
)}
|
||||
{children && <span>{children}</span>}
|
||||
{!loading && icon && iconPosition === 'right' && (
|
||||
<Icon name={icon} size={size === 'sm' || size === 'xs' ? 12 : 14} />
|
||||
<Icon name={icon} size={11} />
|
||||
)}
|
||||
</button>
|
||||
);
|
||||
|
||||
@@ -25,8 +25,8 @@ export const Card: React.FC<CardProps> = ({
|
||||
className={cn(
|
||||
'transition-colors',
|
||||
variantStyles[variant],
|
||||
className,
|
||||
compact ? 'p-4' : 'p-5 sm:p-6'
|
||||
compact ? 'p-3' : 'p-4 sm:p-5',
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
>
|
||||
@@ -42,7 +42,7 @@ export const CardHeader: React.FC<React.HTMLAttributes<HTMLDivElement>> = ({
|
||||
}) => (
|
||||
<div
|
||||
className={cn(
|
||||
'flex items-center justify-between gap-3 pb-3 mb-3 border-b border-[var(--border)]',
|
||||
'flex items-center justify-between gap-2 pb-2 mb-2 border-b border-[var(--border)]',
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
@@ -56,7 +56,7 @@ export const CardTitle: React.FC<React.HTMLAttributes<HTMLHeadingElement>> = ({
|
||||
children,
|
||||
...props
|
||||
}) => (
|
||||
<h3 className={cn('text-[15px] font-semibold text-[var(--text)] leading-snug', className)} {...props}>
|
||||
<h3 className={cn('text-[12px] font-medium text-[var(--text)] leading-snug', className)} {...props}>
|
||||
{children}
|
||||
</h3>
|
||||
);
|
||||
@@ -66,7 +66,7 @@ export const CardDescription: React.FC<React.HTMLAttributes<HTMLParagraphElement
|
||||
children,
|
||||
...props
|
||||
}) => (
|
||||
<p className={cn('text-[13px] text-[var(--text-muted)] leading-relaxed', className)} {...props}>
|
||||
<p className={cn('text-[11.5px] text-[var(--text-muted)] leading-relaxed', className)} {...props}>
|
||||
{children}
|
||||
</p>
|
||||
);
|
||||
@@ -76,7 +76,7 @@ export const CardContent: React.FC<React.HTMLAttributes<HTMLDivElement>> = ({
|
||||
children,
|
||||
...props
|
||||
}) => (
|
||||
<div className={cn('text-[14px]', className)} {...props}>
|
||||
<div className={cn('text-[12px]', className)} {...props}>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
@@ -88,7 +88,7 @@ export const CardFooter: React.FC<React.HTMLAttributes<HTMLDivElement>> = ({
|
||||
}) => (
|
||||
<div
|
||||
className={cn(
|
||||
'flex items-center justify-between gap-3 pt-3 mt-3 border-t border-[var(--border)] text-[13px]',
|
||||
'flex items-center justify-between gap-2 pt-2 mt-2 border-t border-[var(--border)] text-[11.5px]',
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
|
||||
@@ -15,21 +15,21 @@ interface ClientListProps {
|
||||
export const ClientList: React.FC<ClientListProps> = ({ clients, limit = 4 }) => (
|
||||
<div className="divide-y divide-[var(--border)]">
|
||||
{clients.slice(0, limit).map((client) => (
|
||||
<div key={client.clientId} className="flex min-w-0 items-center justify-between gap-3 px-4 py-2">
|
||||
<div key={client.clientId} className="flex min-w-0 items-center justify-between gap-2.5 px-3 py-1.5">
|
||||
<div className="flex min-w-0 items-center gap-2">
|
||||
<span className={client.status === 'active' ? 'h-1.5 w-1.5 shrink-0 bg-[var(--accent)]' : 'h-1.5 w-1.5 shrink-0 bg-[var(--text-faint)]'} />
|
||||
<div className="min-w-0">
|
||||
<p className="truncate text-[12px] font-medium text-[var(--text)]">{client.name}</p>
|
||||
<p className="truncate text-[11.5px] font-medium text-[var(--text)]">{client.name}</p>
|
||||
<p className="truncate font-mono text-[10px] text-[var(--text-faint)]">{client.clientId}</p>
|
||||
</div>
|
||||
</div>
|
||||
<span className="shrink-0 font-mono text-[11px] text-[var(--text-muted)]">
|
||||
<span className="shrink-0 font-mono text-[10.5px] tabular-nums text-[var(--text-muted)]">
|
||||
{client.totalEvents.toLocaleString()}
|
||||
</span>
|
||||
</div>
|
||||
))}
|
||||
{clients.length === 0 && (
|
||||
<p className="px-4 py-5 text-[12px] text-[var(--text-faint)]">No registered clients.</p>
|
||||
<p className="px-3 py-4 text-[11px] text-[var(--text-faint)]">No clients</p>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -1,12 +1,18 @@
|
||||
import { cn } from '@/lib/utils';
|
||||
import React from 'react';
|
||||
|
||||
interface CodeBlockProps {
|
||||
interface CodeBlockProps extends React.HTMLAttributes<HTMLPreElement> {
|
||||
children: React.ReactNode;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export const CodeBlock: React.FC<CodeBlockProps> = ({ children, className = '' }) => (
|
||||
<pre className={`overflow-x-auto bg-[var(--surface)] p-4 font-mono text-[12px] leading-relaxed text-[var(--text-muted)] ${className}`}>
|
||||
export const CodeBlock: React.FC<CodeBlockProps> = ({ children, className, ...props }) => (
|
||||
<pre
|
||||
className={cn(
|
||||
'overflow-x-auto bg-[var(--bg-main)] p-3 font-mono text-[11.5px] leading-relaxed text-[var(--text)]',
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
>
|
||||
<code>{children}</code>
|
||||
</pre>
|
||||
);
|
||||
|
||||
+7
-11
@@ -6,7 +6,7 @@ export const Form: React.FC<React.FormHTMLAttributes<HTMLFormElement>> = ({
|
||||
children,
|
||||
...props
|
||||
}) => (
|
||||
<form className={cn('flex flex-col gap-5', className)} {...props}>
|
||||
<form className={cn('flex flex-col gap-3', className)} {...props}>
|
||||
{children}
|
||||
</form>
|
||||
);
|
||||
@@ -16,7 +16,7 @@ export const FormField: React.FC<React.HTMLAttributes<HTMLDivElement>> = ({
|
||||
children,
|
||||
...props
|
||||
}) => (
|
||||
<div className={cn('flex flex-col gap-2 w-full', className)} {...props}>
|
||||
<div className={cn('flex flex-col gap-1.5 w-full', className)} {...props}>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
@@ -26,7 +26,7 @@ export const FormRow: React.FC<React.HTMLAttributes<HTMLDivElement>> = ({
|
||||
children,
|
||||
...props
|
||||
}) => (
|
||||
<div className={cn('grid grid-cols-1 sm:grid-cols-2 gap-4 w-full', className)} {...props}>
|
||||
<div className={cn('grid grid-cols-1 sm:grid-cols-2 gap-3 w-full', className)} {...props}>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
@@ -35,25 +35,21 @@ export const FormSwitch: React.FC<{
|
||||
label: string;
|
||||
checked: boolean;
|
||||
onChange: (checked: boolean) => void;
|
||||
description?: string;
|
||||
disabled?: boolean;
|
||||
}> = ({ label, checked, onChange, description, disabled = false }) => (
|
||||
}> = ({ label, checked, onChange, disabled = false }) => (
|
||||
<label
|
||||
className={cn(
|
||||
'flex items-center justify-between gap-4 p-4 border border-[var(--border)] bg-[var(--bg-main)] cursor-pointer select-none transition-colors hover:bg-[var(--bg-hover)]',
|
||||
'flex items-center justify-between gap-3 px-2.5 py-1.5 border border-[var(--border)] bg-[var(--bg-main)] cursor-pointer select-none transition-colors hover:bg-[var(--bg-hover)]',
|
||||
disabled && 'opacity-50 cursor-not-allowed'
|
||||
)}
|
||||
>
|
||||
<div className="flex flex-col">
|
||||
<span className="text-[14px] font-medium text-[var(--text)]">{label}</span>
|
||||
{description && <span className="text-[12px] text-[var(--text-muted)]">{description}</span>}
|
||||
</div>
|
||||
<span className="text-[11.5px] text-[var(--text)]">{label}</span>
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={checked}
|
||||
disabled={disabled}
|
||||
onChange={(e) => onChange(e.target.checked)}
|
||||
className="w-5 h-5 accent-[var(--accent)] cursor-pointer shrink-0"
|
||||
className="w-3.5 h-3.5 accent-[var(--accent)] cursor-pointer shrink-0"
|
||||
/>
|
||||
</label>
|
||||
);
|
||||
|
||||
+31
-13
@@ -7,10 +7,12 @@ export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement>
|
||||
error?: string;
|
||||
icon?: string;
|
||||
compact?: boolean;
|
||||
suffix?: string;
|
||||
rightElement?: React.ReactNode;
|
||||
}
|
||||
|
||||
export const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
||||
({ label, error, icon, compact = false, className, id, ...props }, ref) => {
|
||||
({ label, error, icon, compact = false, suffix, rightElement, className, id, ...props }, ref) => {
|
||||
const inputId = id || (label ? label.toLowerCase().replace(/\s+/g, '-') : undefined);
|
||||
|
||||
return (
|
||||
@@ -18,15 +20,15 @@ export const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
||||
{label && (
|
||||
<label
|
||||
htmlFor={inputId}
|
||||
className="text-[12px] font-medium text-[var(--text-muted)]"
|
||||
className="text-[10.5px] font-medium text-[var(--text-muted)]"
|
||||
>
|
||||
{label}
|
||||
</label>
|
||||
)}
|
||||
<div className="relative flex items-center w-full">
|
||||
{icon && (
|
||||
<div className="absolute left-2.5 flex items-center pointer-events-none text-[var(--text-dim)]">
|
||||
<Icon name={icon} size={13} />
|
||||
<div className="absolute left-2 flex items-center pointer-events-none text-[var(--text-dim)]">
|
||||
<Icon name={icon} size={12} />
|
||||
</div>
|
||||
)}
|
||||
<input
|
||||
@@ -34,15 +36,31 @@ export const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
||||
ref={ref}
|
||||
className={cn(
|
||||
'w-full bg-[var(--bg-main)] text-[var(--text)] border border-[var(--border-strong)] placeholder:text-[var(--text-dim)] transition-colors focus:outline-none focus:border-[var(--accent)] disabled:opacity-50 disabled:cursor-not-allowed',
|
||||
compact ? 'h-9 px-3 text-[13px]' : 'h-10 px-3.5 text-[14px]',
|
||||
icon && 'pl-8',
|
||||
compact ? 'h-7.5 px-2.5 text-[11.5px]' : 'h-8.5 px-3 text-[12px]',
|
||||
icon && 'pl-7',
|
||||
rightElement && 'pr-8',
|
||||
error && 'border-[var(--danger)]',
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
{rightElement && (
|
||||
<div className="absolute right-0 top-0 bottom-0 flex items-center">
|
||||
{rightElement}
|
||||
</div>
|
||||
)}
|
||||
{suffix && (
|
||||
<span
|
||||
className={cn(
|
||||
'flex shrink-0 items-center border border-l-0 border-[var(--border-strong)] bg-[var(--surface-2)] text-[var(--text-muted)] select-none',
|
||||
compact ? 'h-7.5 px-2 text-[11px]' : 'h-8.5 px-2.5 text-[11.5px]'
|
||||
)}
|
||||
>
|
||||
{suffix}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
{error && <span className="text-[12px] text-[var(--danger)]">{error}</span>}
|
||||
{error && <span className="text-[11px] text-[var(--danger)]">{error}</span>}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -64,7 +82,7 @@ export const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
|
||||
{label && (
|
||||
<label
|
||||
htmlFor={textareaId}
|
||||
className="text-[12px] font-medium text-[var(--text-muted)]"
|
||||
className="text-[10.5px] font-medium text-[var(--text-muted)]"
|
||||
>
|
||||
{label}
|
||||
</label>
|
||||
@@ -73,13 +91,13 @@ export const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
|
||||
id={textareaId}
|
||||
ref={ref}
|
||||
className={cn(
|
||||
'w-full bg-[var(--bg-main)] text-[var(--text)] border border-[var(--border-strong)] p-3.5 text-[14px] placeholder:text-[var(--text-dim)] focus:outline-none focus:border-[var(--accent)] min-h-[96px] resize-y font-mono',
|
||||
'w-full bg-[var(--bg-main)] text-[var(--text)] border border-[var(--border-strong)] p-2.5 text-[12px] placeholder:text-[var(--text-dim)] focus:outline-none focus:border-[var(--accent)] min-h-[80px] resize-y font-mono',
|
||||
error && 'border-[var(--danger)]',
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
{error && <span className="text-[12px] text-[var(--danger)]">{error}</span>}
|
||||
{error && <span className="text-[11px] text-[var(--danger)]">{error}</span>}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -103,7 +121,7 @@ export const Select = React.forwardRef<HTMLSelectElement, SelectProps>(
|
||||
{label && (
|
||||
<label
|
||||
htmlFor={selectId}
|
||||
className="text-[12px] font-medium text-[var(--text-muted)]"
|
||||
className="text-[10.5px] font-medium text-[var(--text-muted)]"
|
||||
>
|
||||
{label}
|
||||
</label>
|
||||
@@ -113,7 +131,7 @@ export const Select = React.forwardRef<HTMLSelectElement, SelectProps>(
|
||||
ref={ref}
|
||||
className={cn(
|
||||
'w-full bg-[var(--bg-main)] text-[var(--text)] border border-[var(--border-strong)] focus:outline-none focus:border-[var(--accent)] cursor-pointer',
|
||||
compact ? 'h-9 px-2.5 text-[13px]' : 'h-10 px-3 text-[14px]',
|
||||
compact ? 'h-7.5 px-2 text-[11.5px]' : 'h-8.5 px-2.5 text-[12px]',
|
||||
error && 'border-[var(--danger)]',
|
||||
className
|
||||
)}
|
||||
@@ -127,7 +145,7 @@ export const Select = React.forwardRef<HTMLSelectElement, SelectProps>(
|
||||
))
|
||||
: children}
|
||||
</select>
|
||||
{error && <span className="text-[12px] text-[var(--danger)]">{error}</span>}
|
||||
{error && <span className="text-[11px] text-[var(--danger)]">{error}</span>}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
+12
-19
@@ -7,7 +7,6 @@ export interface ModalProps {
|
||||
isOpen: boolean;
|
||||
onClose: () => void;
|
||||
title: string;
|
||||
description?: string;
|
||||
children: React.ReactNode;
|
||||
footer?: React.ReactNode;
|
||||
maxWidth?: 'xs' | 'sm' | 'md' | 'lg';
|
||||
@@ -17,7 +16,6 @@ export const Modal: React.FC<ModalProps> = ({
|
||||
isOpen,
|
||||
onClose,
|
||||
title,
|
||||
description,
|
||||
children,
|
||||
footer,
|
||||
maxWidth = 'md',
|
||||
@@ -41,44 +39,39 @@ export const Modal: React.FC<ModalProps> = ({
|
||||
if (!isOpen) return null;
|
||||
|
||||
const maxWidthStyles = {
|
||||
xs: 'max-w-[440px]',
|
||||
sm: 'max-w-[480px]',
|
||||
md: 'max-w-[640px]',
|
||||
lg: 'max-w-[800px]',
|
||||
xs: 'max-w-[380px]',
|
||||
sm: 'max-w-[420px]',
|
||||
md: 'max-w-[540px]',
|
||||
lg: 'max-w-[680px]',
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="fixed inset-0 z-50 flex items-center justify-center p-3 sm:p-6 bg-black/60">
|
||||
<div className="fixed inset-0 z-50 flex items-center justify-center p-3 bg-black/60">
|
||||
<div
|
||||
className={cn(
|
||||
'w-full bg-[var(--bg-elevated)] border border-[var(--border-strong)] text-[var(--text)] flex flex-col max-h-[calc(100dvh-1.5rem)] sm:max-h-[min(88dvh,800px)] overflow-hidden animate-in fade-in zoom-in-95 duration-150',
|
||||
'w-full bg-[var(--bg-elevated)] border border-[var(--border-strong)] text-[var(--text)] flex flex-col max-h-[calc(100dvh-1.5rem)] sm:max-h-[min(86dvh,720px)] overflow-hidden animate-in fade-in zoom-in-95 duration-150',
|
||||
maxWidthStyles[maxWidth]
|
||||
)}
|
||||
>
|
||||
<div className="flex items-start justify-between gap-4 p-4 sm:px-6 sm:py-5 border-b border-[var(--border)] shrink-0">
|
||||
<div className="min-w-0">
|
||||
<h2 className="text-[18px] font-semibold text-[var(--text)] leading-snug">{title}</h2>
|
||||
{description && (
|
||||
<p className="text-[13px] text-[var(--text-muted)] mt-1.5">{description}</p>
|
||||
)}
|
||||
</div>
|
||||
<div className="flex items-center justify-between gap-3 px-3.5 py-2.5 border-b border-[var(--border)] shrink-0">
|
||||
<h2 className="text-[13px] font-medium text-[var(--text)] leading-snug truncate">{title}</h2>
|
||||
<Button
|
||||
size="icon"
|
||||
variant="ghost"
|
||||
onClick={onClose}
|
||||
aria-label="Close dialog"
|
||||
className="w-9 h-9 text-[var(--text-dim)] hover:text-[var(--text)]"
|
||||
className="w-6.5 h-6.5 text-[var(--text-dim)] hover:text-[var(--text)]"
|
||||
>
|
||||
<Icon name="X" size={14} />
|
||||
<Icon name="X" size={12} />
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div className="p-4 sm:p-6 overflow-y-auto flex-1 text-[14px] flex flex-col gap-4">
|
||||
<div className="p-3.5 overflow-y-auto flex-1 text-[12px] flex flex-col gap-3">
|
||||
{children}
|
||||
</div>
|
||||
|
||||
{footer && (
|
||||
<div className="flex flex-wrap items-center justify-end gap-2 p-4 sm:px-6 border-t border-[var(--border)] bg-[var(--bg-sidebar)] shrink-0">
|
||||
<div className="flex flex-wrap items-center justify-end gap-1.5 px-3.5 py-2 border-t border-[var(--border)] bg-[var(--bg-sidebar)] shrink-0">
|
||||
{footer}
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -19,10 +19,10 @@ export const Panel: React.FC<PanelProps> = ({
|
||||
...props
|
||||
}) => (
|
||||
<section className={cn('flex min-w-0 flex-col border border-[var(--border)] bg-[var(--surface)]', className)} {...props}>
|
||||
<header className="flex min-h-11 items-center justify-between gap-3 border-b border-[var(--border)] px-4 py-2.5">
|
||||
<h2 className="text-[12px] font-medium text-[var(--text)]">{title}</h2>
|
||||
<div className="flex items-center gap-3">
|
||||
{meta && <span className="text-[11px] text-[var(--text-faint)]">{meta}</span>}
|
||||
<header className="flex min-h-8.5 items-center justify-between gap-2 border-b border-[var(--border)] px-3 py-1.5">
|
||||
<h2 className="text-[11.5px] font-medium text-[var(--text)]">{title}</h2>
|
||||
<div className="flex items-center gap-2.5">
|
||||
{meta && <span className="font-mono text-[10.5px] tabular-nums text-[var(--text-faint)]">{meta}</span>}
|
||||
{action}
|
||||
</div>
|
||||
</header>
|
||||
|
||||
@@ -11,7 +11,7 @@ export const Pill = React.forwardRef<HTMLButtonElement, PillProps>(
|
||||
ref={ref}
|
||||
type={type}
|
||||
className={cn(
|
||||
'inline-flex h-[26px] shrink-0 items-center gap-1.5 border px-2.5 text-[11.5px] transition-colors disabled:cursor-not-allowed disabled:opacity-50',
|
||||
'inline-flex h-6 shrink-0 items-center gap-1 border px-2 text-[11px] transition-colors cursor-pointer whitespace-nowrap disabled:cursor-not-allowed disabled:opacity-50',
|
||||
active
|
||||
? 'border-[var(--border-strong)] bg-[var(--surface-2)] text-[var(--text)]'
|
||||
: 'border-[var(--border)] bg-transparent text-[var(--text-muted)] hover:bg-[var(--surface-2)] hover:text-[var(--text)]',
|
||||
|
||||
@@ -24,7 +24,7 @@ export function SettingsTabs({
|
||||
role="tab"
|
||||
aria-selected={value === item.id}
|
||||
aria-controls={`settings-panel-${item.id}`}
|
||||
className={`mb-[-1px] shrink-0 border-b-2 px-3.5 py-2.5 text-xs transition-colors ${value === item.id ? 'border-[var(--accent)] text-[var(--text)]' : 'border-transparent text-[var(--text-muted)] hover:text-[var(--text)]'}`}
|
||||
className={`mb-[-1px] shrink-0 border-b-2 px-3 py-1.5 text-[11.5px] transition-colors cursor-pointer whitespace-nowrap ${value === item.id ? 'border-[var(--accent)] text-[var(--text)] font-medium' : 'border-transparent text-[var(--text-muted)] hover:text-[var(--text)]'}`}
|
||||
onClick={() => onChange(item.id)}
|
||||
>
|
||||
{item.label}
|
||||
@@ -42,29 +42,26 @@ export function SettingsGroup({
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<section className="border-b border-[var(--border)] p-4 last:border-b-0">
|
||||
<h2 className="mb-3 flex items-center gap-1.5 text-[10px] uppercase tracking-wider text-[var(--text-faint)]">
|
||||
<section className="border-b border-[var(--border)] p-3 last:border-b-0">
|
||||
<h2 className="mb-2 flex items-center gap-1.5 text-[9.5px] uppercase tracking-wider text-[var(--text-faint)]">
|
||||
{title}
|
||||
</h2>
|
||||
<div className="flex flex-col">{children}</div>
|
||||
<div className="flex flex-col gap-1">{children}</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
export function SettingsField({
|
||||
label,
|
||||
hint,
|
||||
children,
|
||||
}: {
|
||||
label: string;
|
||||
hint?: string;
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<div className="grid grid-cols-1 items-start gap-1.5 py-2 sm:grid-cols-[1fr_2fr] sm:gap-5">
|
||||
<div className="min-w-0 pt-px">
|
||||
<div className="text-[12.5px] leading-snug text-[var(--text)]">{label}</div>
|
||||
{hint && <div className="mt-0.5 text-[11px] leading-normal text-[var(--text-faint)]">{hint}</div>}
|
||||
<div className="grid grid-cols-1 items-center gap-1.5 py-1.5 sm:grid-cols-[1fr_2fr] sm:gap-4">
|
||||
<div className="min-w-0">
|
||||
<div className="text-[11.5px] leading-snug text-[var(--text)]">{label}</div>
|
||||
</div>
|
||||
<div className="min-w-0">{children}</div>
|
||||
</div>
|
||||
|
||||
@@ -5,17 +5,15 @@ interface StatCardProps {
|
||||
label: string;
|
||||
value: string | number;
|
||||
unit?: string;
|
||||
meta: string;
|
||||
}
|
||||
|
||||
export const StatCard: React.FC<StatCardProps> = ({ label, value, unit, meta }) => (
|
||||
export const StatCard: React.FC<StatCardProps> = ({ label, value, unit }) => (
|
||||
<Card compact className="bg-[var(--surface)]">
|
||||
<div className="mb-1.5 text-[10px] uppercase text-[var(--text-faint)]">{label}</div>
|
||||
<div className="text-[22px] font-medium leading-tight text-[var(--text)]">
|
||||
<div className="mb-1 text-[10px] uppercase tracking-wider text-[var(--text-faint)]">{label}</div>
|
||||
<div className="font-mono text-[16px] font-medium leading-tight tabular-nums text-[var(--text)]">
|
||||
{value}
|
||||
{unit && <span className="ml-1 text-[11px] font-normal text-[var(--text-muted)]">{unit}</span>}
|
||||
{unit && <span className="ml-1 font-sans text-[10.5px] font-normal text-[var(--text-muted)]">{unit}</span>}
|
||||
</div>
|
||||
<div className="mt-2 text-[11px] text-[var(--text-muted)]">{meta}</div>
|
||||
</Card>
|
||||
);
|
||||
|
||||
|
||||
@@ -11,13 +11,13 @@ const DOT_CLASS: Record<Dot, string> = {
|
||||
|
||||
export function StatStrip({ items }: { items: Item[] }) {
|
||||
return (
|
||||
<div className="mb-4 grid grid-cols-2 gap-px border border-[var(--border)] bg-[var(--border)] md:grid-cols-4">
|
||||
<div className="mb-3 grid grid-cols-2 gap-px border border-[var(--border)] bg-[var(--border)] md:grid-cols-4">
|
||||
{items.map((item) => (
|
||||
<div key={item.label} className="bg-[var(--surface)] px-4 py-3">
|
||||
<div className="mb-1 text-[10px] uppercase tracking-wider text-[var(--text-faint)]">
|
||||
<div key={item.label} className="bg-[var(--surface)] px-3 py-2">
|
||||
<div className="mb-0.5 text-[9.5px] uppercase tracking-wider text-[var(--text-faint)]">
|
||||
{item.label}
|
||||
</div>
|
||||
<div className="flex items-center gap-2 text-lg font-medium leading-none tracking-tight text-[var(--text)]">
|
||||
<div className="flex items-center gap-1.5 font-mono text-[15px] font-medium leading-tight tracking-tight tabular-nums text-[var(--text)]">
|
||||
{item.dot && <span aria-hidden="true" className={`h-1.5 w-1.5 ${DOT_CLASS[item.dot]}`} />}
|
||||
{item.value}
|
||||
</div>
|
||||
|
||||
@@ -24,7 +24,7 @@ export const Table: React.FC<React.TableHTMLAttributes<HTMLTableElement>> = ({
|
||||
}) => (
|
||||
<table
|
||||
className={cn(
|
||||
'w-full min-w-[680px] border-collapse text-left text-[13px] whitespace-nowrap',
|
||||
'w-full min-w-[640px] border-collapse text-left text-[11.5px] whitespace-nowrap',
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
@@ -40,7 +40,7 @@ export const TableHeader: React.FC<React.HTMLAttributes<HTMLTableSectionElement>
|
||||
}) => (
|
||||
<thead
|
||||
className={cn(
|
||||
'bg-[var(--bg-sidebar)] border-b border-[var(--border)] text-[12px] font-medium text-[var(--text-muted)] uppercase',
|
||||
'bg-[var(--bg-sidebar)] border-b border-[var(--border)] text-[10px] font-medium tracking-wider text-[var(--text-muted)] uppercase',
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
@@ -76,7 +76,7 @@ export const TableHead: React.FC<React.ThHTMLAttributes<HTMLTableCellElement>> =
|
||||
children,
|
||||
...props
|
||||
}) => (
|
||||
<th className={cn('px-3 py-2.5 font-medium', className)} {...props}>
|
||||
<th className={cn('px-3 py-1.5 font-medium', className)} {...props}>
|
||||
{children}
|
||||
</th>
|
||||
);
|
||||
@@ -86,19 +86,19 @@ export const TableCell: React.FC<React.TdHTMLAttributes<HTMLTableCellElement>> =
|
||||
children,
|
||||
...props
|
||||
}) => (
|
||||
<td className={cn('px-3 py-2.5 text-[var(--text-muted)] align-middle', className)} {...props}>
|
||||
<td className={cn('px-3 py-1.5 text-[var(--text-muted)] align-middle', className)} {...props}>
|
||||
{children}
|
||||
</td>
|
||||
);
|
||||
|
||||
export const TableEmpty: React.FC<{ colSpan: number; message?: string }> = ({
|
||||
colSpan,
|
||||
message = 'No data available',
|
||||
message = 'No data',
|
||||
}) => (
|
||||
<tr>
|
||||
<td
|
||||
colSpan={colSpan}
|
||||
className="px-4 py-10 text-center text-[13px] text-[var(--text-dim)]"
|
||||
className="px-3 py-6 text-center text-[11.5px] text-[var(--text-dim)]"
|
||||
>
|
||||
{message}
|
||||
</td>
|
||||
|
||||
@@ -15,15 +15,15 @@ export const Text: React.FC<TextProps> = ({
|
||||
...props
|
||||
}) => {
|
||||
const variantStyles = {
|
||||
h1: 'text-[24px] font-semibold text-[var(--text)]',
|
||||
h2: 'text-[20px] font-semibold text-[var(--text)]',
|
||||
h3: 'text-[17px] font-medium text-[var(--text)]',
|
||||
body: 'text-[14px] font-normal text-[var(--text)]',
|
||||
muted: 'text-[13px] font-normal text-[var(--text-muted)]',
|
||||
dim: 'text-[12px] font-normal text-[var(--text-dim)]',
|
||||
label: 'text-[12px] font-medium uppercase text-[var(--text-muted)]',
|
||||
code: 'text-[12px] font-mono text-[var(--accent)] bg-[var(--bg-hover)] px-2 py-1 border border-[var(--border)]',
|
||||
badge: 'text-[11.5px] font-medium px-2 py-1 border border-[var(--border)] text-[var(--text-muted)] inline-flex items-center gap-1',
|
||||
h1: 'text-[16px] font-medium tracking-tight text-[var(--text)]',
|
||||
h2: 'text-[14px] font-medium tracking-tight text-[var(--text)]',
|
||||
h3: 'text-[12.5px] font-medium text-[var(--text)]',
|
||||
body: 'text-[13px] font-normal text-[var(--text)]',
|
||||
muted: 'text-[12px] font-normal text-[var(--text-muted)]',
|
||||
dim: 'text-[11px] font-normal text-[var(--text-dim)]',
|
||||
label: 'text-[10.5px] font-medium uppercase tracking-wider text-[var(--text-muted)]',
|
||||
code: 'text-[11.5px] font-mono text-[var(--accent)] bg-[var(--bg-hover)] px-1.5 py-0.5 border border-[var(--border)]',
|
||||
badge: 'text-[10.5px] font-medium px-1.5 py-0.5 border border-[var(--border)] text-[var(--text-muted)] inline-flex items-center gap-1',
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -80,17 +80,17 @@ export const ToastProvider: React.FC<{ children: React.ReactNode }> = ({ childre
|
||||
<div
|
||||
key={t.id}
|
||||
className={cn(
|
||||
'pointer-events-auto flex items-start gap-3 p-4 bg-[var(--bg-elevated)] border border-[var(--border-strong)] text-[var(--text)] text-[13px] transition-all',
|
||||
'pointer-events-auto flex items-start gap-2.5 p-3 bg-[var(--bg-elevated)] border border-[var(--border-strong)] text-[var(--text)] text-[12px] transition-all',
|
||||
typeBorder
|
||||
)}
|
||||
>
|
||||
<div className="mt-0.5 shrink-0">
|
||||
<Icon name={typeIcon} size={17} color={iconColor} />
|
||||
<Icon name={typeIcon} size={14} color={iconColor} />
|
||||
</div>
|
||||
<div className="flex-1 min-w-0">
|
||||
<div className="font-medium text-[var(--text)] leading-tight">{t.title}</div>
|
||||
{t.message && (
|
||||
<div className="text-[12px] text-[var(--text-muted)] mt-1 leading-normal break-words">
|
||||
<div className="text-[11.5px] text-[var(--text-muted)] mt-0.5 leading-normal break-words">
|
||||
{t.message}
|
||||
</div>
|
||||
)}
|
||||
@@ -100,7 +100,7 @@ export const ToastProvider: React.FC<{ children: React.ReactNode }> = ({ childre
|
||||
className="shrink-0 text-[var(--text-dim)] hover:text-[var(--text)] p-0.5 cursor-pointer"
|
||||
aria-label="Dismiss toast"
|
||||
>
|
||||
<Icon name="X" size={12} />
|
||||
<Icon name="X" size={11} />
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user