Update boilerplate UI design system
This commit is contained in:
parent
dbc6af8099
commit
746472d532
5 changed files with 264 additions and 70 deletions
|
|
@ -90,4 +90,10 @@ This file is the single source of truth for codebase obstacles, oddities, and th
|
|||
**Area:** web/app/models/user.py
|
||||
**Obstacle:** `Session` was imported directly (`from .session import Session`) while `Grant` used `TYPE_CHECKING`. Inconsistent and risked circular imports.
|
||||
**Solution:** Moved `Session` import under `TYPE_CHECKING`, changed relationship to string ref `"Session"`.
|
||||
**Preference:** Always use `TYPE_CHECKING` for model references within models to avoid circular imports.
|
||||
**Preference:** Always use `TYPE_CHECKING` for model references within models to avoid circular imports.
|
||||
|
||||
### Boilerplate UI must follow attached light vault system
|
||||
**Area:** web/app/static/css/input.css, web/app/templates/*.html
|
||||
**Obstacle:** Existing boilerplate used dark-mode pink tokens that conflicted with the attached "Mystique Minimalist Security" design system.
|
||||
**Solution/Workaround:** Use light Geist/JetBrains Mono typography, glacier-blue primary actions, white/off-white tonal surfaces, hairline slate borders, compact labels, mono technical strings, and pill status badges.
|
||||
**Preference:** Keep visual changes in Tailwind tokens and boilerplate templates; avoid backend route changes for design-only updates.
|
||||
|
|
|
|||
|
|
@ -1,17 +1,58 @@
|
|||
@import "tailwindcss";
|
||||
|
||||
@theme {
|
||||
--color-surface: #0f0f1a;
|
||||
--color-surface-alt: #1a1a2e;
|
||||
--color-surface-raised: #24243e;
|
||||
--color-primary: #ec4899;
|
||||
--color-primary-hover: #db2777;
|
||||
--color-primary-muted: rgba(236, 72, 153, 0.15);
|
||||
--color-text: #e2e8f0;
|
||||
--color-text-muted: #94a3b8;
|
||||
--color-border: #334155;
|
||||
--color-border-light: #1e293b;
|
||||
--color-success: #22c55e;
|
||||
--color-warning: #f59e0b;
|
||||
--color-danger: #ef4444;
|
||||
--font-sans: "Geist", ui-sans-serif, system-ui, sans-serif;
|
||||
--font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
|
||||
|
||||
--color-background: #f8f9ff;
|
||||
--color-surface: #f8f9ff;
|
||||
--color-surface-bright: #ffffff;
|
||||
--color-surface-alt: #eff4ff;
|
||||
--color-surface-raised: #e5eeff;
|
||||
--color-surface-muted: #f8fafc;
|
||||
--color-surface-hover: #f1f5f9;
|
||||
--color-primary: #006591;
|
||||
--color-primary-hover: #004c6e;
|
||||
--color-primary-container: #0ea5e9;
|
||||
--color-primary-muted: rgba(0, 101, 145, 0.12);
|
||||
--color-text: #0b1c30;
|
||||
--color-text-muted: #3e4850;
|
||||
--color-text-subtle: #57657a;
|
||||
--color-border: #e2e8f0;
|
||||
--color-border-light: #f1f5f9;
|
||||
--color-outline: #6e7881;
|
||||
--color-success: #15803d;
|
||||
--color-success-surface: #dcfce7;
|
||||
--color-warning: #b45309;
|
||||
--color-warning-surface: #fef3c7;
|
||||
--color-danger: #ba1a1a;
|
||||
--color-danger-surface: #ffdad6;
|
||||
|
||||
--radius-sm: 0.125rem;
|
||||
--radius-md: 0.25rem;
|
||||
--radius-lg: 0.375rem;
|
||||
--radius-xl: 0.5rem;
|
||||
--radius-2xl: 0.75rem;
|
||||
}
|
||||
|
||||
@layer base {
|
||||
html {
|
||||
background: #f8f9ff;
|
||||
color: #0b1c30;
|
||||
font-family: var(--font-sans);
|
||||
}
|
||||
|
||||
body {
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
a,
|
||||
button,
|
||||
input {
|
||||
outline-color: var(--color-primary);
|
||||
}
|
||||
|
||||
code {
|
||||
font-family: var(--font-mono);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,28 +1,51 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en" class="dark">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{% block title %}Myst{% endblock %}</title>
|
||||
<link rel="stylesheet" href="/static/css/output.css">
|
||||
<script src="https://unpkg.com/htmx.org@2"></script>
|
||||
</head>
|
||||
<body class="bg-surface text-text min-h-screen">
|
||||
<header class="border-b border-border-light">
|
||||
<div class="mx-auto max-w-6xl flex items-center justify-between px-4 py-3">
|
||||
<a href="/" class="text-xl font-bold text-primary hover:text-primary-hover">Myst</a>
|
||||
<nav class="flex items-center gap-4">
|
||||
{% if user %}
|
||||
<a href="/dashboard" class="text-text-muted hover:text-text transition">Dashboard</a>
|
||||
<a href="/auth/logout" class="rounded bg-primary px-3 py-1.5 text-sm font-medium text-white hover:bg-primary-hover transition">Logout</a>
|
||||
{% else %}
|
||||
<a href="/auth/login/forgejo" class="rounded bg-primary px-3 py-1.5 text-sm font-medium text-white hover:bg-primary-hover transition">Sign in with Forgejo</a>
|
||||
{% endif %}
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
<main class="mx-auto max-w-6xl px-4 py-8">
|
||||
{% block content %}{% endblock %}
|
||||
</main>
|
||||
</body>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>
|
||||
{% block title %}Myst{% endblock %}
|
||||
</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
<link href="https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap"
|
||||
rel="stylesheet" />
|
||||
<link rel="stylesheet" href="/static/css/output.css" />
|
||||
<script src="https://unpkg.com/htmx.org@2"></script>
|
||||
</head>
|
||||
<body class="min-h-screen bg-surface text-sm text-text antialiased">
|
||||
<header class="border-b border-border bg-surface-bright">
|
||||
<div class="mx-auto flex max-w-[1280px] items-center justify-between px-4 py-3 sm:px-8">
|
||||
<a href="/"
|
||||
class="flex items-center gap-2 text-base font-semibold tracking-normal text-text transition hover:text-primary">
|
||||
<span class="grid size-7 place-items-center rounded-md border border-primary/20 bg-primary text-xs font-semibold text-white">M</span>
|
||||
<span>Myst</span>
|
||||
</a>
|
||||
<nav class="flex items-center gap-2">
|
||||
{% if user %}
|
||||
<a href="/dashboard"
|
||||
class="rounded-md px-3 py-2 text-sm font-medium text-text-muted transition hover:bg-surface-hover hover:text-text">Dashboard</a>
|
||||
<a href="/auth/logout"
|
||||
class="rounded-md border border-border bg-white px-3 py-2 text-sm font-medium text-text-muted transition hover:border-outline hover:text-text">Logout</a>
|
||||
{% else %}
|
||||
<a href="/auth/login/forgejo"
|
||||
class="inline-flex items-center gap-2 rounded-md bg-primary px-3 py-2 text-sm font-medium text-white transition hover:bg-primary-hover focus:ring-2 focus:ring-primary-muted">
|
||||
<span class="grid size-5 place-items-center rounded-sm bg-white p-0.5">
|
||||
<img src="http://myst-forgejo-pk9mpr-31e452-76-13-111-87.sslip.io/assets/img/logo.svg"
|
||||
alt=""
|
||||
width="16"
|
||||
height="16"
|
||||
class="size-4"
|
||||
aria-hidden="true" />
|
||||
</span>
|
||||
<span>Sign in with Forgejo</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
<main class="mx-auto max-w-[1280px] px-4 py-8 sm:px-8">
|
||||
{% block content %}{% endblock %}
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -1,20 +1,89 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Dashboard — Myst{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1 class="text-2xl font-bold text-white">Dashboard</h1>
|
||||
<p class="mt-1 text-text-muted">Welcome, {{ user.display_name or user.email }}!</p>
|
||||
|
||||
<section class="mt-8 rounded-lg border border-border bg-surface-alt p-6">
|
||||
<h2 class="text-lg font-semibold text-white">Forgejo Access Token</h2>
|
||||
<p class="mt-1 text-sm text-text-muted">Register a <code class="text-primary">read:repository</code>-scoped PAT to enable share link viewing.</p>
|
||||
<!-- TODO: PAT registration form -->
|
||||
</section>
|
||||
|
||||
<section class="mt-6 rounded-lg border border-border bg-surface-alt p-6">
|
||||
<h2 class="text-lg font-semibold text-white">Share Links</h2>
|
||||
<p class="mt-1 text-sm text-text-muted">You haven't created any share links yet.</p>
|
||||
<!-- TODO: share link list -->
|
||||
</section>
|
||||
<div class="flex flex-col gap-6">
|
||||
<section class="flex flex-col justify-between gap-4 border-b border-border pb-6 sm:flex-row sm:items-end">
|
||||
<div>
|
||||
<p class="text-xs font-semibold uppercase tracking-[0.05em] text-primary">Control plane</p>
|
||||
<h1 class="mt-2 text-3xl font-semibold leading-10 tracking-normal text-text">Dashboard</h1>
|
||||
<p class="mt-1 text-sm text-text-muted">Welcome, {{ user.display_name or user.email }}.</p>
|
||||
</div>
|
||||
<a href="/links/create"
|
||||
class="w-fit rounded-md bg-primary px-4 py-2.5 text-sm font-medium text-white transition hover:bg-primary-hover focus:ring-2 focus:ring-primary-muted">
|
||||
Create share link
|
||||
</a>
|
||||
</section>
|
||||
<section class="grid gap-4 md:grid-cols-3">
|
||||
<div class="rounded-lg border border-border bg-white p-4">
|
||||
<p class="text-xs font-semibold uppercase tracking-[0.05em] text-text-subtle">Active links</p>
|
||||
<p class="mt-3 text-2xl font-semibold text-text">0</p>
|
||||
<p class="mt-1 text-xs text-text-subtle">No repository snapshots published yet.</p>
|
||||
</div>
|
||||
<div class="rounded-lg border border-border bg-white p-4">
|
||||
<p class="text-xs font-semibold uppercase tracking-[0.05em] text-text-subtle">Default expiry</p>
|
||||
<p class="mt-3 text-2xl font-semibold text-text">7 days</p>
|
||||
<p class="mt-1 text-xs text-text-subtle">Applied to newly created links.</p>
|
||||
</div>
|
||||
<div class="rounded-lg border border-border bg-white p-4">
|
||||
<p class="text-xs font-semibold uppercase tracking-[0.05em] text-text-subtle">Audit events</p>
|
||||
<p class="mt-3 text-2xl font-semibold text-text">0</p>
|
||||
<p class="mt-1 text-xs text-text-subtle">Viewer activity will appear here.</p>
|
||||
</div>
|
||||
</section>
|
||||
<section class="rounded-lg border border-border bg-white">
|
||||
<div class="border-b border-border px-4 py-4">
|
||||
<h2 class="text-base font-semibold text-text">Forgejo access token</h2>
|
||||
<p class="mt-1 text-sm text-text-muted">
|
||||
Register a <code class="rounded-sm bg-surface-alt px-1.5 py-0.5 text-primary">read:repository</code>-scoped PAT
|
||||
to enable share link viewing.
|
||||
</p>
|
||||
</div>
|
||||
<form method="post"
|
||||
class="grid gap-4 px-4 py-4 sm:grid-cols-[1fr_auto] sm:items-end">
|
||||
<div>
|
||||
<label for="pat"
|
||||
class="text-xs font-semibold uppercase tracking-[0.05em] text-text-subtle">
|
||||
Personal access token
|
||||
</label>
|
||||
<input type="text"
|
||||
id="pat"
|
||||
name="pat"
|
||||
class="mt-2 block w-full rounded-md border border-border bg-white px-3 py-2 font-mono text-[13px] leading-5 text-text transition placeholder:text-text-subtle focus:border-primary focus:ring-2 focus:ring-primary-muted"
|
||||
placeholder="forgejo_pat_..."
|
||||
required />
|
||||
</div>
|
||||
<button type="submit"
|
||||
class="rounded-md bg-primary px-4 py-2 text-sm font-medium text-white transition hover:bg-primary-hover focus:ring-2 focus:ring-primary-muted">
|
||||
Register
|
||||
</button>
|
||||
</form>
|
||||
</section>
|
||||
<section class="rounded-lg border border-border bg-white">
|
||||
<div class="flex items-center justify-between border-b border-border px-4 py-4">
|
||||
<div>
|
||||
<h2 class="text-base font-semibold text-text">Share links</h2>
|
||||
<p class="mt-1 text-sm text-text-muted">Repository snapshots published from this account.</p>
|
||||
</div>
|
||||
<span class="rounded-full bg-surface-alt px-2.5 py-1 text-xs font-medium text-text-subtle">Empty</span>
|
||||
</div>
|
||||
<div class="overflow-x-auto">
|
||||
<table class="w-full min-w-[720px] text-left text-sm">
|
||||
<thead class="bg-surface-muted text-xs font-semibold uppercase tracking-[0.05em] text-text-subtle">
|
||||
<tr>
|
||||
<th class="px-4 py-3">Repository</th>
|
||||
<th class="px-4 py-3">Commit</th>
|
||||
<th class="px-4 py-3">Status</th>
|
||||
<th class="px-4 py-3">Views</th>
|
||||
<th class="px-4 py-3">Expires</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-border-light">
|
||||
<tr class="text-text-muted">
|
||||
<td class="px-4 py-5" colspan="5">You have not created any share links yet.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
|||
|
|
@ -1,17 +1,72 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Myst{% endblock %}
|
||||
|
||||
{% block title %}Myst — share Forgejo repositories easily{% endblock %}
|
||||
{% block content %}
|
||||
<div class="flex flex-col items-center justify-center py-24 text-center">
|
||||
<h1 class="text-5xl font-bold text-white">Myst</h1>
|
||||
<p class="mt-4 text-lg text-text-muted max-w-md">
|
||||
Share self-hosted repository snapshots via time-limited, view-only links.
|
||||
</p>
|
||||
{% if not user %}
|
||||
<a href="/auth/login/forgejo" class="mt-8 rounded-lg bg-primary px-6 py-3 font-medium text-white hover:bg-primary-hover transition">
|
||||
Sign in with Forgejo
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
<section class="grid min-h-[calc(100vh-9rem)] items-center gap-8 py-6 lg:grid-cols-[0.9fr_1.1fr]">
|
||||
<div class="max-w-2xl">
|
||||
<p class="text-xs font-semibold uppercase tracking-[0.05em] text-primary">
|
||||
Secure repository sharing
|
||||
</p>
|
||||
<h1 class="mt-4 text-4xl font-semibold leading-tight tracking-normal text-text sm:text-[3.25rem] sm:leading-[1.05]">
|
||||
Myst
|
||||
</h1>
|
||||
<p class="mt-4 max-w-xl text-base leading-7 text-text-muted">
|
||||
Share pinned Forgejo repository snapshots through view-only links with expiration,
|
||||
revocation, and audit visibility built in.
|
||||
</p>
|
||||
<div class="mt-8 flex flex-wrap items-center gap-3">
|
||||
{% if user %}
|
||||
<a href="/dashboard"
|
||||
class="rounded-md bg-primary px-4 py-2.5 text-sm font-medium text-white transition hover:bg-primary-hover focus:ring-2 focus:ring-primary-muted">
|
||||
Open dashboard
|
||||
</a>
|
||||
{% else %}
|
||||
<a href="/auth/login/forgejo"
|
||||
class="inline-flex items-center gap-2 rounded-md bg-primary px-4 py-2.5 text-sm font-medium text-white transition hover:bg-primary-hover focus:ring-2 focus:ring-primary-muted">
|
||||
<span class="grid size-5 place-items-center rounded-sm bg-white p-0.5">
|
||||
<img src="http://myst-forgejo-pk9mpr-31e452-76-13-111-87.sslip.io/assets/img/logo.svg"
|
||||
alt=""
|
||||
width="16"
|
||||
height="16"
|
||||
class="size-4"
|
||||
aria-hidden="true" />
|
||||
</span>
|
||||
<span>Sign in with Forgejo</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
<span class="text-sm text-text-subtle">Time-limited. Read-only. Auditable.</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="rounded-xl border border-border bg-white">
|
||||
<div class="flex items-center justify-between border-b border-border px-4 py-3">
|
||||
<div>
|
||||
<p class="text-xs font-semibold uppercase tracking-[0.05em] text-text-subtle">Vault activity</p>
|
||||
<h2 class="mt-1 text-base font-semibold text-text">Repository snapshots</h2>
|
||||
</div>
|
||||
<span class="rounded-full bg-success-surface px-2.5 py-1 text-xs font-medium text-success">Protected</span>
|
||||
</div>
|
||||
<div class="divide-y divide-border-light">
|
||||
<div class="grid grid-cols-[1fr_auto] gap-4 px-4 py-3">
|
||||
<div>
|
||||
<p class="font-mono text-[13px] leading-5 text-text">infra/deployment</p>
|
||||
<p class="mt-1 text-xs text-text-subtle">Pinned commit 9f2a1c8 · expires in 7 days</p>
|
||||
</div>
|
||||
<span class="self-start rounded-full bg-success-surface px-2.5 py-1 text-xs font-medium text-success">Active</span>
|
||||
</div>
|
||||
<div class="grid grid-cols-[1fr_auto] gap-4 px-4 py-3">
|
||||
<div>
|
||||
<p class="font-mono text-[13px] leading-5 text-text">platform/secrets</p>
|
||||
<p class="mt-1 text-xs text-text-subtle">Pinned commit a81dc40 · 14 views</p>
|
||||
</div>
|
||||
<span class="self-start rounded-full bg-warning-surface px-2.5 py-1 text-xs font-medium text-warning">Review</span>
|
||||
</div>
|
||||
<div class="grid grid-cols-[1fr_auto] gap-4 px-4 py-3">
|
||||
<div>
|
||||
<p class="font-mono text-[13px] leading-5 text-text">audit/policies</p>
|
||||
<p class="mt-1 text-xs text-text-subtle">Pinned commit 31e0b77 · revoked yesterday</p>
|
||||
</div>
|
||||
<span class="self-start rounded-full bg-danger-surface px-2.5 py-1 text-xs font-medium text-danger">Revoked</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue