feat(list-selectable): add cornerTag prop with Highlight Corner Tag (MR-490)#1240
Conversation
…MR-490) Adds support for the Highlight Corner Tag in ListSelectable, ListReadOnly and the shared ListContainer. The new CornerTag component lives as an internal subcomponent under src/CornerTag (not exported publicly in this release) and is rendered as an overlay at the top-right corner of card containers. - New CornerTag component with primaryDown/complementaryPure colors - ListSelectable receives a cornerTag prop via discriminated union: only allowed when type='card'; type='text' sets cornerTag?: never to block at compile-time - ListContainer renders CornerTag conditionally for type='card' - ListReadOnly accepts and forwards cornerTag (covers isSelectableDisabled) - New stories cover all V-02..V-14 variants from the spec - Unit tests cover CornerTag standalone + 16 ListSelectable variants - SCSS uses tokens: $color-brand-primary-down / $color-complementary-pure Spec: https://github.com/Pagnet/pagnet/issues/16178#issuecomment-4343595459 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The smallest token in @useblu/ocean-tokens is $font-size-xxxs (12px), but the Figma spec for the Highlight Corner Tag is 10px. Following the existing precedent in _tag.scss and _badge.scss, hardcode the 10px literal until a new token is added to the tokens package. Also adds line-height: 100% to match the Figma typography spec exactly. Follow-up: open issue/PR in ocean-ds/ocean-tokens to add a $font-size-xxxxs (10px) token; once available, replace the hardcoded values in this file plus _tag.scss and _badge.scss. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
|
Heads-up sobre paridade visual com o Figma Durante a revisão deste PR, percebemos que a borda do card do Essa divergência é pré-existente ao MR-490 (não foi introduzida aqui), e afeta todos os consumidores de 🔗 #1242 — Recomendação: mergear este PR (#1240) primeiro com a Corner Tag, e o #1242 logo em sequência para alinhar a borda com o Figma. Não é bloqueante — os dois podem ser revisados em paralelo e mergeados em qualquer ordem. |
|
Fechando para recriar a partir de branch direto no repo principal — assim o Chromatic publica o preview visual automaticamente (PRs de fork não conseguem usar os secrets do CI). Vou abrir um novo PR equivalente em seguida. Nada mudou no código. |



Summary
Adds support for the Highlight Corner Tag in
ListSelectable(andListReadOnlyviaisSelectableDisabled). The newCornerTaglives as an internal subcomponent undersrc/CornerTag/(not exported publicly in this release) and is rendered as an overlay at the top-right corner of card containers.CornerTagcomponent withprimaryDown/complementaryPurecolors (tokens:$color-brand-primary-down/$color-complementary-pure)ListSelectablereceives a newcornerTagprop via discriminated union: only allowed whentype='card';type='text'setscornerTag?: neverto block at compile-time (per spec OQ-S6 — no runtime warns)ListContainerrendersCornerTagconditionally fortype='card'(single source of truth)ListReadOnlyaccepts and forwardscornerTag(coversisSelectableDisabledflow)CornerTagstandalone + 16ListSelectablevariantsSpec & PRD
API contract
type='text'+cornerTagis blocked by TypeScript (discriminated union).Test plan
yarn lint— zero errors on changed filesyarn jest(ocean-react) — 722/722 passing, 64 suites, zero regressionsaria-label, norole="status", reading order after card contentDecisions resolved during the spec
cornerTagis a discriminated-union prop —type='text'blocks usage at compile-timeCornerTagis internal-only (not exported insrc/index.tsthis release; future export is a follow-up when consumers likeCardGroupneed it)$color-brand-primary-down,$color-complementary-pure,$font-family-base,$font-weight-extrabold,$font-size-xxxsListContainer(shared) is the single source of truth —ListSelectableandListReadOnlyboth inherit support automatically🤖 Generated with Claude Code