@rxova/brand 0.14.1 → 0.14.2

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.
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rxova/brand",
3
- "version": "0.14.1",
3
+ "version": "0.14.2",
4
4
  "type": "module",
5
5
  "description": "Design tokens, Starlight theme and shared site chrome for rxova.org",
6
6
  "keywords": [
@@ -55,16 +55,16 @@
55
55
  },
56
56
  "devDependencies": {
57
57
  "@astrojs/check": "^0.9.10",
58
- "@astrojs/starlight": "^0.42.0",
58
+ "@astrojs/starlight": "^0.42.1",
59
59
  "@resvg/resvg-js": "^2.6.2",
60
- "@types/node": "^26.5.0",
61
- "@vitest/coverage-v8": "^5.0.0",
60
+ "@types/node": "^26.6.1",
61
+ "@vitest/coverage-v8": "^5.0.1",
62
62
  "astro": "^7.3.2",
63
63
  "publint": "^0.3.24",
64
64
  "satori": "^0.33.4",
65
65
  "tsx": "^4.23.13",
66
66
  "typescript": "6.0.3",
67
- "vitest": "^5.0.0"
67
+ "vitest": "^5.0.1"
68
68
  },
69
69
  "scripts": {
70
70
  "typecheck": "tsc --noEmit",
@@ -46,12 +46,30 @@ interface Props {
46
46
  * there is no artifact to wait for, so it exists whenever the landing does.
47
47
  */
48
48
  site?: readonly SiteLink[]
49
+ /**
50
+ * The projects whose docs are actually mounted.
51
+ *
52
+ * A prop for exactly the reason `site` is one, and it was missed: only the
53
+ * umbrella repo knows which projects are deployed — `sources.json` gates the
54
+ * mount and the link together — while this package knows only that a project
55
+ * exists. Mapping `PROJECTS` unconditionally put a link to every project's
56
+ * docs in the footer of every page on the origin, including projects whose
57
+ * docs are switched off, so the whole site advertised a 404.
58
+ *
59
+ * The default is every project, which is right for the caller that cannot
60
+ * know: a docs site is itself proof that mounts exist, and it has no view of
61
+ * the registry.
62
+ */
63
+ projects?: readonly SiteLink[]
49
64
  }
50
65
 
51
- const { project, docs, site } = Astro.props
66
+ const { project, docs, site, projects } = Astro.props
52
67
  const self = project ? getProject(project) : undefined
53
68
  const year = new Date().getFullYear()
54
69
 
70
+ const projectLinks: readonly SiteLink[] =
71
+ projects ?? PROJECTS.map((p) => ({ label: p.label, href: `${RXOVA_ORIGIN}${p.mount}` }))
72
+
55
73
  const surfaces: readonly SiteLink[] = site ?? [
56
74
  { label: 'Blog', href: siteUrl('/blog') },
57
75
  { label: 'Updates', href: siteUrl('/updates') },
@@ -67,7 +85,7 @@ const surfaces: readonly SiteLink[] = site ?? [
67
85
  <span>Rxova</span>
68
86
  </a>
69
87
  {/* Not "React libraries": most of these ship a framework-agnostic core
70
- that runs in a worker or a plain script, Journey also ships a browser
88
+ that runs in a worker or a plain script, journey also ships a browser
71
89
  extension, and overlock is a command-line tool that never sees a
72
90
  browser at all. React is a binding we provide, not the boundary of
73
91
  what these are. Same correction as the landing's hero. */}
@@ -91,16 +109,18 @@ const surfaces: readonly SiteLink[] = site ?? [
91
109
  </div>
92
110
  )}
93
111
 
94
- <div>
95
- <h2 class="rx-footer__title">Projects</h2>
96
- <ul class="rx-footer__list">
97
- {PROJECTS.map((p) => (
98
- <li>
99
- <a href={`${RXOVA_ORIGIN}${p.mount}`}>{p.label}</a>
100
- </li>
101
- ))}
102
- </ul>
103
- </div>
112
+ {projectLinks.length > 0 && (
113
+ <div>
114
+ <h2 class="rx-footer__title">Projects</h2>
115
+ <ul class="rx-footer__list">
116
+ {projectLinks.map((link) => (
117
+ <li>
118
+ <a href={link.href}>{link.label}</a>
119
+ </li>
120
+ ))}
121
+ </ul>
122
+ </div>
123
+ )}
104
124
 
105
125
  {self && (
106
126
  <div>
package/src/footer.css CHANGED
@@ -26,10 +26,18 @@
26
26
  `auto-fit` rather than a media query because what matters is how wide the
27
27
  footer's *container* is, not the viewport: on /blog the page measure is 44rem
28
28
  on any screen, and a viewport query would have put the brand block beside the
29
- columns and squeezed them to two cramped tracks on a desktop. */
29
+ columns and squeezed them to two cramped tracks on a desktop.
30
+
31
+ `min(100%, 20rem)` rather than a bare `20rem` for the track floor. A grid
32
+ track's minimum is not capped by its container, so a plain `minmax(20rem,
33
+ 1fr)` stayed 320px wide inside a narrower footer and pushed the document
34
+ past the viewport — every rxova.org surface scrolled sideways on a 320px
35
+ phone, by the 24px of gutter the footer sits in. `min(100%, …)` lets the
36
+ floor collapse to the container, which is the same guard
37
+ `.rx-footer__columns` below already had. */
30
38
  .rx-footer__top {
31
39
  display: grid;
32
- grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
40
+ grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
33
41
  gap: 2.5rem 3rem;
34
42
  }
35
43
 
@@ -37,7 +37,7 @@ async function status(url: string, method: 'GET' | 'HEAD'): Promise<number> {
37
37
  return last
38
38
  }
39
39
 
40
- const registryUrl = (pkg: string) => `https://registry.npmjs.org/${pkg.replace('/', '%2f')}`
40
+ const registryUrl = (pkg: string) => `https://registry.npmjs.org/${encodeURIComponent(pkg)}`
41
41
 
42
42
  describe.each(PROJECTS.map((p) => [p.id, p] as const))('%s links', (_, project) => {
43
43
  it('links npm to its first package', () => {
package/src/sites.test.ts CHANGED
@@ -46,7 +46,7 @@ describe('PROJECTS', () => {
46
46
 
47
47
  describe('getProject', () => {
48
48
  it('finds a project by id', () => {
49
- expect(getProject('journey').label).toBe('Journey')
49
+ expect(getProject('journey').label).toBe('journey')
50
50
  })
51
51
 
52
52
  it('throws rather than returning undefined for an unknown id', () => {
package/src/sites.ts CHANGED
@@ -31,19 +31,18 @@ export interface Project {
31
31
  packages: string[]
32
32
  }
33
33
 
34
+ /**
35
+ * Display order, shared by the landing's project rail and the docs switcher.
36
+ *
37
+ * overlock sits last deliberately. It is the newest of these and the only one
38
+ * that is not a library you import — a CLI and a CI gate — so leading the list
39
+ * with it put the least representative project in front of every reader of
40
+ * every surface.
41
+ */
34
42
  export const PROJECTS: readonly Project[] = [
35
- {
36
- id: 'overlock',
37
- label: 'overlock',
38
- mount: '/packages/overlock/',
39
- tagline: 'A deterministic gate on test integrity in a git patch.',
40
- repo: 'https://github.com/rxova/overlock',
41
- npm: 'https://www.npmjs.com/package/overlock',
42
- packages: ['overlock'],
43
- },
44
43
  {
45
44
  id: 'journey',
46
- label: 'Journey',
45
+ label: 'journey',
47
46
  mount: '/packages/journey/',
48
47
  tagline: 'Declarative journey graphs for non-linear UI flows.',
49
48
  repo: 'https://github.com/rxova/journey',
@@ -88,6 +87,15 @@ export const PROJECTS: readonly Project[] = [
88
87
  npm: 'https://www.npmjs.com/package/ts-extended-errors',
89
88
  packages: ['ts-extended-errors'],
90
89
  },
90
+ {
91
+ id: 'overlock',
92
+ label: 'overlock',
93
+ mount: '/packages/overlock/',
94
+ tagline: 'A deterministic gate on test integrity in a git patch.',
95
+ repo: 'https://github.com/rxova/overlock',
96
+ npm: 'https://www.npmjs.com/package/overlock',
97
+ packages: ['overlock'],
98
+ },
91
99
  ] as const
92
100
 
93
101
  export function getProject(id: ProjectId): Project {
package/src/tokens.css CHANGED
@@ -44,15 +44,15 @@
44
44
  :root[data-theme='dark'] {
45
45
  color-scheme: dark;
46
46
 
47
- --rx-bg: #100f0d;
48
- --rx-card: #17150f;
49
- --rx-tag-bg: #201e18;
50
- --rx-rule: #262420;
51
- --rx-rule-strong: #3b3830;
47
+ --rx-bg: #0b0a08;
48
+ --rx-card: #1e1b17;
49
+ --rx-tag-bg: #2b2721;
50
+ --rx-rule: #3b362d;
51
+ --rx-rule-strong: #565043;
52
52
 
53
- --rx-faint: #7b766c;
54
- --rx-muted: #a8a294;
55
- --rx-fg: #f2efe8;
53
+ --rx-faint: #9a9385;
54
+ --rx-muted: #bbb3a6;
55
+ --rx-fg: #f4f1ea;
56
56
 
57
57
  /* Lightened so the accent keeps AA contrast on a dark surface. */
58
58
  --rx-primary: #9375f5;
@@ -63,24 +63,43 @@
63
63
  --rx-primary-lighter: #cbbcfb;
64
64
  --rx-primary-lightest: #e0d7fd;
65
65
 
66
- --rx-glow-tint: rgb(242 239 232 / 0.06);
66
+ --rx-glow-tint: rgb(244 241 234 / 0.06);
67
67
  --rx-shadow-soft: 0 20px 60px -30px rgb(0 0 0 / 0.6);
68
68
  }
69
69
 
70
+ /* --- On the size of the dark steps ---------------------------------------
71
+ *
72
+ * The dark surfaces used to sit 2.5 L* apart (bg #100f0d, card #17150f), which
73
+ * is a contrast ratio of 1.05 — a card edge nobody can see. Every panel, code
74
+ * block and quote floated on the page with only a 1px rule to define it, and
75
+ * that rule was itself only 1.18 against the card. The light theme gets away
76
+ * with a comparable step (1.7 L*) because a dark edge on a light ground reads
77
+ * strongly; near black the same step disappears, and ambient glare finishes it.
78
+ *
79
+ * So the dark ramp is deliberately spaced wider than its light counterpart
80
+ * rather than being a mirror of it: card sits 7.2 L* above bg, and the rule
81
+ * 12.9 above card. Judge changes here in L*, not in contrast ratio — ratio is
82
+ * compressed at the dark end and will happily report a 7 L* step as "1.1" and
83
+ * therefore fine.
84
+ *
85
+ * Text was never the problem and is unchanged in kind: fg 15.2, muted 8.3 and
86
+ * faint 5.6 against card.
87
+ */
88
+
70
89
  /* OS preference wins only when no explicit choice has been stored. */
71
90
  @media (prefers-color-scheme: dark) {
72
91
  :root:not([data-theme]) {
73
92
  color-scheme: dark;
74
93
 
75
- --rx-bg: #100f0d;
76
- --rx-card: #17150f;
77
- --rx-tag-bg: #201e18;
78
- --rx-rule: #262420;
79
- --rx-rule-strong: #3b3830;
94
+ --rx-bg: #0b0a08;
95
+ --rx-card: #1e1b17;
96
+ --rx-tag-bg: #2b2721;
97
+ --rx-rule: #3b362d;
98
+ --rx-rule-strong: #565043;
80
99
 
81
- --rx-faint: #7b766c;
82
- --rx-muted: #a8a294;
83
- --rx-fg: #f2efe8;
100
+ --rx-faint: #9a9385;
101
+ --rx-muted: #bbb3a6;
102
+ --rx-fg: #f4f1ea;
84
103
 
85
104
  --rx-primary: #9375f5;
86
105
  --rx-primary-dark: #8159f3;
@@ -90,7 +109,7 @@
90
109
  --rx-primary-lighter: #cbbcfb;
91
110
  --rx-primary-lightest: #e0d7fd;
92
111
 
93
- --rx-glow-tint: rgb(242 239 232 / 0.06);
112
+ --rx-glow-tint: rgb(244 241 234 / 0.06);
94
113
  --rx-shadow-soft: 0 20px 60px -30px rgb(0 0 0 / 0.6);
95
114
  }
96
115
  }