feat(workflow): example stats page with embedded Chart.js, inline form validation errors

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-24 01:59:27 +02:00
co-authored by Claude Sonnet 5.5
parent 16a0bb0de4
commit 00af65613d
36 changed files with 1274 additions and 138 deletions
+60 -7
View File
@@ -1,6 +1,28 @@
/* Living example stylesheet: mobile-first, responsive by default. */
/* Living example stylesheet: mobile-first, responsive by default.
Chart palette: validated categorical slots (light and dark). */
:root {
color-scheme: light dark;
--surface-1: #fcfcfb; --text-primary: #0b0b0b; --text-secondary: #52514e;
--grid: #e4e3df; --border: #ccc; --danger: #a00; --danger-bg: #fdecec;
--ok: #0a6b0a;
--series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a;
--series-4: #eda100; --series-5: #e87ba4; --series-6: #008300;
--series-7: #6250d6; --series-8: #e34948;
}
@media (prefers-color-scheme: dark) {
:root {
--surface-1: #1a1a19; --text-primary: #f0efec; --text-secondary: #c3c2b7;
--grid: #3a3a37; --border: #4a4a46; --danger: #ff8f8f; --danger-bg: #3a1c1c;
--ok: #6fd36f;
--series-1: #3987e5; --series-2: #d95926; --series-3: #199e70;
--series-4: #c98500; --series-5: #d55181; --series-6: #008300;
--series-7: #9085e9; --series-8: #e66767;
}
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, sans-serif; line-height: 1.5; }
body { margin: 0; font-family: system-ui, sans-serif; line-height: 1.5;
background: var(--surface-1); color: var(--text-primary); }
a { color: var(--series-1); }
.topbar { display: flex; align-items: center; gap: 1rem; padding: 0.5rem 1rem;
background: #102030; color: #fff; }
.brand { color: #fff; font-weight: bold; text-decoration: none; }
@@ -8,15 +30,46 @@ body { margin: 0; font-family: system-ui, sans-serif; line-height: 1.5; }
.nav-wide a { color: #cde; text-decoration: none; }
.nav-narrow { margin-left: auto; }
.nav-narrow nav { display: flex; flex-direction: column; gap: 0.25rem;
background: #fff; padding: 0.5rem; border: 1px solid #ccc; }
background: var(--surface-1); padding: 0.5rem; border: 1px solid var(--border); }
main { padding: 1rem; max-width: 60rem; margin: 0 auto; }
table { border-collapse: collapse; width: 100%; }
th, td { border: 1px solid #ccc; padding: 0.25rem 0.5rem; text-align: left; }
th, td { border: 1px solid var(--border); padding: 0.25rem 0.5rem; text-align: left; }
form { display: flex; flex-direction: column; gap: 0.5rem; max-width: 28rem; }
input, textarea, button { font-size: 1rem; padding: 0.4rem; }
.ok { color: #0a0; }
.error { color: #a00; }
.hint { color: #555; }
.ok { color: var(--ok); }
.error { color: var(--danger); }
.hint { color: var(--text-secondary); }
code { overflow-wrap: anywhere; }
/* Forms: inline field errors plus a summary box. */
.field { display: flex; flex-direction: column; gap: 0.2rem; }
.field input, .field textarea { border: 1px solid var(--border);
background: var(--surface-1); color: inherit; border-radius: 4px; }
.field.invalid input, .field.invalid textarea { border-color: var(--danger);
border-width: 2px; }
.field-error { color: var(--danger); font-size: 0.9rem; margin: 0; }
.field-error::before { content: "\26A0\00a0"; }
.form-errors { border: 2px solid var(--danger); background: var(--danger-bg);
border-radius: 4px; padding: 0.5rem 0.75rem; max-width: 28rem; }
.form-errors h2 { margin: 0 0 0.25rem; font-size: 1rem; color: var(--danger); }
.form-errors ul { margin: 0; padding-left: 1.25rem; }
label.inline { flex-direction: row; align-items: center; gap: 0.4rem; display: inline-flex; }
label.inline input { padding: 0; }
/* Statistics page */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 0.5rem; }
.tile { border: 1px solid var(--border); border-radius: 6px; padding: 0.4rem 0.6rem;
display: flex; flex-direction: column; min-width: 0; }
.tile .k { color: var(--text-secondary); font-size: 0.8rem; }
.tile .v { font-size: 1.25rem; font-weight: 600; overflow-wrap: anywhere; }
.grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.chart { margin: 0; border: 1px solid var(--border); border-radius: 6px; padding: 0.5rem; min-width: 0; }
.chart figcaption { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 0.25rem; }
.plot { position: relative; height: 14rem; }
.plot.tall { height: 22rem; }
.scroll { overflow-x: auto; margin: 0.75rem 0; }
@media (min-width: 48rem) { .grid { grid-template-columns: 1fr 1fr; } }
/* Big button group becomes a dropdown on small phones: the details element
above is the dropdown; on wide screens show the plain link row. */
@media (min-width: 48rem) {