@atelic-action/ui 8.3.0 → 8.5.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 +74 -9
- package/dist/lib/contactLinks.d.ts +31 -0
- package/dist/lib/contactLinks.js +55 -0
- package/dist/monitoring/server.js +82 -15
- package/dist/scripts/check-contacts.d.ts +17 -0
- package/dist/scripts/check-contacts.js +162 -0
- package/package.json +10 -13
- package/src/chrome/Footer.tsx +27 -17
- package/src/chrome/SiteHeader.tsx +7 -6
- package/src/chrome/SiteMenu.tsx +13 -10
- package/src/chrome/StickyCTABar.tsx +34 -16
- package/src/components/GateLogin.tsx +2 -1
- package/src/components/MultiSelect.tsx +225 -0
- package/src/components/index.ts +1 -0
- package/src/lib/contactForm.ts +184 -0
- package/src/lib/contactLinks.ts +57 -0
- package/src/lib/googlePlaces.ts +392 -0
- package/src/lib/latestOnly.ts +47 -0
- package/src/monitoring/server.ts +92 -16
- package/src/primitives/AddressSearch.tsx +341 -0
- package/src/primitives/EmailLink.tsx +55 -0
- package/src/primitives/ExpandableText.tsx +137 -0
- package/src/primitives/GoogleMapsAttribution.tsx +14 -0
- package/src/primitives/PhoneLink.tsx +61 -0
- package/src/primitives/index.ts +18 -0
- package/src/routing/miss.ts +14 -13
- package/src/scripts/check-base-path.ts +15 -0
- package/src/scripts/check-contacts.ts +177 -0
- package/src/sections/ContactForm.tsx +683 -87
- package/src/sections/ContactInfoCard.tsx +21 -4
- package/src/sections/InfoRows.tsx +103 -0
- package/src/sections/LocationSection.tsx +2 -1
- package/src/sections/Locations.tsx +3 -2
- package/src/sections/PageHero.tsx +22 -5
- package/src/sections/index.ts +23 -1
- package/src/sections/siteConfig.ts +12 -1
- package/src/styles/chrome.css +30 -17
- package/src/styles/components.css +123 -0
- package/src/styles/defaults.css +33 -1
- package/src/styles/fields.css +33 -0
- package/src/styles/primitives.css +165 -0
- package/src/styles/sections.css +310 -22
- package/src/types.ts +7 -2
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { newTabProps } from "../lib/newTabProps";
|
|
2
|
+
import { EmailLink } from "../primitives/EmailLink";
|
|
3
|
+
import { PhoneLink } from "../primitives/PhoneLink";
|
|
2
4
|
import { useWithBase } from "../routing/BasePathProvider";
|
|
3
5
|
import type { SiteConfig } from "./siteConfig";
|
|
4
6
|
|
|
@@ -34,6 +36,14 @@ export interface ContactInfoCardProps {
|
|
|
34
36
|
* so here ("Call or text").
|
|
35
37
|
*/
|
|
36
38
|
phoneLabel?: string;
|
|
39
|
+
/**
|
|
40
|
+
* How each row sets its label beside its value. `inline`, the default, is
|
|
41
|
+
* the small mono label in a column of its own; `stacked` (8.5.0) puts the
|
|
42
|
+
* label over the value in the body face and sets each number large, for a
|
|
43
|
+
* card of several labeled lines where the label is a place ("Downtown")
|
|
44
|
+
* and too long for the column.
|
|
45
|
+
*/
|
|
46
|
+
layout?: "inline" | "stacked";
|
|
37
47
|
}
|
|
38
48
|
|
|
39
49
|
/** Dark card with direct contact rows: call, email, visit, portal. */
|
|
@@ -43,11 +53,17 @@ export function ContactInfoCard({
|
|
|
43
53
|
phones,
|
|
44
54
|
showAddress = true,
|
|
45
55
|
phoneLabel = "Call",
|
|
56
|
+
layout = "inline",
|
|
46
57
|
}: ContactInfoCardProps) {
|
|
47
58
|
const withBase = useWithBase();
|
|
48
59
|
const portal = site.footerLinks?.find((link) => link.label.toLowerCase().includes("portal"));
|
|
49
60
|
return (
|
|
50
|
-
<div
|
|
61
|
+
<div
|
|
62
|
+
className={["contact-info-card", layout === "stacked" && "is-stacked"]
|
|
63
|
+
.filter(Boolean)
|
|
64
|
+
.join(" ")}
|
|
65
|
+
data-ground="dark"
|
|
66
|
+
>
|
|
51
67
|
<h3>{title}</h3>
|
|
52
68
|
<div className="ci-rows">
|
|
53
69
|
{phones?.length
|
|
@@ -55,7 +71,7 @@ export function ContactInfoCard({
|
|
|
55
71
|
<div className="ci-row" key={phone.e164}>
|
|
56
72
|
<span className="k">{phone.role}</span>
|
|
57
73
|
<span className="v">
|
|
58
|
-
<
|
|
74
|
+
<PhoneLink phone={phone} />
|
|
59
75
|
</span>
|
|
60
76
|
</div>
|
|
61
77
|
))
|
|
@@ -63,14 +79,15 @@ export function ContactInfoCard({
|
|
|
63
79
|
<div className="ci-row">
|
|
64
80
|
<span className="k">{phoneLabel}</span>
|
|
65
81
|
<span className="v">
|
|
66
|
-
<
|
|
82
|
+
<PhoneLink phone={site.phone} />
|
|
67
83
|
</span>
|
|
68
84
|
</div>
|
|
69
85
|
)}
|
|
70
86
|
<div className={["ci-row", !showAddress && !portal && "last"].filter(Boolean).join(" ")}>
|
|
71
87
|
<span className="k">Email</span>
|
|
72
88
|
<span className="v">
|
|
73
|
-
|
|
89
|
+
{/* Breaks after the @ and before each dot, never inside a word, as the footer's does. */}
|
|
90
|
+
<EmailLink email={site.email} />
|
|
74
91
|
</span>
|
|
75
92
|
</div>
|
|
76
93
|
{showAddress && (
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { type LucideIcon, Navigation } from "lucide-react";
|
|
2
|
+
import { type ReactNode, useId } from "react";
|
|
3
|
+
import { navIcons } from "../chrome/icons";
|
|
4
|
+
import { newTabProps } from "../lib/newTabProps";
|
|
5
|
+
import { useWithBase } from "../routing/BasePathProvider";
|
|
6
|
+
import type { NavIcon } from "../types";
|
|
7
|
+
|
|
8
|
+
/** The icons a row and its action draw: the mega menu's set, and the directions arrow. */
|
|
9
|
+
export type InfoRowIcon = NavIcon | "directions";
|
|
10
|
+
|
|
11
|
+
const rowIcons: Record<InfoRowIcon, LucideIcon> = { ...navIcons, directions: Navigation };
|
|
12
|
+
|
|
13
|
+
/** The one thing a row does, drawn on its right as an icon over its words. */
|
|
14
|
+
export interface InfoRowAction {
|
|
15
|
+
/** The link's words, under the icon. */
|
|
16
|
+
label: string;
|
|
17
|
+
href: string;
|
|
18
|
+
icon: InfoRowIcon;
|
|
19
|
+
/**
|
|
20
|
+
* Opens in a new tab, as a directions link to a map should. A `tel:` or
|
|
21
|
+
* `mailto:` link never does, whatever this says (Component Rules 12).
|
|
22
|
+
*/
|
|
23
|
+
newTab?: boolean;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface InfoRow {
|
|
27
|
+
/** The row's title: an office's name, a question. */
|
|
28
|
+
title: ReactNode;
|
|
29
|
+
/** The lines under the title, each on its own line: an address, a sentence. */
|
|
30
|
+
lines?: ReactNode[];
|
|
31
|
+
/** Anything under the lines: an office's hours, say, as a `HoursTable`. */
|
|
32
|
+
detail?: ReactNode;
|
|
33
|
+
/** An icon before the title, decorative. */
|
|
34
|
+
icon?: InfoRowIcon;
|
|
35
|
+
action?: InfoRowAction;
|
|
36
|
+
/** A key for the row when its title is not a string. */
|
|
37
|
+
id?: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface InfoRowsProps {
|
|
41
|
+
rows: InfoRow[];
|
|
42
|
+
/** The level each row's title is read at. Defaults to 3. */
|
|
43
|
+
headingLevel?: 2 | 3 | 4 | 5 | 6;
|
|
44
|
+
className?: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* A list of rows, each a title over a few lines with one action on its
|
|
49
|
+
* right, the way a map pack lists a place with its directions: an office
|
|
50
|
+
* and its Get Directions, an estimate and the link to it. The action is an
|
|
51
|
+
* icon in a filled circle over its words; it is described by its row's
|
|
52
|
+
* title, so two Get Directions links tell themselves apart to a screen
|
|
53
|
+
* reader. A row's title is a heading by role (Component Rules 21).
|
|
54
|
+
*/
|
|
55
|
+
export function InfoRows({ rows, headingLevel = 3, className }: InfoRowsProps) {
|
|
56
|
+
const uid = useId();
|
|
57
|
+
const withBase = useWithBase();
|
|
58
|
+
return (
|
|
59
|
+
<ul className={["info-rows", className].filter(Boolean).join(" ")}>
|
|
60
|
+
{rows.map((row, index) => {
|
|
61
|
+
const titleId = `${uid}-${index}`;
|
|
62
|
+
const Lead = row.icon ? rowIcons[row.icon] : null;
|
|
63
|
+
const ActionIcon = row.action ? rowIcons[row.action.icon] : null;
|
|
64
|
+
return (
|
|
65
|
+
<li
|
|
66
|
+
className={["info-row", row.detail && "has-detail"].filter(Boolean).join(" ")}
|
|
67
|
+
key={row.id ?? (typeof row.title === "string" ? row.title : titleId)}
|
|
68
|
+
>
|
|
69
|
+
{Lead && <Lead className="info-row-icon" size={22} aria-hidden="true" />}
|
|
70
|
+
<div className="info-row-text">
|
|
71
|
+
{/* biome-ignore lint/a11y/useSemanticElements: a heading element would take a site's bare heading rules (Component Rules 21) */}
|
|
72
|
+
<div className="info-row-title" id={titleId} role="heading" aria-level={headingLevel}>
|
|
73
|
+
{row.title}
|
|
74
|
+
</div>
|
|
75
|
+
{row.lines && row.lines.length > 0 && (
|
|
76
|
+
<p className="info-row-lines">
|
|
77
|
+
{row.lines.map((line, at) => (
|
|
78
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: the lines are a fixed list, never reordered
|
|
79
|
+
<span key={at}>{line}</span>
|
|
80
|
+
))}
|
|
81
|
+
</p>
|
|
82
|
+
)}
|
|
83
|
+
{row.detail && <div className="info-row-detail">{row.detail}</div>}
|
|
84
|
+
</div>
|
|
85
|
+
{row.action && ActionIcon && (
|
|
86
|
+
<a
|
|
87
|
+
className="info-row-action"
|
|
88
|
+
href={withBase(row.action.href)}
|
|
89
|
+
aria-describedby={titleId}
|
|
90
|
+
{...newTabProps(row.action.href, row.action.newTab)}
|
|
91
|
+
>
|
|
92
|
+
<span className="info-row-action-icon">
|
|
93
|
+
<ActionIcon size={22} aria-hidden="true" />
|
|
94
|
+
</span>
|
|
95
|
+
<span>{row.action.label}</span>
|
|
96
|
+
</a>
|
|
97
|
+
)}
|
|
98
|
+
</li>
|
|
99
|
+
);
|
|
100
|
+
})}
|
|
101
|
+
</ul>
|
|
102
|
+
);
|
|
103
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
import { Eyebrow, Lead } from "../primitives";
|
|
3
3
|
import { Button } from "../primitives/Button";
|
|
4
|
+
import { phoneHref } from "../primitives/PhoneLink";
|
|
4
5
|
import { HoursTable } from "./HoursTable";
|
|
5
6
|
import { MapEmbed, type MapEmbedSite } from "./MapEmbed";
|
|
6
7
|
import type { SiteConfig, Surface } from "./siteConfig";
|
|
@@ -74,7 +75,7 @@ export function LocationSection({
|
|
|
74
75
|
</Button>
|
|
75
76
|
)}
|
|
76
77
|
{site.phone && (
|
|
77
|
-
<Button variant="ghost" href={
|
|
78
|
+
<Button variant="ghost" href={phoneHref(site.phone)}>
|
|
78
79
|
{site.phone.display}
|
|
79
80
|
</Button>
|
|
80
81
|
)}
|
|
@@ -2,6 +2,7 @@ import { Navigation, Phone } from "lucide-react";
|
|
|
2
2
|
import type { ReactNode } from "react";
|
|
3
3
|
import { newTabProps } from "../lib/newTabProps";
|
|
4
4
|
import { Eyebrow, Lead } from "../primitives";
|
|
5
|
+
import { PhoneLink } from "../primitives/PhoneLink";
|
|
5
6
|
import { MapEmbed, type MapEmbedSite } from "./MapEmbed";
|
|
6
7
|
import type { Surface } from "./siteConfig";
|
|
7
8
|
|
|
@@ -65,10 +66,10 @@ export function Locations({
|
|
|
65
66
|
))}
|
|
66
67
|
</div>
|
|
67
68
|
<div className="loc-links">
|
|
68
|
-
<
|
|
69
|
+
<PhoneLink phone={{ e164: loc.phoneE164, display: loc.phoneDisplay }}>
|
|
69
70
|
<Phone size={14} aria-hidden />
|
|
70
71
|
<span className="tel-number">{loc.phoneDisplay}</span>
|
|
71
|
-
</
|
|
72
|
+
</PhoneLink>
|
|
72
73
|
<a href={loc.mapLink} {...newTabProps(loc.mapLink, true)}>
|
|
73
74
|
<Navigation size={14} aria-hidden />
|
|
74
75
|
Directions
|
|
@@ -4,18 +4,25 @@ import type { Surface } from "./siteConfig";
|
|
|
4
4
|
|
|
5
5
|
export interface PageHeroProps {
|
|
6
6
|
eyebrow?: string;
|
|
7
|
+
/** Draws the eyebrow's trailing rule. Defaults to true; false sets the kicker alone, as `Hero`'s does. */
|
|
8
|
+
eyebrowRule?: boolean;
|
|
7
9
|
title: ReactNode;
|
|
8
10
|
lead?: ReactNode;
|
|
9
11
|
center?: boolean;
|
|
10
12
|
/** Extra content under the lead (e.g. jump-link chips). */
|
|
11
13
|
children?: ReactNode;
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
+
/**
|
|
15
|
+
* The band's background. Defaults to `alt`, the band an interior page
|
|
16
|
+
* opens on; `primary` (8.5.0) sets it on the primary fill, its words in
|
|
17
|
+
* `--on-primary`, as the callout panel and the price band are.
|
|
18
|
+
*/
|
|
19
|
+
surface?: Surface | "primary";
|
|
14
20
|
}
|
|
15
21
|
|
|
16
|
-
/** Interior page opener on the alternate surface band. */
|
|
22
|
+
/** Interior page opener on the alternate surface band, the page surface, or the primary fill. */
|
|
17
23
|
export function PageHero({
|
|
18
24
|
eyebrow,
|
|
25
|
+
eyebrowRule = true,
|
|
19
26
|
title,
|
|
20
27
|
lead,
|
|
21
28
|
center = false,
|
|
@@ -24,12 +31,22 @@ export function PageHero({
|
|
|
24
31
|
}: PageHeroProps) {
|
|
25
32
|
return (
|
|
26
33
|
<section
|
|
27
|
-
className={[
|
|
34
|
+
className={[
|
|
35
|
+
"page-hero",
|
|
36
|
+
center && "center",
|
|
37
|
+
surface === "default" && "surface-default",
|
|
38
|
+
surface === "primary" && "on-primary",
|
|
39
|
+
]
|
|
28
40
|
.filter(Boolean)
|
|
29
41
|
.join(" ")}
|
|
42
|
+
data-ground={surface === "primary" ? "primary" : undefined}
|
|
30
43
|
>
|
|
31
44
|
<div className="wrap">
|
|
32
|
-
{eyebrow &&
|
|
45
|
+
{eyebrow && (
|
|
46
|
+
<Eyebrow center={center} rule={eyebrowRule}>
|
|
47
|
+
{eyebrow}
|
|
48
|
+
</Eyebrow>
|
|
49
|
+
)}
|
|
33
50
|
<h1>{title}</h1>
|
|
34
51
|
{lead && <Lead style={center ? { marginInline: "auto" } : undefined}>{lead}</Lead>}
|
|
35
52
|
{children}
|
package/src/sections/index.ts
CHANGED
|
@@ -5,6 +5,13 @@
|
|
|
5
5
|
* `@atelic-action/ui/styles/sections.css`; a section imports no stylesheet of
|
|
6
6
|
* its own.
|
|
7
7
|
*/
|
|
8
|
+
|
|
9
|
+
export {
|
|
10
|
+
type ContactFormField,
|
|
11
|
+
type ContactFormValues,
|
|
12
|
+
isPhoneNumber,
|
|
13
|
+
isZIP,
|
|
14
|
+
} from "../lib/contactForm";
|
|
8
15
|
export { isHoneypotFilled } from "../lib/honeypot";
|
|
9
16
|
export { type ClockOptions, formatClock, formatHoursRange, isClosed } from "../lib/hours";
|
|
10
17
|
export { type EventParams, trackEvent } from "../lib/trackEvent";
|
|
@@ -21,7 +28,15 @@ export {
|
|
|
21
28
|
ComparisonTable,
|
|
22
29
|
type ComparisonTableProps,
|
|
23
30
|
} from "./ComparisonTable";
|
|
24
|
-
export {
|
|
31
|
+
export {
|
|
32
|
+
ContactForm,
|
|
33
|
+
type ContactFormAddress,
|
|
34
|
+
type ContactFormConsent,
|
|
35
|
+
type ContactFormLabels,
|
|
36
|
+
type ContactFormPlaceholders,
|
|
37
|
+
type ContactFormProps,
|
|
38
|
+
type ContactFormThanks,
|
|
39
|
+
} from "./ContactForm";
|
|
25
40
|
export {
|
|
26
41
|
ContactInfoCard,
|
|
27
42
|
type ContactInfoCardProps,
|
|
@@ -44,6 +59,13 @@ export { FullBleedVideo, type FullBleedVideoProps } from "./FullBleedVideo";
|
|
|
44
59
|
export { Gallery, type GalleryPhoto, type GalleryProps } from "./Gallery";
|
|
45
60
|
export { Hero, type HeroCTA, type HeroProps, type HeroTrustItem } from "./Hero";
|
|
46
61
|
export { HoursTable, type HoursTableProps } from "./HoursTable";
|
|
62
|
+
export {
|
|
63
|
+
type InfoRow,
|
|
64
|
+
type InfoRowAction,
|
|
65
|
+
type InfoRowIcon,
|
|
66
|
+
InfoRows,
|
|
67
|
+
type InfoRowsProps,
|
|
68
|
+
} from "./InfoRows";
|
|
47
69
|
export { JumpRail, type JumpRailItem, type JumpRailProps } from "./JumpRail";
|
|
48
70
|
export { type LegalBlock, type LegalDoc, LegalPage, type LegalPageProps } from "./LegalPage";
|
|
49
71
|
export {
|
|
@@ -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?: {
|
|
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 };
|
package/src/styles/chrome.css
CHANGED
|
@@ -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
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
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:
|
|
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
|
-
|
|
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;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
@import "./defaults.css";
|
|
2
|
+
@import "./fields.css";
|
|
2
3
|
@import "./star-rating.css";
|
|
3
4
|
|
|
4
5
|
/* Layout defaults for the components under src/components. A site's own
|
|
@@ -1357,4 +1358,126 @@
|
|
|
1357
1358
|
display: none;
|
|
1358
1359
|
}
|
|
1359
1360
|
}
|
|
1361
|
+
|
|
1362
|
+
/* ---- MultiSelect: a button naming what is chosen over a Radix popover
|
|
1363
|
+
of Radix checkboxes. Here, not in primitives.css or sections.css, so
|
|
1364
|
+
an app that wears .atelic-ui and loads this sheet alone draws it; it
|
|
1365
|
+
reads only the tokens an app maps (In an App), with the --ui- names
|
|
1366
|
+
for the primary and the card. The list renders in place, so these
|
|
1367
|
+
rules reach it. Specific enough to hold off a form's .field rules,
|
|
1368
|
+
which would set an option's label in the field label's mono caps. ---- */
|
|
1369
|
+
.atelic-ui .multi-select {
|
|
1370
|
+
display: flex;
|
|
1371
|
+
flex-direction: column;
|
|
1372
|
+
gap: 7px;
|
|
1373
|
+
min-width: 0;
|
|
1374
|
+
}
|
|
1375
|
+
.atelic-ui .multi-select .multi-select-button {
|
|
1376
|
+
box-sizing: border-box;
|
|
1377
|
+
width: 100%;
|
|
1378
|
+
display: flex;
|
|
1379
|
+
align-items: center;
|
|
1380
|
+
justify-content: space-between;
|
|
1381
|
+
gap: 12px;
|
|
1382
|
+
padding: var(--field-padding-block) var(--field-padding-inline);
|
|
1383
|
+
border: 1.5px solid var(--field-border, var(--neutral-200));
|
|
1384
|
+
border-radius: var(--radius-md, 10px);
|
|
1385
|
+
background: var(--ui-card, var(--card));
|
|
1386
|
+
color: var(--ink);
|
|
1387
|
+
font: inherit;
|
|
1388
|
+
text-align: left;
|
|
1389
|
+
cursor: pointer;
|
|
1390
|
+
transition:
|
|
1391
|
+
border-color 0.15s,
|
|
1392
|
+
box-shadow 0.15s;
|
|
1393
|
+
}
|
|
1394
|
+
.atelic-ui .multi-select .multi-select-button[data-empty] {
|
|
1395
|
+
color: var(--ink-soft);
|
|
1396
|
+
}
|
|
1397
|
+
.atelic-ui .multi-select .multi-select-button:focus-visible {
|
|
1398
|
+
outline: none;
|
|
1399
|
+
border-color: var(--ui-primary, var(--primary));
|
|
1400
|
+
box-shadow: 0 0 0 4px color-mix(in srgb, var(--ui-primary, var(--primary)) 18%, transparent);
|
|
1401
|
+
}
|
|
1402
|
+
.atelic-ui .multi-select-value {
|
|
1403
|
+
min-width: 0;
|
|
1404
|
+
}
|
|
1405
|
+
.atelic-ui .multi-select-chevron {
|
|
1406
|
+
flex: none;
|
|
1407
|
+
color: var(--ink-soft);
|
|
1408
|
+
}
|
|
1409
|
+
.atelic-ui .multi-select-button[aria-expanded="true"] .multi-select-chevron {
|
|
1410
|
+
transform: rotate(180deg);
|
|
1411
|
+
}
|
|
1412
|
+
.atelic-ui .multi-select-list {
|
|
1413
|
+
box-sizing: border-box;
|
|
1414
|
+
width: var(--radix-popover-trigger-width);
|
|
1415
|
+
max-height: min(320px, var(--radix-popover-content-available-height, 320px));
|
|
1416
|
+
overflow-y: auto;
|
|
1417
|
+
z-index: 30;
|
|
1418
|
+
display: flex;
|
|
1419
|
+
flex-direction: column;
|
|
1420
|
+
padding: 6px;
|
|
1421
|
+
border: 1.5px solid var(--field-border, var(--neutral-200));
|
|
1422
|
+
border-radius: var(--radius-md, 10px);
|
|
1423
|
+
background: var(--ui-card, var(--card));
|
|
1424
|
+
color: var(--ink);
|
|
1425
|
+
box-shadow: var(--shadow-md);
|
|
1426
|
+
}
|
|
1427
|
+
.atelic-ui .multi-select-list:focus-visible {
|
|
1428
|
+
outline: 2px solid var(--ui-primary, var(--primary));
|
|
1429
|
+
}
|
|
1430
|
+
.atelic-ui .multi-select .multi-select-option {
|
|
1431
|
+
display: flex;
|
|
1432
|
+
align-items: center;
|
|
1433
|
+
gap: 12px;
|
|
1434
|
+
min-height: 44px;
|
|
1435
|
+
padding: 0 12px;
|
|
1436
|
+
border-radius: var(--radius-sm);
|
|
1437
|
+
}
|
|
1438
|
+
.atelic-ui .multi-select .multi-select-option:hover {
|
|
1439
|
+
background: var(--primary-tint);
|
|
1440
|
+
}
|
|
1441
|
+
.atelic-ui .multi-select .multi-select-option label {
|
|
1442
|
+
flex: 1;
|
|
1443
|
+
min-width: 0;
|
|
1444
|
+
padding: 10px 0;
|
|
1445
|
+
font-family: var(--font-sans);
|
|
1446
|
+
font-size: 1rem;
|
|
1447
|
+
font-weight: var(--weight-regular);
|
|
1448
|
+
letter-spacing: normal;
|
|
1449
|
+
text-transform: none;
|
|
1450
|
+
color: var(--ink);
|
|
1451
|
+
cursor: pointer;
|
|
1452
|
+
}
|
|
1453
|
+
.atelic-ui .multi-select .multi-select-box {
|
|
1454
|
+
flex: none;
|
|
1455
|
+
width: 20px;
|
|
1456
|
+
height: 20px;
|
|
1457
|
+
display: grid;
|
|
1458
|
+
place-items: center;
|
|
1459
|
+
padding: 0;
|
|
1460
|
+
border: 1.5px solid var(--ink-soft);
|
|
1461
|
+
border-radius: 4px;
|
|
1462
|
+
background: var(--ui-card, var(--card));
|
|
1463
|
+
color: var(--ui-card, var(--card));
|
|
1464
|
+
cursor: pointer;
|
|
1465
|
+
}
|
|
1466
|
+
.atelic-ui .multi-select .multi-select-box[data-state="checked"] {
|
|
1467
|
+
border-color: var(--ui-primary, var(--primary));
|
|
1468
|
+
background: var(--ui-primary, var(--primary));
|
|
1469
|
+
}
|
|
1470
|
+
.atelic-ui .multi-select .multi-select-box:focus-visible {
|
|
1471
|
+
outline: 2px solid var(--ui-primary, var(--primary));
|
|
1472
|
+
outline-offset: 2px;
|
|
1473
|
+
}
|
|
1474
|
+
.atelic-ui .multi-select-tick {
|
|
1475
|
+
display: grid;
|
|
1476
|
+
place-items: center;
|
|
1477
|
+
}
|
|
1478
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1479
|
+
.atelic-ui .multi-select .multi-select-button {
|
|
1480
|
+
transition: none;
|
|
1481
|
+
}
|
|
1482
|
+
}
|
|
1360
1483
|
}
|
package/src/styles/defaults.css
CHANGED
|
@@ -126,7 +126,21 @@
|
|
|
126
126
|
--footer-link-hover (--on-dark), --closing-link (--neutral-300),
|
|
127
127
|
and --closing-link-hover (--surface mixed with --on-dark);
|
|
128
128
|
--menu-rule (--hairline), on the light sheet; --hero-split-pad-block
|
|
129
|
-
(--section-space)
|
|
129
|
+
(--section-space); a form field's --field-label-font (--font-mono),
|
|
130
|
+
--field-label-color (--neutral-600), --field-label-weight (the
|
|
131
|
+
inherited weight), and --field-border (--neutral-200), each read by
|
|
132
|
+
.field and by the pickers' own fields; a form's --field-error
|
|
133
|
+
(--primary-ink, then --primary), --field-error-border
|
|
134
|
+
(--primary-deep), and --field-error-bg (--primary-tint), on a refused
|
|
135
|
+
field's words and border and the count over the form;
|
|
136
|
+
--field-error-weight, --form-footnote-align, and the footnote's
|
|
137
|
+
--form-footnote-link-weight and --form-footnote-link-color (each
|
|
138
|
+
the inherited value); HoursTable's --hours-rule (1px dashed
|
|
139
|
+
--neutral-200) and --hours-time-font (--font-mono); the page hero's
|
|
140
|
+
--page-hero-pad-block (its own top and bottom, from
|
|
141
|
+
--section-space), --page-hero-kicker-font (--font-mono), and its
|
|
142
|
+
kicker's size, weight, and tracking (the eyebrow's own, on
|
|
143
|
+
.eyebrow). --hero-stack-gap and the three gaps under it
|
|
130
144
|
(--hero-gap-kicker, --hero-gap-lead, --hero-gap-actions) have no
|
|
131
145
|
default of their own: unset, each gap in the hero keeps the value
|
|
132
146
|
it always had, in place; so has --footer-brand-width, the brand
|
|
@@ -146,6 +160,8 @@
|
|
|
146
160
|
--hero-lead-size: clamp(1.05rem, 2.2vw, 1.35rem);
|
|
147
161
|
--hero-lead-measure: 52ch;
|
|
148
162
|
--hero-lead-leading: 1.55;
|
|
163
|
+
/* The hero's kicker: the inline block it has always been. */
|
|
164
|
+
--hero-kicker-display: inline-block;
|
|
149
165
|
/* A FeatureGrid card's title. */
|
|
150
166
|
--card-title-color: currentColor;
|
|
151
167
|
/* A CalloutPanel title's case, and its subtitle's case and tracking. */
|
|
@@ -165,6 +181,22 @@
|
|
|
165
181
|
--closing-rule-inset: 0px;
|
|
166
182
|
/* The gap between the hero's actions, side by side or stacked. */
|
|
167
183
|
--hero-actions-gap: 14px;
|
|
184
|
+
/* An HoursTable time's size (8.5.0). */
|
|
185
|
+
--hours-time-size: 0.85rem;
|
|
186
|
+
/* A refused field's message size and border width (8.5.0). */
|
|
187
|
+
--field-error-size: 0.82rem;
|
|
188
|
+
--field-error-border-width: 1.5px;
|
|
189
|
+
/* A form field's padding, the pickers' with it, and the contact form's
|
|
190
|
+
footnote size (8.5.0). */
|
|
191
|
+
--field-padding-block: 14px;
|
|
192
|
+
--field-padding-inline: 16px;
|
|
193
|
+
--form-footnote-size: 0.82rem;
|
|
194
|
+
/* The page hero's headline size (8.5.0). */
|
|
195
|
+
--page-hero-title-size: clamp(2.4rem, 7vw, 4.2rem);
|
|
196
|
+
/* A form field's label: its size, its case, and its tracking (8.5.0). */
|
|
197
|
+
--field-label-size: 0.74rem;
|
|
198
|
+
--field-label-case: uppercase;
|
|
199
|
+
--field-label-tracking: 0.1em;
|
|
168
200
|
}
|
|
169
201
|
|
|
170
202
|
/* ---- Long words ----
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
@import "./defaults.css";
|
|
2
|
+
/* The form field label rule the field sheets share (8.5.0). */
|
|
3
|
+
@layer atelic-ui {
|
|
4
|
+
/* A form field's label and the quiet note beside it, such as
|
|
5
|
+
"(optional)": a field's (.field label), the address search's, and the
|
|
6
|
+
multi select's, one rule for all three (8.5.0). Its own sheet,
|
|
7
|
+
imported by the three that draw a labeled field (sections.css,
|
|
8
|
+
primitives.css, components.css) right after defaults.css, so an app
|
|
9
|
+
that loads components.css alone still gets the multi select's label. Each reads
|
|
10
|
+
the --field-label tokens, at the look .field label always had; the
|
|
11
|
+
color falls back to --ink-soft where no --neutral-600 is mapped (an
|
|
12
|
+
app). The note takes the body face, never the label's case. */
|
|
13
|
+
.atelic-ui .field label,
|
|
14
|
+
.atelic-ui .address-search .address-search-label,
|
|
15
|
+
.atelic-ui .multi-select .multi-select-label {
|
|
16
|
+
font-family: var(--field-label-font, var(--font-mono));
|
|
17
|
+
font-size: var(--field-label-size);
|
|
18
|
+
font-weight: var(--field-label-weight, inherit);
|
|
19
|
+
letter-spacing: var(--field-label-tracking);
|
|
20
|
+
text-transform: var(--field-label-case);
|
|
21
|
+
color: var(--field-label-color, var(--neutral-600, var(--ink-soft)));
|
|
22
|
+
}
|
|
23
|
+
.atelic-ui .field-hint,
|
|
24
|
+
.atelic-ui .address-search .address-search-label small,
|
|
25
|
+
.atelic-ui .multi-select .multi-select-label small {
|
|
26
|
+
font-family: var(--font-sans);
|
|
27
|
+
font-size: 0.92em;
|
|
28
|
+
font-weight: var(--weight-regular);
|
|
29
|
+
letter-spacing: normal;
|
|
30
|
+
text-transform: none;
|
|
31
|
+
color: var(--ink-soft);
|
|
32
|
+
}
|
|
33
|
+
}
|