Add a DS::Pill component
We don't have a shared pill/badge component in the DS namespace, so pill-shaped UI is reinvented across many partials with inconsistent classes. A few callsites also break the design-token rule (text-green-500 instead of text-success) and a few have failing WCAG AA contrast (text-on-own-tint pattern).
Proposed API
DS::Pill.new(
variant: :neutral | :success | :warning | :error,
label: String,
dot: true | false, # coloured semantic dot
size: :sm | :md
)
Default visual (variant A from the contrast review): bg-surface-inset text-primary + a small coloured dot when dot: true. The dot carries the semantic meaning, the label sits in the high-contrast neutral pill — ships AA contrast for free, matches the existing _maturity_badge look.
Callsites to consolidate
Pill markup in the wild today:
app/views/settings/providers/_status_pill.html.erb
app/views/settings/providers/_maturity_badge.html.erb
app/views/shared/_badge.html.erb (uses raw text-green-500 etc — also breaks DS-token rule)
app/views/shared/_color_badge.html.erb
app/views/categories/_badge.html.erb
app/views/accounts/_tax_treatment_badge.html.erb (+ inline twin in app/views/reports/_investment_performance.html.erb:121)
app/views/import/qif_category_selections/show.html.erb:86 (inline, low contrast)
app/views/sophtron_items/_sophtron_item.html.erb:26 (inline, low contrast)
app/views/transactions/_transaction.html.erb (lines 92, 101, 106, 115 — pending / review-recommended / potential-duplicate / split badges)
app/views/transactions/_split_parent_row.html.erb:39
app/views/transactions/_header.html.erb:25
app/views/transactions/_transfer_match.html.erb (lines 9, 12)
app/views/transactions/searches/filters/_badge.html.erb
app/views/investment_activity/_badge.html.erb
app/views/investment_activity/_quick_edit_badge.html.erb:52
app/views/simplefin_items/_activity_badge.html.erb
app/views/budget_categories/_budget_category.html.erb:71
app/views/settings/preferences/show.html.erb (lines 65, 70, 170)
Out of scope
The immediate WCAG AA contrast fix on the providers settings status pill ships in PR #1710 by switching _status_pill to the variant-A look using existing tokens. This issue is the broader DS work to extract + unify.
Acceptance
Add a
DS::PillcomponentWe don't have a shared pill/badge component in the DS namespace, so pill-shaped UI is reinvented across many partials with inconsistent classes. A few callsites also break the design-token rule (
text-green-500instead oftext-success) and a few have failing WCAG AA contrast (text-on-own-tint pattern).Proposed API
Default visual (variant A from the contrast review):
bg-surface-inset text-primary+ a small coloured dot whendot: true. The dot carries the semantic meaning, the label sits in the high-contrast neutral pill — ships AA contrast for free, matches the existing_maturity_badgelook.Callsites to consolidate
Pill markup in the wild today:
app/views/settings/providers/_status_pill.html.erbapp/views/settings/providers/_maturity_badge.html.erbapp/views/shared/_badge.html.erb(uses rawtext-green-500etc — also breaks DS-token rule)app/views/shared/_color_badge.html.erbapp/views/categories/_badge.html.erbapp/views/accounts/_tax_treatment_badge.html.erb(+ inline twin inapp/views/reports/_investment_performance.html.erb:121)app/views/import/qif_category_selections/show.html.erb:86(inline, low contrast)app/views/sophtron_items/_sophtron_item.html.erb:26(inline, low contrast)app/views/transactions/_transaction.html.erb(lines 92, 101, 106, 115 — pending / review-recommended / potential-duplicate / split badges)app/views/transactions/_split_parent_row.html.erb:39app/views/transactions/_header.html.erb:25app/views/transactions/_transfer_match.html.erb(lines 9, 12)app/views/transactions/searches/filters/_badge.html.erbapp/views/investment_activity/_badge.html.erbapp/views/investment_activity/_quick_edit_badge.html.erb:52app/views/simplefin_items/_activity_badge.html.erbapp/views/budget_categories/_budget_category.html.erb:71app/views/settings/preferences/show.html.erb(lines 65, 70, 170)Out of scope
The immediate WCAG AA contrast fix on the providers settings status pill ships in PR #1710 by switching
_status_pillto the variant-A look using existing tokens. This issue is the broader DS work to extract + unify.Acceptance
DS::PillViewComponent + Lookbook previewtext-green-500etc) remain in pill callsites