mirror of
https://github.com/we-promise/sure.git
synced 2026-05-30 07:49:01 +00:00
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.
17 lines
588 B
Ruby
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
|