@somewhere-cloud/cli 0.38.84 → 0.38.86

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/CHANGELOG.md +176 -7
  2. package/dist/commands/deploy.js +25 -2
  3. package/dist/commands/deploy.js.map +1 -1
  4. package/dist/commands/test.js +13 -99
  5. package/dist/commands/test.js.map +1 -1
  6. package/dist/lib/deploy-tests.d.ts +27 -0
  7. package/dist/lib/deploy-tests.js +49 -0
  8. package/dist/lib/deploy-tests.js.map +1 -0
  9. package/dist/lib/form-accounts.d.ts +2 -2
  10. package/dist/lib/form-accounts.js +8 -5
  11. package/dist/lib/form-accounts.js.map +1 -1
  12. package/dist/lib/init-agent-guide.d.ts +2 -2
  13. package/dist/lib/init-agent-guide.js +6 -1
  14. package/dist/lib/init-agent-guide.js.map +1 -1
  15. package/dist/lib/init-feature-template.js +5 -5
  16. package/dist/lib/init-feature-template.js.map +1 -1
  17. package/dist/lib/init-green-template.js +3 -0
  18. package/dist/lib/init-green-template.js.map +1 -1
  19. package/dist/lib/init-test-template.d.ts +4 -1
  20. package/dist/lib/init-test-template.js +131 -42
  21. package/dist/lib/init-test-template.js.map +1 -1
  22. package/dist/lib/init-ui-kit.d.ts +1 -1
  23. package/dist/lib/init-ui-kit.js +21 -3
  24. package/dist/lib/init-ui-kit.js.map +1 -1
  25. package/dist/lib/playwright-fixtures.d.ts +8 -1
  26. package/dist/lib/playwright-fixtures.js +46 -29
  27. package/dist/lib/playwright-fixtures.js.map +1 -1
  28. package/dist/lib/test-diagnostics.js +2 -1
  29. package/dist/lib/test-diagnostics.js.map +1 -1
  30. package/dist/lib/test-ledger.d.ts +73 -0
  31. package/dist/lib/test-ledger.js +261 -0
  32. package/dist/lib/test-ledger.js.map +1 -0
  33. package/dist/lib/test-reporter.d.ts +2 -0
  34. package/dist/lib/test-reporter.js +74 -6
  35. package/dist/lib/test-reporter.js.map +1 -1
  36. package/dist/lib/test-run.d.ts +35 -0
  37. package/dist/lib/test-run.js +136 -0
  38. package/dist/lib/test-run.js.map +1 -0
  39. package/dist/lib/test-target.d.ts +4 -1
  40. package/dist/lib/test-target.js +12 -3
  41. package/dist/lib/test-target.js.map +1 -1
  42. package/dist/lib/test-timeline.d.ts +10 -0
  43. package/dist/lib/test-timeline.js +50 -0
  44. package/dist/lib/test-timeline.js.map +1 -0
  45. package/dist/testing.d.ts +1 -1
  46. package/dist/testing.js.map +1 -1
  47. package/npm-shrinkwrap.json +2 -2
  48. package/package.json +1 -1
  49. package/src/testing.ts +1 -1
@@ -1,6 +1,6 @@
1
1
  import type { InitScaffoldFile } from './init-scaffold.js';
2
2
  export declare const TOKENS_CSS = "/* Design tokens: the only place colours, type and spacing are defined.\n app.css and src/ui read these; pages never write a raw hex or px value.\n To restyle the whole app, change the values here.\n\n Fonts are local stacks only (no network fonts), chosen so every platform\n falls back to a good face, not to Arial/Times. Prefer one family: set\n --font-display to a serif stack only if the app wants that personality. */\n:root {\n color-scheme: light;\n\n --font-body: system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif;\n --font-display: var(--font-body);\n /* Serif alternative: \"Iowan Old Style\", \"Palatino Linotype\", Palatino, Georgia, serif; */\n --font-mono: ui-monospace, \"SF Mono\", Menlo, Consolas, \"Liberation Mono\", monospace;\n\n --text-xs: 0.75rem;\n --text-sm: 0.875rem;\n --text-base: 1rem;\n --text-lg: 1.125rem;\n --text-xl: 1.375rem;\n --text-2xl: 1.75rem;\n --text-display: clamp(2rem, 4.4vw, 2.75rem);\n --tracking-display: -0.02em;\n --tracking-label: 0.06em;\n\n --space-1: 4px;\n --space-2: 8px;\n --space-3: 12px;\n --space-4: 16px;\n --space-5: 20px;\n --space-6: 24px;\n --space-8: 32px;\n --space-10: 40px;\n --space-12: 48px;\n --space-16: 64px;\n\n --radius-control: 8px;\n --radius-panel: 14px;\n --radius-pill: 999px;\n\n --control-height: 44px;\n --content-width: 1040px;\n\n --shadow-sm: 0 1px 2px rgba(28, 27, 24, 0.05);\n --shadow-md: 0 1px 2px rgba(28, 27, 24, 0.05), 0 16px 40px -28px rgba(28, 27, 24, 0.35);\n --shadow-lg: 0 24px 64px -24px rgba(28, 27, 24, 0.45);\n\n /* Surfaces and text */\n --color-bg: #f5f3ee;\n --color-surface: #ffffff;\n --color-surface-2: #faf8f4;\n --color-text: #1c1b18;\n --color-muted: #66615a;\n --color-border: #e0dbd1;\n --color-border-strong: #c9c2b5;\n\n /* One accent. Everything interactive uses it. */\n --color-accent: #1d6b52;\n --color-accent-hover: #185b46;\n --color-accent-soft: #e3efe9;\n --color-on-accent: #ffffff;\n --color-focus: #1d6b52;\n\n /* Semantic tones for badges, notices and stats: not for buttons. */\n --color-success: #1d6b52;\n --color-success-soft: #e3efe9;\n --color-warning: #8a5a00;\n --color-warning-soft: #f7ebd2;\n --color-danger: #b42318;\n --color-danger-soft: #fbe4e1;\n --color-info: #2a5d9f;\n --color-info-soft: #e1eaf7;\n}\n\n@media (prefers-color-scheme: dark) {\n :root {\n color-scheme: dark;\n\n --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);\n --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px -28px rgba(0, 0, 0, 0.7);\n --shadow-lg: 0 24px 64px -24px rgba(0, 0, 0, 0.8);\n\n --color-bg: #15161a;\n --color-surface: #1e2025;\n --color-surface-2: #24272d;\n --color-text: #ecebe6;\n --color-muted: #a19d95;\n --color-border: #31343b;\n --color-border-strong: #454953;\n\n --color-accent: #5fbf9a;\n --color-accent-hover: #74cba9;\n --color-accent-soft: #1f3a31;\n --color-on-accent: #0f1f19;\n --color-focus: #5fbf9a;\n\n --color-success: #5fbf9a;\n --color-success-soft: #1f3a31;\n --color-warning: #e2b25a;\n --color-warning-soft: #3a2f16;\n --color-danger: #f0867c;\n --color-danger-soft: #42221f;\n --color-info: #7fa9e6;\n --color-info-soft: #1f2d42;\n }\n}\n";
3
- export declare const APP_CSS = "/* Base styles and the classes src/ui components render. Values come from\n tokens.css. Add app-specific styles at the end of this file, or in a new\n file imported from src/main.tsx; do not restyle native elements globally. */\n\n/* ---------- Base ---------- */\n*, *::before, *::after { box-sizing: border-box; }\nhtml { -webkit-text-size-adjust: 100%; }\nbody {\n margin: 0;\n min-width: 320px;\n background: var(--color-bg);\n color: var(--color-text);\n font: 400 var(--text-base)/1.55 var(--font-body);\n -webkit-font-smoothing: antialiased;\n}\nbutton, input, select, textarea { font: inherit; color: inherit; }\nh1, h2, h3, p { margin: 0; }\nh1, h2, h3 { font-family: var(--font-display); line-height: 1.2; letter-spacing: var(--tracking-display); font-weight: 600; }\nh1 { font-size: var(--text-2xl); }\nh2 { font-size: var(--text-xl); }\nh3 { font-size: var(--text-lg); }\na { color: var(--color-accent); text-underline-offset: 3px; }\ncode, kbd { font-family: var(--font-mono); font-size: 0.9em; }\n:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }\n::placeholder { color: var(--color-muted); opacity: 0.8; }\n\n.muted { color: var(--color-muted); }\n.hint { margin: 0; color: var(--color-muted); font-size: var(--text-sm); font-weight: 400; }\n.error { margin: 0; color: var(--color-danger); font-size: var(--text-sm); }\n.skip-link { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; position: absolute; left: var(--space-3); top: -60px; padding: var(--space-2) var(--space-3); background: var(--color-text); color: var(--color-bg); z-index: 10; }\n.skip-link:focus { top: var(--space-3); }\n.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }\n\n/* ---------- Layout primitives (src/ui/layout.tsx) ---------- */\n.stack { display: grid; gap: var(--stack-gap, var(--space-4)); align-content: start; }\n.stack > *, .grid > *, .card > *, .content > * { min-width: 0; }\n.inline { display: flex; flex-wrap: wrap; gap: var(--inline-gap, var(--space-2)); align-items: var(--inline-align, center); justify-content: var(--inline-justify, flex-start); }\n.grid { display: grid; gap: var(--grid-gap, var(--space-4)); grid-template-columns: repeat(auto-fit, minmax(min(var(--grid-min, 220px), 100%), 1fr)); }\n.actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }\n\n.page-header { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: flex-end; justify-content: space-between; margin-bottom: var(--space-8); }\n.page-header__text { display: grid; gap: var(--space-1); min-width: 0; }\n.page-header__title { font-size: var(--text-display); line-height: 1.1; }\n.page-header__description { color: var(--color-muted); max-width: 60ch; }\n\n.eyebrow { margin: 0; color: var(--color-muted); font-size: var(--text-xs); font-weight: 600; letter-spacing: var(--tracking-label); text-transform: uppercase; }\n.section-title { margin: 0 0 var(--space-3); font-size: var(--text-sm); font-weight: 600; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--color-muted); }\n\n/* ---------- Panel and Card ---------- */\n.panel {\n display: grid;\n gap: var(--space-4);\n padding: var(--space-6);\n border: 1px solid var(--color-border);\n border-radius: var(--radius-panel);\n background: var(--color-surface);\n box-shadow: var(--shadow-md);\n}\n.panel__title { margin: 0; font: 600 var(--text-lg)/1.2 var(--font-display); }\n\n.card { display: grid; gap: 0; padding: 0; border: 1px solid var(--color-border); border-radius: var(--radius-panel); background: var(--color-surface); box-shadow: var(--shadow-sm); overflow: hidden; }\n.card__header { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; justify-content: space-between; padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--color-border); }\n.card__heading { display: grid; gap: 2px; min-width: 0; }\n.card__title { font-size: var(--text-base); font-weight: 600; letter-spacing: 0; }\n.card__description { color: var(--color-muted); font-size: var(--text-sm); }\n.card__body { padding: var(--space-5); }\n.card__body--flush { padding: 0; }\n.card__footer { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: flex-end; padding: var(--space-3) var(--space-5); border-top: 1px solid var(--color-border); background: var(--color-surface-2); }\n\n/* ---------- Buttons (src/ui/Button.tsx) ---------- */\n.button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: var(--space-2);\n min-height: var(--control-height);\n padding: 0 var(--space-4);\n border: 1px solid var(--color-accent);\n border-radius: var(--radius-control);\n background: var(--color-accent);\n color: var(--color-on-accent);\n font-weight: 600;\n line-height: 1.2;\n white-space: nowrap;\n text-decoration: none;\n cursor: pointer;\n transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;\n}\n.button:hover:not(:disabled) { background: var(--color-accent-hover); border-color: var(--color-accent-hover); }\n.button:disabled { opacity: 0.5; cursor: not-allowed; }\n.button--secondary { background: var(--color-surface); border-color: var(--color-border-strong); color: var(--color-text); }\n.button--secondary:hover:not(:disabled) { background: var(--color-surface-2); border-color: var(--color-border-strong); }\n.button--quiet { background: transparent; border-color: transparent; color: var(--color-text); }\n.button--quiet:hover:not(:disabled) { background: var(--color-accent-soft); border-color: transparent; }\n.button--danger { background: var(--color-danger); border-color: var(--color-danger); color: #fff; }\n.button--danger:hover:not(:disabled) { background: var(--color-danger); border-color: var(--color-danger); filter: brightness(0.92); }\n.button--sm { padding: 0 var(--space-3); font-size: var(--text-sm); }\n.button--block { width: 100%; }\n.button__spinner { width: 1em; height: 1em; border-width: 2px; }\n\n.link-button {\n display: inline-flex; align-items: center; min-height: var(--control-height);\n padding: 0 var(--space-2); border: 0; background: none;\n color: var(--color-accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;\n}\n.link-button:disabled { opacity: 0.5; cursor: not-allowed; }\n.link-button--danger { color: var(--color-danger); }\n\n/* ---------- Fields (src/ui/Field.tsx) ---------- */\n.field { display: grid; gap: 6px; min-width: 0; }\n.field__label { display: flex; justify-content: space-between; gap: var(--space-2); font-size: var(--text-sm); font-weight: 600; }\n.field__optional { color: var(--color-muted); font-weight: 400; }\n.field .control {\n width: 100%;\n min-height: var(--control-height);\n padding: 10px 12px;\n border: 1px solid var(--color-border-strong);\n border-radius: var(--radius-control);\n background: var(--color-surface);\n color: var(--color-text);\n}\n.field .control:hover { border-color: var(--color-muted); }\n.field .control[aria-invalid=\"true\"] { border-color: var(--color-danger); }\n.field .control:disabled { background: var(--color-surface-2); color: var(--color-muted); cursor: not-allowed; }\n.field textarea.control { min-height: calc(var(--control-height) * 2.2); resize: vertical; line-height: 1.5; }\n.field select.control {\n appearance: none;\n padding-right: 40px;\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%2366615a' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E\");\n background-repeat: no-repeat;\n background-position: right 12px center;\n}\n.field input[type=\"date\"].control, .field input[type=\"time\"].control { min-width: 10ch; }\n.field--inline { grid-template-columns: auto 1fr; align-items: center; }\n.field--inline .field__label { font-weight: 400; }\n.field input[type=\"checkbox\"], .field input[type=\"radio\"] { width: 20px; height: 20px; margin: 0; accent-color: var(--color-accent); }\n.field__hint { color: var(--color-muted); font-size: var(--text-sm); }\n.field__error { color: var(--color-danger); font-size: var(--text-sm); }\n.form-row { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(var(--form-row-min, 160px), 100%), 1fr)); align-items: start; }\n\n/* ---------- Tabs (src/ui/Tabs.tsx) ---------- */\n.tabs { display: flex; gap: var(--space-1); padding: var(--space-1); min-height: var(--control-height); border: 1px solid var(--color-border); border-radius: var(--radius-control); background: var(--color-surface-2); overflow-x: auto; scrollbar-width: none; max-width: 100%; }\n.tabs::-webkit-scrollbar { display: none; }\n.tab { flex: 0 0 auto; min-height: calc(var(--control-height) - 8px); padding: 0 var(--space-4); border: 0; border-radius: calc(var(--radius-control) - 2px); background: transparent; color: var(--color-muted); font-weight: 600; font-size: var(--text-sm); white-space: nowrap; cursor: pointer; }\n.tab:hover { color: var(--color-text); }\n.tab[aria-selected=\"true\"] { background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow-sm); }\n\n/* ---------- Badge (src/ui/Badge.tsx) ---------- */\n.badge { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 0 10px; border-radius: var(--radius-pill); background: var(--color-surface-2); border: 1px solid var(--color-border); color: var(--color-text); font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.02em; white-space: nowrap; }\n.badge--accent { background: var(--color-accent-soft); border-color: transparent; color: var(--color-accent); }\n.badge--success { background: var(--color-success-soft); border-color: transparent; color: var(--color-success); }\n.badge--warning { background: var(--color-warning-soft); border-color: transparent; color: var(--color-warning); }\n.badge--danger { background: var(--color-danger-soft); border-color: transparent; color: var(--color-danger); }\n.badge--info { background: var(--color-info-soft); border-color: transparent; color: var(--color-info); }\n.badge__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }\n\n/* ---------- Stat (src/ui/Stat.tsx) ---------- */\n.stat { display: grid; gap: var(--space-2); padding: var(--space-5); border: 1px solid var(--color-border); border-radius: var(--radius-panel); background: var(--color-surface); box-shadow: var(--shadow-sm); }\n.stat__value { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 600; letter-spacing: var(--tracking-display); line-height: 1.1; font-variant-numeric: tabular-nums; }\n.stat__value small { color: var(--color-muted); font-size: 0.55em; font-weight: 500; letter-spacing: 0; margin-left: 0.3em; }\n.stat__detail { color: var(--color-muted); font-size: var(--text-sm); }\n.stat__detail--success { color: var(--color-success); }\n.stat__detail--danger { color: var(--color-danger); }\n.meter { height: 6px; border-radius: var(--radius-pill); background: var(--color-border); overflow: hidden; }\n.meter__fill { height: 100%; border-radius: inherit; background: var(--color-accent); transition: width 240ms ease; }\n\n/* ---------- Table (src/ui/Table.tsx) ---------- */\n.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }\n.table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); font-variant-numeric: tabular-nums; }\n.table th, .table td { padding: var(--space-3) var(--space-5); text-align: left; vertical-align: middle; border-bottom: 1px solid var(--color-border); }\n.table th { color: var(--color-muted); font-size: var(--text-xs); font-weight: 600; letter-spacing: var(--tracking-label); text-transform: uppercase; white-space: nowrap; background: var(--color-surface-2); }\n.table tbody tr:last-child td { border-bottom: 0; }\n.table tbody tr:hover td { background: var(--color-surface-2); }\n.table .is-numeric { text-align: right; }\n.table__empty { padding: var(--space-8) var(--space-5); text-align: center; color: var(--color-muted); }\n\n/* ---------- Notice (src/ui/Notice.tsx) ---------- */\n.notice { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border); border-left-width: 4px; border-radius: var(--radius-control); background: var(--color-surface); font-size: var(--text-sm); }\n.notice__body { flex: 1 1 240px; display: grid; gap: 2px; min-width: 0; }\n.notice__title { font-weight: 600; }\n.notice--info { border-left-color: var(--color-info); }\n.notice--success { border-left-color: var(--color-success); }\n.notice--warning { border-left-color: var(--color-warning); }\n.notice--danger { border-left-color: var(--color-danger); }\n.notice__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }\n\n/* Alert from feedback.tsx; Notice is preferred for new code. */\n.alert { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; justify-content: space-between; padding: var(--space-3) var(--space-4); border: 1px solid var(--color-danger); border-radius: var(--radius-control); color: var(--color-danger); background: var(--color-surface); }\n.alert p { margin: 0; }\n\n/* ---------- Dialog (src/ui/Dialog.tsx) ---------- */\n.dialog { width: min(480px, calc(100% - 2 * var(--space-4))); padding: 0; border: 1px solid var(--color-border); border-radius: var(--radius-panel); background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow-lg); }\n.dialog::backdrop { background: rgba(20, 20, 18, 0.45); backdrop-filter: blur(2px); }\n.dialog__header { display: flex; align-items: start; justify-content: space-between; gap: var(--space-3); padding: var(--space-5) var(--space-5) 0; }\n.dialog__title { font-size: var(--text-lg); }\n.dialog__body { display: grid; gap: var(--space-4); padding: var(--space-4) var(--space-5) var(--space-5); }\n.dialog__footer { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: flex-end; padding: var(--space-3) var(--space-5); border-top: 1px solid var(--color-border); background: var(--color-surface-2); }\n\n/* ---------- Skeleton (src/ui/Skeleton.tsx) ---------- */\n.skeleton { display: grid; gap: var(--space-2); }\n.skeleton__line { height: 1em; border-radius: 4px; background: linear-gradient(90deg, var(--color-border) 25%, var(--color-surface-2) 50%, var(--color-border) 75%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }\n@keyframes shimmer { to { background-position: -200% 0; } }\n\n/* ---------- Empty state (src/ui/feedback.tsx) ---------- */\n.empty { display: grid; gap: var(--space-2); justify-items: center; padding: var(--space-10) var(--space-6); border: 1px dashed var(--color-border-strong); border-radius: var(--radius-panel); text-align: center; }\n.empty__title { margin: 0; font: 600 var(--text-lg)/1.3 var(--font-display); }\n.empty__body { margin: 0; color: var(--color-muted); max-width: 44ch; }\n\n/* ---------- Loading, unavailable, banner ---------- */\n.loading { display: grid; place-content: center; justify-items: center; gap: var(--space-3); min-height: 100vh; color: var(--color-muted); }\n.unavailable { max-width: 380px; margin: 0 var(--space-4); color: var(--color-text); }\n.unavailable p { margin: 0; }\n.banner { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; justify-content: center; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--color-danger); background: var(--color-surface); color: var(--color-danger); }\n.banner p { margin: 0; }\n.spinner { width: 24px; height: 24px; border: 3px solid var(--color-border); border-top-color: var(--color-accent); border-radius: 50%; animation: spin 0.8s linear infinite; }\n@keyframes spin { to { transform: rotate(360deg); } }\n\n/* ---------- Sign-in (src/ui/AuthCard.tsx) ---------- */\n.auth {\n display: grid;\n grid-template-columns: minmax(0, 1fr) minmax(300px, 400px);\n gap: var(--space-12);\n align-items: center;\n width: min(960px, calc(100% - 2 * var(--space-6)));\n min-height: 100vh;\n margin: 0 auto;\n padding: var(--space-12) 0;\n}\n.auth__intro { display: grid; gap: var(--space-3); align-content: center; }\n.auth__app { margin: 0; color: var(--color-accent); font-weight: 600; }\n.auth__title { margin: 0; font-size: var(--text-display); line-height: 1.05; }\n.auth__column { display: grid; gap: var(--space-4); }\n.auth__form .button { width: 100%; }\n.auth__providers { display: grid; gap: var(--space-2); }\n.auth__switch { margin: 0; text-align: center; color: var(--color-muted); font-size: var(--text-sm); }\n.auth__forgot { margin: 0; text-align: right; font-size: var(--text-sm); }\n.divider { display: flex; align-items: center; gap: var(--space-3); color: var(--color-muted); font-size: var(--text-sm); }\n.divider::before, .divider::after { content: \"\"; flex: 1; height: 1px; background: var(--color-border); }\n.provider-icon { width: 18px; height: 18px; flex: none; }\n\n/* ---------- Signed-in frame (src/ui/AppShell.tsx) ---------- */\n.shell { min-height: 100vh; }\n.topbar {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--space-4);\n width: min(var(--content-width), calc(100% - 2 * var(--space-6)));\n margin: 0 auto;\n padding: var(--space-3) 0;\n border-bottom: 1px solid var(--color-border);\n}\n.topbar__error { width: min(var(--content-width), calc(100% - 2 * var(--space-6))); margin: var(--space-2) auto 0; }\n.brand { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 44px; font: 600 var(--text-lg)/1 var(--font-display); letter-spacing: var(--tracking-display); color: inherit; text-decoration: none; }\n.account { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }\n.account__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--color-muted); font-size: var(--text-sm); }\n.content { width: min(var(--content-width), calc(100% - 2 * var(--space-6))); margin: 0 auto; padding: var(--space-8) 0 var(--space-16); outline: none; }\n\n/* ---------- Email verification (src/ui/VerifyEmail.tsx) ---------- */\n.verify-email { margin-bottom: var(--space-6); }\n.verify-email__form { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }\n.verify-email__form .field { grid-template-columns: auto auto; align-items: center; }\n.verify-email__form input { width: 8ch; letter-spacing: 0.2em; text-align: center; }\n\n/* ---------- Responsive ---------- */\n@media (max-width: 760px) {\n .auth { grid-template-columns: 1fr; gap: var(--space-6); align-content: start; padding-top: var(--space-8); }\n .auth__title { font-size: var(--text-2xl); }\n .page-header { margin-bottom: var(--space-6); }\n .page-header__title { font-size: var(--text-2xl); }\n .content { padding-top: var(--space-6); }\n}\n@media (max-width: 480px) {\n .panel { padding: var(--space-4); }\n .card__header, .card__body, .card__footer { padding-left: var(--space-4); padding-right: var(--space-4); }\n .table th, .table td { padding-left: var(--space-4); padding-right: var(--space-4); }\n}\n@media (prefers-reduced-motion: reduce) {\n .spinner { animation-duration: 3s; }\n .skeleton__line { animation: none; }\n .button, .meter__fill { transition: none; }\n}\n\n/* ---------- Your app ---------- */\n/* Add page-specific styles below. Use tokens; add a class, don't restyle a tag. */\n";
3
+ export declare const APP_CSS = "/* Base styles and the classes src/ui components render. Values come from\n tokens.css. Add app-specific styles at the end of this file, or in a new\n file imported from src/main.tsx; do not restyle native elements globally. */\n\n/* ---------- Base ---------- */\n*, *::before, *::after { box-sizing: border-box; }\nhtml { -webkit-text-size-adjust: 100%; }\nbody {\n margin: 0;\n min-width: 320px;\n background: var(--color-bg);\n color: var(--color-text);\n font: 400 var(--text-base)/1.55 var(--font-body);\n -webkit-font-smoothing: antialiased;\n}\nbutton, input, select, textarea { font: inherit; color: inherit; }\nh1, h2, h3, p { margin: 0; }\nh1, h2, h3 { font-family: var(--font-display); line-height: 1.2; letter-spacing: var(--tracking-display); font-weight: 600; }\nh1 { font-size: var(--text-2xl); }\nh2 { font-size: var(--text-xl); }\nh3 { font-size: var(--text-lg); }\na { color: var(--color-accent); text-underline-offset: 3px; }\ncode, kbd { font-family: var(--font-mono); font-size: 0.9em; }\n:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }\n::placeholder { color: var(--color-muted); opacity: 0.8; }\n\n.muted { color: var(--color-muted); }\n.hint { margin: 0; color: var(--color-muted); font-size: var(--text-sm); font-weight: 400; }\n.error { margin: 0; color: var(--color-danger); font-size: var(--text-sm); }\n.skip-link { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; position: absolute; left: var(--space-3); top: -60px; padding: var(--space-2) var(--space-3); background: var(--color-text); color: var(--color-bg); z-index: 10; }\n.skip-link:focus { top: var(--space-3); }\n.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }\n\n/* ---------- Layout primitives (src/ui/layout.tsx) ---------- */\n.stack { display: grid; gap: var(--stack-gap, var(--space-4)); align-content: start; }\n.stack > *, .grid > *, .card > *, .content > * { min-width: 0; }\n.inline { display: flex; flex-wrap: wrap; gap: var(--inline-gap, var(--space-2)); align-items: var(--inline-align, center); justify-content: var(--inline-justify, flex-start); }\n.grid { display: grid; gap: var(--grid-gap, var(--space-4)); grid-template-columns: repeat(auto-fit, minmax(min(var(--grid-min, 220px), 100%), 1fr)); }\n.actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }\n\n.page-header { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: flex-end; justify-content: space-between; margin-bottom: var(--space-8); }\n.page-header__text { display: grid; gap: var(--space-1); min-width: 0; }\n.page-header__title { font-size: var(--text-display); line-height: 1.1; }\n.page-header__description { color: var(--color-muted); max-width: 60ch; }\n\n.eyebrow { margin: 0; color: var(--color-muted); font-size: var(--text-xs); font-weight: 600; letter-spacing: var(--tracking-label); text-transform: uppercase; }\n.section-title { margin: 0 0 var(--space-3); font-size: var(--text-sm); font-weight: 600; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--color-muted); }\n\n/* ---------- Panel and Card ---------- */\n.panel {\n display: grid;\n gap: var(--space-4);\n padding: var(--space-6);\n border: 1px solid var(--color-border);\n border-radius: var(--radius-panel);\n background: var(--color-surface);\n box-shadow: var(--shadow-md);\n}\n.panel__title { margin: 0; font: 600 var(--text-lg)/1.2 var(--font-display); }\n\n.card { display: grid; gap: 0; padding: 0; border: 1px solid var(--color-border); border-radius: var(--radius-panel); background: var(--color-surface); box-shadow: var(--shadow-sm); overflow: hidden; }\n.card__header { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; justify-content: space-between; padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--color-border); }\n.card__heading { display: grid; gap: 2px; min-width: 0; }\n.card__title { font-size: var(--text-base); font-weight: 600; letter-spacing: 0; }\n.card__description { color: var(--color-muted); font-size: var(--text-sm); }\n.card__body { padding: var(--space-5); }\n.card__body--flush { padding: 0; }\n.card__footer { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: flex-end; padding: var(--space-3) var(--space-5); border-top: 1px solid var(--color-border); background: var(--color-surface-2); }\n\n/* ---------- Buttons (src/ui/Button.tsx) ---------- */\n.button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: var(--space-2);\n min-height: var(--control-height);\n padding: 0 var(--space-4);\n border: 1px solid var(--color-accent);\n border-radius: var(--radius-control);\n background: var(--color-accent);\n color: var(--color-on-accent);\n font-weight: 600;\n line-height: 1.2;\n white-space: nowrap;\n text-decoration: none;\n cursor: pointer;\n transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;\n}\n.button:hover:not(:disabled) { background: var(--color-accent-hover); border-color: var(--color-accent-hover); }\n.button:disabled { opacity: 0.5; cursor: not-allowed; }\n.button--secondary { background: var(--color-surface); border-color: var(--color-border-strong); color: var(--color-text); }\n.button--secondary:hover:not(:disabled) { background: var(--color-surface-2); border-color: var(--color-border-strong); }\n.button--quiet { background: transparent; border-color: transparent; color: var(--color-text); }\n.button--quiet:hover:not(:disabled) { background: var(--color-accent-soft); border-color: transparent; }\n.button--danger { background: var(--color-danger); border-color: var(--color-danger); color: #fff; }\n.button--danger:hover:not(:disabled) { background: var(--color-danger); border-color: var(--color-danger); filter: brightness(0.92); }\n.button--sm { padding: 0 var(--space-3); font-size: var(--text-sm); }\n.button--block { width: 100%; }\n.button__spinner { width: 1em; height: 1em; border-width: 2px; }\n\n.link-button {\n display: inline-flex; align-items: center; min-height: var(--control-height);\n padding: 0 var(--space-2); border: 0; background: none;\n color: var(--color-accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;\n}\n.link-button:disabled { opacity: 0.5; cursor: not-allowed; }\n.link-button--danger { color: var(--color-danger); }\n\n/* ---------- Fields (src/ui/Field.tsx) ---------- */\n.field { display: grid; gap: 6px; min-width: 0; }\n.field__label { display: flex; justify-content: space-between; gap: var(--space-2); font-size: var(--text-sm); font-weight: 600; }\n.field__optional { color: var(--color-muted); font-weight: 400; }\n.field .control {\n width: 100%;\n min-height: var(--control-height);\n padding: 10px 12px;\n border: 1px solid var(--color-border-strong);\n border-radius: var(--radius-control);\n background: var(--color-surface);\n color: var(--color-text);\n}\n.field .control:hover { border-color: var(--color-muted); }\n.field .control[aria-invalid=\"true\"] { border-color: var(--color-danger); }\n.field .control:disabled { background: var(--color-surface-2); color: var(--color-muted); cursor: not-allowed; }\n.field textarea.control { min-height: calc(var(--control-height) * 2.2); resize: vertical; line-height: 1.5; }\n.field select.control {\n appearance: none;\n padding-right: 40px;\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%2366615a' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E\");\n background-repeat: no-repeat;\n background-position: right 12px center;\n}\n.field input[type=\"date\"].control, .field input[type=\"time\"].control { min-width: 10ch; }\n.field--inline { grid-template-columns: auto 1fr; align-items: center; }\n.field--inline .field__label { font-weight: 400; }\n.field input[type=\"checkbox\"], .field input[type=\"radio\"] { width: 20px; height: 20px; margin: 0; accent-color: var(--color-accent); }\n.field__hint { color: var(--color-muted); font-size: var(--text-sm); }\n.field__error { color: var(--color-danger); font-size: var(--text-sm); }\n.form-row { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(var(--form-row-min, 160px), 100%), 1fr)); align-items: start; }\n\n/* ---------- Tabs (src/ui/Tabs.tsx) ---------- */\n.tabs { display: flex; gap: var(--space-1); padding: var(--space-1); min-height: var(--control-height); border: 1px solid var(--color-border); border-radius: var(--radius-control); background: var(--color-surface-2); overflow-x: auto; scrollbar-width: none; max-width: 100%; }\n.tabs::-webkit-scrollbar { display: none; }\n.tab { flex: 0 0 auto; min-height: calc(var(--control-height) - 8px); padding: 0 var(--space-4); border: 0; border-radius: calc(var(--radius-control) - 2px); background: transparent; color: var(--color-muted); font-weight: 600; font-size: var(--text-sm); white-space: nowrap; cursor: pointer; }\n.tab:hover { color: var(--color-text); }\n.tab[aria-selected=\"true\"] { background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow-sm); }\n\n/* ---------- Badge (src/ui/Badge.tsx) ---------- */\n.badge { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 0 10px; border-radius: var(--radius-pill); background: var(--color-surface-2); border: 1px solid var(--color-border); color: var(--color-text); font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.02em; white-space: nowrap; }\n.badge--accent { background: var(--color-accent-soft); border-color: transparent; color: var(--color-accent); }\n.badge--success { background: var(--color-success-soft); border-color: transparent; color: var(--color-success); }\n.badge--warning { background: var(--color-warning-soft); border-color: transparent; color: var(--color-warning); }\n.badge--danger { background: var(--color-danger-soft); border-color: transparent; color: var(--color-danger); }\n.badge--info { background: var(--color-info-soft); border-color: transparent; color: var(--color-info); }\n.badge__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }\n\n/* ---------- Stat (src/ui/Stat.tsx) ---------- */\n.stat { display: grid; gap: var(--space-2); padding: var(--space-5); border: 1px solid var(--color-border); border-radius: var(--radius-panel); background: var(--color-surface); box-shadow: var(--shadow-sm); }\n.stat__value { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 600; letter-spacing: var(--tracking-display); line-height: 1.1; font-variant-numeric: tabular-nums; }\n.stat__value small { color: var(--color-muted); font-size: 0.55em; font-weight: 500; letter-spacing: 0; margin-left: 0.3em; }\n.stat__detail { color: var(--color-muted); font-size: var(--text-sm); }\n.stat__detail--success { color: var(--color-success); }\n.stat__detail--danger { color: var(--color-danger); }\n.meter { height: 6px; border-radius: var(--radius-pill); background: var(--color-border); overflow: hidden; }\n.meter__fill { height: 100%; border-radius: inherit; background: var(--color-accent); transition: width 240ms ease; }\n\n/* ---------- Table (src/ui/Table.tsx) ---------- */\n.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; container-type: inline-size; }\n.table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); font-variant-numeric: tabular-nums; }\n.table th, .table td { padding: var(--space-3) var(--space-5); text-align: left; vertical-align: middle; border-bottom: 1px solid var(--color-border); }\n.table th { color: var(--color-muted); font-size: var(--text-xs); font-weight: 600; letter-spacing: var(--tracking-label); text-transform: uppercase; white-space: nowrap; background: var(--color-surface-2); }\n.table tbody tr:last-child td { border-bottom: 0; }\n.table tbody tr:hover td { background: var(--color-surface-2); }\n.table .is-numeric { text-align: right; }\n.table__empty { padding: var(--space-8) var(--space-5); text-align: center; color: var(--color-muted); }\n/* A narrow card (a phone): each row becomes a block of label and value lines, so nothing scrolls sideways. */\n@container (max-width: 560px) {\n .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }\n .table, .table tbody, .table tr { display: block; width: 100%; }\n .table tr { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--color-border); }\n .table tbody tr:last-child { border-bottom: 0; }\n .table td { display: flex; gap: var(--space-3); align-items: baseline; padding: var(--space-1) 0; border-bottom: 0; text-align: left; overflow-wrap: anywhere; }\n .table td::before { content: attr(data-label); flex: 0 0 38%; color: var(--color-muted); font-size: var(--text-xs); font-weight: 600; letter-spacing: var(--tracking-label); text-transform: uppercase; }\n .table td.is-numeric { text-align: left; }\n .table tbody tr:hover td { background: transparent; }\n .table .table__empty { display: block; padding: var(--space-6) 0; text-align: center; }\n .table .table__empty::before { content: none; }\n}\n\n/* ---------- Notice (src/ui/Notice.tsx) ---------- */\n.notice { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border); border-left-width: 4px; border-radius: var(--radius-control); background: var(--color-surface); font-size: var(--text-sm); }\n.notice__body { flex: 1 1 240px; display: grid; gap: 2px; min-width: 0; }\n.notice__title { font-weight: 600; }\n.notice--info { border-left-color: var(--color-info); }\n.notice--success { border-left-color: var(--color-success); }\n.notice--warning { border-left-color: var(--color-warning); }\n.notice--danger { border-left-color: var(--color-danger); }\n.notice__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }\n\n/* Alert from feedback.tsx; Notice is preferred for new code. */\n.alert { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; justify-content: space-between; padding: var(--space-3) var(--space-4); border: 1px solid var(--color-danger); border-radius: var(--radius-control); color: var(--color-danger); background: var(--color-surface); }\n.alert p { margin: 0; }\n\n/* ---------- Dialog (src/ui/Dialog.tsx) ---------- */\n.dialog { width: min(480px, calc(100% - 2 * var(--space-4))); padding: 0; border: 1px solid var(--color-border); border-radius: var(--radius-panel); background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow-lg); }\n.dialog::backdrop { background: rgba(20, 20, 18, 0.45); backdrop-filter: blur(2px); }\n.dialog__header { display: flex; align-items: start; justify-content: space-between; gap: var(--space-3); padding: var(--space-5) var(--space-5) 0; }\n.dialog__title { font-size: var(--text-lg); }\n.dialog__body { display: grid; gap: var(--space-4); padding: var(--space-4) var(--space-5) var(--space-5); }\n.dialog__footer { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: flex-end; padding: var(--space-3) var(--space-5); border-top: 1px solid var(--color-border); background: var(--color-surface-2); }\n\n/* ---------- Skeleton (src/ui/Skeleton.tsx) ---------- */\n.skeleton { display: grid; gap: var(--space-2); }\n.skeleton__line { height: 1em; border-radius: 4px; background: linear-gradient(90deg, var(--color-border) 25%, var(--color-surface-2) 50%, var(--color-border) 75%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }\n@keyframes shimmer { to { background-position: -200% 0; } }\n\n/* ---------- Empty state (src/ui/feedback.tsx) ---------- */\n.empty { display: grid; gap: var(--space-2); justify-items: center; padding: var(--space-10) var(--space-6); border: 1px dashed var(--color-border-strong); border-radius: var(--radius-panel); text-align: center; }\n.empty__title { margin: 0; font: 600 var(--text-lg)/1.3 var(--font-display); }\n.empty__body { margin: 0; color: var(--color-muted); max-width: 44ch; }\n\n/* ---------- Loading, unavailable, banner ---------- */\n.loading { display: grid; place-content: center; justify-items: center; gap: var(--space-3); min-height: 100vh; color: var(--color-muted); }\n.unavailable { max-width: 380px; margin: 0 var(--space-4); color: var(--color-text); }\n.unavailable p { margin: 0; }\n.banner { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; justify-content: center; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--color-danger); background: var(--color-surface); color: var(--color-danger); }\n.banner p { margin: 0; }\n.spinner { width: 24px; height: 24px; border: 3px solid var(--color-border); border-top-color: var(--color-accent); border-radius: 50%; animation: spin 0.8s linear infinite; }\n@keyframes spin { to { transform: rotate(360deg); } }\n\n/* ---------- Sign-in (src/ui/AuthCard.tsx) ---------- */\n.auth {\n display: grid;\n grid-template-columns: minmax(0, 1fr) minmax(300px, 400px);\n gap: var(--space-12);\n align-items: center;\n width: min(960px, calc(100% - 2 * var(--space-6)));\n min-height: 100vh;\n margin: 0 auto;\n padding: var(--space-12) 0;\n}\n.auth__intro { display: grid; gap: var(--space-3); align-content: center; }\n.auth__app { margin: 0; color: var(--color-accent); font-weight: 600; }\n.auth__title { margin: 0; font-size: var(--text-display); line-height: 1.05; }\n.auth__column { display: grid; gap: var(--space-4); }\n.auth__form .button { width: 100%; }\n.auth__providers { display: grid; gap: var(--space-2); }\n.auth__switch { margin: 0; text-align: center; color: var(--color-muted); font-size: var(--text-sm); }\n.auth__forgot { margin: 0; text-align: right; font-size: var(--text-sm); }\n.auth__forgot a { display: inline-flex; align-items: center; min-height: 44px; }\n.divider { display: flex; align-items: center; gap: var(--space-3); color: var(--color-muted); font-size: var(--text-sm); }\n.divider::before, .divider::after { content: \"\"; flex: 1; height: 1px; background: var(--color-border); }\n.provider-icon { width: 18px; height: 18px; flex: none; }\n\n/* ---------- Signed-in frame (src/ui/AppShell.tsx) ---------- */\n.shell { min-height: 100vh; }\n.topbar {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--space-4);\n width: min(var(--content-width), calc(100% - 2 * var(--space-6)));\n margin: 0 auto;\n padding: var(--space-3) 0;\n border-bottom: 1px solid var(--color-border);\n}\n.topbar__error { width: min(var(--content-width), calc(100% - 2 * var(--space-6))); margin: var(--space-2) auto 0; }\n.brand { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 44px; font: 600 var(--text-lg)/1 var(--font-display); letter-spacing: var(--tracking-display); color: inherit; text-decoration: none; }\n.account { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }\n.account__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--color-muted); font-size: var(--text-sm); }\n.content { width: min(var(--content-width), calc(100% - 2 * var(--space-6))); margin: 0 auto; padding: var(--space-8) 0 var(--space-16); outline: none; }\n\n/* ---------- Email verification (src/ui/VerifyEmail.tsx) ---------- */\n.verify-email { margin-bottom: var(--space-6); }\n.verify-email__form { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }\n.verify-email__form .field { grid-template-columns: auto auto; align-items: center; }\n.verify-email__form input { width: 8ch; letter-spacing: 0.2em; text-align: center; }\n\n/* ---------- Responsive ---------- */\n@media (max-width: 760px) {\n .auth { grid-template-columns: 1fr; gap: var(--space-6); align-content: start; padding-top: var(--space-8); }\n .auth__title { font-size: var(--text-2xl); }\n .page-header { margin-bottom: var(--space-6); }\n .page-header__title { font-size: var(--text-2xl); }\n .content { padding-top: var(--space-6); }\n}\n@media (max-width: 480px) {\n .panel { padding: var(--space-4); }\n .card__header, .card__body, .card__footer { padding-left: var(--space-4); padding-right: var(--space-4); }\n .table th, .table td { padding-left: var(--space-4); padding-right: var(--space-4); }\n}\n@media (prefers-reduced-motion: reduce) {\n .spinner { animation-duration: 3s; }\n .skeleton__line { animation: none; }\n .button, .meter__fill { transition: none; }\n}\n\n/* ---------- Your app ---------- */\n/* Add page-specific styles below. Use tokens; add a class, don't restyle a tag. */\n";
4
4
  export declare const STYLED_AUTH_CARD = "import type { FormEvent, ReactNode } from 'react';\nimport type { CredentialsForm } from '../../types/auth';\nimport { Button } from './Button';\nimport { TextField } from './Field';\n\ninterface AuthCardProps {\n appName: string;\n /** One line under the title: what the app is for. */\n tagline?: string;\n form: CredentialsForm;\n /** Social sign-in buttons, shown above the email form (see ProviderButtons). */\n providers?: ReactNode;\n /** Anything that belongs under the form: a magic-link form, a terms line. */\n children?: ReactNode;\n}\n\n/** The sign-in page: an intro column and a form column. Add to it through\n * the `providers` and `children` slots; the two-column grid holds exactly\n * these two columns, so don't add siblings to it. */\nexport function AuthCard({ appName, tagline, form, providers, children }: AuthCardProps) {\n const signUp = form.mode === 'sign-up';\n\n function onSubmit(event: FormEvent<HTMLFormElement>) {\n event.preventDefault();\n void form.submit();\n }\n\n return (\n <main className=\"auth\">\n <div className=\"auth__intro\">\n <p className=\"auth__app\">{appName}</p>\n <h1 className=\"auth__title\">{signUp ? 'Create your account' : 'Welcome back'}</h1>\n <p className=\"muted\">{tagline ?? (signUp ? 'It takes a few seconds.' : 'Sign in to continue.')}</p>\n </div>\n <div className=\"auth__column\">\n <form className=\"panel auth__form\" onSubmit={onSubmit} noValidate aria-label={signUp ? 'Create account' : 'Sign in'}\n data-sw-auth=\"form\" data-sw-auth-mode={form.mode}>\n {providers ? (\n <>\n {providers}\n <p className=\"divider\" aria-hidden=\"true\">or use email</p>\n </>\n ) : null}\n <TextField id=\"auth-email\" label=\"Email\" type=\"email\" name=\"email\" autoComplete=\"email\" inputMode=\"email\" autoFocus data-sw-auth=\"email\"\n value={form.email} onChange={(event) => form.setEmail(event.target.value)} />\n <TextField id=\"auth-password\" label=\"Password\" type=\"password\" name=\"password\" data-sw-auth=\"password\"\n autoComplete={signUp ? 'new-password' : 'current-password'}\n minLength={signUp ? form.passwordMinLength : undefined}\n hint={signUp ? `At least ${form.passwordMinLength} characters.` : undefined}\n value={form.password} onChange={(event) => form.setPassword(event.target.value)} />\n {signUp ? null : <p className=\"auth__forgot\"><a href=\"/forgot-password\">Forgot password?</a></p>}\n {form.error ? <p className=\"error\" role=\"alert\" data-sw-auth=\"error\">{form.error}</p> : null}\n <Button type=\"submit\" block disabled={!form.canSubmit} pending={form.pending} data-sw-auth=\"submit\">\n {signUp ? 'Create account' : 'Sign in'}\n </Button>\n <p className=\"auth__switch\">\n {signUp ? 'Already have an account?' : 'New here?'}{' '}\n <button type=\"button\" className=\"link-button\" onClick={form.toggleMode} disabled={form.pending} data-sw-auth=\"mode\">\n {signUp ? 'Sign in' : 'Create an account'}\n </button>\n </p>\n </form>\n {children}\n </div>\n </main>\n );\n}\n";
5
5
  export declare const PLAIN_AUTH_CARD = "import type { FormEvent, ReactNode } from 'react';\nimport type { CredentialsForm } from '../../types/auth';\nimport { Button } from './Button';\nimport { TextField } from './Field';\n\ninterface AuthCardProps {\n appName: string;\n /** One line under the title: what the app is for. */\n tagline?: string;\n form: CredentialsForm;\n /** Social sign-in buttons, shown above the email form (see ProviderButtons). */\n providers?: ReactNode;\n /** What belongs under the form: a magic-link form, a terms line. */\n children?: ReactNode;\n}\n\n/** The sign-in page. Add to it through the `providers` and `children` slots. */\nexport function AuthCard({ appName, tagline, form, providers, children }: AuthCardProps) {\n const signUp = form.mode === 'sign-up';\n\n function onSubmit(event: FormEvent<HTMLFormElement>) {\n event.preventDefault();\n void form.submit();\n }\n\n return (\n <main>\n <h1>{signUp ? 'Create your account' : 'Sign in'} \u00B7 {appName}</h1>\n {tagline ? <p>{tagline}</p> : null}\n {providers}\n <form onSubmit={onSubmit} noValidate aria-label={signUp ? 'Create account' : 'Sign in'} data-sw-auth=\"form\" data-sw-auth-mode={form.mode}>\n <TextField id=\"auth-email\" label=\"Email\" type=\"email\" name=\"email\" autoComplete=\"email\" inputMode=\"email\" autoFocus data-sw-auth=\"email\"\n value={form.email} onChange={(event) => form.setEmail(event.target.value)} />\n <TextField id=\"auth-password\" label=\"Password\" type=\"password\" name=\"password\" data-sw-auth=\"password\"\n autoComplete={signUp ? 'new-password' : 'current-password'}\n minLength={signUp ? form.passwordMinLength : undefined}\n hint={signUp ? `At least ${form.passwordMinLength} characters.` : undefined}\n value={form.password} onChange={(event) => form.setPassword(event.target.value)} />\n {signUp ? null : <p><a href=\"/forgot-password\">Forgot password?</a></p>}\n {form.error ? <p role=\"alert\" data-sw-auth=\"error\">{form.error}</p> : null}\n <Button type=\"submit\" disabled={!form.canSubmit} pending={form.pending} data-sw-auth=\"submit\">\n {signUp ? 'Create account' : 'Sign in'}\n </Button>\n </form>\n <p>\n <button type=\"button\" onClick={form.toggleMode} disabled={form.pending} data-sw-auth=\"mode\">\n {signUp ? 'Sign in' : 'Create an account'}\n </button>\n </p>\n {children}\n </main>\n );\n}\n";
6
6
  export declare const STYLED_VERIFY_EMAIL = "import type { FormEvent } from 'react';\nimport type { EmailVerification } from '../../types/auth';\n\n/** A quiet reminder above the page, never its main call to action. */\nexport function VerifyEmailPanel({ verification }: { verification: EmailVerification }) {\n if (verification.status === 'checking' || verification.status === 'verified') return null;\n if (verification.status === 'unavailable') {\n return (\n <div className=\"notice notice--warning verify-email\" role=\"alert\">\n <p className=\"notice__body\">Could not check whether your email is verified.</p>\n <div className=\"notice__actions\">\n <button type=\"button\" className=\"button button--secondary button--sm\" onClick={verification.retry}>Try again</button>\n </div>\n </div>\n );\n }\n function onSubmit(event: FormEvent<HTMLFormElement>) {\n event.preventDefault();\n void verification.submit();\n }\n return (\n <section className=\"notice notice--info verify-email\" aria-label=\"Verify your email\">\n <div className=\"notice__body\">\n <p className=\"notice__title\">Verify your email</p>\n <p>{verification.sent ? 'Enter the 6-digit code we emailed you.' : verification.entering ? 'Enter the 6-digit code from the latest email we sent you.' : 'We will email you a 6-digit code.'}</p>\n {verification.error ? <p className=\"error\" role=\"alert\">{verification.error}</p> : null}\n </div>\n {verification.entering ? (\n <form className=\"notice__actions verify-email__form\" onSubmit={onSubmit} noValidate>\n <label className=\"visually-hidden\" htmlFor=\"verify-code\">Code</label>\n <input id=\"verify-code\" className=\"control\" inputMode=\"numeric\" autoComplete=\"one-time-code\" maxLength={6} required placeholder=\"000000\"\n value={verification.code} onChange={(event) => verification.setCode(event.target.value)} />\n <button type=\"submit\" className=\"button button--sm\" disabled={!verification.canSubmit} aria-busy={verification.pending}>Verify</button>\n <button type=\"button\" className=\"button button--quiet button--sm\" onClick={() => void verification.sendCode()} disabled={verification.pending}>Send a new code</button>\n </form>\n ) : (\n <div className=\"notice__actions\">\n <button type=\"button\" className=\"button button--secondary button--sm\" onClick={() => void verification.sendCode()} disabled={verification.pending} aria-busy={verification.pending}>\n Email me a code\n </button>\n <button type=\"button\" className=\"button button--quiet button--sm\" onClick={verification.enterCode} disabled={verification.pending}>I already have a code</button>\n </div>\n )}\n </section>\n );\n}\n";
@@ -277,7 +277,7 @@ code, kbd { font-family: var(--font-mono); font-size: 0.9em; }
277
277
  .meter__fill { height: 100%; border-radius: inherit; background: var(--color-accent); transition: width 240ms ease; }
278
278
 
279
279
  /* ---------- Table (src/ui/Table.tsx) ---------- */
280
- .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
280
+ .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; container-type: inline-size; }
281
281
  .table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
282
282
  .table th, .table td { padding: var(--space-3) var(--space-5); text-align: left; vertical-align: middle; border-bottom: 1px solid var(--color-border); }
283
283
  .table th { color: var(--color-muted); font-size: var(--text-xs); font-weight: 600; letter-spacing: var(--tracking-label); text-transform: uppercase; white-space: nowrap; background: var(--color-surface-2); }
@@ -285,6 +285,19 @@ code, kbd { font-family: var(--font-mono); font-size: 0.9em; }
285
285
  .table tbody tr:hover td { background: var(--color-surface-2); }
286
286
  .table .is-numeric { text-align: right; }
287
287
  .table__empty { padding: var(--space-8) var(--space-5); text-align: center; color: var(--color-muted); }
288
+ /* A narrow card (a phone): each row becomes a block of label and value lines, so nothing scrolls sideways. */
289
+ @container (max-width: 560px) {
290
+ .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
291
+ .table, .table tbody, .table tr { display: block; width: 100%; }
292
+ .table tr { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--color-border); }
293
+ .table tbody tr:last-child { border-bottom: 0; }
294
+ .table td { display: flex; gap: var(--space-3); align-items: baseline; padding: var(--space-1) 0; border-bottom: 0; text-align: left; overflow-wrap: anywhere; }
295
+ .table td::before { content: attr(data-label); flex: 0 0 38%; color: var(--color-muted); font-size: var(--text-xs); font-weight: 600; letter-spacing: var(--tracking-label); text-transform: uppercase; }
296
+ .table td.is-numeric { text-align: left; }
297
+ .table tbody tr:hover td { background: transparent; }
298
+ .table .table__empty { display: block; padding: var(--space-6) 0; text-align: center; }
299
+ .table .table__empty::before { content: none; }
300
+ }
288
301
 
289
302
  /* ---------- Notice (src/ui/Notice.tsx) ---------- */
290
303
  .notice { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border); border-left-width: 4px; border-radius: var(--radius-control); background: var(--color-surface); font-size: var(--text-sm); }
@@ -346,6 +359,7 @@ code, kbd { font-family: var(--font-mono); font-size: 0.9em; }
346
359
  .auth__providers { display: grid; gap: var(--space-2); }
347
360
  .auth__switch { margin: 0; text-align: center; color: var(--color-muted); font-size: var(--text-sm); }
348
361
  .auth__forgot { margin: 0; text-align: right; font-size: var(--text-sm); }
362
+ .auth__forgot a { display: inline-flex; align-items: center; min-height: 44px; }
349
363
  .divider { display: flex; align-items: center; gap: var(--space-3); color: var(--color-muted); font-size: var(--text-sm); }
350
364
  .divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--color-border); }
351
365
  .provider-icon { width: 18px; height: 18px; flex: none; }
@@ -796,6 +810,8 @@ export interface Column<Row> {
796
810
  render?(row: Row): ReactNode;
797
811
  numeric?: boolean;
798
812
  width?: string;
813
+ /** The cell's label when a narrow screen stacks each row; defaults to a text header. */
814
+ label?: string;
799
815
  }
800
816
 
801
817
  interface TableProps<Row> {
@@ -808,7 +824,9 @@ interface TableProps<Row> {
808
824
  }
809
825
 
810
826
  /** Rows of like things. Put it in a <Card flush> so the header sits on the
811
- * card edge. For actions per row, add a column that renders quiet buttons. */
827
+ * card edge. For actions per row, add a column that renders quiet buttons.
828
+ * In a card narrower than 560 px (a phone) each row stacks as label and value
829
+ * lines, so the table never scrolls sideways. */
812
830
  export function Table<Row extends object>({ columns, rows, rowKey, empty = 'Nothing here yet.', caption }: TableProps<Row>) {
813
831
  return (
814
832
  <div className="table-wrap">
@@ -829,7 +847,7 @@ export function Table<Row extends object>({ columns, rows, rowKey, empty = 'Noth
829
847
  ) : rows.map((row) => (
830
848
  <tr key={rowKey(row)}>
831
849
  {columns.map((column) => (
832
- <td key={column.key} className={column.numeric ? 'is-numeric' : undefined}>
850
+ <td key={column.key} className={column.numeric ? 'is-numeric' : undefined} data-label={column.label ?? (typeof column.header === 'string' ? column.header : undefined)}>
833
851
  {column.render ? column.render(row) : String((row as Record<string, unknown>)[column.key] ?? '')}
834
852
  </td>
835
853
  ))}
@@ -1 +1 @@
1
- {"version":3,"file":"init-ui-kit.js","sourceRoot":"","sources":["../../src/lib/init-ui-kit.ts"],"names":[],"mappings":"AACA,4EAA4E;AAC5E,6EAA6E;AAC7E,4EAA4E;AAC5E,2EAA2E;AAE3E,4EAA4E;AAE5E,MAAM,CAAC,MAAM,UAAU,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0GzB,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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
10
10
  request: APIRequestContext;
11
11
  }
12
+ /** `role`: an app role declared in db/schema.ts appRoles, granted to this user with your developer
13
+ * credential (the same grant as somewhere's app-roles grant) before newUser returns. */
14
+ export interface NewUserOptions {
15
+ role?: string;
16
+ }
12
17
  /** An ordinary account made through the app's own sign-up form. `verified` is true once its
13
18
  * address was verified with a captured code (verify(), or a project that requires email codes). */
14
19
  export interface Person {
@@ -36,9 +41,11 @@ export interface SignInOptions {
36
41
  }
37
42
  interface Fixtures {
38
43
  _evidence: void;
39
- newUser: () => Promise<TestUser>;
40
44
  anonymous: APIRequestContext;
41
45
  _forms: FormRun;
46
+ /** A fresh signed-in test user. Make several at once: `await Promise.all([newUser(), newUser()])`.
47
+ * `{ role }` grants that app role (declared in db/schema.ts appRoles) before it returns. */
48
+ newUser: (options?: NewUserOptions) => Promise<TestUser>;
42
49
  /** Another signed-out page on the app, in its own browser context (a second person for signUp). */
43
50
  newPage: () => Promise<Page>;
44
51
  signUp: (page: Page, options?: SignUpOptions) => Promise<Person>;
@@ -5,6 +5,7 @@ import { ApiClient } from './client.js';
5
5
  import { getToken, loadProjectConfig } from './config.js';
6
6
  import { buildStorageState, createTestIdentities, expiryOf, messagesAfter } from './test-identities.js';
7
7
  import { diagnostics, rememberSecrets, scrub, describeError, timed, titled } from './test-diagnostics.js';
8
+ import { mark as timelineMark, markProcessStart, span, trackPage } from './test-timeline.js';
8
9
  import { admitReservedAddress, deleteAccount, forgetRecord, generatedAddress, generatedPassword, recordAttempt, recordId } from './form-accounts.js';
9
10
  let loaded;
10
11
  const digests = new WeakMap();
@@ -41,7 +42,9 @@ function runner() {
41
42
  const contexts = [];
42
43
  const partialIds = [];
43
44
  try {
44
- await use(async () => {
45
+ await use(async (options = {}) => {
46
+ if (options.role !== undefined && (typeof options.role !== 'string' || !/^[A-Za-z][A-Za-z0-9_-]{0,63}$/.test(options.role)))
47
+ throw new Error('newUser({ role }): name a role declared in db/schema.ts appRoles.');
45
48
  let created;
46
49
  try {
47
50
  created = await timed(info, 'test-user creation', () => createTestIdentities(client, projectId, 'user', 1, 'pw'));
@@ -54,11 +57,15 @@ function runner() {
54
57
  owned.push(...created.issued);
55
58
  const issued = created.issued[0];
56
59
  rememberSecrets(issued.access_token, issued.refresh_token);
60
+ const granted = options.role === undefined ? undefined : timed(info, 'role grant', () => client.call('POST', '/auth/app-roles/grant', { project_id: projectId, user_id: issued.user.id, role: options.role }))
61
+ .catch((error) => { throw new Error(`newUser({ role: '${options.role}' }): the role was not granted: ${error instanceof Error ? scrub(error.message) : String(error)}`); });
57
62
  const context = await browser.newContext({ baseURL: origin, viewport, isMobile, hasTouch, extraHTTPHeaders: { Origin: origin }, storageState: buildStorageState(origin, host, issued, expiryOf(issued, created.receivedAt)) });
58
63
  contexts.push(context);
64
+ await granted;
59
65
  constrain(context.request, origin, info);
60
66
  digests.set(context.request, target.contractDigest);
61
67
  const page = await timed(info, 'page creation', () => context.newPage());
68
+ trackPage(page, titled(info.project.name, info.title));
62
69
  page.on('load', () => { void page.evaluate("performance.getEntriesByType('navigation')[0]?.duration ?? 0").then(ms => { diagnostics(info).timings['page load'] = ms; }).catch(() => { }); });
63
70
  return { id: issued.user.id, email: issued.user.email, page, request: context.request };
64
71
  });
@@ -68,7 +75,7 @@ function runner() {
68
75
  for (const context of contexts)
69
76
  try {
70
77
  rememberSecrets(...(await context.cookies()).map(cookie => cookie.value));
71
- if (info.status !== info.expectedStatus) {
78
+ if (info.status !== info.expectedStatus && !diagnostics(info).screenshot) {
72
79
  const page = context.pages()[0];
73
80
  if (page && !/auth|login|signup|reset/i.test(new URL(page.url()).pathname)) {
74
81
  const path = info.outputPath('failure.png');
@@ -80,26 +87,25 @@ function runner() {
80
87
  catch {
81
88
  failures.push('Failure screenshot capture failed');
82
89
  }
83
- finally {
90
+ const ids = [...new Set([...owned.map(identity => identity.user.id), ...partialIds])];
91
+ // Contexts close while the exact ids are deleted. The DELETE answer names the ids it removed;
92
+ // only when it does not name every one is the list read back to confirm.
93
+ await Promise.all([
94
+ ...contexts.map(context => context.close().catch(() => { failures.push('Browser context cleanup failed'); })),
95
+ ids.length ? (async () => {
84
96
  try {
85
- await context.close();
97
+ const deleted = await timed(info, 'test-user deletion', () => client.call('DELETE', '/auth/test-users', { project_id: projectId, ids }));
98
+ if (ids.every(id => deleted.ids?.includes(id)))
99
+ return;
100
+ const remaining = await timed(info, 'cleanup confirmation', () => client.call('GET', '/auth/test-users', undefined, { project_id: projectId }));
101
+ if (remaining.identities.some(identity => ids.includes(identity.id)))
102
+ failures.push('Test user cleanup unconfirmed');
86
103
  }
87
104
  catch {
88
- failures.push('Browser context cleanup failed');
105
+ failures.push('Test user cleanup unconfirmed; app rows remain');
89
106
  }
90
- }
91
- const ids = [...new Set([...owned.map(identity => identity.user.id), ...partialIds])];
92
- if (ids.length) {
93
- try {
94
- await timed(info, 'test-user deletion', () => client.call('DELETE', '/auth/test-users', { project_id: projectId, ids }));
95
- const remaining = await timed(info, 'cleanup confirmation', () => client.call('GET', '/auth/test-users', undefined, { project_id: projectId }));
96
- if (remaining.identities.some(identity => ids.includes(identity.id)))
97
- failures.push('Test user cleanup unconfirmed');
98
- }
99
- catch {
100
- failures.push('Test user cleanup unconfirmed; app rows remain');
101
- }
102
- }
107
+ })() : Promise.resolve(),
108
+ ]);
103
109
  if (failures.length)
104
110
  throw new Error(failures.join('; '));
105
111
  }
@@ -123,13 +129,14 @@ function runner() {
123
129
  await context.close();
124
130
  }
125
131
  },
126
- newPage: async ({ browser, baseURL, viewport, isMobile, hasTouch, _forms }, use) => {
132
+ newPage: async ({ browser, baseURL, viewport, isMobile, hasTouch, _forms }, use, info) => {
127
133
  const contexts = [];
128
134
  try {
129
135
  await use(async () => {
130
136
  const context = await browser.newContext({ baseURL, viewport, isMobile, hasTouch });
131
137
  contexts.push(context);
132
138
  const page = await context.newPage();
139
+ trackPage(page, titled(info.project.name, info.title));
133
140
  _forms.pages.add(page);
134
141
  return page;
135
142
  });
@@ -142,6 +149,7 @@ function runner() {
142
149
  // Depends on page so its teardown (screenshots, cookie scrubbing) runs while the page is open.
143
150
  _forms: async ({ page }, use, info) => {
144
151
  const run = new FormRun(info);
152
+ trackPage(page, titled(info.project.name, info.title));
145
153
  run.pages.add(page);
146
154
  try {
147
155
  await use(run);
@@ -150,10 +158,10 @@ function runner() {
150
158
  await run.finish();
151
159
  }
152
160
  },
153
- signUp: async ({ _forms }, use) => { await use((page, options) => signUp(_forms, page, options ?? {})); },
154
- verify: async ({ _forms }, use) => { await use((page, person) => verify(_forms, page, person)); },
155
- signIn: async ({ _forms }, use) => { await use((page, person, options) => signIn(_forms, page, person, options ?? {})); },
156
- signOut: async ({ _forms }, use) => { await use((page, options) => signOut(_forms, page, options ?? {})); },
161
+ signUp: async ({ _forms }, use, info) => { await use((page, options) => span('signUp', { test: titled(info.project.name, info.title) }, () => signUp(_forms, page, options ?? {}))); },
162
+ verify: async ({ _forms }, use, info) => { await use((page, person) => span('verify', { test: titled(info.project.name, info.title) }, () => verify(_forms, page, person))); },
163
+ signIn: async ({ _forms }, use, info) => { await use((page, person, options) => span('signIn', { test: titled(info.project.name, info.title) }, () => signIn(_forms, page, person, options ?? {}))); },
164
+ signOut: async ({ _forms }, use, info) => { await use((page, options) => span('signOut', { test: titled(info.project.name, info.title) }, () => signOut(_forms, page, options ?? {}))); },
157
165
  });
158
166
  loaded = { test, expect: pw.expect };
159
167
  return loaded;
@@ -182,6 +190,7 @@ function constrain(client, origin, info) {
182
190
  catch { }
183
191
  }
184
192
  diagnostics(info).request = { method: String(options.method ?? 'GET').toUpperCase(), path: scrub(url.pathname), status: response.status(), code };
193
+ timelineMark('app-request', { test: titled(info.project.name, info.title), method: String(options.method ?? 'GET').toUpperCase(), path: scrub(url.pathname), status: response.status() });
185
194
  return response;
186
195
  } });
187
196
  }
@@ -196,6 +205,10 @@ const eager = (() => { try {
196
205
  catch {
197
206
  return undefined;
198
207
  } })();
208
+ if (eager) {
209
+ markProcessStart('playwright');
210
+ timelineMark('fixtures:loaded');
211
+ }
199
212
  export const test = eager?.test ?? new Proxy((() => { }), {
200
213
  apply: (_target, receiver, args) => Reflect.apply(runner().test, receiver, args),
201
214
  get: (_target, key) => Reflect.get(runner().test, key),
@@ -335,7 +348,7 @@ export function data(client, table, request) {
335
348
  }
336
349
  export async function ready(page, state = 'ready') {
337
350
  const locator = typeof state === 'string' ? page.locator(state === 'ready' ? '[data-app-state="signed-in"], [data-app-state="signed-out"]' : `[data-app-state="${state}"]`) : state;
338
- await locator.waitFor({ state: 'visible' });
351
+ await span('ready', { state: typeof state === 'string' ? state : 'locator' }, () => locator.waitFor({ state: 'visible' }));
339
352
  }
340
353
  // ---------------------------------------------------------------- sign-up through the app's form
341
354
  //
@@ -402,14 +415,16 @@ class FormRun {
402
415
  failures.push('Failure screenshot capture failed');
403
416
  }
404
417
  }
405
- for (const attempt of this.attempts) {
418
+ // Each account is deleted by its exact id; the deletions run at the same time.
419
+ await Promise.all(this.attempts.map(async (attempt) => {
406
420
  if (attempt.id) {
407
421
  const { client, projectId } = await this.control();
408
422
  const id = attempt.id;
409
- if (await timed(this.info, 'sign-up account deletion', () => deleteAccount(client, projectId, id)))
423
+ const refused = await timed(this.info, 'sign-up account deletion', () => deleteAccount(client, projectId, id));
424
+ if (refused === null)
410
425
  forgetRecord(attempt.record);
411
426
  else
412
- failures.push(`Could not delete the form sign-up account ${attempt.email}; its record is kept and the next somewhere test retries`);
427
+ failures.push(`Could not delete the form sign-up account ${attempt.email} (${refused}); its record is kept and the next somewhere test retries`);
413
428
  }
414
429
  else if (attempt.submitted && !attempt.refused) {
415
430
  // Never delete by address: the account may exist, but this run never learned its id.
@@ -418,7 +433,7 @@ class FormRun {
418
433
  }
419
434
  else
420
435
  forgetRecord(attempt.record);
421
- }
436
+ }));
422
437
  if (failures.length)
423
438
  throw new Error(failures.join('; '));
424
439
  }
@@ -440,7 +455,7 @@ async function pageSays(page) {
440
455
  /** Run one named step; a failure says which step, what the page showed, and the cause, scrubbed. */
441
456
  async function step(page, name, work) {
442
457
  try {
443
- return await work();
458
+ return await span(name, {}, work);
444
459
  }
445
460
  catch (error) {
446
461
  if (error instanceof StepError)
@@ -620,6 +635,7 @@ async function verify(run, page, person) {
620
635
  // a wrong or expired code (401/400) is never retried.
621
636
  let confirmed = await step(page, 'verify: enter the code in the app', () => page.request.post('/api/auth/verify-email', { data: { code } }));
622
637
  for (let wait = 0; confirmed.status() === 404 && wait < 8; wait++) {
638
+ timelineMark('wait', { ms: 250, why: 'verify: code not installed yet (404)' });
623
639
  await new Promise(resolve => setTimeout(resolve, 250));
624
640
  confirmed = await step(page, 'verify: enter the code in the app', () => page.request.post('/api/auth/verify-email', { data: { code } }));
625
641
  }
@@ -671,6 +687,7 @@ async function signIn(run, page, person, options) {
671
687
  const waitMs = Math.min(wait, CODE_GAP_MS);
672
688
  if (run.info.timeout > 0)
673
689
  run.info.setTimeout(run.info.timeout + waitMs + 10_000);
690
+ timelineMark('wait', { ms: waitMs, why: 'signIn: one emailed code a minute' });
674
691
  await page.waitForTimeout(waitMs);
675
692
  result = await submit();
676
693
  }