Feature/brutalism overhaul #10

Merged
ilia merged 9 commits from feature/brutalism-overhaul into main 2026-07-14 07:40:18 +00:00
Showing only changes of commit f8d13193ea - Show all commits
+12 -12
View File
@@ -1,14 +1,10 @@
import type { ReactNode } from 'react'; import type { ComponentPropsWithoutRef } from 'react';
import { cn } from '$shared/lib'; import { cn } from '$shared/lib';
export type BadgeVariant = 'default' | 'primary' | 'secondary' | 'outline'; export type BadgeVariant = 'default' | 'primary' | 'secondary' | 'outline';
export type BadgeSize = 'xs' | 'sm' | 'md'; export type BadgeSize = 'xs' | 'sm' | 'md';
interface Props { interface Props extends Pick<ComponentPropsWithoutRef<'span'>, 'children' | 'className' | 'style'> {
/**
* Badge content
*/
children: ReactNode;
/** /**
* Visual variant * Visual variant
* @default 'default' * @default 'default'
@@ -19,10 +15,6 @@ interface Props {
* @default 'sm' * @default 'sm'
*/ */
size?: BadgeSize; size?: BadgeSize;
/**
* Additional CSS classes
*/
className?: string;
} }
const VARIANTS: Record<BadgeVariant, string> = { const VARIANTS: Record<BadgeVariant, string> = {
@@ -41,9 +33,17 @@ const SIZES: Record<BadgeSize, string> = {
/** /**
* Small label for categorization or status. * Small label for categorization or status.
*/ */
export function Badge({ children, variant = 'default', size = 'sm', className }: Props) { export function Badge({ children, variant = 'default', size = 'sm', className, ...rest }: Props) {
return ( return (
<span className={cn('inline-block uppercase tracking-wider', SIZES[size], VARIANTS[variant], className)}> <span
className={cn(
'inline-flex items-center leading-none uppercase tracking-wider',
SIZES[size],
VARIANTS[variant],
className,
)}
{...rest}
>
{children} {children}
</span> </span>
); );