Description
The contentlet status badge component dot-contentlet-status-chip (core-web/libs/ui/src/lib/components/dot-contentlet-status-chip/) currently wraps PrimeNG p-chip and hardcodes status colors with Tailwind !important overrides (bg-green-100! text-green-700!, etc.) via an @switch in the template. This has several problems:
p-chip has no severity API, so colors fight the PrimeNG theme with ! overrides.
- Neither
p-chip nor p-tag has a size API, and the status badge is rendered at different text sizes depending on the host component.
- The current compact sizing relies on a global CSS override on
.p-chip in CustomLaraPreset (core-web/libs/ui/src/lib/theme/theme.config.ts), which affects every chip in the app.
Decision: keep the wrapper component (its ~10 consumers stay untouched), but internally replace p-chip with p-tag using native severity, and add a size input whose compact variant is styled via design tokens in CustomLaraPreset.
Status → severity mapping
| Status |
Severity |
Current color |
| Published |
success |
green |
| Archived |
danger |
red |
| Revision |
info |
blue |
| New (state is null) |
info |
blue |
| Draft / default |
warn |
yellow |
Scope
-
dot-contentlet-status-chip.component.ts / .html
- Replace
ChipModule with TagModule (primeng/tag).
- Replace the
@switch of Tailwind classes with a single <p-tag [severity]="severity()" [value]="label()" />; severity computed from the existing DotContentletStatusPipe result (pipe unchanged).
- New input:
size = input<'small' | 'normal'>('small') — default small preserves the current compact look (text-xs) for all consumers. small applies a p-tag-sm modifier class.
- Keep the
'New' | dm translated label for the null-state case (current behavior).
-
core-web/libs/ui/src/lib/theme/theme.config.ts
- Add a
tag block under components: .p-tag-sm variant via components.tag.css using design tokens (dt(...) / spacing), following the existing chip block precedent. PrimeNG styling lives in the JS preset, not SCSS.
- Update the
chip block comment that mentions "Content Status" (no longer applies once status uses p-tag).
-
Tests — update dot-contentlet-status-chip.component.spec.ts for severity-per-status and size-class assertions.
Out of scope
- Renaming the selector to
dot-contentlet-status-tag (cosmetic; would touch 10+ consumer files).
- Changing any consumer (content drive, dot-pages, templates, containers, block editor, asset search, es-search, edit-content sidebar). Contexts needing larger text will opt into
size="normal" later.
Acceptance Criteria
Priority
Medium
Additional Context
- Existing
p-tag usages in the repo (analytics tables, experiments header) confirm the severity API is already in use.
- The global
.p-chip compact CSS in the preset stays for the remaining chip use cases (locale, relationships); status badges stop depending on it.
- Verify visually in: Pages table, Content Drive list view, Edit Content sidebar, block editor contentlet card.
Description
The contentlet status badge component
dot-contentlet-status-chip(core-web/libs/ui/src/lib/components/dot-contentlet-status-chip/) currently wraps PrimeNGp-chipand hardcodes status colors with Tailwind!importantoverrides (bg-green-100! text-green-700!, etc.) via an@switchin the template. This has several problems:p-chiphas noseverityAPI, so colors fight the PrimeNG theme with!overrides.p-chipnorp-taghas asizeAPI, and the status badge is rendered at different text sizes depending on the host component..p-chipinCustomLaraPreset(core-web/libs/ui/src/lib/theme/theme.config.ts), which affects every chip in the app.Decision: keep the wrapper component (its ~10 consumers stay untouched), but internally replace
p-chipwithp-tagusing nativeseverity, and add asizeinput whose compact variant is styled via design tokens inCustomLaraPreset.Status → severity mapping
successdangerinfoinfowarnScope
dot-contentlet-status-chip.component.ts/.htmlChipModulewithTagModule(primeng/tag).@switchof Tailwind classes with a single<p-tag [severity]="severity()" [value]="label()" />; severity computed from the existingDotContentletStatusPiperesult (pipe unchanged).size = input<'small' | 'normal'>('small')— defaultsmallpreserves the current compact look (text-xs) for all consumers.smallapplies ap-tag-smmodifier class.'New' | dmtranslated label for the null-state case (current behavior).core-web/libs/ui/src/lib/theme/theme.config.tstagblock undercomponents:.p-tag-smvariant viacomponents.tag.cssusing design tokens (dt(...)/ spacing), following the existingchipblock precedent. PrimeNG styling lives in the JS preset, not SCSS.chipblock comment that mentions "Content Status" (no longer applies once status usesp-tag).Tests — update
dot-contentlet-status-chip.component.spec.tsfor severity-per-status and size-class assertions.Out of scope
dot-contentlet-status-tag(cosmetic; would touch 10+ consumer files).size="normal"later.Acceptance Criteria
p-tagwith nativeseverityper the mapping table above (Published→success, Archived→danger, Revision→info, Draft→warn).stateisnull, the tag shows the translatedNewlabel ('New' | dm) withinfoseverity.sizeinput ('small' | 'normal') defaults to'small';smallapplies thep-tag-smmodifier class,normalrenders PrimeNG's default tag size.!importantcolor overrides remain in the component template.CustomLaraPreset(theme.config.ts) defines thep-tag-smvariant viacomponents.tag.cssusing design tokens; the stale "Content Status" reference in thechipblock comment is updated.dot-contentlet-status-chip.component.spec.tscovers severity per status (including null → New/info) and both size variants;yarn nx test ui --testPathPattern=dot-contentlet-status-chippasses.Priority
Medium
Additional Context
p-tagusages in the repo (analytics tables, experiments header) confirm the severity API is already in use..p-chipcompact CSS in the preset stays for the remaining chip use cases (locale, relationships); status badges stop depending on it.