feat(ext/setup): apply polish vocabulary to setup wizard

- Wraps setup content in .surface-backdrop
- Each wizard step gets a .glass card
- Mode-picker cards become glass cards
- 'next' / 'continue' buttons get the ▸ glyph
- Migrate from .btn .btn-primary to the new .btn-primary class
This commit is contained in:
adlee-was-taken
2026-05-02 14:52:14 -04:00
parent 7371eff0bb
commit 97e351fa61

View File

@@ -16,6 +16,7 @@ import {
STRENGTH_LABELS, STRENGTH_LABELS,
entropyText, entropyText,
} from './setup-helpers'; } from './setup-helpers';
import { GLYPH_NEXT } from '../shared/glyphs';
import type { VaultConfig } from '../shared/types'; import type { VaultConfig } from '../shared/types';
import type { SessionHandle } from 'relicario-wasm'; import type { SessionHandle } from 'relicario-wasm';
@@ -189,6 +190,7 @@ function render(): void {
} }
app.innerHTML = ` app.innerHTML = `
<div class="surface-backdrop" style="min-height:100vh;">
<div class="pad" style="padding-top:12px;"> <div class="pad" style="padding-top:12px;">
<img class="brand-logo" src="icons/relicario-logo.svg" alt="" style="margin-bottom:12px;"> <img class="brand-logo" src="icons/relicario-logo.svg" alt="" style="margin-bottom:12px;">
<div class="brand" style="margin-bottom:4px;">Relicario vault setup</div> <div class="brand" style="margin-bottom:4px;">Relicario vault setup</div>
@@ -196,6 +198,7 @@ function render(): void {
${state.error ? `<div class="error">${escapeHtml(state.error)}</div>` : ''} ${state.error ? `<div class="error">${escapeHtml(state.error)}</div>` : ''}
${stepHtml} ${stepHtml}
</div> </div>
</div>
`; `;
switch (state.step) { switch (state.step) {
@@ -214,20 +217,20 @@ function renderStep0(): string {
const isNew = state.mode === 'new'; const isNew = state.mode === 'new';
const isAttach = state.mode === 'attach'; const isAttach = state.mode === 'attach';
return ` return `
<div class="wizard-step"> <div class="wizard-step glass" style="padding: 24px; margin-top: 16px;">
<h3>set up Relicario</h3> <h3>set up Relicario</h3>
<p class="muted" style="margin-bottom:16px;"> <p class="muted" style="margin-bottom:16px;">
How are you using Relicario on this device? How are you using Relicario on this device?
</p> </p>
<div class="mode-cards"> <div class="mode-cards">
<button class="mode-card ${isNew ? 'active' : ''}" data-mode="new"> <button class="mode-card glass ${isNew ? 'active' : ''}" data-mode="new">
<div class="mode-card-title">create new vault</div> <div class="mode-card-title">create new vault</div>
<p class="mode-card-blurb"> <p class="mode-card-blurb">
I'm setting up Relicario for the first time. This will create a fresh I'm setting up Relicario for the first time. This will create a fresh
encrypted vault on a new or empty git repository. encrypted vault on a new or empty git repository.
</p> </p>
</button> </button>
<button class="mode-card ${isAttach ? 'active' : ''}" data-mode="attach"> <button class="mode-card glass ${isAttach ? 'active' : ''}" data-mode="attach">
<div class="mode-card-title">attach this device</div> <div class="mode-card-title">attach this device</div>
<p class="mode-card-blurb"> <p class="mode-card-blurb">
I already have a vault on another device. Connect this browser to it I already have a vault on another device. Connect this browser to it
@@ -236,7 +239,7 @@ function renderStep0(): string {
</button> </button>
</div> </div>
<div class="form-actions" style="margin-top:24px;"> <div class="form-actions" style="margin-top:24px;">
<button class="btn btn-primary" id="next-btn" ${state.mode ? '' : 'disabled'}>next</button> <button class="btn-primary" id="next-btn" ${state.mode ? '' : 'disabled'}>next ${GLYPH_NEXT}</button>
</div> </div>
</div> </div>
`; `;
@@ -267,7 +270,7 @@ function renderStep3Attach(): string {
const gateDisabled = state.attaching || !p || !hasImage; const gateDisabled = state.attaching || !p || !hasImage;
return ` return `
<div class="wizard-step"> <div class="wizard-step glass" style="padding: 24px; margin-top: 16px;">
<h3>attach this device</h3> <h3>attach this device</h3>
<p class="muted" style="margin-bottom:12px;"> <p class="muted" style="margin-bottom:12px;">
Use your existing passphrase and reference image to attach this browser Use your existing passphrase and reference image to attach this browser
@@ -430,7 +433,7 @@ function renderStep1(): string {
`; `;
return ` return `
<div class="wizard-step"> <div class="wizard-step glass" style="padding: 24px; margin-top: 16px;">
<h3>choose host</h3> <h3>choose host</h3>
<div class="form-group"> <div class="form-group">
<label class="label">host type</label> <label class="label">host type</label>
@@ -442,7 +445,7 @@ function renderStep1(): string {
${state.hostType === 'gitea' ? giteaInstructions : githubInstructions} ${state.hostType === 'gitea' ? giteaInstructions : githubInstructions}
<div class="form-actions"> <div class="form-actions">
<button class="btn" id="back-btn">back</button> <button class="btn" id="back-btn">back</button>
<button class="btn btn-primary" id="next-btn">next</button> <button class="btn-primary" id="next-btn">next ${GLYPH_NEXT}</button>
</div> </div>
</div> </div>
`; `;
@@ -522,7 +525,7 @@ function renderStep2(): string {
!!probe && ((state.mode === 'new' && probe.exists) || (state.mode === 'attach' && !probe.exists)); !!probe && ((state.mode === 'new' && probe.exists) || (state.mode === 'attach' && !probe.exists));
const nextDisabled = !state.connectionTested || !probe || modeMismatch; const nextDisabled = !state.connectionTested || !probe || modeMismatch;
return ` return `
<div class="wizard-step"> <div class="wizard-step glass" style="padding: 24px; margin-top: 16px;">
<h3>configure connection</h3> <h3>configure connection</h3>
<div class="form-group" ${state.hostType === 'github' ? 'style="display:none;"' : ''}> <div class="form-group" ${state.hostType === 'github' ? 'style="display:none;"' : ''}>
<label class="label" for="host-url">host url</label> <label class="label" for="host-url">host url</label>
@@ -543,7 +546,7 @@ function renderStep2(): string {
${renderProbeBanner()} ${renderProbeBanner()}
<div class="form-actions" style="margin-top:12px;"> <div class="form-actions" style="margin-top:12px;">
<button class="btn" id="back-btn">back</button> <button class="btn" id="back-btn">back</button>
<button class="btn btn-primary" id="next-btn" ${nextDisabled ? 'disabled' : ''}>next</button> <button class="btn-primary" id="next-btn" ${nextDisabled ? 'disabled' : ''}>next ${GLYPH_NEXT}</button>
</div> </div>
</div> </div>
`; `;
@@ -643,7 +646,7 @@ function renderStep3New(): string {
const counterText = nChars === 0 ? '' : `${nChars} character${nChars === 1 ? '' : 's'}`; const counterText = nChars === 0 ? '' : `${nChars} character${nChars === 1 ? '' : 's'}`;
return ` return `
<div class="wizard-step"> <div class="wizard-step glass" style="padding: 24px; margin-top: 16px;">
<h3>create vault</h3> <h3>create vault</h3>
<div class="form-group"> <div class="form-group">
@@ -907,7 +910,7 @@ function renderStep4(): string {
const defaultName = state.deviceName || `${browser} on ${os}`; const defaultName = state.deviceName || `${browser} on ${os}`;
return ` return `
<div class="wizard-step"> <div class="wizard-step glass" style="padding: 24px; margin-top: 16px;">
<h3>name this device</h3> <h3>name this device</h3>
<p class="muted" style="margin-bottom:12px;"> <p class="muted" style="margin-bottom:12px;">
This helps you identify which devices have access to your vault. This helps you identify which devices have access to your vault.
@@ -918,7 +921,7 @@ function renderStep4(): string {
</div> </div>
<div class="form-actions"> <div class="form-actions">
<button class="btn" id="back-btn">back</button> <button class="btn" id="back-btn">back</button>
<button class="btn btn-primary" id="next-btn">continue</button> <button class="btn-primary" id="next-btn">continue ${GLYPH_NEXT}</button>
</div> </div>
</div> </div>
`; `;
@@ -979,7 +982,7 @@ function renderStep5(): string {
const isAttach = state.mode === 'attach'; const isAttach = state.mode === 'attach';
return ` return `
<div class="wizard-step"> <div class="wizard-step glass" style="padding: 24px; margin-top: 16px;">
<div class="success-box"> <div class="success-box">
<h3>${isAttach ? 'device verified' : 'vault created'}</h3> <h3>${isAttach ? 'device verified' : 'vault created'}</h3>
<p class="secondary"> <p class="secondary">