@atelic-action/ui 8.2.0 → 8.4.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
@@ -18,7 +18,7 @@ Every export, grouped by the entry it is imported from. The Storybook column lin
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
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`, `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 |
21
+ | `Brand`, `BrandLogo`, `CallToAction`, `HoursRow`, `MenuContact`, `NavLink`, `NavPanelSection`, `NavGroupColumn`, `NavGroupLink`, `NavGroupChildLink`, `NavPictureSection`, `NavIconRowsSection`, `NavIconRow`, `NavIcon`, `NavCardsSection`, `NavCard`, `NavFeature`, `HeaderPhone`, `SiteMenuSurface`, `MenuBurgerStyle`, `FooterHoursPlacement`, `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) |
@@ -105,7 +105,7 @@ 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
- | `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 |
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)) | [Routing/RouteErrorFallback](https://ui.atelic.me/?path=/docs/routing-routeerrorfallback--docs) |
109
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
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 |
111
111
  | `sections.css` | `@atelic-action/ui/styles/sections.css` | Styles for everything under `sections`, imported after `primitives.css` | none |
@@ -235,7 +235,7 @@ The menu is a native `<dialog>` opened with `showModal()`, so Escape, focus cont
235
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:
236
236
 
237
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.
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
+ 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 `/$`. The pending view counts as a miss the catch all route's match, a route whose `staticData.missing(params)` says its params name no page, and a match the router already reports as not found (8.3.0). **A route with params that can claim a path with no page behind it (a blog slug nobody wrote) sets `staticData.missing`**: the host serves that path the 404 prerender, which hydrates through the pending state before the route's loader runs, so a loader's `notFound()` arrives too late for that first render and the page would hydrate blank.
239
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`.
240
240
 
241
241
  ```tsx
@@ -395,7 +395,7 @@ Every site reports its errors to Sentry, errors only and never performance traci
395
395
 
396
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
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
+ 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]` (a sentence's closing period kept outside it) and anything shaped like a phone number (grouped as one is written, or a plus sign and its digits run together) by `[number]` (8.3.0), then cut to 300 characters, nothing else of the body read. The fields are still the upstream's free text: a name or a street quoted in words passes through, so report the refusals of a service whose errors are about the request, never one that echoes what a person wrote; `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.
399
399
 
400
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.
401
401
 
@@ -612,9 +612,9 @@ export function SiteShell(props: Omit<SiteShellProps, "currentPath" | "basePath"
612
612
  Every site's footer has one shape, and `Footer` draws it (7.0.0):
613
613
 
614
614
  - **The brand column:** the header's lockup (the mark with the wordmark beside it, or the mark alone when `logo.wordmark` is false), then the Google rating beside five stars, the whole line one link to the business's Google profile when it has one, then the one address, the headquarters, linked to the same profile, then the phone and the email, each a link.
615
- - **The hours,** when the site gives them: a column of their own headed Hours (`hoursHeading`), each row's days beside or over its range, as the column's width allows (8.1.0).
615
+ - **The hours,** when the site gives them: a column of their own headed Hours (`hoursHeading`), each row's days beside or over its range, as the column's width allows (8.1.0). On a phone, where the footer is two across, the cells under the brand column pair up with none left alone (8.3.0): beside an even count of link columns the hours take the row's whole width with their rows two across and the link columns pair up under them, and beside an odd count the hours stay a column of their own, rows stacked, paired with the first link column, as in 8.1.0. `Footer` counts the link columns it draws (a column with no links is left out first). `footer.hoursPlacement: "brand"` (`Footer`'s `hoursPlacement`, 8.3.0) sets them inside the brand column instead, under the address, the phone, and the email, as a compact list (days, then ranges) under a small Hours label, so the four link columns keep the row's room. In that placement each link column is at least ten times its link text's size wide (so `--footer-link-size` scales it) and never narrower than its longest label, and the brand column is as wide as its content needs, its longest line set whole (the lockup, the rating, an address line, the email, a row of the hours), so a short brand block is as narrow as it reads and `--footer-brand-width` shares out the rest (8.4.0); while the row holds every floor, the brand column and the link columns share it, and when it cannot, the brand column takes a row of its own with the link columns under it, all across while their floors fit and two by two below that (8.3.0). The floors are measured for the link columns `Footer` draws, so two or three columns keep the brand column beside them as long as theirs fit. The link columns share one box beside the brand column, so the brand column sits beside all of them or above all of them, never beside some; inside it one measure, the floors against the box's own width, drives the four across or two by two step, so no breakpoint disagrees with it, and a font a few percent wider than a site was drawn in still holds a three word label on one line.
616
616
  - **Four link columns:** Company, Resources, Social, and Legal, in that order. From 760px the columns share one row at their shares but never narrower than their longest word, wrapping a column to a second row before a label breaks inside itself (8.1.0). A Social link carries its icon in front of its words. A column with no links is left out, and the grid sizes itself to the columns shown.
617
- - **The closing bar:** `ClosingBar` under it all, `Copyright` with the business's name on the left and `Credit` on the right.
617
+ - **The closing bar:** `ClosingBar` under it all, `Copyright` with the business's name on the left and `Credit` on the right while the two share a line; when they do not (a phone, a long attribution), the credit wraps under the copyright and both start at the same edge, and a copyright longer than the line wraps inside itself (8.3.0).
618
618
 
619
619
  The rating's stars are hidden from assistive technology, so the line, linked or not, is named by its words ("4.8 on Google"); `ratingLabel` gives the link a fuller name when a site wants one ("4.8 on Google, opens the Google profile"). Linked, it opens in a new tab as the address does. With the hours the footer holds six columns, so from 760px to 1100px the brand column keeps a row of its own above the other five, and from 1100px all six share one row with the brand column a little wider; a phone sets the brand column over two across, as without them. The rating's five stars read `--star-fill`, the same token `StarRating`'s filled star reads, and fall back to `--review-gold` (`#f5b301`) when a theme sets none, so one line in `theme.css` recolors every star on a site (8.0.0). The logo is the header's lockup drawn on the dark band (8.1.0): the mark the dark surface resolves to, by the header's own order (see the table under [Rendering From Props](#rendering-from-props)), with the wordmark beside it, composed by the same parts the header's `BrandLockup` draws. Its picture is silent there, since the words name it. `logo.wordmark: false` draws the mark alone, named by `logo.alt`; a glyph tile keeps the name beside it, and a logo with no picture is the words alone. The column headings are level 2 by default (`headingLevel` takes 2 to 6): the footer is a landmark beside the page's main content, so its sections sit one level under the page's `h1` whatever the page's own outline ends on, which satisfies axe's `heading-order` on every page and keeps the columns in a screen reader's heading list. Each is a `div` with `role="heading"` and `aria-level`, wearing `.footer-heading`, rather than an `h2`: a site's own bare `h2` rule is unlayered, so it beats every rule in the package's layer whatever its weight, and it is written for a page's section titles, not these small labels. A heading by role keeps the outline and matches no element rule, with no `!important` and no specificity raised.
620
620
 
@@ -627,7 +627,7 @@ The header carries the services and the service areas, so the footer does not re
627
627
  | The rating | `footer.rating`, as printed (`"4.8 on Google"`) |
628
628
  | The rating's link | `footer.ratingHref`, else `mapLinkURL`, the Google profile, whenever a rating is set; `footer.ratingLabel` names it |
629
629
  | The address and its link | `address` and `mapLinkURL`; `footer.showAddress: false` drops the address |
630
- | The hours | `hours`, each row's `labelShort` and its range on `clock`; `footer.showHours: false` keeps them out of the footer and in the structured data |
630
+ | The hours | `hours`, each row's `labelShort` and its range on `clock` and `meridiem`, short ("8a to 5p") unless `footer.hoursShort` is false ("8:00a to 5:00p", or "8:00 am to 5:00 pm" with `meridiem: "word"`); `footer.hoursPlacement` sets them as a column (the default) or inside the brand column; `footer.showHours: false` keeps them out of the footer and in the structured data |
631
631
  | The phone and the email | `phone`, `email` |
632
632
  | Company | `nav` |
633
633
  | Resources | `footerLinks` |
@@ -662,7 +662,7 @@ The menu has two sheets, chosen by `menu.surface` in the config (`SiteHeader`'s
662
662
 
663
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
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.
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. With no header numbers the menu lists the contact block's one phone, which reads `phone.menuLabel`, else "Call", on either sheet (8.4.0); only the menu reads it, and `ContactInfoCard`'s row takes its own `phoneLabel`.
666
666
 
667
667
  ```ts
668
668
  // src/site.config.ts
@@ -731,6 +731,57 @@ The space a section leaves above and below itself is one token, `--section-space
731
731
 
732
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.
733
733
 
734
+ ### Moving to 8.4.0
735
+
736
+ No API breaks. One optional config key is new, `phone.menuLabel`, which makes this a minor; everything else is a fix.
737
+
738
+ **The phone menu's words for a line that answers texts.** A site with no header numbers that wants "Call / Text" in its phone menu sets `phone.menuLabel` on the contact phone in its config; a site with header numbers sets `phones[].menuLabel` on each (`header.phones`), which still wins for those numbers; and `ContactInfoCard`'s row takes its own `phoneLabel`. Unset, each says "Call", as in 8.3.0.
739
+
740
+ **Changes on a site that changes nothing:**
741
+
742
+ 1. **The footer with the hours in the brand column** (`footer.hoursPlacement: "brand"`). The brand column's floor is its content, the width its longest line takes whole (the lockup, the rating, an address line, the email, a row of the hours), where it was a fixed 17em, so a short brand block narrows and `--footer-brand-width` shares out the room; on a row that holds every column the brand column comes in by the difference and the link columns widen by their share (the stories' bakery: the brand column 295 to 281px on a 1200 wrap, each link column 4px wider). Each link column's floor is ten of its link text's size, so a site that sets `--footer-link-size` moves the floors with it; at the default nothing there moves. Where the brand column already took its own row, nothing moves.
743
+ 2. **On a phone page whose sticky bar slides in after a scroll**, the closing bar is padded by the bar's height from the first measure rather than once the bar shows, so one jump straight to the end lands with the closing bar's last line above the bar; the page's end is that much longer from the start. A desktop reserves nothing, as before.
744
+ 3. **`ContactInfoCard`'s email** breaks after the @ and before each dot on a narrow card, as the footer's does, where a long address broke inside a word. An address that fits reads as before.
745
+
746
+ The rest, in detail:
747
+
748
+ - **`StickyCTABar`'s `onSpaceChange`** hears the bar's height from the first measure wherever it can show, slid in or not, and 0 on a desktop; it no longer hears 0 and the height again as the bar slides out and in. Past the swap cap (three swaps in a row with nothing measured) the outgoing listener is still told 0 when it holds a height, and the arrival waits for the next measure; a listener that stores an object, made anew each render, now ends cut off at 0, where it ended holding the height by accident. Store a plain number, or memoize the listener.
749
+ - **Server reports follow an error's `cause`**, up to five deep, into Sentry's chained exceptions: innermost first, each cause under the `chained` mechanism linked to its parent, the thrown value `exception_id` 0 under the `generic` mechanism, handled. A cause's `code` (ENOTFOUND, ECONNRESET) leads its message when the message does not say it, a cause's words take the refusal's address and number scrub, every message is cut to 300 characters (the thrown value's too, which was not cut before), and a cycle ends the chain. An error with no cause is sent as before.
750
+ - **`refusalError`'s scrub** also takes a country code written with no plus sign (`1-555-555-0142`) and a trailing extension (`x12`, `ext. 12`), where an extension left the whole number in place, and no longer takes a dotted IPv4 address for a number. Dates, bare ids, a count beside a year, and status codes still stay.
751
+ - **`--hero-kicker-display`'s default** (`inline-block`) is declared in `defaults.css`, where it was written inline; nothing moves.
752
+ - `HoursRow` and `isMiss` have their doc comments back on them, and the routing tests check the 404 head and the pending view against an answer table written by hand.
753
+
754
+ ### Moving to 8.3.0
755
+
756
+ No API breaks: every prop, config key, token, class, and export a site uses still works, and every addition is optional (a minor release for that reason). Three things change on screen all the same.
757
+
758
+ **Changes on a site that changes nothing:**
759
+
760
+ 1. **The closing bar on a phone stacks.** Where its two sides do not share a line, the credit wraps under the copyright at the same left edge, where it sat at the right of its own line.
761
+ 2. **The footer's hours on a phone, beside an even count of link columns** (the default four, or two), span the row with their rows two across and the link columns pair under them; beside an odd count nothing changes from 8.1.0.
762
+ 3. **`ContactInfoCard`'s single phone row reads "Call"** where it read "Call / Text", which told a reader the business answers texts. `phoneLabel="Call / Text"` restores it. 8.2.0 made the same change in the phone menu, where `phones[].menuLabel` restores it, so **a site whose business does answer texts sets both.**
763
+
764
+ The rest of what an unchanged site sees, in detail:
765
+
766
+ - **The closing bar on a phone.** Where its two sides do not share a line, the credit (or a site's note) wraps under the copyright and both start at the same edge, where the credit sat at the right of its own line and the two lines zigzagged. On one line they stay as before. No breakpoint decides it, so a long attribution on a tablet stacks the same way, and a copyright longer than the line wraps inside itself.
767
+ - **The footer's hours on a phone, beside an even count of link columns** (the default footer's four, or two). Two across, the hours take the row's whole width under the brand column, their rows two across, and the link columns pair up under them, where the hours sat beside the first link column and left a hole under themselves when that column ran longer. **Beside an odd count** (three, say) nothing changes from 8.1.0: the hours stay a column of their own beside the first link column, so the cells pair and none hangs alone. From 760px nothing moves.
768
+ - **`ContactInfoCard`'s single phone row** reads "Call" where it read "Call / Text", which told a reader the business answers texts; `phoneLabel` gives it other words.
769
+ - **An `h4` under a theme that sets `--subheading-tracking: normal`** is flat, where it took its parent's tracking. At the default nothing moves.
770
+ - **The sticky bar's `onSpaceChange`.** A listener swapped in is told the current height at once and the one it replaced gets 0, without waiting for a resize, and no listener hears one value twice. A listener made anew on every render (an inline function, which looped in 8.2.0) hears the height once a function until the caller's state settles; one that stores an object is cut off after three such arrivals with nothing measured between, so it cannot loop. Store a plain number, or memoize the listener.
771
+ - **`isMiss`** also counts a match the router reports as not found, and the not found pending view (given `useMatches`) asks `isMiss` alone, so the root's 404 head and the pending view agree. A route with params that can claim a path with no page sets `staticData.missing` (see [The Not Found Page](#the-not-found-page)).
772
+ - **`refusalError` and `reportRefusedResponse`** also replace a phone number, grouped as one is written, with `[number]`, catch an address on an internationalized domain or with an underscore in a label, and keep a sentence's closing period outside a scrubbed address; a date, a bare id, and a count beside a year stay.
773
+ - **`SiteMenu`** takes an empty `phones` list as none, so the contact block's one phone stands in on either sheet.
774
+ - **One visually hidden class**, `.visually-hidden`, in `defaults.css`, worn by `ReportCard`'s spoken words, `DataTable`'s empty label, `ReviewWall`'s control labels, and `FeatureGrid`'s new tab note, in place of four copies of the rule. The old class names stay on their elements beside it as aliases (`.rc-sr`, `.data-table-empty-label`, `.rw-select-label`), so a site rule written against one still reaches it; they go in the next major, and a site moves its rules to `.visually-hidden` before then.
775
+ - **The rule above the closing bar** is drawn in its top border's place rather than as the border; at the default it looks and measures as before.
776
+
777
+ New, each at today's look unless set (the table under [Tokens](#tokens)):
778
+
779
+ - **The hero:** `--hero-gap-kicker`, `--hero-gap-lead`, and `--hero-gap-actions`, each one gap of the stack, falling back to `--hero-stack-gap` and then to the gap's own value; `--hero-lead-leading` (`1.55`); `--hero-split-pad-block` (`--section-space`); `--hero-kicker-display` and `--hero-kicker-leading` (`inline-block`, inherited), which as `block` and a leading lay the kicker out at its drawn height; `--hero-actions-gap` (`14px`).
780
+ - **The footer:** `footer.hoursPlacement` (`"column"`, or `"brand"` for the hours inside the brand column, the brand column taking its own row when the link columns' floors outrun the row; an unknown value is a column); `--footer-link-size` (`1em`); `--footer-brand-width` (unset, the brand column's 1.4 share, or 2 beside the hours); `--closing-rule-inset` (`0px`).
781
+ - **Hours:** `meridiem` (`"letter"`, or `"word"` for "8 am") and `footer.hoursShort` (`true`), so "8:00 am to 5:00 pm" in the footer is `meridiem: "word"` with `hoursShort: false`, no site code; `HoursTable` takes `meridiem`.
782
+ - **Sections:** `FeatureGrid`'s `external` on a linked card, opening it in a new tab and saying so (`newTabLabel`, "opens in a new tab"); `ContactInfoCard`'s `phoneLabel` (`"Call"`).
783
+ - `RouteErrorFallback` has its stories, and the story widths gain `smallPhone` 320, `smallTablet` 768, `laptop` 1024, and `wideTablet` 1099.
784
+
734
785
  ### Moving to 8.2.0
735
786
 
736
787
  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.
@@ -811,7 +862,7 @@ Nothing breaks: every addition is an optional prop, config key, token, or entry.
811
862
  | `SplitSection` | The two column band: copy beside copy, or media beside copy. `ratio` is `even`, `narrow-first`, or `media`, a fixed 420px shot column and the gap a card row uses, so a photo beside copy lines up with a case study entry above it; `even` and `narrow-first` stack below 920px, `media` below 761px |
812
863
  | `PricingBand` | A brand colored band with the price in a card beside it, informational by design |
813
864
  | `CTASection` | The standard closer: the site's own primary action and an optional ghost second |
814
- | `FeatureGrid` | Numbered cards with a hover lift; a card is a link or holds one, never both |
865
+ | `FeatureGrid` | Numbered cards with a hover lift; a card is a link or holds one, never both; a linked card with `external` opens in a new tab and says so to a screen reader (`newTabLabel`, 8.3.0) |
815
866
  | `FeatureDetail` | Alternating copy and media rows with tags and a tick list |
816
867
  | `ProcessSteps` | A dark band of numbered steps beside a frame |
817
868
  | `PricingCard` | A standalone price card with a tick list and its booking action |
@@ -828,7 +879,7 @@ Nothing breaks: every addition is an optional prop, config key, token, or entry.
828
879
  | `MapEmbed` | The map: a screenshot linking to directions, or a click to load facade over the live embed |
829
880
  | `HoursTable` | Day rows with dashed rules and mono times |
830
881
  | `ContactForm` | Validated form with a honeypot that posts to `endpoint` (or hands off to mail); `onLead` replaces the default GA4 `generate_lead` event |
831
- | `ContactInfoCard` | A dark card of direct contact rows: call, email, visit, portal |
882
+ | `ContactInfoCard` | A dark card of direct contact rows: call, email, visit, portal; the single phone row reads `phoneLabel`, default "Call" (8.3.0) |
832
883
  | `FAQBrowser` | The help page: live search, a sticky `JumpRail` of categories with scroll spy, expand all, deep links; `contactHref` sets where the no match line points |
833
884
  | `JumpRail` | Sticky in page pill tabs with scroll spy, used by `FAQBrowser` and on its own |
834
885
  | `BlogIndex` | The post listing as a readable stack |
@@ -839,7 +890,7 @@ The primitives that came with them, in `@atelic-action/ui/primitives`: `ImageFra
839
890
 
840
891
  The entry also exports the helpers the sections use, for a site's own code: `formatClock`, `formatHoursRange`, and `isClosed` for hours, `isHoneypotFilled`, and `trackEvent`.
841
892
 
842
- Hours print on the 12 hour clock unless the site's config sets `clock: "24h"`, which turns "9a to 5p" into "09:00 to 17:00" everywhere hours appear: `LocationSection` and `HoursTable` (which takes `clock` as a prop when used on its own). `formatClock` and `formatHoursRange` take the same `clock` option for a site's own code.
893
+ Hours print on the 12 hour clock unless the site's config sets `clock: "24h"`, which turns "9a to 5p" into "09:00 to 17:00" everywhere hours appear: `LocationSection` and `HoursTable` (which takes `clock` as a prop when used on its own). `meridiem: "word"` (8.3.0) marks the 12 hour clock with a word, "9 am to 5 pm", wherever hours print (`HoursTable`'s `meridiem` when used on its own). The footer prints the short form, a whole hour's minutes dropped ("8a to 5p"), unless `footer.hoursShort` is false, so "8:00 am to 5:00 pm" in the footer is `meridiem: "word"` with `footer: { hoursShort: false }`, no site code. `formatClock` and `formatHoursRange` take the same `clock`, `meridiem`, and `short` options for a site's own code.
843
894
 
844
895
  ### The Marketing Vite Config and Commands
845
896
 
@@ -1044,15 +1095,20 @@ The sheets read a set of tokens beyond the theme's palette, type, radii, and lay
1044
1095
  | `--grade-a` to `--grade-d`, each with `-line` and `-bg` | A `var(--tone-good)` (`#197538`) on its ground `var(--tone-good-bg)`, B `#8a5f00` on `#c99a1a`, ground `#fdf5dc`, C `var(--tone-warn)` (`#a84500`) on `#e8650a`, ground `#fff0e3`, D `var(--tone-bad)` (`#b3261e`) on its ground `var(--tone-bad-bg)` | The grade chip's words, rule, and ground, green to red whatever the brand is. A grade whose value is a tone's reads the tone, so a theme restating the tone moves both |
1045
1096
  | `--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 |
1046
1097
  | `--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 |
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 |
1098
+ | `--sticky-cta-space` | `0px`, read in place | The room the phone's sticky bar reserves wherever it can show, from the first measure and before it slides in, which the closing bar pads its foot by; `SiteShell` sets it on its root from `StickyCTABar`'s measurement, and a theme never does |
1048
1099
  | `--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
1100
  | `--nav-open-bg`, `--nav-open-ink` | `--hover-tint` read in place, `currentColor` (the bar's words) | The open group's pill (8.1.0) |
1050
1101
  | `--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) |
1051
1102
  | `--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) |
1103
+ | `--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). Set a length; a theme that sets `normal` gets `normal` on `h3` and a flat `h4` (8.3.0: the `h4` took its parent's tracking) |
1053
1104
  | `--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
1105
  | `--hero-lead-measure` | `52ch` | The hero's lead paragraph's measure, both layouts (8.2.0) |
1055
1106
  | `--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) |
1107
+ | `--hero-gap-kicker`, `--hero-gap-lead`, `--hero-gap-actions` | `--hero-stack-gap` when set, else the gap's own (kicker to headline 18px, 12px on the split hero; headline to lead 22px; lead to actions 32px, 26px on the split hero), read in place | Each of the hero's three gaps on its own, both layouts (8.3.0) |
1108
+ | `--hero-lead-leading` | `1.55` | The hero's lead paragraph's line height, both layouts (8.3.0) |
1109
+ | `--hero-kicker-display`, `--hero-kicker-leading` | `inline-block`, declared in `defaults.css`; inherited, read in place | The hero's kicker as the inline block it has been, in a line box of the copy's leading that stands it taller than its type; `block` with a leading of its own lays it out as a block whose height is that leading, so a design's kicker takes its drawn height (8.3.0) |
1110
+ | `--hero-actions-gap` | `14px` | The gap between the hero's actions, side by side or stacked (8.3.0) |
1111
+ | `--hero-split-pad-block` | `--section-space`, read in place | The split hero's copy column's top and bottom padding; over a transparent bar from 900px the bar's height is added above it, as before (8.3.0) |
1056
1112
  | `--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
1113
  | `--card-title-color` | `currentColor` (inherited) | A `FeatureGrid` card's title (8.1.0) |
1058
1114
  | `--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) |
@@ -1062,6 +1118,9 @@ The sheets read a set of tokens beyond the theme's palette, type, radii, and lay
1062
1118
  | `--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
1119
  | `--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
1120
  | `--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) |
1121
+ | `--footer-link-size` | `1em` (the footer's own size, as the links always inherited) | The footer's column links' size, to a design's proportion (8.3.0) |
1122
+ | `--footer-brand-width` | none; unset, the brand column's share is 1.4, or 2 beside the hours from 1100px, read in place | The brand column's share of the footer's row from 760px, a link column's being 1 (8.3.0) |
1123
+ | `--closing-rule-inset` | `0px` | How far in from each side the rule above the closing bar starts; `max(var(--gutter), calc((100% - var(--max-width)) / 2 + var(--gutter)))` sets it inside the content's width (8.3.0) |
1065
1124
  | `--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
1125
  | `--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
1126
  | `--menu-rule` | `--hairline`, read in place | The light phone menu's row dividers (8.2.0) |
@@ -92,8 +92,15 @@ export declare function reportServerErrorLater(error: unknown, options?: ServerR
92
92
  * A refused upstream answer as an error a report may carry: the service's
93
93
  * name, the status, and the error body's `name` and `message` fields alone,
94
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.
95
+ * and anything shaped like a phone number (grouped as one is written) by
96
+ * `[number]`, then cut to 300
97
+ * characters. Nothing else of the body is read, and a body that is not JSON
98
+ * leaves the status alone. Never throws.
99
+ *
100
+ * The scrub takes out the shapes it knows and nothing more: the fields are
101
+ * still the upstream's free text, and a name, a street, or a message quoted
102
+ * in it in words passes through. Report a refusal from a service whose
103
+ * errors are about the request, never one that echoes what a person wrote.
97
104
  *
98
105
  * await refusalError(response, "Resend") // Error("Resend answered 422: validation_error: ...")
99
106
  */
@@ -82,13 +82,33 @@ function eventID() {
82
82
  id += Math.floor(Math.random() * 16).toString(16);
83
83
  return id;
84
84
  }
85
- /** The thrown value as Sentry's exception: its type, message, and frames. */
86
- function exceptionOf(error) {
87
- if (error instanceof Error) {
88
- const frames = parseStack(error.stack);
85
+ /** How many causes deep a report follows a thrown value's `cause`. */
86
+ const CAUSE_DEPTH = 5;
87
+ /** The longest an exception's message is kept in a report. */
88
+ const EXCEPTION_VALUE_MAX = 300;
89
+ /**
90
+ * One thrown value as Sentry's exception: its type, message, and frames. A
91
+ * cause's words are upstream free text (a resolver's, a socket's), so they
92
+ * take the refusal's scrub, and its `code` (ENOTFOUND, ECONNRESET, a TLS
93
+ * error's) leads its message when the message does not already say it, so a
94
+ * DNS fault reads apart from a refused connection.
95
+ */
96
+ function exceptionOne(error, isCause) {
97
+ const words = (text) => (isCause ? scrub(text) : text).slice(0, EXCEPTION_VALUE_MAX);
98
+ const shaped = error instanceof Error ||
99
+ (isCause &&
100
+ error !== null &&
101
+ typeof error === "object" &&
102
+ ("message" in error || "code" in error));
103
+ if (shaped) {
104
+ const { name, message, stack, code } = error;
105
+ const text = typeof message === "string" ? message : "";
106
+ const coded = isCause && (typeof code === "string" || typeof code === "number") ? String(code) : "";
107
+ const value = coded && !text.includes(coded) ? (text ? `${coded}: ${text}` : coded) : text;
108
+ const frames = parseStack(typeof stack === "string" ? stack : undefined);
89
109
  return {
90
- type: error.name || "Error",
91
- value: error.message,
110
+ type: typeof name === "string" && name ? name : "Error",
111
+ value: words(value),
92
112
  ...(frames.length ? { stacktrace: { frames } } : {}),
93
113
  };
94
114
  }
@@ -99,7 +119,48 @@ function exceptionOf(error) {
99
119
  catch {
100
120
  value = String(error);
101
121
  }
102
- return { type: "Error", value: value ?? String(error) };
122
+ return { type: "Error", value: words(value ?? String(error)) };
123
+ }
124
+ /** A value's `cause`, read so that a throwing getter reads as none. */
125
+ function causeOf(error) {
126
+ if (error === null || typeof error !== "object")
127
+ return undefined;
128
+ try {
129
+ return error.cause;
130
+ }
131
+ catch {
132
+ return undefined;
133
+ }
134
+ }
135
+ /**
136
+ * The thrown value and the causes under it, up to five deep, as Sentry's
137
+ * exception values: innermost first and the thrown value last, as Sentry
138
+ * orders a chain, each cause linked to the one it caused (`mechanism`
139
+ * `chained`, `source` `cause`, its own `exception_id` and its parent's
140
+ * `parent_id`), the thrown value `exception_id` 0 under the generic
141
+ * mechanism, handled, since the reporter is called by code that caught it.
142
+ * A cause met twice (a cycle) ends the chain. A value with no cause is the
143
+ * one exception it always was, with no mechanism.
144
+ */
145
+ function exceptionsOf(error) {
146
+ const chain = [error];
147
+ const seen = new Set([error]);
148
+ for (let cause = causeOf(error); chain.length <= CAUSE_DEPTH; cause = causeOf(cause)) {
149
+ if (cause === undefined || cause === null || seen.has(cause))
150
+ break;
151
+ seen.add(cause);
152
+ chain.push(cause);
153
+ }
154
+ if (chain.length === 1)
155
+ return [exceptionOne(error, false)];
156
+ return chain
157
+ .map((value, id) => ({
158
+ ...exceptionOne(value, id > 0),
159
+ mechanism: id === 0
160
+ ? { type: "generic", handled: true, exception_id: 0 }
161
+ : { type: "chained", source: "cause", exception_id: id, parent_id: id - 1 },
162
+ }))
163
+ .reverse();
103
164
  }
104
165
  /**
105
166
  * The request as a report may carry it: the method, the URL with no query
@@ -143,7 +204,7 @@ export function buildEnvelope(error, dsn, options = {}, now = new Date()) {
143
204
  ...(environment ? { environment } : {}),
144
205
  tags: { runtime: runtime(), ...options.tags },
145
206
  ...(request ? { request } : {}),
146
- exception: { values: [exceptionOf(error)] },
207
+ exception: { values: exceptionsOf(error) },
147
208
  };
148
209
  const header = { event_id: id, sent_at: now.toISOString(), dsn, sdk: SDK };
149
210
  return [JSON.stringify(header), JSON.stringify({ type: "event" }), JSON.stringify(event)].join("\n");
@@ -235,16 +296,49 @@ export function reportServerErrorLater(error, options = {}) {
235
296
  }
236
297
  }
237
298
  }
238
- /** Anything shaped like an email address, which a refusal may quote (the recipient, the sender). */
239
- const ADDRESS = /[^\s@<>()[\]"',;:]+@[^\s@<>()[\]"',;:]+\.[^\s@<>()[\]"',;:]+/g;
299
+ /**
300
+ * Anything shaped like an email address, which a refusal may quote (the
301
+ * recipient, the sender). The domain is labels of letters in any script,
302
+ * digits, hyphens, and underscores joined by dots, so an internationalized
303
+ * domain is caught and a sentence's closing period stays outside it.
304
+ */
305
+ const ADDRESS = /[^\s@<>()[\]"',;:]+@[\p{L}\p{N}_-]+(?:\.[\p{L}\p{N}_-]+)+/gu;
306
+ /** A separator inside a phone number: a space, a dot, a slash, or any hyphen or dash. */
307
+ const SEP = "[\\s./\\u2010-\\u2015\\u2212-]";
308
+ /** One part of a dotted IPv4 address, 0 to 255. */
309
+ const OCTET = "(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)";
310
+ /**
311
+ * A run shaped like a phone number: an optional country code (a plus sign
312
+ * and one to three digits, or one to three digits and a separator, as in
313
+ * 1-555-555-0142), then an area code in parentheses and the number after
314
+ * it, or at least three groups of digits joined by separators, the last of
315
+ * three or four digits, or a plus sign and seven to fifteen digits run
316
+ * together (E.164); any of them may close on an extension (x12, ext. 12). A
317
+ * date (2026-11-23), a bare id (12345678), a count beside a year (120
318
+ * 2026), a status (429), and a dotted IPv4 address (192.168.10.200) are none
319
+ * of these, and stay. A run starts at a word's edge and never just after a
320
+ * digit's dot, so no tail of a longer dotted run is taken for one.
321
+ */
322
+ const PHONE = new RegExp(`(?<![\\w+-])(?<!\\d\\.)(?:\\+\\d{7,15}|(?!(?:${OCTET}\\.){3}${OCTET}(?![\\w.-]))(?:\\+\\d{1,3}${SEP}?|\\d{1,3}${SEP})?(?:\\(\\d{2,4}\\)${SEP}?\\d{2,4}(?:${SEP}\\d{3,4})?|\\d{2,4}(?:${SEP}\\d{2,4}){1,2}${SEP}\\d{3,4}))(?:\\s*(?:x|ext\\.?|extension)\\s*\\d{1,6})?(?![\\w-])`, "giu");
323
+ /** A refusal's field with every address and phone number in it replaced. */
324
+ function scrub(text) {
325
+ return text.replace(ADDRESS, "[address]").replace(PHONE, "[number]");
326
+ }
240
327
  /** The longest a refusal's field is kept, so a report never carries a page of text. */
241
328
  const REFUSAL_FIELD_MAX = 300;
242
329
  /**
243
330
  * A refused upstream answer as an error a report may carry: the service's
244
331
  * name, the status, and the error body's `name` and `message` fields alone,
245
332
  * 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.
333
+ * and anything shaped like a phone number (grouped as one is written) by
334
+ * `[number]`, then cut to 300
335
+ * characters. Nothing else of the body is read, and a body that is not JSON
336
+ * leaves the status alone. Never throws.
337
+ *
338
+ * The scrub takes out the shapes it knows and nothing more: the fields are
339
+ * still the upstream's free text, and a name, a street, or a message quoted
340
+ * in it in words passes through. Report a refusal from a service whose
341
+ * errors are about the request, never one that echoes what a person wrote.
248
342
  *
249
343
  * await refusalError(response, "Resend") // Error("Resend answered 422: validation_error: ...")
250
344
  */
@@ -260,7 +354,7 @@ export async function refusalError(response, service = "The upstream service") {
260
354
  }
261
355
  const parts = [body.name, body.message]
262
356
  .filter((part) => typeof part === "string" && part.trim() !== "")
263
- .map((part) => part.replace(ADDRESS, "[address]").slice(0, REFUSAL_FIELD_MAX));
357
+ .map((part) => scrub(part).slice(0, REFUSAL_FIELD_MAX));
264
358
  return new Error(`${service} answered ${response.status}${parts.length ? `: ${parts.join(": ")}` : ""}`);
265
359
  }
266
360
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atelic-action/ui",
3
- "version": "8.2.0",
3
+ "version": "8.4.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",
@@ -1,11 +1,12 @@
1
1
  import { Mail, Star, UserRound } from "lucide-react";
2
- import type { ComponentProps, Ref } from "react";
2
+ import type { ComponentProps, CSSProperties, ReactNode, Ref } from "react";
3
3
  import { breakableEmail } from "../lib/emailText";
4
4
  import { newTabProps } from "../lib/newTabProps";
5
5
  import type {
6
6
  Brand,
7
7
  FooterColumn,
8
8
  FooterColumnLink,
9
+ FooterHoursPlacement,
9
10
  HoursRow,
10
11
  Phone,
11
12
  PostalAddress,
@@ -172,6 +173,13 @@ export interface FooterProps {
172
173
  hours?: HoursRow[];
173
174
  /** The hours column's heading. Defaults to "Hours". */
174
175
  hoursHeading?: string;
176
+ /**
177
+ * Where the hours sit: `column` (the default) is a column of their own
178
+ * beside the link columns; `brand` sets them inside the brand column,
179
+ * under the address, the phone, and the email, as a compact list of two
180
+ * columns under a small label, so the link columns keep the row's room.
181
+ */
182
+ hoursPlacement?: FooterHoursPlacement;
175
183
  /**
176
184
  * The link columns beside the brand column. The default footer carries
177
185
  * four: Company, Resources, Social, and Legal. A column with no links is
@@ -218,6 +226,7 @@ export function Footer({
218
226
  email,
219
227
  hours,
220
228
  hoursHeading = "Hours",
229
+ hoursPlacement = "column",
221
230
  columns,
222
231
  attribution,
223
232
  note,
@@ -231,7 +240,30 @@ export function Footer({
231
240
  // The band is a dark surface, resolved by the order the header uses.
232
241
  const mark = resolveMark(logo, "dark");
233
242
  const shown = (columns ?? []).filter((column) => column.links.length > 0);
234
- const hoursShown = hours && hours.length > 0 ? hours : null;
243
+ const hoursGiven = hours && hours.length > 0 ? hours : null;
244
+ // The hours as a column of their own, or inside the brand column.
245
+ // Any value but "brand" (a typo, a value from a later version) is a column.
246
+ const inBrand = hoursPlacement === "brand";
247
+ const hoursShown = inBrand ? null : hoursGiven;
248
+ const hoursInBrand = inBrand ? hoursGiven : null;
249
+ const hoursList = (rows: HoursRow[]) => (
250
+ <dl>
251
+ {rows.map((row, at) => (
252
+ // biome-ignore lint/suspicious/noArrayIndexKey: two rows may share a label (a split day), so the place keeps the key unique; rows never reorder
253
+ <div key={`${at} ${row.label}`}>
254
+ <dt>{row.label}</dt>
255
+ <dd>{row.range}</dd>
256
+ </div>
257
+ ))}
258
+ </dl>
259
+ );
260
+ // With the hours in the brand column the link columns share one box, so
261
+ // the row is the brand column and that box: the two sit side by side or
262
+ // each takes a row, and the box alone decides four across or two by two
263
+ // (chrome.css). Anywhere else, and on a phone, the columns stand in the
264
+ // grid as they always have.
265
+ const wrapLinks = (links: ReactNode) =>
266
+ hoursInBrand ? <div className="footer-links">{links}</div> : links;
235
267
  const stars = (
236
268
  <span className="footer-stars" aria-hidden="true">
237
269
  {STARS.map((star) => (
@@ -255,7 +287,22 @@ export function Footer({
255
287
  <>
256
288
  <footer ref={ref} className="footer">
257
289
  <div className="wrap">
258
- <div className={hoursShown ? "footer-grid has-hours" : "footer-grid"}>
290
+ <div
291
+ className={[
292
+ "footer-grid",
293
+ hoursShown && "has-hours",
294
+ // Two across, the hours span the row only beside an even count of
295
+ // link columns, so no cell is left alone (chrome.css, the footer).
296
+ hoursShown && shown.length % 2 === 0 && "has-even-columns",
297
+ hoursInBrand && "has-brand-hours",
298
+ ]
299
+ .filter(Boolean)
300
+ .join(" ")}
301
+ // The link columns drawn, which the brand placement's floors are
302
+ // measured for (chrome.css), so two or three columns keep the
303
+ // brand column beside them as long as theirs fit.
304
+ style={hoursInBrand ? ({ "--_link-count": shown.length } as CSSProperties) : undefined}
305
+ >
259
306
  <div className="footer-brand">
260
307
  {logo?.tile ? (
261
308
  <p className="footer-wordmark">
@@ -310,6 +357,15 @@ export function Footer({
310
357
  {email && <a href={`mailto:${email}`}>{breakableEmail(email)}</a>}
311
358
  </address>
312
359
  )}
360
+ {hoursInBrand && (
361
+ <div className="footer-brand-hours">
362
+ {/* biome-ignore lint/a11y/useSemanticElements: a heading by role, as the link columns' are (see below) */}
363
+ <div className="footer-heading" role="heading" aria-level={headingLevel}>
364
+ {hoursHeading}
365
+ </div>
366
+ {hoursList(hoursInBrand)}
367
+ </div>
368
+ )}
313
369
  </div>
314
370
  {hoursShown && (
315
371
  <div className="footer-column footer-hours">
@@ -317,34 +373,28 @@ export function Footer({
317
373
  <div className="footer-heading" role="heading" aria-level={headingLevel}>
318
374
  {hoursHeading}
319
375
  </div>
320
- <dl>
321
- {hoursShown.map((row, at) => (
322
- // biome-ignore lint/suspicious/noArrayIndexKey: two rows may share a label (a split day), so the place keeps the key unique; rows never reorder
323
- <div key={`${at} ${row.label}`}>
324
- <dt>{row.label}</dt>
325
- <dd>{row.range}</dd>
326
- </div>
327
- ))}
328
- </dl>
376
+ {hoursList(hoursShown)}
329
377
  </div>
330
378
  )}
331
- {shown.map((column) => (
332
- <nav key={column.heading} className="footer-column" aria-label={column.heading}>
333
- {/* A heading by role rather than by element: a site's own bare
379
+ {wrapLinks(
380
+ shown.map((column) => (
381
+ <nav key={column.heading} className="footer-column" aria-label={column.heading}>
382
+ {/* A heading by role rather than by element: a site's own bare
334
383
  h2 rule (unlayered, so it beats any rule in the package's
335
384
  layer whatever its weight) is written for a page's section
336
385
  titles and would restyle these small labels. A div that says
337
386
  it is a heading keeps the outline and matches no such rule. */}
338
- {/* biome-ignore lint/a11y/useSemanticElements: an h2 element would take a site's bare h2 rules, see above */}
339
- <div className="footer-heading" role="heading" aria-level={headingLevel}>
340
- {column.heading}
341
- </div>
342
- {column.links.map((link, at) => (
343
- // biome-ignore lint/suspicious/noArrayIndexKey: two links may share a label and a page, so the place keeps the key unique; links never reorder
344
- <ColumnLink key={at} link={link} />
345
- ))}
346
- </nav>
347
- ))}
387
+ {/* biome-ignore lint/a11y/useSemanticElements: an h2 element would take a site's bare h2 rules, see above */}
388
+ <div className="footer-heading" role="heading" aria-level={headingLevel}>
389
+ {column.heading}
390
+ </div>
391
+ {column.links.map((link, at) => (
392
+ // biome-ignore lint/suspicious/noArrayIndexKey: two links may share a label and a page, so the place keeps the key unique; links never reorder
393
+ <ColumnLink key={at} link={link} />
394
+ ))}
395
+ </nav>
396
+ )),
397
+ )}
348
398
  </div>
349
399
  </div>
350
400
  </footer>
@@ -51,7 +51,8 @@ export interface SiteMenuProps {
51
51
  /**
52
52
  * The phone, email, and address block at the foot of the dark sheet. The
53
53
  * light sheet draws its one phone as a card when `phones` is empty, and
54
- * leaves the email and the address out, as its design does.
54
+ * leaves the email and the address out, as its design does. Either sheet
55
+ * sets the phone with its `menuLabel`, else "Call".
55
56
  */
56
57
  contact?: MenuContact;
57
58
  /**
@@ -113,6 +114,9 @@ export function SiteMenu({
113
114
  brand,
114
115
  }: SiteMenuProps) {
115
116
  const light = surface === "light";
117
+ // The header's numbers, when there are any; an empty list is none, so the
118
+ // contact block's one phone stands in on either sheet.
119
+ const headerPhones = phones && phones.length > 0 ? phones : undefined;
116
120
  const [openGroup, setOpenGroup] = useState<number | null>(null);
117
121
  const groupId = useId();
118
122
  const dialogRef = useRef<HTMLDialogElement>(null);
@@ -237,7 +241,7 @@ export function SiteMenu({
237
241
 
238
242
  if (light) {
239
243
  // A card per number the header shows, else the contact block's one phone.
240
- const cards: MenuPhone[] = phones ?? (contact?.phone ? [contact.phone] : []);
244
+ const cards: MenuPhone[] = headerPhones ?? (contact?.phone ? [contact.phone] : []);
241
245
  return (
242
246
  <dialog
243
247
  ref={dialogRef}
@@ -309,7 +313,7 @@ export function SiteMenu({
309
313
  {menuCTA.label}
310
314
  </Button>
311
315
  )}
312
- {(contact || phones) && <ContactBlock contact={contact ?? {}} phones={phones} />}
316
+ {(contact || headerPhones) && <ContactBlock contact={contact ?? {}} phones={headerPhones} />}
313
317
  </dialog>
314
318
  );
315
319
  }