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.
14 lines
339 B
Ruby
14 lines
339 B
Ruby
class DS::SelectableCardPreview < ViewComponent::Preview
|
|
# @param checked toggle
|
|
def default(checked: true)
|
|
render DS::SelectableCard.new(
|
|
name: "bucket[account_ids][]",
|
|
value: "abc",
|
|
title: "Vanguard FTSE All-World (VWCE)",
|
|
subtitle: "ETF",
|
|
amount: "$115,000",
|
|
checked: checked
|
|
)
|
|
end
|
|
end
|