@atelic-action/ui 8.1.0 → 8.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +72 -28
- package/dist/monitoring/server.d.ts +51 -1
- package/dist/monitoring/server.js +102 -1
- package/package.json +1 -1
- package/src/chrome/BrandLockup.tsx +12 -3
- package/src/chrome/ContactDock.tsx +16 -2
- package/src/chrome/Footer.tsx +2 -5
- package/src/chrome/NavMegaPanel.tsx +6 -12
- package/src/chrome/SiteHeader.tsx +39 -17
- package/src/chrome/SiteMenu.tsx +207 -75
- package/src/chrome/SiteShell.tsx +3 -1
- package/src/chrome/StickyCTABar.tsx +12 -0
- package/src/chrome/index.ts +2 -0
- package/src/lib/phoneText.tsx +9 -0
- package/src/monitoring/ErrorCatcherScript.tsx +17 -6
- package/src/monitoring/index.ts +1 -1
- package/src/monitoring/server.ts +125 -1
- package/src/primitives/Button.tsx +2 -2
- package/src/routing/index.ts +10 -32
- package/src/routing/routerErrors.tsx +57 -0
- package/src/routing/staticNotFound.tsx +64 -0
- package/src/scripts/check-sentry.ts +22 -1
- package/src/sections/CalloutPanel.tsx +4 -1
- package/src/sections/ContactInfoCard.tsx +1 -1
- package/src/sections/Hero.tsx +2 -2
- package/src/sections/LogoMarquee.tsx +1 -1
- package/src/sections/PricingBand.tsx +1 -1
- package/src/sections/ProcessSteps.tsx +1 -1
- package/src/sections/siteConfig.ts +32 -0
- package/src/styles/base.css +23 -17
- package/src/styles/chrome.css +250 -32
- package/src/styles/defaults.css +59 -3
- package/src/styles/primitives.css +9 -3
- package/src/styles/sections.css +30 -10
- package/src/types.ts +32 -1
package/src/monitoring/index.ts
CHANGED
|
@@ -15,7 +15,7 @@ export {
|
|
|
15
15
|
readCatcher,
|
|
16
16
|
reportError,
|
|
17
17
|
} from "./catcher";
|
|
18
|
-
export { ErrorCatcherScript } from "./ErrorCatcherScript";
|
|
18
|
+
export { ErrorCatcherScript, type ErrorCatcherScriptProps } from "./ErrorCatcherScript";
|
|
19
19
|
export {
|
|
20
20
|
afterFirstPaint,
|
|
21
21
|
type ErrorReportingOptions,
|
package/src/monitoring/server.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* shipped, so this file imports nothing and touches only what a function and
|
|
6
6
|
* the middleware runtime both have (fetch, `AbortController`, `crypto`).
|
|
7
7
|
*
|
|
8
|
-
* import { reportServerError, withErrorReporting } from "@atelic-action/ui/monitoring/server";
|
|
8
|
+
* import { reportServerError, reportServerErrorLater, withErrorReporting } from "@atelic-action/ui/monitoring/server";
|
|
9
9
|
*
|
|
10
10
|
* Privacy: a report carries the request's method and path, and its user
|
|
11
11
|
* agent, never its body, its query string, or any other header. A contact
|
|
@@ -224,6 +224,130 @@ export async function reportServerError(
|
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
+
/**
|
|
228
|
+
* What a handler's context offers to keep work running after the answer has
|
|
229
|
+
* gone: the second argument of an edge middleware or a Vercel function
|
|
230
|
+
* (`context.waitUntil`), or any object holding a `waitUntil` like it.
|
|
231
|
+
*/
|
|
232
|
+
export interface WaitUntilContext {
|
|
233
|
+
waitUntil(promise: Promise<unknown>): void;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* The platform's own `waitUntil`, read the way `@vercel/functions` reads it,
|
|
238
|
+
* from the request context Vercel keeps on a global symbol, so this file
|
|
239
|
+
* needs no dependency for it. Undefined anywhere else.
|
|
240
|
+
*/
|
|
241
|
+
function platformWaitUntil(): ((promise: Promise<unknown>) => void) | undefined {
|
|
242
|
+
try {
|
|
243
|
+
const store = (globalThis as Record<symbol, unknown>)[Symbol.for("@vercel/request-context")] as
|
|
244
|
+
| { get?: () => { waitUntil?: (promise: Promise<unknown>) => void } | undefined }
|
|
245
|
+
| undefined;
|
|
246
|
+
const context = store?.get?.();
|
|
247
|
+
const waitUntil = context?.waitUntil;
|
|
248
|
+
return typeof waitUntil === "function" ? waitUntil.bind(context) : undefined;
|
|
249
|
+
} catch {
|
|
250
|
+
return undefined;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Reports an error without making the caller wait for it. The send starts
|
|
256
|
+
* at once and is handed to the platform's `waitUntil` (the `context` given,
|
|
257
|
+
* else Vercel's request context), which keeps the function alive until it
|
|
258
|
+
* finishes after the answer has gone. With neither, the send still runs,
|
|
259
|
+
* never blocking the answer, and may be cut short if the runtime freezes
|
|
260
|
+
* once the answer is out. Never throws, and returns nothing to wait on.
|
|
261
|
+
*
|
|
262
|
+
* Use `reportServerError`, awaited, where the report must land before the
|
|
263
|
+
* handler goes on (before a throw, in a handler that already waits); use
|
|
264
|
+
* this one where the answer should leave at once (a refusal the person is
|
|
265
|
+
* waiting to read).
|
|
266
|
+
*/
|
|
267
|
+
export function reportServerErrorLater(
|
|
268
|
+
error: unknown,
|
|
269
|
+
options: ServerReportOptions & { context?: WaitUntilContext } = {},
|
|
270
|
+
): void {
|
|
271
|
+
const { context, ...report } = options;
|
|
272
|
+
const sending = reportServerError(error, report);
|
|
273
|
+
// The context's own waitUntil first, then the platform's; a context with
|
|
274
|
+
// none that can be called, or one that throws, falls through to the
|
|
275
|
+
// next, and with neither the send runs on its own, never blocking.
|
|
276
|
+
const own = (context as { waitUntil?: unknown } | undefined)?.waitUntil;
|
|
277
|
+
const fromContext =
|
|
278
|
+
typeof own === "function"
|
|
279
|
+
? (promise: Promise<unknown>) => own.call(context, promise)
|
|
280
|
+
: undefined;
|
|
281
|
+
for (const find of [() => fromContext, platformWaitUntil]) {
|
|
282
|
+
try {
|
|
283
|
+
const hold = find();
|
|
284
|
+
if (!hold) continue;
|
|
285
|
+
hold(sending);
|
|
286
|
+
return;
|
|
287
|
+
} catch {
|
|
288
|
+
// This one could not hold the send; the next is tried.
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/** Anything shaped like an email address, which a refusal may quote (the recipient, the sender). */
|
|
294
|
+
const ADDRESS = /[^\s@<>()[\]"',;:]+@[^\s@<>()[\]"',;:]+\.[^\s@<>()[\]"',;:]+/g;
|
|
295
|
+
|
|
296
|
+
/** The longest a refusal's field is kept, so a report never carries a page of text. */
|
|
297
|
+
const REFUSAL_FIELD_MAX = 300;
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* A refused upstream answer as an error a report may carry: the service's
|
|
301
|
+
* name, the status, and the error body's `name` and `message` fields alone,
|
|
302
|
+
* each with anything shaped like an email address replaced by `[address]`
|
|
303
|
+
* and cut to 300 characters. Nothing else of the body is read, and a body
|
|
304
|
+
* that is not JSON leaves the status alone. Never throws.
|
|
305
|
+
*
|
|
306
|
+
* await refusalError(response, "Resend") // Error("Resend answered 422: validation_error: ...")
|
|
307
|
+
*/
|
|
308
|
+
export async function refusalError(
|
|
309
|
+
response: Response,
|
|
310
|
+
service = "The upstream service",
|
|
311
|
+
): Promise<Error> {
|
|
312
|
+
let body: { name?: unknown; message?: unknown } = {};
|
|
313
|
+
try {
|
|
314
|
+
const parsed: unknown = await response.json();
|
|
315
|
+
if (parsed && typeof parsed === "object") body = parsed as typeof body;
|
|
316
|
+
} catch {
|
|
317
|
+
// Not JSON, or already read: the status says what there is to say.
|
|
318
|
+
}
|
|
319
|
+
const parts = [body.name, body.message]
|
|
320
|
+
.filter((part): part is string => typeof part === "string" && part.trim() !== "")
|
|
321
|
+
.map((part) => part.replace(ADDRESS, "[address]").slice(0, REFUSAL_FIELD_MAX));
|
|
322
|
+
return new Error(
|
|
323
|
+
`${service} answered ${response.status}${parts.length ? `: ${parts.join(": ")}` : ""}`,
|
|
324
|
+
);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Reports a refused upstream answer (a send the mail service would not
|
|
329
|
+
* take) without holding the caller's own answer: the error is built by
|
|
330
|
+
* `refusalError`, so no address in the refusal survives, and sent by
|
|
331
|
+
* `reportServerErrorLater`. Resolves once the refusal's body is read, never
|
|
332
|
+
* waiting on the send, and never throws.
|
|
333
|
+
*
|
|
334
|
+
* if (!response.ok) {
|
|
335
|
+
* await reportRefusedResponse(response, { service: "Resend", request, tags: { route: "contact" } });
|
|
336
|
+
* return json(502, { ok: false, error: "Sending failed. Please try again in a moment." });
|
|
337
|
+
* }
|
|
338
|
+
*/
|
|
339
|
+
export async function reportRefusedResponse(
|
|
340
|
+
response: Response,
|
|
341
|
+
options: ServerReportOptions & { service?: string; context?: WaitUntilContext } = {},
|
|
342
|
+
): Promise<void> {
|
|
343
|
+
const { service, ...report } = options;
|
|
344
|
+
try {
|
|
345
|
+
reportServerErrorLater(await refusalError(response, service), report);
|
|
346
|
+
} catch {
|
|
347
|
+
// A report never becomes a second failure.
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
227
351
|
/**
|
|
228
352
|
* Wraps a function's handler so a throw is reported, then thrown again: the
|
|
229
353
|
* platform still answers the request as it would have, and Sentry hears of
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CSSProperties, ReactNode } from "react";
|
|
2
2
|
import { newTabProps } from "../lib/newTabProps";
|
|
3
|
-
import {
|
|
3
|
+
import { telText } from "../lib/phoneText";
|
|
4
4
|
import { useWithBase } from "../routing/BasePathProvider";
|
|
5
5
|
|
|
6
6
|
export interface ButtonProps {
|
|
@@ -56,7 +56,7 @@ export function Button({
|
|
|
56
56
|
// A call button with words beside its number holds the number whole.
|
|
57
57
|
const content = (
|
|
58
58
|
<>
|
|
59
|
-
{
|
|
59
|
+
{telText(href, children)}
|
|
60
60
|
{arrow && (
|
|
61
61
|
<span className="arrow" aria-hidden="true">
|
|
62
62
|
→
|
package/src/routing/index.ts
CHANGED
|
@@ -1,35 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The router options that keep a not found page alive on a statically
|
|
3
|
-
* prerendered TanStack Start site. Spread them into createRouter:
|
|
4
|
-
*
|
|
5
|
-
* createRouter({ routeTree, ...staticNotFoundRouting(NotFoundPage) })
|
|
6
|
-
*
|
|
7
|
-
* The static host serves the /404 prerender for every unknown path, and it
|
|
8
|
-
* takes a catch all route (src/routes/$.tsx rendering the same page) plus
|
|
9
|
-
* these two options to survive hydration:
|
|
10
|
-
*
|
|
11
|
-
* - The splat gives the client a match below the root. With a dedicated
|
|
12
|
-
* /404 route instead, an unknown path matches only the root, hydrate takes
|
|
13
|
-
* its SPA branch, throws, and the page goes blank.
|
|
14
|
-
* - The splat's match id still carries the path, so it differs from the
|
|
15
|
-
* dehydrated /404 match and hydrate renders the pending state first.
|
|
16
|
-
* Pending as the page itself keeps that first render identical to the
|
|
17
|
-
* server HTML; the default null is a hydration mismatch.
|
|
18
|
-
*
|
|
19
|
-
* Static sites only. On a live app the pending state is a real loading
|
|
20
|
-
* moment, and this would flash the not found page through every slow load;
|
|
21
|
-
* an app sets defaultNotFoundComponent alone.
|
|
22
|
-
*
|
|
23
|
-
* Generic over the page so the router checks it against its own component
|
|
24
|
-
* type; the package stays free of any router import.
|
|
25
|
-
*/
|
|
26
|
-
export function staticNotFoundRouting<Page>(page: Page) {
|
|
27
|
-
return {
|
|
28
|
-
defaultNotFoundComponent: page,
|
|
29
|
-
defaultPendingComponent: page,
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
|
|
33
1
|
export {
|
|
34
2
|
BasePathProvider,
|
|
35
3
|
type BasePathProviderProps,
|
|
@@ -38,3 +6,13 @@ export {
|
|
|
38
6
|
} from "./BasePathProvider";
|
|
39
7
|
export { hasBase, joinBase, normalizeBasePath, stripBase } from "./basePath";
|
|
40
8
|
export { CATCH_ALL_ROUTE_ID, isMiss, type MissMatch } from "./miss";
|
|
9
|
+
export {
|
|
10
|
+
RouteErrorFallback,
|
|
11
|
+
type RouteErrorProps,
|
|
12
|
+
reportRouteError,
|
|
13
|
+
routerErrorOptions,
|
|
14
|
+
} from "./routerErrors";
|
|
15
|
+
export {
|
|
16
|
+
type StaticNotFoundOptions,
|
|
17
|
+
staticNotFoundRouting,
|
|
18
|
+
} from "./staticNotFound";
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ErrorFallback } from "../artifact/ErrorFallback";
|
|
2
|
+
import { reportError } from "../monitoring/catcher";
|
|
3
|
+
|
|
4
|
+
/** What a router hands its error component: the error and a way to try again. */
|
|
5
|
+
export interface RouteErrorProps {
|
|
6
|
+
error: unknown;
|
|
7
|
+
reset: () => void;
|
|
8
|
+
/** Reloads the page; defaults to the window's own. For a test. */
|
|
9
|
+
reload?: () => void;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The package's `ErrorFallback` as a router's error component: the same
|
|
14
|
+
* dependency free page `AppErrorBoundary` draws. Try Again reloads the page.
|
|
15
|
+
* A loader or beforeLoad error stays on the router's match, so the boundary's
|
|
16
|
+
* own reset throws it again (and reports it a second time), and recovering in
|
|
17
|
+
* place takes the router's invalidate, which this entry cannot import. The
|
|
18
|
+
* `reload` prop is there for a test; a router never passes it.
|
|
19
|
+
*/
|
|
20
|
+
export function RouteErrorFallback({ error, reload }: RouteErrorProps) {
|
|
21
|
+
const retry = reload ?? (() => window.location.reload());
|
|
22
|
+
return <ErrorFallback error={error} resetError={retry} />;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Hands a crash a router's own boundary caught to error reporting, exactly
|
|
27
|
+
* as `AppErrorBoundary` does (`reportError(error, "boundary")`).
|
|
28
|
+
*/
|
|
29
|
+
export function reportRouteError(error: unknown): void {
|
|
30
|
+
reportError(error, "boundary");
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The router options that make a route's render crash reach error reporting
|
|
35
|
+
* whichever boundary catches it. TanStack Router (1.170) gives a route its
|
|
36
|
+
* own catch boundary only when an `errorComponent` applies to it; with none,
|
|
37
|
+
* a crash rises to the site's `AppErrorBoundary`, which reports it. A route
|
|
38
|
+
* or a site that sets its own `errorComponent` with no `onCatch` puts a
|
|
39
|
+
* boundary in the way that catches the crash and reports it to nobody, since
|
|
40
|
+
* React keeps a caught crash from the window's handlers. With these spread
|
|
41
|
+
* into `createRouter`, every route has the boundary, `defaultOnCatch` reports
|
|
42
|
+
* what it catches once, and `defaultErrorComponent` draws the package's error
|
|
43
|
+
* page in its place, so the report no longer depends on which boundary is
|
|
44
|
+
* nearest:
|
|
45
|
+
*
|
|
46
|
+
* createRouter({ routeTree, ...routerErrorOptions() })
|
|
47
|
+
*
|
|
48
|
+
* A route's own `onCatch` or `errorComponent` wins over these; a not found
|
|
49
|
+
* is never caught here, since the router rethrows it to its not found
|
|
50
|
+
* handling first. Like the rest of this entry, it imports no router.
|
|
51
|
+
*/
|
|
52
|
+
export function routerErrorOptions() {
|
|
53
|
+
return {
|
|
54
|
+
defaultOnCatch: reportRouteError,
|
|
55
|
+
defaultErrorComponent: RouteErrorFallback,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { type ComponentType, createElement, type ReactElement } from "react";
|
|
2
|
+
import { CATCH_ALL_ROUTE_ID, isMiss, type MissMatch } from "./miss";
|
|
3
|
+
|
|
4
|
+
/** What the pending view needs from the site's router, handed in so this entry imports none. */
|
|
5
|
+
export interface StaticNotFoundOptions {
|
|
6
|
+
/**
|
|
7
|
+
* The router's own `useMatches` (`import { useMatches } from
|
|
8
|
+
* "@tanstack/react-router"`). With it, the pending view draws the not
|
|
9
|
+
* found page on a miss alone and nothing on any other route's pending
|
|
10
|
+
* state, so a slow client navigation never flashes a bare 404 body.
|
|
11
|
+
*/
|
|
12
|
+
useMatches: (options: { select: (matches: ReadonlyArray<MissMatch>) => boolean }) => boolean;
|
|
13
|
+
/** The catch all route's id, when it is not `/$`. */
|
|
14
|
+
catchAllId?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The router options that keep a not found page alive on a statically
|
|
19
|
+
* prerendered TanStack Start site. Spread them into createRouter:
|
|
20
|
+
*
|
|
21
|
+
* createRouter({ routeTree, ...staticNotFoundRouting(NotFoundPage, { useMatches }) })
|
|
22
|
+
*
|
|
23
|
+
* The static host serves the /404 prerender for every unknown path, and it
|
|
24
|
+
* takes a catch all route (src/routes/$.tsx rendering the same page) plus
|
|
25
|
+
* these two options to survive hydration:
|
|
26
|
+
*
|
|
27
|
+
* - The splat gives the client a match below the root. With a dedicated
|
|
28
|
+
* /404 route instead, an unknown path matches only the root, hydrate takes
|
|
29
|
+
* its SPA branch, throws, and the page goes blank.
|
|
30
|
+
* - The splat's match id still carries the path, so it differs from the
|
|
31
|
+
* dehydrated /404 match and hydrate renders the pending state first.
|
|
32
|
+
* Pending as the page itself keeps that first render identical to the
|
|
33
|
+
* server HTML; a pending view of plain null is a hydration mismatch (React
|
|
34
|
+
* error 418) and a blank body on every miss.
|
|
35
|
+
*
|
|
36
|
+
* Given the router's `useMatches` (8.2.0), the pending view draws the page
|
|
37
|
+
* on a miss (`isMiss`) and nothing otherwise, so another route's pending
|
|
38
|
+
* state on a slow client navigation shows no bare 404 body. Without it the
|
|
39
|
+
* pending view is the page itself, as before.
|
|
40
|
+
*
|
|
41
|
+
* Static sites only. On a live app the pending state is a real loading
|
|
42
|
+
* moment; an app sets defaultNotFoundComponent alone.
|
|
43
|
+
*
|
|
44
|
+
* Generic over the page so the router checks it against its own component
|
|
45
|
+
* type; the package stays free of any router import.
|
|
46
|
+
*/
|
|
47
|
+
export function staticNotFoundRouting<Page>(page: Page): {
|
|
48
|
+
defaultNotFoundComponent: Page;
|
|
49
|
+
defaultPendingComponent: Page;
|
|
50
|
+
};
|
|
51
|
+
export function staticNotFoundRouting<Page extends ComponentType>(
|
|
52
|
+
page: Page,
|
|
53
|
+
options: StaticNotFoundOptions,
|
|
54
|
+
): { defaultNotFoundComponent: Page; defaultPendingComponent: () => ReactElement | null };
|
|
55
|
+
export function staticNotFoundRouting<Page>(page: Page, options?: StaticNotFoundOptions) {
|
|
56
|
+
if (!options) return { defaultNotFoundComponent: page, defaultPendingComponent: page };
|
|
57
|
+
const { useMatches, catchAllId = CATCH_ALL_ROUTE_ID } = options;
|
|
58
|
+
const select = (matches: ReadonlyArray<MissMatch>) => isMiss(matches, catchAllId);
|
|
59
|
+
function NotFoundPending(): ReactElement | null {
|
|
60
|
+
const miss = useMatches({ select });
|
|
61
|
+
return miss ? createElement(page as ComponentType) : null;
|
|
62
|
+
}
|
|
63
|
+
return { defaultNotFoundComponent: page, defaultPendingComponent: NotFoundPending };
|
|
64
|
+
}
|
|
@@ -33,7 +33,28 @@ export interface SentryCheckResult {
|
|
|
33
33
|
/** The check, kept pure so it can be tested without a build. */
|
|
34
34
|
export function checkSentry({ env, args }: SentryCheckInput): SentryCheckResult {
|
|
35
35
|
const production = env.VERCEL_ENV === "production";
|
|
36
|
-
const
|
|
36
|
+
const raw = env.VITE_SENTRY_DSN ?? "";
|
|
37
|
+
const dsn = raw.trim();
|
|
38
|
+
// A value of whitespace alone is set as far as the site's own checks go
|
|
39
|
+
// (`Boolean(dsn)` mounts the catcher and starts reporting) and sends
|
|
40
|
+
// nothing: it is malformed, on any environment, waiver or not.
|
|
41
|
+
if (raw !== "" && dsn === "") {
|
|
42
|
+
return {
|
|
43
|
+
code: 1,
|
|
44
|
+
message:
|
|
45
|
+
"[sentry] VITE_SENTRY_DSN is set to whitespace alone, which the site treats as set and which is not a DSN. Set it to the DSN, or remove it.",
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
// The build ships the value as it is set, untrimmed, so a DSN with a
|
|
49
|
+
// space or a line break around it is checked as shipped, not as it reads
|
|
50
|
+
// once trimmed: it fails here, on any environment, waiver or not.
|
|
51
|
+
if (dsn && raw !== dsn) {
|
|
52
|
+
return {
|
|
53
|
+
code: 1,
|
|
54
|
+
message:
|
|
55
|
+
"[sentry] VITE_SENTRY_DSN has a space or a line break around it, which the build would ship as it is. Set it again with nothing around the DSN.",
|
|
56
|
+
};
|
|
57
|
+
}
|
|
37
58
|
// A DSN that is set but cannot be read sends nothing, whatever the build:
|
|
38
59
|
// it fails here, on any environment, waiver or not.
|
|
39
60
|
if (dsn && !parseDSN(dsn)) {
|
|
@@ -21,7 +21,10 @@ export interface CalloutPanelProps {
|
|
|
21
21
|
*/
|
|
22
22
|
export function CalloutPanel({ items, className }: CalloutPanelProps) {
|
|
23
23
|
return (
|
|
24
|
-
<ul
|
|
24
|
+
<ul
|
|
25
|
+
className={["callout-panel", "on-primary", className].filter(Boolean).join(" ")}
|
|
26
|
+
data-ground="primary"
|
|
27
|
+
>
|
|
25
28
|
{items.map((item, i) => (
|
|
26
29
|
// biome-ignore lint/suspicious/noArrayIndexKey: callouts are static content in a fixed order
|
|
27
30
|
<li key={i}>
|
|
@@ -40,7 +40,7 @@ export function ContactInfoCard({
|
|
|
40
40
|
const withBase = useWithBase();
|
|
41
41
|
const portal = site.footerLinks?.find((link) => link.label.toLowerCase().includes("portal"));
|
|
42
42
|
return (
|
|
43
|
-
<div className="contact-info-card">
|
|
43
|
+
<div className="contact-info-card" data-ground="dark">
|
|
44
44
|
<h3>{title}</h3>
|
|
45
45
|
<div className="ci-rows">
|
|
46
46
|
{phones?.length
|
package/src/sections/Hero.tsx
CHANGED
|
@@ -115,7 +115,7 @@ export function Hero({
|
|
|
115
115
|
|
|
116
116
|
if (layout === "split") {
|
|
117
117
|
return (
|
|
118
|
-
<section className="hero is-split">
|
|
118
|
+
<section className="hero is-split" data-ground="dark">
|
|
119
119
|
<div className="hero-split-copy on-primary">
|
|
120
120
|
<div className="hero-split-inner">{copy}</div>
|
|
121
121
|
</div>
|
|
@@ -125,7 +125,7 @@ export function Hero({
|
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
return (
|
|
128
|
-
<section className="hero">
|
|
128
|
+
<section className="hero" data-ground="dark">
|
|
129
129
|
<div className="hero-media">
|
|
130
130
|
{media}
|
|
131
131
|
<div className="hero-scrim" />
|
|
@@ -38,7 +38,7 @@ export function LogoMarquee({
|
|
|
38
38
|
</div>
|
|
39
39
|
);
|
|
40
40
|
return (
|
|
41
|
-
<section className="creds" aria-label={ariaLabel}>
|
|
41
|
+
<section className="creds" data-ground="dark" aria-label={ariaLabel}>
|
|
42
42
|
<div className="marquee" data-paused={paused || undefined}>
|
|
43
43
|
<div className="marquee-track">
|
|
44
44
|
{row(false)}
|
|
@@ -21,7 +21,7 @@ export interface PricingBandProps {
|
|
|
21
21
|
export function PricingBand({ eyebrow, title, lead, price, unit, detail }: PricingBandProps) {
|
|
22
22
|
const withBase = useWithBase();
|
|
23
23
|
return (
|
|
24
|
-
<section className="price-band">
|
|
24
|
+
<section className="price-band" data-ground="primary">
|
|
25
25
|
<div className="wrap price-inner">
|
|
26
26
|
<div>
|
|
27
27
|
{eyebrow && <Eyebrow onDark>{eyebrow}</Eyebrow>}
|
|
@@ -36,7 +36,7 @@ export function ProcessSteps({
|
|
|
36
36
|
}: ProcessStepsProps) {
|
|
37
37
|
const Title = `h${headingLevel}` as const;
|
|
38
38
|
return (
|
|
39
|
-
<section className="section process" id={id}>
|
|
39
|
+
<section className="section process" data-ground="dark" id={id}>
|
|
40
40
|
<div className="wrap process-grid">
|
|
41
41
|
<div>
|
|
42
42
|
{eyebrow && <Eyebrow onDark>{eyebrow}</Eyebrow>}
|
|
@@ -12,9 +12,11 @@ import type {
|
|
|
12
12
|
ContactDockConfig,
|
|
13
13
|
FooterColumn,
|
|
14
14
|
HeaderPhone,
|
|
15
|
+
MenuBurgerStyle,
|
|
15
16
|
NavFeature,
|
|
16
17
|
NavPanelSection,
|
|
17
18
|
SiteLink,
|
|
19
|
+
SiteMenuSurface,
|
|
18
20
|
SocialLink,
|
|
19
21
|
} from "../types";
|
|
20
22
|
|
|
@@ -68,6 +70,19 @@ export interface CTA {
|
|
|
68
70
|
* Defaults to `label`.
|
|
69
71
|
*/
|
|
70
72
|
stickyLabel?: string;
|
|
73
|
+
/**
|
|
74
|
+
* Whether the phone's sticky bar shows from the first paint. Defaults to
|
|
75
|
+
* true on a page without a hero under the bar (`heroNav` off) and false on
|
|
76
|
+
* one with, where it slides in once the page scrolls; a page with a hero
|
|
77
|
+
* under a solid bar sets false to slide it in there too.
|
|
78
|
+
*/
|
|
79
|
+
stickyFromTop?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* The phone menu's own words, when they should differ from `label` (a
|
|
82
|
+
* fuller "Order ahead for Saturday" where the bar says "Order
|
|
83
|
+
* ahead"). Defaults to `label`.
|
|
84
|
+
*/
|
|
85
|
+
menuLabel?: string;
|
|
71
86
|
}
|
|
72
87
|
|
|
73
88
|
/** How opening hours print: "12h" reads "9a to 5p", "24h" reads "09:00 to 17:00". */
|
|
@@ -303,6 +318,23 @@ export interface SiteConfig {
|
|
|
303
318
|
* name the button. Absent, the burger stands alone as it always has.
|
|
304
319
|
*/
|
|
305
320
|
menuLabel?: string;
|
|
321
|
+
/** The phone menu (the sheet the burger opens). */
|
|
322
|
+
menu?: {
|
|
323
|
+
/**
|
|
324
|
+
* The sheet's look: `dark` (the default) is the full screen sheet on
|
|
325
|
+
* the dark surface; `light` is the page's ground with the lockup and a
|
|
326
|
+
* round close button across the top, the entries as rows, and the
|
|
327
|
+
* call to action and the header's numbers in a foot on the alternate
|
|
328
|
+
* ground.
|
|
329
|
+
*/
|
|
330
|
+
surface?: SiteMenuSurface;
|
|
331
|
+
/**
|
|
332
|
+
* How the burger is drawn: `labelAfter` sets the lines before the
|
|
333
|
+
* words beside it (`menuLabel`), `outlined` sets it in an outlined
|
|
334
|
+
* pill. Both off by default.
|
|
335
|
+
*/
|
|
336
|
+
burger?: MenuBurgerStyle;
|
|
337
|
+
};
|
|
306
338
|
/** What the header shows beyond the nav and the CTA. */
|
|
307
339
|
header?: {
|
|
308
340
|
/** Up to two numbers in the bar, each a tel link; the first is the phone's call button. */
|
package/src/styles/base.css
CHANGED
|
@@ -118,24 +118,32 @@
|
|
|
118
118
|
a dark section heading's). */
|
|
119
119
|
.atelic-ui h1,
|
|
120
120
|
.atelic-ui h2 {
|
|
121
|
-
text-transform: var(--heading-transform
|
|
121
|
+
text-transform: var(--heading-transform);
|
|
122
122
|
font-weight: var(--heading-weight, var(--weight-heavy));
|
|
123
|
-
letter-spacing: var(--heading-tracking
|
|
124
|
-
color: var(--heading-color
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
) {
|
|
123
|
+
letter-spacing: var(--heading-tracking);
|
|
124
|
+
color: var(--heading-color);
|
|
125
|
+
}
|
|
126
|
+
/* A ground that is dark or the primary fill says so with data-ground
|
|
127
|
+
("dark" or "primary"), which every such section the package draws
|
|
128
|
+
wears (the heroes, the credentials band, the callout panel, the price
|
|
129
|
+
band, the process band, the contact card), and a site's own dark band
|
|
130
|
+
may wear too; .on-primary and .on-dark say the same. Headings there
|
|
131
|
+
keep the ground's own words. A new section needs only the attribute.
|
|
132
|
+
The second list is those sections' classes, as 8.1.0 matched them, so
|
|
133
|
+
markup carrying a class without the attribute behaves as it did. */
|
|
134
|
+
.atelic-ui :is([data-ground="dark"], [data-ground="primary"], .on-primary, .on-dark),
|
|
135
|
+
.atelic-ui :is(.hero, .creds, .callout-panel, .price-band, .process, .contact-info-card) {
|
|
137
136
|
--heading-color: currentColor;
|
|
138
137
|
}
|
|
138
|
+
/* The smaller headings take the brand's tracking the same way: h3 at
|
|
139
|
+
--subheading-tracking, h4 at two thirds of it, the proportion they
|
|
140
|
+
always had (-0.015em and -0.01em). */
|
|
141
|
+
.atelic-ui h3 {
|
|
142
|
+
letter-spacing: var(--subheading-tracking);
|
|
143
|
+
}
|
|
144
|
+
.atelic-ui h4 {
|
|
145
|
+
letter-spacing: calc(var(--subheading-tracking) * 2 / 3);
|
|
146
|
+
}
|
|
139
147
|
.atelic-ui h1 {
|
|
140
148
|
font-size: clamp(2.6rem, 8vw, 5rem);
|
|
141
149
|
}
|
|
@@ -144,12 +152,10 @@
|
|
|
144
152
|
}
|
|
145
153
|
.atelic-ui h3 {
|
|
146
154
|
font-size: clamp(1.35rem, 3vw, 1.85rem);
|
|
147
|
-
letter-spacing: -0.015em;
|
|
148
155
|
}
|
|
149
156
|
.atelic-ui h4 {
|
|
150
157
|
font-size: 1.15rem;
|
|
151
158
|
font-weight: var(--weight-bold);
|
|
152
|
-
letter-spacing: -0.01em;
|
|
153
159
|
}
|
|
154
160
|
.atelic-ui p {
|
|
155
161
|
text-wrap: pretty;
|