feat(scraps): interactive Chip compound components (#121648)
Expands the `Chip` API so callers can interact with the individual
`property` / `operator` / `value` / close sections, while keeping the
existing flat string API fully backward compatible.
```tsx
<Chip.Root size="sm"> {/* focus: "auto" (default) | "manual" */}
<Chip.Property onClick={editKey}>{key}</Chip.Property>
<Chip.Operator onClick={editOperator}>{operator}</Chip.Operator>
<Chip.Value onClick={editValue}>{value}</Chip.Value>
<Chip.Dismiss onClick={remove} />
</Chip.Root>
```
- **Sections** render inert `Text` by default and become focusable
`<button>`s when given `onClick` (or `interactive`). They accept
`React.ButtonHTMLAttributes` + `ref` + rich `ReactNode` children, so
external props (grid cell props, react-aria props) spread straight
through.
- **Interactive states** use `tokens.interactive.transparent.neutral.*`
(rest / hover / active) with `theme.focusRing()` on `:focus-visible`;
text keeps the chonky embossed content tokens.
- **Roving focus by default** (`focus="auto"`): a single tab stop enters
the chip; ArrowLeft/Right + Home/End move between sections.
- **`focus="manual"`** escape hatch: the chip installs no tabindex/key
handling so an outer system (e.g. the SearchQueryBuilder grid) keeps
full control of focus.
- **`Chip.Dismiss`** stops its click from bubbling; suppressed when
`readonly`.
- `<Chip property="…" operator="…" value="…" onDismiss>` still works and
is now built on the compound parts.
Stacked on top of #121345 N
Nate Moore committed
b49a3ef8ebb9efaa714adac279ba54c9de7f9e34
Parent: fe4bd53
Committed by GitHub <noreply@github.com>
on 8/28/2026, 5:24:34 PM