@atelic-action/ui 5.0.0 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -12,12 +12,12 @@ Every export, grouped by the entry it is imported from. The gallery column links
12
12
  |---|---|---|---|
13
13
  | `SiteHeader` | `@atelic-action/ui/chrome` | The fixed bar: the lockup, the nav or a page's own stops, the call to action, the burger; transparent, solid, or dark | [#site-header](https://ui.atelic.me/#site-header) |
14
14
  | `SiteMenu` | `@atelic-action/ui/chrome` | The phone's full screen menu, on a native modal dialog | [#site-menu](https://ui.atelic.me/#site-menu) |
15
- | `Footer` | `@atelic-action/ui/chrome` | The site's foot: brand column, nav, address, hours, legal links, closing bar | [#footer](https://ui.atelic.me/#footer) |
16
- | `ClosingBar` | `@atelic-action/ui/chrome` | The line that closes every page: the copyright with the business's name, and the made with note crediting the practice | [#closing-bar](https://ui.atelic.me/#closing-bar) |
15
+ | `Footer` | `@atelic-action/ui/chrome` | The default footer: the brand column (logo, Google rating, linked address, phone, email), the link columns, and the closing bar | [#footer](https://ui.atelic.me/#footer) |
16
+ | `ClosingBar`, `Copyright`, `Credit` | `@atelic-action/ui/chrome` | The line that closes every page, in two sides that each take anything: by default `Copyright` with the business's name on the left and `Credit`, the practice's made with line, on the right | [#closing-bar](https://ui.atelic.me/#closing-bar) |
17
17
  | `StickyCTABar` | `@atelic-action/ui/chrome` | The phone's bottom bar: the call to action and a call shortcut, there from the top on an interior page (`fromTop`) and sliding in after a scroll on a hero page | [#sticky-cta-bar](https://ui.atelic.me/#sticky-cta-bar) |
18
18
  | `BrandLockup` | `@atelic-action/ui/chrome` | The header's identity as one link, with the recipient's mark on a sent document | [#brand-lockup](https://ui.atelic.me/#brand-lockup) |
19
19
  | `SkipLink` | `@atelic-action/ui/chrome` | The keyboard user's jump past the chrome | [#skip-link](https://ui.atelic.me/#skip-link) |
20
- | `Brand`, `BrandLogo`, `CallToAction`, `HoursRow`, `MenuContact`, `NavLink`, `Phone`, `PostalAddress`, `SiteLink`, `SocialLink`, `PageStop` | `@atelic-action/ui/chrome` | The shapes the chrome renders from (types) | none |
20
+ | `Brand`, `BrandLogo`, `CallToAction`, `HoursRow`, `MenuContact`, `NavLink`, `Phone`, `PostalAddress`, `SiteLink`, `SocialLink`, `PageStop`, `FooterColumn`, `FooterColumnLink`, `FooterIcon` | `@atelic-action/ui/chrome` | The shapes the chrome renders from (types) | none |
21
21
  | `NotFound` | `@atelic-action/ui/components` | The body of the page an unknown path renders | [#not-found](https://ui.atelic.me/#not-found) |
22
22
  | `Checklist` | `@atelic-action/ui/components` | A short list of checks, each passed or failed | [#checklist](https://ui.atelic.me/#checklist) |
23
23
  | `IconList` | `@atelic-action/ui/components` | A list whose bullets are icons, one for the list or one per item, each in a tone | [#icon-list](https://ui.atelic.me/#icon-list) |
@@ -464,7 +464,7 @@ The provider stays in the source entry on purpose. A built copy of it would be a
464
464
 
465
465
  ### SiteShell
466
466
 
467
- `SiteShell` (in `@atelic-action/ui/chrome`) is the page wrapper: the `.atelic-ui` scope around the skip link, the header, `<main>`, the sticky CTA bar, the footer with its closing bar, and the watermark, all mapped from the `SiteConfig`. It takes `site`, `currentPath` (the package imports no router), `basePath`, and `nav` (defaults to `site.nav`), plus `heroNav`, `stickyCTA`, `footer`, `pageNav`, `navOnDark`, `hideNavCTA`, and `credit` (the practice's credit after the closing bar's note; the copyright prints either way). 5.0.0 renames `CreditBar` to `ClosingBar` with no alias, replaces `.credit-bar` and `.footer-bottom` with `.closing-bar`, and `footer.note` now prints at the far right of the closing bar, followed by " by Atelic" while `credit` is on. A site keeps a wrapper a few lines long:
467
+ `SiteShell` (in `@atelic-action/ui/chrome`) is the page wrapper: the `.atelic-ui` scope around the skip link, the header, `<main>`, the sticky CTA bar, the footer with its closing bar, and the watermark, all mapped from the `SiteConfig`. It takes `site`, `currentPath` (the package imports no router), `basePath`, and `nav` (defaults to `site.nav`), plus `heroNav`, `stickyCTA`, `footer`, `pageNav`, `navOnDark`, `hideNavCTA`, and `credit` (the practice's credit on the closing bar's right side; the copyright prints either way). 5.0.0 renames `CreditBar` to `ClosingBar` with no alias, replaces `.credit-bar` and `.footer-bottom` with `.closing-bar`, and `footer.note` prints at the far right of the closing bar. Since 6.0.0 the closing bar is two sides, `left` and `right`, that each take anything: left out, they are `Copyright` with the business's name and `Credit`, the practice's made with line; `null` empties a side. `credit` off empties the right side and keeps the copyright, and a `footer.note` stands in place of the credit whether `credit` is on or off. A site keeps a wrapper a few lines long:
468
468
 
469
469
  ```tsx
470
470
  import { SiteShell as Shell, type SiteShellProps } from "@atelic-action/ui/chrome";
@@ -476,6 +476,33 @@ export function SiteShell(props: Omit<SiteShellProps, "currentPath" | "basePath"
476
476
  }
477
477
  ```
478
478
 
479
+ ### The Default Footer
480
+
481
+ Every site's footer has one shape, and `Footer` draws it (7.0.0):
482
+
483
+ - **The brand column:** the logo, then the Google rating as plain text beside five stars (never a link), then the one address, the headquarters, linked to the business's Google profile, then the phone and the email, each a link.
484
+ - **Four link columns:** Company, Resources, Social, and Legal, in that order. A Social link carries its icon in front of its words. A column with no links is left out, and the grid sizes itself to the columns shown.
485
+ - **The closing bar:** `ClosingBar` under it all, `Copyright` with the business's name on the left and `Credit` on the right.
486
+
487
+ The header carries the services and the service areas, so the footer does not repeat them. It holds no blurb, no hours, no call to action, and no credential badges; a site that needs one of those puts it on a page.
488
+
489
+ `SiteShell` fills the footer from the `SiteConfig`, so a site names nothing twice:
490
+
491
+ | The footer shows | From the config |
492
+ |---|---|
493
+ | The rating | `footer.rating`, as printed (`"4.8 on Google"`) |
494
+ | The address and its link | `address` and `mapLinkURL`; `footer.showAddress: false` drops the address |
495
+ | The phone and the email | `phone`, `email` |
496
+ | Company | `nav` |
497
+ | Resources | `footerLinks` |
498
+ | Social | `socialLinks`, each with its `icon` (`facebook`, `github`, `instagram`, `linkedin`, `mail`, `star`, `user`, `youtube`) |
499
+ | Legal | `legalLinks` |
500
+ | The closing bar's right side | the practice's credit, or `footer.note` in its place |
501
+
502
+ A site whose footer genuinely needs other columns names them outright in `footer.columns`, which replaces the derived four. Rendering `Footer` directly, a site passes `columns` itself.
503
+
504
+ Moving to 7.0.0: `footerBlurb` and `footer.contactHeading` are gone from the config, and `Footer` no longer takes `blurb`, `socialLinks`, `links`, `extraLinks`, `contactHeading`, `hours`, or `legalLinks`. Delete `footerBlurb` from the site config; the rest carries over through the mapping above. The hours stay in the config for the structured data and the page sections that print them.
505
+
479
506
  ### Every Section
480
507
 
481
508
  | Section | What it is |
@@ -520,7 +547,7 @@ The primitives that came with them, in `@atelic-action/ui/primitives`: `ImageFra
520
547
 
521
548
  The entry also exports the helpers the sections use, for a site's own code: `formatClock`, `formatHoursRange`, and `isClosed` for hours, `isHoneypotFilled`, and `trackEvent`.
522
549
 
523
- Hours print on the 12 hour clock unless the site's config sets `clock: "24h"`, which turns "9a to 5p" into "09:00 to 17:00" everywhere hours appear: the footer through `SiteShell`, `LocationSection`, and `HoursTable` (which takes `clock` as a prop when used on its own). `formatClock` and `formatHoursRange` take the same `clock` option for a site's own code.
550
+ Hours print on the 12 hour clock unless the site's config sets `clock: "24h"`, which turns "9a to 5p" into "09:00 to 17:00" everywhere hours appear: `LocationSection` and `HoursTable` (which takes `clock` as a prop when used on its own). `formatClock` and `formatHoursRange` take the same `clock` option for a site's own code.
524
551
 
525
552
  ### The Marketing Vite Config and Commands
526
553
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atelic-action/ui",
3
- "version": "5.0.0",
3
+ "version": "7.0.0",
4
4
  "description": "Shared UI for the Atelic templates: site chrome, base styles, the component library, the access gate, and the app shell they install",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -1,58 +1,41 @@
1
- import { newTabProps } from "../lib/newTabProps";
2
-
3
- /**
4
- * The line that closes every page: the copyright with the business's name on
5
- * the left and the made with note on the far right, crediting the practice
6
- * in one link. Footer renders it at its foot, and a page with no footer,
7
- * like a sent document, renders it on its own; given no name it is the note
8
- * alone, centered.
9
- *
10
- * The heart ships as an escape sequence: the no emoji test bars literal
11
- * pictographs from `src/`.
12
- */
13
- const DEFAULT_NOTE = "Made with \u{1F49A} in Denver, CO";
1
+ import type { ReactNode } from "react";
2
+ import { Copyright } from "./Copyright";
3
+ import { Credit } from "./Credit";
14
4
 
15
5
  export interface ClosingBarProps {
16
- /** The business's name, printed in the copyright. Omit it on a page that names no business. */
6
+ /** The business's name, for the default copyright on the left. */
17
7
  name?: string;
18
- /** Suffix on the copyright, e.g. "Dr. Alex Rivers, PT, DPT". */
19
- attribution?: string;
20
- /** The made with note at the far right. Defaults to the practice's own line. */
21
- note?: string;
22
8
  /**
23
- * Credit the practice after the note. Defaults on (client sites carry it);
24
- * the practice's own site turns it off, since crediting yourself on your
25
- * own page reads as noise.
9
+ * The left side. Left out, it is the copyright with `name`, or nothing
10
+ * when there is no name; `null` empties it; anything else renders as given.
11
+ */
12
+ left?: ReactNode;
13
+ /**
14
+ * The right side. Left out, it is the practice's credit; `null` empties
15
+ * it; anything else renders as given.
26
16
  */
27
- credit?: boolean;
17
+ right?: ReactNode;
28
18
  }
29
19
 
30
- export function ClosingBar({
31
- name,
32
- attribution,
33
- note = DEFAULT_NOTE,
34
- credit = true,
35
- }: ClosingBarProps) {
20
+ /**
21
+ * The line that closes every page: two sides, each taking anything. By
22
+ * default the left is the copyright with the business's name and the right is
23
+ * the practice's credit. Footer renders it at its foot, and a page with no
24
+ * footer, like a sent document, renders it on its own; with nothing on the
25
+ * left, the right side sits centered.
26
+ */
27
+ export function ClosingBar({ name, left, right }: ClosingBarProps) {
28
+ const leftSide = left === undefined ? name ? <Copyright name={name} /> : null : left;
29
+ const rightSide = right === undefined ? <Credit /> : right;
30
+ const hasLeft = leftSide !== null && leftSide !== false;
31
+ const hasRight = rightSide !== null && rightSide !== false;
32
+ if (!hasLeft && !hasRight) return null;
33
+
36
34
  return (
37
- <div className={name ? "closing-bar" : "closing-bar is-solo"}>
35
+ <div className={hasLeft ? "closing-bar" : "closing-bar is-solo"}>
38
36
  <div className="wrap closing-bar-line">
39
- {name && (
40
- <span>
41
- © {new Date().getFullYear()} {name}
42
- {attribution ? ` · ${attribution}` : ""}
43
- </span>
44
- )}
45
- <span className="closing-bar-note">
46
- {note}
47
- {credit && (
48
- <>
49
- {" by "}
50
- <a href="https://atelic.me" {...newTabProps("https://atelic.me", true)}>
51
- Atelic
52
- </a>
53
- </>
54
- )}
55
- </span>
37
+ {hasLeft && <div className="closing-bar-left">{leftSide}</div>}
38
+ {hasRight && <div className="closing-bar-right">{rightSide}</div>}
56
39
  </div>
57
40
  </div>
58
41
  );
@@ -0,0 +1,16 @@
1
+ export interface CopyrightProps {
2
+ /** The business's name. */
3
+ name: string;
4
+ /** Suffix after the name, e.g. "Dr. Alex Rivers, PT, DPT". */
5
+ attribution?: string;
6
+ }
7
+
8
+ /** The copyright line: the mark, this year, and the business's name. The closing bar's default left side. */
9
+ export function Copyright({ name, attribution }: CopyrightProps) {
10
+ return (
11
+ <span className="copyright">
12
+ © {new Date().getFullYear()} {name}
13
+ {attribution ? ` · ${attribution}` : ""}
14
+ </span>
15
+ );
16
+ }
@@ -0,0 +1,19 @@
1
+ import { newTabProps } from "../lib/newTabProps";
2
+
3
+ /**
4
+ * The practice's credit: where the site was made and by whom, with the
5
+ * practice in one link. The closing bar's default right side.
6
+ *
7
+ * The heart ships as an escape sequence: the no emoji test bars literal
8
+ * pictographs from `src/`.
9
+ */
10
+ export function Credit() {
11
+ return (
12
+ <span className="credit">
13
+ Made with {"\u{1F49A}"} in Denver, Colorado by{" "}
14
+ <a href="https://atelic.me" {...newTabProps("https://atelic.me", true)}>
15
+ Atelic
16
+ </a>
17
+ </span>
18
+ );
19
+ }
@@ -1,21 +1,14 @@
1
- import { Mail, UserRound } from "lucide-react";
2
- import type { ComponentProps } from "react";
1
+ import { Mail, Star, UserRound } from "lucide-react";
2
+ import type { ComponentProps, CSSProperties } from "react";
3
3
  import { newTabProps } from "../lib/newTabProps";
4
- import type {
5
- Brand,
6
- HoursRow,
7
- NavLink,
8
- Phone,
9
- PostalAddress,
10
- SiteLink,
11
- SocialLink,
12
- } from "../types";
4
+ import type { Brand, FooterColumn, FooterColumnLink, Phone, PostalAddress } from "../types";
13
5
  import { ClosingBar } from "./ClosingBar";
6
+ import { Copyright } from "./Copyright";
14
7
 
15
8
  /*
16
9
  * lucide-react ships no brand marks (removed upstream by policy), and a code
17
10
  * glyph standing in for GitHub or a briefcase for LinkedIn misleads the
18
- * reader. These two are the brands' own simple marks, carried by hand as a
11
+ * reader. These are the brands' own simple marks, carried by hand as a
19
12
  * considered exception to the lucide only rule; like lucide icons they take
20
13
  * currentColor and a size prop.
21
14
  */
@@ -51,93 +44,161 @@ function LinkedInMark({ size = 18, ...rest }: MarkProps) {
51
44
  );
52
45
  }
53
46
 
54
- const SOCIAL_ICONS = {
55
- github: GitHubMark,
56
- linkedin: LinkedInMark,
57
- mail: Mail,
58
- user: UserRound,
59
- } as const;
47
+ function FacebookMark({ size = 18, ...rest }: MarkProps) {
48
+ return (
49
+ <svg
50
+ aria-hidden="true"
51
+ viewBox="0 0 24 24"
52
+ width={size}
53
+ height={size}
54
+ fill="none"
55
+ stroke="currentColor"
56
+ strokeWidth={1.75}
57
+ strokeLinecap="round"
58
+ strokeLinejoin="round"
59
+ {...rest}
60
+ >
61
+ <path d="M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z" />
62
+ </svg>
63
+ );
64
+ }
60
65
 
61
- function SocialIconLink({ link }: { link: SocialLink }) {
62
- const Icon = SOCIAL_ICONS[link.icon];
66
+ function InstagramMark({ size = 18, ...rest }: MarkProps) {
63
67
  return (
64
- <a
65
- className="footer-social-link"
66
- href={link.href}
67
- aria-label={link.label}
68
- title={link.label}
69
- {...newTabProps(link.href, true)}
68
+ <svg
69
+ aria-hidden="true"
70
+ viewBox="0 0 24 24"
71
+ width={size}
72
+ height={size}
73
+ fill="none"
74
+ stroke="currentColor"
75
+ strokeWidth={1.75}
76
+ strokeLinecap="round"
77
+ strokeLinejoin="round"
78
+ {...rest}
70
79
  >
71
- <Icon aria-hidden size={18} />
72
- </a>
80
+ <path d="M7 2h10a5 5 0 0 1 5 5v10a5 5 0 0 1-5 5H7a5 5 0 0 1-5-5V7a5 5 0 0 1 5-5z M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z M17.5 6.5h.01" />
81
+ </svg>
82
+ );
83
+ }
84
+
85
+ function YouTubeMark({ size = 18, ...rest }: MarkProps) {
86
+ return (
87
+ <svg
88
+ aria-hidden="true"
89
+ viewBox="0 0 24 24"
90
+ width={size}
91
+ height={size}
92
+ fill="none"
93
+ stroke="currentColor"
94
+ strokeWidth={1.75}
95
+ strokeLinecap="round"
96
+ strokeLinejoin="round"
97
+ {...rest}
98
+ >
99
+ <path d="M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17 M10 15l5-3-5-3z" />
100
+ </svg>
73
101
  );
74
102
  }
75
103
 
76
- function FooterLink({ link }: { link: SiteLink }) {
104
+ const LINK_ICONS = {
105
+ facebook: FacebookMark,
106
+ github: GitHubMark,
107
+ instagram: InstagramMark,
108
+ linkedin: LinkedInMark,
109
+ mail: Mail,
110
+ star: Star,
111
+ user: UserRound,
112
+ youtube: YouTubeMark,
113
+ } as const;
114
+
115
+ function ColumnLink({ link }: { link: FooterColumnLink }) {
116
+ const Icon = link.icon ? LINK_ICONS[link.icon] : null;
77
117
  return (
78
118
  <a href={link.href} {...newTabProps(link.href, link.external)}>
119
+ {Icon && <Icon aria-hidden size={18} />}
79
120
  {link.label}
80
121
  </a>
81
122
  );
82
123
  }
83
124
 
125
+ const STARS = [1, 2, 3, 4, 5];
126
+
84
127
  export interface FooterProps {
85
128
  /** The identity at the head of the brand column. */
86
129
  brand: Brand;
87
- /** Short brand paragraph under the identity. */
88
- blurb?: string;
89
- /** Icon links (socials, the founder's own site) under the blurb. */
90
- socialLinks?: SocialLink[];
91
- /** The site's nav, repeated in the explore column. */
92
- links?: NavLink[];
93
- /** Explore links beyond the nav, e.g. a patient portal. */
94
- extraLinks?: SiteLink[];
95
- /** Heading over the contact column. Defaults to "Visit". */
96
- contactHeading?: string;
97
130
  /**
98
- * The street address, printed under the business name. Omit it for a
99
- * practice with no storefront, and the phone and email stand alone under
100
- * the heading.
131
+ * The Google rating as printed, e.g. "4.8 on Google". It sits under the
132
+ * logo beside five stars, as plain text and never a link.
133
+ */
134
+ rating?: string;
135
+ /**
136
+ * The one address, the headquarters. Omit it for a business with no
137
+ * storefront, and the phone and email stand alone.
101
138
  */
102
139
  address?: PostalAddress;
140
+ /** Where the address links: the business's Google profile. */
141
+ addressHref?: string;
103
142
  phone?: Phone;
104
143
  email?: string;
105
- /** Opening hours as display rows, already formatted by the site. */
106
- hours?: HoursRow[];
144
+ /**
145
+ * The link columns beside the brand column. The default footer carries
146
+ * four: Company, Resources, Social, and Legal. A column with no links is
147
+ * left out.
148
+ */
149
+ columns?: FooterColumn[];
107
150
  /** Suffix on the copyright line, e.g. "Dr. Alex Rivers, PT, DPT". */
108
151
  attribution?: string;
109
- /** The closing bar's made with note. Defaults to the practice's own line. */
152
+ /** The site's own words for the closing bar's right side, in place of the practice's credit. */
110
153
  note?: string;
111
- legalLinks?: SiteLink[];
112
- /** Credit the practice in the closing bar. Defaults on. */
154
+ /**
155
+ * The practice's credit on the closing bar's right side. Defaults on; off
156
+ * leaves the right side empty unless the site gives a note. The copyright
157
+ * prints either way.
158
+ */
113
159
  credit?: boolean;
114
160
  }
115
161
 
116
- /** The site footer: brand blurb, explore nav, NAP block, hours, legal links, and the closing bar. */
162
+ /**
163
+ * The site footer: a brand column (the logo, the Google rating, the address
164
+ * linked to the Google profile, the phone, and the email), the link columns
165
+ * beside it, and the closing bar under it all.
166
+ */
117
167
  export function Footer({
118
168
  brand,
119
- blurb,
120
- socialLinks,
121
- links,
122
- extraLinks,
123
- contactHeading = "Visit",
169
+ rating,
124
170
  address,
171
+ addressHref,
125
172
  phone,
126
173
  email,
127
- hours,
174
+ columns,
128
175
  attribution,
129
176
  note,
130
- legalLinks,
131
177
  credit = true,
132
178
  }: FooterProps) {
133
179
  const { name, logo } = brand;
134
180
  const wordmark = logo?.wordmark ?? name;
181
+ const shown = (columns ?? []).filter((column) => column.links.length > 0);
182
+ const addressLines = address && (
183
+ <>
184
+ {/* A business that publishes a service area but no storefront leaves
185
+ street empty; a blank line reads as a broken block. */}
186
+ {address.street && <span>{address.street}</span>}
187
+ <span>
188
+ {address.locality}, {address.region}
189
+ {address.postalCode ? ` ${address.postalCode}` : ""}
190
+ </span>
191
+ </>
192
+ );
135
193
 
136
194
  return (
137
195
  <>
138
196
  <footer className="footer">
139
197
  <div className="wrap">
140
- <div className="footer-grid">
198
+ <div
199
+ className="footer-grid"
200
+ style={{ "--footer-columns": shown.length } as CSSProperties}
201
+ >
141
202
  <div className="footer-brand">
142
203
  {logo?.tile ? (
143
204
  <p className="footer-wordmark">
@@ -155,82 +216,50 @@ export function Footer({
155
216
  {logo?.run && <span className="wordmark-run" aria-hidden="true" />}
156
217
  </p>
157
218
  )}
158
- {blurb && <p>{blurb}</p>}
159
- {socialLinks && socialLinks.length > 0 && (
160
- <div className="footer-social">
161
- {socialLinks.map((link) => (
162
- <SocialIconLink key={link.href} link={link} />
163
- ))}
164
- </div>
219
+ {rating && (
220
+ <p className="footer-rating">
221
+ <span className="footer-stars" aria-hidden="true">
222
+ {STARS.map((star) => (
223
+ <Star key={star} size={16} fill="currentColor" />
224
+ ))}
225
+ </span>
226
+ {rating}
227
+ </p>
228
+ )}
229
+ {(address || phone || email) && (
230
+ <address className="nap">
231
+ {address &&
232
+ (addressHref ? (
233
+ <a
234
+ className="nap-address"
235
+ href={addressHref}
236
+ {...newTabProps(addressHref, true)}
237
+ >
238
+ {addressLines}
239
+ </a>
240
+ ) : (
241
+ <span className="nap-address">{addressLines}</span>
242
+ ))}
243
+ {phone && <a href={`tel:${phone.e164}`}>{phone.display}</a>}
244
+ {email && <a href={`mailto:${email}`}>{email}</a>}
245
+ </address>
165
246
  )}
166
247
  </div>
167
- <div>
168
- <h4>Explore</h4>
169
- <nav aria-label="Footer">
170
- {links?.map((link) => (
171
- <a key={link.href} href={link.href}>
172
- {link.label}
173
- </a>
174
- ))}
175
- {extraLinks?.map((link) => (
176
- <FooterLink key={link.href} link={link} />
248
+ {shown.map((column) => (
249
+ <nav key={column.heading} className="footer-column" aria-label={column.heading}>
250
+ <h4>{column.heading}</h4>
251
+ {column.links.map((link) => (
252
+ <ColumnLink key={`${link.label} ${link.href}`} link={link} />
177
253
  ))}
178
254
  </nav>
179
- </div>
180
- <div>
181
- <h4>{contactHeading}</h4>
182
- <address className="nap">
183
- {address && (
184
- <>
185
- <strong>{name}</strong>
186
- <br />
187
- {/* A business that publishes a service area but no storefront
188
- leaves street empty; a blank line reads as a broken block. */}
189
- {address.street && (
190
- <>
191
- {address.street}
192
- <br />
193
- </>
194
- )}
195
- {address.locality}, {address.region}
196
- {address.postalCode ? ` ${address.postalCode}` : ""}
197
- <br />
198
- <br />
199
- </>
200
- )}
201
- {phone && (
202
- <>
203
- <a href={`tel:${phone.e164}`}>{phone.display}</a>
204
- <br />
205
- </>
206
- )}
207
- {email && <a href={`mailto:${email}`}>{email}</a>}
208
- </address>
209
- </div>
210
- {hours && hours.length > 0 && (
211
- <div>
212
- <h4>Hours</h4>
213
- <div className="footer-hours">
214
- {hours.map((row) => (
215
- <span key={row.label}>
216
- {row.label}&nbsp;&nbsp;{row.range}
217
- <br />
218
- </span>
219
- ))}
220
- </div>
221
- </div>
222
- )}
255
+ ))}
223
256
  </div>
224
- {legalLinks && legalLinks.length > 0 && (
225
- <div className="footer-legal">
226
- {legalLinks.map((link) => (
227
- <FooterLink key={link.href} link={link} />
228
- ))}
229
- </div>
230
- )}
231
257
  </div>
232
258
  </footer>
233
- <ClosingBar name={name} attribution={attribution} note={note} credit={credit} />
259
+ <ClosingBar
260
+ left={<Copyright name={name} attribution={attribution} />}
261
+ right={note ?? (credit ? undefined : null)}
262
+ />
234
263
  </>
235
264
  );
236
265
  }
@@ -1,11 +1,12 @@
1
1
  import type { ReactNode } from "react";
2
2
  import { Watermark } from "../components/Watermark";
3
3
  import type { PageStop } from "../hooks/useScrollSpy";
4
- import { formatHoursRange } from "../lib/hours";
5
4
  import { BasePathProvider } from "../routing/BasePathProvider";
6
5
  import { joinBase, normalizeBasePath, stripBase } from "../routing/basePath";
7
6
  import type { NavItem, SiteConfig } from "../sections/siteConfig";
7
+ import type { FooterColumn } from "../types";
8
8
  import { ClosingBar } from "./ClosingBar";
9
+ import { Copyright } from "./Copyright";
9
10
  import { Footer } from "./Footer";
10
11
  import { SiteHeader, type SiteHeaderVariant } from "./SiteHeader";
11
12
  import { SkipLink } from "./SkipLink";
@@ -50,9 +51,10 @@ export interface SiteShellProps {
50
51
  /** Hide the header's primary CTA (e.g. a reveal, where the ask is the letter). The menu keeps it. */
51
52
  hideNavCTA?: boolean;
52
53
  /**
53
- * The practice's credit in the closing bar. Defaults on (client sites
54
- * carry it); the practice's own site turns it off, since crediting
55
- * yourself on your own page reads as noise. The copyright prints either way.
54
+ * The practice's credit on the closing bar's right side. Defaults on
55
+ * (client sites carry it); the practice's own site turns it off, since
56
+ * crediting yourself on your own page reads as noise. Off leaves the right
57
+ * side empty unless the site gives a note. The copyright prints either way.
56
58
  */
57
59
  credit?: boolean;
58
60
  children: ReactNode;
@@ -94,6 +96,20 @@ export function SiteShell({
94
96
  const cta = { ...site.cta, href: withBase(site.cta.href) };
95
97
  const based = <T extends { href: string }>(items: T[] | undefined) =>
96
98
  items?.map((item) => ({ ...item, href: withBase(item.href) }));
99
+ // The default footer's four columns, drawn from what the config already
100
+ // holds; a site that wants other columns names them in `footer.columns`.
101
+ const footerColumns: FooterColumn[] = site.footer?.columns?.map((column) => ({
102
+ ...column,
103
+ links: based(column.links) ?? [],
104
+ })) ?? [
105
+ { heading: "Company", links },
106
+ { heading: "Resources", links: based(site.footerLinks) ?? [] },
107
+ {
108
+ heading: "Social",
109
+ links: (based(site.socialLinks) ?? []).map((link) => ({ ...link, external: true })),
110
+ },
111
+ { heading: "Legal", links: based(site.legalLinks) ?? [] },
112
+ ];
97
113
  // The header takes one variant. A hero page wins over a dark one: the bar
98
114
  // sits transparent over the hero either way, and only its scrolled state
99
115
  // differed.
@@ -122,29 +138,20 @@ export function SiteShell({
122
138
  {footer ? (
123
139
  <Footer
124
140
  brand={brand}
125
- blurb={site.footerBlurb}
126
- socialLinks={based(site.socialLinks)}
127
- links={links}
128
- extraLinks={based(site.footerLinks)}
129
- contactHeading={site.footer?.contactHeading}
141
+ rating={site.footer?.rating}
130
142
  address={site.footer?.showAddress === false ? undefined : site.address}
143
+ addressHref={site.mapLinkURL}
131
144
  phone={site.phone}
132
145
  email={site.email}
133
- hours={site.hours.map((row) => ({
134
- label: row.labelShort,
135
- range: formatHoursRange(row, { short: true, clock: site.clock }),
136
- }))}
146
+ columns={footerColumns}
137
147
  attribution={site.attribution}
138
148
  note={site.footer?.note}
139
- legalLinks={based(site.legalLinks)}
140
149
  credit={credit}
141
150
  />
142
151
  ) : (
143
152
  <ClosingBar
144
- name={brand.name}
145
- attribution={site.attribution}
146
- note={site.footer?.note}
147
- credit={credit}
153
+ left={<Copyright name={brand.name} attribution={site.attribution} />}
154
+ right={site.footer?.note ?? (credit ? undefined : null)}
148
155
  />
149
156
  )}
150
157
  <Watermark />
@@ -4,6 +4,9 @@ export type {
4
4
  Brand,
5
5
  BrandLogo,
6
6
  CallToAction,
7
+ FooterColumn,
8
+ FooterColumnLink,
9
+ FooterIcon,
7
10
  HoursRow,
8
11
  MenuContact,
9
12
  NavLink,
@@ -14,6 +17,8 @@ export type {
14
17
  } from "../types";
15
18
  export { BrandLockup, type BrandLockupProps } from "./BrandLockup";
16
19
  export { ClosingBar, type ClosingBarProps } from "./ClosingBar";
20
+ export { Copyright, type CopyrightProps } from "./Copyright";
21
+ export { Credit } from "./Credit";
17
22
  export { Footer, type FooterProps } from "./Footer";
18
23
  export { SiteHeader, type SiteHeaderProps, type SiteHeaderVariant } from "./SiteHeader";
19
24
  export { SiteMenu, type SiteMenuProps } from "./SiteMenu";
@@ -8,7 +8,7 @@
8
8
  * render from it, so standing up a new site means writing one of these plus
9
9
  * a theme.css, never touching the components themselves.
10
10
  */
11
- import type { SiteLink, SocialLink } from "../types";
11
+ import type { FooterColumn, SiteLink, SocialLink } from "../types";
12
12
 
13
13
  export type { SiteLink, SocialLink };
14
14
 
@@ -156,27 +156,32 @@ export interface SiteConfig {
156
156
  founder?: Founder;
157
157
  /** Names of offered services for structured data. */
158
158
  offers?: string[];
159
- /** Short brand paragraph for the footer. */
160
- footerBlurb: string;
161
- /** Extra footer nav links beyond the main nav (e.g. a patient portal). */
159
+ /** The footer's Resources column (guides, financing, a patient portal). */
162
160
  footerLinks?: SiteLink[];
163
- /** Icon links (socials, the founder's own site) rendered in the footer brand column. */
161
+ /** The footer's Social column, each link printed with its icon. */
164
162
  socialLinks?: SocialLink[];
163
+ /** The footer's Legal column. */
165
164
  legalLinks?: SiteLink[];
166
165
  /** Copyright attribution line suffix, e.g. "Dr. Alex Rivers, PT, DPT". */
167
166
  attribution?: string;
168
167
  /**
169
- * Footer wording overrides: the heading over the address column (defaults
170
- * to "Visit", which reads wrong for a practice with no storefront) and the
171
- * closing bar's made with note, which defaults to the practice's own line.
168
+ * What the footer needs beyond the fields above. The default footer is a
169
+ * brand column (the logo, the rating, `address` linked to `mapLinkURL`,
170
+ * `phone`, `email`) and four link columns: Company from `nav`, Resources
171
+ * from `footerLinks`, Social from `socialLinks`, and Legal from
172
+ * `legalLinks`.
172
173
  */
173
174
  footer?: {
174
- contactHeading?: string;
175
+ /** The Google rating as printed, e.g. "4.8 on Google". Plain text, never a link. */
176
+ rating?: string;
177
+ /** The link columns, named outright, in place of the four the config derives. */
178
+ columns?: FooterColumn[];
179
+ /** The site's own words for the closing bar's right side, in place of the practice's credit. */
175
180
  note?: string;
176
181
  /**
177
- * Set false to drop the name and address lines from the contact column
178
- * and leave only the phone and email under the heading (a practice with
179
- * no storefront has nothing to visit). Defaults to true.
182
+ * Set false to drop the address from the brand column and leave only
183
+ * the phone and email (a practice with no storefront has nothing to
184
+ * visit). Defaults to true.
180
185
  */
181
186
  showAddress?: boolean;
182
187
  };
@@ -370,83 +370,79 @@
370
370
  .atelic-ui .footer a:hover {
371
371
  color: #fff;
372
372
  }
373
+ /* One grid: the brand column, then the link columns, however many the
374
+ footer was given. A phone stacks the brand column over two across. */
373
375
  .atelic-ui .footer-grid {
374
376
  display: grid;
375
- gap: 40px;
376
- grid-template-columns: 1fr;
377
+ gap: 40px 32px;
378
+ grid-template-columns: repeat(2, minmax(0, 1fr));
379
+ }
380
+ .atelic-ui .footer-brand {
381
+ grid-column: 1 / -1;
377
382
  }
378
383
  .atelic-ui .footer h4 {
379
384
  color: #fff;
380
385
  font-family: var(--font-mono);
381
- font-size: 0.74rem;
382
- letter-spacing: 0.16em;
386
+ font-size: 0.84rem;
387
+ letter-spacing: 0.1em;
383
388
  text-transform: uppercase;
384
- font-weight: 500;
385
- margin-bottom: 16px;
389
+ font-weight: 700;
390
+ margin-bottom: 14px;
386
391
  }
387
392
  .atelic-ui .footer-brand img {
388
393
  height: 38px;
389
394
  margin-bottom: 18px;
390
395
  }
391
- .atelic-ui .footer-brand p {
392
- color: var(--neutral-300);
393
- max-width: 30ch;
396
+ .atelic-ui .footer-rating {
397
+ display: flex;
398
+ align-items: center;
399
+ gap: 10px;
400
+ color: #fff;
401
+ font-weight: 500;
402
+ margin-bottom: 10px;
403
+ }
404
+ .atelic-ui .footer-stars {
405
+ display: inline-flex;
406
+ gap: 2px;
407
+ color: #f5b301;
394
408
  }
395
409
  .atelic-ui .footer nav a {
396
- display: block;
410
+ display: flex;
411
+ align-items: center;
412
+ gap: 10px;
397
413
  padding: 6px 0;
398
414
  color: var(--neutral-200);
399
415
  font-weight: 500;
400
416
  }
417
+ .atelic-ui .footer nav a svg {
418
+ flex: none;
419
+ }
401
420
  .atelic-ui .footer .nap {
421
+ display: flex;
422
+ flex-direction: column;
423
+ align-items: flex-start;
424
+ gap: 6px;
402
425
  font-style: normal;
403
- line-height: 1.9;
404
426
  color: var(--neutral-200);
405
427
  }
406
428
  .atelic-ui .footer .nap a {
407
429
  color: #fff;
408
430
  font-weight: 600;
409
431
  }
410
- .atelic-ui .footer-hours {
411
- font-family: var(--font-mono);
412
- font-size: 0.82rem;
413
- line-height: 1.9;
414
- color: var(--neutral-300);
415
- }
416
- .atelic-ui .footer-social {
417
- display: flex;
418
- gap: 10px;
419
- margin-top: 20px;
420
- }
421
- .atelic-ui .footer .footer-social-link {
422
- display: inline-flex;
423
- align-items: center;
424
- justify-content: center;
425
- width: 38px;
426
- height: 38px;
427
- border: 1px solid rgba(255, 255, 255, 0.16);
428
- border-radius: var(--radius-sm);
429
- color: var(--neutral-300);
430
- }
431
- .atelic-ui .footer .footer-social-link:hover {
432
- color: var(--primary-bright);
433
- border-color: var(--primary-bright);
432
+ .atelic-ui .footer-grid > * {
433
+ overflow-wrap: anywhere;
434
434
  }
435
- .atelic-ui .footer-legal {
436
- margin-top: 48px;
435
+ .atelic-ui .footer .nap-address {
437
436
  display: flex;
438
- gap: 20px;
439
- flex-wrap: wrap;
440
- justify-content: flex-end;
441
- font-size: 0.82rem;
442
- }
443
- .atelic-ui .footer .footer-legal a {
444
- color: var(--neutral-300);
437
+ flex-direction: column;
445
438
  }
446
439
  @media (min-width: 760px) {
447
440
  .atelic-ui .footer-grid {
448
- grid-template-columns: 1.4fr 1fr 1fr 1.1fr;
449
- gap: 48px;
441
+ grid-template-columns: minmax(0, 1.4fr) repeat(var(--footer-columns, 4), minmax(0, 1fr));
442
+ gap: 48px 32px;
443
+ }
444
+ .atelic-ui .footer-brand {
445
+ grid-column: auto;
450
446
  }
451
447
  }
452
448
  /* Text wordmark for a site with no mark image. */
@@ -477,14 +473,14 @@
477
473
  align-items: center;
478
474
  justify-content: space-between;
479
475
  }
480
- .atelic-ui .closing-bar-note {
476
+ .atelic-ui .closing-bar-right {
481
477
  margin-left: auto;
482
478
  }
483
479
  .atelic-ui .closing-bar.is-solo .closing-bar-line {
484
480
  justify-content: center;
485
481
  text-align: center;
486
482
  }
487
- .atelic-ui .closing-bar.is-solo .closing-bar-note {
483
+ .atelic-ui .closing-bar.is-solo .closing-bar-right {
488
484
  margin-left: 0;
489
485
  }
490
486
  /* biome-ignore lint/style/noDescendingSpecificity: scoped to .closing-bar, so it never meets the footer's link rules */
package/src/types.ts CHANGED
@@ -63,12 +63,34 @@ export interface SiteLink {
63
63
  external?: boolean;
64
64
  }
65
65
 
66
- /** An icon link in the footer's brand column. */
66
+ /** The icons a footer link can carry. */
67
+ export type FooterIcon =
68
+ | "facebook"
69
+ | "github"
70
+ | "instagram"
71
+ | "linkedin"
72
+ | "mail"
73
+ | "star"
74
+ | "user"
75
+ | "youtube";
76
+
77
+ /** A social link; the footer's Social column prints it with its icon. */
67
78
  export interface SocialLink {
68
- /** Accessible name, e.g. "GitHub". */
79
+ /** The link's words, e.g. "GitHub". */
69
80
  label: string;
70
81
  href: string;
71
- icon: "github" | "linkedin" | "mail" | "user";
82
+ icon: FooterIcon;
83
+ }
84
+
85
+ /** One link in a footer column, with an icon in front when it names one. */
86
+ export interface FooterColumnLink extends SiteLink {
87
+ icon?: FooterIcon;
88
+ }
89
+
90
+ /** One link column of the footer, under its heading. */
91
+ export interface FooterColumn {
92
+ heading: string;
93
+ links: FooterColumnLink[];
72
94
  }
73
95
 
74
96
  export interface Phone {