@noxion/renderer 0.0.2 → 0.1.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.
- package/LICENSE +21 -0
- package/README.md +43 -0
- package/dist/components/EmptyState.d.ts +2 -1
- package/dist/components/EmptyState.d.ts.map +1 -1
- package/dist/components/EmptyState.js +3 -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 +3 -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 +4 -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 +3 -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 +15 -19
- 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 +5 -20
- 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 +61 -0
- package/dist/theme/types.d.ts.map +1 -1
- package/package.json +10 -8
- package/src/styles/noxion.css +739 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jiwon
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# @noxion/renderer
|
|
2
|
+
|
|
3
|
+
React rendering components and theme system for [Noxion](https://github.com/jiwonme/noxion) — a Notion-powered blog builder.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Notion page renderer (via `@noxion/notion-renderer`)
|
|
8
|
+
- Pre-built blog components: `PostCard`, `PostList`, `Header`, `Footer`, `TOC`, `Search`, `TagFilter`
|
|
9
|
+
- CSS variable-based theme system with dark/light/system mode support
|
|
10
|
+
- Fully customizable via component overrides
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @noxion/renderer react react-dom
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Peer Dependencies
|
|
19
|
+
|
|
20
|
+
- `react >= 18.0.0`
|
|
21
|
+
- `react-dom >= 18.0.0`
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
import { NoxionThemeProvider, PostList } from "@noxion/renderer";
|
|
27
|
+
|
|
28
|
+
export default function BlogPage({ posts }) {
|
|
29
|
+
return (
|
|
30
|
+
<NoxionThemeProvider>
|
|
31
|
+
<PostList posts={posts} />
|
|
32
|
+
</NoxionThemeProvider>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Documentation
|
|
38
|
+
|
|
39
|
+
See the [full documentation](https://github.com/jiwonme/noxion) for complete usage guides.
|
|
40
|
+
|
|
41
|
+
## License
|
|
42
|
+
|
|
43
|
+
MIT
|
|
@@ -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":"
|
|
1
|
+
{"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../../src/components/EmptyState.tsx"],"names":[],"mappings":"AAEA,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,2CAUjB"}
|
|
@@ -1,20 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
+
import { FileText } from "lucide-react";
|
|
3
|
+
export function EmptyState({ title = "Nothing here yet", message = "Check back later for new content.", className, }) {
|
|
4
|
+
return (_jsxs("div", { className: className ? `noxion-empty-state ${className}` : "noxion-empty-state", children: [_jsx("span", { className: "noxion-empty-state__icon", children: _jsx(FileText, { size: 32, strokeWidth: 1.5 }) }), _jsx("h2", { className: "noxion-empty-state__title", children: title }), _jsx("p", { className: "noxion-empty-state__message", children: message })] }));
|
|
19
5
|
}
|
|
20
6
|
//# 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":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAQxC,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,eAAM,SAAS,EAAC,0BAA0B,YACxC,KAAC,QAAQ,IAAC,IAAI,EAAE,EAAE,EAAE,WAAW,EAAE,GAAG,GAAI,GACnC,EACP,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":"
|
|
1
|
+
{"version":3,"file":"Footer.d.ts","sourceRoot":"","sources":["../../src/components/Footer.tsx"],"names":[],"mappings":"AACA,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,2CAmB3F"}
|
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
|
|
2
|
+
import { ArrowUpRight } from "lucide-react";
|
|
3
|
+
export function Footer({ siteName, author, className }) {
|
|
3
4
|
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" })] }));
|
|
5
|
+
return (_jsxs("footer", { className: className ? `noxion-footer ${className}` : "noxion-footer", children: [_jsxs("span", { className: "noxion-footer__copyright", children: ["\u00A9 ", year, " ", author ?? siteName] }), _jsxs("a", { href: "https://github.com/jiwonme/noxion", target: "_blank", rel: "noopener noreferrer", className: "noxion-footer__powered-by", children: ["Powered by Noxion", _jsx(ArrowUpRight, { size: 12, strokeWidth: 2 })] })] }));
|
|
13
6
|
}
|
|
14
7
|
//# sourceMappingURL=Footer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Footer.js","sourceRoot":"","sources":["../../src/components/Footer.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Footer.js","sourceRoot":"","sources":["../../src/components/Footer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C,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,aACE,IAAI,EAAC,mCAAmC,EACxC,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,qBAAqB,EACzB,SAAS,EAAC,2BAA2B,kCAGrC,KAAC,YAAY,IAAC,IAAI,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC,GAAI,IACxC,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":"
|
|
1
|
+
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../src/components/Header.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGlD,wBAAgB,MAAM,CAAC,EAAE,QAAQ,EAAE,UAAe,EAAE,SAAS,EAAE,EAAE,WAAW,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,2CAsBpG"}
|
|
@@ -1,21 +1,7 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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))) }))] }));
|
|
3
|
+
import { ThemeToggle } from "./ThemeToggle";
|
|
4
|
+
export function Header({ siteName, navigation = [], className }) {
|
|
5
|
+
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))) })), _jsx("div", { className: "noxion-header__actions", children: _jsx(ThemeToggle, {}) })] }));
|
|
20
6
|
}
|
|
21
7
|
//# sourceMappingURL=Header.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../src/components/Header.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../src/components/Header.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,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,EAED,cAAK,SAAS,EAAC,wBAAwB,YACrC,KAAC,WAAW,KAAG,GACX,IACC,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, author, 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,MAAM,EACN,SAAS,GACV,EAAE,aAAa,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,2CAmDxC"}
|
|
@@ -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, author, 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: [author && (_jsx("span", { className: "noxion-post-card__author", children: author })), _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,MAAM,EACN,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,aACpC,MAAM,IAAI,CACT,eAAM,SAAS,EAAC,0BAA0B,YAAE,MAAM,GAAQ,CAC3D,EACD,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":"
|
|
1
|
+
{"version":3,"file":"Search.d.ts","sourceRoot":"","sources":["../../src/components/Search.tsx"],"names":[],"mappings":"AAIA,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,2CAsCtC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
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
|
-
|
|
4
|
+
import { Search as SearchIcon } from "lucide-react";
|
|
5
|
+
export function Search({ onSearch, placeholder = "Search posts...", className, }) {
|
|
5
6
|
const inputRef = useRef(null);
|
|
6
7
|
const debounceRef = useRef(null);
|
|
7
8
|
const handleInput = useCallback((value) => {
|
|
@@ -19,27 +20,6 @@ export function Search({ onSearch, placeholder = "Search posts...", }) {
|
|
|
19
20
|
document.addEventListener("keydown", handler);
|
|
20
21
|
return () => document.removeEventListener("keydown", handler);
|
|
21
22
|
}, []);
|
|
22
|
-
return (_jsxs("div", { className: "noxion-search",
|
|
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" })] }));
|
|
23
|
+
return (_jsxs("div", { className: className ? `noxion-search ${className}` : "noxion-search", children: [_jsx("span", { className: "noxion-search__icon", children: _jsx(SearchIcon, { size: 14, strokeWidth: 2 }) }), _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
24
|
}
|
|
45
25
|
//# 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;
|
|
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;AACvD,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AAGpD,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,eAAM,SAAS,EAAC,qBAAqB,YACnC,KAAC,UAAU,IAAC,IAAI,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC,GAAI,GACnC,EACP,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, maxVisible, 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":"
|
|
1
|
+
{"version":3,"file":"TagFilter.d.ts","sourceRoot":"","sources":["../../src/components/TagFilter.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,wBAAgB,SAAS,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,cAAc,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,kDA4CzH"}
|