@rxova/astro-ui 0.6.1 → 0.6.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.
- package/README.md +14 -14
- package/package.json +11 -8
- package/src/components/BackLink.astro +4 -4
- package/src/components/CodeRecipes.astro +7 -7
- package/src/components/CopyButton.astro +20 -20
- package/src/components/CtaBand.astro +10 -10
- package/src/components/DataTable.astro +9 -9
- package/src/components/DocAccordionItem.astro +6 -6
- package/src/components/Header.astro +11 -11
- package/src/components/Icon.astro +9 -9
- package/src/components/ModeTabs.astro +7 -7
- package/src/components/PageHeader.astro +8 -8
- package/src/components/ProjectSwitcher.astro +6 -6
- package/src/components/ProofStats.astro +29 -29
- package/src/components/QuickStart.astro +3 -3
- package/src/components/ScreenshotGrid.astro +13 -13
- package/src/components/Section.astro +7 -7
- package/src/components/SectionNav.astro +8 -8
- package/src/components/ShowMore.astro +3 -3
- package/src/components/SiteFooter.astro +16 -16
- package/src/components/SizeTable.astro +7 -7
- package/src/components/ThemeScript.astro +12 -12
- package/src/components/ThemeToggle.astro +35 -35
- package/src/components/ValueGrid.astro +6 -6
- package/src/components/VisuallyHidden.astro +4 -4
- package/src/components/icons/Check.astro +3 -3
- package/src/components/icons/Collapse.astro +3 -3
- package/src/components/icons/Copy.astro +3 -3
- package/src/components/icons/Expand.astro +3 -3
- package/src/components/icons/Next.astro +3 -3
- package/src/components/icons/Pause.astro +3 -3
- package/src/components/icons/Play.astro +3 -3
- package/src/components/icons/Prev.astro +3 -3
- package/src/components/icons/Replay.astro +3 -3
- package/src/env.d.ts +3 -3
- package/src/lib/entries.ts +27 -27
- package/src/lib/icons.ts +7 -7
- package/src/scripts/show-more.ts +23 -23
- package/src/starlight/Footer.astro +4 -4
- package/src/starlight/SiteTitle.astro +5 -5
- package/src/starlight/SocialIcons.astro +4 -4
- package/src/starlight/ThemeSelect.astro +14 -14
- package/src/starlight/index.ts +30 -30
- package/src/styles/chrome.css +2 -2
- package/src/styles/document.css +1 -1
- package/src/styles/footer.css +1 -1
- package/src/styles/mermaid.css +2 -2
- package/src/styles/starlight.css +4 -4
|
@@ -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
|
|
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
|
|
7
|
-
import type { ImageMetadata } from
|
|
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,
|
|
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 ?
|
|
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=
|
|
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=
|
|
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={[
|
|
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.
|
|
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
|
|
7
|
-
import ProjectSwitcher from
|
|
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.
|
|
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.
|
|
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
|
|
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.
|
|
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
|
|
6
|
+
import { PROJECTS, RXOVA_ORIGIN, SECTIONS, getProject, type ProjectId } from "@rxova/brand";
|
|
7
7
|
|
|
8
|
-
/** A standalone surface of rxova.
|
|
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.
|
|
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">
|
|
@@ -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
|
-
|
|
9
|
+
(function () {
|
|
10
10
|
function stored() {
|
|
11
11
|
try {
|
|
12
|
-
const t = localStorage.getItem(
|
|
13
|
-
return t ===
|
|
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(
|
|
22
|
-
else document.documentElement.removeAttribute(
|
|
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(
|
|
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={[
|
|
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
|
-
|
|
101
|
-
const root = document.documentElement
|
|
102
|
-
const btn = document.getElementById(
|
|
103
|
-
const glyph = btn.querySelector(
|
|
104
|
-
const media = window.matchMedia(
|
|
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(
|
|
113
|
+
return root.getAttribute("data-theme") || (media.matches ? "dark" : "light");
|
|
114
114
|
}
|
|
115
115
|
function stored() {
|
|
116
116
|
try {
|
|
117
|
-
const t = localStorage.getItem(
|
|
118
|
-
return t ===
|
|
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(
|
|
129
|
-
else root.removeAttribute(
|
|
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() ===
|
|
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(
|
|
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(
|
|
139
|
+
root.setAttribute("data-theme", t);
|
|
140
140
|
try {
|
|
141
141
|
// Starlight's key — see the pre-paint script in <head>.
|
|
142
|
-
localStorage.setItem(
|
|
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(
|
|
150
|
-
apply(current() ===
|
|
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(
|
|
154
|
-
if (!root.getAttribute(
|
|
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(
|
|
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
|
|
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
|
|
3
|
+
import type { HTMLAttributes } from "astro/types";
|
|
4
4
|
|
|
5
|
-
type Props = HTMLAttributes<
|
|
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={[
|
|
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
|
|
3
|
-
import Icon from
|
|
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>,
|
|
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
|
|
3
|
-
import Icon from
|
|
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>,
|
|
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
|
|
3
|
-
import Icon from
|
|
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>,
|
|
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
|
|
3
|
-
import Icon from
|
|
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>,
|
|
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
|
|
3
|
-
import Icon from
|
|
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>,
|
|
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
|
|
3
|
-
import Icon from
|
|
2
|
+
import type { ComponentProps } from "astro/types";
|
|
3
|
+
import Icon from "../Icon.astro";
|
|
4
4
|
|
|
5
5
|
/** Two bars. */
|
|
6
|
-
type Props = Omit<ComponentProps<typeof Icon>,
|
|
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
|
|
3
|
-
import Icon from
|
|
2
|
+
import type { ComponentProps } from "astro/types";
|
|
3
|
+
import Icon from "../Icon.astro";
|
|
4
4
|
|
|
5
5
|
/** A solid triangle. */
|
|
6
|
-
type Props = Omit<ComponentProps<typeof Icon>,
|
|
6
|
+
type Props = Omit<ComponentProps<typeof Icon>, "solid">;
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
<Icon {...Astro.props} solid>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
-
import type { ComponentProps } from
|
|
3
|
-
import Icon from
|
|
2
|
+
import type { ComponentProps } from "astro/types";
|
|
3
|
+
import Icon from "../Icon.astro";
|
|
4
4
|
|
|
5
5
|
/** A left chevron. */
|
|
6
|
-
type Props = Omit<ComponentProps<typeof Icon>,
|
|
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
|
|
3
|
-
import Icon from
|
|
2
|
+
import type { ComponentProps } from "astro/types";
|
|
3
|
+
import Icon from "../Icon.astro";
|
|
4
4
|
|
|
5
5
|
/** An arrow turning back to its start. */
|
|
6
|
-
type Props = Omit<ComponentProps<typeof Icon>,
|
|
6
|
+
type Props = Omit<ComponentProps<typeof Icon>, "solid">;
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
<Icon {...Astro.props}>
|
package/src/env.d.ts
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
// Re-check against Starlight's `global.d.ts` on a major bump.
|
|
8
8
|
declare global {
|
|
9
9
|
interface StarlightThemeProvider {
|
|
10
|
-
updatePickers(theme?: string): void
|
|
10
|
+
updatePickers(theme?: string): void;
|
|
11
11
|
}
|
|
12
|
-
var StarlightThemeProvider: StarlightThemeProvider
|
|
12
|
+
var StarlightThemeProvider: StarlightThemeProvider;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
export {}
|
|
15
|
+
export {};
|