@publish.os/nextjs 0.0.1-alpha.1

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 (94) hide show
  1. package/README.md +7 -0
  2. package/dist/cache/tags.cjs +76 -0
  3. package/dist/cache/tags.d.cts +12 -0
  4. package/dist/cache/tags.d.ts +12 -0
  5. package/dist/cache/tags.js +51 -0
  6. package/dist/components/color-palette.cjs +408 -0
  7. package/dist/components/color-palette.d.cts +5 -0
  8. package/dist/components/color-palette.d.ts +5 -0
  9. package/dist/components/color-palette.js +388 -0
  10. package/dist/components/nav-breadcrumb.cjs +141 -0
  11. package/dist/components/nav-breadcrumb.d.cts +9 -0
  12. package/dist/components/nav-breadcrumb.d.ts +9 -0
  13. package/dist/components/nav-breadcrumb.js +107 -0
  14. package/dist/components/page-list.cjs +68 -0
  15. package/dist/components/page-list.d.cts +11 -0
  16. package/dist/components/page-list.d.ts +11 -0
  17. package/dist/components/page-list.js +33 -0
  18. package/dist/components/providers.cjs +44 -0
  19. package/dist/components/providers.d.cts +8 -0
  20. package/dist/components/providers.d.ts +8 -0
  21. package/dist/components/providers.js +20 -0
  22. package/dist/components/site-header.cjs +302 -0
  23. package/dist/components/site-header.d.cts +12 -0
  24. package/dist/components/site-header.d.ts +12 -0
  25. package/dist/components/site-header.js +268 -0
  26. package/dist/components/theme-toggle.cjs +147 -0
  27. package/dist/components/theme-toggle.d.cts +5 -0
  28. package/dist/components/theme-toggle.d.ts +5 -0
  29. package/dist/components/theme-toggle.js +123 -0
  30. package/dist/config/createNextConfig.cjs +52 -0
  31. package/dist/config/createNextConfig.d.cts +8 -0
  32. package/dist/config/createNextConfig.d.ts +8 -0
  33. package/dist/config/createNextConfig.js +27 -0
  34. package/dist/index.cjs +347 -0
  35. package/dist/index.d.cts +14 -0
  36. package/dist/index.d.ts +14 -0
  37. package/dist/index.js +299 -0
  38. package/dist/layouts/group.cjs +157 -0
  39. package/dist/layouts/group.d.cts +15 -0
  40. package/dist/layouts/group.d.ts +15 -0
  41. package/dist/layouts/group.js +132 -0
  42. package/dist/mdx/error-boundary.cjs +94 -0
  43. package/dist/mdx/error-boundary.d.cts +13 -0
  44. package/dist/mdx/error-boundary.d.ts +13 -0
  45. package/dist/mdx/error-boundary.js +70 -0
  46. package/dist/mdx/error-fallback.cjs +58 -0
  47. package/dist/mdx/error-fallback.d.cts +9 -0
  48. package/dist/mdx/error-fallback.d.ts +9 -0
  49. package/dist/mdx/error-fallback.js +33 -0
  50. package/dist/mdx/mdx.cjs +182 -0
  51. package/dist/mdx/mdx.d.cts +10 -0
  52. package/dist/mdx/mdx.d.ts +10 -0
  53. package/dist/mdx/mdx.js +147 -0
  54. package/dist/pages/group.cjs +162 -0
  55. package/dist/pages/group.d.cts +15 -0
  56. package/dist/pages/group.d.ts +15 -0
  57. package/dist/pages/group.js +136 -0
  58. package/dist/pages/leaf.cjs +203 -0
  59. package/dist/pages/leaf.d.cts +23 -0
  60. package/dist/pages/leaf.d.ts +23 -0
  61. package/dist/pages/leaf.js +176 -0
  62. package/dist/pages/root.cjs +127 -0
  63. package/dist/pages/root.d.cts +14 -0
  64. package/dist/pages/root.d.ts +14 -0
  65. package/dist/pages/root.js +101 -0
  66. package/dist/resolvers/manifest-resolver.cjs +107 -0
  67. package/dist/resolvers/manifest-resolver.d.cts +13 -0
  68. package/dist/resolvers/manifest-resolver.d.ts +13 -0
  69. package/dist/resolvers/manifest-resolver.js +79 -0
  70. package/dist/routes/llms.cjs +101 -0
  71. package/dist/routes/llms.d.cts +7 -0
  72. package/dist/routes/llms.d.ts +7 -0
  73. package/dist/routes/llms.js +76 -0
  74. package/dist/routes/robots.cjs +94 -0
  75. package/dist/routes/robots.d.cts +5 -0
  76. package/dist/routes/robots.d.ts +5 -0
  77. package/dist/routes/robots.js +69 -0
  78. package/dist/routes/sitemap.cjs +108 -0
  79. package/dist/routes/sitemap.d.cts +5 -0
  80. package/dist/routes/sitemap.d.ts +5 -0
  81. package/dist/routes/sitemap.js +83 -0
  82. package/dist/types.cjs +18 -0
  83. package/dist/types.d.cts +144 -0
  84. package/dist/types.d.ts +144 -0
  85. package/dist/types.js +0 -0
  86. package/dist/utils/cn.cjs +49 -0
  87. package/dist/utils/cn.d.cts +15 -0
  88. package/dist/utils/cn.d.ts +15 -0
  89. package/dist/utils/cn.js +24 -0
  90. package/dist/utils/pretty-date.cjs +55 -0
  91. package/dist/utils/pretty-date.d.cts +6 -0
  92. package/dist/utils/pretty-date.d.ts +6 -0
  93. package/dist/utils/pretty-date.js +30 -0
  94. package/package.json +100 -0
@@ -0,0 +1,268 @@
1
+ "use client";
2
+
3
+ // src/components/site-header.tsx
4
+ import Link2 from "next/link";
5
+ import { usePathname as usePathname2 } from "next/navigation";
6
+
7
+ // src/components/nav-breadcrumb.tsx
8
+ import Link from "next/link";
9
+ import { usePathname } from "next/navigation";
10
+ import { jsx, jsxs } from "react/jsx-runtime";
11
+ function titleFor(node) {
12
+ return node.title;
13
+ }
14
+ function pathFor(node) {
15
+ if (node.type === "page") return node.path;
16
+ if (node.type === "link") return node.href;
17
+ if (node.type === "section") return node.path;
18
+ return void 0;
19
+ }
20
+ function rankFor(node) {
21
+ if (node.type === "page" || node.type === "section") return 2;
22
+ if (node.type === "folder") return 1;
23
+ return 0;
24
+ }
25
+ function findCrumbs(nodes, pathname, parents = []) {
26
+ const matches = [];
27
+ for (const node of nodes) {
28
+ const path = pathFor(node);
29
+ const nextParents = path ? [...parents, { title: titleFor(node), path }] : parents;
30
+ if (path === pathname) {
31
+ matches.push({
32
+ crumbs: nextParents.map((crumb, index) => ({
33
+ ...crumb,
34
+ current: index === nextParents.length - 1
35
+ })),
36
+ pathLength: path.length,
37
+ rank: rankFor(node)
38
+ });
39
+ }
40
+ if (node.type === "section" || node.type === "folder") {
41
+ const childMatch = findCrumbs(node.children, pathname, nextParents);
42
+ if (childMatch) matches.push(childMatch);
43
+ }
44
+ }
45
+ return matches.sort(
46
+ (a, b) => b.rank - a.rank || b.pathLength - a.pathLength || b.crumbs.length - a.crumbs.length
47
+ )[0] ?? null;
48
+ }
49
+ function groupFallback(tree, pathname) {
50
+ const groups = tree.map((group) => ({ group, path: pathFor(group) })).filter(
51
+ (entry) => typeof entry.path === "string"
52
+ ).sort((a, b) => b.path.length - a.path.length);
53
+ for (const { group, path } of groups) {
54
+ if (pathname.startsWith(`${path}/`)) {
55
+ return [{ title: titleFor(group), path }];
56
+ }
57
+ }
58
+ return [];
59
+ }
60
+ function buildCrumbs(site, tree, pathname) {
61
+ const root = {
62
+ title: site.title,
63
+ path: "/",
64
+ current: pathname === "/"
65
+ };
66
+ if (pathname === "/") return [root];
67
+ const treeMatch = findCrumbs(tree, pathname);
68
+ if (treeMatch) return [root, ...treeMatch.crumbs];
69
+ return [
70
+ root,
71
+ ...groupFallback(tree, pathname).map((crumb) => ({
72
+ ...crumb,
73
+ current: false
74
+ }))
75
+ ];
76
+ }
77
+ function NavBreadcrumb({
78
+ site,
79
+ tree
80
+ }) {
81
+ const pathname = usePathname() || "/";
82
+ const crumbs = buildCrumbs(site, tree, pathname);
83
+ return /* @__PURE__ */ jsx(
84
+ "nav",
85
+ {
86
+ "aria-label": "Breadcrumb",
87
+ className: "flex min-w-0 items-center gap-1.5 text-sm",
88
+ children: crumbs.map((crumb, index) => /* @__PURE__ */ jsxs("span", { className: "flex min-w-0 items-center gap-1.5", children: [
89
+ index > 0 && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "text-stroke-3", children: "/" }),
90
+ crumb.current ? /* @__PURE__ */ jsx(
91
+ "span",
92
+ {
93
+ "aria-current": "page",
94
+ className: "truncate font-medium text-foreground-1",
95
+ children: crumb.title
96
+ }
97
+ ) : /* @__PURE__ */ jsx(
98
+ Link,
99
+ {
100
+ className: "truncate text-foreground-3 no-underline hover:text-accent-1",
101
+ href: crumb.path,
102
+ children: crumb.title
103
+ }
104
+ )
105
+ ] }, crumb.path))
106
+ }
107
+ );
108
+ }
109
+
110
+ // src/components/theme-toggle.tsx
111
+ import { useTheme } from "next-themes";
112
+ import { useEffect, useMemo, useState } from "react";
113
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
114
+ var themeOrder = ["system", "light", "dark"];
115
+ function SunIcon() {
116
+ return /* @__PURE__ */ jsxs2(
117
+ "svg",
118
+ {
119
+ "aria-hidden": "true",
120
+ fill: "none",
121
+ height: "16",
122
+ viewBox: "0 0 16 16",
123
+ width: "16",
124
+ children: [
125
+ /* @__PURE__ */ jsx2("circle", { cx: "8", cy: "8", r: "3", stroke: "currentColor", strokeWidth: "1.5" }),
126
+ /* @__PURE__ */ jsx2(
127
+ "path",
128
+ {
129
+ d: "M8 1.5v1.2M8 13.3v1.2M1.5 8h1.2M13.3 8h1.2M3.4 3.4l.9.9M11.7 11.7l.9.9M12.6 3.4l-.9.9M4.3 11.7l-.9.9",
130
+ stroke: "currentColor",
131
+ strokeLinecap: "round",
132
+ strokeWidth: "1.5"
133
+ }
134
+ )
135
+ ]
136
+ }
137
+ );
138
+ }
139
+ function MoonIcon() {
140
+ return /* @__PURE__ */ jsx2(
141
+ "svg",
142
+ {
143
+ "aria-hidden": "true",
144
+ fill: "none",
145
+ height: "16",
146
+ viewBox: "0 0 16 16",
147
+ width: "16",
148
+ children: /* @__PURE__ */ jsx2(
149
+ "path",
150
+ {
151
+ d: "M13.2 9.6A5.5 5.5 0 0 1 6.4 2.8a5.7 5.7 0 1 0 6.8 6.8Z",
152
+ stroke: "currentColor",
153
+ strokeLinejoin: "round",
154
+ strokeWidth: "1.5"
155
+ }
156
+ )
157
+ }
158
+ );
159
+ }
160
+ function SystemIcon() {
161
+ return /* @__PURE__ */ jsxs2(
162
+ "svg",
163
+ {
164
+ "aria-hidden": "true",
165
+ fill: "none",
166
+ height: "16",
167
+ viewBox: "0 0 16 16",
168
+ width: "16",
169
+ children: [
170
+ /* @__PURE__ */ jsx2(
171
+ "rect",
172
+ {
173
+ height: "8.5",
174
+ rx: "1.5",
175
+ stroke: "currentColor",
176
+ strokeWidth: "1.5",
177
+ width: "12",
178
+ x: "2",
179
+ y: "2.5"
180
+ }
181
+ ),
182
+ /* @__PURE__ */ jsx2(
183
+ "path",
184
+ {
185
+ d: "M6.5 13.5h3M8 11v2.5",
186
+ stroke: "currentColor",
187
+ strokeLinecap: "round",
188
+ strokeWidth: "1.5"
189
+ }
190
+ )
191
+ ]
192
+ }
193
+ );
194
+ }
195
+ function Icon({ theme }) {
196
+ if (theme === "light") return /* @__PURE__ */ jsx2(SunIcon, {});
197
+ if (theme === "dark") return /* @__PURE__ */ jsx2(MoonIcon, {});
198
+ return /* @__PURE__ */ jsx2(SystemIcon, {});
199
+ }
200
+ function normalizeTheme(theme) {
201
+ if (theme === "light" || theme === "dark") return theme;
202
+ return "system";
203
+ }
204
+ function ThemeToggle() {
205
+ const { theme, setTheme } = useTheme();
206
+ const [mounted, setMounted] = useState(false);
207
+ const activeTheme = normalizeTheme(theme);
208
+ const nextTheme = useMemo(() => {
209
+ const index = themeOrder.indexOf(activeTheme);
210
+ return themeOrder[(index + 1) % themeOrder.length] ?? "system";
211
+ }, [activeTheme]);
212
+ useEffect(() => {
213
+ setMounted(true);
214
+ }, []);
215
+ const label = mounted ? `Switch to ${nextTheme} theme` : "Theme preference";
216
+ return /* @__PURE__ */ jsx2(
217
+ "button",
218
+ {
219
+ "aria-label": label,
220
+ className: "inline-flex size-8 shrink-0 items-center justify-center rounded-button border border-stroke-2 bg-surface-2 text-foreground-2 transition-colors hover:border-stroke-1 hover:bg-surface-hover hover:text-foreground-1",
221
+ onClick: () => setTheme(nextTheme),
222
+ title: label,
223
+ type: "button",
224
+ children: /* @__PURE__ */ jsx2(Icon, { theme: mounted ? activeTheme : "system" })
225
+ }
226
+ );
227
+ }
228
+
229
+ // src/components/site-header.tsx
230
+ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
231
+ function hasPath(node) {
232
+ return "path" in node && typeof node.path === "string";
233
+ }
234
+ function SiteHeader({
235
+ site,
236
+ siteTitle,
237
+ tree,
238
+ currentPath
239
+ }) {
240
+ const headerSite = site ?? { title: siteTitle ?? "Site" };
241
+ const livePathname = usePathname2() || "/";
242
+ const pathname = currentPath ?? livePathname;
243
+ const groups = tree.filter(hasPath);
244
+ const activeGroupPath = groups.map((group) => group.path).filter((path) => pathname === path || pathname.startsWith(`${path}/`)).sort((a, b) => b.length - a.length)[0];
245
+ return /* @__PURE__ */ jsx3("header", { className: "border-b border-stroke-3 bg-surface-2 backdrop-blur", children: /* @__PURE__ */ jsxs3("div", { className: "mx-auto flex max-w-6xl flex-col gap-3 px-6 py-3 md:flex-row md:items-center md:justify-between lg:px-10", children: [
246
+ /* @__PURE__ */ jsx3("div", { className: "min-w-0", children: /* @__PURE__ */ jsx3(NavBreadcrumb, { site: headerSite, tree }) }),
247
+ /* @__PURE__ */ jsxs3("div", { className: "flex shrink-0 items-center gap-4", children: [
248
+ groups.length >= 2 && /* @__PURE__ */ jsx3("nav", { "aria-label": "Groups", className: "flex flex-wrap gap-3 text-sm", children: groups.map((group) => {
249
+ const path = group.path;
250
+ const active = path === activeGroupPath;
251
+ return /* @__PURE__ */ jsx3(
252
+ Link2,
253
+ {
254
+ "aria-current": active ? "page" : void 0,
255
+ className: active ? "font-medium text-accent-1 underline underline-offset-4" : "text-foreground-2 underline-offset-4 hover:text-accent-1 hover:underline",
256
+ href: path,
257
+ children: group.title
258
+ },
259
+ group.id
260
+ );
261
+ }) }),
262
+ /* @__PURE__ */ jsx3(ThemeToggle, {})
263
+ ] })
264
+ ] }) });
265
+ }
266
+ export {
267
+ SiteHeader
268
+ };
@@ -0,0 +1,147 @@
1
+ "use strict";
2
+ "use client";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/components/theme-toggle.tsx
22
+ var theme_toggle_exports = {};
23
+ __export(theme_toggle_exports, {
24
+ ThemeToggle: () => ThemeToggle
25
+ });
26
+ module.exports = __toCommonJS(theme_toggle_exports);
27
+ var import_next_themes = require("next-themes");
28
+ var import_react = require("react");
29
+ var import_jsx_runtime = require("react/jsx-runtime");
30
+ var themeOrder = ["system", "light", "dark"];
31
+ function SunIcon() {
32
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
33
+ "svg",
34
+ {
35
+ "aria-hidden": "true",
36
+ fill: "none",
37
+ height: "16",
38
+ viewBox: "0 0 16 16",
39
+ width: "16",
40
+ children: [
41
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "8", cy: "8", r: "3", stroke: "currentColor", strokeWidth: "1.5" }),
42
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
43
+ "path",
44
+ {
45
+ d: "M8 1.5v1.2M8 13.3v1.2M1.5 8h1.2M13.3 8h1.2M3.4 3.4l.9.9M11.7 11.7l.9.9M12.6 3.4l-.9.9M4.3 11.7l-.9.9",
46
+ stroke: "currentColor",
47
+ strokeLinecap: "round",
48
+ strokeWidth: "1.5"
49
+ }
50
+ )
51
+ ]
52
+ }
53
+ );
54
+ }
55
+ function MoonIcon() {
56
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
57
+ "svg",
58
+ {
59
+ "aria-hidden": "true",
60
+ fill: "none",
61
+ height: "16",
62
+ viewBox: "0 0 16 16",
63
+ width: "16",
64
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
65
+ "path",
66
+ {
67
+ d: "M13.2 9.6A5.5 5.5 0 0 1 6.4 2.8a5.7 5.7 0 1 0 6.8 6.8Z",
68
+ stroke: "currentColor",
69
+ strokeLinejoin: "round",
70
+ strokeWidth: "1.5"
71
+ }
72
+ )
73
+ }
74
+ );
75
+ }
76
+ function SystemIcon() {
77
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
78
+ "svg",
79
+ {
80
+ "aria-hidden": "true",
81
+ fill: "none",
82
+ height: "16",
83
+ viewBox: "0 0 16 16",
84
+ width: "16",
85
+ children: [
86
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
87
+ "rect",
88
+ {
89
+ height: "8.5",
90
+ rx: "1.5",
91
+ stroke: "currentColor",
92
+ strokeWidth: "1.5",
93
+ width: "12",
94
+ x: "2",
95
+ y: "2.5"
96
+ }
97
+ ),
98
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
99
+ "path",
100
+ {
101
+ d: "M6.5 13.5h3M8 11v2.5",
102
+ stroke: "currentColor",
103
+ strokeLinecap: "round",
104
+ strokeWidth: "1.5"
105
+ }
106
+ )
107
+ ]
108
+ }
109
+ );
110
+ }
111
+ function Icon({ theme }) {
112
+ if (theme === "light") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SunIcon, {});
113
+ if (theme === "dark") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MoonIcon, {});
114
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SystemIcon, {});
115
+ }
116
+ function normalizeTheme(theme) {
117
+ if (theme === "light" || theme === "dark") return theme;
118
+ return "system";
119
+ }
120
+ function ThemeToggle() {
121
+ const { theme, setTheme } = (0, import_next_themes.useTheme)();
122
+ const [mounted, setMounted] = (0, import_react.useState)(false);
123
+ const activeTheme = normalizeTheme(theme);
124
+ const nextTheme = (0, import_react.useMemo)(() => {
125
+ const index = themeOrder.indexOf(activeTheme);
126
+ return themeOrder[(index + 1) % themeOrder.length] ?? "system";
127
+ }, [activeTheme]);
128
+ (0, import_react.useEffect)(() => {
129
+ setMounted(true);
130
+ }, []);
131
+ const label = mounted ? `Switch to ${nextTheme} theme` : "Theme preference";
132
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
133
+ "button",
134
+ {
135
+ "aria-label": label,
136
+ className: "inline-flex size-8 shrink-0 items-center justify-center rounded-button border border-stroke-2 bg-surface-2 text-foreground-2 transition-colors hover:border-stroke-1 hover:bg-surface-hover hover:text-foreground-1",
137
+ onClick: () => setTheme(nextTheme),
138
+ title: label,
139
+ type: "button",
140
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { theme: mounted ? activeTheme : "system" })
141
+ }
142
+ );
143
+ }
144
+ // Annotate the CommonJS export names for ESM import in node:
145
+ 0 && (module.exports = {
146
+ ThemeToggle
147
+ });
@@ -0,0 +1,5 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ declare function ThemeToggle(): react_jsx_runtime.JSX.Element;
4
+
5
+ export { ThemeToggle };
@@ -0,0 +1,5 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ declare function ThemeToggle(): react_jsx_runtime.JSX.Element;
4
+
5
+ export { ThemeToggle };
@@ -0,0 +1,123 @@
1
+ "use client";
2
+
3
+ // src/components/theme-toggle.tsx
4
+ import { useTheme } from "next-themes";
5
+ import { useEffect, useMemo, useState } from "react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ var themeOrder = ["system", "light", "dark"];
8
+ function SunIcon() {
9
+ return /* @__PURE__ */ jsxs(
10
+ "svg",
11
+ {
12
+ "aria-hidden": "true",
13
+ fill: "none",
14
+ height: "16",
15
+ viewBox: "0 0 16 16",
16
+ width: "16",
17
+ children: [
18
+ /* @__PURE__ */ jsx("circle", { cx: "8", cy: "8", r: "3", stroke: "currentColor", strokeWidth: "1.5" }),
19
+ /* @__PURE__ */ jsx(
20
+ "path",
21
+ {
22
+ d: "M8 1.5v1.2M8 13.3v1.2M1.5 8h1.2M13.3 8h1.2M3.4 3.4l.9.9M11.7 11.7l.9.9M12.6 3.4l-.9.9M4.3 11.7l-.9.9",
23
+ stroke: "currentColor",
24
+ strokeLinecap: "round",
25
+ strokeWidth: "1.5"
26
+ }
27
+ )
28
+ ]
29
+ }
30
+ );
31
+ }
32
+ function MoonIcon() {
33
+ return /* @__PURE__ */ jsx(
34
+ "svg",
35
+ {
36
+ "aria-hidden": "true",
37
+ fill: "none",
38
+ height: "16",
39
+ viewBox: "0 0 16 16",
40
+ width: "16",
41
+ children: /* @__PURE__ */ jsx(
42
+ "path",
43
+ {
44
+ d: "M13.2 9.6A5.5 5.5 0 0 1 6.4 2.8a5.7 5.7 0 1 0 6.8 6.8Z",
45
+ stroke: "currentColor",
46
+ strokeLinejoin: "round",
47
+ strokeWidth: "1.5"
48
+ }
49
+ )
50
+ }
51
+ );
52
+ }
53
+ function SystemIcon() {
54
+ return /* @__PURE__ */ jsxs(
55
+ "svg",
56
+ {
57
+ "aria-hidden": "true",
58
+ fill: "none",
59
+ height: "16",
60
+ viewBox: "0 0 16 16",
61
+ width: "16",
62
+ children: [
63
+ /* @__PURE__ */ jsx(
64
+ "rect",
65
+ {
66
+ height: "8.5",
67
+ rx: "1.5",
68
+ stroke: "currentColor",
69
+ strokeWidth: "1.5",
70
+ width: "12",
71
+ x: "2",
72
+ y: "2.5"
73
+ }
74
+ ),
75
+ /* @__PURE__ */ jsx(
76
+ "path",
77
+ {
78
+ d: "M6.5 13.5h3M8 11v2.5",
79
+ stroke: "currentColor",
80
+ strokeLinecap: "round",
81
+ strokeWidth: "1.5"
82
+ }
83
+ )
84
+ ]
85
+ }
86
+ );
87
+ }
88
+ function Icon({ theme }) {
89
+ if (theme === "light") return /* @__PURE__ */ jsx(SunIcon, {});
90
+ if (theme === "dark") return /* @__PURE__ */ jsx(MoonIcon, {});
91
+ return /* @__PURE__ */ jsx(SystemIcon, {});
92
+ }
93
+ function normalizeTheme(theme) {
94
+ if (theme === "light" || theme === "dark") return theme;
95
+ return "system";
96
+ }
97
+ function ThemeToggle() {
98
+ const { theme, setTheme } = useTheme();
99
+ const [mounted, setMounted] = useState(false);
100
+ const activeTheme = normalizeTheme(theme);
101
+ const nextTheme = useMemo(() => {
102
+ const index = themeOrder.indexOf(activeTheme);
103
+ return themeOrder[(index + 1) % themeOrder.length] ?? "system";
104
+ }, [activeTheme]);
105
+ useEffect(() => {
106
+ setMounted(true);
107
+ }, []);
108
+ const label = mounted ? `Switch to ${nextTheme} theme` : "Theme preference";
109
+ return /* @__PURE__ */ jsx(
110
+ "button",
111
+ {
112
+ "aria-label": label,
113
+ className: "inline-flex size-8 shrink-0 items-center justify-center rounded-button border border-stroke-2 bg-surface-2 text-foreground-2 transition-colors hover:border-stroke-1 hover:bg-surface-hover hover:text-foreground-1",
114
+ onClick: () => setTheme(nextTheme),
115
+ title: label,
116
+ type: "button",
117
+ children: /* @__PURE__ */ jsx(Icon, { theme: mounted ? activeTheme : "system" })
118
+ }
119
+ );
120
+ }
121
+ export {
122
+ ThemeToggle
123
+ };
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/config/createNextConfig.ts
21
+ var createNextConfig_exports = {};
22
+ __export(createNextConfig_exports, {
23
+ createNextConfig: () => createNextConfig
24
+ });
25
+ module.exports = __toCommonJS(createNextConfig_exports);
26
+ function createNextConfig(_options) {
27
+ return {
28
+ transpilePackages: ["@publish.os/nextjs"],
29
+ cacheComponents: true,
30
+ cacheLife: {
31
+ page: {
32
+ stale: 60 * 60 * 24,
33
+ revalidate: 60 * 60 * 24 * 30,
34
+ expire: 60 * 60 * 24 * 365
35
+ },
36
+ feed: {
37
+ stale: 60 * 60,
38
+ revalidate: 60 * 60 * 6,
39
+ expire: 60 * 60 * 24 * 7
40
+ },
41
+ sitemap: {
42
+ stale: 60 * 60,
43
+ revalidate: 60 * 60 * 24,
44
+ expire: 60 * 60 * 24 * 30
45
+ }
46
+ }
47
+ };
48
+ }
49
+ // Annotate the CommonJS export names for ESM import in node:
50
+ 0 && (module.exports = {
51
+ createNextConfig
52
+ });
@@ -0,0 +1,8 @@
1
+ import { NextConfig } from 'next';
2
+
3
+ interface CreateNextConfigOptions {
4
+ outputDir: string;
5
+ }
6
+ declare function createNextConfig(_options: CreateNextConfigOptions): NextConfig;
7
+
8
+ export { type CreateNextConfigOptions, createNextConfig };
@@ -0,0 +1,8 @@
1
+ import { NextConfig } from 'next';
2
+
3
+ interface CreateNextConfigOptions {
4
+ outputDir: string;
5
+ }
6
+ declare function createNextConfig(_options: CreateNextConfigOptions): NextConfig;
7
+
8
+ export { type CreateNextConfigOptions, createNextConfig };
@@ -0,0 +1,27 @@
1
+ // src/config/createNextConfig.ts
2
+ function createNextConfig(_options) {
3
+ return {
4
+ transpilePackages: ["@publish.os/nextjs"],
5
+ cacheComponents: true,
6
+ cacheLife: {
7
+ page: {
8
+ stale: 60 * 60 * 24,
9
+ revalidate: 60 * 60 * 24 * 30,
10
+ expire: 60 * 60 * 24 * 365
11
+ },
12
+ feed: {
13
+ stale: 60 * 60,
14
+ revalidate: 60 * 60 * 6,
15
+ expire: 60 * 60 * 24 * 7
16
+ },
17
+ sitemap: {
18
+ stale: 60 * 60,
19
+ revalidate: 60 * 60 * 24,
20
+ expire: 60 * 60 * 24 * 30
21
+ }
22
+ }
23
+ };
24
+ }
25
+ export {
26
+ createNextConfig
27
+ };