@cedros/data-react 0.1.6 → 0.1.8
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 +7 -0
- package/dist/docsContract.d.ts +56 -0
- package/dist/docsContract.js +136 -0
- package/dist/react/contentCollections.d.ts +4 -0
- package/dist/react/contentCollections.js +48 -0
- package/dist/react/docs.d.ts +14 -0
- package/dist/react/docs.js +207 -0
- package/dist/react/entries.js +6 -7
- package/dist/react/index.d.ts +2 -1
- package/dist/react/index.js +1 -0
- package/dist/react/server.d.ts +2 -1
- package/dist/react/server.js +1 -0
- package/dist/react/sitemap.js +7 -20
- package/dist/react/slugs.js +7 -20
- package/dist/react/types.d.ts +17 -0
- package/dist/site-templates/BlogTemplates.js +16 -12
- package/dist/site-templates/DocsSidebar.d.ts +1 -1
- package/dist/site-templates/DocsSidebar.js +2 -2
- package/dist/site-templates/DocsTemplates.d.ts +9 -8
- package/dist/site-templates/DocsTemplates.js +32 -18
- package/dist/site-templates/SiteFooter.js +1 -1
- package/dist/site-templates/SiteLayout.js +1 -1
- package/dist/site-templates/TopNav.js +1 -1
- package/dist/site-templates/blog-styles.css +259 -0
- package/dist/site-templates/blogControls.js +2 -2
- package/dist/site-templates/blogTemplateUi.d.ts +10 -0
- package/dist/site-templates/blogTemplateUi.js +4 -0
- package/dist/site-templates/content-styles.css +127 -309
- package/dist/site-templates/contentIndex.d.ts +4 -7
- package/dist/site-templates/contentIndex.js +25 -1
- package/dist/site-templates/contentUi.js +4 -3
- package/dist/site-templates/dashboard-styles.css +109 -0
- package/dist/site-templates/docs-layout.css +372 -0
- package/dist/site-templates/docs-styles.css +288 -96
- package/dist/site-templates/docsNavigation.d.ts +50 -1
- package/dist/site-templates/docsNavigation.js +242 -8
- package/dist/site-templates/docsTemplateShell.d.ts +8 -0
- package/dist/site-templates/docsTemplateShell.js +14 -0
- package/dist/site-templates/index.d.ts +2 -1
- package/dist/site-templates/index.js +2 -1
- package/dist/site-templates/styles.css +283 -201
- package/package.json +1 -1
|
@@ -6,10 +6,12 @@ import { MarkdownContent } from "./MarkdownContent.js";
|
|
|
6
6
|
import { BlogSearchInput, BookmarkButton, FilterDimensionChips } from "./blogControls.js";
|
|
7
7
|
import { TipWidget } from "./tipControls.js";
|
|
8
8
|
import { ContentPaywall } from "./paywallControls.js";
|
|
9
|
+
import { BlogIndexControls } from "./blogTemplateUi.js";
|
|
9
10
|
export function BlogIndexTemplate({ siteTitle, navigation, posts, title = "Blog", description = "", basePath = "/blog", query = "", category = "", tag = "", sort = "newest", page = 1, pageSize = 8, categories, tags, filterDimensions, activeFilters, onFilterChange, onSearch, bookmarkedSlugs, onBookmarkToggle }) {
|
|
10
11
|
const normalizedFilters = collectFilterValues(posts);
|
|
11
12
|
const resolvedCategories = categories ?? normalizedFilters.categories;
|
|
12
13
|
const resolvedTags = tags ?? normalizedFilters.tags;
|
|
14
|
+
const totalPosts = posts.length;
|
|
13
15
|
const result = prepareBlogIndex(posts, {
|
|
14
16
|
query,
|
|
15
17
|
category,
|
|
@@ -20,22 +22,24 @@ export function BlogIndexTemplate({ siteTitle, navigation, posts, title = "Blog"
|
|
|
20
22
|
dimensions: activeFilters
|
|
21
23
|
});
|
|
22
24
|
const useClientControls = !!(filterDimensions || onSearch);
|
|
23
|
-
return (
|
|
25
|
+
return (_jsx(SiteLayout, { siteTitle: siteTitle, navigation: navigation, children: _jsxs("section", { className: "cedros-site__blog-page", children: [_jsxs("section", { className: "cedros-site__card cedros-site__blog-hero", children: [_jsxs("div", { className: "cedros-site__blog-hero-copy", children: [_jsx("span", { className: "cedros-site__pill cedros-site__pill--strong", children: "Journal" }), _jsx("h1", { className: "cedros-site__title cedros-site__blog-hero-title", children: title }), description && _jsx("p", { className: "cedros-site__subtitle cedros-site__blog-hero-subtitle", children: description })] }), _jsxs("dl", { className: "cedros-site__hero-stats", children: [_jsxs("div", { className: "cedros-site__hero-stat", children: [_jsx("dt", { children: "Posts" }), _jsx("dd", { children: totalPosts })] }), _jsxs("div", { className: "cedros-site__hero-stat", children: [_jsx("dt", { children: "Categories" }), _jsx("dd", { children: resolvedCategories.length })] }), _jsxs("div", { className: "cedros-site__hero-stat", children: [_jsx("dt", { children: "Topics" }), _jsx("dd", { children: resolvedTags.length })] })] })] }), useClientControls ? (_jsxs("section", { className: "cedros-site__card cedros-site__blog-controls-panel", children: [_jsxs("div", { className: "cedros-site__controls-header", children: [_jsxs("div", { children: [_jsx("p", { className: "cedros-site__eyebrow", children: "Discover" }), _jsx("h2", { className: "cedros-site__section-title", children: "Search and explore the latest posts" })] }), _jsx("p", { className: "cedros-site__entry-meta", children: "Use search and topic chips to narrow down the editorial feed." })] }), onSearch && _jsx(BlogSearchInput, { defaultValue: query, onSearch: onSearch }), filterDimensions && onFilterChange && (_jsx(FilterDimensionChips, { dimensions: filterDimensions, active: activeFilters ?? {}, onChange: onFilterChange }))] })) : (_jsx(BlogIndexControls, { basePath: basePath, query: query, category: category, tag: tag, sort: sort, categories: resolvedCategories, tags: resolvedTags })), result.totalItems === 0 && (_jsxs("section", { className: "cedros-site__card cedros-site__empty-state", children: [_jsx("p", { className: "cedros-site__eyebrow", children: "No matches" }), _jsx("h2", { className: "cedros-site__section-title", children: "No posts found" }), _jsx("p", { className: "cedros-site__subtitle", children: "Adjust filters or search terms to find matching articles." })] })), result.totalItems > 0 && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "cedros-site__section-heading", children: [_jsxs("div", { children: [_jsx("p", { className: "cedros-site__eyebrow", children: "Latest posts" }), _jsx("h2", { className: "cedros-site__section-title", children: "News, analysis, and product updates" })] }), _jsxs("p", { className: "cedros-site__entry-meta", children: [result.totalItems, " matching posts"] })] }), _jsx("section", { className: "cedros-site__content-grid cedros-site__content-grid--blog", children: result.items.map((post) => {
|
|
26
|
+
const cardMetadata = [post.publishedAt, post.author, readingTime(post.readingMinutes)]
|
|
27
|
+
.filter(Boolean)
|
|
28
|
+
.join(" • ");
|
|
29
|
+
return (_jsxs("article", { className: "cedros-site__card cedros-site__entry-card cedros-site__blog-card", children: [_jsxs("div", { className: "cedros-site__blog-card-top", children: [_jsx("div", { className: "cedros-site__blog-card-taxonomy", children: post.category && (_jsx("a", { href: buildContentListHref(basePath, { q: query, category: post.category, tag, sort }), className: "cedros-site__pill", children: post.category })) }), bookmarkedSlugs && onBookmarkToggle && (_jsx(BookmarkButton, { slug: post.slug, isBookmarked: bookmarkedSlugs.has(post.slug), onToggle: onBookmarkToggle }))] }), _jsx("h2", { className: "cedros-site__entry-title cedros-site__entry-title--blog", children: _jsx("a", { href: `${basePath}/${post.slug}`, children: post.title }) }), post.excerpt && _jsx("p", { className: "cedros-site__subtitle", children: post.excerpt }), post.tags && post.tags.length > 0 && (_jsx("div", { className: "cedros-site__tag-list", children: post.tags.map((entryTag) => (_jsx("a", { href: buildContentListHref(basePath, { q: query, category, tag: entryTag, sort }), className: "cedros-site__pill", children: entryTag }, entryTag))) })), _jsxs("div", { className: "cedros-site__blog-card-footer", children: [cardMetadata && _jsx("p", { className: "cedros-site__entry-meta", children: cardMetadata }), _jsx("a", { href: `${basePath}/${post.slug}`, className: "cedros-site__button cedros-site__button--ghost", children: "Read post" })] })] }, post.slug));
|
|
30
|
+
}) }), _jsx(ContentPagination, { basePath: basePath, page: result.page, totalPages: result.totalPages, query: { q: query, category, tag, sort } })] }))] }) }));
|
|
24
31
|
}
|
|
25
32
|
export function BlogPostTemplate({ siteTitle, navigation, title, bodyMarkdown, bodyHtml, allowUnsafeHtmlFallback = false, publishedAt, updatedAt, author, category, tags = [], readingMinutes, canonicalUrl, breadcrumbs = [], relatedPosts = [], basePath = "/blog", isBookmarked, onBookmarkToggle, slug, tipping, paywall }) {
|
|
26
33
|
const metadata = [publishedAt, updatedAt ? `Updated ${updatedAt}` : "", author, readingTime(readingMinutes)].filter(Boolean);
|
|
27
34
|
const showBookmark = isBookmarked !== undefined && onBookmarkToggle && slug;
|
|
28
|
-
return (
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
function BlogIndexControls({ basePath, query, category, tag, sort, categories, tags }) {
|
|
38
|
-
return (_jsxs("form", { method: "get", action: basePath, className: "cedros-site__controls cedros-site__card", children: [_jsxs("label", { className: "cedros-site__control", children: [_jsx("span", { children: "Search" }), _jsx("input", { type: "search", name: "q", defaultValue: query, placeholder: "Search blog posts" })] }), _jsxs("label", { className: "cedros-site__control", children: [_jsx("span", { children: "Category" }), _jsxs("select", { name: "category", defaultValue: category, children: [_jsx("option", { value: "", children: "All" }), categories.map((entry) => (_jsx("option", { value: entry, children: entry }, entry)))] })] }), _jsxs("label", { className: "cedros-site__control", children: [_jsx("span", { children: "Tag" }), _jsxs("select", { name: "tag", defaultValue: tag, children: [_jsx("option", { value: "", children: "All" }), tags.map((entry) => (_jsx("option", { value: entry, children: entry }, entry)))] })] }), _jsxs("label", { className: "cedros-site__control", children: [_jsx("span", { children: "Sort" }), _jsxs("select", { name: "sort", defaultValue: sort, children: [_jsx("option", { value: "newest", children: "Newest" }), _jsx("option", { value: "oldest", children: "Oldest" }), _jsx("option", { value: "title-asc", children: "Title A-Z" }), _jsx("option", { value: "title-desc", children: "Title Z-A" })] })] }), _jsxs("div", { className: "cedros-site__control-actions", children: [_jsx("button", { className: "cedros-site__nav-link", type: "submit", children: "Apply" }), _jsx("a", { className: "cedros-site__nav-link", href: basePath, children: "Clear" })] })] }));
|
|
35
|
+
return (_jsx(SiteLayout, { siteTitle: siteTitle, navigation: navigation, children: _jsxs("section", { className: "cedros-site__blog-page cedros-site__blog-page--article", children: [_jsxs("article", { className: "cedros-site__card cedros-site__article cedros-site__blog-article", children: [_jsxs("div", { className: "cedros-site__article-top", children: [_jsx(Breadcrumbs, { trail: breadcrumbs }), _jsxs("div", { className: "cedros-site__blog-article-actions", children: [canonicalUrl && (_jsx("a", { href: canonicalUrl, className: "cedros-site__button cedros-site__button--ghost", children: "Canonical URL" })), showBookmark && (_jsx(BookmarkButton, { slug: slug, isBookmarked: isBookmarked, onToggle: onBookmarkToggle }))] })] }), _jsxs("div", { className: "cedros-site__article-header", children: [_jsx("span", { className: "cedros-site__pill cedros-site__pill--strong", children: "Blog" }), _jsx("h1", { className: "cedros-site__title", children: title }), metadata.length > 0 && (_jsx("div", { className: "cedros-site__article-meta-list", children: metadata.map((entry) => (_jsx("span", { className: "cedros-site__meta-chip", children: entry }, entry))) })), (category || tags.length > 0) && (_jsxs("div", { className: "cedros-site__blog-taxonomy", children: [category && (_jsx("a", { href: buildContentListHref(basePath, { category }), className: "cedros-site__pill", children: category })), tags.map((tag) => (_jsx("a", { href: buildContentListHref(basePath, { tag }), className: "cedros-site__pill", children: tag }, tag)))] }))] }), _jsx("div", { className: "cedros-site__article-body", children: renderPaywallOrContent({
|
|
36
|
+
paywall,
|
|
37
|
+
bodyMarkdown,
|
|
38
|
+
bodyHtml,
|
|
39
|
+
allowUnsafeHtmlFallback
|
|
40
|
+
}) })] }), tipping?.enabled && (_jsxs("section", { className: "cedros-site__card cedros-site__blog-support-card", children: [_jsxs("div", { className: "cedros-site__blog-support-header", children: [_jsx("p", { className: "cedros-site__eyebrow", children: "Support" }), _jsx("h2", { className: "cedros-site__section-title", children: "Tip the author or support the publication" })] }), _jsx(TipWidget, { dataServerUrl: tipping.dataServerUrl, recipient: tipping.allowPerPostRecipient && tipping.recipientOverride
|
|
41
|
+
? tipping.recipientOverride
|
|
42
|
+
: tipping.recipient, currencies: tipping.currencies, presets: tipping.presets, label: tipping.label, description: tipping.description, senderAddress: tipping.senderAddress, signTransaction: tipping.signTransaction })] })), relatedPosts.length > 0 && (_jsxs("section", { className: "cedros-site__card cedros-site__blog-related", children: [_jsxs("div", { className: "cedros-site__blog-related-header", children: [_jsx("p", { className: "cedros-site__eyebrow", children: "Continue reading" }), _jsx("h2", { className: "cedros-site__section-title", children: "Related posts" })] }), _jsx("div", { className: "cedros-site__blog-related-grid", children: relatedPosts.map((post) => (_jsxs("article", { className: "cedros-site__card cedros-site__blog-related-card", children: [_jsx("h3", { className: "cedros-site__entry-title cedros-site__entry-title--blog", children: _jsx("a", { href: `${basePath}/${post.slug}`, children: post.title }) }), post.excerpt && _jsx("p", { className: "cedros-site__subtitle", children: post.excerpt }), _jsx("div", { className: "cedros-site__blog-card-footer", children: _jsx("a", { href: `${basePath}/${post.slug}`, className: "cedros-site__button cedros-site__button--ghost", children: "Read post" }) })] }, post.slug))) })] }))] }) }));
|
|
39
43
|
}
|
|
40
44
|
function readingTime(minutes) {
|
|
41
45
|
if (!minutes) {
|
|
@@ -11,4 +11,4 @@ export interface DocsSidebarProps {
|
|
|
11
11
|
* Desktop: always visible, sticky.
|
|
12
12
|
* Mobile: hidden behind a hamburger button; overlay closes on link click.
|
|
13
13
|
*/
|
|
14
|
-
export declare function DocsSidebar({ title, basePath, searchQuery, sections
|
|
14
|
+
export declare function DocsSidebar({ title, basePath, searchQuery, sections }: DocsSidebarProps): React.JSX.Element;
|
|
@@ -7,7 +7,7 @@ import { useState } from "react";
|
|
|
7
7
|
* Desktop: always visible, sticky.
|
|
8
8
|
* Mobile: hidden behind a hamburger button; overlay closes on link click.
|
|
9
9
|
*/
|
|
10
|
-
export function DocsSidebar({ title, basePath, searchQuery, sections
|
|
10
|
+
export function DocsSidebar({ title, basePath, searchQuery, sections }) {
|
|
11
11
|
const [open, setOpen] = useState(false);
|
|
12
|
-
return (_jsxs(_Fragment, { children: [
|
|
12
|
+
return (_jsxs(_Fragment, { children: [_jsxs("button", { type: "button", className: "cedros-site__sidebar-toggle", "aria-label": "Toggle sidebar", "aria-expanded": open, onClick: () => setOpen((prev) => !prev), children: [_jsxs("span", { className: "cedros-site__sidebar-toggle-copy", children: [_jsx("span", { className: "cedros-site__sidebar-toggle-label", children: title }), _jsxs("span", { className: "cedros-site__sidebar-toggle-meta", children: [sections.length, " sections"] })] }), _jsx("span", { className: "cedros-site__sidebar-toggle-state", children: open ? "Close" : "Open" })] }), open && (_jsx("div", { className: "cedros-site__sidebar-overlay", onClick: () => setOpen(false), role: "presentation" })), _jsxs("aside", { className: `cedros-site__card cedros-site__docs-sidebar${open ? " cedros-site__docs-sidebar--open" : ""}`, children: [_jsxs("div", { className: "cedros-site__docs-sidebar-top", children: [_jsxs("div", { children: [_jsx("p", { className: "cedros-site__eyebrow", children: "Navigation" }), _jsx("h2", { className: "cedros-site__docs-sidebar-title", children: title })] }), _jsx("button", { type: "button", className: "cedros-site__docs-sidebar-close", "aria-label": "Close sidebar", onClick: () => setOpen(false), children: "Close" })] }), _jsx("p", { className: "cedros-site__docs-sidebar-meta", children: "Browse sections, search directly, or return to the full index." }), _jsx("form", { method: "get", action: basePath, className: "cedros-site__docs-search", children: _jsxs("label", { className: "cedros-site__control", children: [_jsx("span", { children: "Search docs" }), _jsx("input", { type: "search", name: "q", defaultValue: searchQuery, placeholder: "Search docs..." })] }) }), _jsx("a", { href: basePath, className: "cedros-site__docs-root-link", children: "Browse all documentation" }), sections.length === 0 && (_jsx("p", { className: "cedros-site__entry-meta", children: "No sections available yet." })), sections.map((section) => (_jsxs("details", { className: "cedros-site__docs-section", open: section.collapsed !== true, children: [_jsx("summary", { className: "cedros-site__docs-section-title", children: section.label }), _jsx("nav", { className: "cedros-site__docs-section-links", "aria-label": section.label, children: section.items.map((item) => (_jsxs("a", { href: item.href, className: `cedros-site__docs-item cedros-site__docs-item--depth-${item.depth ?? 0}${item.isActive ? " cedros-site__docs-item--active" : ""}`, "aria-current": item.isActive ? "page" : undefined, onClick: () => setOpen(false), children: [_jsx("span", { children: item.label }), item.badge && (_jsx("span", { className: "cedros-site__docs-item-badge", children: item.badge }))] }, item.key))) })] }, section.key)))] })] }));
|
|
13
13
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { SiteNavigationItem } from "./SiteLayout.js";
|
|
2
2
|
import { type DocsIndexEntry } from "./contentIndex.js";
|
|
3
3
|
import { type DocsSidebarSection } from "./docsNavigation.js";
|
|
4
|
+
import { type DocsTemplateShellOptions } from "./docsTemplateShell.js";
|
|
4
5
|
export interface DocsIndexItem extends DocsIndexEntry {
|
|
5
6
|
}
|
|
6
|
-
export interface DocsIndexTemplateProps {
|
|
7
|
-
siteTitle
|
|
8
|
-
navigation
|
|
7
|
+
export interface DocsIndexTemplateProps extends DocsTemplateShellOptions {
|
|
8
|
+
siteTitle?: string;
|
|
9
|
+
navigation?: SiteNavigationItem[];
|
|
9
10
|
docs: DocsIndexItem[];
|
|
10
11
|
title?: string;
|
|
11
12
|
description?: string;
|
|
@@ -22,10 +23,10 @@ export interface DocsIndexTemplateProps {
|
|
|
22
23
|
sidebarSections?: DocsSidebarSection[];
|
|
23
24
|
sidebarTitle?: string;
|
|
24
25
|
}
|
|
25
|
-
export declare function DocsIndexTemplate({ siteTitle, navigation, docs, title, description, basePath, currentPath, query, category, tag, sort, page, pageSize, categories, tags, sidebarSections, sidebarTitle }: DocsIndexTemplateProps): React.JSX.Element;
|
|
26
|
-
export interface DocArticleTemplateProps {
|
|
27
|
-
siteTitle
|
|
28
|
-
navigation
|
|
26
|
+
export declare function DocsIndexTemplate({ siteTitle, navigation, docs, title, description, basePath, currentPath, query, category, tag, sort, page, pageSize, categories, tags, sidebarSections, sidebarTitle, headless, renderLayout }: DocsIndexTemplateProps): React.JSX.Element;
|
|
27
|
+
export interface DocArticleTemplateProps extends DocsTemplateShellOptions {
|
|
28
|
+
siteTitle?: string;
|
|
29
|
+
navigation?: SiteNavigationItem[];
|
|
29
30
|
title: string;
|
|
30
31
|
bodyMarkdown?: string;
|
|
31
32
|
bodyHtml?: string;
|
|
@@ -57,4 +58,4 @@ export interface DocArticleTemplateProps {
|
|
|
57
58
|
};
|
|
58
59
|
editHref?: string;
|
|
59
60
|
}
|
|
60
|
-
export declare function DocArticleTemplate({ siteTitle, navigation, title, bodyMarkdown, bodyHtml, allowUnsafeHtmlFallback, lastUpdated, readingMinutes, basePath, currentPath, searchQuery, docs, sidebarSections, sidebarTitle, breadcrumbs, toc, previousDoc, nextDoc, editHref }: DocArticleTemplateProps): React.JSX.Element;
|
|
61
|
+
export declare function DocArticleTemplate({ siteTitle, navigation, title, bodyMarkdown, bodyHtml, allowUnsafeHtmlFallback, lastUpdated, readingMinutes, basePath, currentPath, searchQuery, docs, sidebarSections, sidebarTitle, breadcrumbs, toc, previousDoc, nextDoc, editHref, headless, renderLayout }: DocArticleTemplateProps): React.JSX.Element;
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { normalizeDocsHref } from "../docsContract.js";
|
|
3
3
|
import { buildContentListHref, collectFilterValues, prepareDocsIndex } from "./contentIndex.js";
|
|
4
4
|
import { Breadcrumbs, ContentPagination } from "./contentUi.js";
|
|
5
|
-
import { buildDocsSidebarSections, withActiveDocsSidebar } from "./docsNavigation.js";
|
|
5
|
+
import { buildDocsNavigation, buildDocsSidebarSections, withActiveDocsSidebar } from "./docsNavigation.js";
|
|
6
6
|
import { DocsSidebar } from "./DocsSidebar.js";
|
|
7
|
+
import { renderDocsTemplateShell } from "./docsTemplateShell.js";
|
|
7
8
|
import { MarkdownContent } from "./MarkdownContent.js";
|
|
8
9
|
import { TocScrollSpy } from "./tocScrollSpy.js";
|
|
9
|
-
export function DocsIndexTemplate({ siteTitle, navigation, docs, title = "Documentation", description = "", basePath = "/docs", currentPath, query = "", category = "", tag = "", sort = "title-asc", page = 1, pageSize = 10, categories, tags, sidebarSections, sidebarTitle = "Docs" }) {
|
|
10
|
+
export function DocsIndexTemplate({ siteTitle, navigation, docs, title = "Documentation", description = "", basePath = "/docs", currentPath, query = "", category = "", tag = "", sort = "title-asc", page = 1, pageSize = 10, categories, tags, sidebarSections, sidebarTitle = "Docs", headless = false, renderLayout }) {
|
|
10
11
|
const normalizedFilters = collectFilterValues(docs);
|
|
11
12
|
const resolvedCategories = categories ?? normalizedFilters.categories;
|
|
12
13
|
const resolvedTags = tags ?? normalizedFilters.tags;
|
|
13
14
|
const activePath = currentPath ?? basePath;
|
|
14
|
-
const resolvedSidebarSections = withActiveDocsSidebar(sidebarSections ??
|
|
15
|
+
const resolvedSidebarSections = withActiveDocsSidebar(sidebarSections ?? buildDefaultDocsSidebarSections(docs, basePath, activePath), activePath);
|
|
16
|
+
const categoryCount = resolvedCategories.length;
|
|
17
|
+
const tagCount = resolvedTags.length;
|
|
15
18
|
const result = prepareDocsIndex(docs, {
|
|
16
19
|
query,
|
|
17
20
|
category,
|
|
@@ -20,24 +23,30 @@ export function DocsIndexTemplate({ siteTitle, navigation, docs, title = "Docume
|
|
|
20
23
|
page,
|
|
21
24
|
pageSize
|
|
22
25
|
});
|
|
23
|
-
return (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
return renderDocsTemplateShell((_jsxs("section", { className: "cedros-site__docs-page", children: [_jsx(DocsSidebar, { title: sidebarTitle, basePath: basePath, searchQuery: query, sections: resolvedSidebarSections }), _jsxs("div", { className: "cedros-site__docs-main", children: [_jsxs("section", { className: "cedros-site__card cedros-site__docs-hero", children: [_jsxs("div", { className: "cedros-site__docs-hero-copy", children: [_jsx("span", { className: "cedros-site__pill cedros-site__pill--strong", children: "Documentation" }), _jsx("h1", { className: "cedros-site__title cedros-site__docs-hero-title", children: title }), description && _jsx("p", { className: "cedros-site__subtitle", children: description })] }), _jsxs("dl", { className: "cedros-site__hero-stats", children: [_jsxs("div", { className: "cedros-site__hero-stat", children: [_jsx("dt", { children: "Articles" }), _jsx("dd", { children: result.totalItems })] }), _jsxs("div", { className: "cedros-site__hero-stat", children: [_jsx("dt", { children: "Categories" }), _jsx("dd", { children: categoryCount })] }), _jsxs("div", { className: "cedros-site__hero-stat", children: [_jsx("dt", { children: "Topics" }), _jsx("dd", { children: tagCount })] })] })] }), _jsx(DocsIndexControls, { basePath: basePath, query: query, category: category, tag: tag, sort: sort, categories: resolvedCategories, tags: resolvedTags }), result.totalItems === 0 && (_jsxs("section", { className: "cedros-site__card cedros-site__empty-state", children: [_jsx("p", { className: "cedros-site__eyebrow", children: "No matches" }), _jsx("h2", { className: "cedros-site__section-title", children: "No documentation pages found" }), _jsx("p", { className: "cedros-site__subtitle", children: "Try a broader query or clear filters." })] })), result.totalItems > 0 && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "cedros-site__section-heading", children: [_jsxs("div", { children: [_jsx("p", { className: "cedros-site__eyebrow", children: "Browse" }), _jsx("h2", { className: "cedros-site__section-title", children: "Available guides and references" })] }), _jsxs("p", { className: "cedros-site__entry-meta", children: [result.totalItems, " matching pages"] })] }), _jsx("section", { className: "cedros-site__content-grid cedros-site__content-grid--docs", children: result.items.map((doc) => (_jsxs("article", { className: "cedros-site__card cedros-site__entry-card cedros-site__docs-entry-card", children: [_jsxs("div", { className: "cedros-site__docs-entry-head", children: [doc.category && _jsx("span", { className: "cedros-site__pill", children: doc.category }), doc.lastUpdated && (_jsxs("p", { className: "cedros-site__entry-meta", children: ["Updated ", doc.lastUpdated] }))] }), _jsx("h2", { className: "cedros-site__entry-title cedros-site__entry-title--docs", children: _jsx("a", { href: normalizeDocsHref(doc.slug, { basePath }), children: doc.title }) }), doc.description && _jsx("p", { className: "cedros-site__subtitle", children: doc.description }), doc.tags && doc.tags.length > 0 && (_jsx("div", { className: "cedros-site__tag-list", children: doc.tags.map((entryTag) => (_jsx("a", { href: buildContentListHref(basePath, {
|
|
27
|
+
q: query,
|
|
28
|
+
category,
|
|
29
|
+
tag: entryTag,
|
|
30
|
+
sort
|
|
31
|
+
}), className: "cedros-site__pill", children: entryTag }, entryTag))) })), _jsx("div", { className: "cedros-site__docs-entry-footer", children: _jsx("a", { href: normalizeDocsHref(doc.slug, { basePath }), className: "cedros-site__button cedros-site__button--ghost", children: "Read article" }) })] }, doc.slug))) }), _jsx(ContentPagination, { basePath: basePath, page: result.page, totalPages: result.totalPages, query: { q: query, category, tag, sort } })] }))] })] })), {
|
|
32
|
+
siteTitle,
|
|
33
|
+
navigation,
|
|
34
|
+
headless,
|
|
35
|
+
renderLayout
|
|
36
|
+
});
|
|
31
37
|
}
|
|
32
|
-
export function DocArticleTemplate({ siteTitle, navigation, title, bodyMarkdown, bodyHtml, allowUnsafeHtmlFallback = false, lastUpdated, readingMinutes, basePath = "/docs", currentPath, searchQuery = "", docs = [], sidebarSections, sidebarTitle = "Docs", breadcrumbs = [], toc = [], previousDoc, nextDoc, editHref }) {
|
|
38
|
+
export function DocArticleTemplate({ siteTitle, navigation, title, bodyMarkdown, bodyHtml, allowUnsafeHtmlFallback = false, lastUpdated, readingMinutes, basePath = "/docs", currentPath, searchQuery = "", docs = [], sidebarSections, sidebarTitle = "Docs", breadcrumbs = [], toc = [], previousDoc, nextDoc, editHref, headless = false, renderLayout }) {
|
|
33
39
|
const activePath = currentPath ?? breadcrumbs[breadcrumbs.length - 1]?.href;
|
|
34
|
-
const resolvedSidebarSections = withActiveDocsSidebar(sidebarSections ??
|
|
35
|
-
return (
|
|
36
|
-
|
|
37
|
-
|
|
40
|
+
const resolvedSidebarSections = withActiveDocsSidebar(sidebarSections ?? buildDefaultDocsSidebarSections(docs, basePath, activePath), activePath);
|
|
41
|
+
return renderDocsTemplateShell((_jsxs("section", { className: "cedros-site__docs-page cedros-site__docs-page--article", children: [_jsx(DocsSidebar, { title: sidebarTitle, basePath: basePath, searchQuery: searchQuery, sections: resolvedSidebarSections }), _jsxs("article", { className: "cedros-site__card cedros-site__article cedros-site__docs-article", children: [_jsxs("div", { className: "cedros-site__article-top", children: [_jsx(Breadcrumbs, { trail: breadcrumbs }), editHref && (_jsx("a", { href: editHref, className: "cedros-site__button cedros-site__button--ghost", children: "Suggest edit" }))] }), _jsxs("div", { className: "cedros-site__article-header", children: [_jsx("span", { className: "cedros-site__pill cedros-site__pill--strong", children: "Documentation" }), _jsx("h1", { className: "cedros-site__title", children: title }), (lastUpdated || readingMinutes) && (_jsxs("div", { className: "cedros-site__article-meta-list", children: [lastUpdated && (_jsxs("span", { className: "cedros-site__meta-chip", children: ["Updated ", lastUpdated] })), readingMinutes && (_jsx("span", { className: "cedros-site__meta-chip", children: readingTime(readingMinutes) }))] }))] }), _jsx("div", { className: "cedros-site__article-body", children: _jsx(MarkdownContent, { bodyMarkdown: bodyMarkdown, bodyHtml: bodyHtml, allowUnsafeHtmlFallback: allowUnsafeHtmlFallback }) }), (previousDoc || nextDoc) && (_jsxs("footer", { className: "cedros-site__doc-footer", children: [previousDoc && (_jsxs("a", { href: previousDoc.href, className: "cedros-site__pager-card", children: [_jsx("span", { className: "cedros-site__pager-label", children: "Previous" }), _jsx("span", { className: "cedros-site__pager-title", children: previousDoc.title })] })), nextDoc && (_jsxs("a", { href: nextDoc.href, className: "cedros-site__pager-card cedros-site__pager-card--next", children: [_jsx("span", { className: "cedros-site__pager-label", children: "Next" }), _jsx("span", { className: "cedros-site__pager-title", children: nextDoc.title })] }))] }))] }), toc.length > 0 && (_jsxs("aside", { className: "cedros-site__card cedros-site__toc", children: [_jsxs("div", { className: "cedros-site__toc-header", children: [_jsx("p", { className: "cedros-site__eyebrow", children: "On this page" }), _jsx("h2", { className: "cedros-site__toc-title", children: "Contents" })] }), _jsx(TocScrollSpy, { entries: toc })] }))] })), {
|
|
42
|
+
siteTitle,
|
|
43
|
+
navigation,
|
|
44
|
+
headless,
|
|
45
|
+
renderLayout
|
|
46
|
+
});
|
|
38
47
|
}
|
|
39
48
|
function DocsIndexControls({ basePath, query, category, tag, sort, categories, tags }) {
|
|
40
|
-
return (_jsxs("form", { method: "get", action: basePath, className: "cedros-site__controls cedros-site__card", children: [_jsxs("label", { className: "cedros-site__control", children: [_jsx("span", { children: "Search" }), _jsx("input", { type: "search", name: "q", defaultValue: query, placeholder: "Search docs" })] }), _jsxs("label", { className: "cedros-site__control", children: [_jsx("span", { children: "Category" }), _jsxs("select", { name: "category", defaultValue: category, children: [_jsx("option", { value: "", children: "All" }), categories.map((entry) => (_jsx("option", { value: entry, children: entry }, entry)))] })] }), _jsxs("label", { className: "cedros-site__control", children: [_jsx("span", { children: "Tag" }), _jsxs("select", { name: "tag", defaultValue: tag, children: [_jsx("option", { value: "", children: "All" }), tags.map((entry) => (_jsx("option", { value: entry, children: entry }, entry)))] })] }), _jsxs("label", { className: "cedros-site__control", children: [_jsx("span", { children: "Sort" }), _jsxs("select", { name: "sort", defaultValue: sort, children: [_jsx("option", { value: "title-asc", children: "Title A-Z" }), _jsx("option", { value: "title-desc", children: "Title Z-A" }), _jsx("option", { value: "updated-desc", children: "Recently updated" }), _jsx("option", { value: "updated-asc", children: "Least recently updated" })] })] }), _jsxs("div", { className: "cedros-site__control-actions", children: [_jsx("button", { className: "cedros-
|
|
49
|
+
return (_jsxs("form", { method: "get", action: basePath, className: "cedros-site__controls cedros-site__card cedros-site__controls--docs", children: [_jsxs("div", { className: "cedros-site__controls-header", children: [_jsxs("div", { children: [_jsx("p", { className: "cedros-site__eyebrow", children: "Refine" }), _jsx("h2", { className: "cedros-site__section-title", children: "Search and filter the knowledge base" })] }), _jsx("p", { className: "cedros-site__entry-meta", children: "Use text search, categories, and tags to narrow the result set." })] }), _jsxs("div", { className: "cedros-site__controls-grid", children: [_jsxs("label", { className: "cedros-site__control", children: [_jsx("span", { children: "Search" }), _jsx("input", { type: "search", name: "q", defaultValue: query, placeholder: "Search docs" })] }), _jsxs("label", { className: "cedros-site__control", children: [_jsx("span", { children: "Category" }), _jsxs("select", { name: "category", defaultValue: category, children: [_jsx("option", { value: "", children: "All categories" }), categories.map((entry) => (_jsx("option", { value: entry, children: entry }, entry)))] })] }), _jsxs("label", { className: "cedros-site__control", children: [_jsx("span", { children: "Tag" }), _jsxs("select", { name: "tag", defaultValue: tag, children: [_jsx("option", { value: "", children: "All topics" }), tags.map((entry) => (_jsx("option", { value: entry, children: entry }, entry)))] })] }), _jsxs("label", { className: "cedros-site__control", children: [_jsx("span", { children: "Sort" }), _jsxs("select", { name: "sort", defaultValue: sort, children: [_jsx("option", { value: "title-asc", children: "Title A-Z" }), _jsx("option", { value: "title-desc", children: "Title Z-A" }), _jsx("option", { value: "updated-desc", children: "Recently updated" }), _jsx("option", { value: "updated-asc", children: "Least recently updated" })] })] }), _jsxs("div", { className: "cedros-site__control-actions", children: [_jsx("button", { className: "cedros-site__button", type: "submit", children: "Apply filters" }), _jsx("a", { className: "cedros-site__button cedros-site__button--ghost", href: basePath, children: "Clear" })] })] })] }));
|
|
41
50
|
}
|
|
42
51
|
function readingTime(minutes) {
|
|
43
52
|
if (!minutes) {
|
|
@@ -45,3 +54,8 @@ function readingTime(minutes) {
|
|
|
45
54
|
}
|
|
46
55
|
return `${minutes} min read`;
|
|
47
56
|
}
|
|
57
|
+
function buildDefaultDocsSidebarSections(docs, basePath, currentPath) {
|
|
58
|
+
return docs.some((doc) => doc.slug.includes("/") || doc.productSlug || doc.sectionKey)
|
|
59
|
+
? buildDocsNavigation(docs, { basePath, currentPath, collapsible: true })
|
|
60
|
+
: buildDocsSidebarSections(docs, basePath);
|
|
61
|
+
}
|
|
@@ -3,5 +3,5 @@ export function SiteFooter({ siteTitle, note, links = [], rightSlot, layout }) {
|
|
|
3
3
|
const footerClasses = layout?.width === "full"
|
|
4
4
|
? "cedros-site__footer cedros-site__footer--full"
|
|
5
5
|
: "cedros-site__footer";
|
|
6
|
-
return (_jsx("footer", { className: footerClasses, children: _jsxs("div", { className: "cedros-site__container cedros-site__footer-inner", children: [_jsxs("div", { className: "cedros-site__footer-brand", children: [_jsx("span", { children: siteTitle }), note && _jsx("
|
|
6
|
+
return (_jsx("footer", { className: footerClasses, children: _jsxs("div", { className: "cedros-site__container cedros-site__footer-inner", children: [_jsxs("div", { className: "cedros-site__footer-brand", children: [_jsxs("div", { className: "cedros-site__footer-brand-row", children: [_jsx("span", { className: "cedros-site__brand-mark cedros-site__brand-mark--footer", "aria-hidden": "true" }), _jsx("span", { className: "cedros-site__footer-title", children: siteTitle })] }), note && _jsx("p", { className: "cedros-site__footer-note", children: note })] }), links.length > 0 && (_jsx("nav", { className: "cedros-site__footer-links", "aria-label": "Footer", children: links.map((link) => (_jsx("a", { href: link.route, className: "cedros-site__footer-link", children: link.label }, link.key))) })), rightSlot && _jsx("div", { className: "cedros-site__footer-right", children: rightSlot })] }) }));
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { SiteFooter } from "./SiteFooter.js";
|
|
3
3
|
import { TopNav } from "./TopNav.js";
|
|
4
|
-
export function SiteLayout({ siteTitle, navigation, children, brandHref = "/", footerNote
|
|
4
|
+
export function SiteLayout({ siteTitle, navigation, children, brandHref = "/", footerNote, layout }) {
|
|
5
5
|
return (_jsxs("div", { className: "cedros-site", children: [_jsx(TopNav, { siteTitle: siteTitle, navigation: navigation, brandHref: brandHref, layout: layout?.nav }), _jsx("main", { className: "cedros-site__main", children: _jsx("div", { className: "cedros-site__container", children: children }) }), _jsx(SiteFooter, { siteTitle: siteTitle, note: footerNote, layout: layout?.footer })] }));
|
|
6
6
|
}
|
|
@@ -6,7 +6,7 @@ export function TopNav({ siteTitle, navigation, brandHref = "/", rightSlot, curr
|
|
|
6
6
|
: navigation.map((item) => ({ ...item, isActive: false }));
|
|
7
7
|
const headerClasses = buildHeaderClasses(layout);
|
|
8
8
|
const linkStyleClass = layout?.linkStyle === "text" ? " cedros-site__nav-link--text" : "";
|
|
9
|
-
return (_jsx("header", { className: headerClasses, children: _jsxs("div", { className: "cedros-site__container cedros-site__header-inner", children: [
|
|
9
|
+
return (_jsx("header", { className: headerClasses, children: _jsxs("div", { className: "cedros-site__container cedros-site__header-inner", children: [_jsxs("a", { href: brandHref, className: "cedros-site__brand", "aria-label": siteTitle, children: [_jsx("span", { className: "cedros-site__brand-mark", "aria-hidden": "true" }), _jsx("span", { className: "cedros-site__brand-name", children: siteTitle })] }), activeNavigation.length > 0 && (_jsx("div", { className: "cedros-site__nav-shell", children: _jsx("nav", { className: "cedros-site__nav", "aria-label": "Primary", children: activeNavigation.map((item) => (_jsx("a", { href: item.route, className: `cedros-site__nav-link${linkStyleClass}${item.isActive ? " cedros-site__nav-link--active" : ""}`, "aria-current": item.isActive ? "page" : undefined, children: item.label }, item.key))) }) })), rightSlot && _jsx("div", { className: "cedros-site__header-right", children: rightSlot })] }) }));
|
|
10
10
|
}
|
|
11
11
|
function buildHeaderClasses(layout) {
|
|
12
12
|
let classes = "cedros-site__header";
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
.cedros-site__blog-page {
|
|
2
|
+
display: grid;
|
|
3
|
+
gap: 1rem;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.cedros-site__blog-page--article {
|
|
7
|
+
gap: 1.1rem;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.cedros-site__blog-hero {
|
|
11
|
+
display: grid;
|
|
12
|
+
grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.8fr);
|
|
13
|
+
gap: 1rem;
|
|
14
|
+
padding: 1.45rem;
|
|
15
|
+
background:
|
|
16
|
+
linear-gradient(135deg, color-mix(in srgb, #f59e0b 9%, var(--cds-panel) 91%), color-mix(in srgb, var(--cds-link) 8%, var(--cds-panel) 92%)),
|
|
17
|
+
var(--cds-panel);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.cedros-site__blog-hero-copy {
|
|
21
|
+
display: grid;
|
|
22
|
+
gap: 0.9rem;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.cedros-site__blog-hero-title {
|
|
26
|
+
max-width: 7ch;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.cedros-site__blog-hero-subtitle {
|
|
30
|
+
max-width: 42ch;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.cedros-site__blog-controls-panel,
|
|
34
|
+
.cedros-site__controls--blog {
|
|
35
|
+
padding: 1.15rem 1.2rem 1.25rem;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.cedros-site__content-grid--blog {
|
|
39
|
+
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.cedros-site__entry-title--blog {
|
|
43
|
+
font-size: 1.22rem;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.cedros-site__blog-card {
|
|
47
|
+
height: 100%;
|
|
48
|
+
align-content: start;
|
|
49
|
+
background:
|
|
50
|
+
linear-gradient(180deg, color-mix(in srgb, var(--cds-panel) 92%, transparent), color-mix(in srgb, var(--cds-panel) 78%, var(--cds-bg) 22%)),
|
|
51
|
+
var(--cds-panel);
|
|
52
|
+
transition:
|
|
53
|
+
transform 160ms ease,
|
|
54
|
+
border-color 160ms ease,
|
|
55
|
+
box-shadow 160ms ease;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.cedros-site__blog-card:hover,
|
|
59
|
+
.cedros-site__blog-related-card:hover {
|
|
60
|
+
transform: translateY(-2px);
|
|
61
|
+
border-color: color-mix(in srgb, var(--cds-link) 28%, var(--cds-border) 72%);
|
|
62
|
+
box-shadow: var(--cds-shadow-lg);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.cedros-site__blog-card-top,
|
|
66
|
+
.cedros-site__blog-card-footer,
|
|
67
|
+
.cedros-site__blog-article-actions {
|
|
68
|
+
display: flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
justify-content: space-between;
|
|
71
|
+
gap: 0.75rem;
|
|
72
|
+
flex-wrap: wrap;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.cedros-site__blog-card-taxonomy,
|
|
76
|
+
.cedros-site__blog-taxonomy {
|
|
77
|
+
display: inline-flex;
|
|
78
|
+
flex-wrap: wrap;
|
|
79
|
+
gap: 0.45rem;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.cedros-site__blog-card-footer {
|
|
83
|
+
margin-top: auto;
|
|
84
|
+
align-items: flex-end;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.cedros-site__blog-card-footer .cedros-site__entry-meta {
|
|
88
|
+
flex: 1 1 220px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.cedros-site__blog-article {
|
|
92
|
+
gap: 1.2rem;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.cedros-site__blog-related,
|
|
96
|
+
.cedros-site__blog-support-card {
|
|
97
|
+
display: grid;
|
|
98
|
+
gap: 0.95rem;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.cedros-site__blog-related-header,
|
|
102
|
+
.cedros-site__blog-support-header {
|
|
103
|
+
display: grid;
|
|
104
|
+
gap: 0.3rem;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.cedros-site__blog-related-grid {
|
|
108
|
+
display: grid;
|
|
109
|
+
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
|
|
110
|
+
gap: 1rem;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.cedros-site__blog-related-card {
|
|
114
|
+
display: grid;
|
|
115
|
+
gap: 0.75rem;
|
|
116
|
+
height: 100%;
|
|
117
|
+
transition:
|
|
118
|
+
transform 160ms ease,
|
|
119
|
+
border-color 160ms ease,
|
|
120
|
+
box-shadow 160ms ease;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.cedros-site__search-field {
|
|
124
|
+
display: inline-flex;
|
|
125
|
+
align-items: center;
|
|
126
|
+
width: 100%;
|
|
127
|
+
gap: 0.75rem;
|
|
128
|
+
min-height: 3rem;
|
|
129
|
+
border: 1px solid color-mix(in srgb, var(--cds-border) 88%, transparent);
|
|
130
|
+
border-radius: calc(var(--cds-radius) - 0.05rem);
|
|
131
|
+
background: color-mix(in srgb, var(--cds-panel) 86%, transparent);
|
|
132
|
+
padding: 0 0.9rem;
|
|
133
|
+
box-shadow: inset 0 1px 0 rgb(255 255 255 / 38%);
|
|
134
|
+
transition:
|
|
135
|
+
border-color 140ms ease,
|
|
136
|
+
box-shadow 140ms ease,
|
|
137
|
+
background 140ms ease;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.cedros-site__search-field:focus-within {
|
|
141
|
+
border-color: color-mix(in srgb, var(--cds-link) 48%, var(--cds-border) 52%);
|
|
142
|
+
box-shadow: 0 0 0 0.24rem color-mix(in srgb, var(--cds-link) 12%, transparent);
|
|
143
|
+
background: var(--cds-panel);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.cedros-site__search-icon {
|
|
147
|
+
width: 1rem;
|
|
148
|
+
height: 1rem;
|
|
149
|
+
color: var(--cds-muted);
|
|
150
|
+
flex-shrink: 0;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.cedros-site__search-icon svg {
|
|
154
|
+
width: 100%;
|
|
155
|
+
height: 100%;
|
|
156
|
+
display: block;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.cedros-site__search-input {
|
|
160
|
+
width: 100%;
|
|
161
|
+
min-width: 0;
|
|
162
|
+
border: 0;
|
|
163
|
+
outline: 0;
|
|
164
|
+
background: transparent;
|
|
165
|
+
color: var(--cds-fg);
|
|
166
|
+
padding: 0;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.cedros-site__search-input::placeholder {
|
|
170
|
+
color: color-mix(in srgb, var(--cds-muted) 74%, transparent);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.cedros-site__search-shortcut {
|
|
174
|
+
display: inline-flex;
|
|
175
|
+
align-items: center;
|
|
176
|
+
min-height: 1.75rem;
|
|
177
|
+
padding: 0 0.55rem;
|
|
178
|
+
border-radius: 999px;
|
|
179
|
+
border: 1px solid color-mix(in srgb, var(--cds-border) 82%, transparent);
|
|
180
|
+
background: color-mix(in srgb, var(--cds-panel-muted) 86%, transparent);
|
|
181
|
+
color: var(--cds-muted);
|
|
182
|
+
font-size: 0.72rem;
|
|
183
|
+
font-weight: 700;
|
|
184
|
+
white-space: nowrap;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.cedros-site__filter-dimensions {
|
|
188
|
+
display: grid;
|
|
189
|
+
gap: 0.8rem;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.cedros-site__filter-group {
|
|
193
|
+
display: grid;
|
|
194
|
+
gap: 0.4rem;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.cedros-site__filter-group + .cedros-site__filter-group {
|
|
198
|
+
padding-top: 0.8rem;
|
|
199
|
+
border-top: 1px solid color-mix(in srgb, var(--cds-border) 76%, transparent);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.cedros-site__filter-group-label {
|
|
203
|
+
font-size: 0.72rem;
|
|
204
|
+
color: var(--cds-muted);
|
|
205
|
+
text-transform: uppercase;
|
|
206
|
+
letter-spacing: 0.08em;
|
|
207
|
+
font-weight: 700;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.cedros-site__filter-group-chips {
|
|
211
|
+
display: flex;
|
|
212
|
+
flex-wrap: wrap;
|
|
213
|
+
gap: 0.45rem;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.cedros-site__bookmark {
|
|
217
|
+
background: color-mix(in srgb, var(--cds-panel) 88%, transparent);
|
|
218
|
+
border: 1px solid color-mix(in srgb, var(--cds-border) 84%, transparent);
|
|
219
|
+
border-radius: 999px;
|
|
220
|
+
padding: 0.38rem 0.56rem;
|
|
221
|
+
cursor: pointer;
|
|
222
|
+
color: var(--cds-muted);
|
|
223
|
+
display: inline-flex;
|
|
224
|
+
align-items: center;
|
|
225
|
+
justify-content: center;
|
|
226
|
+
min-width: 2.2rem;
|
|
227
|
+
min-height: 2.2rem;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.cedros-site__bookmark:hover,
|
|
231
|
+
.cedros-site__bookmark[aria-pressed="true"] {
|
|
232
|
+
color: var(--cds-link-strong);
|
|
233
|
+
border-color: color-mix(in srgb, var(--cds-link) 42%, var(--cds-border) 58%);
|
|
234
|
+
background: var(--cds-link-soft);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
@media (max-width: 960px) {
|
|
238
|
+
.cedros-site__blog-hero {
|
|
239
|
+
grid-template-columns: 1fr;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
@media (max-width: 700px) {
|
|
244
|
+
.cedros-site__blog-hero,
|
|
245
|
+
.cedros-site__blog-controls-panel,
|
|
246
|
+
.cedros-site__controls--blog {
|
|
247
|
+
padding: 1rem;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.cedros-site__blog-card-footer .cedros-site__button,
|
|
251
|
+
.cedros-site__blog-related-card .cedros-site__button,
|
|
252
|
+
.cedros-site__blog-article-actions .cedros-site__button {
|
|
253
|
+
width: 100%;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.cedros-site__search-shortcut {
|
|
257
|
+
display: none;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
@@ -24,10 +24,10 @@ export function BlogSearchInput({ defaultValue = "", onSearch, placeholder = "Se
|
|
|
24
24
|
clearTimeout(timerRef.current);
|
|
25
25
|
};
|
|
26
26
|
}, []);
|
|
27
|
-
return (_jsx("input", { ref: inputRef, type: "search", defaultValue: defaultValue, onChange: handleChange, placeholder: placeholder, className: "cedros-site__search-input" }));
|
|
27
|
+
return (_jsxs("label", { className: "cedros-site__search-field", children: [_jsx("span", { className: "cedros-site__search-icon", "aria-hidden": "true", children: _jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", children: [_jsx("circle", { cx: "11", cy: "11", r: "7" }), _jsx("path", { d: "m20 20-3.5-3.5" })] }) }), _jsx("input", { ref: inputRef, type: "search", defaultValue: defaultValue, onChange: handleChange, placeholder: placeholder, className: "cedros-site__search-input" }), _jsx("span", { className: "cedros-site__search-shortcut", "aria-hidden": "true", children: "Ctrl/\u2318K" })] }));
|
|
28
28
|
}
|
|
29
29
|
export function FilterDimensionChips({ dimensions, active, onChange }) {
|
|
30
|
-
return (_jsx("div", { className: "cedros-site__filter-dimensions", children: dimensions.map((dim) => (_jsxs("div", { className: "cedros-site__filter-group", children: [_jsx("span", { className: "cedros-site__filter-group-label", children: dim.label }), _jsx("div", { className: "cedros-
|
|
30
|
+
return (_jsx("div", { className: "cedros-site__filter-dimensions", children: dimensions.map((dim) => (_jsxs("div", { className: "cedros-site__filter-group", children: [_jsx("span", { className: "cedros-site__filter-group-label", children: dim.label }), _jsx("div", { className: "cedros-site__filter-group-chips", children: dim.values.map((value) => {
|
|
31
31
|
const isActive = active[dim.key] === value;
|
|
32
32
|
return (_jsx("button", { type: "button", className: `cedros-site__pill${isActive ? " cedros-site__pill--active" : ""}`, onClick: () => onChange(dim.key, isActive ? "" : value), children: value }, value));
|
|
33
33
|
}) })] }, dim.key))) }));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface BlogIndexControlsProps {
|
|
2
|
+
basePath: string;
|
|
3
|
+
query: string;
|
|
4
|
+
category: string;
|
|
5
|
+
tag: string;
|
|
6
|
+
sort: "newest" | "oldest" | "title-asc" | "title-desc";
|
|
7
|
+
categories: string[];
|
|
8
|
+
tags: string[];
|
|
9
|
+
}
|
|
10
|
+
export declare function BlogIndexControls({ basePath, query, category, tag, sort, categories, tags }: BlogIndexControlsProps): React.JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export function BlogIndexControls({ basePath, query, category, tag, sort, categories, tags }) {
|
|
3
|
+
return (_jsxs("form", { method: "get", action: basePath, className: "cedros-site__controls cedros-site__card cedros-site__controls--blog", children: [_jsxs("div", { className: "cedros-site__controls-header", children: [_jsxs("div", { children: [_jsx("p", { className: "cedros-site__eyebrow", children: "Refine" }), _jsx("h2", { className: "cedros-site__section-title", children: "Search the editorial archive" })] }), _jsx("p", { className: "cedros-site__entry-meta", children: "Filter by category, topic, or sort order to find the right post faster." })] }), _jsxs("div", { className: "cedros-site__controls-grid", children: [_jsxs("label", { className: "cedros-site__control", children: [_jsx("span", { children: "Search" }), _jsx("input", { type: "search", name: "q", defaultValue: query, placeholder: "Search blog posts" })] }), _jsxs("label", { className: "cedros-site__control", children: [_jsx("span", { children: "Category" }), _jsxs("select", { name: "category", defaultValue: category, children: [_jsx("option", { value: "", children: "All categories" }), categories.map((entry) => (_jsx("option", { value: entry, children: entry }, entry)))] })] }), _jsxs("label", { className: "cedros-site__control", children: [_jsx("span", { children: "Tag" }), _jsxs("select", { name: "tag", defaultValue: tag, children: [_jsx("option", { value: "", children: "All topics" }), tags.map((entry) => (_jsx("option", { value: entry, children: entry }, entry)))] })] }), _jsxs("label", { className: "cedros-site__control", children: [_jsx("span", { children: "Sort" }), _jsxs("select", { name: "sort", defaultValue: sort, children: [_jsx("option", { value: "newest", children: "Newest" }), _jsx("option", { value: "oldest", children: "Oldest" }), _jsx("option", { value: "title-asc", children: "Title A-Z" }), _jsx("option", { value: "title-desc", children: "Title Z-A" })] })] }), _jsxs("div", { className: "cedros-site__control-actions", children: [_jsx("button", { className: "cedros-site__button", type: "submit", children: "Apply filters" }), _jsx("a", { className: "cedros-site__button cedros-site__button--ghost", href: basePath, children: "Clear" })] })] })] }));
|
|
4
|
+
}
|