@rxova/astro-ui 0.6.1 → 0.7.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.
Files changed (52) hide show
  1. package/README.md +14 -14
  2. package/package.json +11 -8
  3. package/src/components/BackLink.astro +4 -4
  4. package/src/components/CodeRecipes.astro +7 -7
  5. package/src/components/CopyButton.astro +20 -20
  6. package/src/components/CtaBand.astro +10 -10
  7. package/src/components/DataTable.astro +9 -9
  8. package/src/components/DocAccordionItem.astro +6 -6
  9. package/src/components/DocsMenu.astro +46 -0
  10. package/src/components/Header.astro +11 -11
  11. package/src/components/Icon.astro +9 -9
  12. package/src/components/ModeTabs.astro +7 -7
  13. package/src/components/PageHeader.astro +8 -8
  14. package/src/components/ProjectSwitcher.astro +10 -12
  15. package/src/components/ProofStats.astro +29 -29
  16. package/src/components/QuickStart.astro +3 -3
  17. package/src/components/ScreenshotGrid.astro +13 -13
  18. package/src/components/Section.astro +7 -7
  19. package/src/components/SectionNav.astro +8 -8
  20. package/src/components/ShowMore.astro +3 -3
  21. package/src/components/SiteFooter.astro +17 -17
  22. package/src/components/SizeTable.astro +7 -7
  23. package/src/components/ThemeScript.astro +12 -12
  24. package/src/components/ThemeToggle.astro +35 -35
  25. package/src/components/ValueGrid.astro +6 -6
  26. package/src/components/VisuallyHidden.astro +4 -4
  27. package/src/components/icons/Check.astro +3 -3
  28. package/src/components/icons/Collapse.astro +3 -3
  29. package/src/components/icons/Copy.astro +3 -3
  30. package/src/components/icons/Expand.astro +3 -3
  31. package/src/components/icons/Next.astro +3 -3
  32. package/src/components/icons/Pause.astro +3 -3
  33. package/src/components/icons/Play.astro +3 -3
  34. package/src/components/icons/Prev.astro +3 -3
  35. package/src/components/icons/Replay.astro +3 -3
  36. package/src/env.d.ts +3 -3
  37. package/src/lib/entries.ts +27 -27
  38. package/src/lib/icons.ts +7 -7
  39. package/src/scripts/show-more.ts +23 -23
  40. package/src/starlight/Footer.astro +4 -4
  41. package/src/starlight/Header.astro +75 -0
  42. package/src/starlight/MenuContent.astro +25 -0
  43. package/src/starlight/MobileMenuFooter.astro +9 -0
  44. package/src/starlight/SiteTitle.astro +5 -5
  45. package/src/starlight/SocialIcons.astro +4 -4
  46. package/src/starlight/ThemeSelect.astro +14 -14
  47. package/src/starlight/index.ts +34 -30
  48. package/src/styles/chrome.css +2 -2
  49. package/src/styles/document.css +1 -1
  50. package/src/styles/footer.css +1 -1
  51. package/src/styles/mermaid.css +2 -2
  52. package/src/styles/starlight.css +180 -45
@@ -4,16 +4,16 @@
4
4
  * Figures are server-rendered at their final value, so with JS off or motion reduced it is a static panel.
5
5
  */
6
6
  export interface Stat {
7
- value: string
8
- label: string
9
- note: string
7
+ value: string;
8
+ label: string;
9
+ note: string;
10
10
  }
11
11
 
12
12
  interface Props {
13
- stats: readonly Stat[]
13
+ stats: readonly Stat[];
14
14
  }
15
15
 
16
- const { stats } = Astro.props
16
+ const { stats } = Astro.props;
17
17
  ---
18
18
 
19
19
  <div class="rx-stats">
@@ -32,52 +32,52 @@ const { stats } = Astro.props
32
32
  </div>
33
33
 
34
34
  <script>
35
- const DURATION = 1100
35
+ const DURATION = 1100;
36
36
 
37
37
  const animate = (panel: HTMLElement) => {
38
38
  // Values are display strings ("7.58 kB", "95%"); the leading number animates and the rest stays.
39
- const figures = [...panel.querySelectorAll<HTMLElement>('.rx-stats__value')].flatMap((el) => {
40
- const match = /^(\d+(?:\.\d+)?)(.*)$/s.exec(el.textContent ?? '')
41
- if (!match) return []
42
- const [, number = '', suffix = ''] = match
43
- const final = el.textContent ?? ''
39
+ const figures = [...panel.querySelectorAll<HTMLElement>(".rx-stats__value")].flatMap((el) => {
40
+ const match = /^(\d+(?:\.\d+)?)(.*)$/s.exec(el.textContent ?? "");
41
+ if (!match) return [];
42
+ const [, number = "", suffix = ""] = match;
43
+ const final = el.textContent ?? "";
44
44
  return [
45
45
  {
46
46
  el,
47
47
  target: Number(number),
48
- decimals: (number.split('.')[1] ?? '').length,
48
+ decimals: (number.split(".")[1] ?? "").length,
49
49
  suffix,
50
50
  final,
51
51
  },
52
- ]
53
- })
52
+ ];
53
+ });
54
54
 
55
55
  const frame = (start: number) => {
56
- const t = Math.min(1, (performance.now() - start) / DURATION)
56
+ const t = Math.min(1, (performance.now() - start) / DURATION);
57
57
  // easeOutExpo: quick to nearly-there, then settles.
58
- const eased = t === 1 ? 1 : 1 - Math.pow(2, -10 * t)
58
+ const eased = t === 1 ? 1 : 1 - Math.pow(2, -10 * t);
59
59
  for (const f of figures) {
60
- f.el.textContent = t === 1 ? f.final : (f.target * eased).toFixed(f.decimals) + f.suffix
60
+ f.el.textContent = t === 1 ? f.final : (f.target * eased).toFixed(f.decimals) + f.suffix;
61
61
  }
62
- if (t < 1) requestAnimationFrame(() => frame(start))
63
- }
62
+ if (t < 1) requestAnimationFrame(() => frame(start));
63
+ };
64
64
 
65
65
  const observer = new IntersectionObserver(
66
66
  (entries) => {
67
67
  for (const entry of entries) {
68
- if (!entry.isIntersecting) continue
69
- observer.disconnect()
70
- for (const f of figures) f.el.textContent = '0' + f.suffix
71
- requestAnimationFrame(() => frame(performance.now()))
68
+ if (!entry.isIntersecting) continue;
69
+ observer.disconnect();
70
+ for (const f of figures) f.el.textContent = "0" + f.suffix;
71
+ requestAnimationFrame(() => frame(performance.now()));
72
72
  }
73
73
  },
74
74
  { threshold: 0.3 },
75
- )
76
- observer.observe(panel)
77
- }
75
+ );
76
+ observer.observe(panel);
77
+ };
78
78
 
79
- if (!window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
80
- for (const panel of document.querySelectorAll<HTMLElement>('.rx-stats')) animate(panel)
79
+ if (!window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
80
+ for (const panel of document.querySelectorAll<HTMLElement>(".rx-stats")) animate(panel);
81
81
  }
82
82
  </script>
83
83
 
@@ -147,7 +147,7 @@ const { stats } = Astro.props
147
147
 
148
148
  /* A gradient wash that fades up from the bottom of the hovered tile. */
149
149
  .rx-stats__item::after {
150
- content: '';
150
+ content: "";
151
151
  position: absolute;
152
152
  inset: 0;
153
153
  background: var(--rx-gradient);
@@ -3,13 +3,13 @@
3
3
  * An install command with a `CopyButton` beside a "Use" pane. The snippet arrives through the slot,
4
4
  * so a page can write a fenced block and get the same Shiki highlighting as the docs.
5
5
  */
6
- import CopyButton from './CopyButton.astro'
6
+ import CopyButton from "./CopyButton.astro";
7
7
 
8
8
  interface Props {
9
- command: string
9
+ command: string;
10
10
  }
11
11
 
12
- const { command } = Astro.props
12
+ const { command } = Astro.props;
13
13
  ---
14
14
 
15
15
  <div class="rx-qs">
@@ -3,22 +3,22 @@
3
3
  * Screenshots shown rather than described: each in a hairline frame through Astro's `<Image>`,
4
4
  * a mono label and a line of detail under it, and an optional link beneath the row.
5
5
  */
6
- import { Image } from 'astro:assets'
7
- import type { ImageMetadata } from 'astro'
6
+ import { Image } from "astro:assets";
7
+ import type { ImageMetadata } from "astro";
8
8
 
9
9
  export interface Shot {
10
- src: ImageMetadata
11
- alt: string
12
- title: string
13
- body: string
10
+ src: ImageMetadata;
11
+ alt: string;
12
+ title: string;
13
+ body: string;
14
14
  }
15
15
 
16
16
  interface Props {
17
- shots: readonly Shot[]
18
- link?: { href: string; text: string; external?: boolean }
17
+ shots: readonly Shot[];
18
+ link?: { href: string; text: string; external?: boolean };
19
19
  }
20
20
 
21
- const { shots, link } = Astro.props
21
+ const { shots, link } = Astro.props;
22
22
  ---
23
23
 
24
24
  <div class="rx-shots">
@@ -31,7 +31,7 @@ const { shots, link } = Astro.props
31
31
  </div>
32
32
  <figcaption class="rx-shots__caption">
33
33
  <span class="rx-shots__index" aria-hidden="true">
34
- {String(index + 1).padStart(2, '0')}
34
+ {String(index + 1).padStart(2, "0")}
35
35
  </span>
36
36
  <span class="rx-shots__title">{shot.title}</span>
37
37
  <span class="rx-shots__body">{shot.body}</span>
@@ -42,7 +42,7 @@ const { shots, link } = Astro.props
42
42
  </ul>
43
43
 
44
44
  {link && (
45
- <a class="rx-shots__link" href={link.href} rel={link.external ? 'noopener' : undefined}>
45
+ <a class="rx-shots__link" href={link.href} rel={link.external ? "noopener" : undefined}>
46
46
  {link.text}
47
47
  <svg
48
48
  viewBox="0 0 16 16"
@@ -108,12 +108,12 @@ const { shots, link } = Astro.props
108
108
 
109
109
  /* A light capture is the brightest thing on a dark page; dimmed, it sits on the surface instead of glaring. */
110
110
  @media (prefers-color-scheme: dark) {
111
- :global(html:not([data-theme='light'])) .rx-shots__frame :global(img) {
111
+ :global(html:not([data-theme="light"])) .rx-shots__frame :global(img) {
112
112
  filter: brightness(0.8);
113
113
  }
114
114
  }
115
115
 
116
- :global(html[data-theme='dark']) .rx-shots__frame :global(img) {
116
+ :global(html[data-theme="dark"]) .rx-shots__frame :global(img) {
117
117
  filter: brightness(0.8);
118
118
  }
119
119
 
@@ -4,18 +4,18 @@
4
4
  * of Starlight's prose rules, which would otherwise give every stat and card title a paragraph's measure.
5
5
  */
6
6
  interface Props {
7
- id?: string
8
- eyebrow?: string
9
- title: string
10
- lede?: string
7
+ id?: string;
8
+ eyebrow?: string;
9
+ title: string;
10
+ lede?: string;
11
11
  /** Draws the gradient hairline above the heading; the brand spends the gradient sparingly. */
12
- accent?: boolean
12
+ accent?: boolean;
13
13
  }
14
14
 
15
- const { id, eyebrow, title, lede, accent = false } = Astro.props
15
+ const { id, eyebrow, title, lede, accent = false } = Astro.props;
16
16
  ---
17
17
 
18
- <section class:list={['rx-sec', 'not-content', { 'rx-sec--accent': accent }]} id={id}>
18
+ <section class:list={["rx-sec", "not-content", { "rx-sec--accent": accent }]} id={id}>
19
19
  <header class="rx-sec__head">
20
20
  {eyebrow && <p class="rx-sec__eyebrow">{eyebrow}</p>}
21
21
  <h2 class="rx-sec__title">{title}</h2>
@@ -1,22 +1,22 @@
1
1
  ---
2
2
  /**
3
- * The umbrella navigation for a docs site: the project switcher, then the rxova.org sections.
3
+ * The umbrella navigation for a docs site: the project switcher, then the rxova.dev sections.
4
4
  * Starlight shows it in the header bar on wide screens and in the menu on phones.
5
5
  */
6
- import { RXOVA_ORIGIN, SECTIONS, type ProjectId } from '@rxova/brand'
7
- import ProjectSwitcher from './ProjectSwitcher.astro'
6
+ import { RXOVA_ORIGIN, SECTIONS, type ProjectId } from "@rxova/brand";
7
+ import ProjectSwitcher from "./ProjectSwitcher.astro";
8
8
 
9
9
  interface Props {
10
10
  /** The project whose docs these are, marked in the switcher. */
11
- current?: ProjectId
12
- /** Prefix for the section links. '' links root-relative, for a build served on rxova.org. */
13
- origin?: string
11
+ current?: ProjectId;
12
+ /** Prefix for the section links. '' links root-relative, for a build served on rxova.dev. */
13
+ origin?: string;
14
14
  }
15
15
 
16
- const { current, origin = RXOVA_ORIGIN } = Astro.props
16
+ const { current, origin = RXOVA_ORIGIN } = Astro.props;
17
17
  ---
18
18
 
19
- <nav class="rx-sections" aria-label="rxova.org">
19
+ <nav class="rx-sections" aria-label="rxova.dev">
20
20
  <ProjectSwitcher current={current} />
21
21
  {SECTIONS.map((section) => (
22
22
  <a class="rx-sections__link" href={`${origin}${section.path}`}>
@@ -3,14 +3,14 @@
3
3
  * "Show more" controls for a batched list; they ship `hidden` until a script drives them.
4
4
  * `enhanceShowMore` from `@rxova/astro-ui/scripts/show-more` batches a plain list.
5
5
  */
6
- import VisuallyHidden from './VisuallyHidden.astro'
6
+ import VisuallyHidden from "./VisuallyHidden.astro";
7
7
 
8
8
  interface Props {
9
9
  /** What the list holds, for the button's accessible name: "Show more posts". */
10
- noun: string
10
+ noun: string;
11
11
  }
12
12
 
13
- const { noun } = Astro.props
13
+ const { noun } = Astro.props;
14
14
  ---
15
15
 
16
16
  <div class="more" data-reveal-controls hidden>
@@ -1,45 +1,45 @@
1
1
  ---
2
2
  /**
3
3
  * The rxova footer on every surface: brand block, link columns, then copyright and legal links.
4
- * Styles live in `../styles/footer.css`. Hrefs are absolute unless `origin` is '' (on rxova.org).
4
+ * Styles live in `../styles/footer.css`. Hrefs are absolute unless `origin` is '' (on rxova.dev).
5
5
  */
6
- import { PROJECTS, RXOVA_ORIGIN, SECTIONS, getProject, type ProjectId } from '@rxova/brand'
6
+ import { PROJECTS, RXOVA_ORIGIN, SECTIONS, getProject, type ProjectId } from "@rxova/brand";
7
7
 
8
- /** A standalone surface of rxova.org, for the "Site" column. */
8
+ /** A standalone surface of rxova.dev, for the "Site" column. */
9
9
  export interface SiteLink {
10
- label: string
10
+ label: string;
11
11
  /** A page URL ending in `/`: absolute, or root-relative when `origin` is ''. */
12
- href: string
12
+ href: string;
13
13
  }
14
14
 
15
15
  interface Props {
16
16
  /** Current project, if this is a docs site. Omitted on the landing. */
17
- project?: ProjectId
17
+ project?: ProjectId;
18
18
  /** Optional per-site "Docs" column. */
19
- docs?: { label: string; href: string }[]
19
+ docs?: { label: string; href: string }[];
20
20
  /**
21
21
  * Standalone surfaces listed under "Site", below Home. Only the umbrella repo knows which are
22
22
  * deployed; the default (for docs sites) is `SECTIONS`: Projects, Blog and Updates.
23
23
  */
24
- site?: readonly SiteLink[]
24
+ site?: readonly SiteLink[];
25
25
  /**
26
26
  * Projects whose docs are actually mounted; only the umbrella repo knows which are deployed.
27
27
  * Defaults to every project, which is right for a docs site.
28
28
  */
29
- projects?: readonly SiteLink[]
30
- /** Prefix for every rxova.org link. '' on rxova.org itself, so links stay on the serving origin. */
31
- origin?: string
29
+ projects?: readonly SiteLink[];
30
+ /** Prefix for every rxova.dev link. '' on rxova.dev itself, so links stay on the serving origin. */
31
+ origin?: string;
32
32
  }
33
33
 
34
- const { project, docs, site, projects, origin = RXOVA_ORIGIN } = Astro.props
35
- const self = project ? getProject(project) : undefined
36
- const year = new Date().getFullYear()
34
+ const { project, docs, site, projects, origin = RXOVA_ORIGIN } = Astro.props;
35
+ const self = project ? getProject(project) : undefined;
36
+ const year = new Date().getFullYear();
37
37
 
38
38
  const projectLinks: readonly SiteLink[] =
39
- projects ?? PROJECTS.map((p) => ({ label: p.label, href: `${origin}${p.mount}` }))
39
+ projects ?? PROJECTS.map((p) => ({ label: p.label, href: `${origin}${p.mount}` }));
40
40
 
41
41
  const surfaces: readonly SiteLink[] =
42
- site ?? SECTIONS.map((section) => ({ label: section.label, href: `${origin}${section.path}` }))
42
+ site ?? SECTIONS.map((section) => ({ label: section.label, href: `${origin}${section.path}` }));
43
43
  ---
44
44
 
45
45
  <footer class="rx-footer">
@@ -131,7 +131,7 @@ const surfaces: readonly SiteLink[] =
131
131
  <a href="https://www.npmjs.com/org/rxova">npm</a>
132
132
  </li>
133
133
  <li>
134
- <a href="mailto:jonatan@rxova.org">jonatan@rxova.org</a>
134
+ <a href="mailto:jonyk@rxova.dev">jonyk@rxova.dev</a>
135
135
  </li>
136
136
  </ul>
137
137
  </div>
@@ -4,19 +4,19 @@
4
4
  * supports comparing against whatever the reader ships today.
5
5
  */
6
6
  export interface SizeRow {
7
- pkg: string
8
- entry: string
9
- limitKb: number
7
+ pkg: string;
8
+ entry: string;
9
+ limitKb: number;
10
10
  }
11
11
 
12
12
  interface Props {
13
- rows: readonly SizeRow[]
13
+ rows: readonly SizeRow[];
14
14
  /** The column heading: "brotli", "gzip". */
15
- compression: string
16
- caption: string
15
+ compression: string;
16
+ caption: string;
17
17
  }
18
18
 
19
- const { rows, compression, caption } = Astro.props
19
+ const { rows, compression, caption } = Astro.props;
20
20
  ---
21
21
 
22
22
  {/* Focusable and labelled: the box scrolls sideways on a narrow viewport, and a scrollable region needs a tab stop. */}
@@ -6,26 +6,26 @@
6
6
  ---
7
7
 
8
8
  <script is:inline>
9
- ;(function () {
9
+ (function () {
10
10
  function stored() {
11
11
  try {
12
- const t = localStorage.getItem('starlight-theme')
13
- return t === 'light' || t === 'dark' ? t : null
12
+ const t = localStorage.getItem("starlight-theme");
13
+ return t === "light" || t === "dark" ? t : null;
14
14
  } catch {
15
15
  /* localStorage may be unavailable */
16
- return null
16
+ return null;
17
17
  }
18
18
  }
19
19
  function sync() {
20
- const t = stored()
21
- if (t) document.documentElement.setAttribute('data-theme', t)
22
- else document.documentElement.removeAttribute('data-theme')
20
+ const t = stored();
21
+ if (t) document.documentElement.setAttribute("data-theme", t);
22
+ else document.documentElement.removeAttribute("data-theme");
23
23
  }
24
- sync()
24
+ sync();
25
25
  // Back from a docs site restores this page from the bfcache without rerunning the script;
26
26
  // `pageshow` is the only notification, so re-sync the theme there.
27
- window.addEventListener('pageshow', function (e) {
28
- if (e.persisted) sync()
29
- })
30
- })()
27
+ window.addEventListener("pageshow", function (e) {
28
+ if (e.persisted) sync();
29
+ });
30
+ })();
31
31
  </script>
@@ -6,15 +6,15 @@
6
6
 
7
7
  interface Props {
8
8
  /** Pin the button to the viewport's top-right corner; `false` when it sits in a header. */
9
- floating?: boolean
9
+ floating?: boolean;
10
10
  }
11
11
 
12
- const { floating = true } = Astro.props
12
+ const { floating = true } = Astro.props;
13
13
  ---
14
14
 
15
15
  <button
16
16
  id="theme-toggle"
17
- class:list={['theme-toggle', { 'theme-toggle--floating': floating }]}
17
+ class:list={["theme-toggle", { "theme-toggle--floating": floating }]}
18
18
  type="button"
19
19
  aria-label="Toggle theme"
20
20
  >
@@ -97,67 +97,67 @@ const { floating = true } = Astro.props
97
97
  </style>
98
98
 
99
99
  <script is:inline>
100
- ;(function () {
101
- const root = document.documentElement
102
- const btn = document.getElementById('theme-toggle')
103
- const glyph = btn.querySelector('.icon')
104
- const media = window.matchMedia('(prefers-color-scheme: dark)')
100
+ (function () {
101
+ const root = document.documentElement;
102
+ const btn = document.getElementById("theme-toggle");
103
+ const glyph = btn.querySelector(".icon");
104
+ const media = window.matchMedia("(prefers-color-scheme: dark)");
105
105
 
106
106
  // Lucide icons (ISC licensed).
107
107
  const ICON_MOON =
108
- '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"/></svg>'
108
+ '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"/></svg>';
109
109
  const ICON_SUN =
110
- '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="4"/><path d="M12 2v2"/><path d="M12 20v2"/><path d="m4.93 4.93 1.41 1.41"/><path d="m17.66 17.66 1.41 1.41"/><path d="M2 12h2"/><path d="M20 12h2"/><path d="m6.34 17.66-1.41 1.41"/><path d="m19.07 4.93-1.41 1.41"/></svg>'
110
+ '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="4"/><path d="M12 2v2"/><path d="M12 20v2"/><path d="m4.93 4.93 1.41 1.41"/><path d="m17.66 17.66 1.41 1.41"/><path d="M2 12h2"/><path d="M20 12h2"/><path d="m6.34 17.66-1.41 1.41"/><path d="m19.07 4.93-1.41 1.41"/></svg>';
111
111
 
112
112
  function current() {
113
- return root.getAttribute('data-theme') || (media.matches ? 'dark' : 'light')
113
+ return root.getAttribute("data-theme") || (media.matches ? "dark" : "light");
114
114
  }
115
115
  function stored() {
116
116
  try {
117
- const t = localStorage.getItem('starlight-theme')
118
- return t === 'light' || t === 'dark' ? t : null
117
+ const t = localStorage.getItem("starlight-theme");
118
+ return t === "light" || t === "dark" ? t : null;
119
119
  } catch {
120
120
  /* localStorage may be unavailable */
121
- return null
121
+ return null;
122
122
  }
123
123
  }
124
124
  // Re-read the saved choice and reflect it in the DOM. Same job as the
125
125
  // pre-paint script in <head>, minus the write.
126
126
  function sync() {
127
- const t = stored()
128
- if (t) root.setAttribute('data-theme', t)
129
- else root.removeAttribute('data-theme')
130
- render()
127
+ const t = stored();
128
+ if (t) root.setAttribute("data-theme", t);
129
+ else root.removeAttribute("data-theme");
130
+ render();
131
131
  }
132
132
  function render() {
133
- const dark = current() === 'dark'
133
+ const dark = current() === "dark";
134
134
  // Show the icon of the theme you'd switch TO.
135
- glyph.innerHTML = dark ? ICON_SUN : ICON_MOON
136
- btn.setAttribute('aria-label', dark ? 'Switch to light theme' : 'Switch to dark theme')
135
+ glyph.innerHTML = dark ? ICON_SUN : ICON_MOON;
136
+ btn.setAttribute("aria-label", dark ? "Switch to light theme" : "Switch to dark theme");
137
137
  }
138
138
  function apply(t) {
139
- root.setAttribute('data-theme', t)
139
+ root.setAttribute("data-theme", t);
140
140
  try {
141
141
  // Starlight's key — see the pre-paint script in <head>.
142
- localStorage.setItem('starlight-theme', t)
142
+ localStorage.setItem("starlight-theme", t);
143
143
  } catch {
144
144
  /* localStorage may be unavailable */
145
145
  }
146
- render()
146
+ render();
147
147
  }
148
148
 
149
- btn.addEventListener('click', function () {
150
- apply(current() === 'dark' ? 'light' : 'dark')
151
- })
149
+ btn.addEventListener("click", function () {
150
+ apply(current() === "dark" ? "light" : "dark");
151
+ });
152
152
  // Track the OS preference while the user hasn't overridden it.
153
- media.addEventListener('change', function () {
154
- if (!root.getAttribute('data-theme')) render()
155
- })
153
+ media.addEventListener("change", function () {
154
+ if (!root.getAttribute("data-theme")) render();
155
+ });
156
156
  // Back from a docs site restores this page from the bfcache without rerunning any script;
157
157
  // `pageshow` is the only notification, so re-sync the theme there.
158
- window.addEventListener('pageshow', function (e) {
159
- if (e.persisted) sync()
160
- })
161
- render()
162
- })()
158
+ window.addEventListener("pageshow", function (e) {
159
+ if (e.persisted) sync();
160
+ });
161
+ render();
162
+ })();
163
163
  </script>
@@ -3,20 +3,20 @@
3
3
  * A grid of claims in the landing's language: a gradient hairline over each, a faint-ink Lucide
4
4
  * icon beside the title, the body hanging under it. `icon` is a `lucide-static` name, inlined at build time.
5
5
  */
6
- import { lucideGlyph } from '../lib/icons.ts'
6
+ import { lucideGlyph } from "../lib/icons.ts";
7
7
 
8
8
  export interface ValueItem {
9
- title: string
9
+ title: string;
10
10
  /** Set as HTML, so it may carry inline `<code>`. */
11
- body: string
12
- icon: string
11
+ body: string;
12
+ icon: string;
13
13
  }
14
14
 
15
15
  interface Props {
16
- items: readonly ValueItem[]
16
+ items: readonly ValueItem[];
17
17
  }
18
18
 
19
- const { items } = Astro.props
19
+ const { items } = Astro.props;
20
20
  ---
21
21
 
22
22
  <ul class="rx-vg">
@@ -1,13 +1,13 @@
1
1
  ---
2
2
  /** Text only screen readers get; unlike `display: none`, it stays in the accessibility tree. */
3
- import type { HTMLAttributes } from 'astro/types'
3
+ import type { HTMLAttributes } from "astro/types";
4
4
 
5
- type Props = HTMLAttributes<'span'>
5
+ type Props = HTMLAttributes<"span">;
6
6
 
7
- const { class: className, ...rest } = Astro.props
7
+ const { class: className, ...rest } = Astro.props;
8
8
  ---
9
9
 
10
- <span class:list={['visually-hidden', className]} {...rest}>
10
+ <span class:list={["visually-hidden", className]} {...rest}>
11
11
  <slot />
12
12
  </span>
13
13
 
@@ -1,9 +1,9 @@
1
1
  ---
2
- import type { ComponentProps } from 'astro/types'
3
- import Icon from '../Icon.astro'
2
+ import type { ComponentProps } from "astro/types";
3
+ import Icon from "../Icon.astro";
4
4
 
5
5
  /** A tick: done. */
6
- type Props = Omit<ComponentProps<typeof Icon>, 'solid'>
6
+ type Props = Omit<ComponentProps<typeof Icon>, "solid">;
7
7
  ---
8
8
 
9
9
  <Icon {...Astro.props}>
@@ -1,9 +1,9 @@
1
1
  ---
2
- import type { ComponentProps } from 'astro/types'
3
- import Icon from '../Icon.astro'
2
+ import type { ComponentProps } from "astro/types";
3
+ import Icon from "../Icon.astro";
4
4
 
5
5
  /** Four corners pointing in. */
6
- type Props = Omit<ComponentProps<typeof Icon>, 'solid'>
6
+ type Props = Omit<ComponentProps<typeof Icon>, "solid">;
7
7
  ---
8
8
 
9
9
  <Icon {...Astro.props}>
@@ -1,9 +1,9 @@
1
1
  ---
2
- import type { ComponentProps } from 'astro/types'
3
- import Icon from '../Icon.astro'
2
+ import type { ComponentProps } from "astro/types";
3
+ import Icon from "../Icon.astro";
4
4
 
5
5
  /** Two overlapping sheets: the front one is what goes on the clipboard. */
6
- type Props = Omit<ComponentProps<typeof Icon>, 'solid'>
6
+ type Props = Omit<ComponentProps<typeof Icon>, "solid">;
7
7
  ---
8
8
 
9
9
  <Icon {...Astro.props}>
@@ -1,9 +1,9 @@
1
1
  ---
2
- import type { ComponentProps } from 'astro/types'
3
- import Icon from '../Icon.astro'
2
+ import type { ComponentProps } from "astro/types";
3
+ import Icon from "../Icon.astro";
4
4
 
5
5
  /** Four corners pointing out. */
6
- type Props = Omit<ComponentProps<typeof Icon>, 'solid'>
6
+ type Props = Omit<ComponentProps<typeof Icon>, "solid">;
7
7
  ---
8
8
 
9
9
  <Icon {...Astro.props}>
@@ -1,9 +1,9 @@
1
1
  ---
2
- import type { ComponentProps } from 'astro/types'
3
- import Icon from '../Icon.astro'
2
+ import type { ComponentProps } from "astro/types";
3
+ import Icon from "../Icon.astro";
4
4
 
5
5
  /** A right chevron. */
6
- type Props = Omit<ComponentProps<typeof Icon>, 'solid'>
6
+ type Props = Omit<ComponentProps<typeof Icon>, "solid">;
7
7
  ---
8
8
 
9
9
  <Icon {...Astro.props}>