@noxion/renderer 0.0.1 → 0.1.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/README.md +1 -1
- package/dist/components/EmptyState.d.ts +2 -1
- package/dist/components/EmptyState.d.ts.map +1 -1
- package/dist/components/EmptyState.js +2 -17
- package/dist/components/EmptyState.js.map +1 -1
- package/dist/components/Footer.d.ts +3 -1
- package/dist/components/Footer.d.ts.map +1 -1
- package/dist/components/Footer.js +2 -10
- package/dist/components/Footer.js.map +1 -1
- package/dist/components/Header.d.ts +3 -1
- package/dist/components/Header.d.ts.map +1 -1
- package/dist/components/Header.js +2 -18
- package/dist/components/Header.js.map +1 -1
- package/dist/components/NotionPage.d.ts +1 -4
- package/dist/components/NotionPage.d.ts.map +1 -1
- package/dist/components/NotionPage.js +31 -16
- package/dist/components/NotionPage.js.map +1 -1
- package/dist/components/PostCard.d.ts +3 -1
- package/dist/components/PostCard.d.ts.map +1 -1
- package/dist/components/PostCard.js +5 -41
- package/dist/components/PostCard.js.map +1 -1
- package/dist/components/PostList.d.ts +3 -1
- package/dist/components/PostList.d.ts.map +1 -1
- package/dist/components/PostList.js +3 -15
- package/dist/components/PostList.js.map +1 -1
- package/dist/components/Search.d.ts +3 -1
- package/dist/components/Search.d.ts.map +1 -1
- package/dist/components/Search.js +2 -23
- package/dist/components/Search.js.map +1 -1
- package/dist/components/TOC.d.ts +3 -1
- package/dist/components/TOC.d.ts.map +1 -1
- package/dist/components/TOC.js +2 -19
- package/dist/components/TOC.js.map +1 -1
- package/dist/components/TagFilter.d.ts +3 -1
- package/dist/components/TagFilter.d.ts.map +1 -1
- package/dist/components/TagFilter.js +6 -16
- package/dist/components/TagFilter.js.map +1 -1
- package/dist/components/ThemeToggle.d.ts +3 -1
- package/dist/components/ThemeToggle.d.ts.map +1 -1
- package/dist/components/ThemeToggle.js +2 -13
- package/dist/components/ThemeToggle.js.map +1 -1
- package/dist/index.d.ts +7 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/layouts/BaseLayout.d.ts +3 -0
- package/dist/layouts/BaseLayout.d.ts.map +1 -0
- package/dist/layouts/BaseLayout.js +11 -0
- package/dist/layouts/BaseLayout.js.map +1 -0
- package/dist/layouts/BlogLayout.d.ts +3 -0
- package/dist/layouts/BlogLayout.d.ts.map +1 -0
- package/dist/layouts/BlogLayout.js +6 -0
- package/dist/layouts/BlogLayout.js.map +1 -0
- package/dist/layouts/DocsLayout.d.ts +3 -0
- package/dist/layouts/DocsLayout.d.ts.map +1 -0
- package/dist/layouts/DocsLayout.js +11 -0
- package/dist/layouts/DocsLayout.js.map +1 -0
- package/dist/layouts/MagazineLayout.d.ts +3 -0
- package/dist/layouts/MagazineLayout.d.ts.map +1 -0
- package/dist/layouts/MagazineLayout.js +11 -0
- package/dist/layouts/MagazineLayout.js.map +1 -0
- package/dist/layouts/index.d.ts +5 -0
- package/dist/layouts/index.d.ts.map +1 -0
- package/dist/layouts/index.js +5 -0
- package/dist/layouts/index.js.map +1 -0
- package/dist/templates/ArchivePage.d.ts +3 -0
- package/dist/templates/ArchivePage.d.ts.map +1 -0
- package/dist/templates/ArchivePage.js +8 -0
- package/dist/templates/ArchivePage.js.map +1 -0
- package/dist/templates/HomePage.d.ts +3 -0
- package/dist/templates/HomePage.d.ts.map +1 -0
- package/dist/templates/HomePage.js +7 -0
- package/dist/templates/HomePage.js.map +1 -0
- package/dist/templates/PostPage.d.ts +3 -0
- package/dist/templates/PostPage.d.ts.map +1 -0
- package/dist/templates/PostPage.js +11 -0
- package/dist/templates/PostPage.js.map +1 -0
- package/dist/templates/TagPage.d.ts +3 -0
- package/dist/templates/TagPage.d.ts.map +1 -0
- package/dist/templates/TagPage.js +8 -0
- package/dist/templates/TagPage.js.map +1 -0
- package/dist/templates/index.d.ts +5 -0
- package/dist/templates/index.d.ts.map +1 -0
- package/dist/templates/index.js +5 -0
- package/dist/templates/index.js.map +1 -0
- package/dist/theme/ThemeProvider.d.ts +9 -2
- package/dist/theme/ThemeProvider.d.ts.map +1 -1
- package/dist/theme/ThemeProvider.js +46 -6
- package/dist/theme/ThemeProvider.js.map +1 -1
- package/dist/theme/css-generator.d.ts +2 -1
- package/dist/theme/css-generator.d.ts.map +1 -1
- package/dist/theme/css-generator.js +44 -0
- package/dist/theme/css-generator.js.map +1 -1
- package/dist/theme/define-theme.js +14 -14
- package/dist/theme/define-theme.js.map +1 -1
- package/dist/theme/slot-resolver.d.ts +3 -0
- package/dist/theme/slot-resolver.d.ts.map +1 -0
- package/dist/theme/slot-resolver.js +13 -0
- package/dist/theme/slot-resolver.js.map +1 -0
- package/dist/theme/template-resolver.d.ts +4 -0
- package/dist/theme/template-resolver.d.ts.map +1 -0
- package/dist/theme/template-resolver.js +4 -0
- package/dist/theme/template-resolver.js.map +1 -0
- package/dist/theme/types.d.ts +60 -0
- package/dist/theme/types.d.ts.map +1 -1
- package/package.json +9 -8
- package/src/styles/noxion.css +669 -0
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ React rendering components and theme system for [Noxion](https://github.com/jiwo
|
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
|
-
- Notion page renderer (via
|
|
7
|
+
- Notion page renderer (via `@noxion/notion-renderer`)
|
|
8
8
|
- Pre-built blog components: `PostCard`, `PostList`, `Header`, `Footer`, `TOC`, `Search`, `TagFilter`
|
|
9
9
|
- CSS variable-based theme system with dark/light/system mode support
|
|
10
10
|
- Fully customizable via component overrides
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export interface EmptyStateProps {
|
|
2
2
|
title?: string;
|
|
3
3
|
message?: string;
|
|
4
|
+
className?: string;
|
|
4
5
|
}
|
|
5
|
-
export declare function EmptyState({ title, message, }: EmptyStateProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function EmptyState({ title, message, className, }: EmptyStateProps): import("react/jsx-runtime").JSX.Element;
|
|
6
7
|
//# sourceMappingURL=EmptyState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../../src/components/EmptyState.tsx"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../../src/components/EmptyState.tsx"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,UAAU,CAAC,EACzB,KAA0B,EAC1B,OAA6C,EAC7C,SAAS,GACV,EAAE,eAAe,2CAOjB"}
|
|
@@ -1,20 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
export function EmptyState({ title = "Nothing here yet", message = "Check back later for new content.", }) {
|
|
3
|
-
return (_jsxs("div", { className: "noxion-empty-state",
|
|
4
|
-
display: "flex",
|
|
5
|
-
flexDirection: "column",
|
|
6
|
-
alignItems: "center",
|
|
7
|
-
justifyContent: "center",
|
|
8
|
-
padding: "4rem 1rem",
|
|
9
|
-
textAlign: "center",
|
|
10
|
-
}, children: [_jsx("h2", { style: {
|
|
11
|
-
fontSize: "1.5rem",
|
|
12
|
-
fontWeight: 600,
|
|
13
|
-
color: "var(--noxion-foreground, #000)",
|
|
14
|
-
marginBottom: "0.5rem",
|
|
15
|
-
}, children: title }), _jsx("p", { style: {
|
|
16
|
-
fontSize: "1rem",
|
|
17
|
-
color: "var(--noxion-mutedForeground, #737373)",
|
|
18
|
-
}, children: message })] }));
|
|
2
|
+
export function EmptyState({ title = "Nothing here yet", message = "Check back later for new content.", className, }) {
|
|
3
|
+
return (_jsxs("div", { className: className ? `noxion-empty-state ${className}` : "noxion-empty-state", children: [_jsx("h2", { className: "noxion-empty-state__title", children: title }), _jsx("p", { className: "noxion-empty-state__message", children: message })] }));
|
|
19
4
|
}
|
|
20
5
|
//# sourceMappingURL=EmptyState.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyState.js","sourceRoot":"","sources":["../../src/components/EmptyState.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"EmptyState.js","sourceRoot":"","sources":["../../src/components/EmptyState.tsx"],"names":[],"mappings":";AAMA,MAAM,UAAU,UAAU,CAAC,EACzB,KAAK,GAAG,kBAAkB,EAC1B,OAAO,GAAG,mCAAmC,EAC7C,SAAS,GACO;IAChB,OAAO,CACL,eAAK,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,sBAAsB,SAAS,EAAE,CAAC,CAAC,CAAC,oBAAoB,aAClF,aAAI,SAAS,EAAC,2BAA2B,YAAE,KAAK,GAAM,EACtD,YAAG,SAAS,EAAC,6BAA6B,YAAE,OAAO,GAAK,IACpD,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { FooterProps } from "../theme/types";
|
|
2
|
-
export declare function Footer({ siteName, author }: FooterProps
|
|
2
|
+
export declare function Footer({ siteName, author, className }: FooterProps & {
|
|
3
|
+
className?: string;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
3
5
|
//# sourceMappingURL=Footer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Footer.d.ts","sourceRoot":"","sources":["../../src/components/Footer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,wBAAgB,MAAM,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"Footer.d.ts","sourceRoot":"","sources":["../../src/components/Footer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,wBAAgB,MAAM,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,WAAW,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,2CAkB3F"}
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
export function Footer({ siteName, author }) {
|
|
2
|
+
export function Footer({ siteName, author, className }) {
|
|
3
3
|
const year = new Date().getFullYear();
|
|
4
|
-
return (_jsxs("footer", { className: "noxion-footer",
|
|
5
|
-
display: "flex",
|
|
6
|
-
alignItems: "center",
|
|
7
|
-
justifyContent: "space-between",
|
|
8
|
-
padding: "1.5rem",
|
|
9
|
-
borderTop: "1px solid var(--noxion-border, #e5e5e5)",
|
|
10
|
-
fontSize: "0.875rem",
|
|
11
|
-
color: "var(--noxion-mutedForeground, #737373)",
|
|
12
|
-
}, children: [_jsxs("span", { children: ["\u00A9 ", year, " ", author ?? siteName] }), _jsx("a", { href: "https://github.com/jiwonme/noxion", target: "_blank", rel: "noopener noreferrer", style: { color: "var(--noxion-mutedForeground, #737373)", textDecoration: "none" }, children: "Powered by Noxion" })] }));
|
|
4
|
+
return (_jsxs("footer", { className: className ? `noxion-footer ${className}` : "noxion-footer", children: [_jsxs("span", { className: "noxion-footer__copyright", children: ["\u00A9 ", year, " ", author ?? siteName] }), _jsx("a", { href: "https://github.com/jiwonme/noxion", target: "_blank", rel: "noopener noreferrer", className: "noxion-footer__powered-by", children: "Powered by Noxion" })] }));
|
|
13
5
|
}
|
|
14
6
|
//# sourceMappingURL=Footer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Footer.js","sourceRoot":"","sources":["../../src/components/Footer.tsx"],"names":[],"mappings":";AAEA,MAAM,UAAU,MAAM,CAAC,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Footer.js","sourceRoot":"","sources":["../../src/components/Footer.tsx"],"names":[],"mappings":";AAEA,MAAM,UAAU,MAAM,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAwC;IAC1F,MAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAEtC,OAAO,CACL,kBAAQ,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,iBAAiB,SAAS,EAAE,CAAC,CAAC,CAAC,eAAe,aAC3E,gBAAM,SAAS,EAAC,0BAA0B,wBAChC,IAAI,OAAG,MAAM,IAAI,QAAQ,IAC5B,EACP,YACE,IAAI,EAAC,mCAAmC,EACxC,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,qBAAqB,EACzB,SAAS,EAAC,2BAA2B,kCAGnC,IACG,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { HeaderProps } from "../theme/types";
|
|
2
|
-
export declare function Header({ siteName, navigation }: HeaderProps
|
|
2
|
+
export declare function Header({ siteName, navigation, className }: HeaderProps & {
|
|
3
|
+
className?: string;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
3
5
|
//# sourceMappingURL=Header.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../src/components/Header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,wBAAgB,MAAM,CAAC,EAAE,QAAQ,EAAE,UAAe,EAAE,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../src/components/Header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,wBAAgB,MAAM,CAAC,EAAE,QAAQ,EAAE,UAAe,EAAE,SAAS,EAAE,EAAE,WAAW,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,2CAkBpG"}
|
|
@@ -1,21 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
export function Header({ siteName, navigation = [] }) {
|
|
3
|
-
return (_jsxs("header", { className: "noxion-header",
|
|
4
|
-
display: "flex",
|
|
5
|
-
alignItems: "center",
|
|
6
|
-
justifyContent: "space-between",
|
|
7
|
-
padding: "1rem 1.5rem",
|
|
8
|
-
borderBottom: "1px solid var(--noxion-border, #e5e5e5)",
|
|
9
|
-
backgroundColor: "var(--noxion-background, #fff)",
|
|
10
|
-
}, children: [_jsx("a", { href: "/", style: {
|
|
11
|
-
fontSize: "1.25rem",
|
|
12
|
-
fontWeight: 700,
|
|
13
|
-
color: "var(--noxion-foreground, #000)",
|
|
14
|
-
textDecoration: "none",
|
|
15
|
-
}, children: siteName }), navigation.length > 0 && (_jsx("nav", { style: { display: "flex", gap: "1.5rem" }, children: navigation.map((item) => (_jsx("a", { href: item.href, style: {
|
|
16
|
-
fontSize: "0.875rem",
|
|
17
|
-
color: "var(--noxion-mutedForeground, #737373)",
|
|
18
|
-
textDecoration: "none",
|
|
19
|
-
}, children: item.label }, item.href))) }))] }));
|
|
2
|
+
export function Header({ siteName, navigation = [], className }) {
|
|
3
|
+
return (_jsxs("header", { className: className ? `noxion-header ${className}` : "noxion-header", children: [_jsx("a", { href: "/", className: "noxion-header__logo", children: siteName }), navigation.length > 0 && (_jsx("nav", { className: "noxion-header__nav", children: navigation.map((item) => (_jsx("a", { href: item.href, className: "noxion-header__nav-link", children: item.label }, item.href))) }))] }));
|
|
20
4
|
}
|
|
21
5
|
//# sourceMappingURL=Header.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../src/components/Header.tsx"],"names":[],"mappings":";AAEA,MAAM,UAAU,MAAM,CAAC,EAAE,QAAQ,EAAE,UAAU,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../src/components/Header.tsx"],"names":[],"mappings":";AAEA,MAAM,UAAU,MAAM,CAAC,EAAE,QAAQ,EAAE,UAAU,GAAG,EAAE,EAAE,SAAS,EAAwC;IACnG,OAAO,CACL,kBAAQ,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,iBAAiB,SAAS,EAAE,CAAC,CAAC,CAAC,eAAe,aAC3E,YAAG,IAAI,EAAC,GAAG,EAAC,SAAS,EAAC,qBAAqB,YACxC,QAAQ,GACP,EAEH,UAAU,CAAC,MAAM,GAAG,CAAC,IAAI,CACxB,cAAK,SAAS,EAAC,oBAAoB,YAChC,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACxB,YAAmB,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,SAAS,EAAC,yBAAyB,YACpE,IAAI,CAAC,KAAK,IADL,IAAI,CAAC,IAAI,CAEb,CACL,CAAC,GACE,CACP,IACM,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -5,11 +5,8 @@ export interface NotionPageProps {
|
|
|
5
5
|
fullPage?: boolean;
|
|
6
6
|
darkMode?: boolean;
|
|
7
7
|
previewImages?: boolean;
|
|
8
|
-
showTableOfContents?: boolean;
|
|
9
|
-
minTableOfContentsItems?: number;
|
|
10
8
|
pageUrlPrefix?: string;
|
|
11
|
-
nextImage?: unknown;
|
|
12
9
|
className?: string;
|
|
13
10
|
}
|
|
14
|
-
export declare function NotionPage({ recordMap, rootPageId, fullPage, darkMode, previewImages,
|
|
11
|
+
export declare function NotionPage({ recordMap, rootPageId, fullPage, darkMode, previewImages, pageUrlPrefix, className, }: NotionPageProps): import("react/jsx-runtime").JSX.Element;
|
|
15
12
|
//# sourceMappingURL=NotionPage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotionPage.d.ts","sourceRoot":"","sources":["../../src/components/NotionPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NotionPage.d.ts","sourceRoot":"","sources":["../../src/components/NotionPage.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAStD,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,iBAAiB,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAsBD,wBAAgB,UAAU,CAAC,EACzB,SAAS,EACT,UAAU,EACV,QAAe,EACf,QAAQ,EACR,aAAqB,EACrB,aAAmB,EACnB,SAAS,GACV,EAAE,eAAe,2CAwBjB"}
|
|
@@ -1,20 +1,35 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
3
|
+
import { useState, useEffect } from "react";
|
|
4
|
+
import { NotionRenderer, createShikiHighlighter } from "@noxion/notion-renderer";
|
|
5
|
+
import { defaultMapImageUrl } from "notion-utils";
|
|
6
|
+
const highlighterPromise = createShikiHighlighter({
|
|
7
|
+
theme: "github-light",
|
|
8
|
+
darkTheme: "github-dark",
|
|
9
|
+
});
|
|
10
|
+
function useDetectDarkMode() {
|
|
11
|
+
const [isDark, setIsDark] = useState(false);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
const check = () => {
|
|
14
|
+
setIsDark(document.documentElement.dataset.theme === "dark");
|
|
15
|
+
};
|
|
16
|
+
check();
|
|
17
|
+
const observer = new MutationObserver(check);
|
|
18
|
+
observer.observe(document.documentElement, {
|
|
19
|
+
attributes: true,
|
|
20
|
+
attributeFilter: ["data-theme"],
|
|
21
|
+
});
|
|
22
|
+
return () => observer.disconnect();
|
|
23
|
+
}, []);
|
|
24
|
+
return isDark;
|
|
25
|
+
}
|
|
26
|
+
export function NotionPage({ recordMap, rootPageId, fullPage = true, darkMode, previewImages = false, pageUrlPrefix = "/", className, }) {
|
|
27
|
+
const detectedDark = useDetectDarkMode();
|
|
28
|
+
const resolvedDarkMode = darkMode ?? detectedDark;
|
|
29
|
+
const [highlightCode, setHighlightCode] = useState();
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
highlighterPromise.then((fn) => setHighlightCode(() => fn));
|
|
32
|
+
}, []);
|
|
33
|
+
return (_jsx("div", { className: className, children: _jsx(NotionRenderer, { recordMap: recordMap, rootPageId: rootPageId, fullPage: fullPage, darkMode: resolvedDarkMode, previewImages: previewImages, highlightCode: highlightCode, mapPageUrl: (pageId) => `${pageUrlPrefix}${pageId}`, mapImageUrl: (url, block) => defaultMapImageUrl(url, block) ?? url }) }));
|
|
19
34
|
}
|
|
20
35
|
//# sourceMappingURL=NotionPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotionPage.js","sourceRoot":"","sources":["../../src/components/NotionPage.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"NotionPage.js","sourceRoot":"","sources":["../../src/components/NotionPage.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAGjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,MAAM,kBAAkB,GAAG,sBAAsB,CAAC;IAChD,KAAK,EAAE,cAAc;IACrB,SAAS,EAAE,aAAa;CACzB,CAAC,CAAC;AAYH,SAAS,iBAAiB;IACxB,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE5C,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,KAAK,GAAG,GAAG,EAAE;YACjB,SAAS,CAAC,QAAQ,CAAC,eAAe,CAAC,OAAO,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC;QAC/D,CAAC,CAAC;QACF,KAAK,EAAE,CAAC;QAER,MAAM,QAAQ,GAAG,IAAI,gBAAgB,CAAC,KAAK,CAAC,CAAC;QAC7C,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,eAAe,EAAE;YACzC,UAAU,EAAE,IAAI;YAChB,eAAe,EAAE,CAAC,YAAY,CAAC;SAChC,CAAC,CAAC;QACH,OAAO,GAAG,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;IACrC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,EACzB,SAAS,EACT,UAAU,EACV,QAAQ,GAAG,IAAI,EACf,QAAQ,EACR,aAAa,GAAG,KAAK,EACrB,aAAa,GAAG,GAAG,EACnB,SAAS,GACO;IAChB,MAAM,YAAY,GAAG,iBAAiB,EAAE,CAAC;IACzC,MAAM,gBAAgB,GAAG,QAAQ,IAAI,YAAY,CAAC;IAElD,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,EAA+B,CAAC;IAElF,SAAS,CAAC,GAAG,EAAE;QACb,kBAAkB,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,gBAAgB,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC9D,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,cAAK,SAAS,EAAE,SAAS,YACvB,KAAC,cAAc,IACb,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,gBAAgB,EAC1B,aAAa,EAAE,aAAa,EAC5B,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,CAAC,MAAc,EAAE,EAAE,CAAC,GAAG,aAAa,GAAG,MAAM,EAAE,EAC3D,WAAW,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,kBAAkB,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,GAAG,GAClE,GACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { PostCardProps } from "../theme/types";
|
|
2
|
-
export declare function PostCard({ title, slug, date, tags, coverImage, category, }: PostCardProps
|
|
2
|
+
export declare function PostCard({ title, slug, date, tags, coverImage, category, description, className, }: PostCardProps & {
|
|
3
|
+
className?: string;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
3
5
|
//# sourceMappingURL=PostCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PostCard.d.ts","sourceRoot":"","sources":["../../src/components/PostCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD,wBAAgB,QAAQ,CAAC,EACvB,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,QAAQ,
|
|
1
|
+
{"version":3,"file":"PostCard.d.ts","sourceRoot":"","sources":["../../src/components/PostCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD,wBAAgB,QAAQ,CAAC,EACvB,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,QAAQ,EACR,WAAW,EACX,SAAS,GACV,EAAE,aAAa,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,2CAgDxC"}
|
|
@@ -1,44 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
export function PostCard({ title, slug, date, tags, coverImage, category, }) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
borderRadius: "var(--noxion-border-radius, 0.5rem)",
|
|
8
|
-
border: "1px solid var(--noxion-border, #e5e5e5)",
|
|
9
|
-
overflow: "hidden",
|
|
10
|
-
backgroundColor: "var(--noxion-card, #fff)",
|
|
11
|
-
transition: "box-shadow 0.2s ease",
|
|
12
|
-
}, children: [_jsx("div", { style: { position: "relative", width: "100%", height: "200px", overflow: "hidden" }, children: coverImage ? (_jsx("img", { src: coverImage, alt: title, loading: "lazy", decoding: "async", style: {
|
|
13
|
-
width: "100%",
|
|
14
|
-
height: "100%",
|
|
15
|
-
objectFit: "cover",
|
|
16
|
-
objectPosition: "center",
|
|
17
|
-
} })) : (_jsx("div", { style: {
|
|
18
|
-
width: "100%",
|
|
19
|
-
height: "100%",
|
|
20
|
-
background: "linear-gradient(135deg, var(--noxion-primary, #2563eb), var(--noxion-accent, #f5f5f5))",
|
|
21
|
-
} })) }), _jsxs("div", { style: { padding: "1rem" }, children: [category && (_jsx("span", { style: {
|
|
22
|
-
fontSize: "0.75rem",
|
|
23
|
-
fontWeight: 500,
|
|
24
|
-
color: "var(--noxion-primary, #2563eb)",
|
|
25
|
-
textTransform: "uppercase",
|
|
26
|
-
letterSpacing: "0.05em",
|
|
27
|
-
}, children: category })), _jsx("h3", { style: {
|
|
28
|
-
margin: "0.25rem 0",
|
|
29
|
-
fontSize: "1.125rem",
|
|
30
|
-
fontWeight: 600,
|
|
31
|
-
color: "var(--noxion-cardForeground, #000)",
|
|
32
|
-
lineHeight: 1.4,
|
|
33
|
-
}, children: title }), _jsx("time", { dateTime: date, style: {
|
|
34
|
-
fontSize: "0.875rem",
|
|
35
|
-
color: "var(--noxion-mutedForeground, #737373)",
|
|
36
|
-
}, children: date }), tags.length > 0 && (_jsx("div", { style: { marginTop: "0.5rem", display: "flex", flexWrap: "wrap", gap: "0.25rem" }, children: tags.map((tag) => (_jsx("span", { style: {
|
|
37
|
-
fontSize: "0.75rem",
|
|
38
|
-
padding: "0.125rem 0.5rem",
|
|
39
|
-
borderRadius: "9999px",
|
|
40
|
-
backgroundColor: "var(--noxion-muted, #f5f5f5)",
|
|
41
|
-
color: "var(--noxion-mutedForeground, #737373)",
|
|
42
|
-
}, children: tag }, tag))) }))] })] }));
|
|
2
|
+
export function PostCard({ title, slug, date, tags, coverImage, category, description, className, }) {
|
|
3
|
+
const hasImage = Boolean(coverImage);
|
|
4
|
+
const baseClass = hasImage ? "noxion-post-card" : "noxion-post-card noxion-post-card--text-only";
|
|
5
|
+
const cardClass = className ? `${baseClass} ${className}` : baseClass;
|
|
6
|
+
return (_jsxs("a", { href: `/${slug}`, className: cardClass, children: [hasImage && (_jsx("div", { className: "noxion-post-card__cover", children: _jsx("img", { src: coverImage, alt: title, loading: "lazy", decoding: "async", className: "noxion-post-card__cover-image" }) })), _jsxs("div", { className: "noxion-post-card__body", children: [category && (_jsx("span", { className: "noxion-post-card__category", children: category })), _jsx("h3", { className: "noxion-post-card__title", children: title }), description && (_jsx("p", { className: "noxion-post-card__description", children: description })), _jsxs("div", { className: "noxion-post-card__meta", children: [_jsx("time", { dateTime: date, className: "noxion-post-card__date", children: date }), tags.length > 0 && (_jsx("div", { className: "noxion-post-card__tags", children: tags.map((tag) => (_jsx("span", { className: "noxion-post-card__tag", children: tag }, tag))) }))] })] })] }));
|
|
43
7
|
}
|
|
44
8
|
//# sourceMappingURL=PostCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PostCard.js","sourceRoot":"","sources":["../../src/components/PostCard.tsx"],"names":[],"mappings":";AAEA,MAAM,UAAU,QAAQ,CAAC,EACvB,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,QAAQ,
|
|
1
|
+
{"version":3,"file":"PostCard.js","sourceRoot":"","sources":["../../src/components/PostCard.tsx"],"names":[],"mappings":";AAEA,MAAM,UAAU,QAAQ,CAAC,EACvB,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,QAAQ,EACR,WAAW,EACX,SAAS,GAC8B;IACvC,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IACrC,MAAM,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,8CAA8C,CAAC;IACjG,MAAM,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IAEtE,OAAO,CACL,aAAG,IAAI,EAAE,IAAI,IAAI,EAAE,EAAE,SAAS,EAAE,SAAS,aACtC,QAAQ,IAAI,CACX,cAAK,SAAS,EAAC,yBAAyB,YACtC,cACE,GAAG,EAAE,UAAU,EACf,GAAG,EAAE,KAAK,EACV,OAAO,EAAC,MAAM,EACd,QAAQ,EAAC,OAAO,EAChB,SAAS,EAAC,+BAA+B,GACzC,GACE,CACP,EAED,eAAK,SAAS,EAAC,wBAAwB,aACpC,QAAQ,IAAI,CACX,eAAM,SAAS,EAAC,4BAA4B,YAAE,QAAQ,GAAQ,CAC/D,EAED,aAAI,SAAS,EAAC,yBAAyB,YAAE,KAAK,GAAM,EAEnD,WAAW,IAAI,CACd,YAAG,SAAS,EAAC,+BAA+B,YAAE,WAAW,GAAK,CAC/D,EAED,eAAK,SAAS,EAAC,wBAAwB,aACrC,eAAM,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAC,wBAAwB,YACrD,IAAI,GACA,EAEN,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAClB,cAAK,SAAS,EAAC,wBAAwB,YACpC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CACjB,eAAgB,SAAS,EAAC,uBAAuB,YAC9C,GAAG,IADK,GAAG,CAEP,CACR,CAAC,GACE,CACP,IACG,IACF,IACJ,CACL,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { PostListProps } from "../theme/types";
|
|
2
|
-
export declare function PostList({ posts }: PostListProps
|
|
2
|
+
export declare function PostList({ posts, className }: PostListProps & {
|
|
3
|
+
className?: string;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
3
5
|
//# sourceMappingURL=PostList.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PostList.d.ts","sourceRoot":"","sources":["../../src/components/PostList.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAiB,MAAM,gBAAgB,CAAC;AAInE,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"PostList.d.ts","sourceRoot":"","sources":["../../src/components/PostList.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAiB,MAAM,gBAAgB,CAAC;AAInE,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,aAAa,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,2CAmBpF"}
|
|
@@ -2,24 +2,12 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useNoxionComponents } from "../theme/ThemeProvider";
|
|
4
4
|
import { PostCard as DefaultPostCard } from "./PostCard";
|
|
5
|
-
export function PostList({ posts }) {
|
|
5
|
+
export function PostList({ posts, className }) {
|
|
6
6
|
const overrides = useNoxionComponents();
|
|
7
7
|
const Card = (overrides.PostCard ?? DefaultPostCard);
|
|
8
8
|
if (posts.length === 0) {
|
|
9
|
-
return _jsx(
|
|
9
|
+
return (_jsx("div", { className: "noxion-empty-state", children: _jsx("p", { className: "noxion-empty-state__message", children: "No posts found." }) }));
|
|
10
10
|
}
|
|
11
|
-
return (_jsx("div", { className: "noxion-post-list",
|
|
12
|
-
display: "grid",
|
|
13
|
-
gridTemplateColumns: "repeat(auto-fill, minmax(300px, 1fr))",
|
|
14
|
-
gap: "1.5rem",
|
|
15
|
-
width: "100%",
|
|
16
|
-
}, children: posts.map((post) => (_jsx(Card, { ...post }, post.id))) }));
|
|
17
|
-
}
|
|
18
|
-
function EmptyState({ message }) {
|
|
19
|
-
return (_jsx("div", { style: {
|
|
20
|
-
textAlign: "center",
|
|
21
|
-
padding: "3rem 1rem",
|
|
22
|
-
color: "var(--noxion-mutedForeground, #737373)",
|
|
23
|
-
}, children: _jsx("p", { style: { fontSize: "1.125rem" }, children: message }) }));
|
|
11
|
+
return (_jsx("div", { className: className ? `noxion-post-list ${className}` : "noxion-post-list", children: posts.map((post) => (_jsx(Card, { ...post }, post.slug))) }));
|
|
24
12
|
}
|
|
25
13
|
//# sourceMappingURL=PostList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PostList.js","sourceRoot":"","sources":["../../src/components/PostList.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAIb,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,QAAQ,IAAI,eAAe,EAAE,MAAM,YAAY,CAAC;AAEzD,MAAM,UAAU,QAAQ,CAAC,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"PostList.js","sourceRoot":"","sources":["../../src/components/PostList.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAIb,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,QAAQ,IAAI,eAAe,EAAE,MAAM,YAAY,CAAC;AAEzD,MAAM,UAAU,QAAQ,CAAC,EAAE,KAAK,EAAE,SAAS,EAA0C;IACnF,MAAM,SAAS,GAAG,mBAAmB,EAAE,CAAC;IACxC,MAAM,IAAI,GAAG,CAAC,SAAS,CAAC,QAAQ,IAAI,eAAe,CAAiC,CAAC;IAErF,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,CACL,cAAK,SAAS,EAAC,oBAAoB,YACjC,YAAG,SAAS,EAAC,6BAA6B,gCAAoB,GAC1D,CACP,CAAC;IACJ,CAAC;IAED,OAAO,CACL,cAAK,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,oBAAoB,SAAS,EAAE,CAAC,CAAC,CAAC,kBAAkB,YAC7E,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACnB,KAAC,IAAI,OAAqB,IAAI,IAAnB,IAAI,CAAC,IAAI,CAAc,CACnC,CAAC,GACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { SearchProps } from "../theme/types";
|
|
2
|
-
export declare function Search({ onSearch, placeholder, }: SearchProps
|
|
2
|
+
export declare function Search({ onSearch, placeholder, className, }: SearchProps & {
|
|
3
|
+
className?: string;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
3
5
|
//# sourceMappingURL=Search.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Search.d.ts","sourceRoot":"","sources":["../../src/components/Search.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,wBAAgB,MAAM,CAAC,EACrB,QAAQ,EACR,WAA+B,
|
|
1
|
+
{"version":3,"file":"Search.d.ts","sourceRoot":"","sources":["../../src/components/Search.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,wBAAgB,MAAM,CAAC,EACrB,QAAQ,EACR,WAA+B,EAC/B,SAAS,GACV,EAAE,WAAW,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,2CAmCtC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useRef, useEffect, useCallback } from "react";
|
|
4
|
-
export function Search({ onSearch, placeholder = "Search posts...", }) {
|
|
4
|
+
export function Search({ onSearch, placeholder = "Search posts...", className, }) {
|
|
5
5
|
const inputRef = useRef(null);
|
|
6
6
|
const debounceRef = useRef(null);
|
|
7
7
|
const handleInput = useCallback((value) => {
|
|
@@ -19,27 +19,6 @@ export function Search({ onSearch, placeholder = "Search posts...", }) {
|
|
|
19
19
|
document.addEventListener("keydown", handler);
|
|
20
20
|
return () => document.removeEventListener("keydown", handler);
|
|
21
21
|
}, []);
|
|
22
|
-
return (_jsxs("div", { className:
|
|
23
|
-
width: "100%",
|
|
24
|
-
padding: "0.5rem 0.75rem",
|
|
25
|
-
paddingRight: "3rem",
|
|
26
|
-
borderRadius: "var(--noxion-border-radius, 0.5rem)",
|
|
27
|
-
border: "1px solid var(--noxion-border, #e5e5e5)",
|
|
28
|
-
backgroundColor: "var(--noxion-background, #fff)",
|
|
29
|
-
color: "var(--noxion-foreground, #000)",
|
|
30
|
-
fontSize: "0.875rem",
|
|
31
|
-
outline: "none",
|
|
32
|
-
} }), _jsx("kbd", { style: {
|
|
33
|
-
position: "absolute",
|
|
34
|
-
right: "0.5rem",
|
|
35
|
-
top: "50%",
|
|
36
|
-
transform: "translateY(-50%)",
|
|
37
|
-
fontSize: "0.75rem",
|
|
38
|
-
padding: "0.125rem 0.375rem",
|
|
39
|
-
borderRadius: "0.25rem",
|
|
40
|
-
border: "1px solid var(--noxion-border, #e5e5e5)",
|
|
41
|
-
color: "var(--noxion-mutedForeground, #737373)",
|
|
42
|
-
pointerEvents: "none",
|
|
43
|
-
}, children: "\u2318K" })] }));
|
|
22
|
+
return (_jsxs("div", { className: className ? `noxion-search ${className}` : "noxion-search", children: [_jsx("input", { ref: inputRef, type: "text", placeholder: placeholder, onChange: (e) => handleInput(e.target.value), className: "noxion-search__input" }), _jsx("kbd", { className: "noxion-search__kbd", children: "\u2318K" })] }));
|
|
44
23
|
}
|
|
45
24
|
//# sourceMappingURL=Search.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Search.js","sourceRoot":"","sources":["../../src/components/Search.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAGvD,MAAM,UAAU,MAAM,CAAC,EACrB,QAAQ,EACR,WAAW,GAAG,iBAAiB,
|
|
1
|
+
{"version":3,"file":"Search.js","sourceRoot":"","sources":["../../src/components/Search.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAGvD,MAAM,UAAU,MAAM,CAAC,EACrB,QAAQ,EACR,WAAW,GAAG,iBAAiB,EAC/B,SAAS,GAC4B;IACrC,MAAM,QAAQ,GAAG,MAAM,CAAmB,IAAI,CAAC,CAAC;IAChD,MAAM,WAAW,GAAG,MAAM,CAAuC,IAAI,CAAC,CAAC;IAEvE,MAAM,WAAW,GAAG,WAAW,CAC7B,CAAC,KAAa,EAAE,EAAE;QAChB,IAAI,WAAW,CAAC,OAAO;YAAE,YAAY,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAC3D,WAAW,CAAC,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC;IAC/D,CAAC,EACD,CAAC,QAAQ,CAAC,CACX,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,OAAO,GAAG,CAAC,CAAgB,EAAE,EAAE;YACnC,IAAI,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,EAAE,CAAC;gBAC9C,CAAC,CAAC,cAAc,EAAE,CAAC;gBACnB,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;YAC5B,CAAC;QACH,CAAC,CAAC;QACF,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAC9C,OAAO,GAAG,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAChE,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,eAAK,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,iBAAiB,SAAS,EAAE,CAAC,CAAC,CAAC,eAAe,aACxE,gBACE,GAAG,EAAE,QAAQ,EACb,IAAI,EAAC,MAAM,EACX,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAC5C,SAAS,EAAC,sBAAsB,GAChC,EACF,cAAK,SAAS,EAAC,oBAAoB,wBAAS,IACxC,CACP,CAAC;AACJ,CAAC"}
|
package/dist/components/TOC.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { TOCProps } from "../theme/types";
|
|
2
|
-
export declare function TOC({ headings }: TOCProps
|
|
2
|
+
export declare function TOC({ headings, className }: TOCProps & {
|
|
3
|
+
className?: string;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
3
5
|
//# sourceMappingURL=TOC.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TOC.d.ts","sourceRoot":"","sources":["../../src/components/TOC.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,wBAAgB,GAAG,CAAC,EAAE,QAAQ,EAAE,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"TOC.d.ts","sourceRoot":"","sources":["../../src/components/TOC.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,wBAAgB,GAAG,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,QAAQ,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,kDAwB7E"}
|
package/dist/components/TOC.js
CHANGED
|
@@ -1,24 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
export function TOC({ headings }) {
|
|
2
|
+
export function TOC({ headings, className }) {
|
|
3
3
|
if (headings.length === 0)
|
|
4
4
|
return null;
|
|
5
|
-
return (_jsxs("nav", { className: "noxion-toc", "aria-label": "Table of Contents", style: {
|
|
6
|
-
padding: "1rem 0",
|
|
7
|
-
fontSize: "0.875rem",
|
|
8
|
-
}, children: [_jsx("h4", { style: {
|
|
9
|
-
fontSize: "0.75rem",
|
|
10
|
-
fontWeight: 600,
|
|
11
|
-
textTransform: "uppercase",
|
|
12
|
-
letterSpacing: "0.05em",
|
|
13
|
-
color: "var(--noxion-mutedForeground, #737373)",
|
|
14
|
-
marginBottom: "0.75rem",
|
|
15
|
-
}, children: "On this page" }), _jsx("ul", { style: { listStyle: "none", padding: 0, margin: 0 }, children: headings.map((heading) => (_jsx("li", { style: {
|
|
16
|
-
paddingLeft: `${(heading.level - 1) * 0.75}rem`,
|
|
17
|
-
marginBottom: "0.375rem",
|
|
18
|
-
}, children: _jsx("a", { href: `#${heading.id}`, style: {
|
|
19
|
-
color: "var(--noxion-mutedForeground, #737373)",
|
|
20
|
-
textDecoration: "none",
|
|
21
|
-
lineHeight: 1.5,
|
|
22
|
-
}, children: heading.text }) }, heading.id))) })] }));
|
|
5
|
+
return (_jsxs("nav", { className: className ? `noxion-toc ${className}` : "noxion-toc", "aria-label": "Table of Contents", children: [_jsx("h4", { className: "noxion-toc__heading", children: "On this page" }), _jsx("ul", { className: "noxion-toc__list", children: headings.map((heading) => (_jsx("li", { className: "noxion-toc__item", style: { paddingLeft: `${(heading.level - 1) * 0.75}rem` }, children: _jsx("a", { href: `#${heading.id}`, className: "noxion-toc__link", children: heading.text }) }, heading.id))) })] }));
|
|
23
6
|
}
|
|
24
7
|
//# sourceMappingURL=TOC.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TOC.js","sourceRoot":"","sources":["../../src/components/TOC.tsx"],"names":[],"mappings":";AAEA,MAAM,UAAU,GAAG,CAAC,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"TOC.js","sourceRoot":"","sources":["../../src/components/TOC.tsx"],"names":[],"mappings":";AAEA,MAAM,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAqC;IAC5E,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAEvC,OAAO,CACL,eACE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,cAAc,SAAS,EAAE,CAAC,CAAC,CAAC,YAAY,gBACpD,mBAAmB,aAE9B,aAAI,SAAS,EAAC,qBAAqB,6BAAkB,EACrD,aAAI,SAAS,EAAC,kBAAkB,YAC7B,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CACzB,aAEE,SAAS,EAAC,kBAAkB,EAC5B,KAAK,EAAE,EAAE,WAAW,EAAE,GAAG,CAAC,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,IAAI,KAAK,EAAE,YAE1D,YAAG,IAAI,EAAE,IAAI,OAAO,CAAC,EAAE,EAAE,EAAE,SAAS,EAAC,kBAAkB,YACpD,OAAO,CAAC,IAAI,GACX,IANC,OAAO,CAAC,EAAE,CAOZ,CACN,CAAC,GACC,IACD,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { TagFilterProps } from "../theme/types";
|
|
2
|
-
export declare function TagFilter({ tags, selectedTags, onToggle }: TagFilterProps
|
|
2
|
+
export declare function TagFilter({ tags, selectedTags, onToggle, className }: TagFilterProps & {
|
|
3
|
+
className?: string;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
3
5
|
//# sourceMappingURL=TagFilter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TagFilter.d.ts","sourceRoot":"","sources":["../../src/components/TagFilter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,wBAAgB,SAAS,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"TagFilter.d.ts","sourceRoot":"","sources":["../../src/components/TagFilter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,wBAAgB,SAAS,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,cAAc,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,kDAkB7G"}
|
|
@@ -1,23 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
export function TagFilter({ tags, selectedTags, onToggle }) {
|
|
2
|
+
export function TagFilter({ tags, selectedTags, onToggle, className }) {
|
|
3
3
|
if (tags.length === 0)
|
|
4
4
|
return null;
|
|
5
|
-
return (_jsx("div", { className:
|
|
5
|
+
return (_jsx("div", { className: className ? `noxion-tag-filter ${className}` : "noxion-tag-filter", children: tags.map((tag) => {
|
|
6
6
|
const isSelected = selectedTags.includes(tag);
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
backgroundColor: isSelected
|
|
12
|
-
? "var(--noxion-primary, #2563eb)"
|
|
13
|
-
: "transparent",
|
|
14
|
-
color: isSelected
|
|
15
|
-
? "var(--noxion-primaryForeground, #fff)"
|
|
16
|
-
: "var(--noxion-foreground, #000)",
|
|
17
|
-
fontSize: "0.875rem",
|
|
18
|
-
cursor: "pointer",
|
|
19
|
-
transition: "all 0.15s ease",
|
|
20
|
-
}, children: tag }, tag));
|
|
7
|
+
const tagClass = isSelected
|
|
8
|
+
? "noxion-tag-filter__tag noxion-tag-filter__tag--selected"
|
|
9
|
+
: "noxion-tag-filter__tag";
|
|
10
|
+
return (_jsx("button", { onClick: () => onToggle(tag), type: "button", className: tagClass, children: tag }, tag));
|
|
21
11
|
}) }));
|
|
22
12
|
}
|
|
23
13
|
//# sourceMappingURL=TagFilter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TagFilter.js","sourceRoot":"","sources":["../../src/components/TagFilter.tsx"],"names":[],"mappings":";AAEA,MAAM,UAAU,SAAS,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"TagFilter.js","sourceRoot":"","sources":["../../src/components/TagFilter.tsx"],"names":[],"mappings":";AAEA,MAAM,UAAU,SAAS,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAA2C;IAC5G,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAEnC,OAAO,CACL,cAAK,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,qBAAqB,SAAS,EAAE,CAAC,CAAC,CAAC,mBAAmB,YAC/E,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;YAChB,MAAM,UAAU,GAAG,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;YAC9C,MAAM,QAAQ,GAAG,UAAU;gBACzB,CAAC,CAAC,yDAAyD;gBAC3D,CAAC,CAAC,wBAAwB,CAAC;YAC7B,OAAO,CACL,iBAAkB,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAE,QAAQ,YAC9E,GAAG,IADO,GAAG,CAEP,CACV,CAAC;QACJ,CAAC,CAAC,GACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeToggle.d.ts","sourceRoot":"","sources":["../../src/components/ThemeToggle.tsx"],"names":[],"mappings":"AAkBA,wBAAgB,WAAW,
|
|
1
|
+
{"version":3,"file":"ThemeToggle.d.ts","sourceRoot":"","sources":["../../src/components/ThemeToggle.tsx"],"names":[],"mappings":"AAkBA,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,2CAoBhE"}
|
|
@@ -12,24 +12,13 @@ const LABELS = {
|
|
|
12
12
|
system: "System",
|
|
13
13
|
};
|
|
14
14
|
const CYCLE = ["system", "light", "dark"];
|
|
15
|
-
export function ThemeToggle() {
|
|
15
|
+
export function ThemeToggle({ className }) {
|
|
16
16
|
const { preference, setPreference } = useThemePreference();
|
|
17
17
|
const nextPreference = () => {
|
|
18
18
|
const currentIndex = CYCLE.indexOf(preference);
|
|
19
19
|
const next = CYCLE[(currentIndex + 1) % CYCLE.length];
|
|
20
20
|
setPreference(next);
|
|
21
21
|
};
|
|
22
|
-
return (_jsx("button", { onClick: nextPreference, type: "button", "aria-label": `Theme: ${LABELS[preference]}. Click to change.`, title: LABELS[preference], className: "noxion-theme-toggle",
|
|
23
|
-
display: "inline-flex",
|
|
24
|
-
alignItems: "center",
|
|
25
|
-
justifyContent: "center",
|
|
26
|
-
width: "2rem",
|
|
27
|
-
height: "2rem",
|
|
28
|
-
borderRadius: "var(--noxion-border-radius, 0.5rem)",
|
|
29
|
-
border: "1px solid var(--noxion-border, #e5e5e5)",
|
|
30
|
-
backgroundColor: "transparent",
|
|
31
|
-
cursor: "pointer",
|
|
32
|
-
fontSize: "1rem",
|
|
33
|
-
}, children: ICONS[preference] }));
|
|
22
|
+
return (_jsx("button", { onClick: nextPreference, type: "button", "aria-label": `Theme: ${LABELS[preference]}. Click to change.`, title: LABELS[preference], className: className ? `noxion-theme-toggle ${className}` : "noxion-theme-toggle", children: ICONS[preference] }));
|
|
34
23
|
}
|
|
35
24
|
//# sourceMappingURL=ThemeToggle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeToggle.js","sourceRoot":"","sources":["../../src/components/ThemeToggle.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,kBAAkB,EAAwB,MAAM,mBAAmB,CAAC;AAE7E,MAAM,KAAK,GAAoC;IAC7C,KAAK,EAAE,cAAc;IACrB,IAAI,EAAE,cAAc;IACpB,MAAM,EAAE,cAAc;CACvB,CAAC;AAEF,MAAM,MAAM,GAAoC;IAC9C,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;CACjB,CAAC;AAEF,MAAM,KAAK,GAAsB,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AAE7D,MAAM,UAAU,WAAW;
|
|
1
|
+
{"version":3,"file":"ThemeToggle.js","sourceRoot":"","sources":["../../src/components/ThemeToggle.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,kBAAkB,EAAwB,MAAM,mBAAmB,CAAC;AAE7E,MAAM,KAAK,GAAoC;IAC7C,KAAK,EAAE,cAAc;IACrB,IAAI,EAAE,cAAc;IACpB,MAAM,EAAE,cAAc;CACvB,CAAC;AAEF,MAAM,MAAM,GAAoC;IAC9C,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;CACjB,CAAC;AAEF,MAAM,KAAK,GAAsB,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AAE7D,MAAM,UAAU,WAAW,CAAC,EAAE,SAAS,EAA0B;IAC/D,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,GAAG,kBAAkB,EAAE,CAAC;IAE3D,MAAM,cAAc,GAAG,GAAG,EAAE;QAC1B,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC/C,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,YAAY,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;QACtD,aAAa,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC,CAAC;IAEF,OAAO,CACL,iBACE,OAAO,EAAE,cAAc,EACvB,IAAI,EAAC,QAAQ,gBACD,UAAU,MAAM,CAAC,UAAU,CAAC,oBAAoB,EAC5D,KAAK,EAAE,MAAM,CAAC,UAAU,CAAC,EACzB,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,uBAAuB,SAAS,EAAE,CAAC,CAAC,CAAC,qBAAqB,YAEhF,KAAK,CAAC,UAAU,CAAC,GACX,CACV,CAAC;AACJ,CAAC"}
|