@atelic-action/ui 8.2.0 → 8.3.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 +50 -11
- package/dist/monitoring/server.d.ts +9 -2
- package/dist/monitoring/server.js +32 -5
- package/package.json +1 -1
- package/src/chrome/Footer.tsx +53 -12
- package/src/chrome/SiteMenu.tsx +5 -2
- package/src/chrome/SiteShell.tsx +6 -1
- package/src/chrome/StickyCTABar.tsx +45 -29
- package/src/chrome/index.ts +1 -0
- package/src/components/DataTable.tsx +1 -1
- package/src/components/ReportCard.tsx +3 -3
- package/src/lib/hours.ts +9 -2
- package/src/monitoring/server.ts +38 -5
- package/src/routing/miss.ts +14 -3
- package/src/routing/staticNotFound.tsx +14 -1
- package/src/sections/ContactInfoCard.tsx +8 -1
- package/src/sections/FeatureGrid.tsx +31 -7
- package/src/sections/HoursTable.tsx +5 -3
- package/src/sections/LocationSection.tsx +2 -2
- package/src/sections/ReviewWall.tsx +2 -2
- package/src/sections/index.ts +1 -0
- package/src/sections/siteConfig.ts +25 -0
- package/src/styles/base.css +12 -1
- package/src/styles/chrome.css +108 -10
- package/src/styles/components.css +0 -22
- package/src/styles/defaults.css +34 -3
- package/src/styles/sections.css +24 -24
- package/src/types.ts +6 -0
package/src/lib/hours.ts
CHANGED
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
import type { Clock, OpeningHours } from "../sections/siteConfig";
|
|
1
|
+
import type { Clock, Meridiem, OpeningHours } from "../sections/siteConfig";
|
|
2
2
|
|
|
3
3
|
/** How a time prints: `short` drops a whole hour's minutes on the 12 hour clock. */
|
|
4
4
|
export interface ClockOptions {
|
|
5
5
|
short?: boolean;
|
|
6
6
|
/** "12h" (the default) or "24h"; see `SiteConfig.clock`. */
|
|
7
7
|
clock?: Clock;
|
|
8
|
+
/** "letter" (the default, "9a") or "word" ("9 am"); see `SiteConfig.meridiem`. */
|
|
9
|
+
meridiem?: Meridiem;
|
|
8
10
|
}
|
|
9
11
|
|
|
10
12
|
/**
|
|
11
13
|
* Formats a 24 hour "HH:MM" time as the display style used across the
|
|
12
14
|
* marketing components: "11:00" -> "11:00a", "19:00" -> "7:00p".
|
|
13
15
|
* With short: true, whole hours drop their minutes: "11a", "7p".
|
|
16
|
+
* With meridiem: "word", the mark is a word after a no break space:
|
|
17
|
+
* "11:00 am", "7 pm" short.
|
|
14
18
|
* With clock: "24h", the time prints as "HH:MM" with a leading zero
|
|
15
19
|
* ("09:00", "17:00") and short changes nothing.
|
|
16
20
|
*/
|
|
@@ -18,7 +22,10 @@ export function formatClock(time: string, opts: ClockOptions = {}): string {
|
|
|
18
22
|
const [hourStr, minuteStr = "00"] = time.split(":");
|
|
19
23
|
const hour24 = Number(hourStr);
|
|
20
24
|
if (opts.clock === "24h") return `${String(hour24 % 24).padStart(2, "0")}:${minuteStr}`;
|
|
21
|
-
const
|
|
25
|
+
const afternoon = hour24 % 24 >= 12;
|
|
26
|
+
// A word joins with a no break space, so "5:00 pm" never breaks before its mark.
|
|
27
|
+
const word = afternoon ? "\u00a0pm" : "\u00a0am";
|
|
28
|
+
const suffix = opts.meridiem === "word" ? word : afternoon ? "p" : "a";
|
|
22
29
|
const hour = hour24 % 12 || 12;
|
|
23
30
|
if (opts.short && minuteStr === "00") return `${hour}${suffix}`;
|
|
24
31
|
return `${hour}:${minuteStr}${suffix}`;
|
package/src/monitoring/server.ts
CHANGED
|
@@ -290,8 +290,34 @@ export function reportServerErrorLater(
|
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
292
|
|
|
293
|
-
/**
|
|
294
|
-
|
|
293
|
+
/**
|
|
294
|
+
* Anything shaped like an email address, which a refusal may quote (the
|
|
295
|
+
* recipient, the sender). The domain is labels of letters in any script,
|
|
296
|
+
* digits, hyphens, and underscores joined by dots, so an internationalized
|
|
297
|
+
* domain is caught and a sentence's closing period stays outside it.
|
|
298
|
+
*/
|
|
299
|
+
const ADDRESS = /[^\s@<>()[\]"',;:]+@[\p{L}\p{N}_-]+(?:\.[\p{L}\p{N}_-]+)+/gu;
|
|
300
|
+
|
|
301
|
+
/** A separator inside a phone number: a space, a dot, a slash, or any hyphen or dash. */
|
|
302
|
+
const SEP = "[\\s./\\u2010-\\u2015\\u2212-]";
|
|
303
|
+
|
|
304
|
+
/**
|
|
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.
|
|
311
|
+
*/
|
|
312
|
+
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",
|
|
315
|
+
);
|
|
316
|
+
|
|
317
|
+
/** A refusal's field with every address and phone number in it replaced. */
|
|
318
|
+
function scrub(text: string): string {
|
|
319
|
+
return text.replace(ADDRESS, "[address]").replace(PHONE, "[number]");
|
|
320
|
+
}
|
|
295
321
|
|
|
296
322
|
/** The longest a refusal's field is kept, so a report never carries a page of text. */
|
|
297
323
|
const REFUSAL_FIELD_MAX = 300;
|
|
@@ -300,8 +326,15 @@ const REFUSAL_FIELD_MAX = 300;
|
|
|
300
326
|
* A refused upstream answer as an error a report may carry: the service's
|
|
301
327
|
* name, the status, and the error body's `name` and `message` fields alone,
|
|
302
328
|
* each with anything shaped like an email address replaced by `[address]`
|
|
303
|
-
* and
|
|
304
|
-
*
|
|
329
|
+
* and anything shaped like a phone number (grouped as one is written) by
|
|
330
|
+
* `[number]`, then cut to 300
|
|
331
|
+
* characters. Nothing else of the body is read, and a body that is not JSON
|
|
332
|
+
* leaves the status alone. Never throws.
|
|
333
|
+
*
|
|
334
|
+
* The scrub takes out the shapes it knows and nothing more: the fields are
|
|
335
|
+
* still the upstream's free text, and a name, a street, or a message quoted
|
|
336
|
+
* in it in words passes through. Report a refusal from a service whose
|
|
337
|
+
* errors are about the request, never one that echoes what a person wrote.
|
|
305
338
|
*
|
|
306
339
|
* await refusalError(response, "Resend") // Error("Resend answered 422: validation_error: ...")
|
|
307
340
|
*/
|
|
@@ -318,7 +351,7 @@ export async function refusalError(
|
|
|
318
351
|
}
|
|
319
352
|
const parts = [body.name, body.message]
|
|
320
353
|
.filter((part): part is string => typeof part === "string" && part.trim() !== "")
|
|
321
|
-
.map((part) => part
|
|
354
|
+
.map((part) => scrub(part).slice(0, REFUSAL_FIELD_MAX));
|
|
322
355
|
return new Error(
|
|
323
356
|
`${service} answered ${response.status}${parts.length ? `: ${parts.join(": ")}` : ""}`,
|
|
324
357
|
);
|
package/src/routing/miss.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Whether the router's matches are a miss: the catch all route took the
|
|
3
|
-
* path (an unknown page),
|
|
4
|
-
* it does not have (a blog slug nobody wrote) through `staticData.missing
|
|
3
|
+
* path (an unknown page), a route with params says its params name a page
|
|
4
|
+
* it does not have (a blog slug nobody wrote) through `staticData.missing`,
|
|
5
|
+
* or the router already reports a match not found (a loader's `notFound()`,
|
|
6
|
+
* 8.3.0). The one predicate the root's 404 head and the not found pending
|
|
7
|
+
* view both ask, so the two never disagree.
|
|
5
8
|
* Router free: it reads the plain fields every TanStack match carries, so a
|
|
6
9
|
* site's root route asks it from `head` and from `useMatches`.
|
|
7
10
|
*
|
|
@@ -17,6 +20,10 @@ export interface MissMatch {
|
|
|
17
20
|
routeId: string;
|
|
18
21
|
params: Record<string, string>;
|
|
19
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;
|
|
20
27
|
}
|
|
21
28
|
|
|
22
29
|
/** The catch all route's id in a TanStack file route tree. */
|
|
@@ -27,6 +34,10 @@ export function isMiss(
|
|
|
27
34
|
catchAllId: string = CATCH_ALL_ROUTE_ID,
|
|
28
35
|
): boolean {
|
|
29
36
|
return matches.some(
|
|
30
|
-
(match) =>
|
|
37
|
+
(match) =>
|
|
38
|
+
match.routeId === catchAllId ||
|
|
39
|
+
match.staticData?.missing?.(match.params) === true ||
|
|
40
|
+
match.status === "notFound" ||
|
|
41
|
+
match.globalNotFound === true,
|
|
31
42
|
);
|
|
32
43
|
}
|
|
@@ -7,7 +7,10 @@ export interface StaticNotFoundOptions {
|
|
|
7
7
|
* The router's own `useMatches` (`import { useMatches } from
|
|
8
8
|
* "@tanstack/react-router"`). With it, the pending view draws the not
|
|
9
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.
|
|
10
|
+
* state, so a slow client navigation never flashes a bare 404 body. A
|
|
11
|
+
* miss is the catch all route's match, a route whose
|
|
12
|
+
* `staticData.missing(params)` says its params name no page, or a match
|
|
13
|
+
* the router already reports as not found.
|
|
11
14
|
*/
|
|
12
15
|
useMatches: (options: { select: (matches: ReadonlyArray<MissMatch>) => boolean }) => boolean;
|
|
13
16
|
/** The catch all route's id, when it is not `/$`. */
|
|
@@ -38,6 +41,15 @@ export interface StaticNotFoundOptions {
|
|
|
38
41
|
* state on a slow client navigation shows no bare 404 body. Without it the
|
|
39
42
|
* pending view is the page itself, as before.
|
|
40
43
|
*
|
|
44
|
+
* What a route must set: a route with params that can claim a path with no
|
|
45
|
+
* page behind it (a blog slug nobody wrote) sets `staticData.missing(params)`.
|
|
46
|
+
* The static host serves such a path the 404 prerender, and it hydrates
|
|
47
|
+
* through the pending state before the route's loader has run, so its
|
|
48
|
+
* `notFound()` arrives too late for that first render: without `missing`,
|
|
49
|
+
* the pending view draws nothing where the server drew the page, and the
|
|
50
|
+
* page hydrates blank. A loader's `notFound()` is still honored once the
|
|
51
|
+
* router reports it (a client navigation to the slug).
|
|
52
|
+
*
|
|
41
53
|
* Static sites only. On a live app the pending state is a real loading
|
|
42
54
|
* moment; an app sets defaultNotFoundComponent alone.
|
|
43
55
|
*
|
|
@@ -55,6 +67,7 @@ export function staticNotFoundRouting<Page extends ComponentType>(
|
|
|
55
67
|
export function staticNotFoundRouting<Page>(page: Page, options?: StaticNotFoundOptions) {
|
|
56
68
|
if (!options) return { defaultNotFoundComponent: page, defaultPendingComponent: page };
|
|
57
69
|
const { useMatches, catchAllId = CATCH_ALL_ROUTE_ID } = options;
|
|
70
|
+
// The one miss predicate the root's 404 head asks too, so the two agree.
|
|
58
71
|
const select = (matches: ReadonlyArray<MissMatch>) => isMiss(matches, catchAllId);
|
|
59
72
|
function NotFoundPending(): ReactElement | null {
|
|
60
73
|
const miss = useMatches({ select });
|
|
@@ -28,6 +28,12 @@ export interface ContactInfoCardProps {
|
|
|
28
28
|
* broken card, and inventing one is worse.
|
|
29
29
|
*/
|
|
30
30
|
showAddress?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* The words beside the single `site.phone` row. Defaults to "Call", which
|
|
33
|
+
* asserts nothing a business may not do; a line that answers texts says
|
|
34
|
+
* so here ("Call or text").
|
|
35
|
+
*/
|
|
36
|
+
phoneLabel?: string;
|
|
31
37
|
}
|
|
32
38
|
|
|
33
39
|
/** Dark card with direct contact rows: call, email, visit, portal. */
|
|
@@ -36,6 +42,7 @@ export function ContactInfoCard({
|
|
|
36
42
|
title = "Reach us directly",
|
|
37
43
|
phones,
|
|
38
44
|
showAddress = true,
|
|
45
|
+
phoneLabel = "Call",
|
|
39
46
|
}: ContactInfoCardProps) {
|
|
40
47
|
const withBase = useWithBase();
|
|
41
48
|
const portal = site.footerLinks?.find((link) => link.label.toLowerCase().includes("portal"));
|
|
@@ -54,7 +61,7 @@ export function ContactInfoCard({
|
|
|
54
61
|
))
|
|
55
62
|
: site.phone && (
|
|
56
63
|
<div className="ci-row">
|
|
57
|
-
<span className="k">
|
|
64
|
+
<span className="k">{phoneLabel}</span>
|
|
58
65
|
<span className="v">
|
|
59
66
|
<a href={`tel:${site.phone.e164}`}>{site.phone.display}</a>
|
|
60
67
|
</span>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { CSSProperties, ReactNode } from "react";
|
|
2
|
+
import { newTabProps } from "../lib/newTabProps";
|
|
2
3
|
import { SectionHeading } from "../primitives";
|
|
3
4
|
import { useWithBase } from "../routing/BasePathProvider";
|
|
4
5
|
import type { Surface } from "./siteConfig";
|
|
@@ -22,8 +23,19 @@ interface FeatureCardBase {
|
|
|
22
23
|
* rather than a constraint.
|
|
23
24
|
*/
|
|
24
25
|
export type FeatureCard =
|
|
25
|
-
| (FeatureCardBase & {
|
|
26
|
-
|
|
26
|
+
| (FeatureCardBase & {
|
|
27
|
+
description: ReactNode;
|
|
28
|
+
href?: never;
|
|
29
|
+
linkLabel?: never;
|
|
30
|
+
external?: never;
|
|
31
|
+
})
|
|
32
|
+
| (FeatureCardBase & {
|
|
33
|
+
description: string;
|
|
34
|
+
href: string;
|
|
35
|
+
linkLabel?: string;
|
|
36
|
+
/** Opens in a new tab, except on mailto, tel, and sms links, and says so to a screen reader. */
|
|
37
|
+
external?: boolean;
|
|
38
|
+
});
|
|
27
39
|
|
|
28
40
|
export interface FeatureGridProps {
|
|
29
41
|
eyebrow?: string;
|
|
@@ -37,6 +49,11 @@ export interface FeatureGridProps {
|
|
|
37
49
|
columns?: 2 | 3 | 4;
|
|
38
50
|
surface?: Surface;
|
|
39
51
|
id?: string;
|
|
52
|
+
/**
|
|
53
|
+
* The words a screen reader hears after a card that opens in a new tab.
|
|
54
|
+
* Defaults to "opens in a new tab".
|
|
55
|
+
*/
|
|
56
|
+
newTabLabel?: string;
|
|
40
57
|
}
|
|
41
58
|
|
|
42
59
|
/** Numbered feature/service card grid with hover lift. */
|
|
@@ -48,6 +65,7 @@ export function FeatureGrid({
|
|
|
48
65
|
columns = 4,
|
|
49
66
|
surface = "alt",
|
|
50
67
|
id,
|
|
68
|
+
newTabLabel = "opens in a new tab",
|
|
51
69
|
}: FeatureGridProps) {
|
|
52
70
|
const withBase = useWithBase();
|
|
53
71
|
const sectionClasses = ["section", surface === "alt" && "surface-alt"].filter(Boolean).join(" ");
|
|
@@ -70,11 +88,17 @@ export function FeatureGrid({
|
|
|
70
88
|
)}
|
|
71
89
|
</>
|
|
72
90
|
);
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
91
|
+
if (item.href) {
|
|
92
|
+
const tab = newTabProps(item.href, item.external);
|
|
93
|
+
return (
|
|
94
|
+
<a key={item.title} className="feature-card" href={withBase(item.href)} {...tab}>
|
|
95
|
+
{inner}
|
|
96
|
+
{/* Said to a screen reader only, as the card's last words. */}
|
|
97
|
+
{tab.target && <span className="visually-hidden">, {newTabLabel}</span>}
|
|
98
|
+
</a>
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
return (
|
|
78
102
|
<div key={item.title} className="feature-card">
|
|
79
103
|
{inner}
|
|
80
104
|
</div>
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { formatHoursRange, isClosed } from "../lib/hours";
|
|
2
|
-
import type { Clock, OpeningHours } from "./siteConfig";
|
|
2
|
+
import type { Clock, Meridiem, OpeningHours } from "./siteConfig";
|
|
3
3
|
|
|
4
4
|
export interface HoursTableProps {
|
|
5
5
|
hours: OpeningHours[];
|
|
6
6
|
/** "12h" (the default) or "24h"; pass the site's `SiteConfig.clock`. */
|
|
7
7
|
clock?: Clock;
|
|
8
|
+
/** "letter" (the default) or "word"; pass the site's `SiteConfig.meridiem`. */
|
|
9
|
+
meridiem?: Meridiem;
|
|
8
10
|
}
|
|
9
11
|
|
|
10
12
|
/** Day-by-day hours rows with dashed rules and mono times. */
|
|
11
|
-
export function HoursTable({ hours, clock }: HoursTableProps) {
|
|
13
|
+
export function HoursTable({ hours, clock, meridiem }: HoursTableProps) {
|
|
12
14
|
return (
|
|
13
15
|
<div>
|
|
14
16
|
{hours.map((row) => (
|
|
@@ -17,7 +19,7 @@ export function HoursTable({ hours, clock }: HoursTableProps) {
|
|
|
17
19
|
className={["hours-row", isClosed(row) && "closed"].filter(Boolean).join(" ")}
|
|
18
20
|
>
|
|
19
21
|
<span className="day">{row.label}</span>
|
|
20
|
-
<span className="time">{formatHoursRange(row, { clock })}</span>
|
|
22
|
+
<span className="time">{formatHoursRange(row, { clock, meridiem })}</span>
|
|
21
23
|
</div>
|
|
22
24
|
))}
|
|
23
25
|
</div>
|
|
@@ -7,7 +7,7 @@ import type { SiteConfig, Surface } from "./siteConfig";
|
|
|
7
7
|
|
|
8
8
|
/** The keys of the site config the section reads; a whole `SiteConfig` passes as it is. */
|
|
9
9
|
export type LocationSectionSite = MapEmbedSite &
|
|
10
|
-
Pick<SiteConfig, "serviceAreas" | "hours" | "clock" | "phone">;
|
|
10
|
+
Pick<SiteConfig, "serviceAreas" | "hours" | "clock" | "meridiem" | "phone">;
|
|
11
11
|
|
|
12
12
|
export interface LocationSectionProps {
|
|
13
13
|
site: LocationSectionSite;
|
|
@@ -64,7 +64,7 @@ export function LocationSection({
|
|
|
64
64
|
<div className="loc-heading" role="heading" aria-level={headingLevel + 1}>
|
|
65
65
|
Hours
|
|
66
66
|
</div>
|
|
67
|
-
<HoursTable hours={site.hours} clock={site.clock} />
|
|
67
|
+
<HoursTable hours={site.hours} clock={site.clock} meridiem={site.meridiem} />
|
|
68
68
|
</div>
|
|
69
69
|
|
|
70
70
|
<div className="loc-actions">
|
|
@@ -184,7 +184,7 @@ export function ReviewWall({
|
|
|
184
184
|
<div className="rw-controls">
|
|
185
185
|
{showFilter && (
|
|
186
186
|
<label className="rw-select">
|
|
187
|
-
<span className="rw-select-label">Filter reviews by tag</span>
|
|
187
|
+
<span className="rw-select-label visually-hidden">Filter reviews by tag</span>
|
|
188
188
|
<select value={tag} onChange={(event) => setTag(event.target.value)}>
|
|
189
189
|
<option value="">{allTagsLabel}</option>
|
|
190
190
|
{tags.map((option) => (
|
|
@@ -197,7 +197,7 @@ export function ReviewWall({
|
|
|
197
197
|
)}
|
|
198
198
|
{showSort && (
|
|
199
199
|
<label className="rw-select rw-select-end">
|
|
200
|
-
<span className="rw-select-label">Sort reviews by date</span>
|
|
200
|
+
<span className="rw-select-label visually-hidden">Sort reviews by date</span>
|
|
201
201
|
<select
|
|
202
202
|
value={order}
|
|
203
203
|
onChange={(event) => setOrder(event.target.value as "newest" | "oldest")}
|
package/src/sections/index.ts
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
import type {
|
|
12
12
|
ContactDockConfig,
|
|
13
13
|
FooterColumn,
|
|
14
|
+
FooterHoursPlacement,
|
|
14
15
|
HeaderPhone,
|
|
15
16
|
MenuBurgerStyle,
|
|
16
17
|
NavFeature,
|
|
@@ -88,6 +89,13 @@ export interface CTA {
|
|
|
88
89
|
/** How opening hours print: "12h" reads "9a to 5p", "24h" reads "09:00 to 17:00". */
|
|
89
90
|
export type Clock = "12h" | "24h";
|
|
90
91
|
|
|
92
|
+
/**
|
|
93
|
+
* How the 12 hour clock marks morning and afternoon: "letter" (the default)
|
|
94
|
+
* reads "9a" and "9:30a", "word" reads "9 am" and "9:30 am". The 24 hour
|
|
95
|
+
* clock marks neither.
|
|
96
|
+
*/
|
|
97
|
+
export type Meridiem = "letter" | "word";
|
|
98
|
+
|
|
91
99
|
export interface OpeningHours {
|
|
92
100
|
/** Row label as displayed, e.g. "Monday" or "Friday to Sunday". */
|
|
93
101
|
label: string;
|
|
@@ -222,6 +230,11 @@ export interface SiteConfig {
|
|
|
222
230
|
* `opens` and `closes` are already 24 hour.
|
|
223
231
|
*/
|
|
224
232
|
clock?: Clock;
|
|
233
|
+
/**
|
|
234
|
+
* How the 12 hour clock marks the time of day, wherever hours print:
|
|
235
|
+
* "letter" (the default) reads "9a to 5p", "word" reads "9 am to 5 pm".
|
|
236
|
+
*/
|
|
237
|
+
meridiem?: Meridiem;
|
|
225
238
|
/** Neighborhoods or cities served; feeds local SEO copy and structured data. */
|
|
226
239
|
serviceAreas: string[];
|
|
227
240
|
priceRange?: string;
|
|
@@ -275,6 +288,18 @@ export interface SiteConfig {
|
|
|
275
288
|
* to true: a site whose config holds hours shows them in its footer.
|
|
276
289
|
*/
|
|
277
290
|
showHours?: boolean;
|
|
291
|
+
/**
|
|
292
|
+
* Where the footer's hours sit: "column" (the default), a column of
|
|
293
|
+
* their own beside the link columns, or "brand", a compact list inside
|
|
294
|
+
* the brand column under the address, the phone, and the email.
|
|
295
|
+
*/
|
|
296
|
+
hoursPlacement?: FooterHoursPlacement;
|
|
297
|
+
/**
|
|
298
|
+
* Whether the footer's hours drop a whole hour's minutes ("8a to 5p").
|
|
299
|
+
* Defaults to true; false prints them as the hours table does
|
|
300
|
+
* ("8:00a to 5:00p", or "8:00 am to 5:00 pm" with `meridiem: "word"`).
|
|
301
|
+
*/
|
|
302
|
+
hoursShort?: boolean;
|
|
278
303
|
};
|
|
279
304
|
ogImage?: string;
|
|
280
305
|
/** Profile URLs for the schema.org sameAs entity graph (socials, listings). */
|
package/src/styles/base.css
CHANGED
|
@@ -8,6 +8,16 @@
|
|
|
8
8
|
them. Everything sits in the atelic-ui layer, so any rule a site
|
|
9
9
|
writes outside a layer wins without a specificity fight.
|
|
10
10
|
================================================================= */
|
|
11
|
+
/* The h4's tracking, two thirds of --subheading-tracking, computed on the
|
|
12
|
+
h4 itself. Registered as a length so a value that is not one (a theme's
|
|
13
|
+
--subheading-tracking: normal, which no arithmetic takes) falls to 0px,
|
|
14
|
+
flat as normal is, where an unregistered property left the h4 to inherit
|
|
15
|
+
whatever tracking its parent had. A registration sits outside any layer. */
|
|
16
|
+
@property --_h4-tracking {
|
|
17
|
+
syntax: "<length>";
|
|
18
|
+
inherits: false;
|
|
19
|
+
initial-value: 0px;
|
|
20
|
+
}
|
|
11
21
|
@layer atelic-ui {
|
|
12
22
|
/* ---- Resets ---- */
|
|
13
23
|
*,
|
|
@@ -142,7 +152,8 @@
|
|
|
142
152
|
letter-spacing: var(--subheading-tracking);
|
|
143
153
|
}
|
|
144
154
|
.atelic-ui h4 {
|
|
145
|
-
|
|
155
|
+
--_h4-tracking: calc(var(--subheading-tracking) * 2 / 3);
|
|
156
|
+
letter-spacing: var(--_h4-tracking);
|
|
146
157
|
}
|
|
147
158
|
.atelic-ui h1 {
|
|
148
159
|
font-size: clamp(2.6rem, 8vw, 5rem);
|
package/src/styles/chrome.css
CHANGED
|
@@ -1355,7 +1355,9 @@
|
|
|
1355
1355
|
.atelic-ui:has(dialog.mobile-menu[open]) .contact-dock {
|
|
1356
1356
|
visibility: hidden;
|
|
1357
1357
|
}
|
|
1358
|
-
/* Positioned, so it paints over the
|
|
1358
|
+
/* Positioned, so on a phone it paints over the dock's own panel, a fixed
|
|
1359
|
+
sheet across the bottom that leaves room for it as its close button.
|
|
1360
|
+
It never shows over the phone menu's sheet, which hides it (above). */
|
|
1359
1361
|
.atelic-ui .cd-launch {
|
|
1360
1362
|
position: relative;
|
|
1361
1363
|
display: inline-flex;
|
|
@@ -1637,19 +1639,58 @@
|
|
|
1637
1639
|
flex-wrap: wrap;
|
|
1638
1640
|
column-gap: 8px;
|
|
1639
1641
|
}
|
|
1640
|
-
.atelic-ui .footer-hours dt {
|
|
1642
|
+
.atelic-ui :is(.footer-hours, .footer-brand-hours) dt {
|
|
1641
1643
|
color: var(--on-dark);
|
|
1642
1644
|
font-weight: var(--weight-medium);
|
|
1643
1645
|
}
|
|
1644
|
-
.atelic-ui .footer-hours dd {
|
|
1646
|
+
.atelic-ui :is(.footer-hours, .footer-brand-hours) dd {
|
|
1645
1647
|
margin: 0;
|
|
1646
1648
|
color: var(--neutral-200);
|
|
1647
1649
|
}
|
|
1650
|
+
/* Two across (a phone), the cells under the brand column pair up with none
|
|
1651
|
+
left alone. Beside an even count of link columns the hours take the
|
|
1652
|
+
row's whole width, their rows laid two across, and the link columns pair
|
|
1653
|
+
under them; beside an odd count the hours stay a column of their own,
|
|
1654
|
+
rows stacked, paired with the first link column, so the count of cells
|
|
1655
|
+
is even either way. Footer.tsx marks the even count from the columns it
|
|
1656
|
+
draws. */
|
|
1657
|
+
@media (max-width: 759px) {
|
|
1658
|
+
.atelic-ui .footer-grid.has-even-columns > .footer-hours {
|
|
1659
|
+
grid-column: 1 / -1;
|
|
1660
|
+
}
|
|
1661
|
+
.atelic-ui .footer-grid.has-even-columns .footer-hours dl {
|
|
1662
|
+
display: grid;
|
|
1663
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
1664
|
+
gap: 8px 32px;
|
|
1665
|
+
}
|
|
1666
|
+
}
|
|
1667
|
+
/* The hours inside the brand column (hoursPlacement "brand"): a small
|
|
1668
|
+
label over a compact list, the days in one column and the ranges in
|
|
1669
|
+
the next, under the address, the phone, and the email. */
|
|
1670
|
+
.atelic-ui .footer-brand-hours {
|
|
1671
|
+
margin-top: 20px;
|
|
1672
|
+
}
|
|
1673
|
+
.atelic-ui .footer .footer-brand-hours .footer-heading {
|
|
1674
|
+
font-size: 0.72rem;
|
|
1675
|
+
margin-bottom: 8px;
|
|
1676
|
+
}
|
|
1677
|
+
.atelic-ui .footer-brand-hours dl {
|
|
1678
|
+
display: grid;
|
|
1679
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
1680
|
+
gap: 4px 16px;
|
|
1681
|
+
margin: 0;
|
|
1682
|
+
font-size: 0.9rem;
|
|
1683
|
+
line-height: 1.4;
|
|
1684
|
+
}
|
|
1685
|
+
.atelic-ui .footer-brand-hours dl > div {
|
|
1686
|
+
display: contents;
|
|
1687
|
+
}
|
|
1648
1688
|
.atelic-ui .footer nav a {
|
|
1649
1689
|
display: flex;
|
|
1650
1690
|
align-items: center;
|
|
1651
1691
|
gap: 10px;
|
|
1652
1692
|
padding: 6px 0;
|
|
1693
|
+
font-size: var(--footer-link-size);
|
|
1653
1694
|
color: var(--footer-link, var(--neutral-200));
|
|
1654
1695
|
font-weight: var(--weight-medium);
|
|
1655
1696
|
}
|
|
@@ -1701,20 +1742,60 @@
|
|
|
1701
1742
|
.atelic-ui .footer-grid > * {
|
|
1702
1743
|
flex: 1 1 0;
|
|
1703
1744
|
}
|
|
1745
|
+
/* The brand column's share of the row, a link column's being 1:
|
|
1746
|
+
--footer-brand-width, else 1.4 (2 beside the hours from 1100px). */
|
|
1704
1747
|
.atelic-ui .footer-grid > .footer-brand {
|
|
1705
|
-
flex-grow: 1.4;
|
|
1748
|
+
flex-grow: var(--footer-brand-width, 1.4);
|
|
1706
1749
|
}
|
|
1707
1750
|
/* With the hours beside the four link columns a tablet has no room for
|
|
1708
1751
|
the brand column too, so it keeps the row above them until 1100px. */
|
|
1709
1752
|
.atelic-ui .footer-grid.has-hours > .footer-brand {
|
|
1710
1753
|
flex-basis: 100%;
|
|
1711
1754
|
}
|
|
1755
|
+
/* 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. */
|
|
1767
|
+
.atelic-ui .footer-grid.has-brand-hours {
|
|
1768
|
+
--_link-floor: 10em;
|
|
1769
|
+
--_brand-floor: 17em;
|
|
1770
|
+
--_links-need: calc(
|
|
1771
|
+
var(--_link-count, 4) *
|
|
1772
|
+
var(--_link-floor) +
|
|
1773
|
+
(var(--_link-count, 4) - 1) *
|
|
1774
|
+
24px
|
|
1775
|
+
);
|
|
1776
|
+
--_row-need: calc(var(--_brand-floor) + 24px + var(--_links-need));
|
|
1777
|
+
column-gap: 24px;
|
|
1778
|
+
}
|
|
1779
|
+
.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));
|
|
1782
|
+
}
|
|
1783
|
+
/* min-width: max-content departs from Component Rules 5 (zero the
|
|
1784
|
+
min-width chain around wide content) on purpose: these labels are
|
|
1785
|
+
short words a design sets whole, and the floor is what keeps a label
|
|
1786
|
+
whole on a machine whose font runs a few percent wider; the row wraps
|
|
1787
|
+
a column instead, so nothing scrolls sideways. */
|
|
1788
|
+
.atelic-ui .footer-grid.has-brand-hours > .footer-column {
|
|
1789
|
+
flex: 1 1
|
|
1790
|
+
min(calc(50% - 16px), max(var(--_link-floor), calc((var(--_links-need) - 100%) * 999)));
|
|
1791
|
+
min-width: max-content;
|
|
1792
|
+
}
|
|
1712
1793
|
}
|
|
1713
1794
|
/* One row from 1100px, the brand column a little wider than without the
|
|
1714
1795
|
hours, so the lockup and the rating keep a line each. */
|
|
1715
1796
|
@media (min-width: 1100px) {
|
|
1716
1797
|
.atelic-ui .footer-grid.has-hours > .footer-brand {
|
|
1717
|
-
flex: 2 1 0;
|
|
1798
|
+
flex: var(--footer-brand-width, 2) 1 0;
|
|
1718
1799
|
}
|
|
1719
1800
|
}
|
|
1720
1801
|
/* Text wordmark for a site with no mark image. */
|
|
@@ -1747,9 +1828,13 @@
|
|
|
1747
1828
|
alone. Token themed: the hairline and hover lift derive from --surface
|
|
1748
1829
|
through color-mix and the words read --on-dark-faint, so it rebrands
|
|
1749
1830
|
with theme.css on any page it renders under, light or dark. */
|
|
1831
|
+
/* The rule above the closing bar is drawn in its top border's place, so
|
|
1832
|
+
it can sit inside the content's width (--closing-rule-inset, from each
|
|
1833
|
+
side) while the bar keeps its full width and its height. */
|
|
1750
1834
|
.atelic-ui .closing-bar {
|
|
1835
|
+
position: relative;
|
|
1751
1836
|
background: var(--surface-dark);
|
|
1752
|
-
border-top: 1px solid
|
|
1837
|
+
border-top: 1px solid transparent;
|
|
1753
1838
|
color: var(--on-dark-faint);
|
|
1754
1839
|
font-size: 0.82rem;
|
|
1755
1840
|
padding-block: 18px;
|
|
@@ -1758,6 +1843,21 @@
|
|
|
1758
1843
|
below everything, so nothing on screen moves when it appears. */
|
|
1759
1844
|
padding-bottom: calc(18px + var(--sticky-cta-space, 0px));
|
|
1760
1845
|
}
|
|
1846
|
+
.atelic-ui .closing-bar::before {
|
|
1847
|
+
content: "";
|
|
1848
|
+
position: absolute;
|
|
1849
|
+
top: -1px;
|
|
1850
|
+
left: var(--closing-rule-inset);
|
|
1851
|
+
right: var(--closing-rule-inset);
|
|
1852
|
+
height: 1px;
|
|
1853
|
+
background: color-mix(in srgb, var(--surface) 10%, transparent);
|
|
1854
|
+
}
|
|
1855
|
+
/* The two sides share one line, the copyright at the start and the credit
|
|
1856
|
+
at the end, while they fit; when they do not, the credit wraps under
|
|
1857
|
+
the copyright and both start at the same edge. That is space-between
|
|
1858
|
+
alone: a line holding one side sets it at the start, so no width
|
|
1859
|
+
decides it and a long attribution on a tablet stacks the same way. A
|
|
1860
|
+
side longer than the line wraps inside itself (min-width 0). */
|
|
1761
1861
|
.atelic-ui .closing-bar-line {
|
|
1762
1862
|
display: flex;
|
|
1763
1863
|
flex-wrap: wrap;
|
|
@@ -1765,16 +1865,14 @@
|
|
|
1765
1865
|
align-items: center;
|
|
1766
1866
|
justify-content: space-between;
|
|
1767
1867
|
}
|
|
1868
|
+
.atelic-ui .closing-bar-left,
|
|
1768
1869
|
.atelic-ui .closing-bar-right {
|
|
1769
|
-
|
|
1870
|
+
min-width: 0;
|
|
1770
1871
|
}
|
|
1771
1872
|
.atelic-ui .closing-bar.is-solo .closing-bar-line {
|
|
1772
1873
|
justify-content: center;
|
|
1773
1874
|
text-align: center;
|
|
1774
1875
|
}
|
|
1775
|
-
.atelic-ui .closing-bar.is-solo .closing-bar-right {
|
|
1776
|
-
margin-left: 0;
|
|
1777
|
-
}
|
|
1778
1876
|
/* biome-ignore lint/style/noDescendingSpecificity: scoped to .closing-bar, so it never meets the footer's link rules */
|
|
1779
1877
|
.atelic-ui .closing-bar a {
|
|
1780
1878
|
color: var(--closing-link, var(--neutral-300));
|
|
@@ -776,17 +776,6 @@
|
|
|
776
776
|
grid-row: 1 / span 2;
|
|
777
777
|
color: var(--neutral-500);
|
|
778
778
|
}
|
|
779
|
-
.atelic-ui .rc-sr {
|
|
780
|
-
position: absolute;
|
|
781
|
-
width: 1px;
|
|
782
|
-
height: 1px;
|
|
783
|
-
margin: -1px;
|
|
784
|
-
padding: 0;
|
|
785
|
-
overflow: hidden;
|
|
786
|
-
clip: rect(0, 0, 0, 0);
|
|
787
|
-
white-space: nowrap;
|
|
788
|
-
border: 0;
|
|
789
|
-
}
|
|
790
779
|
@media print, (min-width: 721px) {
|
|
791
780
|
.atelic-ui .rc-card {
|
|
792
781
|
grid-template-columns: auto 232px minmax(0, 1fr) auto;
|
|
@@ -1235,17 +1224,6 @@
|
|
|
1235
1224
|
vertical-align: 0.3em;
|
|
1236
1225
|
border-top: 1.5px solid var(--neutral-300);
|
|
1237
1226
|
}
|
|
1238
|
-
.atelic-ui .data-table-empty-label {
|
|
1239
|
-
position: absolute;
|
|
1240
|
-
width: 1px;
|
|
1241
|
-
height: 1px;
|
|
1242
|
-
margin: -1px;
|
|
1243
|
-
padding: 0;
|
|
1244
|
-
overflow: hidden;
|
|
1245
|
-
clip: rect(0, 0, 0, 0);
|
|
1246
|
-
white-space: nowrap;
|
|
1247
|
-
border: 0;
|
|
1248
|
-
}
|
|
1249
1227
|
@media print, (min-width: 721px) {
|
|
1250
1228
|
.atelic-ui .data-table-sort {
|
|
1251
1229
|
display: none;
|