@natsuneko-laboratory/makit-theme-product 0.5.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/LICENSE +21 -0
- package/README.md +69 -0
- package/dist/components/breadcrumbs.d.mts +6 -0
- package/dist/components/breadcrumbs.d.mts.map +1 -0
- package/dist/components/breadcrumbs.mjs +30 -0
- package/dist/components/breadcrumbs.mjs.map +1 -0
- package/dist/components/docs-page.d.mts +6 -0
- package/dist/components/docs-page.d.mts.map +1 -0
- package/dist/components/docs-page.mjs +93 -0
- package/dist/components/docs-page.mjs.map +1 -0
- package/dist/components/footer.d.mts +6 -0
- package/dist/components/footer.d.mts.map +1 -0
- package/dist/components/footer.mjs +32 -0
- package/dist/components/footer.mjs.map +1 -0
- package/dist/components/header.d.mts +6 -0
- package/dist/components/header.d.mts.map +1 -0
- package/dist/components/header.mjs +97 -0
- package/dist/components/header.mjs.map +1 -0
- package/dist/components/icons.mjs +73 -0
- package/dist/components/icons.mjs.map +1 -0
- package/dist/components/navigation-items.d.mts +6 -0
- package/dist/components/navigation-items.d.mts.map +1 -0
- package/dist/components/navigation-items.mjs +95 -0
- package/dist/components/navigation-items.mjs.map +1 -0
- package/dist/components/not-found-page.d.mts +9 -0
- package/dist/components/not-found-page.d.mts.map +1 -0
- package/dist/components/not-found-page.mjs +39 -0
- package/dist/components/not-found-page.mjs.map +1 -0
- package/dist/components/page-header.d.mts +6 -0
- package/dist/components/page-header.d.mts.map +1 -0
- package/dist/components/page-header.mjs +26 -0
- package/dist/components/page-header.mjs.map +1 -0
- package/dist/components/portal-home-page.d.mts +6 -0
- package/dist/components/portal-home-page.d.mts.map +1 -0
- package/dist/components/portal-home-page.mjs +117 -0
- package/dist/components/portal-home-page.mjs.map +1 -0
- package/dist/components/prev-next-links.d.mts +6 -0
- package/dist/components/prev-next-links.d.mts.map +1 -0
- package/dist/components/prev-next-links.mjs +39 -0
- package/dist/components/prev-next-links.mjs.map +1 -0
- package/dist/components/root-layout.d.mts +10 -0
- package/dist/components/root-layout.d.mts.map +1 -0
- package/dist/components/root-layout.mjs +21 -0
- package/dist/components/root-layout.mjs.map +1 -0
- package/dist/components/sidebar.d.mts +6 -0
- package/dist/components/sidebar.d.mts.map +1 -0
- package/dist/components/sidebar.mjs +35 -0
- package/dist/components/sidebar.mjs.map +1 -0
- package/dist/components/table-of-contents.d.mts +6 -0
- package/dist/components/table-of-contents.d.mts.map +1 -0
- package/dist/components/table-of-contents.mjs +76 -0
- package/dist/components/table-of-contents.mjs.map +1 -0
- package/dist/components/theme-variables.d.mts +6 -0
- package/dist/components/theme-variables.d.mts.map +1 -0
- package/dist/components/theme-variables.mjs +92 -0
- package/dist/components/theme-variables.mjs.map +1 -0
- package/dist/index.d.mts +14 -0
- package/dist/index.mjs +14 -0
- package/dist/manifest.d.mts +5 -0
- package/dist/manifest.d.mts.map +1 -0
- package/dist/manifest.mjs +15 -0
- package/dist/manifest.mjs.map +1 -0
- package/package.json +57 -0
- package/styles/theme.css +93 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region src/components/not-found-page.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Takes no props of its own; `NotFoundPageProps` carries only `components`,
|
|
4
|
+
* which this implementation does not need.
|
|
5
|
+
*/
|
|
6
|
+
declare function NotFoundPage(): import("react").JSX.Element;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { NotFoundPage };
|
|
9
|
+
//# sourceMappingURL=not-found-page.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"not-found-page.d.mts","names":[],"sources":["../../src/components/not-found-page.tsx"],"mappings":";;;;;iBAOgB,gCAAY,IAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ArrowRight } from "./icons.mjs";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import Link from "next/link.js";
|
|
4
|
+
//#region src/components/not-found-page.tsx
|
|
5
|
+
/**
|
|
6
|
+
* Takes no props of its own; `NotFoundPageProps` carries only `components`,
|
|
7
|
+
* which this implementation does not need.
|
|
8
|
+
*/
|
|
9
|
+
function NotFoundPage() {
|
|
10
|
+
return /* @__PURE__ */ jsx("div", {
|
|
11
|
+
className: "flex min-h-screen items-center justify-center bg-[var(--makit-color-background)] px-6 text-[var(--makit-color-foreground)]",
|
|
12
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
13
|
+
className: "text-center",
|
|
14
|
+
children: [
|
|
15
|
+
/* @__PURE__ */ jsx("p", {
|
|
16
|
+
className: "bg-linear-to-br from-[var(--makit-color-accent)] to-[color-mix(in_srgb,var(--makit-color-accent)_45%,var(--makit-color-foreground))] bg-clip-text text-7xl font-bold tracking-tight text-transparent",
|
|
17
|
+
children: "404"
|
|
18
|
+
}),
|
|
19
|
+
/* @__PURE__ */ jsx("h1", {
|
|
20
|
+
className: "mt-4 text-2xl font-semibold tracking-tight",
|
|
21
|
+
children: "Page not found"
|
|
22
|
+
}),
|
|
23
|
+
/* @__PURE__ */ jsx("p", {
|
|
24
|
+
className: "mt-2 text-[var(--makit-color-subtle)]",
|
|
25
|
+
children: "The page you were looking for does not exist."
|
|
26
|
+
}),
|
|
27
|
+
/* @__PURE__ */ jsxs(Link, {
|
|
28
|
+
href: "/",
|
|
29
|
+
className: "mt-8 inline-flex items-center gap-2 rounded-full bg-[var(--makit-color-accent)] px-5 py-2.5 text-sm font-medium text-white transition hover:opacity-90",
|
|
30
|
+
children: ["Back to documentation", /* @__PURE__ */ jsx(ArrowRight, { className: "size-4" })]
|
|
31
|
+
})
|
|
32
|
+
]
|
|
33
|
+
})
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
export { NotFoundPage };
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=not-found-page.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"not-found-page.mjs","names":[],"sources":["../../src/components/not-found-page.tsx"],"sourcesContent":["import Link from \"next/link\";\r\nimport { ArrowRight } from \"./icons.js\";\r\n\r\n/**\r\n * Takes no props of its own; `NotFoundPageProps` carries only `components`,\r\n * which this implementation does not need.\r\n */\r\nexport function NotFoundPage() {\r\n return (\r\n <div className=\"flex min-h-screen items-center justify-center bg-[var(--makit-color-background)] px-6 text-[var(--makit-color-foreground)]\">\r\n <div className=\"text-center\">\r\n <p className=\"bg-linear-to-br from-[var(--makit-color-accent)] to-[color-mix(in_srgb,var(--makit-color-accent)_45%,var(--makit-color-foreground))] bg-clip-text text-7xl font-bold tracking-tight text-transparent\">\r\n 404\r\n </p>\r\n <h1 className=\"mt-4 text-2xl font-semibold tracking-tight\">Page not found</h1>\r\n <p className=\"mt-2 text-[var(--makit-color-subtle)]\">\r\n The page you were looking for does not exist.\r\n </p>\r\n <Link\r\n href=\"/\"\r\n className=\"mt-8 inline-flex items-center gap-2 rounded-full bg-[var(--makit-color-accent)] px-5 py-2.5 text-sm font-medium text-white transition hover:opacity-90\"\r\n >\r\n Back to documentation\r\n <ArrowRight className=\"size-4\" />\r\n </Link>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"mappings":";;;;;;;;AAOA,SAAgB,eAAe;CAC7B,OACE,oBAAC,OAAD;EAAK,WAAU;YACb,qBAAC,OAAD;GAAK,WAAU;aAAf;IACE,oBAAC,KAAD;KAAG,WAAU;eAAuM;IAEjN,CAAA;IACH,oBAAC,MAAD;KAAI,WAAU;eAA6C;IAAkB,CAAA;IAC7E,oBAAC,KAAD;KAAG,WAAU;eAAwC;IAElD,CAAA;IACH,qBAAC,MAAD;KACE,MAAK;KACL,WAAU;eAFZ,CAGC,yBAEC,oBAAC,YAAD,EAAY,WAAU,SAAU,CAAA,CAC5B;;GACH;;CACF,CAAA;AAET"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PageHeaderProps } from "@natsuneko-laboratory/makit-runtime";
|
|
2
|
+
//#region src/components/page-header.d.ts
|
|
3
|
+
declare function PageHeader({ page }: PageHeaderProps): import("react").JSX.Element;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { PageHeader };
|
|
6
|
+
//# sourceMappingURL=page-header.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-header.d.mts","names":[],"sources":["../../src/components/page-header.tsx"],"mappings":";;iBAEgB,aAAa,QAAQ,kCAAe,IAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
//#region src/components/page-header.tsx
|
|
3
|
+
function PageHeader({ page }) {
|
|
4
|
+
const eyebrow = page.hierarchy.at(-1)?.title;
|
|
5
|
+
return /* @__PURE__ */ jsxs("header", {
|
|
6
|
+
className: "mb-10",
|
|
7
|
+
children: [
|
|
8
|
+
eyebrow && /* @__PURE__ */ jsx("p", {
|
|
9
|
+
className: "mb-3 text-[13px] font-semibold tracking-wide text-[var(--makit-color-accent)]",
|
|
10
|
+
children: eyebrow
|
|
11
|
+
}),
|
|
12
|
+
/* @__PURE__ */ jsx("h1", {
|
|
13
|
+
className: "text-4xl font-semibold tracking-[-0.035em] sm:text-[2.6rem] sm:leading-[1.12]",
|
|
14
|
+
children: page.title
|
|
15
|
+
}),
|
|
16
|
+
page.description && /* @__PURE__ */ jsx("p", {
|
|
17
|
+
className: "mt-4 max-w-2xl text-lg leading-8 text-[var(--makit-color-subtle)]",
|
|
18
|
+
children: page.description
|
|
19
|
+
})
|
|
20
|
+
]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { PageHeader };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=page-header.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-header.mjs","names":[],"sources":["../../src/components/page-header.tsx"],"sourcesContent":["import type { PageHeaderProps } from \"@natsuneko-laboratory/makit-runtime\";\r\n\r\nexport function PageHeader({ page }: PageHeaderProps) {\r\n // The nearest ancestor in the canonical hierarchy (spec §39) makes a good\r\n // eyebrow — \"Guides\", \"API Reference\" — without any extra configuration.\r\n const eyebrow = page.hierarchy.at(-1)?.title;\r\n\r\n return (\r\n <header className=\"mb-10\">\r\n {eyebrow && (\r\n <p className=\"mb-3 text-[13px] font-semibold tracking-wide text-[var(--makit-color-accent)]\">\r\n {eyebrow}\r\n </p>\r\n )}\r\n <h1 className=\"text-4xl font-semibold tracking-[-0.035em] sm:text-[2.6rem] sm:leading-[1.12]\">\r\n {page.title}\r\n </h1>\r\n {page.description && (\r\n <p className=\"mt-4 max-w-2xl text-lg leading-8 text-[var(--makit-color-subtle)]\">\r\n {page.description}\r\n </p>\r\n )}\r\n </header>\r\n );\r\n}\r\n"],"mappings":";;AAEA,SAAgB,WAAW,EAAE,QAAyB;CAGpD,MAAM,UAAU,KAAK,UAAU,GAAG,EAAE,CAAC,EAAE;CAEvC,OACE,qBAAC,UAAD;EAAQ,WAAU;YAAlB;GACG,WACC,oBAAC,KAAD;IAAG,WAAU;cACV;GACA,CAAA;GAEL,oBAAC,MAAD;IAAI,WAAU;cACX,KAAK;GACJ,CAAA;GACH,KAAK,eACJ,oBAAC,KAAD;IAAG,WAAU;cACV,KAAK;GACL,CAAA;EAEC;;AAEZ"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PortalHomePageProps } from "@natsuneko-laboratory/makit-runtime";
|
|
2
|
+
//#region src/components/portal-home-page.d.ts
|
|
3
|
+
declare function PortalHomePage({ home, site, i18n, locale, components: C }: PortalHomePageProps): Promise<import("react").JSX.Element>;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { PortalHomePage };
|
|
6
|
+
//# sourceMappingURL=portal-home-page.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portal-home-page.d.mts","names":[],"sources":["../../src/components/portal-home-page.tsx"],"mappings":";;iBAkDsB,iBACpB,MACA,MACA,MACA,QACA,YAAY,KACX,sBAAmB,wBAAA,IAAA"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { ArrowRight } from "./icons.mjs";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { getGlobalNavigation, getHomeRoute, getSearchIndex } from "@natsuneko-laboratory/makit-runtime";
|
|
4
|
+
import Link from "next/link.js";
|
|
5
|
+
//#region src/components/portal-home-page.tsx
|
|
6
|
+
function CollectionCard({ card }) {
|
|
7
|
+
return /* @__PURE__ */ jsxs(Link, {
|
|
8
|
+
href: card.href,
|
|
9
|
+
className: "makit-product-card group block rounded-2xl border border-[var(--makit-color-border)] bg-[var(--makit-color-surface)] p-6 transition hover:-translate-y-0.5 hover:border-[color-mix(in_srgb,var(--makit-color-accent)_45%,var(--makit-color-border))]",
|
|
10
|
+
children: [
|
|
11
|
+
/* @__PURE__ */ jsx("span", {
|
|
12
|
+
"aria-hidden": "true",
|
|
13
|
+
className: "mb-4 flex size-10 items-center justify-center rounded-xl bg-[color-mix(in_srgb,var(--makit-color-accent)_14%,transparent)] text-lg font-semibold text-[var(--makit-color-accent)]",
|
|
14
|
+
children: card.title.slice(0, 1).toUpperCase()
|
|
15
|
+
}),
|
|
16
|
+
/* @__PURE__ */ jsxs("span", {
|
|
17
|
+
className: "flex items-center justify-between gap-3",
|
|
18
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
19
|
+
className: "text-lg font-semibold tracking-tight text-[var(--makit-color-foreground)]",
|
|
20
|
+
children: card.title
|
|
21
|
+
}), /* @__PURE__ */ jsx(ArrowRight, { className: "size-4 shrink-0 text-[var(--makit-color-subtle)] transition group-hover:translate-x-0.5 group-hover:text-[var(--makit-color-accent)]" })]
|
|
22
|
+
}),
|
|
23
|
+
card.description && /* @__PURE__ */ jsx("span", {
|
|
24
|
+
className: "mt-2 block text-sm leading-6 text-[var(--makit-color-subtle)]",
|
|
25
|
+
children: card.description
|
|
26
|
+
})
|
|
27
|
+
]
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function CardGrid({ cards }) {
|
|
31
|
+
if (cards.length === 0) return null;
|
|
32
|
+
return /* @__PURE__ */ jsx("div", {
|
|
33
|
+
className: "grid grid-cols-1 gap-5 sm:grid-cols-2 lg:grid-cols-3",
|
|
34
|
+
children: cards.map((card) => /* @__PURE__ */ jsx(CollectionCard, { card }, card.id))
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
async function PortalHomePage({ home, site, i18n, locale, components: C }) {
|
|
38
|
+
const homeHref = await getHomeRoute(locale) ?? `${site.basePath}/`;
|
|
39
|
+
const [globalNavigation, searchEntries] = await Promise.all([getGlobalNavigation(locale), getSearchIndex(locale)]);
|
|
40
|
+
const localeLinks = i18n.enabled && i18n.locales.length > 1 ? await Promise.all(i18n.locales.map(async (candidate) => ({
|
|
41
|
+
locale: candidate,
|
|
42
|
+
href: await getHomeRoute(candidate.urlLocale) ?? homeHref
|
|
43
|
+
}))) : [];
|
|
44
|
+
const headerActions = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
45
|
+
/* @__PURE__ */ jsx(C.SearchDialog, {
|
|
46
|
+
entries: searchEntries,
|
|
47
|
+
pagefindEnabled: process.env.NODE_ENV === "production",
|
|
48
|
+
pagefindBundlePath: `${site.basePath}/pagefind/`
|
|
49
|
+
}),
|
|
50
|
+
localeLinks.length > 1 && /* @__PURE__ */ jsx("div", {
|
|
51
|
+
className: "hidden items-center gap-1 text-sm sm:flex",
|
|
52
|
+
children: localeLinks.map(({ locale: candidate, href }) => /* @__PURE__ */ jsx(Link, {
|
|
53
|
+
href,
|
|
54
|
+
"aria-current": candidate.urlLocale === locale ? "true" : void 0,
|
|
55
|
+
className: candidate.urlLocale === locale ? "rounded-full bg-[color-mix(in_srgb,var(--makit-color-accent)_12%,transparent)] px-3 py-1.5 font-medium text-[var(--makit-color-accent)]" : "rounded-full px-3 py-1.5 text-[var(--makit-color-subtle)] transition hover:text-[var(--makit-color-foreground)]",
|
|
56
|
+
children: candidate.label
|
|
57
|
+
}, candidate.urlLocale))
|
|
58
|
+
}),
|
|
59
|
+
site.theme.colorScheme === "system" && /* @__PURE__ */ jsx(C.ThemeToggle, {})
|
|
60
|
+
] });
|
|
61
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
62
|
+
className: "flex min-h-screen flex-col bg-[var(--makit-color-background)] text-[var(--makit-color-foreground)]",
|
|
63
|
+
children: [
|
|
64
|
+
/* @__PURE__ */ jsx(C.Header, {
|
|
65
|
+
header: site.header,
|
|
66
|
+
siteTitle: site.title,
|
|
67
|
+
homeHref,
|
|
68
|
+
actions: headerActions,
|
|
69
|
+
globalNavigation
|
|
70
|
+
}),
|
|
71
|
+
/* @__PURE__ */ jsxs("main", {
|
|
72
|
+
"data-pagefind-body": true,
|
|
73
|
+
className: "flex-1",
|
|
74
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
75
|
+
className: "relative overflow-hidden border-b border-[var(--makit-color-border)]",
|
|
76
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
77
|
+
"aria-hidden": "true",
|
|
78
|
+
className: "pointer-events-none absolute inset-x-0 top-0 h-full bg-linear-to-b from-[color-mix(in_srgb,var(--makit-color-accent)_10%,transparent)] to-transparent"
|
|
79
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
80
|
+
className: "relative mx-auto w-full max-w-[92rem] px-5 py-20 sm:px-10 md:py-28",
|
|
81
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
82
|
+
className: "max-w-3xl",
|
|
83
|
+
children: [
|
|
84
|
+
/* @__PURE__ */ jsx("span", {
|
|
85
|
+
className: "mb-5 inline-flex rounded-full border border-[var(--makit-color-border)] bg-[var(--makit-color-surface)] px-3.5 py-1.5 text-xs font-medium text-[var(--makit-color-subtle)]",
|
|
86
|
+
children: "Documentation"
|
|
87
|
+
}),
|
|
88
|
+
/* @__PURE__ */ jsx("h1", {
|
|
89
|
+
className: "text-5xl font-semibold tracking-[-0.045em] sm:text-6xl",
|
|
90
|
+
children: site.title
|
|
91
|
+
}),
|
|
92
|
+
site.description && /* @__PURE__ */ jsx("p", {
|
|
93
|
+
className: "mt-6 max-w-2xl text-xl leading-8 text-[var(--makit-color-subtle)]",
|
|
94
|
+
children: site.description
|
|
95
|
+
})
|
|
96
|
+
]
|
|
97
|
+
})
|
|
98
|
+
})]
|
|
99
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
100
|
+
className: "mx-auto w-full max-w-[92rem] px-5 py-16 sm:px-10",
|
|
101
|
+
children: [/* @__PURE__ */ jsx(CardGrid, { cards: home.featuredCollections }), home.sections.map((section, index) => /* @__PURE__ */ jsxs("section", {
|
|
102
|
+
className: "mt-16",
|
|
103
|
+
children: [section.title && /* @__PURE__ */ jsx("h2", {
|
|
104
|
+
className: "mb-6 text-xl font-semibold tracking-tight",
|
|
105
|
+
children: section.title
|
|
106
|
+
}), /* @__PURE__ */ jsx(CardGrid, { cards: section.collections })]
|
|
107
|
+
}, section.title ?? `section-${index}`))]
|
|
108
|
+
})]
|
|
109
|
+
}),
|
|
110
|
+
/* @__PURE__ */ jsx(C.Footer, { footer: site.footer })
|
|
111
|
+
]
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
//#endregion
|
|
115
|
+
export { PortalHomePage };
|
|
116
|
+
|
|
117
|
+
//# sourceMappingURL=portal-home-page.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portal-home-page.mjs","names":[],"sources":["../../src/components/portal-home-page.tsx"],"sourcesContent":["import Link from \"next/link\";\r\nimport {\r\n getGlobalNavigation,\r\n getHomeRoute,\r\n getSearchIndex,\r\n} from \"@natsuneko-laboratory/makit-runtime\";\r\nimport type {\r\n PortalCollectionCard,\r\n PortalHomePageProps,\r\n} from \"@natsuneko-laboratory/makit-runtime\";\r\nimport { ArrowRight } from \"./icons.js\";\r\n\r\nfunction CollectionCard({ card }: { card: PortalCollectionCard }) {\r\n return (\r\n <Link\r\n href={card.href}\r\n className=\"makit-product-card group block rounded-2xl border border-[var(--makit-color-border)] bg-[var(--makit-color-surface)] p-6 transition hover:-translate-y-0.5 hover:border-[color-mix(in_srgb,var(--makit-color-accent)_45%,var(--makit-color-border))]\"\r\n >\r\n <span\r\n aria-hidden=\"true\"\r\n className=\"mb-4 flex size-10 items-center justify-center rounded-xl bg-[color-mix(in_srgb,var(--makit-color-accent)_14%,transparent)] text-lg font-semibold text-[var(--makit-color-accent)]\"\r\n >\r\n {card.title.slice(0, 1).toUpperCase()}\r\n </span>\r\n <span className=\"flex items-center justify-between gap-3\">\r\n <span className=\"text-lg font-semibold tracking-tight text-[var(--makit-color-foreground)]\">\r\n {card.title}\r\n </span>\r\n <ArrowRight className=\"size-4 shrink-0 text-[var(--makit-color-subtle)] transition group-hover:translate-x-0.5 group-hover:text-[var(--makit-color-accent)]\" />\r\n </span>\r\n {card.description && (\r\n <span className=\"mt-2 block text-sm leading-6 text-[var(--makit-color-subtle)]\">\r\n {card.description}\r\n </span>\r\n )}\r\n </Link>\r\n );\r\n}\r\n\r\nfunction CardGrid({ cards }: { cards: readonly PortalCollectionCard[] }) {\r\n if (cards.length === 0) return null;\r\n return (\r\n <div className=\"grid grid-cols-1 gap-5 sm:grid-cols-2 lg:grid-cols-3\">\r\n {cards.map((card) => (\r\n <CollectionCard key={card.id} card={card} />\r\n ))}\r\n </div>\r\n );\r\n}\r\n\r\nexport async function PortalHomePage({\r\n home,\r\n site,\r\n i18n,\r\n locale,\r\n components: C,\r\n}: PortalHomePageProps) {\r\n const homeHref = (await getHomeRoute(locale)) ?? `${site.basePath}/`;\r\n const [globalNavigation, searchEntries] = await Promise.all([\r\n getGlobalNavigation(locale),\r\n getSearchIndex(locale),\r\n ]);\r\n\r\n const localeLinks =\r\n i18n.enabled && i18n.locales.length > 1\r\n ? await Promise.all(\r\n i18n.locales.map(async (candidate) => ({\r\n locale: candidate,\r\n href: (await getHomeRoute(candidate.urlLocale)) ?? homeHref,\r\n })),\r\n )\r\n : [];\r\n\r\n const headerActions = (\r\n <>\r\n <C.SearchDialog\r\n entries={searchEntries}\r\n pagefindEnabled={process.env.NODE_ENV === \"production\"}\r\n pagefindBundlePath={`${site.basePath}/pagefind/`}\r\n />\r\n {localeLinks.length > 1 && (\r\n <div className=\"hidden items-center gap-1 text-sm sm:flex\">\r\n {localeLinks.map(({ locale: candidate, href }) => (\r\n <Link\r\n key={candidate.urlLocale}\r\n href={href}\r\n aria-current={candidate.urlLocale === locale ? \"true\" : undefined}\r\n className={\r\n candidate.urlLocale === locale\r\n ? \"rounded-full bg-[color-mix(in_srgb,var(--makit-color-accent)_12%,transparent)] px-3 py-1.5 font-medium text-[var(--makit-color-accent)]\"\r\n : \"rounded-full px-3 py-1.5 text-[var(--makit-color-subtle)] transition hover:text-[var(--makit-color-foreground)]\"\r\n }\r\n >\r\n {candidate.label}\r\n </Link>\r\n ))}\r\n </div>\r\n )}\r\n {site.theme.colorScheme === \"system\" && <C.ThemeToggle />}\r\n </>\r\n );\r\n\r\n return (\r\n <div className=\"flex min-h-screen flex-col bg-[var(--makit-color-background)] text-[var(--makit-color-foreground)]\">\r\n <C.Header\r\n header={site.header}\r\n siteTitle={site.title}\r\n homeHref={homeHref}\r\n actions={headerActions}\r\n globalNavigation={globalNavigation}\r\n />\r\n <main data-pagefind-body className=\"flex-1\">\r\n {/* Hero: an accent wash that fades into the page background. */}\r\n <div className=\"relative overflow-hidden border-b border-[var(--makit-color-border)]\">\r\n <div\r\n aria-hidden=\"true\"\r\n className=\"pointer-events-none absolute inset-x-0 top-0 h-full bg-linear-to-b from-[color-mix(in_srgb,var(--makit-color-accent)_10%,transparent)] to-transparent\"\r\n />\r\n <div className=\"relative mx-auto w-full max-w-[92rem] px-5 py-20 sm:px-10 md:py-28\">\r\n <div className=\"max-w-3xl\">\r\n <span className=\"mb-5 inline-flex rounded-full border border-[var(--makit-color-border)] bg-[var(--makit-color-surface)] px-3.5 py-1.5 text-xs font-medium text-[var(--makit-color-subtle)]\">\r\n Documentation\r\n </span>\r\n <h1 className=\"text-5xl font-semibold tracking-[-0.045em] sm:text-6xl\">\r\n {site.title}\r\n </h1>\r\n {site.description && (\r\n <p className=\"mt-6 max-w-2xl text-xl leading-8 text-[var(--makit-color-subtle)]\">\r\n {site.description}\r\n </p>\r\n )}\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div className=\"mx-auto w-full max-w-[92rem] px-5 py-16 sm:px-10\">\r\n <CardGrid cards={home.featuredCollections} />\r\n\r\n {home.sections.map((section, index) => (\r\n <section key={section.title ?? `section-${index}`} className=\"mt-16\">\r\n {section.title && (\r\n <h2 className=\"mb-6 text-xl font-semibold tracking-tight\">{section.title}</h2>\r\n )}\r\n <CardGrid cards={section.collections} />\r\n </section>\r\n ))}\r\n </div>\r\n </main>\r\n <C.Footer footer={site.footer} />\r\n </div>\r\n );\r\n}\r\n"],"mappings":"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"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PrevNextLinksProps } from "@natsuneko-laboratory/makit-runtime";
|
|
2
|
+
//#region src/components/prev-next-links.d.ts
|
|
3
|
+
declare function PrevNextLinks({ prev, next }: PrevNextLinksProps): import("react").JSX.Element | null;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { PrevNextLinks };
|
|
6
|
+
//# sourceMappingURL=prev-next-links.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prev-next-links.d.mts","names":[],"sources":["../../src/components/prev-next-links.tsx"],"mappings":";;iBAyBgB,gBAAgB,MAAM,QAAQ,qCAAkB,IAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ArrowRight } from "./icons.mjs";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import Link from "next/link.js";
|
|
4
|
+
//#region src/components/prev-next-links.tsx
|
|
5
|
+
function Card({ link, direction }) {
|
|
6
|
+
const isPrev = direction === "prev";
|
|
7
|
+
return /* @__PURE__ */ jsxs(Link, {
|
|
8
|
+
href: link.href,
|
|
9
|
+
className: `group flex flex-col gap-1.5 rounded-2xl border border-[var(--makit-color-border)] bg-[var(--makit-color-surface)] px-5 py-4 transition hover:-translate-y-0.5 hover:border-[color-mix(in_srgb,var(--makit-color-accent)_45%,var(--makit-color-border))] hover:shadow-lg ${isPrev ? "" : "items-end text-right"}`,
|
|
10
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
11
|
+
className: "flex items-center gap-1.5 text-xs font-medium text-[var(--makit-color-subtle)]",
|
|
12
|
+
children: [
|
|
13
|
+
isPrev && /* @__PURE__ */ jsx(ArrowRight, { className: "size-3.5 rotate-180" }),
|
|
14
|
+
isPrev ? "Previous" : "Next",
|
|
15
|
+
!isPrev && /* @__PURE__ */ jsx(ArrowRight, { className: "size-3.5 transition group-hover:translate-x-0.5" })
|
|
16
|
+
]
|
|
17
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
18
|
+
className: "font-medium text-[var(--makit-color-foreground)] group-hover:text-[var(--makit-color-accent)]",
|
|
19
|
+
children: link.title
|
|
20
|
+
})]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function PrevNextLinks({ prev, next }) {
|
|
24
|
+
if (!prev && !next) return null;
|
|
25
|
+
return /* @__PURE__ */ jsxs("nav", {
|
|
26
|
+
className: "mt-16 grid grid-cols-1 gap-4 border-t border-[var(--makit-color-border)] pt-10 sm:grid-cols-2",
|
|
27
|
+
children: [prev ? /* @__PURE__ */ jsx(Card, {
|
|
28
|
+
link: prev,
|
|
29
|
+
direction: "prev"
|
|
30
|
+
}) : /* @__PURE__ */ jsx("span", { className: "hidden sm:block" }), next ? /* @__PURE__ */ jsx(Card, {
|
|
31
|
+
link: next,
|
|
32
|
+
direction: "next"
|
|
33
|
+
}) : /* @__PURE__ */ jsx("span", { className: "hidden sm:block" })]
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
export { PrevNextLinks };
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=prev-next-links.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prev-next-links.mjs","names":[],"sources":["../../src/components/prev-next-links.tsx"],"sourcesContent":["import Link from \"next/link\";\r\nimport type { GeneratedPageLink, PrevNextLinksProps } from \"@natsuneko-laboratory/makit-runtime\";\r\nimport { ArrowRight } from \"./icons.js\";\r\n\r\nfunction Card({ link, direction }: { link: GeneratedPageLink; direction: \"prev\" | \"next\" }) {\r\n const isPrev = direction === \"prev\";\r\n return (\r\n <Link\r\n href={link.href}\r\n className={`group flex flex-col gap-1.5 rounded-2xl border border-[var(--makit-color-border)] bg-[var(--makit-color-surface)] px-5 py-4 transition hover:-translate-y-0.5 hover:border-[color-mix(in_srgb,var(--makit-color-accent)_45%,var(--makit-color-border))] hover:shadow-lg ${\r\n isPrev ? \"\" : \"items-end text-right\"\r\n }`}\r\n >\r\n <span className=\"flex items-center gap-1.5 text-xs font-medium text-[var(--makit-color-subtle)]\">\r\n {isPrev && <ArrowRight className=\"size-3.5 rotate-180\" />}\r\n {isPrev ? \"Previous\" : \"Next\"}\r\n {!isPrev && <ArrowRight className=\"size-3.5 transition group-hover:translate-x-0.5\" />}\r\n </span>\r\n <span className=\"font-medium text-[var(--makit-color-foreground)] group-hover:text-[var(--makit-color-accent)]\">\r\n {link.title}\r\n </span>\r\n </Link>\r\n );\r\n}\r\n\r\nexport function PrevNextLinks({ prev, next }: PrevNextLinksProps) {\r\n if (!prev && !next) return null;\r\n\r\n return (\r\n <nav className=\"mt-16 grid grid-cols-1 gap-4 border-t border-[var(--makit-color-border)] pt-10 sm:grid-cols-2\">\r\n {prev ? <Card link={prev} direction=\"prev\" /> : <span className=\"hidden sm:block\" />}\r\n {next ? <Card link={next} direction=\"next\" /> : <span className=\"hidden sm:block\" />}\r\n </nav>\r\n );\r\n}\r\n"],"mappings":";;;;AAIA,SAAS,KAAK,EAAE,MAAM,aAAsE;CAC1F,MAAM,SAAS,cAAc;CAC7B,OACE,qBAAC,MAAD;EACE,MAAM,KAAK;EACX,WAAW,2QACT,SAAS,KAAK;YAHlB,CAME,qBAAC,QAAD;GAAM,WAAU;aAAhB;IACG,UAAU,oBAAC,YAAD,EAAY,WAAU,sBAAuB,CAAA;IACvD,SAAS,aAAa;IACtB,CAAC,UAAU,oBAAC,YAAD,EAAY,WAAU,kDAAmD,CAAA;GACjF;MACN,oBAAC,QAAD;GAAM,WAAU;aACb,KAAK;EACF,CAAA,CACF;;AAEV;AAEA,SAAgB,cAAc,EAAE,MAAM,QAA4B;CAChE,IAAI,CAAC,QAAQ,CAAC,MAAM,OAAO;CAE3B,OACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACG,OAAO,oBAAC,MAAD;GAAM,MAAM;GAAM,WAAU;EAAQ,CAAA,IAAI,oBAAC,QAAD,EAAM,WAAU,kBAAmB,CAAA,GAClF,OAAO,oBAAC,MAAD;GAAM,MAAM;GAAM,WAAU;EAAQ,CAAA,IAAI,oBAAC,QAAD,EAAM,WAAU,kBAAmB,CAAA,CAChF;;AAET"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RootLayoutProps } from "@natsuneko-laboratory/makit-runtime";
|
|
2
|
+
//#region src/components/root-layout.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* `bodyStart` must be rendered first inside `<body>` (THEME §10.3) — it
|
|
5
|
+
* carries the CSS variables and the pre-hydration color-scheme script.
|
|
6
|
+
*/
|
|
7
|
+
declare function RootLayout({ htmlProps, bodyProps, bodyStart, children }: RootLayoutProps): import("react").JSX.Element;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { RootLayout };
|
|
10
|
+
//# sourceMappingURL=root-layout.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root-layout.d.mts","names":[],"sources":["../../src/components/root-layout.tsx"],"mappings":";;;;;;iBAMgB,aAAa,WAAW,WAAW,WAAW,YAAY,kCAAe,IAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
//#region src/components/root-layout.tsx
|
|
3
|
+
/**
|
|
4
|
+
* `bodyStart` must be rendered first inside `<body>` (THEME §10.3) — it
|
|
5
|
+
* carries the CSS variables and the pre-hydration color-scheme script.
|
|
6
|
+
*/
|
|
7
|
+
function RootLayout({ htmlProps, bodyProps, bodyStart, children }) {
|
|
8
|
+
return /* @__PURE__ */ jsx("html", {
|
|
9
|
+
...htmlProps,
|
|
10
|
+
"data-makit-theme": "product",
|
|
11
|
+
children: /* @__PURE__ */ jsxs("body", {
|
|
12
|
+
...bodyProps,
|
|
13
|
+
className: "makit-product antialiased",
|
|
14
|
+
children: [bodyStart, children]
|
|
15
|
+
})
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { RootLayout };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=root-layout.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root-layout.mjs","names":[],"sources":["../../src/components/root-layout.tsx"],"sourcesContent":["import type { RootLayoutProps } from \"@natsuneko-laboratory/makit-runtime\";\r\n\r\n/**\r\n * `bodyStart` must be rendered first inside `<body>` (THEME §10.3) — it\r\n * carries the CSS variables and the pre-hydration color-scheme script.\r\n */\r\nexport function RootLayout({ htmlProps, bodyProps, bodyStart, children }: RootLayoutProps) {\r\n return (\r\n <html {...htmlProps} data-makit-theme=\"product\">\r\n <body {...bodyProps} className=\"makit-product antialiased\">\r\n {bodyStart}\r\n {children}\r\n </body>\r\n </html>\r\n );\r\n}\r\n"],"mappings":";;;;;;AAMA,SAAgB,WAAW,EAAE,WAAW,WAAW,WAAW,YAA6B;CACzF,OACE,oBAAC,QAAD;EAAM,GAAI;EAAW,oBAAiB;YACpC,qBAAC,QAAD;GAAM,GAAI;GAAW,WAAU;aAA/B,CACG,WACA,QACG;;CACF,CAAA;AAEV"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SidebarProps } from "@natsuneko-laboratory/makit-runtime";
|
|
2
|
+
//#region src/components/sidebar.d.ts
|
|
3
|
+
declare function Sidebar({ navigation, currentRoute, components }: SidebarProps): import("react").JSX.Element | null;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { Sidebar };
|
|
6
|
+
//# sourceMappingURL=sidebar.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar.d.mts","names":[],"sources":["../../src/components/sidebar.tsx"],"mappings":";;iBAIgB,UAAU,YAAY,cAAc,cAAc,+BAAY,IAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ChevronDown } from "./icons.mjs";
|
|
2
|
+
import { NavigationItems } from "./navigation-items.mjs";
|
|
3
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/sidebar.tsx
|
|
5
|
+
function Sidebar({ navigation, currentRoute, components }) {
|
|
6
|
+
if (navigation.length === 0) return null;
|
|
7
|
+
const NavigationItems$1 = components?.NavigationItems ?? NavigationItems;
|
|
8
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("aside", {
|
|
9
|
+
className: "sticky top-16 hidden h-[calc(100vh-4rem)] overflow-y-auto px-4 py-8 md:block",
|
|
10
|
+
children: /* @__PURE__ */ jsx("nav", {
|
|
11
|
+
"aria-label": "Documentation navigation",
|
|
12
|
+
children: /* @__PURE__ */ jsx(NavigationItems$1, {
|
|
13
|
+
items: navigation,
|
|
14
|
+
currentRoute
|
|
15
|
+
})
|
|
16
|
+
})
|
|
17
|
+
}), /* @__PURE__ */ jsxs("details", {
|
|
18
|
+
className: "border-b border-[var(--makit-color-border)] px-5 py-3 md:hidden",
|
|
19
|
+
children: [/* @__PURE__ */ jsxs("summary", {
|
|
20
|
+
className: "flex cursor-pointer list-none items-center justify-between text-sm font-medium text-[var(--makit-color-foreground)]",
|
|
21
|
+
children: ["Documentation", /* @__PURE__ */ jsx(ChevronDown, { className: "makit-product-marker size-4 text-[var(--makit-color-subtle)] transition-transform" })]
|
|
22
|
+
}), /* @__PURE__ */ jsx("nav", {
|
|
23
|
+
className: "mt-3",
|
|
24
|
+
"aria-label": "Documentation navigation",
|
|
25
|
+
children: /* @__PURE__ */ jsx(NavigationItems$1, {
|
|
26
|
+
items: navigation,
|
|
27
|
+
currentRoute
|
|
28
|
+
})
|
|
29
|
+
})]
|
|
30
|
+
})] });
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { Sidebar };
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=sidebar.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar.mjs","names":["NavigationItems","ProductNavigationItems"],"sources":["../../src/components/sidebar.tsx"],"sourcesContent":["import type { SidebarProps } from \"@natsuneko-laboratory/makit-runtime\";\r\nimport { ChevronDown } from \"./icons.js\";\r\nimport { NavigationItems as ProductNavigationItems } from \"./navigation-items.js\";\r\n\r\nexport function Sidebar({ navigation, currentRoute, components }: SidebarProps) {\r\n if (navigation.length === 0) return null;\r\n\r\n // Honor a `NavigationItems` override layered on top of this theme\r\n // (THEME §12); fall back to this theme's own list, not the standard one.\r\n const NavigationItems = components?.NavigationItems ?? ProductNavigationItems;\r\n\r\n return (\r\n <>\r\n <aside className=\"sticky top-16 hidden h-[calc(100vh-4rem)] overflow-y-auto px-4 py-8 md:block\">\r\n <nav aria-label=\"Documentation navigation\">\r\n <NavigationItems items={navigation} currentRoute={currentRoute} />\r\n </nav>\r\n </aside>\r\n\r\n {/* Mobile: a JS-free disclosure holding the same tree. */}\r\n <details className=\"border-b border-[var(--makit-color-border)] px-5 py-3 md:hidden\">\r\n <summary className=\"flex cursor-pointer list-none items-center justify-between text-sm font-medium text-[var(--makit-color-foreground)]\">\r\n Documentation\r\n <ChevronDown className=\"makit-product-marker size-4 text-[var(--makit-color-subtle)] transition-transform\" />\r\n </summary>\r\n <nav className=\"mt-3\" aria-label=\"Documentation navigation\">\r\n <NavigationItems items={navigation} currentRoute={currentRoute} />\r\n </nav>\r\n </details>\r\n </>\r\n );\r\n}\r\n"],"mappings":";;;;AAIA,SAAgB,QAAQ,EAAE,YAAY,cAAc,cAA4B;CAC9E,IAAI,WAAW,WAAW,GAAG,OAAO;CAIpC,MAAMA,oBAAkB,YAAY,mBAAmBC;CAEvD,OACE,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,SAAD;EAAO,WAAU;YACf,oBAAC,OAAD;GAAK,cAAW;aACd,oBAACD,mBAAD;IAAiB,OAAO;IAA0B;GAAe,CAAA;EAC9D,CAAA;CACA,CAAA,GAGP,qBAAC,WAAD;EAAS,WAAU;YAAnB,CACE,qBAAC,WAAD;GAAS,WAAU;aAAnB,CAAyI,iBAEvI,oBAAC,aAAD,EAAa,WAAU,oFAAqF,CAAA,CACrG;MACT,oBAAC,OAAD;GAAK,WAAU;GAAO,cAAW;aAC/B,oBAACA,mBAAD;IAAiB,OAAO;IAA0B;GAAe,CAAA;EAC9D,CAAA,CACE;GACT,EAAA,CAAA;AAEN"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { TableOfContentsProps } from "@natsuneko-laboratory/makit-runtime";
|
|
2
|
+
//#region src/components/table-of-contents.d.ts
|
|
3
|
+
declare function TableOfContents({ headings, minDepth, maxDepth, actions }: TableOfContentsProps): import("react").JSX.Element | null;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { TableOfContents };
|
|
6
|
+
//# sourceMappingURL=table-of-contents.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-of-contents.d.mts","names":[],"sources":["../../src/components/table-of-contents.tsx"],"mappings":";;iBAKgB,kBAAkB,UAAU,UAAU,UAAU,WAAW,uCAAoB,IAAA"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useMemo, useState } from "react";
|
|
4
|
+
//#region src/components/table-of-contents.tsx
|
|
5
|
+
function TableOfContents({ headings, minDepth, maxDepth, actions }) {
|
|
6
|
+
const visible = useMemo(() => headings.filter((h) => h.depth >= minDepth && h.depth <= maxDepth && h.id), [
|
|
7
|
+
headings,
|
|
8
|
+
minDepth,
|
|
9
|
+
maxDepth
|
|
10
|
+
]);
|
|
11
|
+
const [activeId, setActiveId] = useState(() => visible[0]?.id);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
if (visible.length === 0) return;
|
|
14
|
+
let frame = 0;
|
|
15
|
+
const updateActiveHeading = () => {
|
|
16
|
+
cancelAnimationFrame(frame);
|
|
17
|
+
frame = requestAnimationFrame(() => {
|
|
18
|
+
const activationLine = 128;
|
|
19
|
+
let nextId = visible[0]?.id;
|
|
20
|
+
for (const heading of visible) {
|
|
21
|
+
const element = document.getElementById(heading.id);
|
|
22
|
+
if (!element) continue;
|
|
23
|
+
if (element.getBoundingClientRect().top <= activationLine) nextId = heading.id;
|
|
24
|
+
else break;
|
|
25
|
+
}
|
|
26
|
+
setActiveId(nextId);
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
updateActiveHeading();
|
|
30
|
+
window.addEventListener("scroll", updateActiveHeading, { passive: true });
|
|
31
|
+
window.addEventListener("hashchange", updateActiveHeading);
|
|
32
|
+
window.addEventListener("resize", updateActiveHeading);
|
|
33
|
+
return () => {
|
|
34
|
+
cancelAnimationFrame(frame);
|
|
35
|
+
window.removeEventListener("scroll", updateActiveHeading);
|
|
36
|
+
window.removeEventListener("hashchange", updateActiveHeading);
|
|
37
|
+
window.removeEventListener("resize", updateActiveHeading);
|
|
38
|
+
};
|
|
39
|
+
}, [visible]);
|
|
40
|
+
if (visible.length === 0) return null;
|
|
41
|
+
return /* @__PURE__ */ jsx("aside", {
|
|
42
|
+
className: "sticky top-16 hidden h-[calc(100vh-4rem)] overflow-y-auto px-4 py-8 xl:block",
|
|
43
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
44
|
+
className: "makit-product-card rounded-2xl border border-[var(--makit-color-border)] bg-[var(--makit-color-surface)] p-4",
|
|
45
|
+
children: [
|
|
46
|
+
/* @__PURE__ */ jsx("h2", {
|
|
47
|
+
className: "mb-3 text-[11px] font-semibold tracking-[0.1em] text-[var(--makit-color-subtle)] uppercase",
|
|
48
|
+
children: "On this page"
|
|
49
|
+
}),
|
|
50
|
+
/* @__PURE__ */ jsx("nav", {
|
|
51
|
+
"aria-label": "Table of contents",
|
|
52
|
+
children: /* @__PURE__ */ jsx("ul", {
|
|
53
|
+
className: "space-y-1",
|
|
54
|
+
children: visible.map((heading) => {
|
|
55
|
+
const isActive = activeId === heading.id;
|
|
56
|
+
return /* @__PURE__ */ jsx("li", {
|
|
57
|
+
style: { paddingLeft: `${(heading.depth - minDepth) * .75}rem` },
|
|
58
|
+
children: /* @__PURE__ */ jsx("a", {
|
|
59
|
+
href: `#${heading.id}`,
|
|
60
|
+
"aria-current": isActive ? "location" : void 0,
|
|
61
|
+
className: isActive ? "flex items-center gap-2 rounded-lg bg-[color-mix(in_srgb,var(--makit-color-accent)_12%,transparent)] px-2.5 py-1.5 text-[13px] leading-5 font-medium text-[var(--makit-color-accent)]" : "flex items-center gap-2 rounded-lg px-2.5 py-1.5 text-[13px] leading-5 text-[var(--makit-color-subtle)] transition hover:bg-[var(--makit-color-muted)] hover:text-[var(--makit-color-foreground)]",
|
|
62
|
+
children: heading.text
|
|
63
|
+
})
|
|
64
|
+
}, heading.id);
|
|
65
|
+
})
|
|
66
|
+
})
|
|
67
|
+
}),
|
|
68
|
+
actions
|
|
69
|
+
]
|
|
70
|
+
})
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
//#endregion
|
|
74
|
+
export { TableOfContents };
|
|
75
|
+
|
|
76
|
+
//# sourceMappingURL=table-of-contents.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-of-contents.mjs","names":[],"sources":["../../src/components/table-of-contents.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport { useEffect, useMemo, useState } from \"react\";\r\nimport type { TableOfContentsProps } from \"@natsuneko-laboratory/makit-runtime\";\r\n\r\nexport function TableOfContents({ headings, minDepth, maxDepth, actions }: TableOfContentsProps) {\r\n const visible = useMemo(\r\n () => headings.filter((h) => h.depth >= minDepth && h.depth <= maxDepth && h.id),\r\n [headings, minDepth, maxDepth],\r\n );\r\n const [activeId, setActiveId] = useState<string | undefined>(() => visible[0]?.id);\r\n\r\n useEffect(() => {\r\n if (visible.length === 0) return;\r\n\r\n let frame = 0;\r\n const updateActiveHeading = () => {\r\n cancelAnimationFrame(frame);\r\n frame = requestAnimationFrame(() => {\r\n // Matches this theme's `scroll-padding-top`.\r\n const activationLine = 128;\r\n let nextId = visible[0]?.id;\r\n\r\n for (const heading of visible) {\r\n const element = document.getElementById(heading.id);\r\n if (!element) continue;\r\n if (element.getBoundingClientRect().top <= activationLine) nextId = heading.id;\r\n else break;\r\n }\r\n\r\n setActiveId(nextId);\r\n });\r\n };\r\n\r\n updateActiveHeading();\r\n window.addEventListener(\"scroll\", updateActiveHeading, { passive: true });\r\n window.addEventListener(\"hashchange\", updateActiveHeading);\r\n window.addEventListener(\"resize\", updateActiveHeading);\r\n\r\n return () => {\r\n cancelAnimationFrame(frame);\r\n window.removeEventListener(\"scroll\", updateActiveHeading);\r\n window.removeEventListener(\"hashchange\", updateActiveHeading);\r\n window.removeEventListener(\"resize\", updateActiveHeading);\r\n };\r\n }, [visible]);\r\n\r\n if (visible.length === 0) return null;\r\n\r\n return (\r\n <aside className=\"sticky top-16 hidden h-[calc(100vh-4rem)] overflow-y-auto px-4 py-8 xl:block\">\r\n <div className=\"makit-product-card rounded-2xl border border-[var(--makit-color-border)] bg-[var(--makit-color-surface)] p-4\">\r\n <h2 className=\"mb-3 text-[11px] font-semibold tracking-[0.1em] text-[var(--makit-color-subtle)] uppercase\">\r\n On this page\r\n </h2>\r\n <nav aria-label=\"Table of contents\">\r\n <ul className=\"space-y-1\">\r\n {visible.map((heading) => {\r\n const isActive = activeId === heading.id;\r\n return (\r\n <li\r\n key={heading.id}\r\n style={{ paddingLeft: `${(heading.depth - minDepth) * 0.75}rem` }}\r\n >\r\n <a\r\n href={`#${heading.id}`}\r\n aria-current={isActive ? \"location\" : undefined}\r\n className={\r\n isActive\r\n ? \"flex items-center gap-2 rounded-lg bg-[color-mix(in_srgb,var(--makit-color-accent)_12%,transparent)] px-2.5 py-1.5 text-[13px] leading-5 font-medium text-[var(--makit-color-accent)]\"\r\n : \"flex items-center gap-2 rounded-lg px-2.5 py-1.5 text-[13px] leading-5 text-[var(--makit-color-subtle)] transition hover:bg-[var(--makit-color-muted)] hover:text-[var(--makit-color-foreground)]\"\r\n }\r\n >\r\n {heading.text}\r\n </a>\r\n </li>\r\n );\r\n })}\r\n </ul>\r\n </nav>\r\n {actions}\r\n </div>\r\n </aside>\r\n );\r\n}\r\n"],"mappings":";;;;AAKA,SAAgB,gBAAgB,EAAE,UAAU,UAAU,UAAU,WAAiC;CAC/F,MAAM,UAAU,cACR,SAAS,QAAQ,MAAM,EAAE,SAAS,YAAY,EAAE,SAAS,YAAY,EAAE,EAAE,GAC/E;EAAC;EAAU;EAAU;CAAQ,CAC/B;CACA,MAAM,CAAC,UAAU,eAAe,eAAmC,QAAQ,EAAE,EAAE,EAAE;CAEjF,gBAAgB;EACd,IAAI,QAAQ,WAAW,GAAG;EAE1B,IAAI,QAAQ;EACZ,MAAM,4BAA4B;GAChC,qBAAqB,KAAK;GAC1B,QAAQ,4BAA4B;IAElC,MAAM,iBAAiB;IACvB,IAAI,SAAS,QAAQ,EAAE,EAAE;IAEzB,KAAK,MAAM,WAAW,SAAS;KAC7B,MAAM,UAAU,SAAS,eAAe,QAAQ,EAAE;KAClD,IAAI,CAAC,SAAS;KACd,IAAI,QAAQ,sBAAsB,CAAC,CAAC,OAAO,gBAAgB,SAAS,QAAQ;UACvE;IACP;IAEA,YAAY,MAAM;GACpB,CAAC;EACH;EAEA,oBAAoB;EACpB,OAAO,iBAAiB,UAAU,qBAAqB,EAAE,SAAS,KAAK,CAAC;EACxE,OAAO,iBAAiB,cAAc,mBAAmB;EACzD,OAAO,iBAAiB,UAAU,mBAAmB;EAErD,aAAa;GACX,qBAAqB,KAAK;GAC1B,OAAO,oBAAoB,UAAU,mBAAmB;GACxD,OAAO,oBAAoB,cAAc,mBAAmB;GAC5D,OAAO,oBAAoB,UAAU,mBAAmB;EAC1D;CACF,GAAG,CAAC,OAAO,CAAC;CAEZ,IAAI,QAAQ,WAAW,GAAG,OAAO;CAEjC,OACE,oBAAC,SAAD;EAAO,WAAU;YACf,qBAAC,OAAD;GAAK,WAAU;aAAf;IACE,oBAAC,MAAD;KAAI,WAAU;eAA6F;IAEvG,CAAA;IACJ,oBAAC,OAAD;KAAK,cAAW;eACd,oBAAC,MAAD;MAAI,WAAU;gBACX,QAAQ,KAAK,YAAY;OACxB,MAAM,WAAW,aAAa,QAAQ;OACtC,OACE,oBAAC,MAAD;QAEE,OAAO,EAAE,aAAa,IAAI,QAAQ,QAAQ,YAAY,IAAK,KAAK;kBAEhE,oBAAC,KAAD;SACE,MAAM,IAAI,QAAQ;SAClB,gBAAc,WAAW,aAAa,KAAA;SACtC,WACE,WACI,0LACA;mBAGL,QAAQ;QACR,CAAA;OACD,GAdG,QAAQ,EAcX;MAER,CAAC;KACC,CAAA;IACD,CAAA;IACJ;GACE;;CACA,CAAA;AAEX"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ThemeVariablesProps } from "@natsuneko-laboratory/makit-runtime";
|
|
2
|
+
//#region src/components/theme-variables.d.ts
|
|
3
|
+
declare function ThemeVariables({ theme }: ThemeVariablesProps): import("react").JSX.Element;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { ThemeVariables };
|
|
6
|
+
//# sourceMappingURL=theme-variables.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-variables.d.mts","names":[],"sources":["../../src/components/theme-variables.tsx"],"mappings":";;iBA+DgB,iBAAiB,SAAS,sCAAmB,IAAA"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
//#region src/components/theme-variables.tsx
|
|
3
|
+
/**
|
|
4
|
+
* The accent drives the logo mark, the active navigation pill, and the home
|
|
5
|
+
* page's gradient, so each name carries a pair tuned for contrast against
|
|
6
|
+
* this theme's two backgrounds rather than a single hue.
|
|
7
|
+
*/
|
|
8
|
+
const ACCENTS = {
|
|
9
|
+
indigo: {
|
|
10
|
+
light: "#4f46e5",
|
|
11
|
+
dark: "#818cf8"
|
|
12
|
+
},
|
|
13
|
+
violet: {
|
|
14
|
+
light: "#7c3aed",
|
|
15
|
+
dark: "#a78bfa"
|
|
16
|
+
},
|
|
17
|
+
blue: {
|
|
18
|
+
light: "#2563eb",
|
|
19
|
+
dark: "#60a5fa"
|
|
20
|
+
},
|
|
21
|
+
sky: {
|
|
22
|
+
light: "#0284c7",
|
|
23
|
+
dark: "#38bdf8"
|
|
24
|
+
},
|
|
25
|
+
teal: {
|
|
26
|
+
light: "#0d9488",
|
|
27
|
+
dark: "#2dd4bf"
|
|
28
|
+
},
|
|
29
|
+
emerald: {
|
|
30
|
+
light: "#059669",
|
|
31
|
+
dark: "#34d399"
|
|
32
|
+
},
|
|
33
|
+
rose: {
|
|
34
|
+
light: "#e11d48",
|
|
35
|
+
dark: "#fb7185"
|
|
36
|
+
},
|
|
37
|
+
amber: {
|
|
38
|
+
light: "#d97706",
|
|
39
|
+
dark: "#fbbf24"
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
function resolveAccent(accentColor) {
|
|
43
|
+
if (!accentColor) return ACCENTS.indigo;
|
|
44
|
+
const named = ACCENTS[accentColor.toLowerCase()];
|
|
45
|
+
if (named) return named;
|
|
46
|
+
return {
|
|
47
|
+
light: accentColor,
|
|
48
|
+
dark: accentColor
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
const RADIUS = {
|
|
52
|
+
none: "0px",
|
|
53
|
+
small: "0.375rem",
|
|
54
|
+
medium: "0.625rem",
|
|
55
|
+
large: "0.875rem"
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Replaces the standard palette (THEME §13.3). The grays are slightly
|
|
59
|
+
* blue-tinted (slate rather than zinc) so they sit under a saturated accent
|
|
60
|
+
* without looking muddy, and `--makit-color-surface` is deliberately lifted
|
|
61
|
+
* off the background in both schemes — this theme leans on cards.
|
|
62
|
+
*/
|
|
63
|
+
const LIGHT = [
|
|
64
|
+
"--makit-color-background:#ffffff",
|
|
65
|
+
"--makit-color-surface:#ffffff",
|
|
66
|
+
"--makit-color-foreground:#0f172a",
|
|
67
|
+
"--makit-color-subtle:#64748b",
|
|
68
|
+
"--makit-color-muted:#f1f5f9",
|
|
69
|
+
"--makit-color-border:#e2e8f0",
|
|
70
|
+
"--makit-color-border-strong:#cbd5e1"
|
|
71
|
+
].join(";");
|
|
72
|
+
const DARK = [
|
|
73
|
+
"--makit-color-background:#0b1120",
|
|
74
|
+
"--makit-color-surface:#131c2f",
|
|
75
|
+
"--makit-color-foreground:#e8edf7",
|
|
76
|
+
"--makit-color-subtle:#94a3b8",
|
|
77
|
+
"--makit-color-muted:#1c273d",
|
|
78
|
+
"--makit-color-border:#22304a",
|
|
79
|
+
"--makit-color-border-strong:#38486a"
|
|
80
|
+
].join(";");
|
|
81
|
+
function ThemeVariables({ theme }) {
|
|
82
|
+
const accent = resolveAccent(theme.accentColor);
|
|
83
|
+
const radius = RADIUS[theme.radius] ?? RADIUS.large;
|
|
84
|
+
return /* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: `:root{--makit-color-accent:${accent.light};${LIGHT};--makit-radius:${radius};--makit-product-shadow:0 1px 2px rgb(15 23 42 / 0.04),0 8px 24px -12px rgb(15 23 42 / 0.12);}
|
|
85
|
+
:root[data-theme="dark"]{--makit-color-accent:${accent.dark};${DARK};--makit-product-shadow:0 1px 2px rgb(0 0 0 / 0.3),0 8px 24px -12px rgb(0 0 0 / 0.6);}
|
|
86
|
+
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]):not([data-theme="dark"]){--makit-color-accent:${accent.dark};${DARK};--makit-product-shadow:0 1px 2px rgb(0 0 0 / 0.3),0 8px 24px -12px rgb(0 0 0 / 0.6);}}
|
|
87
|
+
.makit-header-logo-dark{display:none}:root[data-theme="dark"] .makit-header-logo-light{display:none}:root[data-theme="dark"] .makit-header-logo-dark{display:block}@media (prefers-color-scheme: dark){:root:not([data-theme="light"]):not([data-theme="dark"]) .makit-header-logo-light{display:none}:root:not([data-theme="light"]):not([data-theme="dark"]) .makit-header-logo-dark{display:block}}` } });
|
|
88
|
+
}
|
|
89
|
+
//#endregion
|
|
90
|
+
export { ThemeVariables };
|
|
91
|
+
|
|
92
|
+
//# sourceMappingURL=theme-variables.mjs.map
|