@the-docs/core 0.0.1-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/dist/build/discovery.d.ts +22 -0
  2. package/dist/build/discovery.d.ts.map +1 -0
  3. package/dist/build/discovery.js +107 -0
  4. package/dist/build/discovery.js.map +1 -0
  5. package/dist/build/index.d.ts +5 -0
  6. package/dist/build/index.d.ts.map +1 -0
  7. package/dist/build/index.js +4 -0
  8. package/dist/build/index.js.map +1 -0
  9. package/dist/build/prerender.d.ts +3 -0
  10. package/dist/build/prerender.d.ts.map +1 -0
  11. package/dist/build/prerender.js +9 -0
  12. package/dist/build/prerender.js.map +1 -0
  13. package/dist/build/routes.d.ts +3 -0
  14. package/dist/build/routes.d.ts.map +1 -0
  15. package/dist/build/routes.js +17 -0
  16. package/dist/build/routes.js.map +1 -0
  17. package/dist/build/vite.d.ts +9 -0
  18. package/dist/build/vite.d.ts.map +1 -0
  19. package/dist/build/vite.js +258 -0
  20. package/dist/build/vite.js.map +1 -0
  21. package/dist/components/docs-page-layout.d.ts +5 -0
  22. package/dist/components/docs-page-layout.d.ts.map +1 -0
  23. package/dist/components/docs-page-layout.js +8 -0
  24. package/dist/components/docs-page-layout.js.map +1 -0
  25. package/dist/components/docs-search-input.d.ts +11 -0
  26. package/dist/components/docs-search-input.d.ts.map +1 -0
  27. package/dist/components/docs-search-input.js +10 -0
  28. package/dist/components/docs-search-input.js.map +1 -0
  29. package/dist/components/document-list-facet.d.ts +11 -0
  30. package/dist/components/document-list-facet.d.ts.map +1 -0
  31. package/dist/components/document-list-facet.js +94 -0
  32. package/dist/components/document-list-facet.js.map +1 -0
  33. package/dist/components/document-list-page.d.ts +7 -0
  34. package/dist/components/document-list-page.d.ts.map +1 -0
  35. package/dist/components/document-list-page.js +154 -0
  36. package/dist/components/document-list-page.js.map +1 -0
  37. package/dist/components/document-page.d.ts +14 -0
  38. package/dist/components/document-page.d.ts.map +1 -0
  39. package/dist/components/document-page.js +131 -0
  40. package/dist/components/document-page.js.map +1 -0
  41. package/dist/components/global-search.d.ts +9 -0
  42. package/dist/components/global-search.d.ts.map +1 -0
  43. package/dist/components/global-search.js +171 -0
  44. package/dist/components/global-search.js.map +1 -0
  45. package/dist/components/home-page.d.ts +9 -0
  46. package/dist/components/home-page.d.ts.map +1 -0
  47. package/dist/components/home-page.js +47 -0
  48. package/dist/components/home-page.js.map +1 -0
  49. package/dist/components/importance.d.ts +5 -0
  50. package/dist/components/importance.d.ts.map +1 -0
  51. package/dist/components/importance.js +33 -0
  52. package/dist/components/importance.js.map +1 -0
  53. package/dist/components/related-documents.d.ts +6 -0
  54. package/dist/components/related-documents.d.ts.map +1 -0
  55. package/dist/components/related-documents.js +30 -0
  56. package/dist/components/related-documents.js.map +1 -0
  57. package/dist/components/relative-modified-time.d.ts +5 -0
  58. package/dist/components/relative-modified-time.d.ts.map +1 -0
  59. package/dist/components/relative-modified-time.js +61 -0
  60. package/dist/components/relative-modified-time.js.map +1 -0
  61. package/dist/components/scope-icon.d.ts +7 -0
  62. package/dist/components/scope-icon.d.ts.map +1 -0
  63. package/dist/components/scope-icon.js +9 -0
  64. package/dist/components/scope-icon.js.map +1 -0
  65. package/dist/components/scopes-page.d.ts +9 -0
  66. package/dist/components/scopes-page.d.ts.map +1 -0
  67. package/dist/components/scopes-page.js +40 -0
  68. package/dist/components/scopes-page.js.map +1 -0
  69. package/dist/components/table-of-contents.d.ts +8 -0
  70. package/dist/components/table-of-contents.d.ts.map +1 -0
  71. package/dist/components/table-of-contents.js +62 -0
  72. package/dist/components/table-of-contents.js.map +1 -0
  73. package/dist/components/tags-page.d.ts +7 -0
  74. package/dist/components/tags-page.d.ts.map +1 -0
  75. package/dist/components/tags-page.js +152 -0
  76. package/dist/components/tags-page.js.map +1 -0
  77. package/dist/content/registry.d.ts +12 -0
  78. package/dist/content/registry.d.ts.map +1 -0
  79. package/dist/content/registry.js +264 -0
  80. package/dist/content/registry.js.map +1 -0
  81. package/dist/content/table-of-contents.d.ts +18 -0
  82. package/dist/content/table-of-contents.d.ts.map +1 -0
  83. package/dist/content/table-of-contents.js +82 -0
  84. package/dist/content/table-of-contents.js.map +1 -0
  85. package/dist/content/types.d.ts +95 -0
  86. package/dist/content/types.d.ts.map +1 -0
  87. package/dist/content/types.js +2 -0
  88. package/dist/content/types.js.map +1 -0
  89. package/dist/index.d.ts +13 -0
  90. package/dist/index.d.ts.map +1 -0
  91. package/dist/index.js +11 -0
  92. package/dist/index.js.map +1 -0
  93. package/dist/route/docs-post.d.ts +11 -0
  94. package/dist/route/docs-post.d.ts.map +1 -0
  95. package/dist/route/docs-post.js +64 -0
  96. package/dist/route/docs-post.js.map +1 -0
  97. package/dist/search/document-search.d.ts +17 -0
  98. package/dist/search/document-search.d.ts.map +1 -0
  99. package/dist/search/document-search.js +92 -0
  100. package/dist/search/document-search.js.map +1 -0
  101. package/dist/virtual-docs-content.d.ts +16 -0
  102. package/package.json +48 -0
@@ -0,0 +1,171 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Dialog } from "@base-ui/react/dialog";
3
+ import Fuse from "fuse.js";
4
+ import { ArrowDown, ArrowUp, ArrowUpRight, CornerDownLeft, FileText, Layers3, Search, Tag, } from "lucide-react";
5
+ import { useEffect, useMemo, useRef, useState } from "react";
6
+ import { useNavigate } from "react-router";
7
+ const maximumResultCount = 12;
8
+ const resultListId = "global-search-results";
9
+ const resultKindLabels = {
10
+ document: "Document",
11
+ scope: "Scope",
12
+ tag: "Tag",
13
+ };
14
+ function tagHref(slug) {
15
+ const value = /\s/.test(slug) ? `"${slug}"` : slug;
16
+ return `/list?${new URLSearchParams({ q: `tag:${value}` }).toString()}`;
17
+ }
18
+ function createSearchResults(documents, scopes, tags) {
19
+ const documentResults = [...documents]
20
+ .sort((left, right) => right.modifiedAt - left.modifiedAt)
21
+ .map((document) => ({
22
+ id: `document:${document.slug}`,
23
+ kind: "document",
24
+ title: document.frontmatter.title,
25
+ description: document.frontmatter.description ||
26
+ document.frontmatter.tags.join(" · "),
27
+ keywords: [
28
+ document.searchText,
29
+ ...document.frontmatter.tags,
30
+ ...document.scopeSlugs,
31
+ ].join(" "),
32
+ href: `/p/${document.slug}`,
33
+ }));
34
+ const scopeResults = scopes.map((scope) => {
35
+ const documentCount = documents.filter((document) => document.scopeSlugs.includes(scope.slug)).length;
36
+ return {
37
+ id: `scope:${scope.slug}`,
38
+ kind: "scope",
39
+ title: scope.title,
40
+ description: scope.description ||
41
+ `${documentCount} ${documentCount === 1 ? "document" : "documents"}`,
42
+ keywords: scope.sections
43
+ .flatMap((section) => [
44
+ section.title,
45
+ section.description ?? "",
46
+ ...section.documents.map(({ slug }) => slug),
47
+ ...section.groups.flatMap((group) => [
48
+ group.title ?? "",
49
+ group.description ?? "",
50
+ ...(group.document ? [group.document.slug] : []),
51
+ ...group.documents.map(({ slug }) => slug),
52
+ ]),
53
+ ])
54
+ .join(" "),
55
+ href: `/scopes/${scope.slug}`,
56
+ };
57
+ });
58
+ const tagResults = tags.map((tag) => {
59
+ const documentCount = documents.filter((document) => document.frontmatter.tags.includes(tag.slug)).length;
60
+ return {
61
+ id: `tag:${tag.slug}`,
62
+ kind: "tag",
63
+ title: tag.title,
64
+ description: tag.description ||
65
+ `${documentCount} ${documentCount === 1 ? "document" : "documents"}`,
66
+ keywords: [tag.slug, tag.parentSlug ?? ""].join(" "),
67
+ href: tagHref(tag.slug),
68
+ };
69
+ });
70
+ return [...documentResults, ...scopeResults, ...tagResults];
71
+ }
72
+ function defaultSearchResults(results) {
73
+ const limits = {
74
+ document: 5,
75
+ scope: 3,
76
+ tag: 4,
77
+ };
78
+ const selected = results.filter((result, index) => {
79
+ const sameKindBefore = results
80
+ .slice(0, index)
81
+ .filter(({ kind }) => kind === result.kind).length;
82
+ return sameKindBefore < limits[result.kind];
83
+ });
84
+ if (selected.length >= maximumResultCount) {
85
+ return selected.slice(0, maximumResultCount);
86
+ }
87
+ const selectedIds = new Set(selected.map(({ id }) => id));
88
+ return [
89
+ ...selected,
90
+ ...results.filter(({ id }) => !selectedIds.has(id)),
91
+ ].slice(0, maximumResultCount);
92
+ }
93
+ function ResultIcon({ kind }) {
94
+ const Icon = kind === "document" ? FileText : kind === "scope" ? Layers3 : Tag;
95
+ return _jsx(Icon, { className: "size-4", "aria-hidden": "true" });
96
+ }
97
+ export function GlobalSearch({ open, onOpenChange, documents, scopes, tags, }) {
98
+ const navigate = useNavigate();
99
+ const listRef = useRef(null);
100
+ const [query, setQuery] = useState("");
101
+ const [selectedIndex, setSelectedIndex] = useState(0);
102
+ const searchResults = useMemo(() => createSearchResults(documents, scopes, tags), [documents, scopes, tags]);
103
+ const searchIndex = useMemo(() => new Fuse(searchResults, {
104
+ ignoreLocation: true,
105
+ minMatchCharLength: 1,
106
+ threshold: 0.35,
107
+ keys: [
108
+ { name: "title", weight: 0.55 },
109
+ { name: "description", weight: 0.2 },
110
+ { name: "keywords", weight: 0.25 },
111
+ ],
112
+ }), [searchResults]);
113
+ const visibleResults = useMemo(() => {
114
+ const normalizedQuery = query.trim();
115
+ if (!normalizedQuery)
116
+ return defaultSearchResults(searchResults);
117
+ return searchIndex
118
+ .search(normalizedQuery)
119
+ .map(({ item }) => item)
120
+ .slice(0, maximumResultCount);
121
+ }, [query, searchIndex, searchResults]);
122
+ useEffect(() => {
123
+ setSelectedIndex(0);
124
+ }, [query]);
125
+ useEffect(() => {
126
+ const selectedResult = listRef.current?.querySelector('[data-selected="true"]');
127
+ selectedResult?.scrollIntoView({ block: "nearest" });
128
+ }, [selectedIndex]);
129
+ function close() {
130
+ onOpenChange(false);
131
+ setQuery("");
132
+ setSelectedIndex(0);
133
+ }
134
+ function openResult(result) {
135
+ close();
136
+ navigate(result.href);
137
+ }
138
+ function handleOpenChange(nextOpen) {
139
+ onOpenChange(nextOpen);
140
+ if (!nextOpen) {
141
+ setQuery("");
142
+ setSelectedIndex(0);
143
+ }
144
+ }
145
+ function handleKeyDown(event) {
146
+ if (!visibleResults.length)
147
+ return;
148
+ if (event.key === "ArrowDown") {
149
+ event.preventDefault();
150
+ setSelectedIndex((index) => (index + 1) % visibleResults.length);
151
+ return;
152
+ }
153
+ if (event.key === "ArrowUp") {
154
+ event.preventDefault();
155
+ setSelectedIndex((index) => (index - 1 + visibleResults.length) % visibleResults.length);
156
+ return;
157
+ }
158
+ if (event.key === "Enter") {
159
+ event.preventDefault();
160
+ const selectedResult = visibleResults[selectedIndex];
161
+ if (selectedResult)
162
+ openResult(selectedResult);
163
+ }
164
+ }
165
+ const activeResult = visibleResults[selectedIndex];
166
+ return (_jsx(Dialog.Root, { open: open, onOpenChange: handleOpenChange, children: _jsxs(Dialog.Portal, { children: [_jsx(Dialog.Backdrop, { className: "fixed inset-0 z-50 min-h-dvh bg-black/55 supports-[-webkit-touch-callout:none]:absolute" }), _jsxs(Dialog.Popup, { className: "fixed top-[max(1rem,10svh)] left-1/2 z-50 flex max-h-[min(42rem,calc(100dvh-2rem))] w-[calc(100vw-2rem)] max-w-2xl -translate-x-1/2 flex-col overflow-hidden rounded-2xl border bg-popover text-popover-foreground shadow-2xl outline-none", children: [_jsx(Dialog.Title, { className: "sr-only", children: "Search all documentation" }), _jsx(Dialog.Description, { className: "sr-only", children: "Search documents, tags, and scopes. Use the arrow keys to navigate results." }), _jsxs("div", { className: "flex h-16 shrink-0 items-center gap-3 border-b px-5", children: [_jsx(Search, { className: "size-5 shrink-0 text-muted-foreground", "aria-hidden": "true" }), _jsx("input", { autoFocus: true, type: "search", value: query, onChange: (event) => setQuery(event.target.value), onKeyDown: handleKeyDown, placeholder: "Search documents, tags, and scopes...", className: "h-full min-w-0 flex-1 bg-transparent text-base outline-none placeholder:text-muted-foreground", role: "combobox", "aria-autocomplete": "list", "aria-controls": resultListId, "aria-expanded": "true", "aria-activedescendant": activeResult ? `global-search-${activeResult.id}` : undefined }), _jsx("kbd", { className: "rounded-md border bg-muted px-2 py-1 font-sans text-[0.7rem] text-muted-foreground", children: "Esc" })] }), _jsx("div", { ref: listRef, id: resultListId, role: "listbox", "aria-label": "Search results", className: "min-h-0 flex-1 overflow-y-auto p-2", children: visibleResults.length ? (visibleResults.map((result, index) => {
167
+ const selected = index === selectedIndex;
168
+ return (_jsxs("button", { id: `global-search-${result.id}`, type: "button", role: "option", "aria-selected": selected, "data-selected": selected, onMouseMove: () => setSelectedIndex(index), onClick: () => openResult(result), className: "group flex w-full items-center gap-3 rounded-xl px-3 py-3 text-left outline-none hover:bg-muted focus-visible:ring-2 focus-visible:ring-grey-9/40 data-[selected=true]:bg-muted", children: [_jsx("span", { className: "flex size-10 shrink-0 items-center justify-center rounded-lg border bg-background text-muted-foreground group-data-[selected=true]:border-grey-8 group-data-[selected=true]:text-foreground", children: _jsx(ResultIcon, { kind: result.kind }) }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsxs("span", { className: "flex items-center gap-2", children: [_jsx("span", { className: "truncate font-medium", children: result.title }), _jsx("span", { className: "shrink-0 text-[0.65rem] font-semibold tracking-wide text-muted-foreground uppercase", children: resultKindLabels[result.kind] })] }), result.description ? (_jsx("span", { className: "mt-0.5 line-clamp-1 block text-sm text-muted-foreground", children: result.description })) : null] }), _jsx(ArrowUpRight, { className: "size-4 shrink-0 text-muted-foreground opacity-0 group-hover:opacity-100 group-data-[selected=true]:opacity-100", "aria-hidden": "true" })] }, result.id));
169
+ })) : (_jsxs("div", { className: "flex min-h-48 flex-col items-center justify-center px-6 text-center", children: [_jsx(Search, { className: "size-8 text-muted-foreground/60", "aria-hidden": "true" }), _jsx("p", { className: "mt-4 font-medium", children: "No results found" }), _jsx("p", { className: "mt-1 text-sm text-muted-foreground", children: "Try a document title, tag, or scope." })] })) }), _jsxs("div", { className: "hidden min-h-12 shrink-0 items-center gap-5 border-t bg-grey-2 px-5 text-xs text-muted-foreground sm:flex", children: [_jsxs("span", { className: "inline-flex items-center gap-1.5", children: [_jsxs("kbd", { className: "inline-flex gap-0.5 rounded border bg-background p-1", children: [_jsx(ArrowUp, { className: "size-3", "aria-hidden": "true" }), _jsx(ArrowDown, { className: "size-3", "aria-hidden": "true" })] }), "Navigate"] }), _jsxs("span", { className: "inline-flex items-center gap-1.5", children: [_jsx("kbd", { className: "rounded border bg-background p-1", children: _jsx(CornerDownLeft, { className: "size-3", "aria-hidden": "true" }) }), "Open"] }), _jsxs("span", { className: "ml-auto", children: [visibleResults.length, " results"] })] })] })] }) }));
170
+ }
171
+ //# sourceMappingURL=global-search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"global-search.js","sourceRoot":"","sources":["../../src/components/global-search.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAC9C,OAAO,IAAI,MAAM,SAAS,CAAA;AAC1B,OAAO,EACL,SAAS,EACT,OAAO,EACP,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,OAAO,EACP,MAAM,EACN,GAAG,GACJ,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAmB1C,MAAM,kBAAkB,GAAG,EAAE,CAAA;AAC7B,MAAM,YAAY,GAAG,uBAAuB,CAAA;AAE5C,MAAM,gBAAgB,GAAqC;IACzD,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,OAAO;IACd,GAAG,EAAE,KAAK;CACX,CAAA;AAED,SAAS,OAAO,CAAC,IAAY;IAC3B,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,CAAA;IAClD,OAAO,SAAS,IAAI,eAAe,CAAC,EAAE,CAAC,EAAE,OAAO,KAAK,EAAE,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAA;AACzE,CAAC;AAED,SAAS,mBAAmB,CA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opeDefinition, TagDefinition } from "../content/types.js";
2
+ export declare function HomePage({ documents, scopes, tags, title, description, }: {
3
+ documents: DocumentEntry[];
4
+ scopes: ScopeDefinition[];
5
+ tags: TagDefinition[];
6
+ title?: string;
7
+ description?: string;
8
+ }): import("react/jsx-runtime").JSX.Element;
9
+ //# sourceMappingURL=home-page.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"home-page.d.ts","sourceRoot":"","sources":["../../src/components/home-page.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,aAAa,EACb,eAAe,EACf,aAAa,EACd,MAAM,qBAAqB,CAAA;AAwB5B,wBAAgB,QAAQ,CAAC,EACvB,SAAS,EACT,MAAM,EACN,IAAI,EACJ,KAAkB,EAClB,WAAiF,GAClF,EAAE;IACD,SAAS,EAAE,aAAa,EAAE,CAAA;IAC1B,MAAM,EAAE,eAAe,EAAE,CAAA;IACzB,IAAI,EAAE,aAAa,EAAE,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,2CA+OA"}
@@ -0,0 +1,47 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import { ArrowRight, ArrowUpRight, Layers3, Tag } from "lucide-react";
4
+ import { Link, useNavigate } from "react-router";
5
+ import { DocsPageLayout } from "./docs-page-layout.js";
6
+ import { DocsSearchInput } from "./docs-search-input.js";
7
+ import { DocsShell } from "./document-page.js";
8
+ import { ScopeIcon } from "./scope-icon.js";
9
+ const latestDocumentCount = 3;
10
+ const featuredTagCount = 8;
11
+ function qualifierHref(qualifier, value) {
12
+ const serializedValue = /\s/.test(value) ? `"${value}"` : value;
13
+ const params = new URLSearchParams({ q: `${qualifier}:${serializedValue}` });
14
+ return `/list?${params.toString()}`;
15
+ }
16
+ function countDocumentsForTag(tag, documents) {
17
+ return documents.filter((document) => document.frontmatter.tags.some((documentTag) => documentTag === tag.slug || documentTag.startsWith(`${tag.slug}/`))).length;
18
+ }
19
+ export function HomePage({ documents, scopes, tags, title = "The Docs", description = "Find architecture notes, product decisions, and practical guides.", }) {
20
+ const navigate = useNavigate();
21
+ const [query, setQuery] = useState("");
22
+ const [searchOpen, setSearchOpen] = useState(false);
23
+ const latestDocuments = documents.slice(-latestDocumentCount).reverse();
24
+ const featuredTags = tags
25
+ .map((tag) => ({
26
+ ...tag,
27
+ documentCount: countDocumentsForTag(tag, documents),
28
+ }))
29
+ .sort((left, right) => right.documentCount - left.documentCount ||
30
+ left.title.localeCompare(right.title))
31
+ .slice(0, featuredTagCount);
32
+ function submitSearch() {
33
+ const trimmedQuery = query.trim();
34
+ if (!trimmedQuery) {
35
+ navigate("/list");
36
+ return;
37
+ }
38
+ navigate(`/list?${new URLSearchParams({ q: trimmedQuery }).toString()}`);
39
+ }
40
+ return (_jsx(DocsShell, { searchOpen: searchOpen, onSearchOpenChange: setSearchOpen, children: _jsxs(DocsPageLayout, { className: "py-10 sm:py-16", children: [_jsxs("section", { "aria-labelledby": "home-heading", children: [_jsx("p", { className: "text-sm font-medium text-primary", children: "Documentation" }), _jsx("h1", { id: "home-heading", className: "mt-3 text-4xl font-semibold tracking-tight text-balance sm:text-5xl", children: title }), _jsx("p", { className: "mt-4 max-w-2xl text-lg leading-8 text-muted-foreground", children: description }), _jsx("div", { className: "mt-8", children: _jsx(DocsSearchInput, { value: query, onValueChange: setQuery, onSubmit: submitSearch, onActivate: () => setSearchOpen(true), placeholder: "Search guides, topics, and tags" }) })] }), scopes.length ? (_jsxs("section", { className: "mt-16", "aria-labelledby": "scopes-heading", children: [_jsx("div", { className: "flex items-end justify-between gap-4", children: _jsxs("div", { children: [_jsx("p", { className: "text-sm font-medium text-primary", children: "Browse by" }), _jsx("h2", { id: "scopes-heading", className: "mt-1 text-2xl font-semibold tracking-tight", children: "Scope" })] }) }), _jsx("div", { className: "mt-5 grid gap-4 sm:grid-cols-2", children: scopes.map((scope) => {
41
+ const scopeDocuments = documents.filter((document) => document.scopeSlugs.includes(scope.slug));
42
+ return (_jsxs(Link, { to: `/scopes/${scope.slug}`, className: "group rounded-xl border bg-card p-5 shadow-xs transition hover:-translate-y-0.5 hover:border-primary/40 hover:shadow-md", children: [_jsxs("span", { className: "flex items-start justify-between gap-4", children: [_jsx("span", { className: "flex size-9 items-center justify-center rounded-lg bg-primary/10 text-primary", children: _jsx(ScopeIcon, { name: scope.icon, fallback: Layers3, className: "size-4" }) }), _jsx(ArrowUpRight, { className: "size-4 text-muted-foreground transition group-hover:text-primary", "aria-hidden": "true" })] }), _jsx("span", { className: "mt-5 block text-lg font-semibold group-hover:text-primary", children: scope.title }), _jsxs("span", { className: "mt-1 block text-sm leading-6 text-muted-foreground", children: [scopeDocuments.length, " ", scopeDocuments.length === 1 ? "document" : "documents", scope.description ? ` · ${scope.description}` : ""] })] }, scope.slug));
43
+ }) })] })) : null, _jsxs("section", { className: "mt-16", "aria-labelledby": "latest-heading", children: [_jsxs("div", { className: "flex items-end justify-between gap-4 border-b pb-4", children: [_jsxs("div", { children: [_jsx("p", { className: "text-sm font-medium text-primary", children: "What\u2019s new" }), _jsx("h2", { id: "latest-heading", className: "mt-1 text-2xl font-semibold tracking-tight", children: "Latest" })] }), _jsxs(Link, { to: "/list", className: "group inline-flex items-center gap-1.5 text-sm font-medium text-muted-foreground transition-colors hover:text-primary", children: ["View all", _jsx(ArrowRight, { className: "size-4 transition-transform group-hover:translate-x-0.5", "aria-hidden": "true" })] })] }), latestDocuments.length ? (_jsx("ul", { className: "divide-y", children: latestDocuments.map((document) => (_jsx("li", { children: _jsxs(Link, { to: `/p/${document.slug}`, className: "group grid gap-4 py-6 sm:grid-cols-[minmax(0,1fr)_auto]", children: [_jsxs("span", { className: "min-w-0", children: [_jsx("span", { className: "text-lg font-semibold transition-colors group-hover:text-primary", children: document.frontmatter.title }), document.frontmatter.description ? (_jsx("span", { className: "mt-1 block max-w-3xl text-sm leading-6 text-muted-foreground", children: document.frontmatter.description })) : null, document.frontmatter.tags.length ? (_jsx("span", { className: "mt-3 flex flex-wrap gap-2", children: document.frontmatter.tags.slice(0, 3).map((tag) => (_jsx("span", { className: "rounded-full border bg-muted/50 px-2.5 py-1 text-xs font-medium text-muted-foreground", children: tag }, tag))) })) : null] }), _jsx(ArrowUpRight, { className: "mt-1 hidden size-4 text-muted-foreground transition group-hover:text-primary sm:block", "aria-hidden": "true" })] }) }, document.slug))) })) : (_jsx("p", { className: "py-10 text-sm text-muted-foreground", children: "No documentation has been published yet." }))] }), featuredTags.length ? (_jsxs("section", { className: "mt-16", "aria-labelledby": "tags-heading", children: [_jsxs("div", { className: "flex items-end justify-between gap-4 border-b pb-4", children: [_jsxs("div", { children: [_jsx("p", { className: "text-sm font-medium text-primary", children: "Explore" }), _jsx("h2", { id: "tags-heading", className: "mt-1 text-2xl font-semibold tracking-tight", children: "Tags" })] }), _jsxs(Link, { to: "/tags/tree", className: "group inline-flex items-center gap-1.5 text-sm font-medium text-muted-foreground transition-colors hover:text-primary", children: ["View all tags", _jsx(ArrowRight, { className: "size-4 transition-transform group-hover:translate-x-0.5", "aria-hidden": "true" })] })] }), _jsx("ul", { className: "mt-2 grid gap-x-8 md:grid-cols-2", children: featuredTags.map((tag) => (_jsx("li", { className: "border-b", children: _jsxs(Link, { to: qualifierHref("tag", tag.slug), className: "group grid grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-3 py-5", children: [_jsx("span", { className: "mt-0.5 flex size-8 items-center justify-center rounded-lg border bg-background text-muted-foreground transition group-hover:border-primary/40 group-hover:text-primary", style: tag.color
44
+ ? { borderColor: tag.color, color: tag.color }
45
+ : undefined, children: _jsx(Tag, { className: "size-3.5", "aria-hidden": "true" }) }), _jsxs("span", { className: "min-w-0", children: [_jsx("span", { className: "font-semibold transition-colors group-hover:text-primary", children: tag.title }), tag.description ? (_jsx("span", { className: "mt-0.5 block text-sm leading-5 text-muted-foreground", children: tag.description })) : null] }), _jsxs("span", { className: "pt-1 text-sm text-muted-foreground tabular-nums", children: [tag.documentCount, _jsx("span", { className: "sr-only", children: tag.documentCount === 1 ? " document" : " documents" })] })] }) }, tag.slug))) })] })) : null] }) }));
46
+ }
47
+ //# sourceMappingURL=home-page.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"home-page.js","sourceRoot":"","sources":["../../src/components/home-page.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AACrE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAOhD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C,MAAM,mBAAmB,GAAG,CAAC,CAAA;AAC7B,MAAM,gBAAgB,GAAG,CAAC,CAAA;AAE1B,SAAS,aAAa,CAAC,SAA0B,EAAE,KAAa;IAC9D,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,KAAK,CAAA;IAC/D,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,EAAE,CAAC,EAAE,GAAG,SAAS,IAAI,eAAe,EAAE,EAAE,CAAC,CAAA;IAC5E,OAAO,SAAS,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAA;AACrC,CAAC;AAED,SAAS,oBAAoB,CAAC,GAAkB,EAAE,SAA0B;IAC1E,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CACnC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAC5B,CAAC,WAAW,EAAE,E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IACH,EAAE,EAAE,aAAa,CAAC,KAAK,EAAE,GAAG,CAAC,IAAI,CAAC,EAClC,SAAS,EAAC,uEAAuE,aAEjF,eACE,SAAS,EAAC,wKAAwK,EAClL,KAAK,EACH,GAAG,CAAC,KAAK;gDACP,CAAC,CAAC,EAAE,WAAW,EAAE,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE;gDAC9C,CAAC,CAAC,SAAS,YAGf,KAAC,GAAG,IAAC,SAAS,EAAC,UAAU,iBAAa,MAAM,GAAG,GAC1C,EACP,gBAAM,SAAS,EAAC,SAAS,aACvB,eAAM,SAAS,EAAC,0DAA0D,YACvE,GAAG,CAAC,KAAK,GACL,EACN,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CACjB,eAAM,SAAS,EAAC,sDAAsD,YACnE,GAAG,CAAC,WAAW,GACX,CACR,CAAC,CAAC,CAAC,IAAI,IACH,EACP,gBAAM,SAAS,EAAC,iDAAiD,aAC9D,GAAG,CAAC,aAAa,EAClB,eAAM,SAAS,EAAC,SAAS,YACtB,GAAG,CAAC,aAAa,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY,GAChD,IACF,IACF,IA/BA,GAAG,CAAC,IAAI,CAgCZ,CACN,CAAC,GACC,IACG,CACX,CAAC,CAAC,CAAC,IAAI,IACO,GACP,CACb,CAAA;AACH,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare function Importance({ value, className, }: {
2
+ value: string;
3
+ className?: string;
4
+ }): import("react/jsx-runtime").JSX.Element;
5
+ //# sourceMappingURL=importance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"importance.d.ts","sourceRoot":"","sources":["../../src/components/importance.tsx"],"names":[],"mappings":"AA0CA,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,SAAS,GACV,EAAE;IACD,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,2CAaA"}
@@ -0,0 +1,33 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { ChevronDown, ChevronUp, ChevronsDown, ChevronsUp, Equal, } from "lucide-react";
3
+ const importanceDetails = {
4
+ highest: {
5
+ icon: ChevronsUp,
6
+ colorClassName: "text-danger",
7
+ },
8
+ high: {
9
+ icon: ChevronUp,
10
+ colorClassName: "text-danger",
11
+ },
12
+ medium: {
13
+ icon: Equal,
14
+ colorClassName: "text-grey-11",
15
+ },
16
+ low: {
17
+ icon: ChevronDown,
18
+ colorClassName: "text-info",
19
+ },
20
+ lowest: {
21
+ icon: ChevronsDown,
22
+ colorClassName: "text-info",
23
+ },
24
+ };
25
+ const defaultImportanceDetails = {
26
+ icon: Equal,
27
+ colorClassName: "text-grey-11",
28
+ };
29
+ export function Importance({ value, className, }) {
30
+ const { icon: Icon, colorClassName } = importanceDetails[value.trim().toLowerCase()] ?? defaultImportanceDetails;
31
+ return (_jsx("span", { className: `inline-flex items-center ${colorClassName}${className ? ` ${className}` : ""}`, title: value, "aria-label": `${value} importance`, children: _jsx(Icon, { className: "size-4", strokeWidth: 2.25, "aria-hidden": "true" }) }));
32
+ }
33
+ //# sourceMappingURL=importance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"importance.js","sourceRoot":"","sources":["../../src/components/importance.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,WAAW,EACX,SAAS,EACT,YAAY,EACZ,UAAU,EACV,KAAK,GAEN,MAAM,cAAc,CAAA;AAOrB,MAAM,iBAAiB,GAAsC;IAC3D,OAAO,EAAE;QACP,IAAI,EAAE,UAAU;QAChB,cAAc,EAAE,aAAa;KAC9B;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,cAAc,EAAE,aAAa;KAC9B;IACD,MAAM,EAAE;QACN,IAAI,EAAE,KAAK;QACX,cAAc,EAAE,cAAc;KAC/B;IACD,GAAG,EAAE;QACH,IAAI,EAAE,WAAW;QACjB,cAAc,EAAE,WAAW;KAC5B;IACD,MAAM,EAAE;QACN,IAAI,EAAE,YAAY;QAClB,cAAc,EAAE,WAAW;KAC5B;CACF,CAAA;AAED,MAAM,wBAAwB,GAAsB;IAClD,IAAI,EAAE,KAAK;IACX,cAAc,EAAE,cAAc;CAC/B,CAAA;AAED,MAAM,UAAU,UAAU,CAAC,EACzB,KAAK,EACL,SAAS,GAIV;IACC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,EAAE,GAClC,iBAAiB,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,IAAI,wBAAwB,CAAA;IAE3E,OAAO,CACL,eACE,SAAS,EAAE,4BAA4B,cAAc,GAAG,SAAS,CAAC,CAAC,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAC1F,KAAK,EAAE,KAAK,gBACA,GAAG,KAAK,aAAa,YAEjC,KAAC,IAAI,IAAC,SAAS,EAAC,QAAQ,EAAC,WAAW,EAAE,IAAI,iBAAc,MAAM,GAAG,GAC5D,CACR,CAAA;AACH,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { RelatedDocumentsSection } from "../content/types.js";
2
+ export declare function RelatedDocuments({ documentSlug, sections, }: {
3
+ documentSlug: string;
4
+ sections: RelatedDocumentsSection[];
5
+ }): import("react/jsx-runtime").JSX.Element | null;
6
+ //# sourceMappingURL=related-documents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"related-documents.d.ts","sourceRoot":"","sources":["../../src/components/related-documents.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AA+IlE,wBAAgB,gBAAgB,CAAC,EAC/B,YAAY,EACZ,QAAQ,GACT,EAAE;IACD,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,uBAAuB,EAAE,CAAA;CACpC,kDAaA"}
@@ -0,0 +1,30 @@
1
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import { ArrowUpRight, ChevronDown, ChevronLeft, ChevronRight, } from "lucide-react";
4
+ import { Link } from "react-router";
5
+ const relatedDocumentsPageSize = 3;
6
+ const modifiedDateFormatter = new Intl.DateTimeFormat("en", {
7
+ day: "numeric",
8
+ month: "short",
9
+ timeZone: "UTC",
10
+ year: "numeric",
11
+ });
12
+ function ModifiedDate({ modifiedAt }) {
13
+ if (!Number.isFinite(modifiedAt) || modifiedAt <= 0)
14
+ return null;
15
+ return (_jsxs("time", { dateTime: new Date(modifiedAt).toISOString(), children: ["Updated ", modifiedDateFormatter.format(modifiedAt)] }));
16
+ }
17
+ function RelatedDocumentsGroup({ section, }) {
18
+ const [expanded, setExpanded] = useState(section.defaultExpanded);
19
+ const [page, setPage] = useState(0);
20
+ const pageCount = Math.ceil(section.entries.length / relatedDocumentsPageSize);
21
+ const currentPage = Math.min(page, pageCount - 1);
22
+ const visibleEntries = section.entries.slice(currentPage * relatedDocumentsPageSize, (currentPage + 1) * relatedDocumentsPageSize);
23
+ return (_jsxs("details", { className: "group border-b first:border-t", open: expanded, onToggle: (event) => setExpanded(event.currentTarget.open), children: [_jsx("summary", { className: "docs-centered-layout min-h-14 list-none font-semibold transition-colors hover:bg-muted/40 focus-visible:ring-2 focus-visible:ring-ring/40 focus-visible:outline-none [&::-webkit-details-marker]:hidden", children: _jsxs("span", { className: "flex min-h-14 w-full items-center justify-between gap-4", children: [_jsxs("span", { children: [section.title, _jsx("span", { className: "ml-2 text-sm font-normal text-muted-foreground", children: section.entries.length })] }), _jsx(ChevronDown, { className: "size-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180", "aria-hidden": "true" })] }) }), _jsx("div", { className: "docs-centered-layout border-t", children: _jsxs("div", { className: "w-full", children: [_jsx("ul", { children: visibleEntries.map(({ document, directlyLinked }) => (_jsx("li", { className: "py-5", children: _jsxs("div", { className: "grid gap-3 sm:grid-cols-[minmax(0,1fr)_auto]", children: [_jsxs("div", { className: "min-w-0", children: [_jsxs(Link, { to: `/p/${document.slug}`, className: "group/link inline-flex items-center gap-1.5 font-semibold transition-colors hover:text-primary", children: [document.frontmatter.title, _jsx(ArrowUpRight, { className: "size-3.5 opacity-0 transition-opacity group-hover/link:opacity-100", "aria-hidden": "true" })] }), document.frontmatter.description ? (_jsx("p", { className: "mt-1 text-sm leading-6 text-muted-foreground", children: document.frontmatter.description })) : null, document.frontmatter.tags.length ? (_jsx("ul", { className: "mt-3 flex flex-wrap gap-1.5", "aria-label": "Tags", children: document.frontmatter.tags.slice(0, 3).map((tag) => (_jsx("li", { className: "rounded-full border bg-muted/50 px-2 py-0.5 text-xs font-medium text-muted-foreground", children: tag }, tag))) })) : null] }), _jsxs("div", { className: "flex items-start gap-2 text-xs text-muted-foreground sm:flex-col sm:items-end", children: [directlyLinked ? (_jsx("span", { className: "rounded-full bg-primary/10 px-2 py-1 font-medium text-primary", children: "Directly linked" })) : null, _jsx(ModifiedDate, { modifiedAt: document.modifiedAt })] })] }) }, document.slug))) }), pageCount > 1 ? (_jsxs("nav", { className: "flex items-center justify-end gap-2 py-3", "aria-label": `${section.title} pages`, children: [_jsx("button", { type: "button", onClick: () => setPage((value) => Math.max(0, value - 1)), disabled: currentPage === 0, className: "rounded-md border p-1.5 transition-colors hover:bg-muted disabled:cursor-not-allowed disabled:opacity-35", "aria-label": `Previous ${section.title.toLocaleLowerCase()} page`, children: _jsx(ChevronLeft, { className: "size-4", "aria-hidden": "true" }) }), _jsxs("span", { className: "min-w-16 text-center text-xs text-muted-foreground", children: [currentPage + 1, " / ", pageCount] }), _jsx("button", { type: "button", onClick: () => setPage((value) => Math.min(pageCount - 1, value + 1)), disabled: currentPage === pageCount - 1, className: "rounded-md border p-1.5 transition-colors hover:bg-muted disabled:cursor-not-allowed disabled:opacity-35", "aria-label": `Next ${section.title.toLocaleLowerCase()} page`, children: _jsx(ChevronRight, { className: "size-4", "aria-hidden": "true" }) })] })) : null] }) })] }));
24
+ }
25
+ export function RelatedDocuments({ documentSlug, sections, }) {
26
+ if (!sections.length)
27
+ return null;
28
+ return (_jsx("aside", { className: "w-full", "aria-label": "Related documentation", children: sections.map((section) => (_jsx(RelatedDocumentsGroup, { section: section }, `${documentSlug}-${section.id}`))) }));
29
+ }
30
+ //# sourceMappingURL=related-documents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"related-documents.js","sourceRoot":"","sources":["../../src/components/related-documents.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EACL,YAAY,EACZ,WAAW,EACX,WAAW,EACX,YAAY,GACb,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAInC,MAAM,wBAAwB,GAAG,CAAC,CAAA;AAClC,MAAM,qBAAqB,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE;IAC1D,GAAG,EAAE,SAAS;IACd,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE,SAAS;CAChB,CAAC,CAAA;AAEF,SAAS,YAAY,CAAC,EAAE,UAAU,EAA0B;IAC1D,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,UAAU,IAAI,CAAC;QAAE,OAAO,IAAI,CAAA;IAEhE,OAAO,CACL,gBAAM,QAAQ,EAAE,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,WAAW,EAAE,yBACvC,qBAAqB,CAAC,MAAM,CAAC,UAAU,CAAC,IAC5C,CACR,CAAA;AACH,CAAC;AAED,SAAS,qBAAqB,CAAC,EAC7B,OAAO,GAGR;IACC,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,eAAe,CAAC,CAAA;IACjE,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;IACnC,MAAM,SAAS,GAAG,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D,aACjE,WAAW,GAAG,CAAC,SAAK,SAAS,IACzB,EACP,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE,CACZ,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,EAExD,QAAQ,EAAE,WAAW,KAAK,SAAS,GAAG,CAAC,EACvC,SAAS,EAAC,0GAA0G,gBACxG,QAAQ,OAAO,CAAC,KAAK,CAAC,iBAAiB,EAAE,OAAO,YAE5D,KAAC,YAAY,IAAC,SAAS,EAAC,QAAQ,iBAAa,MAAM,GAAG,GAC/C,IACL,CACP,CAAC,CAAC,CAAC,IAAI,IACJ,GACF,IACE,CACX,CAAA;AACH,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,EAC/B,YAAY,EACZ,QAAQ,GAIT;IACC,IAAI,CAAC,QAAQ,CAAC,MAAM;QAAE,OAAO,IAAI,CAAA;IAEjC,OAAO,CACL,gBAAO,SAAS,EAAC,QAAQ,gBAAY,uBAAuB,YACzD,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CACzB,KAAC,qBAAqB,IAEpB,OAAO,EAAE,OAAO,IADX,GAAG,YAAY,IAAI,OAAO,CAAC,EAAE,EAAE,CAEpC,CACH,CAAC,GACI,CACT,CAAA;AACH,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare function RelativeModifiedTime({ modifiedAt, now, }: {
2
+ modifiedAt: number;
3
+ now: number;
4
+ }): import("react/jsx-runtime").JSX.Element | null;
5
+ //# sourceMappingURL=relative-modified-time.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relative-modified-time.d.ts","sourceRoot":"","sources":["../../src/components/relative-modified-time.tsx"],"names":[],"mappings":"AA+DA,wBAAgB,oBAAoB,CAAC,EACnC,UAAU,EACV,GAAG,GACJ,EAAE;IACD,UAAU,EAAE,MAAM,CAAA;IAClB,GAAG,EAAE,MAAM,CAAA;CACZ,kDAgBA"}
@@ -0,0 +1,61 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Clock3 } from "lucide-react";
3
+ const minute = 60 * 1000;
4
+ const hour = 60 * minute;
5
+ const day = 24 * hour;
6
+ const month = 30 * day;
7
+ const year = 365 * day;
8
+ const modifiedDateFormatter = new Intl.DateTimeFormat("en", {
9
+ day: "numeric",
10
+ month: "short",
11
+ timeZone: "UTC",
12
+ year: "numeric",
13
+ });
14
+ const relativeTimeFormatter = new Intl.RelativeTimeFormat("en", {
15
+ numeric: "always",
16
+ });
17
+ function relativeTime(modifiedAt, now) {
18
+ if (!Number.isFinite(modifiedAt) || modifiedAt <= 0)
19
+ return null;
20
+ const elapsed = Math.max(0, now - modifiedAt);
21
+ if (elapsed < hour) {
22
+ return {
23
+ amount: Math.max(1, Math.floor(elapsed / minute)),
24
+ abbreviation: "m",
25
+ unit: "minute",
26
+ };
27
+ }
28
+ if (elapsed < day) {
29
+ return {
30
+ amount: Math.floor(elapsed / hour),
31
+ abbreviation: "h",
32
+ unit: "hour",
33
+ };
34
+ }
35
+ if (elapsed < month) {
36
+ return {
37
+ amount: Math.floor(elapsed / day),
38
+ abbreviation: "d",
39
+ unit: "day",
40
+ };
41
+ }
42
+ if (elapsed < year) {
43
+ return {
44
+ amount: Math.floor(elapsed / month),
45
+ abbreviation: "mo",
46
+ unit: "month",
47
+ };
48
+ }
49
+ return {
50
+ amount: Math.floor(elapsed / year),
51
+ abbreviation: "y",
52
+ unit: "year",
53
+ };
54
+ }
55
+ export function RelativeModifiedTime({ modifiedAt, now, }) {
56
+ const relative = relativeTime(modifiedAt, now);
57
+ if (!relative)
58
+ return null;
59
+ return (_jsxs("time", { dateTime: new Date(modifiedAt).toISOString(), title: `Updated ${modifiedDateFormatter.format(modifiedAt)}`, "aria-label": `Updated ${relativeTimeFormatter.format(-relative.amount, relative.unit)}`, className: "ml-auto inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground", suppressHydrationWarning: true, children: [_jsx(Clock3, { className: "size-3.5", "aria-hidden": "true" }), relative.amount, " ", relative.abbreviation] }));
60
+ }
61
+ //# sourceMappingURL=relative-modified-time.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relative-modified-time.js","sourceRoot":"","sources":["../../src/components/relative-modified-time.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAErC,MAAM,MAAM,GAAG,EAAE,GAAG,IAAI,CAAA;AACxB,MAAM,IAAI,GAAG,EAAE,GAAG,MAAM,CAAA;AACxB,MAAM,GAAG,GAAG,EAAE,GAAG,IAAI,CAAA;AACrB,MAAM,KAAK,GAAG,EAAE,GAAG,GAAG,CAAA;AACtB,MAAM,IAAI,GAAG,GAAG,GAAG,GAAG,CAAA;AACtB,MAAM,qBAAqB,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE;IAC1D,GAAG,EAAE,SAAS;IACd,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE,SAAS;CAChB,CAAC,CAAA;AACF,MAAM,qBAAqB,GAAG,IAAI,IAAI,CAAC,kBAAkB,CAAC,IAAI,EAAE;IAC9D,OAAO,EAAE,QAAQ;CAClB,CAAC,CAAA;AAIF,SAAS,YAAY,CACnB,UAAkB,EAClB,GAAW;IAEX,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,UAAU,IAAI,CAAC;QAAE,OAAO,IAAI,CAAA;IAEhE,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,GAAG,UAAU,CAAC,CAAA;IAE7C,IAAI,OAAO,GAAG,IAAI,EAAE,CAAC;QACnB,OAAO;YACL,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,MAA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ACtF,SAAS,EAAC,+EAA+E,EACzF,wBAAwB,mBAExB,KAAC,MAAM,IAAC,SAAS,EAAC,UAAU,iBAAa,MAAM,GAAG,EACjD,QAAQ,CAAC,MAAM,OAAG,QAAQ,CAAC,YAAY,IACnC,CACR,CAAA;AACH,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { type LucideIcon } from "lucide-react";
2
+ export declare function ScopeIcon({ name, fallback: Fallback, className, }: {
3
+ name?: string;
4
+ fallback?: LucideIcon;
5
+ className?: string;
6
+ }): import("react/jsx-runtime").JSX.Element;
7
+ //# sourceMappingURL=scope-icon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scope-icon.d.ts","sourceRoot":"","sources":["../../src/components/scope-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,UAAU,EAAE,MAAM,cAAc,CAAA;AAItD,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,QAAQ,EAAE,QAAiB,EAC3B,SAAoB,GACrB,EAAE;IACD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,UAAU,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,2CAKA"}
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Shapes } from "lucide-react";
3
+ import { getScopeIcon } from "../content/registry.js";
4
+ export function ScopeIcon({ name, fallback: Fallback = Shapes, className = "size-4", }) {
5
+ const Icon = name ? getScopeIcon(name) : undefined;
6
+ const ResolvedIcon = Icon ?? Fallback;
7
+ return _jsx(ResolvedIcon, { className: className, "aria-hidden": "true" });
8
+ }
9
+ //# sourceMappingURL=scope-icon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scope-icon.js","sourceRoot":"","sources":["../../src/components/scope-icon.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAmB,MAAM,cAAc,CAAA;AAEtD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAErD,MAAM,UAAU,SAAS,CAAC,EACxB,IAAI,EACJ,QAAQ,EAAE,QAAQ,GAAG,MAAM,EAC3B,SAAS,GAAG,QAAQ,GAKrB;IACC,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IAClD,MAAM,YAAY,GAAG,IAAI,IAAI,QAAQ,CAAA;IAErC,OAAO,KAAC,YAAY,IAAC,SAAS,EAAE,SAAS,iBAAc,MAAM,GAAG,CAAA;AAClE,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { DocumentEntry, ScopeDefinition } from "../content/types.js";
2
+ export declare function ScopesPage({ scopes }: {
3
+ scopes: ScopeDefinition[];
4
+ }): import("react/jsx-runtime").JSX.Element;
5
+ export declare function ScopePage({ scope, documents, }: {
6
+ scope: ScopeDefinition;
7
+ documents: DocumentEntry[];
8
+ }): import("react/jsx-runtime").JSX.Element;
9
+ //# sourceMappingURL=scopes-page.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scopes-page.d.ts","sourceRoot":"","sources":["../../src/components/scopes-page.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,aAAa,EACb,eAAe,EAGhB,MAAM,qBAAqB,CAAA;AAa5B,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,eAAe,EAAE,CAAA;CAAE,2CAiFnE;AA2HD,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,SAAS,GACV,EAAE;IACD,KAAK,EAAE,eAAe,CAAA;IACtB,SAAS,EAAE,aAAa,EAAE,CAAA;CAC3B,2CAqHA"}
@@ -0,0 +1,40 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { ArrowRight, ArrowUpRight, FileText, FolderTree, Layers3, } from "lucide-react";
3
+ import { Link } from "react-router";
4
+ import { scopeDocumentSlugs } from "../content/registry.js";
5
+ import { DocsPageLayout } from "./docs-page-layout.js";
6
+ import { DocsShell } from "./document-page.js";
7
+ import { ScopeIcon } from "./scope-icon.js";
8
+ function documentHref(documentSlug, scopeSlug) {
9
+ return `/p/${documentSlug}?${new URLSearchParams({ scope: scopeSlug }).toString()}`;
10
+ }
11
+ function documentCountLabel(count) {
12
+ return `${count} ${count === 1 ? "document" : "documents"}`;
13
+ }
14
+ export function ScopesPage({ scopes }) {
15
+ return (_jsx(DocsShell, { children: _jsx(DocsPageLayout, { className: "py-8 sm:py-12", children: _jsxs("div", { className: "w-full", children: [_jsxs("nav", { className: "mb-8 text-sm text-muted-foreground", "aria-label": "Breadcrumb", children: [_jsx(Link, { to: "/", className: "transition-colors hover:text-foreground", children: "Docs" }), " ", _jsx("span", { "aria-hidden": "true", children: "/" }), " ", _jsx("span", { className: "text-foreground", children: "Scopes" })] }), _jsxs("section", { "aria-labelledby": "scopes-heading", children: [_jsxs("div", { className: "border-b pb-5", children: [_jsx("p", { className: "text-sm font-medium text-primary", children: "Browse by" }), _jsx("h1", { id: "scopes-heading", className: "mt-1 text-3xl font-semibold", children: "Scopes" }), _jsx("p", { className: "mt-2 max-w-2xl text-sm leading-6 text-muted-foreground", children: "Follow curated document paths organized into sections and groups." })] }), scopes.length ? (_jsx("ul", { className: "mt-8 grid gap-4 sm:grid-cols-2 xl:grid-cols-3", children: scopes.map((scope) => {
16
+ const documentCount = scopeDocumentSlugs(scope).length;
17
+ return (_jsx("li", { children: _jsxs(Link, { to: `/scopes/${scope.slug}`, className: "group flex h-full flex-col rounded-xl border bg-card p-5 shadow-xs transition hover:-translate-y-0.5 hover:border-primary/40 hover:shadow-md", children: [_jsxs("span", { className: "flex items-start justify-between gap-4", children: [_jsx("span", { className: "flex size-9 items-center justify-center rounded-lg bg-primary/10 text-primary", children: _jsx(ScopeIcon, { name: scope.icon, fallback: Layers3, className: "size-4" }) }), _jsx(ArrowUpRight, { className: "size-4 text-muted-foreground transition group-hover:text-primary", "aria-hidden": "true" })] }), _jsx("span", { className: "mt-5 block text-lg font-semibold transition-colors group-hover:text-primary", children: scope.title }), scope.description ? (_jsx("span", { className: "mt-1 block text-sm leading-6 text-muted-foreground", children: scope.description })) : null, _jsx("span", { className: "mt-4 block text-xs font-medium text-muted-foreground", children: documentCountLabel(documentCount) })] }) }, scope.slug));
18
+ }) })) : (_jsxs("div", { className: "py-16 text-center", children: [_jsx("h2", { className: "font-semibold", children: "No scopes found" }), _jsx("p", { className: "mt-2 text-sm text-muted-foreground", children: "Add a scope.json file under docs/_scopes to create one." })] }))] })] }) }) }));
19
+ }
20
+ function ScopeDocumentLink({ reference, scope, documentsBySlug, }) {
21
+ const document = documentsBySlug.get(reference.slug);
22
+ if (!document)
23
+ return null;
24
+ return (_jsxs(Link, { to: documentHref(document.slug, scope.slug), className: "group grid grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-3 rounded-lg px-3 py-3 transition-colors hover:bg-muted", children: [_jsx("span", { className: "mt-0.5 flex size-8 items-center justify-center rounded-lg border bg-background text-muted-foreground transition group-hover:border-primary/40 group-hover:text-primary", children: _jsx(ScopeIcon, { name: reference.icon, fallback: FileText, className: "size-3.5" }) }), _jsxs("span", { className: "min-w-0", children: [_jsx("span", { className: "font-medium transition-colors group-hover:text-primary", children: document.frontmatter.title }), document.frontmatter.description ? (_jsx("span", { className: "mt-0.5 block text-sm leading-5 text-muted-foreground", children: document.frontmatter.description })) : null] }), _jsx(ArrowRight, { className: "mt-2 size-4 text-muted-foreground transition-transform group-hover:translate-x-0.5 group-hover:text-primary", "aria-hidden": "true" })] }));
25
+ }
26
+ function ScopeGroup({ group, scope, documentsBySlug, }) {
27
+ const groupDocument = group.document
28
+ ? documentsBySlug.get(group.document.slug)
29
+ : undefined;
30
+ const title = group.title ?? groupDocument?.frontmatter.title ?? group.id;
31
+ const description = group.description ?? groupDocument?.frontmatter.description ?? "";
32
+ const headingContent = (_jsxs(_Fragment, { children: [_jsx("span", { className: "flex size-9 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary", children: _jsx(ScopeIcon, { name: group.icon ?? group.document?.icon, fallback: FolderTree, className: "size-4" }) }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "font-semibold", children: title }), description ? (_jsx("span", { className: "mt-0.5 block text-sm leading-5 text-muted-foreground", children: description })) : null] }), groupDocument ? (_jsx(ArrowUpRight, { className: "size-4 text-muted-foreground", "aria-hidden": "true" })) : null] }));
33
+ return (_jsxs("section", { id: `${scope.slug}-${group.id}`, className: "overflow-hidden rounded-xl border bg-card", "aria-labelledby": `${scope.slug}-${group.id}-heading`, children: [_jsx("h3", { id: `${scope.slug}-${group.id}-heading`, children: groupDocument ? (_jsx(Link, { to: documentHref(groupDocument.slug, scope.slug), className: "group flex items-start gap-3 border-b p-4 transition-colors hover:bg-muted", children: headingContent })) : (_jsx("span", { className: "flex items-start gap-3 border-b p-4", children: headingContent })) }), group.documents.length ? (_jsx("ul", { className: "divide-y p-1", children: group.documents.map((reference) => (_jsx("li", { children: _jsx(ScopeDocumentLink, { reference: reference, scope: scope, documentsBySlug: documentsBySlug }) }, reference.slug))) })) : null] }));
34
+ }
35
+ export function ScopePage({ scope, documents, }) {
36
+ const documentsBySlug = new Map(documents.map((document) => [document.slug, document]));
37
+ const documentCount = scopeDocumentSlugs(scope).length;
38
+ return (_jsx(DocsShell, { children: _jsx(DocsPageLayout, { className: "py-8 sm:py-12", children: _jsxs("div", { className: "w-full", children: [_jsxs("nav", { className: "mb-8 text-sm text-muted-foreground", "aria-label": "Breadcrumb", children: [_jsx(Link, { to: "/", className: "transition-colors hover:text-foreground", children: "Docs" }), " ", _jsx("span", { "aria-hidden": "true", children: "/" }), " ", _jsx(Link, { to: "/scopes", className: "transition-colors hover:text-foreground", children: "Scopes" }), " ", _jsx("span", { "aria-hidden": "true", children: "/" }), " ", _jsx("span", { className: "text-foreground", children: scope.title })] }), _jsxs("header", { className: "flex items-start gap-4 border-b pb-8", children: [_jsx("span", { className: "flex size-11 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-primary", children: _jsx(ScopeIcon, { name: scope.icon, fallback: Layers3, className: "size-5" }) }), _jsxs("div", { children: [_jsx("p", { className: "text-sm font-medium text-primary", children: "Scope" }), _jsx("h1", { className: "mt-1 text-3xl font-semibold tracking-tight sm:text-4xl", children: scope.title }), scope.description ? (_jsx("p", { className: "mt-3 max-w-2xl leading-7 text-muted-foreground", children: scope.description })) : null, _jsx("p", { className: "mt-3 text-sm text-muted-foreground", children: documentCountLabel(documentCount) })] })] }), scope.sections.length ? (_jsx("div", { className: "mt-10 space-y-12", children: scope.sections.map((section) => (_jsxs("section", { id: section.id, "aria-labelledby": `${section.id}-heading`, children: [_jsxs("div", { className: "flex items-start gap-3 border-b pb-4", children: [_jsx("span", { className: "mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground", children: _jsx(ScopeIcon, { name: section.icon, className: "size-4" }) }), _jsxs("div", { children: [_jsx("h2", { id: `${section.id}-heading`, className: "text-xl font-semibold", children: section.title }), section.description ? (_jsx("p", { className: "mt-1 text-sm leading-6 text-muted-foreground", children: section.description })) : null] })] }), section.documents.length ? (_jsx("ul", { className: "mt-3 divide-y", children: section.documents.map((reference) => (_jsx("li", { children: _jsx(ScopeDocumentLink, { reference: reference, scope: scope, documentsBySlug: documentsBySlug }) }, reference.slug))) })) : null, section.groups.length ? (_jsx("div", { className: "mt-5 grid gap-4 lg:grid-cols-2", children: section.groups.map((group) => (_jsx(ScopeGroup, { group: group, scope: scope, documentsBySlug: documentsBySlug }, group.id))) })) : null] }, section.id))) })) : (_jsx("p", { className: "py-16 text-center text-sm text-muted-foreground", children: "This scope does not contain any sections yet." }))] }) }) }));
39
+ }
40
+ //# sourceMappingURL=scopes-page.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scopes-page.js","sourceRoot":"","sources":["../../src/components/scopes-page.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EACV,YAAY,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AAC,UAAU,IAET,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,eAAe,IAH3B,KAAK,CAAC,EAAE,CAIb,CACH,CAAC,GACE,CACP,CAAC,CAAC,CAAC,IAAI,KAhDH,OAAO,CAAC,EAAE,CAiDP,CACX,CAAC,GACE,CACP,CAAC,CAAC,CAAC,CACF,YAAG,SAAS,EAAC,iDAAiD,8DAE1D,CACL,IACG,GACS,GACP,CACb,CAAA;AACH,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { TableOfContentsItem } from "../content/table-of-contents.js";
2
+ export declare function MobileTableOfContents({ items, }: {
3
+ items: TableOfContentsItem[];
4
+ }): import("react/jsx-runtime").JSX.Element;
5
+ export declare function DesktopTableOfContents({ items, }: {
6
+ items: TableOfContentsItem[];
7
+ }): import("react/jsx-runtime").JSX.Element;
8
+ //# sourceMappingURL=table-of-contents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table-of-contents.d.ts","sourceRoot":"","sources":["../../src/components/table-of-contents.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAA;AAsF1E,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,GACN,EAAE;IACD,KAAK,EAAE,mBAAmB,EAAE,CAAA;CAC7B,2CAmCA;AAED,wBAAgB,sBAAsB,CAAC,EACrC,KAAK,GACN,EAAE;IACD,KAAK,EAAE,mBAAmB,EAAE,CAAA;CAC7B,2CAgBA"}