forked from koshikraj/ottopus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchip.tsx
More file actions
27 lines (26 loc) · 987 Bytes
/
Copy pathchip.tsx
File metadata and controls
27 lines (26 loc) · 987 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import type { HTMLAttributes } from 'react'
import { cn } from '@/lib/cn'
/**
* A neutral chip carries a fact — a chain, a device, a wallet kind.
*
* Deliberately not the same component as Badge or StatusChip: those carry
* state, and the design system is explicit that "neutral chips carry facts,
* state chips carry state and nothing else". Conflating them lets a fact borrow
* the visual weight of a warning.
*
* Facts use the small radius; state uses the pill. Neither is ever a clickable
* filter — a chip that looks pressable implies a filter that does not exist.
*/
export function Chip({ className, ...props }: HTMLAttributes<HTMLSpanElement>) {
return (
<span
className={cn(
'inline-flex w-fit items-center gap-1.5 rounded-[var(--ot-radius-sm)]',
'bg-[var(--ot-surface-3)] px-2.5 py-1 text-[12px] font-medium leading-none',
'whitespace-nowrap text-[var(--ot-text-2)]',
className,
)}
{...props}
/>
)
}