@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,35 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useContext, useEffect, useRef } from "react";
|
|
4
|
+
import { buttonLook } from "../button-class.js";
|
|
5
|
+
import { ChromeContext, Link } from "./header-context.js";
|
|
6
|
+
import { Chevron } from "./icons.js";
|
|
7
|
+
import { BookDemo, OpenOrDemo } from "./open-or-demo.js";
|
|
8
|
+
import { HEADER_LINKS, HEADER_MENUS, MENUS, OPEN_APP, SIGN_IN, sheetGroups } from "./site-map.js";
|
|
9
|
+
import { ThemeToggle } from "./theme-toggle.js";
|
|
10
|
+
export function Sheet({ onClose }) {
|
|
11
|
+
const { origin, auth, themeStorage } = useContext(ChromeContext);
|
|
12
|
+
const sheet = useRef(null);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
const el = sheet.current;
|
|
15
|
+
el?.querySelector("summary, a, button")?.focus();
|
|
16
|
+
const trap = (event) => {
|
|
17
|
+
if (event.key !== "Tab" || !el)
|
|
18
|
+
return;
|
|
19
|
+
const focusable = [...el.querySelectorAll("summary, a, button")].filter((x) => x.offsetParent !== null);
|
|
20
|
+
const first = focusable[0];
|
|
21
|
+
const last = focusable[focusable.length - 1];
|
|
22
|
+
if (event.shiftKey && document.activeElement === first) {
|
|
23
|
+
event.preventDefault();
|
|
24
|
+
last?.focus();
|
|
25
|
+
}
|
|
26
|
+
else if (!event.shiftKey && document.activeElement === last) {
|
|
27
|
+
event.preventDefault();
|
|
28
|
+
first?.focus();
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
document.addEventListener("keydown", trap);
|
|
32
|
+
return () => document.removeEventListener("keydown", trap);
|
|
33
|
+
}, []);
|
|
34
|
+
return (_jsxs("nav", { className: "sheet-menu", id: "site-sheet", "aria-label": "All pages", ref: sheet, children: [HEADER_MENUS(MENUS).map((menu) => (_jsxs("details", { className: "sheet-section", children: [_jsxs("summary", { children: [menu.name, " ", _jsx(Chevron, {})] }), sheetGroups(menu).map((group) => (_jsxs("div", { className: "sheet-group", children: [_jsx("h3", { children: group.title }), group.items.map((item) => (_jsxs(Link, { href: item.href, onClick: onClose, children: [item.name, item.tag && item.tag !== group.title ? (_jsx("i", { className: "sheet-tag", "data-live": item.live || undefined, children: item.tag })) : null] }, item.href)))] }, group.title)))] }, menu.id))), _jsxs("div", { children: [_jsx("h2", { children: "More" }), HEADER_LINKS().map((link) => (_jsx(Link, { href: link.href, onClick: onClose, children: link.name }, link.href)))] }), _jsxs("div", { className: "sheet-foot", children: [_jsxs("div", { className: "sheet-actions", children: [_jsx(OpenOrDemo, { size: "lg", onClick: onClose }), _jsx(BookDemo, { size: "lg", onClick: onClose, origin: origin }), auth === "none" ? (_jsx("a", { ...buttonLook("secondary", "lg"), href: OPEN_APP, onClick: onClose, children: "Sign in" })) : (_jsx("a", { ...buttonLook("secondary", "lg"), href: SIGN_IN, onClick: onClose, "data-auth-when": "out", children: "Sign in" }))] }), _jsx(ThemeToggle, { ...(themeStorage ? { themeStorage } : {}) })] })] }));
|
|
35
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function Arrow(): import("react").JSX.Element;
|
|
2
|
+
export declare function Chevron(): import("react").JSX.Element;
|
|
3
|
+
export declare function Check(): import("react").JSX.Element;
|
|
4
|
+
export declare function State({ kind }: {
|
|
5
|
+
kind: "yes" | "no" | "part" | "ns";
|
|
6
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export function Arrow() {
|
|
3
|
+
return (_jsx("svg", { className: "arrow", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: _jsx("path", { d: "M3 8h10M9 4l4 4-4 4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
4
|
+
}
|
|
5
|
+
export function Chevron() {
|
|
6
|
+
return (_jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", "aria-hidden": "true", children: _jsx("path", { d: "M2.5 4.5L6 8l3.5-3.5", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
7
|
+
}
|
|
8
|
+
export function Check() {
|
|
9
|
+
return (_jsxs("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [_jsx("circle", { cx: "10", cy: "10", r: "8.2", stroke: "currentColor", strokeWidth: "1.4" }), _jsx("path", { d: "M6.4 10.3l2.4 2.4 4.8-5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })] }));
|
|
10
|
+
}
|
|
11
|
+
export function State({ kind }) {
|
|
12
|
+
if (kind === "yes")
|
|
13
|
+
return (_jsx("svg", { className: "yes", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", role: "img", "aria-label": "Yes", children: _jsx("path", { d: "M3 8.5l3.2 3.2L13 5", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
14
|
+
if (kind === "no")
|
|
15
|
+
return (_jsx("svg", { className: "no", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", role: "img", "aria-label": "No", children: _jsx("path", { d: "M4 4l8 8M12 4l-8 8", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round" }) }));
|
|
16
|
+
if (kind === "part")
|
|
17
|
+
return (_jsxs("svg", { className: "part", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", role: "img", "aria-label": "Partly", children: [_jsx("circle", { cx: "8", cy: "8", r: "5", stroke: "currentColor", strokeWidth: "1.5" }), _jsx("path", { d: "M8 3a5 5 0 010 10z", fill: "currentColor" })] }));
|
|
18
|
+
return (_jsx("svg", { className: "part", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", role: "img", "aria-label": "Not stated", children: _jsx("path", { d: "M4 8h8", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round" }) }));
|
|
19
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { Footer, type FooterProps } from "./footer.js";
|
|
2
|
+
export { GitHubStarsLink, starWords } from "./github-stars.js";
|
|
3
|
+
export { Head } from "./head.js";
|
|
4
|
+
export { Arrow, Check, Chevron, State } from "./icons.js";
|
|
5
|
+
export { BRAIN, ENGINE, LINES, PLATFORM, SOON } from "./lines.js";
|
|
6
|
+
export { type MenuArt, MenuArtView } from "./menu-art.js";
|
|
7
|
+
export { initialNav, type NavEvent, type NavState, navReducer, type Open } from "./nav-machine.js";
|
|
8
|
+
export { BookDemo, OpenOrDemo } from "./open-or-demo.js";
|
|
9
|
+
export { type ChromeLinks, type LinkComponent, type LinkProps, PageLink, siteHref, } from "./page-link.js";
|
|
10
|
+
export { PageRail, titleCase } from "./page-rail.js";
|
|
11
|
+
export { Reveal } from "./reveal.js";
|
|
12
|
+
export { Ribbon } from "./ribbon.js";
|
|
13
|
+
export { SiteHeader, type SiteHeaderProps } from "./site-header.js";
|
|
14
|
+
export { DEMO, type FeaturedPost, HEADER_LINKS, HEADER_MENUS, isFullLoad, LEGAL, LINKS, MENUS, type Menu, type MenuGroup, type MenuItem, OPEN_APP, PRODUCT, SALES, SIGN_IN, sheetGroups, TRIAL, TRUST, } from "./site-map.js";
|
|
15
|
+
export { ThemeToggle } from "./theme-toggle.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { Footer } from "./footer.js";
|
|
2
|
+
export { GitHubStarsLink, starWords } from "./github-stars.js";
|
|
3
|
+
export { Head } from "./head.js";
|
|
4
|
+
export { Arrow, Check, Chevron, State } from "./icons.js";
|
|
5
|
+
export { BRAIN, ENGINE, LINES, PLATFORM, SOON } from "./lines.js";
|
|
6
|
+
export { MenuArtView } from "./menu-art.js";
|
|
7
|
+
export { initialNav, navReducer } from "./nav-machine.js";
|
|
8
|
+
export { BookDemo, OpenOrDemo } from "./open-or-demo.js";
|
|
9
|
+
export { PageLink, siteHref, } from "./page-link.js";
|
|
10
|
+
export { PageRail, titleCase } from "./page-rail.js";
|
|
11
|
+
export { Reveal } from "./reveal.js";
|
|
12
|
+
export { Ribbon } from "./ribbon.js";
|
|
13
|
+
export { SiteHeader } from "./site-header.js";
|
|
14
|
+
export { DEMO, HEADER_LINKS, HEADER_MENUS, isFullLoad, LEGAL, LINKS, MENUS, OPEN_APP, PRODUCT, SALES, SIGN_IN, sheetGroups, TRIAL, TRUST, } from "./site-map.js";
|
|
15
|
+
export { ThemeToggle } from "./theme-toggle.js";
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export declare const SOON = "Coming soon";
|
|
2
|
+
export declare const ENGINE: {
|
|
3
|
+
readonly name: "Louvain Engine";
|
|
4
|
+
readonly short: "Engine";
|
|
5
|
+
readonly href: "/engine";
|
|
6
|
+
readonly repo: "louvain-ai/louvain-engine";
|
|
7
|
+
readonly repoUrl: "https://github.com/louvain-ai/louvain-engine";
|
|
8
|
+
readonly orgUrl: "https://github.com/louvain-ai";
|
|
9
|
+
readonly licence: "Apache-2.0";
|
|
10
|
+
readonly line: "The open retrieval engine behind Louvain: it finds the right document in your company’s files, behind a permission fence, and hands it to your agent with its source, self-hosted, over MCP and HTTP.";
|
|
11
|
+
};
|
|
12
|
+
export declare const BRAIN: {
|
|
13
|
+
readonly name: "Louvain Brain";
|
|
14
|
+
readonly short: "Brain";
|
|
15
|
+
readonly href: "/brain";
|
|
16
|
+
readonly line: "Louvain Engine, run for your company: a brain in seconds, configured lane by lane, with permissions on a dial.";
|
|
17
|
+
};
|
|
18
|
+
export declare const PLATFORM: {
|
|
19
|
+
readonly name: "Louvain";
|
|
20
|
+
readonly short: "Louvain";
|
|
21
|
+
readonly href: "/";
|
|
22
|
+
readonly line: "The home screen of work: what was said, what was agreed and what is owed, with an answer behind every claim.";
|
|
23
|
+
};
|
|
24
|
+
export declare const LINES: readonly [{
|
|
25
|
+
readonly tag: "Open source";
|
|
26
|
+
readonly runs: "You run it";
|
|
27
|
+
readonly adds: readonly ["A permission fence first in every query", "Keyword and meaning search, with an optional reranker", "Three MCP tools, an HTTP ingest door and a Search and Ask app", "Plugins as functions in one file"];
|
|
28
|
+
readonly cta: "See the engine";
|
|
29
|
+
readonly name: "Louvain Engine";
|
|
30
|
+
readonly short: "Engine";
|
|
31
|
+
readonly href: "/engine";
|
|
32
|
+
readonly repo: "louvain-ai/louvain-engine";
|
|
33
|
+
readonly repoUrl: "https://github.com/louvain-ai/louvain-engine";
|
|
34
|
+
readonly orgUrl: "https://github.com/louvain-ai";
|
|
35
|
+
readonly licence: "Apache-2.0";
|
|
36
|
+
readonly line: "The open retrieval engine behind Louvain: it finds the right document in your company’s files, behind a permission fence, and hands it to your agent with its source, self-hosted, over MCP and HTTP.";
|
|
37
|
+
}, {
|
|
38
|
+
readonly tag: "Hosted · coming soon";
|
|
39
|
+
readonly runs: "We run it, one per company";
|
|
40
|
+
readonly adds: readonly ["Everything in the engine", "Lanes: ingestion, embedding, recall, models", "Permissions on a dial", "No app on top: your agents and software ask it"];
|
|
41
|
+
readonly cta: "See the brain";
|
|
42
|
+
readonly name: "Louvain Brain";
|
|
43
|
+
readonly short: "Brain";
|
|
44
|
+
readonly href: "/brain";
|
|
45
|
+
readonly line: "Louvain Engine, run for your company: a brain in seconds, configured lane by lane, with permissions on a dial.";
|
|
46
|
+
}, {
|
|
47
|
+
readonly tag: "The product";
|
|
48
|
+
readonly runs: "Ready to use";
|
|
49
|
+
readonly adds: readonly ["Built on the same engine", "Connected to your email, files, chat and calendar", "Today, the Plate and Ask, with receipts", "Each person sees only what they may read"];
|
|
50
|
+
readonly cta: "See Louvain";
|
|
51
|
+
readonly name: "Louvain";
|
|
52
|
+
readonly short: "Louvain";
|
|
53
|
+
readonly href: "/";
|
|
54
|
+
readonly line: "The home screen of work: what was said, what was agreed and what is owed, with an answer behind every claim.";
|
|
55
|
+
}];
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export const SOON = "Coming soon";
|
|
2
|
+
export const ENGINE = {
|
|
3
|
+
name: "Louvain Engine",
|
|
4
|
+
short: "Engine",
|
|
5
|
+
href: "/engine",
|
|
6
|
+
repo: "louvain-ai/louvain-engine",
|
|
7
|
+
repoUrl: "https://github.com/louvain-ai/louvain-engine",
|
|
8
|
+
orgUrl: "https://github.com/louvain-ai",
|
|
9
|
+
licence: "Apache-2.0",
|
|
10
|
+
line: "The open retrieval engine behind Louvain: it finds the right document in your company’s files, behind a permission fence, and hands it to your agent with its source, self-hosted, over MCP and HTTP.",
|
|
11
|
+
};
|
|
12
|
+
export const BRAIN = {
|
|
13
|
+
name: "Louvain Brain",
|
|
14
|
+
short: "Brain",
|
|
15
|
+
href: "/brain",
|
|
16
|
+
line: "Louvain Engine, run for your company: a brain in seconds, configured lane by lane, with permissions on a dial.",
|
|
17
|
+
};
|
|
18
|
+
export const PLATFORM = {
|
|
19
|
+
name: "Louvain",
|
|
20
|
+
short: "Louvain",
|
|
21
|
+
href: "/",
|
|
22
|
+
line: "The home screen of work: what was said, what was agreed and what is owed, with an answer behind every claim.",
|
|
23
|
+
};
|
|
24
|
+
export const LINES = [
|
|
25
|
+
{
|
|
26
|
+
...ENGINE,
|
|
27
|
+
tag: "Open source",
|
|
28
|
+
runs: "You run it",
|
|
29
|
+
adds: [
|
|
30
|
+
"A permission fence first in every query",
|
|
31
|
+
"Keyword and meaning search, with an optional reranker",
|
|
32
|
+
"Three MCP tools, an HTTP ingest door and a Search and Ask app",
|
|
33
|
+
"Plugins as functions in one file",
|
|
34
|
+
],
|
|
35
|
+
cta: "See the engine",
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
...BRAIN,
|
|
39
|
+
tag: "Hosted · coming soon",
|
|
40
|
+
runs: "We run it, one per company",
|
|
41
|
+
adds: [
|
|
42
|
+
"Everything in the engine",
|
|
43
|
+
"Lanes: ingestion, embedding, recall, models",
|
|
44
|
+
"Permissions on a dial",
|
|
45
|
+
"No app on top: your agents and software ask it",
|
|
46
|
+
],
|
|
47
|
+
cta: "See the brain",
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
...PLATFORM,
|
|
51
|
+
tag: "The product",
|
|
52
|
+
runs: "Ready to use",
|
|
53
|
+
adds: [
|
|
54
|
+
"Built on the same engine",
|
|
55
|
+
"Connected to your email, files, chat and calendar",
|
|
56
|
+
"Today, the Plate and Ask, with receipts",
|
|
57
|
+
"Each person sees only what they may read",
|
|
58
|
+
],
|
|
59
|
+
cta: "See Louvain",
|
|
60
|
+
},
|
|
61
|
+
];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type Open = "product" | "solutions" | "compare" | "resources" | "sheet" | null;
|
|
2
|
+
export type NavState = {
|
|
3
|
+
floating: boolean;
|
|
4
|
+
open: Open;
|
|
5
|
+
};
|
|
6
|
+
export type NavEvent = {
|
|
7
|
+
type: "scrolled";
|
|
8
|
+
atTop: boolean;
|
|
9
|
+
} | {
|
|
10
|
+
type: "toggle";
|
|
11
|
+
menu: Exclude<Open, null>;
|
|
12
|
+
} | {
|
|
13
|
+
type: "open";
|
|
14
|
+
menu: Exclude<Open, null | "sheet">;
|
|
15
|
+
} | {
|
|
16
|
+
type: "close";
|
|
17
|
+
menu?: Exclude<Open, null | "sheet">;
|
|
18
|
+
} | {
|
|
19
|
+
type: "navigated";
|
|
20
|
+
} | {
|
|
21
|
+
type: "wide";
|
|
22
|
+
};
|
|
23
|
+
export declare const initialNav: NavState;
|
|
24
|
+
export declare function navReducer(state: NavState, event: NavEvent): NavState;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export const initialNav = { floating: false, open: null };
|
|
2
|
+
export function navReducer(state, event) {
|
|
3
|
+
switch (event.type) {
|
|
4
|
+
case "scrolled":
|
|
5
|
+
return state.floating === !event.atTop ? state : { ...state, floating: !event.atTop };
|
|
6
|
+
case "toggle":
|
|
7
|
+
return { ...state, open: state.open === event.menu ? null : event.menu };
|
|
8
|
+
case "open":
|
|
9
|
+
return state.open === event.menu ? state : { ...state, open: event.menu };
|
|
10
|
+
case "close":
|
|
11
|
+
if (event.menu && state.open !== event.menu)
|
|
12
|
+
return state;
|
|
13
|
+
return state.open === null ? state : { ...state, open: null };
|
|
14
|
+
case "navigated":
|
|
15
|
+
return state.open === null ? state : { ...state, open: null };
|
|
16
|
+
case "wide":
|
|
17
|
+
return state.open === "sheet" ? { ...state, open: null } : state;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ButtonSize, type ButtonVariant } from "../button-class.js";
|
|
2
|
+
export declare function OpenOrDemo({ size, variant, arrow, onClick, children, }: {
|
|
3
|
+
size: ButtonSize;
|
|
4
|
+
variant?: Extract<ButtonVariant, "primary" | "brand">;
|
|
5
|
+
arrow?: boolean;
|
|
6
|
+
onClick?: (() => void) | undefined;
|
|
7
|
+
children?: string;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
9
|
+
export declare function BookDemo({ size, variant, onClick, origin, }: {
|
|
10
|
+
size: ButtonSize;
|
|
11
|
+
variant?: Extract<ButtonVariant, "secondary" | "brand-secondary">;
|
|
12
|
+
onClick?: (() => void) | undefined;
|
|
13
|
+
origin?: string | undefined;
|
|
14
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { buttonLook } from "../button-class.js";
|
|
3
|
+
import { Arrow } from "./icons.js";
|
|
4
|
+
import { siteHref } from "./page-link.js";
|
|
5
|
+
import { DEMO, OPEN_APP, TRIAL } from "./site-map.js";
|
|
6
|
+
export function OpenOrDemo({ size, variant = "primary", arrow = false, onClick, children = "Start free trial", }) {
|
|
7
|
+
const look = buttonLook(variant, size);
|
|
8
|
+
return (_jsxs(_Fragment, { children: [_jsxs("a", { ...look, href: OPEN_APP, onClick: onClick, "data-auth-when": "in", children: ["Open Louvain ", arrow ? _jsx(Arrow, {}) : null] }), _jsxs("a", { ...look, href: TRIAL, onClick: onClick, "data-auth-when": "out", children: [children, " ", arrow ? _jsx(Arrow, {}) : null] })] }));
|
|
9
|
+
}
|
|
10
|
+
export function BookDemo({ size, variant = "secondary", onClick, origin, }) {
|
|
11
|
+
return (_jsx("a", { ...buttonLook(variant, size), href: siteHref(DEMO, origin), onClick: onClick, "data-auth-when": "out", children: "Book a demo" }));
|
|
12
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ComponentType, KeyboardEventHandler, MouseEventHandler, ReactNode } from "react";
|
|
2
|
+
export type LinkProps = {
|
|
3
|
+
href: string;
|
|
4
|
+
className?: string | undefined;
|
|
5
|
+
"aria-current"?: "page" | "true" | undefined;
|
|
6
|
+
onClick?: MouseEventHandler<HTMLAnchorElement>;
|
|
7
|
+
onKeyDown?: KeyboardEventHandler<HTMLAnchorElement>;
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
"data-size"?: string | undefined;
|
|
10
|
+
"data-auth-when"?: "in" | "out" | undefined;
|
|
11
|
+
};
|
|
12
|
+
export type LinkComponent = ComponentType<LinkProps>;
|
|
13
|
+
export type ChromeLinks = {
|
|
14
|
+
origin?: string | undefined;
|
|
15
|
+
link?: LinkComponent | undefined;
|
|
16
|
+
};
|
|
17
|
+
export declare const siteHref: (href: string, origin?: string) => string;
|
|
18
|
+
export declare function PageLink({ origin, link: Link, href, ...props }: LinkProps & ChromeLinks): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { isFullLoad } from "./site-map.js";
|
|
3
|
+
export const siteHref = (href, origin) => origin && href.startsWith("/") ? `${origin.replace(/\/$/, "")}${href}` : href;
|
|
4
|
+
export function PageLink({ origin, link: Link, href, ...props }) {
|
|
5
|
+
if (origin || !Link || isFullLoad(href))
|
|
6
|
+
return _jsx("a", { ...props, href: siteHref(href, origin) });
|
|
7
|
+
return _jsx(Link, { ...props, href: href });
|
|
8
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useRef, useState } from "react";
|
|
4
|
+
const SMALL = new Set([
|
|
5
|
+
"a",
|
|
6
|
+
"an",
|
|
7
|
+
"and",
|
|
8
|
+
"as",
|
|
9
|
+
"at",
|
|
10
|
+
"but",
|
|
11
|
+
"by",
|
|
12
|
+
"for",
|
|
13
|
+
"in",
|
|
14
|
+
"of",
|
|
15
|
+
"on",
|
|
16
|
+
"or",
|
|
17
|
+
"the",
|
|
18
|
+
"to",
|
|
19
|
+
"vs",
|
|
20
|
+
"with",
|
|
21
|
+
]);
|
|
22
|
+
export function titleCase(text) {
|
|
23
|
+
return text
|
|
24
|
+
.split(" ")
|
|
25
|
+
.map((w, i) => i > 1 && SMALL.has(w.toLowerCase())
|
|
26
|
+
? w.toLowerCase()
|
|
27
|
+
: w.charAt(0).toUpperCase() + w.slice(1))
|
|
28
|
+
.join(" ");
|
|
29
|
+
}
|
|
30
|
+
function entries() {
|
|
31
|
+
const main = document.querySelector("main");
|
|
32
|
+
if (!main)
|
|
33
|
+
return [];
|
|
34
|
+
const found = [];
|
|
35
|
+
for (const section of main.querySelectorAll("section")) {
|
|
36
|
+
const named = section.dataset.rail;
|
|
37
|
+
const eyebrow = section.querySelector(".eyebrow");
|
|
38
|
+
const number = eyebrow?.querySelector("b")?.textContent?.trim() ?? "";
|
|
39
|
+
if (!named && !/^\d+$/.test(number))
|
|
40
|
+
continue;
|
|
41
|
+
const heading = section.querySelector("h1, h2");
|
|
42
|
+
const anchor = section.id ? section : heading?.id ? heading : null;
|
|
43
|
+
if (!anchor)
|
|
44
|
+
continue;
|
|
45
|
+
const rest = (eyebrow?.textContent ?? "").replace(number, "").trim();
|
|
46
|
+
const name = rest || heading?.textContent?.trim() || "";
|
|
47
|
+
found.push({ id: anchor.id, label: named ?? titleCase(`${number} ${name}`), el: section });
|
|
48
|
+
}
|
|
49
|
+
return found;
|
|
50
|
+
}
|
|
51
|
+
export function PageRail({ pathname, } = {}) {
|
|
52
|
+
const [items, setItems] = useState([]);
|
|
53
|
+
const [current, setCurrent] = useState(null);
|
|
54
|
+
const menu = useRef(null);
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
const found = entries();
|
|
57
|
+
setItems(found.length >= 3 ? found : []);
|
|
58
|
+
setCurrent(null);
|
|
59
|
+
if (found.length < 3 || typeof IntersectionObserver === "undefined")
|
|
60
|
+
return;
|
|
61
|
+
const io = new IntersectionObserver((seen) => {
|
|
62
|
+
for (const e of seen) {
|
|
63
|
+
if (!e.isIntersecting)
|
|
64
|
+
continue;
|
|
65
|
+
const hit = found.find((f) => f.el === e.target);
|
|
66
|
+
if (hit)
|
|
67
|
+
setCurrent(hit.id);
|
|
68
|
+
}
|
|
69
|
+
}, { rootMargin: "-45% 0px -50% 0px" });
|
|
70
|
+
for (const f of found)
|
|
71
|
+
io.observe(f.el);
|
|
72
|
+
return () => io.disconnect();
|
|
73
|
+
}, [pathname]);
|
|
74
|
+
if (!items.length)
|
|
75
|
+
return null;
|
|
76
|
+
const here = items.find((s) => s.id === current);
|
|
77
|
+
return (_jsxs(_Fragment, { children: [_jsx("nav", { className: "rail", "aria-label": "Sections", children: items.map((s) => (_jsx("a", { href: `#${s.id}`, "aria-current": current === s.id ? "true" : undefined, children: s.label }, s.id))) }), _jsxs("details", { className: "rail-mini", "data-shown": here && here !== items[0] ? "" : undefined, ref: menu, children: [_jsxs("summary", { children: [_jsx("span", { className: "rail-mini-label", children: "On this page" }), _jsx("span", { className: "rail-mini-here", children: here?.label ?? items[0]?.label })] }), _jsx("nav", { "aria-label": "Sections", children: items.map((s) => (_jsx("a", { href: `#${s.id}`, "aria-current": current === s.id ? "true" : undefined, onClick: () => menu.current?.removeAttribute("open"), children: s.label }, s.id))) })] })] }));
|
|
78
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
export function Reveal({ pathname, } = {}) {
|
|
4
|
+
useEffect(() => {
|
|
5
|
+
if (!window.matchMedia("(prefers-reduced-motion: no-preference)").matches)
|
|
6
|
+
return;
|
|
7
|
+
if (typeof IntersectionObserver === "undefined")
|
|
8
|
+
return;
|
|
9
|
+
const root = document.documentElement;
|
|
10
|
+
const pending = [...document.querySelectorAll("[data-reveal]:not([data-shown])")];
|
|
11
|
+
const fold = window.innerHeight;
|
|
12
|
+
for (const el of pending)
|
|
13
|
+
if (el.getBoundingClientRect().top < fold)
|
|
14
|
+
el.dataset.shown = "";
|
|
15
|
+
root.dataset.motion = "";
|
|
16
|
+
const io = new IntersectionObserver((entries) => {
|
|
17
|
+
for (const e of entries) {
|
|
18
|
+
if (!e.isIntersecting)
|
|
19
|
+
continue;
|
|
20
|
+
e.target.dataset.shown = "";
|
|
21
|
+
io.unobserve(e.target);
|
|
22
|
+
}
|
|
23
|
+
}, { threshold: 0 });
|
|
24
|
+
for (const el of pending)
|
|
25
|
+
if (!("shown" in el.dataset))
|
|
26
|
+
io.observe(el);
|
|
27
|
+
return () => io.disconnect();
|
|
28
|
+
}, [pathname]);
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
const W = 2400;
|
|
3
|
+
const H = 1400;
|
|
4
|
+
const TONES = [
|
|
5
|
+
"color-mix(in srgb, var(--p-primary) 38%, var(--p-deep))",
|
|
6
|
+
"color-mix(in srgb, var(--p-primary) 62%, var(--p-deep))",
|
|
7
|
+
"color-mix(in srgb, var(--p-primary) 88%, var(--p-deep))",
|
|
8
|
+
"color-mix(in srgb, var(--p-primary) 60%, white)",
|
|
9
|
+
"color-mix(in srgb, var(--p-primary) 22%, white)",
|
|
10
|
+
"var(--action-brand)",
|
|
11
|
+
"color-mix(in srgb, var(--p-primary) 88%, var(--p-deep))",
|
|
12
|
+
"color-mix(in srgb, var(--p-primary) 62%, var(--p-deep))",
|
|
13
|
+
"color-mix(in srgb, var(--p-primary) 38%, var(--p-deep))",
|
|
14
|
+
];
|
|
15
|
+
function y(x, i) {
|
|
16
|
+
const t = x / W;
|
|
17
|
+
const base = H * (1.02 - 0.78 * t) + 260 * Math.sin(t * Math.PI * 1.25 + 0.4);
|
|
18
|
+
const spread = 46 + 150 * Math.sin(t * Math.PI * 1.1 + 0.2) ** 2;
|
|
19
|
+
return base + (i - TONES.length / 2) * spread * 0.55;
|
|
20
|
+
}
|
|
21
|
+
const XS = [];
|
|
22
|
+
for (let x = -20; x <= W + 40; x += 24)
|
|
23
|
+
XS.push(x);
|
|
24
|
+
function band(i) {
|
|
25
|
+
const top = XS.map((x) => `${x},${Math.round(y(x, i))}`);
|
|
26
|
+
const bottom = [...XS].reverse().map((x) => `${x},${Math.round(y(x, i + 1))}`);
|
|
27
|
+
return `M${top.join("L")}L${bottom.join("L")}Z`;
|
|
28
|
+
}
|
|
29
|
+
const BANDS = TONES.map((_, i) => band(i));
|
|
30
|
+
export function Ribbon({ variant = "panel", }) {
|
|
31
|
+
return (_jsxs("svg", { className: `ribbon ribbon--${variant}`, viewBox: `0 0 ${W} ${H}`, preserveAspectRatio: "xMidYMid slice", "aria-hidden": "true", focusable: "false", children: [_jsx("rect", { width: W, height: H, style: { fill: "var(--field)" } }), _jsx("g", { className: "ribbon-drift", children: BANDS.map((d, i) => (_jsx("path", { className: "ribbon-band", d: d, style: { fill: TONES[i], "--i": i } }, i))) })] }));
|
|
32
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type LinkComponent } from "./page-link.js";
|
|
3
|
+
import { type FeaturedPost } from "./site-map.js";
|
|
4
|
+
export type SiteHeaderProps = {
|
|
5
|
+
featured?: FeaturedPost | null;
|
|
6
|
+
stars?: ReactNode;
|
|
7
|
+
origin?: string | undefined;
|
|
8
|
+
link?: LinkComponent | undefined;
|
|
9
|
+
auth?: "cookie-hint" | "none";
|
|
10
|
+
themeStorage?: string | undefined;
|
|
11
|
+
pathname?: string | null | undefined;
|
|
12
|
+
score?: number | null;
|
|
13
|
+
};
|
|
14
|
+
export declare function SiteHeader({ featured, stars, origin, link, auth, themeStorage, pathname: path, score, }: SiteHeaderProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useContext, useEffect, useReducer, useRef } from "react";
|
|
4
|
+
import { Lockup } from "../logo.js";
|
|
5
|
+
import { ChromeContext, Link } from "./header-context.js";
|
|
6
|
+
import { MenuItem } from "./header-menu.js";
|
|
7
|
+
import { Sheet } from "./header-sheet.js";
|
|
8
|
+
import { initialNav, navReducer } from "./nav-machine.js";
|
|
9
|
+
import { OpenOrDemo } from "./open-or-demo.js";
|
|
10
|
+
import { siteHref } from "./page-link.js";
|
|
11
|
+
import { DEMO, HEADER_LINKS, HEADER_MENUS, MENUS, OPEN_APP, SIGN_IN, } from "./site-map.js";
|
|
12
|
+
const WIDE = "(min-width: 1061px)";
|
|
13
|
+
export function SiteHeader({ featured = null, stars = null, origin, link, auth = "cookie-hint", themeStorage, pathname: path, score = null, }) {
|
|
14
|
+
const pathname = path ?? "";
|
|
15
|
+
const { state, send, header, sentinel } = useHeader(pathname);
|
|
16
|
+
return (_jsxs(ChromeContext.Provider, { value: { origin, link, auth, themeStorage, score }, children: [_jsx("span", { className: "top-sentinel", ref: sentinel, "aria-hidden": "true" }), _jsx("a", { className: "skip", href: "#main", children: "Skip to content" }), _jsxs("header", { className: "site-header", ref: header, "data-floating": state.floating || undefined, "data-open": state.open ?? undefined, children: [_jsx("span", { className: "site-header-pill", "aria-hidden": "true" }), _jsxs("div", { className: "site-header-row", children: [_jsx(Link, { className: "logo", href: "/", children: _jsx(Lockup, { height: 26, title: "Louvain home" }) }), _jsx("nav", { className: "menu", "aria-label": "Main", children: _jsxs("ul", { children: [HEADER_MENUS(MENUS, featured).map((menu) => (_jsx(MenuItem, { menu: menu, state: state, send: send }, menu.id))), HEADER_LINKS().map((link) => (_jsx("li", { children: _jsx(Link, { className: "top", href: link.href, "aria-current": pathname === link.href || pathname.startsWith(`${link.href}/`)
|
|
17
|
+
? "page"
|
|
18
|
+
: undefined, children: link.name }) }, link.href)))] }) }), _jsx(Actions, { stars: stars, open: state.open, onBurger: () => send({ type: "toggle", menu: "sheet" }) })] }), state.open === "sheet" && _jsx(Sheet, { onClose: () => send({ type: "close" }) })] }), _jsx("div", { className: "site-scrim", "aria-hidden": "true", "data-on": (state.open && state.open !== "sheet") || undefined }), _jsx("div", { className: "site-header-space", "aria-hidden": "true" })] }));
|
|
19
|
+
}
|
|
20
|
+
function useHeader(pathname) {
|
|
21
|
+
const [state, send] = useReducer(navReducer, initialNav);
|
|
22
|
+
const header = useRef(null);
|
|
23
|
+
const sentinel = useRef(null);
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
const el = sentinel.current;
|
|
26
|
+
if (!el || typeof IntersectionObserver === "undefined")
|
|
27
|
+
return;
|
|
28
|
+
const seen = new IntersectionObserver(([entry]) => send({ type: "scrolled", atTop: Boolean(entry?.isIntersecting) }));
|
|
29
|
+
seen.observe(el);
|
|
30
|
+
return () => seen.disconnect();
|
|
31
|
+
}, []);
|
|
32
|
+
useEffect(() => send({ type: "navigated" }), [pathname]);
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
const wide = window.matchMedia(WIDE);
|
|
35
|
+
const onChange = () => wide.matches && send({ type: "wide" });
|
|
36
|
+
wide.addEventListener("change", onChange);
|
|
37
|
+
return () => wide.removeEventListener("change", onChange);
|
|
38
|
+
}, []);
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (!state.open)
|
|
41
|
+
return;
|
|
42
|
+
const press = (event) => {
|
|
43
|
+
if (!header.current?.contains(event.target))
|
|
44
|
+
send({ type: "close" });
|
|
45
|
+
};
|
|
46
|
+
const key = (event) => {
|
|
47
|
+
if (event.key !== "Escape")
|
|
48
|
+
return;
|
|
49
|
+
const trigger = header.current?.querySelector(`[data-opens="${state.open}"]`);
|
|
50
|
+
send({ type: "close" });
|
|
51
|
+
trigger?.focus();
|
|
52
|
+
};
|
|
53
|
+
document.addEventListener("pointerdown", press);
|
|
54
|
+
document.addEventListener("keydown", key);
|
|
55
|
+
return () => {
|
|
56
|
+
document.removeEventListener("pointerdown", press);
|
|
57
|
+
document.removeEventListener("keydown", key);
|
|
58
|
+
};
|
|
59
|
+
}, [state.open]);
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
if (state.open !== "sheet")
|
|
62
|
+
return;
|
|
63
|
+
const root = document.documentElement;
|
|
64
|
+
root.dataset.sheet = "open";
|
|
65
|
+
return () => {
|
|
66
|
+
delete root.dataset.sheet;
|
|
67
|
+
};
|
|
68
|
+
}, [state.open]);
|
|
69
|
+
return { state, send, header, sentinel };
|
|
70
|
+
}
|
|
71
|
+
function Actions({ stars, open, onBurger, }) {
|
|
72
|
+
const { origin, auth } = useContext(ChromeContext);
|
|
73
|
+
return (_jsxs("div", { className: "r", children: [stars, _jsx("a", { className: "top signin", href: siteHref(DEMO, origin), "data-auth-when": "out", children: "Book a demo" }), auth === "none" ? (_jsx("a", { className: "top signin", href: OPEN_APP, children: "Sign in" })) : (_jsx("a", { className: "top signin", href: SIGN_IN, "data-auth-when": "out", children: "Sign in" })), _jsx(OpenOrDemo, { size: "sm" }), _jsx("button", { className: "burger", type: "button", "data-opens": "sheet", "aria-expanded": open === "sheet", "aria-controls": "site-sheet", "aria-label": open === "sheet" ? "Close menu" : "Menu", onClick: onBurger, children: _jsx("svg", { width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", "aria-hidden": "true", children: open === "sheet" ? (_jsx("path", { d: "M4 4l10 10M14 4L4 14", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })) : (_jsx("path", { d: "M2.5 5h13M2.5 9h13M2.5 13h13", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })) }) })] }));
|
|
74
|
+
}
|