mirror of
https://github.com/we-promise/sure.git
synced 2026-07-12 04:45:19 +00:00
* refactor(settings): header-less settings_section variant + migrate guides
Add a title:nil branch to settings_section so a page can route through the one
canonical surface recipe (bg-container shadow-border-xs rounded-xl p-4 space-y-4)
without a section header. No visual change to existing titled callers.
Migrate the guides page onto it: replace the hand-rolled card + hardcoded
'Guides' page title with settings_section + t('.page_title') (new locale key).
First step of the settings design-consistency pass.
* refactor(family-exports): un-nest exports list
The exports list rendered 'Exports' three times (page h1 + settings_section
title + inset count header) inside three stacked surfaces (section card >
bg-container-inset > inner bg-container table card). Flatten it:
- settings_section header-less (drop the duplicate title; the page h1 + the
inset count header already label it),
- drop the redundant inner space-y-4 wrapper,
- table sits directly in the inset (remove the inner bg-container card).
Now: one title, one card, one inset.
* refactor(settings): payments + appearances consistency
- payments: subscription summary row was bg-container inside the section's
bg-container (container-on-container) -> bg-container-inset + p-4.
- appearances: toggle-row labels used <h4> (heading-level break inside a
settings_section) -> <p font-medium>.
* refactor(settings): preferences consistency
- month_start_day warning: text-warning bg-warning/10 colored-body-text box
-> DS::Alert(:warning) (neutral-text recipe).
- preview-features block: hand-rolled <section bg-container shadow-border-xs
rounded-xl p-4> -> header-less settings_section (canonical surface).
- toggle-row <h4> -> <p font-medium>; text-[11px] base-currency badge -> text-xs.
* refactor(settings): profiles consistency
- unconfirmed-email notice was hardcoded English -> i18n
(unconfirmed_email_notice_html + resend_confirmation_link keys).
- role + pending chips: bespoke 'rounded-md bg-surface px-1.5 py-0.5 uppercase'
pills -> DS::Pill (tone: gray, badge mode).
- pending-invitation row border: border-alpha-black-25 -> shadow-border-xs
(match the member-row token).
52 lines
1.9 KiB
Plaintext
52 lines
1.9 KiB
Plaintext
<%# locals: (title:, subtitle: nil, content:, collapsible: false, open: true, auto_open_param: nil, status: nil, meta: nil, actions: nil, badge: nil) %>
|
|
<% if collapsible %>
|
|
<%= render DS::Disclosure.new(
|
|
variant: :card,
|
|
open: open,
|
|
data: auto_open_param.present? ? { controller: "auto-open", auto_open_param_value: auto_open_param } : nil
|
|
) do |disclosure| %>
|
|
<% disclosure.with_summary_content do %>
|
|
<div class="flex items-center justify-between gap-2 w-full">
|
|
<div class="flex items-center gap-2">
|
|
<%= icon "chevron-right", class: "text-secondary group-open:rotate-90 motion-safe:transition-transform motion-safe:duration-150" %>
|
|
<div>
|
|
<div class="flex items-center gap-2 flex-wrap">
|
|
<h2 class="text-lg font-medium text-primary"><%= title %></h2>
|
|
<%= badge if badge.present? %>
|
|
</div>
|
|
<% if subtitle.present? %>
|
|
<p class="text-secondary text-sm"><%= subtitle %></p>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
<% if status.present? %>
|
|
<div class="flex items-center gap-2 shrink-0 group-open:hidden">
|
|
<% if meta.present? %>
|
|
<span class="text-xs text-subdued"><%= meta %></span>
|
|
<% end %>
|
|
<%= status %>
|
|
<%= actions if actions.present? %>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|
|
<div class="space-y-4 mt-4">
|
|
<%= content %>
|
|
</div>
|
|
<% end %>
|
|
<% else %>
|
|
<section class="bg-container shadow-border-xs rounded-xl p-4 space-y-4">
|
|
<% if title.present? %>
|
|
<div>
|
|
<h2 class="text-lg font-medium text-primary"><%= title %></h2>
|
|
<% if subtitle.present? %>
|
|
<p class="text-secondary text-sm mt-1"><%= subtitle %></p>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|
|
<div class="space-y-4">
|
|
<%= content %>
|
|
</div>
|
|
</section>
|
|
<% end %>
|