@atelic-action/ui 4.0.0 → 5.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 +21 -8
- package/package.json +1 -1
- package/src/artifact/ArtifactShell.tsx +4 -4
- package/src/chrome/ClosingBar.tsx +59 -0
- package/src/chrome/Footer.tsx +12 -19
- package/src/chrome/SiteShell.tsx +11 -6
- package/src/chrome/index.ts +1 -1
- package/src/email/frame.tsx +154 -2
- package/src/email/render.tsx +24 -2
- package/src/sections/siteConfig.ts +2 -2
- package/src/styles/artifact.css +2 -2
- package/src/styles/chrome.css +29 -23
- package/src/chrome/CreditBar.tsx +0 -18
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @atelic-action/ui
|
|
2
2
|
|
|
3
|
-
Shared UI for the Atelic templates: the site chrome (header, menu, footer, sticky CTA bar, and
|
|
3
|
+
Shared UI for the Atelic templates: the site chrome (header, menu, footer, sticky CTA bar, and closing bar), the not found page and the routing that keeps it alive, the scroll spy hook, and the one base stylesheet. The marketing and artifact templates install it instead of carrying their own copies, so a chrome fix lands once and every site picks it up with `bun update @atelic-action/ui --latest`.
|
|
4
4
|
|
|
5
5
|
The package ships source, not a build. Its TSX and CSS arrive as written and compile inside each site's own Vite. The one exception is the access gate's server side, which ships compiled (see [The Access Gate](#the-access-gate)).
|
|
6
6
|
|
|
@@ -12,8 +12,8 @@ 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,
|
|
16
|
-
| `
|
|
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) |
|
|
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) |
|
|
@@ -42,11 +42,11 @@ Every export, grouped by the entry it is imported from. The gallery column links
|
|
|
42
42
|
| `SignOff`, `WriteupPerson` | `@atelic-action/ui/artifact` | The close a document ends on, and the person it names | [#sign-off](https://ui.atelic.me/#sign-off) |
|
|
43
43
|
| `Shot`, `WriteupShot` | `@atelic-action/ui/artifact` | The owner's own screen, opening the full picture, over its caption; a portrait crop is marked `data-portrait` and held to 200px (1.8in in print) | [#shot](https://ui.atelic.me/#shot) |
|
|
44
44
|
| `Paragraph`, `Runs`, `ArtifactAnchor`, `isEmpty`, `ArtifactLink`, `ArtifactParagraph` | `@atelic-action/ui/artifact` | Plain data text a routine can write as JSON: a paragraph, its runs alone, one link, the empty test, and the two types | [#paragraph](https://ui.atelic.me/#paragraph) |
|
|
45
|
-
| `ArtifactShell` | `@atelic-action/ui/artifact` | The chrome around a document page: skip link, dark header,
|
|
45
|
+
| `ArtifactShell` | `@atelic-action/ui/artifact` | The chrome around a document page: skip link, dark header, closing bar, watermark | [#site-header](https://ui.atelic.me/#site-header) (its dark bar) |
|
|
46
46
|
| `AppErrorBoundary`, `ErrorFallback` | `@atelic-action/ui/artifact` | The error boundary and the page it falls back to | none |
|
|
47
47
|
| `buildPageHead`, `canonicalURL`, `newTabProps`, the `ArtifactConfig` types | `@atelic-action/ui/artifact` | A page's head, a link's new tab props, and a site's contract | none |
|
|
48
48
|
| `whoIsReading` | `@atelic-action/ui/artifact` and `@atelic-action/ui/artifact/readers` | Who opened a document, by the email they signed in with; the second entry is the same function, built, for what Node runs | none |
|
|
49
|
-
| `Masthead`, `TitleCard`, `Footer`, `FailurePage` | `@atelic-action/ui/email` | An email's frame: the wordmark row, the title card, the foot, the failure page | [#email](https://ui.atelic.me/#email) |
|
|
49
|
+
| `Masthead`, `TitleCard`, `Footer`, `FailurePage` | `@atelic-action/ui/email` | An email's frame: the wordmark row, the title card, the foot, the failure page (plain, or structured by a step and a fix) | [#email](https://ui.atelic.me/#email) |
|
|
50
50
|
| `Card`, `Row`, `FoldRow`, `Eyebrow`, `SubEyebrow`, `Fold`, `BigFold` | `@atelic-action/ui/email` | The containers and labels an email's sections sit in | [#email](https://ui.atelic.me/#email) |
|
|
51
51
|
| `Item`, `TitleLine`, `Note`, `EmptyRow`, `Stat`, `StatsRow`, `List`, `ListRow`, `LeadRow`, `MonoTable`, `ReadBlock`, `Badge` | `@atelic-action/ui/email` | The rows inside a card | [#email](https://ui.atelic.me/#email) |
|
|
52
52
|
| `Scoreboard`, `GroupRow`, `TargetRow`, `Bar`, `WhatMoved`, `DayStrip`, `StatStrip` | `@atelic-action/ui/email` | Targets against what was logged, what moved, and the week by day | [#email](https://ui.atelic.me/#email) |
|
|
@@ -344,7 +344,7 @@ The two pieces a reader sees are ordinary components, in `@atelic-action/ui/comp
|
|
|
344
344
|
`@atelic-action/ui/artifact` is the pieces an artifact document is built from and the site around it, so a fix to a piece reaches every business's documents with one version bump. The composed documents themselves (`Writeup`, `Read`, `Report`, `Note`, and the sealed `Gate`, with their content types and their stylesheet) live in [`@atelic-action/artifact`](https://github.com/atelic-action/artifact) since 2.0.0, which depends on this package for everything below:
|
|
345
345
|
|
|
346
346
|
- **The pieces:** `GradeChip` and `gradeLabel` with the `WriteupGrade` type, `SignOff` with the `WriteupPerson` type, `Shot` with the `WriteupShot` type (a crop taller than it is wide is measured in the browser, marked `data-portrait`, and held to 200px wide on screen and 1.8in in print; a layout that sizes its shots itself sets `--op-shot-portrait-max: none` to opt out, on screen and in print alike), and the plain data text (`Paragraph`, `Runs`, `ArtifactAnchor`, and `isEmpty`, with the `ArtifactLink` and `ArtifactParagraph` types: a paragraph is a string or runs of text and `{ text, href }` links, so a routine can write a document as JSON).
|
|
347
|
-
- **The shell:** `ArtifactShell`, the `.atelic-ui` scope with the skip link, the dark header, the
|
|
347
|
+
- **The shell:** `ArtifactShell`, the `.atelic-ui` scope with the skip link, the dark header, the closing bar, and the watermark around a page.
|
|
348
348
|
- **The contract and the head:** the `ArtifactConfig` types, and `buildPageHead` and `canonicalURL` with their `PageMeta` type.
|
|
349
349
|
- **Who opened it:** `whoIsReading`, the email a reader signed in with at the wall, by the form or by the sign in a send carried, and nobody on the sender's own domain. It is also built and exported alone as `@atelic-action/ui/artifact/readers`, because a Playwright spec runs under Node, which compiles nothing inside `node_modules`.
|
|
350
350
|
- **The error boundary:** `AppErrorBoundary` and its `ErrorFallback`.
|
|
@@ -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
|
|
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:
|
|
468
468
|
|
|
469
469
|
```tsx
|
|
470
470
|
import { SiteShell as Shell, type SiteShellProps } from "@atelic-action/ui/chrome";
|
|
@@ -650,6 +650,19 @@ const text = recordStackText(records);
|
|
|
650
650
|
|
|
651
651
|
`renderEmail` builds the document shell itself and puts only the rows through React, because React emits no doctype, React 19 hoists and reorders head tags, and it would escape the `>` in `details>summary`. `renderFailureEmail` is the same shell around `FailurePage`. Both live at `@atelic-action/ui/email/render`, apart from the components, so a site that mounts a component on a page never pulls React's server renderer into its browser bundle.
|
|
652
652
|
|
|
653
|
+
The failure page takes two optional strings (4.1.0): `step`, what failed as a short label (`"Claude model call"`), and `fix`, what to do in a sentence or two that may hold a command. Given either, the reason line under the headline becomes a labelled block, one row per fact on a hairline with a faint eyebrow over its value: What Failed (the step), Why (the reason), and What to Do (the fix, its label in the accent and its value in mono), then the log tail under its own Log eyebrow. A row whose value is empty or only whitespace is left out, so an empty reason leaves no bare Why. The preheader leads with the step when there is one (`Claude model call: OAuth token revoked`). Given neither, the page is byte for byte what it was before, held by a frozen copy in `tst/email/frozen/`.
|
|
654
|
+
|
|
655
|
+
```ts
|
|
656
|
+
renderFailureEmail({
|
|
657
|
+
runnerTitle: "Brief",
|
|
658
|
+
eyebrowText: "Week 47",
|
|
659
|
+
step: "Claude model call",
|
|
660
|
+
reason: "OAuth token revoked, status 401",
|
|
661
|
+
fix: "Run claude setup-token, then push the new token to the vault.",
|
|
662
|
+
logTail,
|
|
663
|
+
});
|
|
664
|
+
```
|
|
665
|
+
|
|
653
666
|
### The Mapping
|
|
654
667
|
|
|
655
668
|
Where the jq takes a pre rendered html string (`$rows`, `$body_html`, `$cells_html`, a records cell's `html`, a stat's caption), the React prop is `children` or a `ReactNode`. Where the jq escapes a string argument, the prop is a plain string and React does the escaping.
|
|
@@ -688,7 +701,7 @@ Where the jq takes a pre rendered html string (`$rows`, `$body_html`, `$cells_ht
|
|
|
688
701
|
| `title_card` | `TitleCard` | `eyebrowText`, `headlineLines`, `lede`, `stats` (the rows under the lede, in place of the jq's `$stats_html`) |
|
|
689
702
|
| `footer` | `Footer` | `meta` |
|
|
690
703
|
| `page` | `renderEmail` | `title`, `preheader`, `children`, `palette`, `fonts` |
|
|
691
|
-
| `failure_page` | `renderFailureEmail`, or `FailurePage` as body rows | `runnerTitle`, `eyebrowText`, `reason`, `logTail` |
|
|
704
|
+
| `failure_page` | `renderFailureEmail`, or `FailurePage` as body rows | `runnerTitle`, `eyebrowText`, `reason`, `logTail`, and since 4.1.0 the optional `step` and `fix` (no jq counterpart) |
|
|
692
705
|
|
|
693
706
|
The plain text alternative part ports as plain functions with no React anywhere in them: `spaces`, `rpad`, `lpad`, `wrap`, `textRule`, `textSection`, `textRead`, `textBar`, `textTarget`, `textTableGrid`, `textTable`, `recordStackText`, `textWidth`, plus `asciiUpcase` and `asciiDowncase`. Every width counts Unicode codepoints, the way jq's `length` does.
|
|
694
707
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atelic-action/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.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,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { ClosingBar } from "../chrome/ClosingBar";
|
|
3
3
|
import { SiteHeader } from "../chrome/SiteHeader";
|
|
4
4
|
import { SkipLink } from "../chrome/SkipLink";
|
|
5
5
|
import { Watermark } from "../components/Watermark";
|
|
@@ -20,11 +20,11 @@ export interface ArtifactShellProps {
|
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* The wrapper every artifact page uses: the `.atelic-ui` theming
|
|
23
|
-
* scope, the skip link, the header, the
|
|
23
|
+
* scope, the skip link, the header, the closing bar, and the access gate's
|
|
24
24
|
* watermark, composed from the chrome. The header is always the dark
|
|
25
25
|
* variant with the sender's lockup and never a site nav or a CTA, because the
|
|
26
26
|
* document's own close is the ask. There is no footer and no sticky bar by
|
|
27
|
-
* design: a document ends on its own sign off, and the
|
|
27
|
+
* design: a document ends on its own sign off, and the closing bar is the
|
|
28
28
|
* one line allowed after it.
|
|
29
29
|
*/
|
|
30
30
|
export function ArtifactShell({ site, currentPath, stops, children }: ArtifactShellProps) {
|
|
@@ -43,7 +43,7 @@ export function ArtifactShell({ site, currentPath, stops, children }: ArtifactSh
|
|
|
43
43
|
stops={stops}
|
|
44
44
|
/>
|
|
45
45
|
<main id="main">{children}</main>
|
|
46
|
-
<
|
|
46
|
+
<ClosingBar />
|
|
47
47
|
<Watermark />
|
|
48
48
|
</div>
|
|
49
49
|
);
|
|
@@ -0,0 +1,59 @@
|
|
|
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";
|
|
14
|
+
|
|
15
|
+
export interface ClosingBarProps {
|
|
16
|
+
/** The business's name, printed in the copyright. Omit it on a page that names no business. */
|
|
17
|
+
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
|
+
/**
|
|
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.
|
|
26
|
+
*/
|
|
27
|
+
credit?: boolean;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function ClosingBar({
|
|
31
|
+
name,
|
|
32
|
+
attribution,
|
|
33
|
+
note = DEFAULT_NOTE,
|
|
34
|
+
credit = true,
|
|
35
|
+
}: ClosingBarProps) {
|
|
36
|
+
return (
|
|
37
|
+
<div className={name ? "closing-bar" : "closing-bar is-solo"}>
|
|
38
|
+
<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>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
);
|
|
59
|
+
}
|
package/src/chrome/Footer.tsx
CHANGED
|
@@ -10,7 +10,7 @@ import type {
|
|
|
10
10
|
SiteLink,
|
|
11
11
|
SocialLink,
|
|
12
12
|
} from "../types";
|
|
13
|
-
import {
|
|
13
|
+
import { ClosingBar } from "./ClosingBar";
|
|
14
14
|
|
|
15
15
|
/*
|
|
16
16
|
* lucide-react ships no brand marks (removed upstream by policy), and a code
|
|
@@ -106,14 +106,14 @@ export interface FooterProps {
|
|
|
106
106
|
hours?: HoursRow[];
|
|
107
107
|
/** Suffix on the copyright line, e.g. "Dr. Alex Rivers, PT, DPT". */
|
|
108
108
|
attribution?: string;
|
|
109
|
-
/**
|
|
109
|
+
/** The closing bar's made with note. Defaults to the practice's own line. */
|
|
110
110
|
note?: string;
|
|
111
111
|
legalLinks?: SiteLink[];
|
|
112
|
-
/**
|
|
112
|
+
/** Credit the practice in the closing bar. Defaults on. */
|
|
113
113
|
credit?: boolean;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
/** The site footer: brand blurb, explore nav, NAP block, hours, and the
|
|
116
|
+
/** The site footer: brand blurb, explore nav, NAP block, hours, legal links, and the closing bar. */
|
|
117
117
|
export function Footer({
|
|
118
118
|
brand,
|
|
119
119
|
blurb,
|
|
@@ -221,23 +221,16 @@ export function Footer({
|
|
|
221
221
|
</div>
|
|
222
222
|
)}
|
|
223
223
|
</div>
|
|
224
|
-
|
|
225
|
-
<
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
<span className="footer-legal">
|
|
232
|
-
{legalLinks.map((link) => (
|
|
233
|
-
<FooterLink key={link.href} link={link} />
|
|
234
|
-
))}
|
|
235
|
-
</span>
|
|
236
|
-
)}
|
|
237
|
-
</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
|
+
)}
|
|
238
231
|
</div>
|
|
239
232
|
</footer>
|
|
240
|
-
{
|
|
233
|
+
<ClosingBar name={name} attribution={attribution} note={note} credit={credit} />
|
|
241
234
|
</>
|
|
242
235
|
);
|
|
243
236
|
}
|
package/src/chrome/SiteShell.tsx
CHANGED
|
@@ -5,7 +5,7 @@ import { formatHoursRange } from "../lib/hours";
|
|
|
5
5
|
import { BasePathProvider } from "../routing/BasePathProvider";
|
|
6
6
|
import { joinBase, normalizeBasePath, stripBase } from "../routing/basePath";
|
|
7
7
|
import type { NavItem, SiteConfig } from "../sections/siteConfig";
|
|
8
|
-
import {
|
|
8
|
+
import { ClosingBar } from "./ClosingBar";
|
|
9
9
|
import { Footer } from "./Footer";
|
|
10
10
|
import { SiteHeader, type SiteHeaderVariant } from "./SiteHeader";
|
|
11
11
|
import { SkipLink } from "./SkipLink";
|
|
@@ -50,9 +50,9 @@ export interface SiteShellProps {
|
|
|
50
50
|
/** Hide the header's primary CTA (e.g. a reveal, where the ask is the letter). The menu keeps it. */
|
|
51
51
|
hideNavCTA?: boolean;
|
|
52
52
|
/**
|
|
53
|
-
* The
|
|
54
|
-
* practice's own site turns it off, since crediting
|
|
55
|
-
* own page reads as noise.
|
|
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.
|
|
56
56
|
*/
|
|
57
57
|
credit?: boolean;
|
|
58
58
|
children: ReactNode;
|
|
@@ -60,7 +60,7 @@ export interface SiteShellProps {
|
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
62
|
* The marketing page wrapper: the `.atelic-ui` scope around the skip link,
|
|
63
|
-
* the header, `<main>`, the sticky CTA bar, the footer with its
|
|
63
|
+
* the header, `<main>`, the sticky CTA bar, the footer with its closing bar,
|
|
64
64
|
* and the watermark, all mapped from the site's config. Moved here from
|
|
65
65
|
* template-marketing in 0.19.0 (ATE-643); a site keeps a wrapper a few lines
|
|
66
66
|
* long that reads the path from its router and passes it in.
|
|
@@ -140,7 +140,12 @@ export function SiteShell({
|
|
|
140
140
|
credit={credit}
|
|
141
141
|
/>
|
|
142
142
|
) : (
|
|
143
|
-
|
|
143
|
+
<ClosingBar
|
|
144
|
+
name={brand.name}
|
|
145
|
+
attribution={site.attribution}
|
|
146
|
+
note={site.footer?.note}
|
|
147
|
+
credit={credit}
|
|
148
|
+
/>
|
|
144
149
|
)}
|
|
145
150
|
<Watermark />
|
|
146
151
|
</div>
|
package/src/chrome/index.ts
CHANGED
|
@@ -13,7 +13,7 @@ export type {
|
|
|
13
13
|
SocialLink,
|
|
14
14
|
} from "../types";
|
|
15
15
|
export { BrandLockup, type BrandLockupProps } from "./BrandLockup";
|
|
16
|
-
export {
|
|
16
|
+
export { ClosingBar, type ClosingBarProps } from "./ClosingBar";
|
|
17
17
|
export { Footer, type FooterProps } from "./Footer";
|
|
18
18
|
export { SiteHeader, type SiteHeaderProps, type SiteHeaderVariant } from "./SiteHeader";
|
|
19
19
|
export { SiteMenu, type SiteMenuProps } from "./SiteMenu";
|
package/src/email/frame.tsx
CHANGED
|
@@ -188,14 +188,50 @@ export type FailurePageProps = {
|
|
|
188
188
|
eyebrowText: string;
|
|
189
189
|
reason: string;
|
|
190
190
|
logTail: string;
|
|
191
|
+
/** What failed, as a short label ("Claude model call"). */
|
|
192
|
+
step?: string;
|
|
193
|
+
/** What to do about it, a sentence or two that may hold a command. */
|
|
194
|
+
fix?: string;
|
|
191
195
|
};
|
|
192
196
|
|
|
197
|
+
/** True for a string with something in it besides whitespace. */
|
|
198
|
+
function filled(value: string | undefined): value is string {
|
|
199
|
+
return value !== undefined && value.trim() !== "";
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/** One long token (a path, a URL) wraps instead of widening the column. */
|
|
203
|
+
const wrapLong = { overflowWrap: "anywhere", wordBreak: "break-word" } as const;
|
|
204
|
+
|
|
205
|
+
type FailureFact = { label: string; value: string; kind: "step" | "reason" | "fix" };
|
|
206
|
+
|
|
193
207
|
/**
|
|
194
208
|
* The body rows of the failure page, in the same cream, so a bad week reads
|
|
195
|
-
* like a good one with the reason on top and the log's tail beneath.
|
|
209
|
+
* like a good one with the reason on top and the log's tail beneath. With a
|
|
210
|
+
* `step` or a `fix` the reason becomes a labelled block of what failed, why,
|
|
211
|
+
* and what to do, and the log sits under its own label; without either the
|
|
212
|
+
* page is exactly the plain one.
|
|
196
213
|
*/
|
|
197
|
-
export function FailurePage({
|
|
214
|
+
export function FailurePage({
|
|
215
|
+
runnerTitle,
|
|
216
|
+
eyebrowText,
|
|
217
|
+
reason,
|
|
218
|
+
logTail,
|
|
219
|
+
step,
|
|
220
|
+
fix,
|
|
221
|
+
}: FailurePageProps) {
|
|
198
222
|
const { palette, fonts } = useEmailTheme();
|
|
223
|
+
if (filled(step) || filled(fix)) {
|
|
224
|
+
return (
|
|
225
|
+
<StructuredFailurePage
|
|
226
|
+
runnerTitle={runnerTitle}
|
|
227
|
+
eyebrowText={eyebrowText}
|
|
228
|
+
reason={reason}
|
|
229
|
+
logTail={logTail}
|
|
230
|
+
step={step}
|
|
231
|
+
fix={fix}
|
|
232
|
+
/>
|
|
233
|
+
);
|
|
234
|
+
}
|
|
199
235
|
return (
|
|
200
236
|
<>
|
|
201
237
|
<Masthead title={runnerTitle} />
|
|
@@ -254,3 +290,119 @@ export function FailurePage({ runnerTitle, eyebrowText, reason, logTail }: Failu
|
|
|
254
290
|
</>
|
|
255
291
|
);
|
|
256
292
|
}
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* The structured failure page: the same eyebrow and headline, then one row per
|
|
296
|
+
* fact that has a value, each a faint eyebrow over its value on a hairline,
|
|
297
|
+
* and the log's tail last under its own eyebrow. The fix's label wears the
|
|
298
|
+
* accent, as an accented `Note` does, and its value is set in mono because it
|
|
299
|
+
* so often holds a command.
|
|
300
|
+
*/
|
|
301
|
+
function StructuredFailurePage({
|
|
302
|
+
runnerTitle,
|
|
303
|
+
eyebrowText,
|
|
304
|
+
reason,
|
|
305
|
+
logTail,
|
|
306
|
+
step,
|
|
307
|
+
fix,
|
|
308
|
+
}: FailurePageProps) {
|
|
309
|
+
const { palette, fonts } = useEmailTheme();
|
|
310
|
+
const facts: FailureFact[] = [];
|
|
311
|
+
if (filled(step)) facts.push({ label: "What Failed", value: step, kind: "step" });
|
|
312
|
+
if (filled(reason)) facts.push({ label: "Why", value: reason, kind: "reason" });
|
|
313
|
+
if (filled(fix)) facts.push({ label: "What to Do", value: fix, kind: "fix" });
|
|
314
|
+
const hasLog = filled(logTail);
|
|
315
|
+
const cell = { padding: "14px 0", borderTop: `1px solid ${palette.line}` };
|
|
316
|
+
const valueStyle = (kind: FailureFact["kind"]) => {
|
|
317
|
+
if (kind === "fix") {
|
|
318
|
+
return {
|
|
319
|
+
marginTop: "6px",
|
|
320
|
+
fontFamily: fonts.mono,
|
|
321
|
+
fontSize: "13px",
|
|
322
|
+
lineHeight: "1.6",
|
|
323
|
+
color: palette.ink,
|
|
324
|
+
whiteSpace: "pre-wrap" as const,
|
|
325
|
+
...wrapLong,
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
return {
|
|
329
|
+
marginTop: "6px",
|
|
330
|
+
fontFamily: fonts.sans,
|
|
331
|
+
fontSize: "15px",
|
|
332
|
+
lineHeight: "1.5",
|
|
333
|
+
color: kind === "step" ? palette.ink : palette.dim,
|
|
334
|
+
...wrapLong,
|
|
335
|
+
...(kind === "step" ? { fontWeight: "600" } : {}),
|
|
336
|
+
};
|
|
337
|
+
};
|
|
338
|
+
return (
|
|
339
|
+
<>
|
|
340
|
+
<Masthead title={runnerTitle} />
|
|
341
|
+
<Card>
|
|
342
|
+
<tr>
|
|
343
|
+
<td style={{ padding: "26px 26px 6px", ...eyebrowStyle(fonts), color: palette.faint }}>
|
|
344
|
+
{eyebrowText}
|
|
345
|
+
</td>
|
|
346
|
+
</tr>
|
|
347
|
+
<tr>
|
|
348
|
+
<td
|
|
349
|
+
style={{
|
|
350
|
+
padding: "0 26px",
|
|
351
|
+
fontFamily: fonts.sans,
|
|
352
|
+
fontSize: "30px",
|
|
353
|
+
fontWeight: "600",
|
|
354
|
+
letterSpacing: "-0.03em",
|
|
355
|
+
lineHeight: "1.1",
|
|
356
|
+
color: palette.ink,
|
|
357
|
+
}}
|
|
358
|
+
>
|
|
359
|
+
{`The ${asciiDowncase(runnerTitle)} did not run.`}
|
|
360
|
+
</td>
|
|
361
|
+
</tr>
|
|
362
|
+
<tr>
|
|
363
|
+
<td style={{ padding: "22px 26px 12px" }}>
|
|
364
|
+
<table {...tableReset} width="100%">
|
|
365
|
+
<tbody>
|
|
366
|
+
{facts.map((fact) => (
|
|
367
|
+
<tr key={fact.kind}>
|
|
368
|
+
<td style={cell}>
|
|
369
|
+
<div
|
|
370
|
+
style={{
|
|
371
|
+
...eyebrowStyle(fonts),
|
|
372
|
+
color: fact.kind === "fix" ? palette.accent : palette.faint,
|
|
373
|
+
}}
|
|
374
|
+
>
|
|
375
|
+
{fact.label}
|
|
376
|
+
</div>
|
|
377
|
+
<div style={valueStyle(fact.kind)}>{fact.value}</div>
|
|
378
|
+
</td>
|
|
379
|
+
</tr>
|
|
380
|
+
))}
|
|
381
|
+
{hasLog ? (
|
|
382
|
+
<tr>
|
|
383
|
+
<td style={cell}>
|
|
384
|
+
<div style={{ ...eyebrowStyle(fonts), color: palette.faint }}>Log</div>
|
|
385
|
+
<pre
|
|
386
|
+
style={{
|
|
387
|
+
fontFamily: fonts.mono,
|
|
388
|
+
fontSize: "12px",
|
|
389
|
+
lineHeight: "1.5",
|
|
390
|
+
whiteSpace: "pre-wrap",
|
|
391
|
+
...wrapLong,
|
|
392
|
+
color: palette.dim,
|
|
393
|
+
margin: "6px 0 0",
|
|
394
|
+
}}
|
|
395
|
+
>
|
|
396
|
+
{logTail}
|
|
397
|
+
</pre>
|
|
398
|
+
</td>
|
|
399
|
+
</tr>
|
|
400
|
+
) : null}
|
|
401
|
+
</tbody>
|
|
402
|
+
</table>
|
|
403
|
+
</td>
|
|
404
|
+
</tr>
|
|
405
|
+
</Card>
|
|
406
|
+
</>
|
|
407
|
+
);
|
|
408
|
+
}
|
package/src/email/render.tsx
CHANGED
|
@@ -77,22 +77,42 @@ export type RenderFailureEmailOptions = {
|
|
|
77
77
|
eyebrowText: string;
|
|
78
78
|
reason: string;
|
|
79
79
|
logTail: string;
|
|
80
|
+
/** What failed, as a short label; it also leads the preheader. */
|
|
81
|
+
step?: string;
|
|
82
|
+
/** What to do about it, a sentence or two that may hold a command. */
|
|
83
|
+
fix?: string;
|
|
80
84
|
palette?: Palette;
|
|
81
85
|
fonts?: Fonts;
|
|
82
86
|
};
|
|
83
87
|
|
|
84
|
-
/**
|
|
88
|
+
/**
|
|
89
|
+
* The inbox preview: the reason alone, or led by the step when there is one
|
|
90
|
+
* ("Claude model call: OAuth token revoked").
|
|
91
|
+
*/
|
|
92
|
+
function failurePreheader(reason: string, step: string | undefined): string {
|
|
93
|
+
const label = step?.trim() ?? "";
|
|
94
|
+
if (label === "") return reason;
|
|
95
|
+
const why = reason.trim();
|
|
96
|
+
return why === "" ? label : `${label}: ${why}`;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* The failure page: the reason on top and the log's tail beneath, or with a
|
|
101
|
+
* `step` or a `fix` the labelled block of what failed, why, and what to do.
|
|
102
|
+
*/
|
|
85
103
|
export function renderFailureEmail({
|
|
86
104
|
runnerTitle,
|
|
87
105
|
eyebrowText,
|
|
88
106
|
reason,
|
|
89
107
|
logTail,
|
|
108
|
+
step,
|
|
109
|
+
fix,
|
|
90
110
|
palette,
|
|
91
111
|
fonts,
|
|
92
112
|
}: RenderFailureEmailOptions): string {
|
|
93
113
|
return renderEmail({
|
|
94
114
|
title: `${runnerTitle}: did not run`,
|
|
95
|
-
preheader: reason,
|
|
115
|
+
preheader: failurePreheader(reason, step),
|
|
96
116
|
palette,
|
|
97
117
|
fonts,
|
|
98
118
|
children: (
|
|
@@ -101,6 +121,8 @@ export function renderFailureEmail({
|
|
|
101
121
|
eyebrowText={eyebrowText}
|
|
102
122
|
reason={reason}
|
|
103
123
|
logTail={logTail}
|
|
124
|
+
step={step}
|
|
125
|
+
fix={fix}
|
|
104
126
|
/>
|
|
105
127
|
),
|
|
106
128
|
});
|
|
@@ -167,8 +167,8 @@ export interface SiteConfig {
|
|
|
167
167
|
attribution?: string;
|
|
168
168
|
/**
|
|
169
169
|
* Footer wording overrides: the heading over the address column (defaults
|
|
170
|
-
* to "Visit", which reads wrong for a practice with no storefront) and
|
|
171
|
-
*
|
|
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.
|
|
172
172
|
*/
|
|
173
173
|
footer?: {
|
|
174
174
|
contactHeading?: string;
|
package/src/styles/artifact.css
CHANGED
|
@@ -130,11 +130,11 @@
|
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
/* ---- print: the shell's chrome steps aside on every artifact page ----
|
|
133
|
-
ArtifactShell's header,
|
|
133
|
+
ArtifactShell's header, closing bar, and skip link belong to the screen;
|
|
134
134
|
a printed document is the page alone. */
|
|
135
135
|
@media print {
|
|
136
136
|
.atelic-ui .nav,
|
|
137
|
-
.atelic-ui .
|
|
137
|
+
.atelic-ui .closing-bar,
|
|
138
138
|
.atelic-ui .skip-link {
|
|
139
139
|
display: none;
|
|
140
140
|
}
|
package/src/styles/chrome.css
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* =================================================================
|
|
2
2
|
@atelic-action/ui CHROME: the skip link, the brand lockup, the
|
|
3
|
-
header, the menu, the sticky CTA bar, the footer, and the
|
|
3
|
+
header, the menu, the sticky CTA bar, the footer, and the closing
|
|
4
4
|
band. Tokens are read here and never defined. Everything sits in
|
|
5
5
|
the atelic-ui layer, so any rule a site writes outside a layer wins.
|
|
6
6
|
The chrome's buttons wear the site's own .btn classes.
|
|
@@ -432,26 +432,17 @@
|
|
|
432
432
|
color: var(--primary-bright);
|
|
433
433
|
border-color: var(--primary-bright);
|
|
434
434
|
}
|
|
435
|
-
.atelic-ui .footer-
|
|
435
|
+
.atelic-ui .footer-legal {
|
|
436
436
|
margin-top: 48px;
|
|
437
|
-
padding-top: 24px;
|
|
438
|
-
border-top: 1px solid rgba(255, 255, 255, 0.1);
|
|
439
437
|
display: flex;
|
|
438
|
+
gap: 20px;
|
|
440
439
|
flex-wrap: wrap;
|
|
441
|
-
|
|
442
|
-
justify-content: space-between;
|
|
443
|
-
align-items: center;
|
|
440
|
+
justify-content: flex-end;
|
|
444
441
|
font-size: 0.82rem;
|
|
445
|
-
color: var(--neutral-500);
|
|
446
442
|
}
|
|
447
|
-
.atelic-ui .footer .footer-
|
|
443
|
+
.atelic-ui .footer .footer-legal a {
|
|
448
444
|
color: var(--neutral-300);
|
|
449
445
|
}
|
|
450
|
-
.atelic-ui .footer-legal {
|
|
451
|
-
display: flex;
|
|
452
|
-
gap: 20px;
|
|
453
|
-
flex-wrap: wrap;
|
|
454
|
-
}
|
|
455
446
|
@media (min-width: 760px) {
|
|
456
447
|
.atelic-ui .footer-grid {
|
|
457
448
|
grid-template-columns: 1.4fr 1fr 1fr 1.1fr;
|
|
@@ -467,27 +458,42 @@
|
|
|
467
458
|
margin-bottom: 18px;
|
|
468
459
|
}
|
|
469
460
|
|
|
470
|
-
/* ----
|
|
461
|
+
/* ---- Closing bar ---- */
|
|
471
462
|
/* The developer credit below the footer: its own full width band, centered,
|
|
472
463
|
small, and muted. Purely token themed (the hairline and hover lift derive
|
|
473
464
|
from --surface through color-mix), so it rebrands with theme.css on any
|
|
474
465
|
page it renders under, light or dark. */
|
|
475
|
-
.atelic-ui .
|
|
466
|
+
.atelic-ui .closing-bar {
|
|
476
467
|
background: var(--surface-dark);
|
|
477
468
|
border-top: 1px solid color-mix(in srgb, var(--surface) 10%, transparent);
|
|
478
469
|
color: var(--neutral-500);
|
|
479
|
-
font-size: 0.
|
|
470
|
+
font-size: 0.82rem;
|
|
471
|
+
padding-block: 18px;
|
|
472
|
+
}
|
|
473
|
+
.atelic-ui .closing-bar-line {
|
|
474
|
+
display: flex;
|
|
475
|
+
flex-wrap: wrap;
|
|
476
|
+
gap: 6px 28px;
|
|
477
|
+
align-items: center;
|
|
478
|
+
justify-content: space-between;
|
|
479
|
+
}
|
|
480
|
+
.atelic-ui .closing-bar-note {
|
|
481
|
+
margin-left: auto;
|
|
482
|
+
}
|
|
483
|
+
.atelic-ui .closing-bar.is-solo .closing-bar-line {
|
|
484
|
+
justify-content: center;
|
|
480
485
|
text-align: center;
|
|
481
|
-
text-wrap: balance;
|
|
482
|
-
padding: 16px 20px;
|
|
483
486
|
}
|
|
484
|
-
|
|
485
|
-
|
|
487
|
+
.atelic-ui .closing-bar.is-solo .closing-bar-note {
|
|
488
|
+
margin-left: 0;
|
|
489
|
+
}
|
|
490
|
+
/* biome-ignore lint/style/noDescendingSpecificity: scoped to .closing-bar, so it never meets the footer's link rules */
|
|
491
|
+
.atelic-ui .closing-bar a {
|
|
486
492
|
color: var(--neutral-300);
|
|
487
493
|
font-weight: 500;
|
|
488
494
|
}
|
|
489
|
-
/* biome-ignore lint/style/noDescendingSpecificity: scoped to .
|
|
490
|
-
.atelic-ui .
|
|
495
|
+
/* biome-ignore lint/style/noDescendingSpecificity: scoped to .closing-bar, so it never meets the header's link rules */
|
|
496
|
+
.atelic-ui .closing-bar a:hover {
|
|
491
497
|
color: color-mix(in srgb, var(--surface) 96%, white);
|
|
492
498
|
}
|
|
493
499
|
}
|
package/src/chrome/CreditBar.tsx
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The standardized developer credit: a full width band, visually separate
|
|
3
|
-
* from anything above it, centered and muted. Footer renders it at its foot,
|
|
4
|
-
* and a page that drops the footer renders it on its own.
|
|
5
|
-
*
|
|
6
|
-
* The heart ships as an escape sequence: the no emoji test bars literal
|
|
7
|
-
* pictographs from `src/`.
|
|
8
|
-
*/
|
|
9
|
-
export function CreditBar() {
|
|
10
|
-
return (
|
|
11
|
-
<div className="credit-bar">
|
|
12
|
-
Developed with {"\u{1F49A}"} in Denver by{" "}
|
|
13
|
-
<a href="https://atelic.me" target="_blank" rel="noopener">
|
|
14
|
-
Atelic
|
|
15
|
-
</a>
|
|
16
|
-
</div>
|
|
17
|
-
);
|
|
18
|
-
}
|