auth

Main authentication module for my projects
git clone git://git.finwo.net/app/auth
Log | Files | Refs

commit 1ff7f46bc660431f56c2f27a3fb92e2d4a6771d8
parent 2474ef0e6b31735854af120a050fbc5b5976d695
Author: finwo <finwo@pm.me>
Date:   Wed, 11 Nov 2026 02:47:25 +0100

css: account SPA onto framework classes, apps-layer sheet (T4)

Diffstat:
Dapp/account/src/assets/account.css | 160-------------------------------------------------------------------------------
Mapp/account/src/main.ts | 2+-
Mapp/account/src/screen/apps.tsx | 2+-
Mapp/account/src/screen/overview.tsx | 132++++++++++++++++++++++++++++++++++++++-----------------------------------------
Mapp/account/src/screen/security.tsx | 10++++++----
Aapp/account/src/style/account.css | 124+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 196 insertions(+), 234 deletions(-)

diff --git a/app/account/src/assets/account.css b/app/account/src/assets/account.css @@ -1,160 +0,0 @@ -.summary-list { - display: grid; - gap: 0.25rem; - margin: 0; - padding: 0; - list-style: none; -} - -.summary-row { - display: grid; - grid-template-columns: 1.5rem minmax(0, 1fr); - align-items: center; - gap: 1rem; - padding: 0.875rem 0.75rem; - color: inherit; - text-decoration: none; - cursor: pointer; - user-select: none; -} - -.summary-row:hover, -.summary-row:active { - background: var(--row-hover); -} - -.summary-row svg { - width: 1.25rem; - height: 1.25rem; -} - -.summary-body { - display: grid; - gap: 0.125rem; - min-width: 0; -} - -.summary-title { - font-size: 0.9375rem; - font-weight: 500; - line-height: 1.4; -} - -.summary-meta { - color: var(--muted); - font-size: 0.8125rem; - line-height: 1.4; -} - -.summary-arrow { - display: none; - color: var(--muted); - font-size: 1.125rem; - line-height: 1; -} - -.security-stack, -.apps-stack { - display: grid; - gap: 1rem; - max-width: 56rem; - margin: 0 auto; -} - -.surface-row { - display: grid; - grid-template-columns: 1.5rem minmax(0, 1fr); - align-items: center; - gap: 1rem; - padding: 1rem 0.75rem; - background: var(--row); -} - -.surface-row svg { - width: 1.25rem; - height: 1.25rem; -} - -.surface-row strong { - display: block; - font-size: 0.9375rem; - font-weight: 500; - line-height: 1.4; -} - -.surface-row span { - color: var(--muted); - font-size: 0.8125rem; - line-height: 1.4; -} - -.status { - display: none; - color: var(--muted); - font-size: 0.8125rem; - line-height: 1.4; -} - -.danger-link { - display: inline-flex; - align-items: center; - min-height: 2.75rem; - padding: 0.5rem 0; - border: 0; - background: none; - color: var(--danger-text); - font: inherit; - font-size: 0.875rem; - cursor: pointer; - touch-action: manipulation; -} - -.danger-link:hover:not(:disabled) { - filter: brightness(1.1); -} - -.danger-link:disabled { - cursor: default; - opacity: 0.55; -} - -.details + .note { - margin-top: 1rem; -} - -.note + .note { - margin-top: 1rem; -} - -.panel-heading { - display: flex; - align-items: center; - gap: 0.75rem; - margin-bottom: 1rem; -} - -.panel-heading svg { - flex: none; - width: 1.25rem; - height: 1.25rem; -} - -.panel-heading h2 { - margin: 0; -} - -.skeleton-medium { - width: 62%; -} - -@media (min-width: 40em) { - .summary-row, - .surface-row { - grid-template-columns: 1.5rem minmax(0, 1fr) auto; - } - - .summary-arrow, - .status { - display: inline; - } -} diff --git a/app/account/src/main.ts b/app/account/src/main.ts @@ -3,7 +3,7 @@ import { Account, AccountCallback } from './screen/account'; import { getBasePath } from './util/api'; import '@style/global.css'; -import './assets/account.css'; +import './style/account.css'; const routes: m.RouteDefs = { '/': { diff --git a/app/account/src/screen/apps.tsx b/app/account/src/screen/apps.tsx @@ -10,7 +10,7 @@ export const AppsPage: m.Component = { subtitle="Applications with access to this account." /> - <div class="apps-stack"> + <div class="stack"> <section class="panel"> <h2>Authorized apps</h2> <p class="note">App permission management arrives in a later slice.</p> diff --git a/app/account/src/screen/overview.tsx b/app/account/src/screen/overview.tsx @@ -79,50 +79,46 @@ export const OverviewPage: m.Component<OverviewAttrs> = { <section class="panel panel-wide"> <h2>Manage</h2> - <ul class="summary-list"> - <li> - <a - class="summary-row" - href="#" - onclick={(event: Event) => { - event.preventDefault(); - m.route.set('/security'); - }} - > - {Icon(ShieldCheck)} - <span class="summary-body"> - <span class="summary-title">Security</span> - <span class="summary-meta"> - Password, multi-factor authentication and sessions. - </span> - </span> - <span class="summary-arrow" aria-hidden="true"> - {'\u203A'} - </span> - </a> - </li> - <li> - <a - class="summary-row" - href="#" - onclick={(event: Event) => { - event.preventDefault(); - m.route.set('/apps'); - }} - > - {Icon(AppWindow)} - <span class="summary-body"> - <span class="summary-title">Apps</span> - <span class="summary-meta"> - Applications with access to this account. - </span> + <div class="stack"> + <a + class="card summary-row" + href="#" + onclick={(event: Event) => { + event.preventDefault(); + m.route.set('/security'); + }} + > + {Icon(ShieldCheck)} + <span class="summary-body"> + <span class="summary-title">Security</span> + <span class="summary-meta"> + Password, multi-factor authentication and sessions. </span> - <span class="summary-arrow" aria-hidden="true"> - {'\u203A'} + </span> + <span class="summary-arrow" aria-hidden="true"> + {'\u203A'} + </span> + </a> + <a + class="card summary-row" + href="#" + onclick={(event: Event) => { + event.preventDefault(); + m.route.set('/apps'); + }} + > + {Icon(AppWindow)} + <span class="summary-body"> + <span class="summary-title">Apps</span> + <span class="summary-meta"> + Applications with access to this account. </span> - </a> - </li> - </ul> + </span> + <span class="summary-arrow" aria-hidden="true"> + {'\u203A'} + </span> + </a> + </div> </section> </div> ); @@ -184,47 +180,47 @@ export const ClientOverviewPage: m.Component<ClientOverviewAttrs> = { <section class="panel panel-wide"> <h2>Access</h2> - <dl class="details"> - <div> - <dt>Consent</dt> - <dd>{consent?.active ? 'Granted' : 'Not granted'}</dd> - </div> - <div> - <dt>Session</dt> - <dd>Active</dd> - </div> - </dl> - <p class="note"> - {consent?.active - ? `Revoking access removes ${clientName}'s consent. The app must ask again the next time it signs you in.` - : `${clientName} no longer has access to this account.`} - </p> - {consent?.active ? ( + <div class="stack"> + <dl class="details"> + <div> + <dt>Consent</dt> + <dd>{consent?.active ? 'Granted' : 'Not granted'}</dd> + </div> + <div> + <dt>Session</dt> + <dd>Active</dd> + </div> + </dl> <p class="note"> + {consent?.active + ? `Revoking access removes ${clientName}'s consent. The app must ask again the next time it signs you in.` + : `${clientName} no longer has access to this account.`} + </p> + {consent?.active ? ( <button - class="danger-link" + class="button-inline button-inline-danger" type="button" disabled={revokePending} onclick={onRevoke} > {revokePending ? 'Revoking' : 'Revoke access'} </button> - </p> - ) : null} + ) : null} + </div> </section> <section class="panel panel-wide"> <h2>Full account management</h2> - <p class="note"> - Manage your identity, security and app permissions on the account host. - </p> - {fullAccountUrl ? ( + <div class="stack"> <p class="note"> - <a class="button" href={fullAccountUrl}> + Manage your identity, security and app permissions on the account host. + </p> + {fullAccountUrl ? ( + <a class="button button-primary" href={fullAccountUrl}> Open full account </a> - </p> - ) : null} + ) : null} + </div> </section> </div> ); diff --git a/app/account/src/screen/security.tsx b/app/account/src/screen/security.tsx @@ -21,7 +21,7 @@ export const SecurityPage: m.Component = { subtitle="Manage how you sign in and where this account is active." /> - <div class="security-stack"> + <div class="stack"> <section class="panel"> {PanelHeading(KeyRound, 'Password')} <p class="note">Password management arrives in a later slice.</p> @@ -47,10 +47,12 @@ export const SecurityPage: m.Component = { <div class="surface-row"> {Icon(Monitor)} <span> - <strong>Current session</strong> - <span>account {'\u00B7'} This device {'\u00B7'} Active</span> + <strong class="surface-title">Current session</strong> + <span class="surface-meta"> + account {'\u00B7'} This device {'\u00B7'} Active + </span> </span> - <span class="status">Read-only</span> + <span class="status surface-state">Read-only</span> </div> <p class="note">Session revocation arrives in a later slice.</p> </section> diff --git a/app/account/src/style/account.css b/app/account/src/style/account.css @@ -0,0 +1,124 @@ +@layer apps { + /* overview panel pair: one column, two-up at desktop */ + .grid { + display: grid; + grid-template-columns: minmax(0, 1fr); + gap: var(--space-4); + } + + /* manage rows: framework .card supplies surface, padding, shadow */ + .summary-row { + display: grid; + grid-template-columns: var(--space-6) minmax(0, 1fr); + align-items: center; + gap: var(--space-4); + color: inherit; + text-decoration: none; + cursor: pointer; + user-select: none; + } + + .summary-row:hover, + .summary-row:active { + background: var(--line-strong); + } + + .summary-row svg { + width: var(--space-5); + height: var(--space-5); + } + + .summary-body { + display: grid; + gap: var(--space-1); + min-width: 0; + } + + .summary-title { + font-size: var(--font-md); + font-weight: 500; + line-height: var(--lh-snug); + } + + .summary-meta { + color: var(--muted); + font-size: var(--font-sm); + line-height: var(--lh-snug); + } + + .summary-arrow { + display: none; + color: var(--muted); + font-size: var(--font-xl); + line-height: 1; + } + + .panel-heading { + display: flex; + align-items: center; + gap: var(--space-3); + margin-block-end: var(--space-4); + } + + .panel-heading svg { + flex: none; + width: var(--space-5); + height: var(--space-5); + } + + .panel-heading h2 { + margin: 0; + } + + /* device surface rows inside panels */ + .surface-row { + display: grid; + grid-template-columns: var(--space-6) minmax(0, 1fr); + align-items: center; + gap: var(--space-4); + padding: var(--space-4) var(--space-3); + background: var(--line); + } + + .surface-row svg { + width: var(--space-5); + height: var(--space-5); + } + + .surface-title { + display: block; + font-size: var(--font-md); + font-weight: 500; + line-height: var(--lh-snug); + } + + .surface-meta { + display: block; + color: var(--muted); + font-size: var(--font-sm); + line-height: var(--lh-snug); + } + + .surface-state { + grid-column: 2; + } + + @media (min-width: 40em) { + .grid { + grid-template-columns: repeat(2, minmax(0, 1fr)); + } + + .summary-row, + .surface-row { + grid-template-columns: var(--space-6) minmax(0, 1fr) auto; + } + + .summary-arrow { + display: inline; + } + + .surface-state { + grid-column: 3; + } + } +}