@atelic-action/ui 0.5.0 → 0.6.1

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
@@ -71,6 +71,17 @@ import { Footer, SiteHeader, SkipLink, StickyCTABar } from "@atelic-action/ui/ch
71
71
  </div>;
72
72
  ```
73
73
 
74
+ A sent artifact's header names who the document is for as well as who it is
75
+ from: pass `recipient: { src, alt }` on the `brand` (added 0.6.0) and the
76
+ lockup reads "atelic × <their mark>", the sender's wordmark and run first, a
77
+ quiet times sign, then the recipient's mark at wordmark height. Cut the mark
78
+ for the surface the header wears (a light mark for the dark bar) and keep it
79
+ an image; the chrome draws no second wordmark. A marketing site's lockup
80
+ passes no recipient. The run after the wordmark reads `--brand-accent` when
81
+ the theme sets it (a client branded host pins the sender's orange there) and
82
+ falls back to `--primary` (0.6.1), and the recipient's mark sits at the same
83
+ 30 pixel height as the sender's.
84
+
74
85
  The menu is a native `<dialog>` opened with `showModal()`, so Escape, focus containment, and focus return come from the browser.
75
86
 
76
87
  ## The Not Found Page
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atelic-action/ui",
3
- "version": "0.5.0",
3
+ "version": "0.6.1",
4
4
  "description": "Shared UI for the Atelic templates: site chrome, base styles, and the component library they install",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -9,12 +9,17 @@ export interface BrandLockupProps {
9
9
  /**
10
10
  * The header's identity as one link: the mark (a glyph tile or an image),
11
11
  * the wordmark, and the trailing run. The image carries empty alt text
12
- * because the link's own label already names it.
12
+ * because the link's own label already names it. On a sent artifact the
13
+ * recipient's mark follows, after a times sign: "atelic × Wynkoop Athletics",
14
+ * the sender's identity and the business the document is for in one lockup.
15
+ * The anchor's aria-label folds in the recipient's alt too, since it
16
+ * overrides accessible-name computation for every child, image alt included.
13
17
  */
14
18
  export function BrandLockup({ brand, ariaLabel }: BrandLockupProps) {
15
- const { name, href = "/", logo } = brand;
19
+ const { name, href = "/", logo, recipient } = brand;
20
+ const label = ariaLabel ?? (recipient ? `${name} × ${recipient.alt} home` : `${name} home`);
16
21
  return (
17
- <a className="nav-logo" href={href} aria-label={ariaLabel ?? `${name} home`}>
22
+ <a className="nav-logo" href={href} aria-label={label}>
18
23
  {logo?.tile ? (
19
24
  <span className="logo-tile" aria-hidden="true">
20
25
  {logo.tile}
@@ -24,6 +29,14 @@ export function BrandLockup({ brand, ariaLabel }: BrandLockupProps) {
24
29
  )}
25
30
  <span className="wordmark">{logo?.wordmark ?? name}</span>
26
31
  {logo?.run && <span className="wordmark-run" aria-hidden="true" />}
32
+ {recipient && (
33
+ <>
34
+ <span className="nav-x" aria-hidden="true">
35
+ ×
36
+ </span>
37
+ <img className="nav-recipient" src={recipient.src} alt={recipient.alt} />
38
+ </>
39
+ )}
27
40
  </a>
28
41
  );
29
42
  }
@@ -30,7 +30,10 @@
30
30
  height: 2px;
31
31
  margin-left: 0.38em;
32
32
  vertical-align: middle;
33
- background: linear-gradient(90deg, var(--primary), transparent);
33
+ /* The run is the sender's, so it reads the brand accent a client
34
+ branded host pins (GATE.md, Branding an artifact host) and falls
35
+ back to the primary on a site wearing its own palette. */
36
+ background: linear-gradient(90deg, var(--brand-accent, var(--primary)), transparent);
34
37
  }
35
38
  /* The glyph tile mark (logo.tile): the favicon's design as real DOM text,
36
39
  so the brand webfont renders it, which an SVG loaded through an img
@@ -101,6 +104,23 @@
101
104
  height: 30px;
102
105
  width: 30px;
103
106
  }
107
+ /* The recipient half of a sent artifact's lockup (BrandLockup: recipient):
108
+ a quiet times sign in the mono face, then the business's mark at
109
+ wordmark height. */
110
+ .mkt .nav-logo .nav-x {
111
+ font-family: var(--font-mono);
112
+ font-weight: 400;
113
+ font-size: 0.9rem;
114
+ color: color-mix(in srgb, currentColor 55%, transparent);
115
+ margin: 0 2px;
116
+ }
117
+ .mkt .nav-logo .nav-recipient {
118
+ /* Matches the sender's mark, so a square recipient mark reads at the
119
+ same size as the sender's would; a wide wordmark simply runs longer. */
120
+ height: 30px;
121
+ width: auto;
122
+ display: block;
123
+ }
104
124
  .mkt .nav-links {
105
125
  display: none;
106
126
  align-items: center;
package/src/types.ts CHANGED
@@ -20,12 +20,26 @@ export interface BrandLogo {
20
20
  run?: boolean;
21
21
  }
22
22
 
23
+ /**
24
+ * The recipient half of a sent artifact's lockup: the business a document
25
+ * was prepared for, whose mark follows the sender's wordmark after a times
26
+ * sign. An image cut for the surface the header wears (a light mark on the
27
+ * dark bar), never a wordmark string, since the sender's type is the one
28
+ * face the chrome draws in.
29
+ */
30
+ export interface BrandRecipient {
31
+ src: string;
32
+ alt: string;
33
+ }
34
+
23
35
  /** The identity a header or footer wears. */
24
36
  export interface Brand {
25
37
  name: string;
26
38
  /** Where the lockup points. Defaults to "/". */
27
39
  href?: string;
28
40
  logo?: BrandLogo;
41
+ /** Set on a sent artifact's header only; a marketing site's lockup has no recipient. */
42
+ recipient?: BrandRecipient;
29
43
  }
30
44
 
31
45
  /** An entry in a site's primary nav. */