Something went wrong. Try again.
Monorepo for Tangled tangled.org
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667import type { ComponentChildren } from "preact";import { Row } from "./layout";import { CHIP, COLORS, TYPOGRAPHY } from "./constants";import type { LucideIcon } from "../../icons/lucide";
interface ChipProps { children?: ComponentChildren; paddingLeft?: number; paddingRight?: number;}
export function Chip({ children, paddingLeft = 22, paddingRight = 22,}: ChipProps) { return ( <div style={{ display: "flex", height: CHIP.height, padding: CHIP.border, borderRadius: CHIP.radius, backgroundColor: COLORS.chip.background, backgroundImage: COLORS.chip.stroke, boxShadow: COLORS.chip.shadow, }}> <Row style={{ flexGrow: 1, gap: 14, paddingLeft, paddingRight, borderRadius: CHIP.radius - CHIP.border, backgroundColor: COLORS.chip.background, boxShadow: COLORS.chip.innerShadow, }}> {children} </Row> </div> );}
interface IconChipProps { Icon: LucideIcon; maxWidth?: number; children?: ComponentChildren;}
export function IconChip({ Icon, maxWidth = 440, children }: IconChipProps) { return ( <Chip> <Icon size={32} color={COLORS.icon} /> <span style={{ ...TYPOGRAPHY.body, color: COLORS.text, display: "block", lineClamp: 1, maxWidth, }}> {children} </span> </Chip> );}