@rxova/brand 0.14.1 → 0.15.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/assets/og/journey.png +0 -0
- package/assets/og/overlock.png +0 -0
- package/assets/og/react-inputs.png +0 -0
- package/assets/og/rxova.png +0 -0
- package/assets/og/ts-extended-errors.png +0 -0
- package/assets/og/use-everywhere.png +0 -0
- package/package.json +5 -5
- package/src/astro.css +22 -0
- package/src/chrome.css +9 -1
- package/src/components/SiteFooter.astro +32 -12
- package/src/footer.css +10 -2
- package/src/sites.links.test.ts +1 -1
- package/src/sites.test.ts +1 -1
- package/src/sites.ts +18 -10
- package/src/tokens.css +37 -18
package/assets/og/journey.png
CHANGED
|
Binary file
|
package/assets/og/overlock.png
CHANGED
|
Binary file
|
|
Binary file
|
package/assets/og/rxova.png
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rxova/brand",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
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.
|
|
58
|
+
"@astrojs/starlight": "^0.42.1",
|
|
59
59
|
"@resvg/resvg-js": "^2.6.2",
|
|
60
|
-
"@types/node": "^26.
|
|
61
|
-
"@vitest/coverage-v8": "^5.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.
|
|
67
|
+
"vitest": "^5.0.1"
|
|
68
68
|
},
|
|
69
69
|
"scripts": {
|
|
70
70
|
"typecheck": "tsc --noEmit",
|
package/src/astro.css
CHANGED
|
@@ -50,6 +50,28 @@ body {
|
|
|
50
50
|
transition:
|
|
51
51
|
background-color 0.2s ease,
|
|
52
52
|
color 0.2s ease;
|
|
53
|
+
|
|
54
|
+
/* At least a screen tall, with `main` taking the slack, so a short page —
|
|
55
|
+
/blog with two posts — keeps its footer at the bottom of the window instead
|
|
56
|
+
of halfway up it. A column of flex items rather than a grid because the
|
|
57
|
+
number of children varies: the shell's header and footer are spliced
|
|
58
|
+
around a producer's `main` at deploy time. */
|
|
59
|
+
display: flex;
|
|
60
|
+
flex-direction: column;
|
|
61
|
+
min-height: 100dvh;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* A flex item with `margin: 0 auto` shrinks to its content instead of filling
|
|
65
|
+
the row the way a block does, so a short `main` or footer would narrow and
|
|
66
|
+
drift off the header's edges. Full width restores the block behaviour, and
|
|
67
|
+
`max-width` plus the auto margins centre it as before. `:where()` keeps both
|
|
68
|
+
rules at zero specificity, so any component's own width still wins. */
|
|
69
|
+
:where(body > *) {
|
|
70
|
+
width: 100%;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
:where(body > main) {
|
|
74
|
+
flex-grow: 1;
|
|
53
75
|
}
|
|
54
76
|
|
|
55
77
|
a {
|
package/src/chrome.css
CHANGED
|
@@ -41,7 +41,15 @@
|
|
|
41
41
|
--glow-tint: var(--rx-glow-tint);
|
|
42
42
|
--font: var(--rx-font-sans);
|
|
43
43
|
--mono: var(--rx-font-mono);
|
|
44
|
-
|
|
44
|
+
|
|
45
|
+
/* The page width: the header, the page and the footer all centre on it, so
|
|
46
|
+
it is the wide bound rather than the prose one. It was `--rx-max` (44rem),
|
|
47
|
+
which put /blog, /updates and /about in a narrow column under a header that
|
|
48
|
+
spans the landing's 72rem — narrow on a large screen, and a different
|
|
49
|
+
width from one page to the next. Running text keeps its own measure inside
|
|
50
|
+
it (the blog's 62–68ch, the updates stream's 68ch), so widening the page
|
|
51
|
+
does not lengthen a line of prose. */
|
|
52
|
+
--max: var(--rx-max-wide);
|
|
45
53
|
|
|
46
54
|
/* The landing's `--accent` is the foreground, not the brand violet: its
|
|
47
55
|
design is deliberately monochrome and uses the gradient only as an accent
|
|
@@ -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,
|
|
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
|
-
|
|
95
|
-
<
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
<
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
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
|
|
package/src/sites.links.test.ts
CHANGED
|
@@ -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
|
|
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('
|
|
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: '
|
|
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: #
|
|
48
|
-
--rx-card: #
|
|
49
|
-
--rx-tag-bg: #
|
|
50
|
-
--rx-rule: #
|
|
51
|
-
--rx-rule-strong: #
|
|
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: #
|
|
54
|
-
--rx-muted: #
|
|
55
|
-
--rx-fg: #
|
|
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(
|
|
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: #
|
|
76
|
-
--rx-card: #
|
|
77
|
-
--rx-tag-bg: #
|
|
78
|
-
--rx-rule: #
|
|
79
|
-
--rx-rule-strong: #
|
|
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: #
|
|
82
|
-
--rx-muted: #
|
|
83
|
-
--rx-fg: #
|
|
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(
|
|
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
|
}
|