@atelic-action/ui 8.3.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
@@ -612,7 +612,7 @@ 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). 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 10em wide and never narrower than its longest label, and the brand column at least 17em, an ordinary email address on one line; 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. One measure, the floors against the row's own width, drives both steps, 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.
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
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
 
@@ -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,26 @@ 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
+
734
754
  ### Moving to 8.3.0
735
755
 
736
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.
@@ -1075,7 +1095,7 @@ The sheets read a set of tokens beyond the theme's palette, type, radii, and lay
1075
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 |
1076
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 |
1077
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 |
1078
- | `--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 |
1079
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) |
1080
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) |
1081
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) |
@@ -1086,7 +1106,7 @@ The sheets read a set of tokens beyond the theme's palette, type, radii, and lay
1086
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) |
1087
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) |
1088
1108
  | `--hero-lead-leading` | `1.55` | The hero's lead paragraph's line height, both layouts (8.3.0) |
1089
- | `--hero-kicker-display`, `--hero-kicker-leading` | `inline-block`, 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) |
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) |
1090
1110
  | `--hero-actions-gap` | `14px` | The gap between the hero's actions, side by side or stacked (8.3.0) |
1091
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) |
1092
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) |
@@ -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");
@@ -244,15 +305,21 @@ export function reportServerErrorLater(error, options = {}) {
244
305
  const ADDRESS = /[^\s@<>()[\]"',;:]+@[\p{L}\p{N}_-]+(?:\.[\p{L}\p{N}_-]+)+/gu;
245
306
  /** A separator inside a phone number: a space, a dot, a slash, or any hyphen or dash. */
246
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)";
247
310
  /**
248
- * A run shaped like a phone number: an optional country code, then an area
249
- * code in parentheses and the number after it, or at least three groups of
250
- * digits joined by separators, the last of three or four digits, or a plus
251
- * sign and seven to fifteen digits run together (E.164). A date
252
- * (2026-11-23), a bare id (12345678), and a count beside a year (120 2026)
253
- * are none of these, and stay.
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.
254
321
  */
255
- const PHONE = new RegExp(`(?<![\\w+-])\\+\\d{7,15}(?![\\w-])|(?<![\\w+-])(?:\\+\\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})(?![\\w-])`, "gu");
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");
256
323
  /** A refusal's field with every address and phone number in it replaced. */
257
324
  function scrub(text) {
258
325
  return text.replace(ADDRESS, "[address]").replace(PHONE, "[number]");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atelic-action/ui",
3
- "version": "8.3.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,5 +1,5 @@
1
1
  import { Mail, Star, UserRound } from "lucide-react";
2
- import type { ComponentProps, CSSProperties, 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 {
@@ -257,6 +257,13 @@ export function Footer({
257
257
  ))}
258
258
  </dl>
259
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;
260
267
  const stars = (
261
268
  <span className="footer-stars" aria-hidden="true">
262
269
  {STARS.map((star) => (
@@ -369,23 +376,25 @@ export function Footer({
369
376
  {hoursList(hoursShown)}
370
377
  </div>
371
378
  )}
372
- {shown.map((column) => (
373
- <nav key={column.heading} className="footer-column" aria-label={column.heading}>
374
- {/* 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
375
383
  h2 rule (unlayered, so it beats any rule in the package's
376
384
  layer whatever its weight) is written for a page's section
377
385
  titles and would restyle these small labels. A div that says
378
386
  it is a heading keeps the outline and matches no such rule. */}
379
- {/* biome-ignore lint/a11y/useSemanticElements: an h2 element would take a site's bare h2 rules, see above */}
380
- <div className="footer-heading" role="heading" aria-level={headingLevel}>
381
- {column.heading}
382
- </div>
383
- {column.links.map((link, at) => (
384
- // biome-ignore lint/suspicious/noArrayIndexKey: two links may share a label and a page, so the place keeps the key unique; links never reorder
385
- <ColumnLink key={at} link={link} />
386
- ))}
387
- </nav>
388
- ))}
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
+ )}
389
398
  </div>
390
399
  </div>
391
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
  /**
@@ -21,15 +21,21 @@ export interface StickyCTABarProps {
21
21
  /** The call shortcut's accessible name. Defaults to "Call us". */
22
22
  callLabel?: string;
23
23
  /**
24
- * Hears the room the bar takes at the foot of the screen, in pixels: its
25
- * measured height while it shows, and 0 while it is hidden (scrolled
26
- * above its threshold, or on a desktop, where the stylesheet hides it).
27
- * `SiteShell` pads the page's closing bar by it, so the copyright and the
28
- * credit are never under the bar. A listener swapped in is told the
24
+ * Hears the room the bar reserves at the foot of the page, in pixels: its
25
+ * measured height wherever it can show, from the first measure, whether
26
+ * or not it has slid in yet, and 0 on a desktop, where the stylesheet
27
+ * hides it. `SiteShell` pads the page's closing bar by it, so the
28
+ * copyright and the credit are never under the bar, even on a page whose
29
+ * bar slides in only once scrolled and a jump straight to its end: the
30
+ * page is already as long as it will be when the bar shows, so its
31
+ * arrival moves nothing under the reader. A listener swapped in is told the
29
32
  * current height at once and the one it replaced gets 0; no listener
30
33
  * hears one value twice. A listener made anew each render that sets state
31
34
  * should store a plain number (or be memoized): each new function hears
32
- * the height once, and a state equal to it stops the renders.
35
+ * the height once, and a state equal to it stops the renders. One that
36
+ * stores an object is cut off after three arrivals with nothing measured
37
+ * between: the listener leaving still hears 0, and the one arriving
38
+ * waits for the next measure.
33
39
  */
34
40
  onSpaceChange?: (pixels: number) => void;
35
41
  }
@@ -72,15 +78,19 @@ export function StickyCTABar({
72
78
  return () => window.removeEventListener("scroll", onScroll);
73
79
  }, [threshold, fromTop]);
74
80
 
75
- // The bar's real height while it shows, measured again whenever it changes
76
- // size (a phone turned, a font loading, a label wrapping), never assumed.
77
- // Hidden by the stylesheet its height reads 0, so a desktop reserves nothing.
81
+ // The bar's real height, measured again whenever it changes size (a phone
82
+ // turned, a font loading, a label wrapping), never assumed. It is reported
83
+ // while the bar waits below the screen too (its slide is a transform, which
84
+ // leaves its height as it is), so the space at the page's end is reserved
85
+ // from the start and never grows as the bar slides in, where a jump to the
86
+ // end would stop short of it. Hidden by the stylesheet its height reads 0,
87
+ // so a desktop reserves nothing.
78
88
  // biome-ignore lint/correctness/useExhaustiveDependencies: tell reads only refs
79
89
  useEffect(() => {
80
90
  const bar = barRef.current;
81
91
  if (!bar || !listening) return;
82
92
  const report = () => {
83
- heightRef.current = show ? bar.offsetHeight : 0;
93
+ heightRef.current = bar.offsetHeight;
84
94
  arrivalsRef.current = 0;
85
95
  tell(spaceRef.current, heightRef.current);
86
96
  };
@@ -91,12 +101,12 @@ export function StickyCTABar({
91
101
  return () => {
92
102
  sizes?.disconnect();
93
103
  window.removeEventListener("resize", report);
94
- // A final 0 on unmount, on hiding, and when the listener goes, so no
95
- // foot padding outlives the bar.
104
+ // A final 0 on unmount and when the listener goes, so no foot padding
105
+ // outlives the bar.
96
106
  heightRef.current = -1;
97
107
  tell(spaceRef.current, 0);
98
108
  };
99
- }, [show, listening]);
109
+ }, [listening]);
100
110
 
101
111
  // A listener swapped in is told the current height, and the one it
102
112
  // replaced gets 0, unless either already heard that value. A function made
@@ -114,7 +124,14 @@ export function StickyCTABar({
114
124
  const previous = previousRef.current;
115
125
  previousRef.current = onSpaceChange;
116
126
  if (previous === onSpaceChange) return;
117
- if (onSpaceChange && arrivalsRef.current >= 3) return;
127
+ if (onSpaceChange && arrivalsRef.current >= 3) {
128
+ // Past the cap the outgoing one still gives back any space it holds;
129
+ // only the arrival waits. Only a listener told a height is told 0, so
130
+ // a looping listener hears it once: the function its 0 makes was
131
+ // never told anything, and the next swap tells no one.
132
+ if (previous && (toldRef.current.get(previous) ?? 0) > 0) tell(previous, 0);
133
+ return;
134
+ }
118
135
  arrivalsRef.current += 1;
119
136
  // The outgoing one gives its space back, the bar measured or not (a
120
137
  // listener taken away leaves the measuring off by now).
@@ -114,13 +114,42 @@ function eventID(): string {
114
114
  return id;
115
115
  }
116
116
 
117
- /** The thrown value as Sentry's exception: its type, message, and frames. */
118
- function exceptionOf(error: unknown) {
119
- if (error instanceof Error) {
120
- const frames = parseStack(error.stack);
117
+ /** How many causes deep a report follows a thrown value's `cause`. */
118
+ const CAUSE_DEPTH = 5;
119
+
120
+ /** The longest an exception's message is kept in a report. */
121
+ const EXCEPTION_VALUE_MAX = 300;
122
+
123
+ /**
124
+ * One thrown value as Sentry's exception: its type, message, and frames. A
125
+ * cause's words are upstream free text (a resolver's, a socket's), so they
126
+ * take the refusal's scrub, and its `code` (ENOTFOUND, ECONNRESET, a TLS
127
+ * error's) leads its message when the message does not already say it, so a
128
+ * DNS fault reads apart from a refused connection.
129
+ */
130
+ function exceptionOne(error: unknown, isCause: boolean) {
131
+ const words = (text: string) => (isCause ? scrub(text) : text).slice(0, EXCEPTION_VALUE_MAX);
132
+ const shaped =
133
+ error instanceof Error ||
134
+ (isCause &&
135
+ error !== null &&
136
+ typeof error === "object" &&
137
+ ("message" in error || "code" in error));
138
+ if (shaped) {
139
+ const { name, message, stack, code } = error as {
140
+ name?: unknown;
141
+ message?: unknown;
142
+ stack?: unknown;
143
+ code?: unknown;
144
+ };
145
+ const text = typeof message === "string" ? message : "";
146
+ const coded =
147
+ isCause && (typeof code === "string" || typeof code === "number") ? String(code) : "";
148
+ const value = coded && !text.includes(coded) ? (text ? `${coded}: ${text}` : coded) : text;
149
+ const frames = parseStack(typeof stack === "string" ? stack : undefined);
121
150
  return {
122
- type: error.name || "Error",
123
- value: error.message,
151
+ type: typeof name === "string" && name ? name : "Error",
152
+ value: words(value),
124
153
  ...(frames.length ? { stacktrace: { frames } } : {}),
125
154
  };
126
155
  }
@@ -130,7 +159,47 @@ function exceptionOf(error: unknown) {
130
159
  } catch {
131
160
  value = String(error);
132
161
  }
133
- return { type: "Error", value: value ?? String(error) };
162
+ return { type: "Error", value: words(value ?? String(error)) };
163
+ }
164
+
165
+ /** A value's `cause`, read so that a throwing getter reads as none. */
166
+ function causeOf(error: unknown): unknown {
167
+ if (error === null || typeof error !== "object") return undefined;
168
+ try {
169
+ return (error as { cause?: unknown }).cause;
170
+ } catch {
171
+ return undefined;
172
+ }
173
+ }
174
+
175
+ /**
176
+ * The thrown value and the causes under it, up to five deep, as Sentry's
177
+ * exception values: innermost first and the thrown value last, as Sentry
178
+ * orders a chain, each cause linked to the one it caused (`mechanism`
179
+ * `chained`, `source` `cause`, its own `exception_id` and its parent's
180
+ * `parent_id`), the thrown value `exception_id` 0 under the generic
181
+ * mechanism, handled, since the reporter is called by code that caught it.
182
+ * A cause met twice (a cycle) ends the chain. A value with no cause is the
183
+ * one exception it always was, with no mechanism.
184
+ */
185
+ function exceptionsOf(error: unknown) {
186
+ const chain: unknown[] = [error];
187
+ const seen = new Set<unknown>([error]);
188
+ for (let cause = causeOf(error); chain.length <= CAUSE_DEPTH; cause = causeOf(cause)) {
189
+ if (cause === undefined || cause === null || seen.has(cause)) break;
190
+ seen.add(cause);
191
+ chain.push(cause);
192
+ }
193
+ if (chain.length === 1) return [exceptionOne(error, false)];
194
+ return chain
195
+ .map((value, id) => ({
196
+ ...exceptionOne(value, id > 0),
197
+ mechanism:
198
+ id === 0
199
+ ? { type: "generic", handled: true, exception_id: 0 }
200
+ : { type: "chained", source: "cause", exception_id: id, parent_id: id - 1 },
201
+ }))
202
+ .reverse();
134
203
  }
135
204
 
136
205
  /**
@@ -179,7 +248,7 @@ export function buildEnvelope(
179
248
  ...(environment ? { environment } : {}),
180
249
  tags: { runtime: runtime(), ...options.tags },
181
250
  ...(request ? { request } : {}),
182
- exception: { values: [exceptionOf(error)] },
251
+ exception: { values: exceptionsOf(error) },
183
252
  };
184
253
  const header = { event_id: id, sent_at: now.toISOString(), dsn, sdk: SDK };
185
254
  return [JSON.stringify(header), JSON.stringify({ type: "event" }), JSON.stringify(event)].join(
@@ -301,17 +370,24 @@ const ADDRESS = /[^\s@<>()[\]"',;:]+@[\p{L}\p{N}_-]+(?:\.[\p{L}\p{N}_-]+)+/gu;
301
370
  /** A separator inside a phone number: a space, a dot, a slash, or any hyphen or dash. */
302
371
  const SEP = "[\\s./\\u2010-\\u2015\\u2212-]";
303
372
 
373
+ /** One part of a dotted IPv4 address, 0 to 255. */
374
+ const OCTET = "(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)";
375
+
304
376
  /**
305
- * A run shaped like a phone number: an optional country code, then an area
306
- * code in parentheses and the number after it, or at least three groups of
307
- * digits joined by separators, the last of three or four digits, or a plus
308
- * sign and seven to fifteen digits run together (E.164). A date
309
- * (2026-11-23), a bare id (12345678), and a count beside a year (120 2026)
310
- * are none of these, and stay.
377
+ * A run shaped like a phone number: an optional country code (a plus sign
378
+ * and one to three digits, or one to three digits and a separator, as in
379
+ * 1-555-555-0142), then an area code in parentheses and the number after
380
+ * it, or at least three groups of digits joined by separators, the last of
381
+ * three or four digits, or a plus sign and seven to fifteen digits run
382
+ * together (E.164); any of them may close on an extension (x12, ext. 12). A
383
+ * date (2026-11-23), a bare id (12345678), a count beside a year (120
384
+ * 2026), a status (429), and a dotted IPv4 address (192.168.10.200) are none
385
+ * of these, and stay. A run starts at a word's edge and never just after a
386
+ * digit's dot, so no tail of a longer dotted run is taken for one.
311
387
  */
312
388
  const PHONE = new RegExp(
313
- `(?<![\\w+-])\\+\\d{7,15}(?![\\w-])|(?<![\\w+-])(?:\\+\\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})(?![\\w-])`,
314
- "gu",
389
+ `(?<![\\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-])`,
390
+ "giu",
315
391
  );
316
392
 
317
393
  /** A refusal's field with every address and phone number in it replaced. */
@@ -1,3 +1,17 @@
1
+ /** One of the router's matches, by the plain fields `isMiss` reads. */
2
+ export interface MissMatch {
3
+ routeId: string;
4
+ params: Record<string, string>;
5
+ staticData?: { missing?: (params: Record<string, string>) => boolean };
6
+ /** The match's state; `notFound` once a route's loader has thrown `notFound()`. */
7
+ status?: string;
8
+ /** Set on the match that renders a not found nothing below it handled. */
9
+ globalNotFound?: boolean;
10
+ }
11
+
12
+ /** The catch all route's id in a TanStack file route tree. */
13
+ export const CATCH_ALL_ROUTE_ID = "/$";
14
+
1
15
  /**
2
16
  * Whether the router's matches are a miss: the catch all route took the
3
17
  * path (an unknown page), a route with params says its params name a page
@@ -16,19 +30,6 @@
16
30
  * the site's shell from the root layout, so the shell stays mounted while
17
31
  * the not found body swaps from its pending render to its own.
18
32
  */
19
- export interface MissMatch {
20
- routeId: string;
21
- params: Record<string, string>;
22
- staticData?: { missing?: (params: Record<string, string>) => boolean };
23
- /** The match's state; `notFound` once a route's loader has thrown `notFound()`. */
24
- status?: string;
25
- /** Set on the match that renders a not found nothing below it handled. */
26
- globalNotFound?: boolean;
27
- }
28
-
29
- /** The catch all route's id in a TanStack file route tree. */
30
- export const CATCH_ALL_ROUTE_ID = "/$";
31
-
32
33
  export function isMiss(
33
34
  matches: ReadonlyArray<MissMatch>,
34
35
  catchAllId: string = CATCH_ALL_ROUTE_ID,
@@ -1,3 +1,4 @@
1
+ import { breakableEmail } from "../lib/emailText";
1
2
  import { newTabProps } from "../lib/newTabProps";
2
3
  import { useWithBase } from "../routing/BasePathProvider";
3
4
  import type { SiteConfig } from "./siteConfig";
@@ -70,7 +71,8 @@ export function ContactInfoCard({
70
71
  <div className={["ci-row", !showAddress && !portal && "last"].filter(Boolean).join(" ")}>
71
72
  <span className="k">Email</span>
72
73
  <span className="v">
73
- <a href={`mailto:${site.email}`}>{site.email}</a>
74
+ {/* Breaks after the @ and before each dot, never inside a word, as the footer's does. */}
75
+ <a href={`mailto:${site.email}`}>{breakableEmail(site.email)}</a>
74
76
  </span>
75
77
  </div>
76
78
  {showAddress && (
@@ -208,7 +208,18 @@ export interface SiteConfig {
208
208
  /** The site's primary conversion action; rendered in nav, sticky bar, and menus. */
209
209
  cta: CTA;
210
210
  /** Omit for businesses with no public phone; call surfaces render nothing. */
211
- phone?: { e164: string; display: string };
211
+ phone?: {
212
+ e164: string;
213
+ display: string;
214
+ /**
215
+ * The words the phone menu sets with this number when the header shows
216
+ * no numbers of its own (`header.phones`), on either sheet, e.g. "Call
217
+ * / Text" for a line that answers texts. Defaults to "Call". Only the
218
+ * phone menu reads it: a header number takes its own `menuLabel`, and
219
+ * `ContactInfoCard` takes `phoneLabel` (8.4.0).
220
+ */
221
+ menuLabel?: string;
222
+ };
212
223
  email: string;
213
224
  address: Address;
214
225
  geo?: { latitude: number; longitude: number };
@@ -1729,6 +1729,11 @@
1729
1729
  display: flex;
1730
1730
  flex-direction: column;
1731
1731
  }
1732
+ /* The link columns' shared box under the hours in the brand column: no
1733
+ box of its own on a phone, where the columns pair in the grid. */
1734
+ .atelic-ui .footer-links {
1735
+ display: contents;
1736
+ }
1732
1737
  /* From 760px one row that wraps: the brand column at 1.4 shares, each
1733
1738
  other column at one, as the grid laid them out, but a column never
1734
1739
  narrows past its longest word; when the row cannot hold every column
@@ -1753,39 +1758,47 @@
1753
1758
  flex-basis: 100%;
1754
1759
  }
1755
1760
  /* With the hours in the brand column the row is the brand column and
1756
- four link columns, each link column a floor of 10em (about twenty
1757
- characters) and never narrower than its longest label, the brand
1758
- column a floor of 17em (an ordinary email address on one line), the
1759
- columns 24px apart. While the row holds every floor they share
1760
- it; when it cannot, the brand column takes a row of its own and the
1761
- link columns sit under it, four across while their floors fit and two
1762
- by two below that. One measure drives both steps, the floors against
1763
- the row's own width (a basis of the floor, or of the whole row once
1764
- the floors outrun it), so no breakpoint can disagree with it. A font
1765
- a few percent wider than a site was drawn in still sets an ordinary
1766
- three word label on one line. */
1761
+ the link columns' shared box, 24px apart, side by side while the row
1762
+ holds both at their floors and each on a row of its own when it
1763
+ cannot. The brand column's floor is its content: the width its
1764
+ longest line takes whole (the lockup, the rating, an address line,
1765
+ the email, a row of the hours), so a short brand block is as narrow
1766
+ as it reads and --footer-brand-width shares out the rest. The box's
1767
+ floor is every link column at its own floor, 10 of its link text's
1768
+ size (about twenty characters, scaled by --footer-link-size) and
1769
+ never narrower than its longest label, the columns 24px apart. In
1770
+ the box the columns sit four across while their floors fit it and
1771
+ two by two below that: one measure, the floors against the box's own
1772
+ width (a basis of the floor, or of half the box once the floors
1773
+ outrun it), so no breakpoint can disagree with it. A font a few
1774
+ percent wider than a site was drawn in still sets an ordinary three
1775
+ word label on one line. */
1767
1776
  .atelic-ui .footer-grid.has-brand-hours {
1768
- --_link-floor: 10em;
1769
- --_brand-floor: 17em;
1777
+ --_link-floor: calc(10 * var(--footer-link-size));
1770
1778
  --_links-need: calc(
1771
1779
  var(--_link-count, 4) *
1772
1780
  var(--_link-floor) +
1773
1781
  (var(--_link-count, 4) - 1) *
1774
1782
  24px
1775
1783
  );
1776
- --_row-need: calc(var(--_brand-floor) + 24px + var(--_links-need));
1777
1784
  column-gap: 24px;
1778
1785
  }
1779
1786
  .atelic-ui .footer-grid.has-brand-hours > .footer-brand {
1780
- flex: var(--footer-brand-width, 1.4) 1
1781
- max(var(--_brand-floor), calc((var(--_row-need) - 100%) * 999));
1787
+ flex: var(--footer-brand-width, 1.4) 1 auto;
1788
+ width: max-content;
1789
+ }
1790
+ .atelic-ui .footer-grid.has-brand-hours > .footer-links {
1791
+ display: flex;
1792
+ flex-wrap: wrap;
1793
+ gap: 48px 24px;
1794
+ flex: var(--_link-count, 4) 1 var(--_links-need);
1782
1795
  }
1783
1796
  /* min-width: max-content departs from Component Rules 5 (zero the
1784
1797
  min-width chain around wide content) on purpose: these labels are
1785
1798
  short words a design sets whole, and the floor is what keeps a label
1786
1799
  whole on a machine whose font runs a few percent wider; the row wraps
1787
1800
  a column instead, so nothing scrolls sideways. */
1788
- .atelic-ui .footer-grid.has-brand-hours > .footer-column {
1801
+ .atelic-ui .footer-grid.has-brand-hours .footer-links > .footer-column {
1789
1802
  flex: 1 1
1790
1803
  min(calc(50% - 16px), max(var(--_link-floor), calc((var(--_links-need) - 100%) * 999)));
1791
1804
  min-width: max-content;
@@ -146,6 +146,8 @@
146
146
  --hero-lead-size: clamp(1.05rem, 2.2vw, 1.35rem);
147
147
  --hero-lead-measure: 52ch;
148
148
  --hero-lead-leading: 1.55;
149
+ /* The hero's kicker: the inline block it has always been. */
150
+ --hero-kicker-display: inline-block;
149
151
  /* A FeatureGrid card's title. */
150
152
  --card-title-color: currentColor;
151
153
  /* A CalloutPanel title's case, and its subtitle's case and tracking. */
@@ -1092,10 +1092,11 @@
1092
1092
  kicker tokens. */
1093
1093
  /* --hero-kicker-display: block and --hero-kicker-leading lay the kicker
1094
1094
  out as a block whose height is its own line height. Unset it stays the
1095
- inline block it was, in the copy's line box, which stands it taller
1096
- than its own type (both read in place, inherited by default). */
1095
+ inline block it was (defaults.css), in the copy's line box, which
1096
+ stands it taller than its own type; the leading is inherited by
1097
+ default, read in place, since no custom property can hold inherit. */
1097
1098
  .atelic-ui .hero .eyebrow {
1098
- display: var(--hero-kicker-display, inline-block);
1099
+ display: var(--hero-kicker-display);
1099
1100
  line-height: var(--hero-kicker-leading, inherit);
1100
1101
  font-size: var(--hero-kicker-size, var(--_eyebrow-size));
1101
1102
  font-weight: var(--hero-kicker-weight, var(--_eyebrow-weight));
package/src/types.ts CHANGED
@@ -302,13 +302,13 @@ export interface PostalAddress {
302
302
  postalCode?: string;
303
303
  }
304
304
 
305
- /** One row of opening hours, already formatted by the site. */
306
305
  /**
307
306
  * Where the footer sets the hours: `column`, a column of their own beside
308
307
  * the link columns, or `brand`, a compact list inside the brand column.
309
308
  */
310
309
  export type FooterHoursPlacement = "column" | "brand";
311
310
 
311
+ /** One row of opening hours, already formatted by the site. */
312
312
  export interface HoursRow {
313
313
  /** The day label as printed, e.g. "Mon" or "Fri to Sun". */
314
314
  label: string;
@@ -318,7 +318,12 @@ export interface HoursRow {
318
318
 
319
319
  /** The contact block at the foot of the menu. */
320
320
  export interface MenuContact {
321
- phone?: Phone;
321
+ /**
322
+ * The one phone, which the menu lists when the header shows no numbers;
323
+ * its `menuLabel` is the words beside it on either sheet, else "Call"
324
+ * (8.4.0).
325
+ */
326
+ phone?: Phone & { menuLabel?: string };
322
327
  email?: string;
323
328
  address?: PostalAddress;
324
329
  }