@atelic-action/ui 8.1.0 → 8.2.0

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.
package/README.md CHANGED
@@ -11,14 +11,14 @@ Every export, grouped by the entry it is imported from. The Storybook column lin
11
11
  | Export | Entry | What it is | Storybook |
12
12
  |---|---|---|---|
13
13
  | `SiteHeader` | `@atelic-action/ui/chrome` | The fixed bar: the lockup, the nav or a page's own stops, the call to action, the burger; transparent, solid, or dark. A nav entry with `columns` is a group that opens a mega menu panel of link columns (nested links, badges), a picture, icon rows, and cards beside a ticked feature card, and `phones` puts up to two tel links in the bar (8.0.0) | [Chrome/SiteHeader](https://ui.atelic.me/?path=/docs/chrome-siteheader--docs) |
14
- | `SiteMenu` | `@atelic-action/ui/chrome` | The phone's full screen menu, on a native modal dialog; a group is an accordion that opens one at a time, every group closed when the menu opens (8.0.0) | [Chrome/SiteMenu](https://ui.atelic.me/?path=/docs/chrome-sitemenu--docs) |
14
+ | `SiteMenu` | `@atelic-action/ui/chrome` | The phone's full screen menu, on a native modal dialog; a group is an accordion that opens one at a time, every group closed when the menu opens (8.0.0); a dark sheet or a light one (`surface`, with `brand` for its top row), the current page underlined on both (8.2.0) | [Chrome/SiteMenu](https://ui.atelic.me/?path=/docs/chrome-sitemenu--docs) |
15
15
  | `ContactDock` | `@atelic-action/ui/chrome` | The floating Get in Touch launcher and its panel of ways to reach the business, inset alike from the right and the bottom, lifting over the phone's sticky bar and riding above the footer; `SiteShell` mounts it from `site.contactDock` (8.0.0) | [Chrome/ContactDock](https://ui.atelic.me/?path=/docs/chrome-contactdock--docs) |
16
16
  | `Footer` | `@atelic-action/ui/chrome` | The default footer: the brand column (the header's lockup, the Google rating linked to the profile, linked address, phone, email), the hours, the link columns, and the closing bar | [Chrome/Footer](https://ui.atelic.me/?path=/docs/chrome-footer--docs) |
17
17
  | `ClosingBar`, `Copyright`, `Credit` | `@atelic-action/ui/chrome` | The line that closes every page, in two sides that each take anything: by default `Copyright` with the business's name on the left and `Credit`, the practice's made with line, on the right | [Chrome/ClosingBar](https://ui.atelic.me/?path=/docs/chrome-closingbar--docs) |
18
18
  | `StickyCTABar` | `@atelic-action/ui/chrome` | The phone's bottom bar: the call to action and a call shortcut, there from the top on an interior page (`fromTop`) and sliding in after a scroll on a hero page | [Chrome/StickyCTABar](https://ui.atelic.me/?path=/docs/chrome-stickyctabar--docs) |
19
- | `BrandLockup` | `@atelic-action/ui/chrome` | The header's identity as one link, with the recipient's mark on a sent document; the brand's own mark per surface (`onLight`, `onDark`), never recolored, at `--brand-mark-height` (8.0.0) | [Chrome/BrandLockup](https://ui.atelic.me/?path=/docs/chrome-brandlockup--docs) |
19
+ | `BrandLockup` | `@atelic-action/ui/chrome` | The header's identity as one link, with the recipient's mark on a sent document; the brand's own mark per surface (`onLight`, `onDark`), never recolored, at `--brand-mark-height` (8.0.0); `surface` draws one ground's mark alone, and `onClick` hears the link followed (8.2.0) | [Chrome/BrandLockup](https://ui.atelic.me/?path=/docs/chrome-brandlockup--docs) |
20
20
  | `SkipLink` | `@atelic-action/ui/chrome` | The keyboard user's jump past the chrome | [Chrome/SkipLink](https://ui.atelic.me/?path=/docs/chrome-skiplink--docs) |
21
- | `Brand`, `BrandLogo`, `CallToAction`, `HoursRow`, `MenuContact`, `NavLink`, `NavPanelSection`, `NavGroupColumn`, `NavGroupLink`, `NavGroupChildLink`, `NavPictureSection`, `NavIconRowsSection`, `NavIconRow`, `NavIcon`, `NavCardsSection`, `NavCard`, `NavFeature`, `HeaderPhone`, `ContactDockConfig`, `ContactDockItem`, `ContactDockIcon`, `Phone`, `PostalAddress`, `SiteLink`, `SocialLink`, `PageStop`, `FooterColumn`, `FooterColumnLink`, `FooterIcon` | `@atelic-action/ui/chrome` | The shapes the chrome renders from (types) | none |
21
+ | `Brand`, `BrandLogo`, `CallToAction`, `HoursRow`, `MenuContact`, `NavLink`, `NavPanelSection`, `NavGroupColumn`, `NavGroupLink`, `NavGroupChildLink`, `NavPictureSection`, `NavIconRowsSection`, `NavIconRow`, `NavIcon`, `NavCardsSection`, `NavCard`, `NavFeature`, `HeaderPhone`, `SiteMenuSurface`, `MenuBurgerStyle`, `ContactDockConfig`, `ContactDockItem`, `ContactDockIcon`, `Phone`, `PostalAddress`, `SiteLink`, `SocialLink`, `PageStop`, `FooterColumn`, `FooterColumnLink`, `FooterIcon` | `@atelic-action/ui/chrome` | The shapes the chrome renders from (types) | none |
22
22
  | `NotFound` | `@atelic-action/ui/components` | The body of the page an unknown path renders | [Components/NotFound](https://ui.atelic.me/?path=/docs/components-notfound--docs) |
23
23
  | `Checklist` | `@atelic-action/ui/components` | A short list of checks, each passed or failed | [Components/Checklist](https://ui.atelic.me/?path=/docs/components-checklist--docs) |
24
24
  | `IconList` | `@atelic-action/ui/components` | A list whose bullets are icons, one for the list or one per item, each in a tone | [Components/IconList](https://ui.atelic.me/?path=/docs/components-iconlist--docs) |
@@ -56,7 +56,7 @@ Every export, grouped by the entry it is imported from. The Storybook column lin
56
56
  | `renderEmail`, `renderFailureEmail` | `@atelic-action/ui/email/render` | The whole email document, and the failure page's | [Email/WeeklyReport](https://ui.atelic.me/?path=/docs/email-weeklyreport--docs) |
57
57
  | `atelicPalette`, `atelicFonts`, `toThemeCSS`, `themeTokenMap`, `Palette`, `Fonts` | `@atelic-action/ui/tokens` | The palette and font stacks, with no React | none |
58
58
  | `useScrollSpy` | `@atelic-action/ui/hooks` | Which section is in the reading band; the header's stops use it | [Chrome/SiteHeader](https://ui.atelic.me/?path=/docs/chrome-siteheader--docs) (the dark bar's stops) |
59
- | `staticNotFoundRouting` | `@atelic-action/ui/routing` | The router options that keep a prerendered not found page alive | none |
59
+ | `staticNotFoundRouting`, `StaticNotFoundOptions` | `@atelic-action/ui/routing` | The router options that keep a prerendered not found page alive; given the router's `useMatches`, its pending view draws the page on a miss alone (8.2.0) | none |
60
60
  | `signToken`, `verifyToken`, `safeNext`, `needsSession` | `@atelic-action/ui/gate` | The access gate's tokens, the safe post sign in path, and the wall's test | none |
61
61
  | `POST`, `createRequestLink` | `@atelic-action/ui/gate/request-link` | The function that emails a sign in link | none |
62
62
  | `GET` | `@atelic-action/ui/gate/verify` | The function that turns a link into a session | none |
@@ -105,8 +105,9 @@ Every export, grouped by the entry it is imported from. The Storybook column lin
105
105
  | `marketingConfig` | `@atelic-action/ui/vite` | A marketing site's whole Vite configuration as one call; with the three Sentry variables it uploads hidden source maps under the commit (8.1.0) | none |
106
106
  | `buildRelease`, `sentryUpload`, `SentryUpload`, `environmentPlugin` | `@atelic-action/ui/vite` | The commit a build is filed under, the source map upload's settings (on only with its three variables), and the plugin that names the build's environment for the browser (8.1.0) | none |
107
107
  | `isMiss`, `MissMatch`, `CATCH_ALL_ROUTE_ID` | `@atelic-action/ui/routing` | Whether a router's matches are a miss (the catch all route, or a route whose params name no page), router free, for a site's root route (8.1.0) | none |
108
- | `startErrorReporting`, `ErrorCatcherScript`, `errorCatcherScript`, `reportError`, `installCatcher`, `readCatcher`, `afterFirstPaint`, `throwLaunchCheck`, `LAUNCH_CHECK_MESSAGE` | `@atelic-action/ui/monitoring` | Error reporting in the browser: the inline early catcher, and the start function that loads the Sentry SDK after first paint, errors only (8.1.0; see [Error Reporting](#error-reporting)) | none |
109
- | `reportServerError`, `withErrorReporting`, `parseDSN`, `parseStack`, `buildEnvelope` | `@atelic-action/ui/monitoring/server` | Error reporting from a function or the middleware, dependency free and built, for what Vercel runs uncompiled (8.1.0) | none |
108
+ | `routerErrorOptions`, `RouteErrorFallback`, `RouteErrorProps`, `reportRouteError` | `@atelic-action/ui/routing` | The router options that report a route's render crash and draw the package's error page in its place, router free (8.2.0; see [Error Reporting](#error-reporting)) | none |
109
+ | `startErrorReporting`, `ErrorCatcherScript` (`enabled`, 8.2.0), `ErrorCatcherScriptProps`, `errorCatcherScript`, `reportError`, `installCatcher`, `readCatcher`, `afterFirstPaint`, `throwLaunchCheck`, `LAUNCH_CHECK_MESSAGE` | `@atelic-action/ui/monitoring` | Error reporting in the browser: the inline early catcher, and the start function that loads the Sentry SDK after first paint, errors only (8.1.0; see [Error Reporting](#error-reporting)) | none |
110
+ | `reportServerError`, `reportServerErrorLater`, `WaitUntilContext`, `refusalError`, `reportRefusedResponse`, `withErrorReporting`, `parseDSN`, `parseStack`, `buildEnvelope` | `@atelic-action/ui/monitoring/server` | Error reporting from a function or the middleware, dependency free and built, for what Vercel runs uncompiled (8.1.0); the later one sends without holding the answer, on the platform's `waitUntil` (8.2.0) | none |
110
111
  | `sections.css` | `@atelic-action/ui/styles/sections.css` | Styles for everything under `sections`, imported after `primitives.css` | none |
111
112
  | `AppProvider`, `AppConfigProvider`, `useAppConfig`, `useNav`, `useUser`, `configureApp`, `getAppConfig`, `AppConfig`, `NavItem`, `AppUser`, `Register` | `@atelic-action/ui/app` | The app shell's seam: the app hands in its config and nav, registers its user type, and reads them back | [App/AppProvider](https://ui.atelic.me/?path=/docs/app-appprovider--docs) |
112
113
  | `AppLayout`, `AppPage`, `AppPageToolbar`, `Breadcrumbs`, `SectionCards`, `DesktopRail`, `MobileTabBar`, `MobileMenu`, `UserMenu`, `PageSkeleton`, `PageError`, `ActionButton`, `FormActionButtons`, `activeSection` | `@atelic-action/ui/app` | The app frame: the rails, the tab bar, the page scaffold with its toolbar and right rail | [App/AppLayout](https://ui.atelic.me/?path=/docs/app-applayout--docs) |
@@ -234,7 +235,7 @@ The menu is a native `<dialog>` opened with `showModal()`, so Escape, focus cont
234
235
  On a statically prerendered TanStack Start site the markup is the easy part. The host serves the `/404` prerender for every miss, and the page survives hydration only with three pieces in the site:
235
236
 
236
237
  1. **A catch all route**, `src/routes/$.tsx`, rendering the site's page (noindexed). Never a dedicated `/404` route: an unknown path then matches only the root, TanStack's hydrate throws, and the page goes blank.
237
- 2. **The router options:** `createRouter({ routeTree, ...staticNotFoundRouting(NotFoundPage) })`. A miss hydrates through its pending state first, so pending has to render the same page or React reports a mismatch.
238
+ 2. **The router options:** `createRouter({ routeTree, ...staticNotFoundRouting(NotFoundPage, { useMatches }) })`, with `useMatches` imported from `@tanstack/react-router` and handed in, so the package imports no router. A miss hydrates through its pending state first, so pending has to render the same page or React reports a mismatch (a pending view of plain `null` is React error 418 and a blank body on every miss). Given `useMatches` (8.2.0), the pending view draws the page on a miss alone (`isMiss`) and nothing on any other route's pending state, so a slow client navigation never shows a bare 404 body with no header; without it, the pending view is the page itself, as before. `catchAllId` names a catch all route other than `/$`.
238
239
  3. **The build:** a `{ path: "/404", prerender: { enabled: true }, sitemap: { exclude: true } }` entry in the Vite `pages` list, and a copy of `dist/client/404/index.html` to `dist/client/404.html`.
239
240
 
240
241
  ```tsx
@@ -392,15 +393,15 @@ The two pieces a reader sees are ordinary components, in `@atelic-action/ui/comp
392
393
 
393
394
  Every site reports its errors to Sentry, errors only and never performance tracing, through three pieces the package owns (8.1.0). A site cannot launch without it: `atelic-check-sentry` stops a production build with no DSN.
394
395
 
395
- 1. **The early catcher.** `ErrorCatcherScript`, first in the root route's `<head>`, is a 443 byte inline script (281 gzipped, ES5, no dependencies) that listens for `error` and `unhandledrejection` from the first moment and holds up to twenty (`CATCHER_CAP`) in a buffer on `window.__atelicErrors` (`CATCHER_GLOBAL`), counting the rest as dropped; the count rides on each replayed error as `earlyDropped`. An error thrown before the app's own JavaScript runs is held, not lost.
396
- 2. **The start function.** `startErrorReporting({ dsn, release, environment })` from `@atelic-action/ui/monitoring` (with `environment` defaulting to the build's `import.meta.env.VITE_ENVIRONMENT`) makes sure the catcher is listening (installing it when the page has none), then after first paint (falling back to the load event where the browser cannot report paints, and to ten seconds whatever happens) loads the Sentry browser SDK, replays what the catcher held, each tagged `early`, and takes the catcher's listeners off so nothing is reported twice. With no `dsn` it does nothing and loads nothing. The SDK chunk is the client set up by hand with six integrations (event filters, function to string, the global handlers, linked errors, dedupe, the page's URL and user agent): no tracing, no replay, no breadcrumbs. Measured alone with esbuild, the chunk weighs 69.9 KB raw, 24.6 KB gzipped, and 22.3 KB in brotli, where the old `@sentry/react` chunk with browser tracing, measured the same way, weighed 136.2 KB, 47.0 KB, and 41.5 KB; a site's own build bundles them with what it shares, so its figures differ (a real site's new chunk measured 81 KB raw and 28 KB gzipped, replacing one of 425 KB raw and 141 KB gzipped). `AppErrorBoundary` hands a render crash to the same buffer (`reportError`), since React keeps a caught crash from the window's handlers; on a page where reporting never started and no inline catcher runs, the crash is let go quietly rather than held by a catcher nobody reads. The package carries `@sentry/browser`, so a site needs no Sentry dependency of its own.
397
- 3. **The server reporter.** `@atelic-action/ui/monitoring/server`, built like the gate so a Vercel function imports it uncompiled: `reportServerError(error, { dsn?, request?, tags?, release?, environment? })` posts a Sentry envelope to the ingest the DSN names (`SENTRY_DSN`, then `VITE_SENTRY_DSN`), with the stack's frames, the runtime as a tag, and the release from `VERCEL_GIT_COMMIT_SHA`. It waits two seconds at most, never throws, and resolves whether or not the send worked. `withErrorReporting(handler)` reports a handler's throw and throws it again. The gate's middleware reports anything it throws, and passes and blocks exactly as before.
396
+ 1. **The early catcher.** `ErrorCatcherScript`, placed first among the root route's `<head>` scripts, is a 443 byte inline script (281 gzipped, ES5, no dependencies) that listens for `error` and `unhandledrejection` from the first moment and holds up to twenty (`CATCHER_CAP`) in a buffer on `window.__atelicErrors` (`CATCHER_GLOBAL`), counting the rest as dropped; the count rides on each replayed error as `earlyDropped`. It is the page's first script and runs before any other script on the page; it is not the first element in `<head>`, since React 19 hoists the title, the meta tags, the preloads, and the stylesheets ahead of it, and nothing it does depends on that. An error thrown before the app's own JavaScript runs is held, not lost.
397
+ 2. **The start function.** `startErrorReporting({ dsn, release, environment })` from `@atelic-action/ui/monitoring` (with `environment` defaulting to the build's `import.meta.env.VITE_ENVIRONMENT`) makes sure the catcher is listening (installing it when the page has none), then after first paint (falling back to the load event where the browser cannot report paints, and to ten seconds whatever happens) loads the Sentry browser SDK, replays what the catcher held, each tagged `early`, and takes the catcher's listeners off so nothing is reported twice. With no `dsn` it does nothing and loads nothing. The SDK chunk is the client set up by hand with six integrations (event filters, function to string, the global handlers, linked errors, dedupe, the page's URL and user agent): no tracing, no replay, no breadcrumbs. Measured alone with esbuild, the chunk weighs 69.9 KB raw, 24.6 KB gzipped, and 22.3 KB in brotli, where the old `@sentry/react` chunk with browser tracing, measured the same way, weighed 136.2 KB, 47.0 KB, and 41.5 KB; a site's own build bundles them with what it shares, so its figures differ (a real site's new chunk measured 81 KB raw and 28 KB gzipped, replacing one of 425 KB raw and 141 KB gzipped). `AppErrorBoundary` hands a render crash to the same buffer (`reportError`), since React keeps a caught crash from the window's handlers; on a page where reporting never started and no inline catcher runs, the crash is let go quietly rather than held by a catcher nobody reads. A route's render crash reaches that boundary too on TanStack Router 1.170, where a route has a catch boundary of its own only when an `errorComponent` applies to it, so on a site that sets none the crash rises to `AppErrorBoundary` and is reported once. A route or a site that sets its own `errorComponent` with no `onCatch` puts a boundary in the way that catches the crash and reports it to nobody. `routerErrorOptions()` (8.2.0, below) closes that: spread into `createRouter`, it gives every route the boundary, its `defaultOnCatch` hands what any of them catches to `reportError` once, and its `defaultErrorComponent` draws the same `ErrorFallback` page, so the report no longer depends on which boundary is nearest. The package carries `@sentry/browser`, so a site needs no Sentry dependency of its own.
398
+ 3. **The server reporter.** `@atelic-action/ui/monitoring/server`, built like the gate so a Vercel function imports it uncompiled: `reportServerError(error, { dsn?, request?, tags?, release?, environment? })` posts a Sentry envelope to the ingest the DSN names (`SENTRY_DSN`, then `VITE_SENTRY_DSN`), with the stack's frames, the runtime as a tag, and the release from `VERCEL_GIT_COMMIT_SHA`. It waits two seconds at most, never throws, and resolves whether or not the send worked. `withErrorReporting(handler)` reports a handler's throw and throws it again. `reportServerErrorLater(error, { context?, ...options })` (8.2.0) starts the same send and returns at once: it hands the send to the platform's `waitUntil`, the `context` a handler was given (an edge middleware's or a function's second argument) or else the request context Vercel keeps for a function, so the function stays alive until the send finishes after the answer has gone; with neither, the send runs without blocking the answer and may be cut short when the runtime freezes. Await `reportServerError` where the report must land before the handler goes on (before a throw, or in a handler that waits anyway); call `reportServerErrorLater` where the person is waiting on the answer (a refused send the form should say at once). The gate's middleware reports anything it throws, and passes and blocks exactly as before. `refusalError(response, service?)` (8.2.0) turns a refused upstream answer (a send the mail service would not take) into an error a report may carry: the service's name, the status, and the error body's `name` and `message` alone, each with anything shaped like an email address replaced by `[address]` and cut to 300 characters, nothing else of the body read; `reportRefusedResponse(response, { service, request, tags, context })` builds it and sends it with `reportServerErrorLater`, resolving once the body is read and never waiting on the send.
398
399
 
399
400
  **The launch check.** Once reporting has started, `window.__atelicErrors.test()` in the browser's console throws an error from the package's own code on the next turn, uncaught, named "Atelic error reporting launch check: thrown on purpose from @atelic-action/ui" (`LAUNCH_CHECK_MESSAGE`). Run it on a site's first production deploy: the error should reach Sentry under the deploy's release and environment with a readable, source mapped stack. A stack of minified names means the upload did not run.
400
401
 
401
402
  Two noises are left out, the list kept short: an error whose top frame is a browser extension's (`chrome-extension://`, `moz-extension://`, `safari-extension://`, `safari-web-extension://`), and the in app webview bridges failing ("Java object is gone", "Error invoking postMessage").
402
403
 
403
- **What is captured:** uncaught errors and unhandled rejections in the browser, from before first paint on; render crashes an error boundary catches; a function's or the middleware's throw, and whatever a function reports by hand. **What is not:** performance, sessions, replays, breadcrumbs, console output, and the expected misses (a contact form's validation answer, a malformed or expired gate cookie). **Privacy:** a server report carries the request's method, its path with no query string, and its user agent, and nothing else from the request: never a body, never another header. A browser report is cut the same way before it leaves the page: the page's URL and each stack frame's file lose their query string and fragment, the referrer goes, and the user agent is the one header kept. A contact form's request holds a person's name, address, and message.
404
+ **What is captured:** uncaught errors and unhandled rejections in the browser, from before first paint on; render crashes `AppErrorBoundary` catches, and with `routerErrorOptions()` any a route's own boundary catches; a function's or the middleware's throw, and whatever a function reports by hand. **What is not:** performance, sessions, replays, breadcrumbs, console output, and the expected misses (a contact form's validation answer, a malformed or expired gate cookie). **Privacy:** a server report carries the request's method, its path with no query string, and its user agent, and nothing else from the request: never a body, never another header. A browser report is cut the same way before it leaves the page: the page's URL and each stack frame's file lose their query string and fragment, the referrer goes, and the user agent is the one header kept. A contact form's request holds a person's name, address, and message.
404
405
 
405
406
  | Variable | Where | What it does |
406
407
  |---|---|---|
@@ -408,7 +409,7 @@ Two noises are left out, the list kept short: an error whose top frame is a brow
408
409
  | `SENTRY_DSN` | the Vercel project, optional | The server's DSN when it should differ from the browser's |
409
410
  | `SENTRY_AUTH_TOKEN`, `SENTRY_ORG`, `SENTRY_PROJECT` | the Vercel project, production | With all three, `marketingConfig` adds the Sentry Vite plugin: it creates a release named by the commit, uploads hidden source maps (`build.sourcemap: "hidden"`, only then), and deletes every map from `dist/` once uploaded. With any missing, the build is unchanged |
410
411
 
411
- `marketingConfig` hands the browser the commit (`VERCEL_GIT_COMMIT_SHA`, else `GITHUB_SHA`) as `import.meta.env.VITE_RELEASE`, the same name the upload's release takes, so a stack trace meets its source maps, and the environment as `import.meta.env.VITE_ENVIRONMENT`: `VERCEL_ENV` (production, preview, development) on Vercel, else the build's mode, since a production build's mode is production on every deploy, a preview's included. `atelic-check-sentry` also fails any build whose DSN is set but is not one.
412
+ `marketingConfig` hands the browser the commit (`VERCEL_GIT_COMMIT_SHA`, else `GITHUB_SHA`) as `import.meta.env.VITE_RELEASE`, the same name the upload's release takes, so a stack trace meets its source maps, and the environment as `import.meta.env.VITE_ENVIRONMENT`: `VERCEL_ENV` (production, preview, development) on Vercel, else the build's mode, since a production build's mode is production on every deploy, a preview's included. `atelic-check-sentry` also fails any build whose DSN is set but is not one, and any whose DSN carries a space or a line break around it, since the build ships the value as it is set (8.2.0).
412
413
 
413
414
  What a site changes. `src/router.tsx` drops its own Sentry import and its `afterFirstPaint`, and starts reporting where the lazy init was:
414
415
 
@@ -424,14 +425,22 @@ if (typeof window !== "undefined") {
424
425
  }
425
426
  ```
426
427
 
427
- `src/routes/__root.tsx` puts the catcher first in `<head>`, and imports the boundary from the package in place of its own copy, so a render crash is reported (the site deletes its `src/shared/components/AppErrorBoundary.tsx` and `ErrorFallback.tsx`, whose package twins are the same page with a long message that wraps):
428
+ The same file hands the router's boundaries to error reporting, two lines (8.2.0). Without them a route crash is still reported by `AppErrorBoundary` unless a route or the site sets its own `errorComponent` with no `onCatch`; with them every route's crash is reported once by its own boundary, whatever error page a route sets:
429
+
430
+ ```ts
431
+ import { routerErrorOptions } from "@atelic-action/ui/routing";
432
+
433
+ const router = createRouter({ routeTree, ...routerErrorOptions() });
434
+ ```
435
+
436
+ `src/routes/__root.tsx` puts the catcher first among the scripts in `<head>`, and imports the boundary from the package in place of its own copy, so a render crash outside a route is reported too (the site deletes its `src/shared/components/AppErrorBoundary.tsx` and `ErrorFallback.tsx`, whose package twins are the same page with a long message that wraps). The catcher renders only when the build has a DSN (`enabled`, 8.2.0, default true), so a build with none ships no catcher holding errors nobody reads:
428
437
 
429
438
  ```tsx
430
439
  import { AppErrorBoundary } from "@atelic-action/ui/artifact";
431
440
  import { ErrorCatcherScript } from "@atelic-action/ui/monitoring";
432
441
 
433
442
  <head>
434
- <ErrorCatcherScript />
443
+ <ErrorCatcherScript enabled={Boolean(env.VITE_SENTRY_DSN)} />
435
444
  <HeadContent />
436
445
  </head>
437
446
  ```
@@ -439,13 +448,13 @@ import { ErrorCatcherScript } from "@atelic-action/ui/monitoring";
439
448
  `api/contact.ts` wraps its handler, and reports a refused send by hand, since that path answers rather than throws:
440
449
 
441
450
  ```ts
442
- import { reportServerError, withErrorReporting } from "@atelic-action/ui/monitoring/server";
451
+ import { reportRefusedResponse, withErrorReporting } from "@atelic-action/ui/monitoring/server";
443
452
 
444
453
  export const POST = withErrorReporting(
445
454
  async (request: Request): Promise<Response> => {
446
455
  // ...the handler as it was, and where Resend refuses:
447
456
  if (!response.ok) {
448
- await reportServerError(new Error(`Resend answered ${response.status}`), { request, tags: { route: "contact" } });
457
+ await reportRefusedResponse(response, { service: "Resend", request, tags: { route: "contact" } });
449
458
  return json(502, { ok: false, error: "Sending failed. Please try again in a moment." });
450
459
  }
451
460
  },
@@ -647,7 +656,13 @@ A row's `icon` is one of `calculator`, `calendar`, `card`, `chat`, `document`, `
647
656
 
648
657
  Every link in a panel that leads to the page being read carries `aria-current="page"`, the picture, the cards, a column heading, and the group's own link included, and a flat bar link on the current page is marked as a group holding it is. On the solid bar the current entry reads `--primary-ink`; over a hero the transparent bar keeps it in `--on-dark` with its siblings and marks it with an underline, so it reads on a dark photograph whatever the theme's primary (8.1.0). The sections share one row and wrap to a second when their least widths outrun it (a picture, icon rows, and cards beside the feature card at a narrow desktop, or two link columns, icon rows, and cards on a wide wrap), so none is squeezed past reading or pushed out of the card. A section's least width is the larger of its floor (a link column's list 120px, the icon rows 320px, the cards 240px, the picture 220px) and its longest word, and words in a panel break only as a last resort, so no label breaks inside a word to make a row fit (8.1.0).
649
658
 
650
- On a phone and a tablet the menu opens each group as an accordion, one at a time, and every group starts closed whenever the menu opens, the one holding the current page included. It draws the same data: each section's heading, a link's children indented under it with the same elbow, the badges kept, icon rows and cards as plain links of their labels and titles, and a picture as a plain link of its caption. A plain entry wears a number, and the numbers count plain entries alone, so a group between them leaves no gap.
659
+ On a phone and a tablet the menu opens each group as an accordion, one at a time, and every group starts closed whenever the menu opens, the one holding the current page included. It draws the same data: each section's heading, a link's children indented under it with the same elbow, the badges kept, icon rows and cards as plain links of their labels and titles, and a picture as a plain link of its caption. A plain entry wears a number, and the numbers count plain entries alone, so a group between them leaves no gap. The link to the page being read carries `aria-current="page"` and, for the eye, the 2px underline the bar marks its current entry with, under its words alone (8.2.0).
660
+
661
+ The menu has two sheets, chosen by `menu.surface` in the config (`SiteHeader`'s `menuSurface`, `SiteMenu`'s `surface`), with one behavior: the native modal dialog traps focus, Escape closes it, focus returns to the burger, and the page behind holds still. `dark`, the default, is the sheet every site had: the dark surface, large light entries with their numbers, the call to action mid sheet, and the contact block at the foot. `light` (8.2.0) sets the page's ground and ink: a top row with the header's lockup, drawn for the light ground and linking home, and a round outlined close button, where focus starts; the entries as rows under hairlines, a group's label bold in ink at a moderate size with a chevron at the right, turning the primary's words while it is open, its sections' headings small quiet caps labels, a link's children, badges, and `quiet` honored; and a foot on `--surface-alt` under a hairline, pushed to the bottom of the screen while the list is short, holding the call to action across its width (with the arrow when `cta.arrow` is set) and a card per header number, an outlined card with the number's words in small caps over the number, the whole card a `tel:` link (the contact block's one phone when the header has none). The light sheet sets no numbers on its entries, and it shows no email and no address: the dark sheet's contact block has them, the light sheet's design does not, so a site that needs them on a phone keeps the dark sheet or puts them on a page. Its top row is the bar's height and is inset as the bar's content is (`--header-max`, `--header-gutter`), so opening the sheet moves neither the lockup nor the button under the reader's thumb, and its row dividers read `--menu-rule` (default `--hairline`). On either sheet the contact dock's launcher steps aside while the menu is open.
662
+
663
+ The burger takes `menu.burger` (`SiteHeader`'s `burger`): `labelAfter` sets the three lines before the words `menuLabel` puts beside it, and `outlined` draws it in an outlined pill; both are off by default (8.2.0). While the menu is open only the lines fold to an X. The phone's round call button beside the burger is named by its number's `label` and the number, or "Call" and the number when it has no label (8.2.0).
664
+
665
+ The menu's words come from the config: the call to action reads `cta.menuLabel` when set, else `cta.label` ("Order ahead for Saturday" in the menu where the bar says "Order ahead"), and each header number reads its `menuLabel`, else its `label`, else "Call" (8.2.0). A number's `label` keeps its place in the desktop bar's phone pill.
651
666
 
652
667
  ```ts
653
668
  // src/site.config.ts
@@ -695,7 +710,9 @@ nav: [
695
710
  },
696
711
  { label: "About", to: "/about" },
697
712
  ],
698
- header: { phones: [{ e164: "+15555550100", display: "(555) 555-0100", label: "The shop" }] },
713
+ header: { phones: [{ e164: "+15555550100", display: "(555) 555-0100", label: "The shop", menuLabel: "Call the shop" }] },
714
+ menu: { surface: "light" },
715
+ cta: { label: "Order ahead", href: "/order", menuLabel: "Order ahead for Saturday", arrow: true },
699
716
  ```
700
717
 
701
718
  `SiteShell` puts the base path on every link and picture a section holds. The footer's Company column lists the entries themselves and never a group's links. A bar holding a group or a number keeps the burger up to 1180px instead of 900px, since it needs the room; the second of two numbers shows from 1360px, and the menu lists both. `header.phones` takes up to two, each a tel link; the first is also the round call button beside the burger on a phone.
@@ -714,6 +731,22 @@ The space a section leaves above and below itself is one token, `--section-space
714
731
 
715
732
  `.section` pads with it, and the steps derived from it keep their old proportion to it: `.section-md` 0.7, `.section-sm` 0.6, `tight-top` and `tight-bottom` a third, the `PricingBand` 0.84, `PageHero` and the not found opener 0.72 on top and 0.5 below, and the `FeatureDetail` rows 0.6, whose first and last rows now sit flush with the section around them. `--block-gap` is the space between a section's heading and the grid under it (`FeatureGrid`, `ProfileCards`, `LinkColumns`, `CalloutPanel`, and `Gallery` at 0.77 of it), and `--card-min` the least a `FeatureGrid` card stands. A site that wants its own value sets the property on `.atelic-ui` in its own sheet, outside the layer. `ArtifactShell` pins `comfortable`, so a document reads as it did; the app shell reads none of these.
716
733
 
734
+ ### Moving to 8.2.0
735
+
736
+ Nothing breaks: every addition is an optional prop, config key, token, or export. On a site that changes nothing, these change, all in or beside the phone menu: a header number with no label, or the contact block's one phone, reads "CALL" in the menu where it read "CALL / TEXT", which told a reader the business answers texts; the phone's round call button for a number with no label is named "Call" and the number where it was named by the number alone; the link to the page being read is underlined in the menu, as the bar marks its current entry; the contact dock's launcher is hidden while the menu is open, where the sheet already covered it; and a labeled burger, while the menu is open, folds only its lines to an X, where its words and its column of lines were caught by the X's rules too, a fault the open sheet covered. The group's own link in an open group now carries `aria-current` when it is the page being read, as the desktop panel's does. The light sheet, which no site has yet, shows no email and no address.
737
+
738
+ - **A light phone menu.** `menu: { surface: "light" }` in the site config (`SiteHeader`'s `menuSurface`, `SiteMenu`'s `surface` and `brand`) draws the menu on the page's ground: the lockup and a round close button across the top, the entries as rows, and the call to action and a card per number in a foot on the alternate ground (see [The Mega Menu](#the-mega-menu)). `dark` stays the default and draws as before. One component and one behavior: focus is trapped, Escape closes it, focus returns to the burger, the page holds still. `BrandLockup` takes `surface`, to draw one ground's mark alone, and `onClick`.
739
+ - **The menu's own words.** `cta.menuLabel` gives the menu's call to action its words where the bar keeps `label`. A header number's new `menuLabel` names it in the menu, falling back to `label`, then to "Call"; `label` keeps its place in the desktop bar's pill.
740
+ - **The light sheet** shows no email and no address, which the dark sheet's contact block does; its top row sits exactly where the bar's lockup and burger sit, and `--menu-rule` sets its dividers.
741
+ - **The burger** takes `menu.burger: { labelAfter, outlined }` (both off): the lines before the words, in an outlined pill.
742
+ - **The sticky bar on a hero page under a solid bar.** `cta.stickyFromTop` says whether the phone's sticky bar shows from the first paint; unset it does on a page without `heroNav`, as before, and a page with a hero under a solid bar sets it false so the bar slides in once the hero scrolls away.
743
+ - **The not found page's pending view.** `staticNotFoundRouting(NotFoundPage, { useMatches })` draws the page on a miss alone, so a slow client navigation shows no bare 404 body; a site drops its own pending component (see [The Not Found Page](#the-not-found-page)).
744
+ - **A refused send as a report.** `reportRefusedResponse(response, { service, request, tags })` from `@atelic-action/ui/monitoring/server` reports an upstream refusal with the status and the body's `name` and `message` alone, every address in them replaced by `[address]`; `refusalError` builds the error alone.
745
+ - **Every route's render crash reaches Sentry, whichever boundary catches it.** On TanStack Router 1.170 a route with no `errorComponent` already rises to `AppErrorBoundary` and is reported once; a route or a site that sets its own `errorComponent` with no `onCatch` caught the crash and reported it to nobody. A site adds the two lines under [Error Reporting](#error-reporting), `createRouter({ routeTree, ...routerErrorOptions() })` from `@atelic-action/ui/routing`, and every route's crash is reported once by its own boundary. The package's error page's Try Again reloads the page, since a loader's error stays on the router's match. `ErrorCatcherScript` takes `enabled` (default true), so the root route renders it only with a DSN. `reportServerErrorLater` from `@atelic-action/ui/monitoring/server` sends without holding the answer, on the platform's `waitUntil`. `atelic-check-sentry` now fails a DSN with a space or a line break around it, which the build would ship as set.
746
+ - **New tokens, each at today's look** (the table under [Tokens](#tokens)): `--hero-kicker-weight`, `--hero-kicker-tracking`, `--hero-kicker-size`, `--hero-lead-size`, `--hero-lead-measure`, `--hero-stack-gap`, `--menu-card-bg`, `--menu-card-ink`, `--menu-rule`, `--callout-sub-transform`, `--callout-sub-tracking`, `--subheading-tracking`, `--footer-link`, `--footer-link-hover`, `--footer-link-hover-decoration`, `--closing-link`, and `--closing-link-hover`. The 8.1.0 tokens whose default is a literal or a keyword default in `defaults.css` now; every default that names another token stays at its read, so a band that restates the named token still reaches it, exactly as in 8.1.0.
747
+ - **A dark ground says so with `data-ground`.** The sections the package draws on a dark or filled ground (the heroes, the credentials band, the callout panel, the price band, the process band, the contact card) wear `data-ground="dark"` or `"primary"`, and `--heading-color` steps aside on `[data-ground="dark"]`, `[data-ground="primary"]`, `.on-primary`, and `.on-dark`, beside the old list of those sections' classes, kept so markup carrying a class without the attribute behaves as before. A new dark section, the package's or a site's, needs only the attribute.
748
+ - **Fixes:** `atelic-check-sentry` fails a `VITE_SENTRY_DSN` of whitespace alone as malformed on every build, since a site's `Boolean(dsn)` treats it as set; `reportServerErrorLater` falls through to the platform's `waitUntil` when the context it is given has none it can call; the dark sheet's call to action is the `Button` primitive (the same markup, now with the base path and the number held whole); the contact dock measures again only on the header's own transition, never one inside it; a `tel:` link of an icon and its words holds its number whole, and the header's phone pill marks its number; `StickyCTABar` tells a swapped in `onSpaceChange` the height at once, where it waited for a resize; the contact dock measures its ceiling again when the header changes size or ends a transition; the header's call to action is the `Button` primitive (the same markup); `Footer` no longer sets `--footer-columns`, which nothing read.
749
+
717
750
  ### Moving to 8.1.0
718
751
 
719
752
  Nothing breaks: every addition is an optional prop, config key, token, or entry. On a site that changes nothing, these change: the footer's hours, linked rating, and lockup; the fixes below; the current nav entry's underline on the solid bar; the credit link's underline; the footer's row wrapping a column before it squeezes a word; an email address breaking only at its @ or a dot; the contact dock never rising into the header; and the eyebrow's rule following its last line. Error reporting arrives for a site to wire.
@@ -987,7 +1020,7 @@ The plain text alternative part ports as plain functions with no React anywhere
987
1020
 
988
1021
  ### Tokens
989
1022
 
990
- The sheets read a set of tokens beyond the theme's palette, type, radii, and layout. Each has a default, declared once in `styles/defaults.css` on `:where(.atelic-ui)`, which weighs nothing, so a theme's own `.atelic-ui` rule wins and sets one only to change it; every default is the value the sheets used before it was a token, so a site that sets none looks as it did (8.0.0). Every layered sheet imports `defaults.css` first, so a sheet loaded alone still finds its defaults. No layered sheet paints a raw color anywhere else: `tst/no-raw-colors.test.ts` sweeps every sheet in `src/styles/` but the ones it excludes by name with a reason (`app.css`, Tailwind source outside the layer), and fails on a hex, a color function, or a named color outside a token's declaration in the defaults sheet, with its few exceptions listed in the test, each with its reason.
1023
+ The sheets read a set of tokens beyond the theme's palette, type, radii, and layout. Each has a default, declared once in `styles/defaults.css` on `:where(.atelic-ui)`, which weighs nothing, so a theme's own `.atelic-ui` rule wins and sets one only to change it; every default is the value the sheets used before it was a token, so a site that sets none looks as it did (8.0.0). Every layered sheet imports `defaults.css` first, so a sheet loaded alone still finds its defaults. Only a default that is a literal value or a system keyword is declared there; an inherited color is `currentColor`, which is the same thing. Every other default stays at the read, marked "read in place" below: a default that names another token (`--menu-cta-bg` falls back to `--primary-fill`, then `--primary`), since declared on the root it would resolve once there and a band that restates the named token below it would no longer reach it, as `--primary-fill` and `--primary-ink` never have; a chain read more than once is written once as a private property on the component's own root (`--_menu-cta-bg` on the menu's sheet, `--_header-gutter` on the bar), where it resolves below any band. Also read in place: one computed on the element itself (`--hero-split-pad`), an inherited one other than a color (`--callout-sub-font`, the plain address's `--footer-nap-weight`), since a custom property cannot hold `inherit`, and `--hero-stack-gap`, whose gaps each keep their own value unset. `defaults.css` lists them in one comment, and `Foundations/ThemeTokens`' `BandRestatingPrimary` and `Chrome/SiteMenu`'s `CTAInABandRestatingPrimary` prove a band reaches them (8.2.0). No layered sheet paints a raw color anywhere else: `tst/no-raw-colors.test.ts` sweeps every sheet in `src/styles/` but the ones it excludes by name with a reason (`app.css`, Tailwind source outside the layer), and fails on a hex, a color function, or a named color outside a token's declaration in the defaults sheet, with its few exceptions listed in the test, each with its reason.
991
1024
 
992
1025
  **The primary does three jobs, and each has its own token.** `--primary` is the brand color as a mark: lines, rules, focus rings, icons, stars, dots, and accents that carry no words. `--primary-fill` is the primary as a field that carries words: the primary button, the dock's launcher and panel head, the split hero and the callout panel bands, the price band, the menu's badges and highlighted row, the reveal slider's after label, the map's directions chip, a step bubble's badge; the words on it read `--on-primary`, and its hover and press darken it, so they stay distinct even where a theme's fill is its old hover shade. `--primary-ink` is the primary as words on `--surface` and `--surface-alt`: the eyebrow, a serif accent in a heading, the current nav entry and panel link, inline accent links, a feature number, the info tone. Both new tokens fall back to `--primary` where they are read, so a site that sets neither looks as it did, and a band that restates `--primary` carries both with it. A bright brand color that cannot pass text contrast keeps `--primary` and sets the other two deeper; the Storybook theme (`.storybook/theme.css`) sets `--primary` `#fc4a1a`, `--primary-fill` `#d63a10` (white on it 4.70 to 1), and `--primary-ink` `#b8300b` (5.38 to 1 on `--surface`, 4.97 on `--surface-alt`, 4.80 under the bar's hover tint).
993
1026
 
@@ -1012,16 +1045,27 @@ The sheets read a set of tokens beyond the theme's palette, type, radii, and lay
1012
1045
  | `--weight-light`, `--weight-regular`, `--weight-medium`, `--weight-semibold`, `--weight-strong`, `--weight-bold`, `--weight-heavy` | 300, 400, 500, 600, 650, 700, 800 | Every font weight in every layered sheet. A font kit with only 400 and 700 maps each name to one of those (medium to 400, semibold, strong, and heavy to 700), so the browser synthesizes no weight |
1013
1046
  | `--brand-mark-height` | `30px` (20px inside `ArtifactShell`) | The header mark's height, and a sent document's recipient mark; the width follows the image's own ratio |
1014
1047
  | `--sticky-cta-space` | `0px`, read in place | The room the phone's sticky bar takes while it shows, which the closing bar pads its foot by; `SiteShell` sets it on its root from `StickyCTABar`'s measurement, and a theme never does |
1015
- | `--header-max`, `--header-gutter` | `--max-width`, `--gutter`, read in place | The bar's and the mega panel's width and side gutter, for a design that runs the bar wider than the content (8.1.0) |
1016
- | `--nav-open-bg`, `--nav-open-ink` | `--hover-tint`, the bar's words | The open group's pill (8.1.0) |
1048
+ | `--header-max`, `--header-gutter` | `--max-width`, `--gutter`, read in place (on the bar, and on the light menu's top row, which sits where the bar's content does) | The bar's and the mega panel's width and side gutter, for a design that runs the bar wider than the content (8.1.0) |
1049
+ | `--nav-open-bg`, `--nav-open-ink` | `--hover-tint` read in place, `currentColor` (the bar's words) | The open group's pill (8.1.0) |
1017
1050
  | `--nav-phone-pad`, `--nav-phone-size` | `6px 16px 6px 12px`, `0.95rem` | The header phone pill's padding and its number's size (8.1.0) |
1018
- | `--heading-transform`, `--heading-weight`, `--heading-tracking`, `--heading-color` | `none`, `--weight-heavy`, `-0.02em`, inherited | Every `h1` and `h2` the package sets (section headings, the heroes', the page hero's). The color never reaches a heading on a filled or dark ground (`.on-primary`, `.on-dark`, the hero, the process band, the callout panel, the price band, the credentials band, the contact card), which reset it, nor one a component colors itself (8.1.0) |
1019
- | `--card-title-color` | inherited | A `FeatureGrid` card's title (8.1.0) |
1020
- | `--callout-transform`, `--callout-sub-font` | `none`, inherited | A `CalloutPanel` title's case and its line's face (8.1.0) |
1021
- | `--proof-star-fill` | `--primary` | A star row in a `ProofStrip` value (8.1.0) |
1022
- | `--hero-split-pad` | the wrap's edge, computed | The split hero's copy sides (8.1.0) |
1023
- | `--footer-mark-height`, `--footer-nap-weight` | `38px`, `--weight-semibold` (the plain address: the column's own) | The footer lockup's mark and the address, phone, and email lines (8.1.0) |
1024
- | `--menu-badge-bg`, `--menu-badge-ink`, `--menu-cta-bg`, `--menu-cta-ink` | `--primary-fill`, `--on-primary` (as 8.0.0 drew them) | The phone menu's badge and call to action. A theme whose sheet's ground equals its primary sets them to `--on-primary` and `--primary-ink`, or they vanish into the sheet (8.1.0) |
1051
+ | `--heading-transform`, `--heading-weight`, `--heading-tracking`, `--heading-color` | `none`, `--weight-heavy`, `-0.02em`, `currentColor` (inherited) | Every `h1` and `h2` the package sets (section headings, the heroes', the page hero's). The color never reaches a heading on a ground that says it is dark or the primary fill, by `data-ground` (8.2.0: every such section the package draws wears it, the hero, the process band, the callout panel, the price band, the credentials band, the contact card, and a site's own dark band may) or by `.on-primary` or `.on-dark`, nor one a component colors itself (8.1.0) |
1052
+ | `--subheading-tracking` | `-0.015em` | Every `h3`'s tracking, and two thirds of it every `h4`'s (`-0.01em` at the default), as `--heading-tracking` reaches `h1` and `h2`; a brand setting headings flat sets it to `0` (8.2.0) |
1053
+ | `--hero-kicker-weight`, `--hero-kicker-tracking`, `--hero-kicker-size` | the eyebrow primitive's own (`--weight-medium`, `0.18em`, `0.74rem`), read in place from its private properties | The hero's eyebrow line, both layouts (8.2.0) |
1054
+ | `--hero-lead-measure` | `52ch` | The hero's lead paragraph's measure, both layouts (8.2.0) |
1055
+ | `--hero-stack-gap` | none; unset, each gap keeps its own (18, 22, and 32px on the full hero, 12, 22, and 26px on the split hero), read in place | One gap between the hero's kicker and headline, headline and lead, and lead and actions, both layouts (8.2.0) |
1056
+ | `--hero-lead-size` | `clamp(1.05rem, 2.2vw, 1.35rem)` | The hero's lead paragraph (`subtitle`), both layouts; a split hero whose lead wraps too long sets it smaller (8.2.0) |
1057
+ | `--card-title-color` | `currentColor` (inherited) | A `FeatureGrid` card's title (8.1.0) |
1058
+ | `--callout-transform`, `--callout-sub-font` | `none`, inherited (read in place, since no custom property can hold `inherit`) | A `CalloutPanel` title's case and its line's face (8.1.0) |
1059
+ | `--callout-sub-transform`, `--callout-sub-tracking` | `none`, `normal` | A `CalloutPanel` subtitle's case and tracking (8.2.0) |
1060
+ | `--proof-star-fill` | `--primary`, read in place | A star row in a `ProofStrip` value (8.1.0) |
1061
+ | `--hero-split-pad` | the wrap's edge, computed on the copy (read in place) | The split hero's copy sides (8.1.0) |
1062
+ | `--footer-mark-height`, `--footer-nap-weight` | `38px`, `--weight-semibold` (the plain address: the column's own, read in place, since no custom property can hold `inherit`) | The footer lockup's mark and the address, phone, and email lines (8.1.0) |
1063
+ | `--footer-link`, `--footer-link-hover` | `--neutral-200`, `--on-dark`, read in place | The footer's column links and every footer link's hover, apart from the neutrals that also draw outlines (8.2.0) |
1064
+ | `--footer-link-hover-decoration` | `none` | The line a footer column link and a contact line take on hover (`underline`), for a theme whose links are already the hover's color, where a hover by color alone shows nothing (8.2.0) |
1065
+ | `--closing-link`, `--closing-link-hover` | `--neutral-300`, `--surface` mixed 96% with `--on-dark`, read in place | The closing bar's links, the credit's among them, and their hover. Their own pair, since the closing bar's links have always read a step quieter than the footer's (8.2.0) |
1066
+ | `--menu-card-bg`, `--menu-card-ink` | `--primary-deep`, `--on-primary`, read in place | The mega panel's feature card: its ground, and its eyebrow, headline, line, and ticked points. The card is the primary field (`.on-primary`), so its button stays light; a theme that sets a light ground here checks the button against it (8.2.0) |
1067
+ | `--menu-rule` | `--hairline`, read in place | The light phone menu's row dividers (8.2.0) |
1068
+ | `--menu-badge-bg`, `--menu-badge-ink`, `--menu-cta-bg`, `--menu-cta-ink` | `--primary-fill`, `--on-primary` (as 8.0.0 drew them), read in place | The phone menu's badge and call to action. A theme whose sheet's ground equals its primary sets them to `--on-primary` and `--primary-ink`, or they vanish into the sheet (8.1.0) |
1025
1069
  | `--link-columns-min` | `170px` | The least a `LinkColumns` column narrows to (8.1.0) |
1026
1070
  | `--section-space`, `--block-gap`, `--card-min` | `clamp(56px, 9vw, 120px)`, `44px`, `240px` | The section rhythm where no `base.css` sets it (an app importing `components.css` alone); with `base.css` the settings under [Density](#density) win |
1027
1071
 
@@ -5,7 +5,7 @@
5
5
  * shipped, so this file imports nothing and touches only what a function and
6
6
  * the middleware runtime both have (fetch, `AbortController`, `crypto`).
7
7
  *
8
- * import { reportServerError, withErrorReporting } from "@atelic-action/ui/monitoring/server";
8
+ * import { reportServerError, reportServerErrorLater, withErrorReporting } from "@atelic-action/ui/monitoring/server";
9
9
  *
10
10
  * Privacy: a report carries the request's method and path, and its user
11
11
  * agent, never its body, its query string, or any other header. A contact
@@ -64,6 +64,56 @@ export declare function buildEnvelope(error: unknown, dsn: string, options?: Omi
64
64
  * failure. With no DSN it sends nothing.
65
65
  */
66
66
  export declare function reportServerError(error: unknown, options?: ServerReportOptions): Promise<boolean>;
67
+ /**
68
+ * What a handler's context offers to keep work running after the answer has
69
+ * gone: the second argument of an edge middleware or a Vercel function
70
+ * (`context.waitUntil`), or any object holding a `waitUntil` like it.
71
+ */
72
+ export interface WaitUntilContext {
73
+ waitUntil(promise: Promise<unknown>): void;
74
+ }
75
+ /**
76
+ * Reports an error without making the caller wait for it. The send starts
77
+ * at once and is handed to the platform's `waitUntil` (the `context` given,
78
+ * else Vercel's request context), which keeps the function alive until it
79
+ * finishes after the answer has gone. With neither, the send still runs,
80
+ * never blocking the answer, and may be cut short if the runtime freezes
81
+ * once the answer is out. Never throws, and returns nothing to wait on.
82
+ *
83
+ * Use `reportServerError`, awaited, where the report must land before the
84
+ * handler goes on (before a throw, in a handler that already waits); use
85
+ * this one where the answer should leave at once (a refusal the person is
86
+ * waiting to read).
87
+ */
88
+ export declare function reportServerErrorLater(error: unknown, options?: ServerReportOptions & {
89
+ context?: WaitUntilContext;
90
+ }): void;
91
+ /**
92
+ * A refused upstream answer as an error a report may carry: the service's
93
+ * name, the status, and the error body's `name` and `message` fields alone,
94
+ * each with anything shaped like an email address replaced by `[address]`
95
+ * and cut to 300 characters. Nothing else of the body is read, and a body
96
+ * that is not JSON leaves the status alone. Never throws.
97
+ *
98
+ * await refusalError(response, "Resend") // Error("Resend answered 422: validation_error: ...")
99
+ */
100
+ export declare function refusalError(response: Response, service?: string): Promise<Error>;
101
+ /**
102
+ * Reports a refused upstream answer (a send the mail service would not
103
+ * take) without holding the caller's own answer: the error is built by
104
+ * `refusalError`, so no address in the refusal survives, and sent by
105
+ * `reportServerErrorLater`. Resolves once the refusal's body is read, never
106
+ * waiting on the send, and never throws.
107
+ *
108
+ * if (!response.ok) {
109
+ * await reportRefusedResponse(response, { service: "Resend", request, tags: { route: "contact" } });
110
+ * return json(502, { ok: false, error: "Sending failed. Please try again in a moment." });
111
+ * }
112
+ */
113
+ export declare function reportRefusedResponse(response: Response, options?: ServerReportOptions & {
114
+ service?: string;
115
+ context?: WaitUntilContext;
116
+ }): Promise<void>;
67
117
  /**
68
118
  * Wraps a function's handler so a throw is reported, then thrown again: the
69
119
  * platform still answers the request as it would have, and Sentry hears of
@@ -5,7 +5,7 @@
5
5
  * shipped, so this file imports nothing and touches only what a function and
6
6
  * the middleware runtime both have (fetch, `AbortController`, `crypto`).
7
7
  *
8
- * import { reportServerError, withErrorReporting } from "@atelic-action/ui/monitoring/server";
8
+ * import { reportServerError, reportServerErrorLater, withErrorReporting } from "@atelic-action/ui/monitoring/server";
9
9
  *
10
10
  * Privacy: a report carries the request's method and path, and its user
11
11
  * agent, never its body, its query string, or any other header. A contact
@@ -183,6 +183,107 @@ export async function reportServerError(error, options = {}) {
183
183
  return false;
184
184
  }
185
185
  }
186
+ /**
187
+ * The platform's own `waitUntil`, read the way `@vercel/functions` reads it,
188
+ * from the request context Vercel keeps on a global symbol, so this file
189
+ * needs no dependency for it. Undefined anywhere else.
190
+ */
191
+ function platformWaitUntil() {
192
+ try {
193
+ const store = globalThis[Symbol.for("@vercel/request-context")];
194
+ const context = store?.get?.();
195
+ const waitUntil = context?.waitUntil;
196
+ return typeof waitUntil === "function" ? waitUntil.bind(context) : undefined;
197
+ }
198
+ catch {
199
+ return undefined;
200
+ }
201
+ }
202
+ /**
203
+ * Reports an error without making the caller wait for it. The send starts
204
+ * at once and is handed to the platform's `waitUntil` (the `context` given,
205
+ * else Vercel's request context), which keeps the function alive until it
206
+ * finishes after the answer has gone. With neither, the send still runs,
207
+ * never blocking the answer, and may be cut short if the runtime freezes
208
+ * once the answer is out. Never throws, and returns nothing to wait on.
209
+ *
210
+ * Use `reportServerError`, awaited, where the report must land before the
211
+ * handler goes on (before a throw, in a handler that already waits); use
212
+ * this one where the answer should leave at once (a refusal the person is
213
+ * waiting to read).
214
+ */
215
+ export function reportServerErrorLater(error, options = {}) {
216
+ const { context, ...report } = options;
217
+ const sending = reportServerError(error, report);
218
+ // The context's own waitUntil first, then the platform's; a context with
219
+ // none that can be called, or one that throws, falls through to the
220
+ // next, and with neither the send runs on its own, never blocking.
221
+ const own = context?.waitUntil;
222
+ const fromContext = typeof own === "function"
223
+ ? (promise) => own.call(context, promise)
224
+ : undefined;
225
+ for (const find of [() => fromContext, platformWaitUntil]) {
226
+ try {
227
+ const hold = find();
228
+ if (!hold)
229
+ continue;
230
+ hold(sending);
231
+ return;
232
+ }
233
+ catch {
234
+ // This one could not hold the send; the next is tried.
235
+ }
236
+ }
237
+ }
238
+ /** Anything shaped like an email address, which a refusal may quote (the recipient, the sender). */
239
+ const ADDRESS = /[^\s@<>()[\]"',;:]+@[^\s@<>()[\]"',;:]+\.[^\s@<>()[\]"',;:]+/g;
240
+ /** The longest a refusal's field is kept, so a report never carries a page of text. */
241
+ const REFUSAL_FIELD_MAX = 300;
242
+ /**
243
+ * A refused upstream answer as an error a report may carry: the service's
244
+ * name, the status, and the error body's `name` and `message` fields alone,
245
+ * each with anything shaped like an email address replaced by `[address]`
246
+ * and cut to 300 characters. Nothing else of the body is read, and a body
247
+ * that is not JSON leaves the status alone. Never throws.
248
+ *
249
+ * await refusalError(response, "Resend") // Error("Resend answered 422: validation_error: ...")
250
+ */
251
+ export async function refusalError(response, service = "The upstream service") {
252
+ let body = {};
253
+ try {
254
+ const parsed = await response.json();
255
+ if (parsed && typeof parsed === "object")
256
+ body = parsed;
257
+ }
258
+ catch {
259
+ // Not JSON, or already read: the status says what there is to say.
260
+ }
261
+ const parts = [body.name, body.message]
262
+ .filter((part) => typeof part === "string" && part.trim() !== "")
263
+ .map((part) => part.replace(ADDRESS, "[address]").slice(0, REFUSAL_FIELD_MAX));
264
+ return new Error(`${service} answered ${response.status}${parts.length ? `: ${parts.join(": ")}` : ""}`);
265
+ }
266
+ /**
267
+ * Reports a refused upstream answer (a send the mail service would not
268
+ * take) without holding the caller's own answer: the error is built by
269
+ * `refusalError`, so no address in the refusal survives, and sent by
270
+ * `reportServerErrorLater`. Resolves once the refusal's body is read, never
271
+ * waiting on the send, and never throws.
272
+ *
273
+ * if (!response.ok) {
274
+ * await reportRefusedResponse(response, { service: "Resend", request, tags: { route: "contact" } });
275
+ * return json(502, { ok: false, error: "Sending failed. Please try again in a moment." });
276
+ * }
277
+ */
278
+ export async function reportRefusedResponse(response, options = {}) {
279
+ const { service, ...report } = options;
280
+ try {
281
+ reportServerErrorLater(await refusalError(response, service), report);
282
+ }
283
+ catch {
284
+ // A report never becomes a second failure.
285
+ }
286
+ }
186
287
  /**
187
288
  * Wraps a function's handler so a throw is reported, then thrown again: the
188
289
  * platform still answers the request as it would have, and Sentry hears of
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atelic-action/ui",
3
- "version": "8.1.0",
3
+ "version": "8.2.0",
4
4
  "description": "Shared UI for the Atelic templates: site chrome, base styles, the component library, the access gate, and the app shell they install",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -8,6 +8,15 @@ export interface BrandLockupProps {
8
8
  * brand's name when they are its name in another case), then "home".
9
9
  */
10
10
  ariaLabel?: string;
11
+ /**
12
+ * The one ground the lockup sits on, for a place outside the header that
13
+ * only ever wears one (the light phone menu's top row): that surface's
14
+ * mark alone, as the footer draws its own. Left out, the header draws
15
+ * both and its bar shows the one for its state.
16
+ */
17
+ surface?: MarkSurface;
18
+ /** Called when the link is followed, before the browser navigates. */
19
+ onClick?: () => void;
11
20
  }
12
21
 
13
22
  /**
@@ -103,7 +112,7 @@ export function LockupParts({
103
112
  * every child, image alt included, and it always holds the words the link
104
113
  * shows, so what a reader sees is what a voice user can say.
105
114
  */
106
- export function BrandLockup({ brand, ariaLabel }: BrandLockupProps) {
115
+ export function BrandLockup({ brand, ariaLabel, surface, onClick }: BrandLockupProps) {
107
116
  const { name, href = "/", logo, recipient } = brand;
108
117
  const wordmark = lockupWords(name, logo);
109
118
  // The visible words lead the name. A wordmark that is the name in another
@@ -112,8 +121,8 @@ export function BrandLockup({ brand, ariaLabel }: BrandLockupProps) {
112
121
  wordmark === null || name.toLowerCase().includes(wordmark.toLowerCase()) ? name : wordmark;
113
122
  const label = ariaLabel ?? (recipient ? `${words} × ${recipient.alt} home` : `${words} home`);
114
123
  return (
115
- <a className="nav-logo" href={href} aria-label={label}>
116
- <LockupParts name={name} logo={logo} />
124
+ <a className="nav-logo" href={href} aria-label={label} onClick={onClick}>
125
+ <LockupParts name={name} logo={logo} surface={surface} />
117
126
  {recipient && (
118
127
  <>
119
128
  <span className="nav-x" aria-hidden="true">
@@ -2,7 +2,7 @@ import { ChevronRight, MessageCircle, X } from "lucide-react";
2
2
  import { type RefObject, useEffect, useId, useRef, useState } from "react";
3
3
  import { useDismiss } from "../hooks/useDismiss";
4
4
  import { newTabProps } from "../lib/newTabProps";
5
- import { holdPhoneNumbers, isTel } from "../lib/phoneText";
5
+ import { telText } from "../lib/phoneText";
6
6
  import type { ContactDockConfig } from "../types";
7
7
  import { dockIcons } from "./icons";
8
8
 
@@ -186,7 +186,13 @@ export function ContactDock({
186
186
  : typeof avoid === "string"
187
187
  ? document.querySelector(avoid)
188
188
  : avoid.current;
189
+ // A transition ending inside the header (a pill's hover, a panel's
190
+ // chevron) moves nothing; only the header's own counts.
191
+ const onHeadTransition = (event: Event) => {
192
+ if (event.target === head) schedule();
193
+ };
189
194
  const bind = () => {
195
+ head?.removeEventListener("transitionend", onHeadTransition);
190
196
  bar = findBar();
191
197
  footer = findFooter();
192
198
  head = findHeader();
@@ -200,6 +206,13 @@ export function ContactDock({
200
206
  shows?.observe(bar, { attributes: true, attributeFilter: ["data-showing", "class"] });
201
207
  }
202
208
  if (footer) sizes?.observe(footer);
209
+ // The header sets the launcher's ceiling, so a change in its size (a
210
+ // logo that loads late, a bar that grows) measures again, and so does
211
+ // the end of its own transition, which moves it without resizing it.
212
+ if (head) {
213
+ sizes?.observe(head);
214
+ head.addEventListener("transitionend", onHeadTransition);
215
+ }
203
216
  measure();
204
217
  };
205
218
  // A route change swaps the footer, and a bar can mount after the dock:
@@ -230,6 +243,7 @@ export function ContactDock({
230
243
  cancelAnimationFrame(bound);
231
244
  window.removeEventListener("scroll", schedule);
232
245
  window.removeEventListener("resize", schedule);
246
+ head?.removeEventListener("transitionend", onHeadTransition);
233
247
  sizes?.disconnect();
234
248
  shows?.disconnect();
235
249
  added?.disconnect();
@@ -298,7 +312,7 @@ export function ContactDock({
298
312
  {items.map((item, at) => {
299
313
  const Icon = dockIcons[item.icon ?? "chat"];
300
314
  // A call row holds its number whole and wraps its words.
301
- const words = (text: string) => (isTel(item.href) ? holdPhoneNumbers(text) : text);
315
+ const words = (text: string) => telText(item.href, text);
302
316
  const inner = (
303
317
  <>
304
318
  <span className="cd-item-icon">
@@ -1,5 +1,5 @@
1
1
  import { Mail, Star, UserRound } from "lucide-react";
2
- import type { ComponentProps, CSSProperties, Ref } from "react";
2
+ import type { ComponentProps, Ref } from "react";
3
3
  import { breakableEmail } from "../lib/emailText";
4
4
  import { newTabProps } from "../lib/newTabProps";
5
5
  import type {
@@ -255,10 +255,7 @@ export function Footer({
255
255
  <>
256
256
  <footer ref={ref} className="footer">
257
257
  <div className="wrap">
258
- <div
259
- className={hoursShown ? "footer-grid has-hours" : "footer-grid"}
260
- style={{ "--footer-columns": shown.length + (hoursShown ? 1 : 0) } as CSSProperties}
261
- >
258
+ <div className={hoursShown ? "footer-grid has-hours" : "footer-grid"}>
262
259
  <div className="footer-brand">
263
260
  {logo?.tile ? (
264
261
  <p className="footer-wordmark">