@atelic-action/ui 5.0.0 → 6.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
@@ -13,7 +13,7 @@ Every export, grouped by the entry it is imported from. The gallery column links
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
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) |
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) |
@@ -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";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atelic-action/ui",
3
- "version": "5.0.0",
3
+ "version": "6.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
+ }
@@ -11,6 +11,7 @@ import type {
11
11
  SocialLink,
12
12
  } from "../types";
13
13
  import { ClosingBar } from "./ClosingBar";
14
+ import { Copyright } from "./Copyright";
14
15
 
15
16
  /*
16
17
  * lucide-react ships no brand marks (removed upstream by policy), and a code
@@ -106,10 +107,14 @@ export interface FooterProps {
106
107
  hours?: HoursRow[];
107
108
  /** Suffix on the copyright line, e.g. "Dr. Alex Rivers, PT, DPT". */
108
109
  attribution?: string;
109
- /** The closing bar's made with note. Defaults to the practice's own line. */
110
+ /** The site's own words for the closing bar's right side, in place of the practice's credit. */
110
111
  note?: string;
111
112
  legalLinks?: SiteLink[];
112
- /** Credit the practice in the closing bar. Defaults on. */
113
+ /**
114
+ * The practice's credit on the closing bar's right side. Defaults on; off
115
+ * leaves the right side empty unless the site gives a note. The copyright
116
+ * prints either way.
117
+ */
113
118
  credit?: boolean;
114
119
  }
115
120
 
@@ -230,7 +235,10 @@ export function Footer({
230
235
  )}
231
236
  </div>
232
237
  </footer>
233
- <ClosingBar name={name} attribution={attribution} note={note} credit={credit} />
238
+ <ClosingBar
239
+ left={<Copyright name={name} attribution={attribution} />}
240
+ right={note ?? (credit ? undefined : null)}
241
+ />
234
242
  </>
235
243
  );
236
244
  }
@@ -6,6 +6,7 @@ import { BasePathProvider } from "../routing/BasePathProvider";
6
6
  import { joinBase, normalizeBasePath, stripBase } from "../routing/basePath";
7
7
  import type { NavItem, SiteConfig } from "../sections/siteConfig";
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;
@@ -141,10 +143,8 @@ export function SiteShell({
141
143
  />
142
144
  ) : (
143
145
  <ClosingBar
144
- name={brand.name}
145
- attribution={site.attribution}
146
- note={site.footer?.note}
147
- credit={credit}
146
+ left={<Copyright name={brand.name} attribution={site.attribution} />}
147
+ right={site.footer?.note ?? (credit ? undefined : null)}
148
148
  />
149
149
  )}
150
150
  <Watermark />
@@ -14,6 +14,8 @@ export type {
14
14
  } from "../types";
15
15
  export { BrandLockup, type BrandLockupProps } from "./BrandLockup";
16
16
  export { ClosingBar, type ClosingBarProps } from "./ClosingBar";
17
+ export { Copyright, type CopyrightProps } from "./Copyright";
18
+ export { Credit } from "./Credit";
17
19
  export { Footer, type FooterProps } from "./Footer";
18
20
  export { SiteHeader, type SiteHeaderProps, type SiteHeaderVariant } from "./SiteHeader";
19
21
  export { SiteMenu, type SiteMenuProps } from "./SiteMenu";
@@ -168,7 +168,8 @@ export interface SiteConfig {
168
168
  /**
169
169
  * Footer wording overrides: the heading over the address column (defaults
170
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.
171
+ * site's own words for the closing bar's right side, in place of the
172
+ * practice's credit.
172
173
  */
173
174
  footer?: {
174
175
  contactHeading?: string;
@@ -477,14 +477,14 @@
477
477
  align-items: center;
478
478
  justify-content: space-between;
479
479
  }
480
- .atelic-ui .closing-bar-note {
480
+ .atelic-ui .closing-bar-right {
481
481
  margin-left: auto;
482
482
  }
483
483
  .atelic-ui .closing-bar.is-solo .closing-bar-line {
484
484
  justify-content: center;
485
485
  text-align: center;
486
486
  }
487
- .atelic-ui .closing-bar.is-solo .closing-bar-note {
487
+ .atelic-ui .closing-bar.is-solo .closing-bar-right {
488
488
  margin-left: 0;
489
489
  }
490
490
  /* biome-ignore lint/style/noDescendingSpecificity: scoped to .closing-bar, so it never meets the footer's link rules */