feat(design): add IMS Admin primitives (Button, StatusTag, Checkbox, FilterChip, Segmented, Avatar, Drawer) and restyle Field, Card, Modal
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import type { ReactNode } from 'react'
|
||||
import { cx } from './cx'
|
||||
|
||||
export function Segmented({
|
||||
value,
|
||||
onChange,
|
||||
options,
|
||||
}: {
|
||||
value: string
|
||||
onChange: (v: string) => void
|
||||
options: Array<{ value: string; label: ReactNode }>
|
||||
}) {
|
||||
return (
|
||||
<div className="inline-flex p-0.5 rounded-[10px] bg-rule-2">
|
||||
{options.map(o => (
|
||||
<button
|
||||
key={o.value}
|
||||
type="button"
|
||||
aria-pressed={o.value === value}
|
||||
onClick={() => onChange(o.value)}
|
||||
className={cx(
|
||||
'inline-flex items-center gap-1.5 px-2.5 py-[5px] rounded-md text-[13px] cursor-pointer whitespace-nowrap',
|
||||
o.value === value ? 'bg-surface font-semibold shadow-sm' : 'text-ink-3',
|
||||
)}
|
||||
>
|
||||
{o.label}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user