Files
sure/app/components/DS/selectable_card.rb
Guillem Arias ec023cfe71 feat(retirement): PR4c DS::SelectableCard + bucket restyle
DS::SelectableCard — a checkbox rendered as a selectable card (whole card
toggles; brand-accent border + bg-surface when selected via peer-checked
on the sibling). Submits like a normal checkbox, so the bucket's
replace-all form is unchanged. Lookbook preview + component test.

Retirement bucket now renders each account as a DS::SelectableCard
(name · type · balance) instead of a bare checkbox row. Money stays
privacy-sensitive.
2026-05-29 12:36:53 +02:00

17 lines
588 B
Ruby

# A checkbox rendered as a selectable card: the whole card toggles, with a
# brand-accent border + check glyph when selected. Used for the retirement
# bucket account picker. Submits like a normal checkbox (name[]/value).
class DS::SelectableCard < DesignSystemComponent
attr_reader :name, :value, :title, :subtitle, :amount, :checked, :opts
def initialize(name:, value:, title:, subtitle: nil, amount: nil, checked: false, **opts)
@name = name
@value = value
@title = title
@subtitle = subtitle
@amount = amount
@checked = checked
@opts = opts
end
end