Swatch picker (PT colours)
PT colour tiles from the one backend matrix (Q23): code search, the selected tile, retired colours hidden by default (struck when shown).
Covers: swatch-picker primitive. Exports: SwatchPicker.
Anatomy
The component as it sits in the product: English, compact, real data shapes.
States
5 states, left to right, top to bottom. A mock poll never finishes, so each state is drawn on purpose.
No PT colour matches “PT-09”
Retired colours are hidden; switch them on to search them too.
Density
The phone shell is always comfortable (POWERUPS #15): 44px tap targets, 16px inputs. Compact exists on desktop only; see the desktop page.
English · 中文
Staff pick en or cn (T001 Q25). Labels arrive localised; CJK falls back to PingFang SC / Noto Sans SC.
Long string · permission denied
The long-string case (PL-063) and what a role without the permission sees (the server decides; T003).
Contract
The @rj/admin-kit API for this family. Mirrored in CONTRACT.md.
- Export
SwatchPicker·@rj/admin-kit- Props
colours·value·excludeRetired·search- States
- selected · retired · empty · loading · read-only
- shadcn / Radix
- RadioGroup (tiles)
- Accessibility
- radiogroup; each tile names code + colour
- API operations
- admin.pt-colors.matrix (exclude_retired) · admin.pt-colors.index
- Phone variant
- 3-column grid