@louvain/ui 0.0.0-stage → 1.0.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/CHANGELOG.md +7 -0
- package/LICENSE +202 -0
- package/NOTICE +21 -0
- package/README.md +73 -2
- package/TRADEMARKS.md +11 -0
- package/assets/lou-ell/ell-gotit-dark.svg +1 -0
- package/assets/lou-ell/ell-gotit.svg +1 -0
- package/assets/lou-ell/ell-hero-dark.svg +1 -0
- package/assets/lou-ell/ell-hero-mono.svg +1 -0
- package/assets/lou-ell/ell-hero.svg +1 -0
- package/assets/lou-ell/ell-icon-64-mono.svg +1 -0
- package/assets/lou-ell/ell-icon-64.svg +1 -0
- package/assets/lou-ell/ell-listen-dark.svg +1 -0
- package/assets/lou-ell/ell-listen.svg +1 -0
- package/assets/lou-ell/ell-mark-16-dark.svg +1 -0
- package/assets/lou-ell/ell-mark-16.svg +1 -0
- package/assets/lou-ell/ell-write-dark.svg +1 -0
- package/assets/lou-ell/ell-write.svg +1 -0
- package/assets/louvain-notes.svg +1 -0
- package/css/button-raised.css +92 -0
- package/css/button.css +64 -0
- package/css/site-chrome/header.css +938 -0
- package/css/site-chrome/motion.css +137 -0
- package/css/site-chrome/sheet.css +2527 -0
- package/css/site-chrome.css +3 -0
- package/css/tokens.css +828 -0
- package/dist/button-class.d.ts +7 -0
- package/dist/button-class.js +20 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/logo.d.ts +12 -0
- package/dist/logo.js +14 -0
- package/dist/lou-ell-svg.d.ts +16 -0
- package/dist/lou-ell-svg.js +15 -0
- package/dist/notes-avatar.d.ts +1 -0
- package/dist/notes-avatar.js +1 -0
- package/dist/site-chrome/footer.d.ts +5 -0
- package/dist/site-chrome/footer.js +23 -0
- package/dist/site-chrome/github-stars.d.ts +6 -0
- package/dist/site-chrome/github-stars.js +15 -0
- package/dist/site-chrome/head.d.ts +8 -0
- package/dist/site-chrome/head.js +4 -0
- package/dist/site-chrome/header-context.d.ts +8 -0
- package/dist/site-chrome/header-context.js +9 -0
- package/dist/site-chrome/header-menu.d.ts +7 -0
- package/dist/site-chrome/header-menu.js +68 -0
- package/dist/site-chrome/header-sheet.d.ts +3 -0
- package/dist/site-chrome/header-sheet.js +35 -0
- package/dist/site-chrome/icons.d.ts +6 -0
- package/dist/site-chrome/icons.js +19 -0
- package/dist/site-chrome/index.d.ts +15 -0
- package/dist/site-chrome/index.js +15 -0
- package/dist/site-chrome/lines.d.ts +55 -0
- package/dist/site-chrome/lines.js +61 -0
- package/dist/site-chrome/menu-art.d.ts +5 -0
- package/dist/site-chrome/menu-art.js +6 -0
- package/dist/site-chrome/nav-machine.d.ts +24 -0
- package/dist/site-chrome/nav-machine.js +19 -0
- package/dist/site-chrome/open-or-demo.d.ts +14 -0
- package/dist/site-chrome/open-or-demo.js +12 -0
- package/dist/site-chrome/page-link.d.ts +18 -0
- package/dist/site-chrome/page-link.js +8 -0
- package/dist/site-chrome/page-rail.d.ts +4 -0
- package/dist/site-chrome/page-rail.js +78 -0
- package/dist/site-chrome/reveal.d.ts +3 -0
- package/dist/site-chrome/reveal.js +30 -0
- package/dist/site-chrome/ribbon.d.ts +3 -0
- package/dist/site-chrome/ribbon.js +32 -0
- package/dist/site-chrome/site-header.d.ts +14 -0
- package/dist/site-chrome/site-header.js +74 -0
- package/dist/site-chrome/site-map.d.ts +64 -0
- package/dist/site-chrome/site-map.js +209 -0
- package/dist/site-chrome/theme-toggle.d.ts +3 -0
- package/dist/site-chrome/theme-toggle.js +22 -0
- package/dist/theme.d.ts +17 -0
- package/dist/theme.js +92 -0
- package/fonts/OFL-host-grotesk.txt +93 -0
- package/fonts/OFL-jetbrains-mono.txt +93 -0
- package/fonts/host-grotesk-latin-wght-normal.woff2 +0 -0
- package/fonts/jetbrains-mono-latin-wght-normal.woff2 +0 -0
- package/package.json +99 -3
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { MenuArt } from "./menu-art.js";
|
|
2
|
+
export type MenuItem = {
|
|
3
|
+
href: string;
|
|
4
|
+
name: string;
|
|
5
|
+
note: string;
|
|
6
|
+
tag?: string;
|
|
7
|
+
signedIn?: {
|
|
8
|
+
name: string;
|
|
9
|
+
note: string;
|
|
10
|
+
tag: string;
|
|
11
|
+
};
|
|
12
|
+
live?: boolean;
|
|
13
|
+
art?: MenuArt;
|
|
14
|
+
};
|
|
15
|
+
export type MenuGroup = {
|
|
16
|
+
title: string;
|
|
17
|
+
items: MenuItem[];
|
|
18
|
+
};
|
|
19
|
+
export type Menu = {
|
|
20
|
+
id: "product" | "solutions" | "compare" | "resources";
|
|
21
|
+
name: string;
|
|
22
|
+
items: MenuItem[];
|
|
23
|
+
feature?: MenuItem;
|
|
24
|
+
promo?: MenuItem;
|
|
25
|
+
foot?: MenuItem[];
|
|
26
|
+
footTitle?: string;
|
|
27
|
+
boxed?: boolean;
|
|
28
|
+
groups?: MenuGroup[];
|
|
29
|
+
};
|
|
30
|
+
export type FeaturedPost = {
|
|
31
|
+
href: string;
|
|
32
|
+
title: string;
|
|
33
|
+
dek: string;
|
|
34
|
+
category: string;
|
|
35
|
+
};
|
|
36
|
+
export declare const SALES = "sales@louvain.ai";
|
|
37
|
+
export declare const PRODUCT = "https://louvain.ai";
|
|
38
|
+
export declare const DEMO = "/demo";
|
|
39
|
+
export declare const isFullLoad: (href: string) => boolean;
|
|
40
|
+
export declare const SIGN_IN = "https://louvain.ai/login";
|
|
41
|
+
export declare const TRIAL = "https://louvain.ai/signup";
|
|
42
|
+
export declare const OPEN_APP = "https://louvain.ai/app";
|
|
43
|
+
export declare const LEGAL: {
|
|
44
|
+
href: string;
|
|
45
|
+
name: string;
|
|
46
|
+
}[];
|
|
47
|
+
export declare const TRUST: {
|
|
48
|
+
href: string;
|
|
49
|
+
name: string;
|
|
50
|
+
}[];
|
|
51
|
+
export declare const MENUS: Menu[];
|
|
52
|
+
export declare const LINKS: {
|
|
53
|
+
href: string;
|
|
54
|
+
name: string;
|
|
55
|
+
}[];
|
|
56
|
+
export declare function HEADER_MENUS(menus: Menu[], featured?: FeaturedPost | null): Menu[];
|
|
57
|
+
export declare function sheetGroups(menu: Menu): {
|
|
58
|
+
title: string;
|
|
59
|
+
items: MenuItem[];
|
|
60
|
+
}[];
|
|
61
|
+
export declare const HEADER_LINKS: () => {
|
|
62
|
+
href: string;
|
|
63
|
+
name: string;
|
|
64
|
+
}[];
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { BRAIN, ENGINE, PLATFORM } from "./lines.js";
|
|
2
|
+
export const SALES = "sales@louvain.ai";
|
|
3
|
+
export const PRODUCT = "https://louvain.ai";
|
|
4
|
+
export const DEMO = "/demo";
|
|
5
|
+
export const isFullLoad = (href) => href === DEMO || href.startsWith(`${DEMO}?`) || href.startsWith(`${DEMO}#`);
|
|
6
|
+
export const SIGN_IN = `${PRODUCT}/login`;
|
|
7
|
+
export const TRIAL = `${PRODUCT}/signup`;
|
|
8
|
+
export const OPEN_APP = `${PRODUCT}/app`;
|
|
9
|
+
export const LEGAL = [
|
|
10
|
+
{ href: "/privacy", name: "Privacy" },
|
|
11
|
+
{ href: "/terms", name: "Terms" },
|
|
12
|
+
{ href: "/cookies", name: "Cookies" },
|
|
13
|
+
{ href: "/dpa", name: "Data processing" },
|
|
14
|
+
{ href: "/subprocessors", name: "Subprocessors" },
|
|
15
|
+
{ href: "/acceptable-use", name: "Acceptable use" },
|
|
16
|
+
];
|
|
17
|
+
export const TRUST = [
|
|
18
|
+
{ href: "/docs", name: "Documentation" },
|
|
19
|
+
{ href: "https://louvain.ai/changelog", name: "Changelog" },
|
|
20
|
+
{ href: "https://status.louvain.ai", name: "Status" },
|
|
21
|
+
{ href: "https://louvain.ai/support", name: "Support" },
|
|
22
|
+
{ href: "/security", name: "Security" },
|
|
23
|
+
{ href: "https://trust.louvain.ai", name: "Trust Centre" },
|
|
24
|
+
{ href: "mailto:security@louvain.ai", name: "Security contact" },
|
|
25
|
+
];
|
|
26
|
+
export const MENUS = [
|
|
27
|
+
{
|
|
28
|
+
id: "product",
|
|
29
|
+
name: "Product",
|
|
30
|
+
items: [
|
|
31
|
+
{ href: "/#product", name: "Today and the Plate", note: "What needs you, and what is owed" },
|
|
32
|
+
{
|
|
33
|
+
href: "/#receipts",
|
|
34
|
+
name: "Ask, with receipts",
|
|
35
|
+
note: "Every sentence checked against its source",
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
href: "/security#permissions",
|
|
39
|
+
name: "Permissions",
|
|
40
|
+
note: "Each answer scoped to the person asking",
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
href: "/integrations#assistants",
|
|
44
|
+
name: "For AI tools",
|
|
45
|
+
note: "Claude, ChatGPT and Cursor over MCP",
|
|
46
|
+
},
|
|
47
|
+
{ href: "/roi", name: "ROI calculator", note: "Your numbers, from your own inputs" },
|
|
48
|
+
{
|
|
49
|
+
href: ENGINE.href,
|
|
50
|
+
name: ENGINE.name,
|
|
51
|
+
note: "Permissioned search for your agents",
|
|
52
|
+
tag: "Open source",
|
|
53
|
+
live: true,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
href: BRAIN.href,
|
|
57
|
+
name: BRAIN.name,
|
|
58
|
+
note: "The engine, hosted for your company",
|
|
59
|
+
tag: "Coming soon",
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: "solutions",
|
|
65
|
+
name: "Solutions",
|
|
66
|
+
items: [
|
|
67
|
+
{
|
|
68
|
+
href: "/solutions/professional-services",
|
|
69
|
+
name: "Professional services",
|
|
70
|
+
note: "Scope, commitments and client confidentiality",
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
href: "/solutions/accounting",
|
|
74
|
+
name: "Accounting",
|
|
75
|
+
note: "What each client owes you, and what you promised them",
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
href: "/solutions/startups",
|
|
79
|
+
name: "Startups",
|
|
80
|
+
note: "One memory before the company outgrows its chat",
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
href: "/solutions/commercial-teams",
|
|
84
|
+
name: "Commercial teams",
|
|
85
|
+
note: "Every promise made to a customer, kept in view",
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
id: "compare",
|
|
91
|
+
name: "Compare",
|
|
92
|
+
items: [
|
|
93
|
+
{
|
|
94
|
+
href: "/compare/microsoft-copilot",
|
|
95
|
+
name: "Microsoft Copilot",
|
|
96
|
+
note: "The question we are asked most",
|
|
97
|
+
},
|
|
98
|
+
{ href: "/compare/glean", name: "Glean", note: "Enterprise search at large scale" },
|
|
99
|
+
{ href: "/compare/onyx", name: "Onyx", note: "Open source and self-hosted" },
|
|
100
|
+
{
|
|
101
|
+
href: "/compare/glean/cost-calculator",
|
|
102
|
+
name: "Glean cost calculator",
|
|
103
|
+
note: "What Glean costs, from reported figures",
|
|
104
|
+
},
|
|
105
|
+
{ href: "/compare", name: "All comparisons", note: "How we write them, and our sources" },
|
|
106
|
+
],
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
id: "resources",
|
|
110
|
+
name: "Resources",
|
|
111
|
+
items: [
|
|
112
|
+
{ href: "/docs", name: "Docs", note: "Guides to everything you can do in Louvain" },
|
|
113
|
+
{ href: "/blog", name: "Blog", note: "Product news, how we build it, what we measure" },
|
|
114
|
+
{ href: "/benchmarks", name: "Benchmarks", note: "Results, each with its method" },
|
|
115
|
+
{ href: "/roi", name: "ROI calculator", note: "Your numbers, from your own inputs" },
|
|
116
|
+
],
|
|
117
|
+
},
|
|
118
|
+
];
|
|
119
|
+
export const LINKS = [
|
|
120
|
+
{ href: "/integrations", name: "Integrations" },
|
|
121
|
+
{ href: "/security", name: "Security" },
|
|
122
|
+
{ href: "/pricing", name: "Pricing" },
|
|
123
|
+
{ href: "/blog", name: "Blog" },
|
|
124
|
+
];
|
|
125
|
+
export function HEADER_MENUS(menus, featured) {
|
|
126
|
+
const of = (id) => menus.find((m) => m.id === id)?.items ?? [];
|
|
127
|
+
const product = of("product");
|
|
128
|
+
const lines = product.filter((i) => i.href === ENGINE.href || i.href === BRAIN.href);
|
|
129
|
+
const platform = product.filter((i) => !lines.includes(i) && i.href !== "/roi");
|
|
130
|
+
const resources = of("resources");
|
|
131
|
+
const compare = of("compare");
|
|
132
|
+
const menu = (m) => ({
|
|
133
|
+
...m,
|
|
134
|
+
items: [...m.groups.flatMap((g) => g.items), ...(m.foot ?? [])],
|
|
135
|
+
});
|
|
136
|
+
return [
|
|
137
|
+
menu({
|
|
138
|
+
id: "product",
|
|
139
|
+
name: "Product",
|
|
140
|
+
feature: { href: "/", name: "Louvain", note: PLATFORM.line, tag: "Overview" },
|
|
141
|
+
groups: [{ title: "The platform", items: platform }],
|
|
142
|
+
foot: lines,
|
|
143
|
+
footTitle: "Engine and Brain",
|
|
144
|
+
}),
|
|
145
|
+
menu({
|
|
146
|
+
id: "solutions",
|
|
147
|
+
name: "Solutions",
|
|
148
|
+
promo: {
|
|
149
|
+
href: DEMO,
|
|
150
|
+
name: "See it on your team’s work",
|
|
151
|
+
note: "A walkthrough on your own questions, with your own sources.",
|
|
152
|
+
tag: "Book a demo",
|
|
153
|
+
signedIn: {
|
|
154
|
+
name: "Back to your workspace",
|
|
155
|
+
note: "Your sources, your questions, where you left them.",
|
|
156
|
+
tag: "Open Louvain",
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
groups: [{ title: "By team", items: of("solutions") }],
|
|
160
|
+
}),
|
|
161
|
+
menu({
|
|
162
|
+
id: "resources",
|
|
163
|
+
name: "Resources",
|
|
164
|
+
boxed: true,
|
|
165
|
+
...(featured
|
|
166
|
+
? {
|
|
167
|
+
promo: {
|
|
168
|
+
href: featured.href,
|
|
169
|
+
name: featured.title,
|
|
170
|
+
note: featured.dek,
|
|
171
|
+
tag: "Read the post",
|
|
172
|
+
},
|
|
173
|
+
}
|
|
174
|
+
: {}),
|
|
175
|
+
groups: [
|
|
176
|
+
{ title: "Learn", items: resources.filter((i) => i.href !== "/roi") },
|
|
177
|
+
{ title: "Compare", items: compare.filter((i) => !i.href.includes("calculator")) },
|
|
178
|
+
{
|
|
179
|
+
title: "Calculators",
|
|
180
|
+
items: [
|
|
181
|
+
...resources.filter((i) => i.href === "/roi"),
|
|
182
|
+
...compare.filter((i) => i.href.includes("calculator")),
|
|
183
|
+
],
|
|
184
|
+
},
|
|
185
|
+
],
|
|
186
|
+
foot: [
|
|
187
|
+
{
|
|
188
|
+
href: "/benchmarks",
|
|
189
|
+
name: "Benchmarks",
|
|
190
|
+
note: "Our results, each with its method, so you can check them.",
|
|
191
|
+
art: "score",
|
|
192
|
+
},
|
|
193
|
+
],
|
|
194
|
+
}),
|
|
195
|
+
];
|
|
196
|
+
}
|
|
197
|
+
export function sheetGroups(menu) {
|
|
198
|
+
const seen = new Set();
|
|
199
|
+
const once = (items) => items.filter((i) => (seen.has(i.href) ? false : (seen.add(i.href), true)));
|
|
200
|
+
const groups = (menu.groups ?? [{ title: menu.name, items: menu.items }]).map((g) => ({
|
|
201
|
+
title: g.title,
|
|
202
|
+
items: once(g.items),
|
|
203
|
+
}));
|
|
204
|
+
const foot = once(menu.foot ?? []);
|
|
205
|
+
if (foot.length)
|
|
206
|
+
groups.push({ title: menu.footTitle ?? foot[0]?.tag ?? "More", items: foot });
|
|
207
|
+
return groups.filter((g) => g.items.length);
|
|
208
|
+
}
|
|
209
|
+
export const HEADER_LINKS = () => LINKS.filter((l) => l.href !== "/blog");
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
import { applyTheme, readTheme, THEME_COOKIE_DOMAIN, writeTheme } from "../theme.js";
|
|
5
|
+
export function ThemeToggle({ themeStorage = THEME_COOKIE_DOMAIN }) {
|
|
6
|
+
const [theme, setTheme] = useState("system");
|
|
7
|
+
useEffect(() => setTheme(readTheme(themeStorage)), [themeStorage]);
|
|
8
|
+
const choose = (next) => {
|
|
9
|
+
setTheme(next);
|
|
10
|
+
const root = document.documentElement;
|
|
11
|
+
const apply = () => applyTheme(next);
|
|
12
|
+
if (document.startViewTransition &&
|
|
13
|
+
!window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
14
|
+
root.dataset.vt = "theme";
|
|
15
|
+
document.startViewTransition(apply).finished.finally(() => delete root.dataset.vt);
|
|
16
|
+
}
|
|
17
|
+
else
|
|
18
|
+
apply();
|
|
19
|
+
writeTheme(next, themeStorage);
|
|
20
|
+
};
|
|
21
|
+
return (_jsxs("fieldset", { className: "theme-toggle", children: [_jsx("legend", { children: "Theme" }), ["system", "light", "dark"].map((t) => (_jsxs("label", { children: [_jsx("input", { type: "radio", name: "theme", value: t, checked: theme === t, onChange: () => choose(t) }), _jsx("span", { children: t === "system" ? "System" : t === "light" ? "Light" : "Dark" })] }, t)))] }));
|
|
22
|
+
}
|
package/dist/theme.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type Theme = "system" | "light" | "dark";
|
|
2
|
+
export declare const THEME_COOKIE = "louvain.theme";
|
|
3
|
+
export declare const THEME_LEGACY_KEYS: readonly ["louvain.theme", "brain.theme"];
|
|
4
|
+
export declare const THEME_COOKIE_DOMAIN = ".louvain.ai";
|
|
5
|
+
export declare const THEME_MAX_AGE = 31536000;
|
|
6
|
+
export declare const parseTheme: (value: string | null | undefined) => Theme;
|
|
7
|
+
export declare function themeFromCookie(cookie: string): "light" | "dark" | null;
|
|
8
|
+
export declare function onDomain(host: string, domain: string): boolean;
|
|
9
|
+
export declare function themeCookie(theme: Theme, where: {
|
|
10
|
+
host: string;
|
|
11
|
+
protocol: string;
|
|
12
|
+
}, domain?: string): string;
|
|
13
|
+
export declare function readTheme(domain?: string): Theme;
|
|
14
|
+
export declare function writeTheme(theme: Theme, domain?: string): void;
|
|
15
|
+
export declare function applyTheme(theme: Theme): void;
|
|
16
|
+
export declare function themeScript(domain?: string): string;
|
|
17
|
+
export declare const THEME_SCRIPT: string;
|
package/dist/theme.js
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
export const THEME_COOKIE = "louvain.theme";
|
|
2
|
+
export const THEME_LEGACY_KEYS = ["louvain.theme", "brain.theme"];
|
|
3
|
+
export const THEME_COOKIE_DOMAIN = ".louvain.ai";
|
|
4
|
+
export const THEME_MAX_AGE = 31_536_000;
|
|
5
|
+
export const parseTheme = (value) => value === "light" || value === "dark" ? value : "system";
|
|
6
|
+
export function themeFromCookie(cookie) {
|
|
7
|
+
for (const part of cookie.split(";")) {
|
|
8
|
+
const at = part.indexOf("=");
|
|
9
|
+
if (at < 0 || part.slice(0, at).trim() !== THEME_COOKIE)
|
|
10
|
+
continue;
|
|
11
|
+
const t = parseTheme(part.slice(at + 1).trim());
|
|
12
|
+
return t === "system" ? null : t;
|
|
13
|
+
}
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
export function onDomain(host, domain) {
|
|
17
|
+
const bare = domain.replace(/^\./, "").toLowerCase();
|
|
18
|
+
const h = host.toLowerCase();
|
|
19
|
+
return h === bare || h.endsWith(`.${bare}`);
|
|
20
|
+
}
|
|
21
|
+
export function themeCookie(theme, where, domain = THEME_COOKIE_DOMAIN) {
|
|
22
|
+
const attrs = [
|
|
23
|
+
"Path=/",
|
|
24
|
+
theme === "system" ? "Max-Age=0" : `Max-Age=${THEME_MAX_AGE}`,
|
|
25
|
+
"SameSite=Lax",
|
|
26
|
+
];
|
|
27
|
+
if (onDomain(where.host, domain))
|
|
28
|
+
attrs.unshift(`Domain=${domain}`);
|
|
29
|
+
if (where.protocol === "https:")
|
|
30
|
+
attrs.push("Secure");
|
|
31
|
+
return `${THEME_COOKIE}=${theme === "system" ? "" : theme}; ${attrs.join("; ")}`;
|
|
32
|
+
}
|
|
33
|
+
export function readTheme(domain = THEME_COOKIE_DOMAIN) {
|
|
34
|
+
if (typeof document === "undefined")
|
|
35
|
+
return "system";
|
|
36
|
+
const fromCookie = themeFromCookie(document.cookie);
|
|
37
|
+
if (fromCookie) {
|
|
38
|
+
dropLegacy();
|
|
39
|
+
return fromCookie;
|
|
40
|
+
}
|
|
41
|
+
let legacy = "system";
|
|
42
|
+
try {
|
|
43
|
+
for (const key of THEME_LEGACY_KEYS) {
|
|
44
|
+
legacy = parseTheme(localStorage.getItem(key));
|
|
45
|
+
if (legacy !== "system")
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
}
|
|
51
|
+
if (legacy !== "system")
|
|
52
|
+
writeTheme(legacy, domain);
|
|
53
|
+
return legacy;
|
|
54
|
+
}
|
|
55
|
+
function dropLegacy() {
|
|
56
|
+
try {
|
|
57
|
+
for (const key of THEME_LEGACY_KEYS)
|
|
58
|
+
localStorage.removeItem(key);
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
export function writeTheme(theme, domain = THEME_COOKIE_DOMAIN) {
|
|
64
|
+
if (typeof document === "undefined")
|
|
65
|
+
return;
|
|
66
|
+
document.cookie = themeCookie(theme, { host: location.hostname, protocol: location.protocol }, domain);
|
|
67
|
+
dropLegacy();
|
|
68
|
+
}
|
|
69
|
+
export function applyTheme(theme) {
|
|
70
|
+
const root = document.documentElement;
|
|
71
|
+
if (theme === "system")
|
|
72
|
+
root.removeAttribute("data-theme");
|
|
73
|
+
else
|
|
74
|
+
root.setAttribute("data-theme", theme);
|
|
75
|
+
}
|
|
76
|
+
export function themeScript(domain = THEME_COOKIE_DOMAIN) {
|
|
77
|
+
const d = JSON.stringify(domain);
|
|
78
|
+
const keys = JSON.stringify(THEME_LEGACY_KEYS);
|
|
79
|
+
return [
|
|
80
|
+
"try{",
|
|
81
|
+
`var c=document.cookie.match(/(?:^|;\\s*)${THEME_COOKIE.replace(".", "\\.")}=([^;]*)/),t=c&&c[1],k=${keys},i,v;`,
|
|
82
|
+
"if(t!=='dark'&&t!=='light'){t=null;",
|
|
83
|
+
"try{for(i=0;i<k.length;i++){v=localStorage.getItem(k[i]);if(v==='dark'||v==='light'){t=v;break}}}catch(e){}",
|
|
84
|
+
"if(t){",
|
|
85
|
+
`var D=${d},h=location.hostname,b=D.replace(/^\\./,'');`,
|
|
86
|
+
`document.cookie='${THEME_COOKIE}='+t+(h===b||h.slice(-b.length-1)==='.'+b?'; Domain='+D:'')+'; Path=/; Max-Age=${THEME_MAX_AGE}; SameSite=Lax'+(location.protocol==='https:'?'; Secure':'')}}`,
|
|
87
|
+
"if(t){try{for(i=0;i<k.length;i++)localStorage.removeItem(k[i])}catch(e){}",
|
|
88
|
+
"document.documentElement.setAttribute('data-theme',t)}",
|
|
89
|
+
"}catch(e){}",
|
|
90
|
+
].join("");
|
|
91
|
+
}
|
|
92
|
+
export const THEME_SCRIPT = themeScript();
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Copyright 2023 The Host Grotesk Project Authors (https://github.com/Element-Type/HostGrotesk)
|
|
2
|
+
|
|
3
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
4
|
+
This license is copied below, and is also available with a FAQ at:
|
|
5
|
+
https://openfontlicense.org
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
-----------------------------------------------------------
|
|
9
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
10
|
+
-----------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
PREAMBLE
|
|
13
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
14
|
+
development of collaborative font projects, to support the font creation
|
|
15
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
16
|
+
open framework in which fonts may be shared and improved in partnership
|
|
17
|
+
with others.
|
|
18
|
+
|
|
19
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
20
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
21
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
22
|
+
redistributed and/or sold with any software provided that any reserved
|
|
23
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
24
|
+
however, cannot be released under any other type of license. The
|
|
25
|
+
requirement for fonts to remain under this license does not apply
|
|
26
|
+
to any document created using the fonts or their derivatives.
|
|
27
|
+
|
|
28
|
+
DEFINITIONS
|
|
29
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
30
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
31
|
+
include source files, build scripts and documentation.
|
|
32
|
+
|
|
33
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
34
|
+
copyright statement(s).
|
|
35
|
+
|
|
36
|
+
"Original Version" refers to the collection of Font Software components as
|
|
37
|
+
distributed by the Copyright Holder(s).
|
|
38
|
+
|
|
39
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
40
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
41
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
42
|
+
new environment.
|
|
43
|
+
|
|
44
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
45
|
+
writer or other person who contributed to the Font Software.
|
|
46
|
+
|
|
47
|
+
PERMISSION & CONDITIONS
|
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
49
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
50
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
51
|
+
Software, subject to the following conditions:
|
|
52
|
+
|
|
53
|
+
1) Neither the Font Software nor any of its individual components,
|
|
54
|
+
in Original or Modified Versions, may be sold by itself.
|
|
55
|
+
|
|
56
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
57
|
+
redistributed and/or sold with any software, provided that each copy
|
|
58
|
+
contains the above copyright notice and this license. These can be
|
|
59
|
+
included either as stand-alone text files, human-readable headers or
|
|
60
|
+
in the appropriate machine-readable metadata fields within text or
|
|
61
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
62
|
+
|
|
63
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
64
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
65
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
66
|
+
presented to the users.
|
|
67
|
+
|
|
68
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
69
|
+
Software shall not be used to promote, endorse or advertise any
|
|
70
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
71
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
72
|
+
permission.
|
|
73
|
+
|
|
74
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
75
|
+
must be distributed entirely under this license, and must not be
|
|
76
|
+
distributed under any other license. The requirement for fonts to
|
|
77
|
+
remain under this license does not apply to any document created
|
|
78
|
+
using the Font Software.
|
|
79
|
+
|
|
80
|
+
TERMINATION
|
|
81
|
+
This license becomes null and void if any of the above conditions are
|
|
82
|
+
not met.
|
|
83
|
+
|
|
84
|
+
DISCLAIMER
|
|
85
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
86
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
87
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
88
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
89
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
90
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
91
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
92
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
93
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Copyright 2020 The JetBrains Mono Project Authors (https://github.com/JetBrains/JetBrainsMono) JetBrainsMono-Italic[wght].ttf: Copyright 2020 The JetBrains Mono Project Authors (https://github.com/JetBrains/JetBrainsMono)
|
|
2
|
+
|
|
3
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
4
|
+
This license is copied below, and is also available with a FAQ at:
|
|
5
|
+
http://scripts.sil.org/OFL
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
-----------------------------------------------------------
|
|
9
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
10
|
+
-----------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
PREAMBLE
|
|
13
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
14
|
+
development of collaborative font projects, to support the font creation
|
|
15
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
16
|
+
open framework in which fonts may be shared and improved in partnership
|
|
17
|
+
with others.
|
|
18
|
+
|
|
19
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
20
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
21
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
22
|
+
redistributed and/or sold with any software provided that any reserved
|
|
23
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
24
|
+
however, cannot be released under any other type of license. The
|
|
25
|
+
requirement for fonts to remain under this license does not apply
|
|
26
|
+
to any document created using the fonts or their derivatives.
|
|
27
|
+
|
|
28
|
+
DEFINITIONS
|
|
29
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
30
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
31
|
+
include source files, build scripts and documentation.
|
|
32
|
+
|
|
33
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
34
|
+
copyright statement(s).
|
|
35
|
+
|
|
36
|
+
"Original Version" refers to the collection of Font Software components as
|
|
37
|
+
distributed by the Copyright Holder(s).
|
|
38
|
+
|
|
39
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
40
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
41
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
42
|
+
new environment.
|
|
43
|
+
|
|
44
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
45
|
+
writer or other person who contributed to the Font Software.
|
|
46
|
+
|
|
47
|
+
PERMISSION & CONDITIONS
|
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
49
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
50
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
51
|
+
Software, subject to the following conditions:
|
|
52
|
+
|
|
53
|
+
1) Neither the Font Software nor any of its individual components,
|
|
54
|
+
in Original or Modified Versions, may be sold by itself.
|
|
55
|
+
|
|
56
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
57
|
+
redistributed and/or sold with any software, provided that each copy
|
|
58
|
+
contains the above copyright notice and this license. These can be
|
|
59
|
+
included either as stand-alone text files, human-readable headers or
|
|
60
|
+
in the appropriate machine-readable metadata fields within text or
|
|
61
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
62
|
+
|
|
63
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
64
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
65
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
66
|
+
presented to the users.
|
|
67
|
+
|
|
68
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
69
|
+
Software shall not be used to promote, endorse or advertise any
|
|
70
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
71
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
72
|
+
permission.
|
|
73
|
+
|
|
74
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
75
|
+
must be distributed entirely under this license, and must not be
|
|
76
|
+
distributed under any other license. The requirement for fonts to
|
|
77
|
+
remain under this license does not apply to any document created
|
|
78
|
+
using the Font Software.
|
|
79
|
+
|
|
80
|
+
TERMINATION
|
|
81
|
+
This license becomes null and void if any of the above conditions are
|
|
82
|
+
not met.
|
|
83
|
+
|
|
84
|
+
DISCLAIMER
|
|
85
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
86
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
87
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
88
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
89
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
90
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
91
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
92
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
93
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
Binary file
|
|
Binary file
|