- 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
40 lines
1.3 KiB
TypeScript
40 lines
1.3 KiB
TypeScript
import { cn } from '@/lib/utils';
|
|
import React from 'react';
|
|
|
|
interface TextProps extends React.HTMLAttributes<HTMLElement> {
|
|
as?: 'h1' | 'h2' | 'h3' | 'h4' | 'p' | 'span' | 'label' | 'code' | 'div';
|
|
variant?: 'h1' | 'h2' | 'h3' | 'body' | 'muted' | 'dim' | 'label' | 'code' | 'badge';
|
|
children: React.ReactNode;
|
|
}
|
|
|
|
export const Text: React.FC<TextProps> = ({
|
|
as: Component = 'p',
|
|
variant = 'body',
|
|
className,
|
|
children,
|
|
...props
|
|
}) => {
|
|
const variantStyles = {
|
|
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 (
|
|
<Component
|
|
className={cn(variantStyles[variant], className)}
|
|
{...props}
|
|
>
|
|
{children}
|
|
</Component>
|
|
);
|
|
};
|
|
|
|
export default Text;
|