@tenphi/renderer 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +23 -0
- package/dist/client/appearance.d.ts +12 -0
- package/dist/client/appearance.d.ts.map +1 -0
- package/dist/client/appearance.js +66 -0
- package/dist/client/appearance.js.map +1 -0
- package/dist/client/code-copy.d.ts +1 -0
- package/dist/client/code-copy.js +63 -0
- package/dist/client/code-copy.js.map +1 -0
- package/dist/client/heading-links.d.ts +6 -0
- package/dist/client/heading-links.d.ts.map +1 -0
- package/dist/client/heading-links.js +87 -0
- package/dist/client/heading-links.js.map +1 -0
- package/dist/client/mobile-toc.d.ts +1 -0
- package/dist/client/mobile-toc.js +28 -0
- package/dist/client/mobile-toc.js.map +1 -0
- package/dist/client/navigation.d.ts +1 -0
- package/dist/client/navigation.js +112 -0
- package/dist/client/navigation.js.map +1 -0
- package/dist/client/page-copy.d.ts +1 -0
- package/dist/client/page-copy.js +34 -0
- package/dist/client/page-copy.js.map +1 -0
- package/dist/client/search.d.ts +13 -0
- package/dist/client/search.d.ts.map +1 -0
- package/dist/client/search.js +87 -0
- package/dist/client/search.js.map +1 -0
- package/dist/client/sidebar.d.ts +1 -0
- package/dist/client/sidebar.js +93 -0
- package/dist/client/sidebar.js.map +1 -0
- package/dist/client/tabs.d.ts +6 -0
- package/dist/client/tabs.d.ts.map +1 -0
- package/dist/client/tabs.js +64 -0
- package/dist/client/tabs.js.map +1 -0
- package/dist/components/Callout.astro +15 -0
- package/dist/components/Card.astro +13 -0
- package/dist/components/CodeGroup.astro +47 -0
- package/dist/components/ContrastIcon.astro +29 -0
- package/dist/components/EditLink.astro +11 -0
- package/dist/components/GlobalStyles.js +1675 -0
- package/dist/components/HeaderLinks.astro +84 -0
- package/dist/components/Icon.astro +39 -0
- package/dist/components/LastUpdated.astro +17 -0
- package/dist/components/LayoutComponents.js +866 -0
- package/dist/components/Logo.astro +37 -0
- package/dist/components/MobileNavigationTabs.astro +79 -0
- package/dist/components/MobileTocList.astro +22 -0
- package/dist/components/PackageVersion.astro +25 -0
- package/dist/components/PageActions.astro +29 -0
- package/dist/components/Pagination.astro +29 -0
- package/dist/components/Preview.astro +34 -0
- package/dist/components/SidebarList.astro +122 -0
- package/dist/components/SiteLogo.astro +40 -0
- package/dist/components/SiteTitle.astro +7 -0
- package/dist/components/Steps.astro +6 -0
- package/dist/components/Tab.astro +10 -0
- package/dist/components/TableOfContents.astro +23 -0
- package/dist/components/Tabs.astro +16 -0
- package/dist/components/TastyComponents.js +255 -0
- package/dist/components/VersionSwitcher.astro +44 -0
- package/dist/components/appearance-preferences.test.ts +91 -0
- package/dist/components/appearance-preferences.ts +57 -0
- package/dist/components/component-styles.test.ts +129 -0
- package/dist/components/component-styles.ts +65 -0
- package/dist/components/customize-component.js +8 -0
- package/dist/components/props.d.ts +38 -0
- package/dist/components/props.d.ts.map +1 -0
- package/dist/components/props.js +1 -0
- package/dist/components/props.ts +30 -0
- package/dist/components/svg-icon.test.ts +11 -0
- package/dist/components/svg-icon.ts +11 -0
- package/dist/components/tasty-states.d.ts +2 -0
- package/dist/components/tasty-states.js +42 -0
- package/dist/components-public.d.ts +21 -0
- package/dist/components.d.ts +10 -0
- package/dist/components.js +9 -0
- package/dist/content.d.ts +11 -0
- package/dist/content.d.ts.map +1 -0
- package/dist/content.js +16 -0
- package/dist/content.js.map +1 -0
- package/dist/eslint-plugin.d.ts +32 -0
- package/dist/eslint-plugin.d.ts.map +1 -0
- package/dist/eslint-plugin.js +155 -0
- package/dist/eslint-plugin.js.map +1 -0
- package/dist/icons/arrow-left.svg +1 -0
- package/dist/icons/arrow-right.svg +1 -0
- package/dist/icons/check.svg +1 -0
- package/dist/icons/chevron-down.svg +1 -0
- package/dist/icons/chevron-right.svg +1 -0
- package/dist/icons/close.svg +1 -0
- package/dist/icons/copy.svg +1 -0
- package/dist/icons/device-desktop.svg +1 -0
- package/dist/icons/favicon.svg +11 -0
- package/dist/icons/menu.svg +1 -0
- package/dist/icons/moon.svg +1 -0
- package/dist/icons/palette.svg +1 -0
- package/dist/icons/search.svg +1 -0
- package/dist/icons/sun.svg +1 -0
- package/dist/index-BuX_Sb5c.d.ts +10 -0
- package/dist/index-BuX_Sb5c.d.ts.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1648 -0
- package/dist/index.js.map +1 -0
- package/dist/localization.d.ts +69 -0
- package/dist/localization.d.ts.map +1 -0
- package/dist/localization.js +195 -0
- package/dist/localization.js.map +1 -0
- package/dist/markdown/rendered-content.d.ts +6 -0
- package/dist/markdown/rendered-content.d.ts.map +1 -0
- package/dist/markdown/rendered-content.js +34 -0
- package/dist/markdown/rendered-content.js.map +1 -0
- package/dist/messages-B_3xUzUb.js +14 -0
- package/dist/messages-B_3xUzUb.js.map +1 -0
- package/dist/navigation.d.ts +31 -0
- package/dist/navigation.d.ts.map +1 -0
- package/dist/navigation.js +165 -0
- package/dist/navigation.js.map +1 -0
- package/dist/overrides/DraftContentNotice.astro +8 -0
- package/dist/overrides/EmptyFooter.astro +3 -0
- package/dist/overrides/Footer.astro +23 -0
- package/dist/overrides/Head.astro +59 -0
- package/dist/overrides/Header.astro +139 -0
- package/dist/overrides/Hero.astro +73 -0
- package/dist/overrides/LanguageSelect.astro +63 -0
- package/dist/overrides/MarkdownContent.astro +14 -0
- package/dist/overrides/MobileMenuFooter.astro +15 -0
- package/dist/overrides/MobileMenuToggle.astro +36 -0
- package/dist/overrides/MobileTableOfContents.astro +37 -0
- package/dist/overrides/PageFrame.astro +35 -0
- package/dist/overrides/Search.astro +64 -0
- package/dist/overrides/Sidebar.astro +89 -0
- package/dist/overrides/SocialIcons.astro +27 -0
- package/dist/overrides/ThemeSelect.astro +148 -0
- package/dist/page-metadata.d.ts +13 -0
- package/dist/page-metadata.d.ts.map +1 -0
- package/dist/page-metadata.js +109 -0
- package/dist/page-metadata.js.map +1 -0
- package/dist/route-context.d.ts +85 -0
- package/dist/route-context.d.ts.map +1 -0
- package/dist/route-context.js +116 -0
- package/dist/route-context.js.map +1 -0
- package/dist/routes/DocsPage.astro +91 -0
- package/dist/routes/NotFound.astro +12 -0
- package/dist/routes/Page.astro +120 -0
- package/dist/styling.d.ts +17 -0
- package/dist/styling.d.ts.map +1 -0
- package/dist/styling.js +17 -0
- package/dist/styling.js.map +1 -0
- package/dist/tasty-states-BDKIbfw2.js +65 -0
- package/dist/tasty-states-BDKIbfw2.js.map +1 -0
- package/dist/theme/defaults.d.ts +21 -0
- package/dist/theme/defaults.d.ts.map +1 -0
- package/dist/theme/defaults.js +93 -0
- package/dist/theme/defaults.js.map +1 -0
- package/dist/theme/fonts.ts +64 -0
- package/dist/theme/shiki-theme.d.ts +13 -0
- package/dist/theme/shiki-theme.d.ts.map +1 -0
- package/dist/theme/shiki-theme.js +328 -0
- package/dist/theme/shiki-theme.js.map +1 -0
- package/dist/theme/tasty-config.d.ts +13 -0
- package/dist/theme/tasty-config.d.ts.map +1 -0
- package/dist/theme/tasty-config.js +16 -0
- package/dist/theme/tasty-config.js.map +1 -0
- package/dist/ui.d.ts +6 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +53 -0
- package/dist/ui.js.map +1 -0
- package/dist/versioning.d.ts +11 -0
- package/dist/versioning.d.ts.map +1 -0
- package/dist/versioning.js +38 -0
- package/dist/versioning.js.map +1 -0
- package/package.json +92 -0
- package/tasty.config.mjs +1 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { LogoRoot } from "./LayoutComponents.js";
|
|
3
|
+
|
|
4
|
+
import type { LogoProps as Props } from "./props.js";
|
|
5
|
+
|
|
6
|
+
const {
|
|
7
|
+
label = "Cookbook",
|
|
8
|
+
decorative = false,
|
|
9
|
+
class: className,
|
|
10
|
+
} = Astro.props;
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<LogoRoot
|
|
14
|
+
className={className}
|
|
15
|
+
aria-hidden={decorative ? "true" : undefined}
|
|
16
|
+
data-tasty-anatomy="Logo"
|
|
17
|
+
>
|
|
18
|
+
<svg
|
|
19
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
20
|
+
viewBox="0 0 64 64"
|
|
21
|
+
role={decorative ? undefined : "img"}
|
|
22
|
+
aria-label={decorative ? undefined : label}
|
|
23
|
+
focusable="false"
|
|
24
|
+
>
|
|
25
|
+
<rect width="64" height="64" rx="14" fill="currentColor"></rect>
|
|
26
|
+
<path
|
|
27
|
+
class="td-logo__mark"
|
|
28
|
+
fill="currentColor"
|
|
29
|
+
d="M14.8 16c6.7.2 12.3 2 16.7 5.4v28.4c-4.4-3.1-10-4.7-16.6-4.9a3 3 0 0 1-2.9-3V19a3 3 0 0 1 2.8-3Z"
|
|
30
|
+
></path>
|
|
31
|
+
<path
|
|
32
|
+
class="td-logo__mark"
|
|
33
|
+
fill="currentColor"
|
|
34
|
+
d="M49.2 16c-6.7.2-12.3 2-16.7 5.4v28.4c4.4-3.1 10-4.7 16.6-4.9a3 3 0 0 0 2.9-3V19a3 3 0 0 0-2.8-3Z"
|
|
35
|
+
></path>
|
|
36
|
+
</svg>
|
|
37
|
+
</LogoRoot>
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
---
|
|
2
|
+
import {
|
|
3
|
+
localizedNavigation,
|
|
4
|
+
localePath,
|
|
5
|
+
localeHref,
|
|
6
|
+
} from "../localization.js";
|
|
7
|
+
import { messages } from "../localization.js";
|
|
8
|
+
import { content } from "virtual:cookbook/config";
|
|
9
|
+
import { layout as configuredLayout } from "virtual:cookbook/layout";
|
|
10
|
+
import { activeNavigationTab, navigationPath } from "../navigation.js";
|
|
11
|
+
import { MobileNavigationTabsRoot } from "./LayoutComponents.js";
|
|
12
|
+
|
|
13
|
+
interface Props {
|
|
14
|
+
base?: string;
|
|
15
|
+
currentPath: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const { base = "/", currentPath } = Astro.props;
|
|
19
|
+
const basePath = base === "/" ? "" : `/${base.replace(/^\/+|\/+$/g, "")}`;
|
|
20
|
+
const { layout } = localizedNavigation(
|
|
21
|
+
configuredLayout,
|
|
22
|
+
content.routes,
|
|
23
|
+
navigationPath(currentPath, base),
|
|
24
|
+
content,
|
|
25
|
+
);
|
|
26
|
+
const activeTab = activeNavigationTab(
|
|
27
|
+
layout.tabs,
|
|
28
|
+
localePath(navigationPath(currentPath, basePath || "/"), content),
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
function tabHref(link: string): string {
|
|
32
|
+
return localeHref(
|
|
33
|
+
link,
|
|
34
|
+
navigationPath(currentPath, base),
|
|
35
|
+
content.routes,
|
|
36
|
+
content,
|
|
37
|
+
base,
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
const ui = messages(Astro.locals.cookbookRoute?.lang ?? "en", content);
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
{
|
|
44
|
+
layout.tabs.length > 0 && (
|
|
45
|
+
<MobileNavigationTabsRoot
|
|
46
|
+
className="td-mobile-tabs cookbook-print-hidden"
|
|
47
|
+
aria-label={ui.sections}
|
|
48
|
+
data-tasty-anatomy="MobileNavigationTabs"
|
|
49
|
+
>
|
|
50
|
+
<details>
|
|
51
|
+
<summary aria-label={ui.chooseSection}>
|
|
52
|
+
<span class="td-mobile-tabs__label">
|
|
53
|
+
{layout.tabs[activeTab]?.label ?? ui.sections}
|
|
54
|
+
</span>
|
|
55
|
+
<svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true">
|
|
56
|
+
<path
|
|
57
|
+
d="m4 6 4 4 4-4"
|
|
58
|
+
fill="none"
|
|
59
|
+
stroke="currentColor"
|
|
60
|
+
stroke-width="1.5"
|
|
61
|
+
/>
|
|
62
|
+
</svg>
|
|
63
|
+
</summary>
|
|
64
|
+
<ul>
|
|
65
|
+
{layout.tabs.map((tab, index) => (
|
|
66
|
+
<li>
|
|
67
|
+
<a
|
|
68
|
+
href={tabHref(tab.link)}
|
|
69
|
+
aria-current={index === activeTab ? "page" : undefined}
|
|
70
|
+
>
|
|
71
|
+
{tab.label}
|
|
72
|
+
</a>
|
|
73
|
+
</li>
|
|
74
|
+
))}
|
|
75
|
+
</ul>
|
|
76
|
+
</details>
|
|
77
|
+
</MobileNavigationTabsRoot>
|
|
78
|
+
)
|
|
79
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
interface Item {
|
|
3
|
+
slug: string;
|
|
4
|
+
text: string;
|
|
5
|
+
children: Item[];
|
|
6
|
+
}
|
|
7
|
+
interface Props {
|
|
8
|
+
items: Item[];
|
|
9
|
+
}
|
|
10
|
+
const { items } = Astro.props;
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<ul>
|
|
14
|
+
{
|
|
15
|
+
items.map((item) => (
|
|
16
|
+
<li>
|
|
17
|
+
<a href={`#${item.slug}`}>{item.text}</a>
|
|
18
|
+
{item.children.length > 0 && <Astro.self items={item.children} />}
|
|
19
|
+
</li>
|
|
20
|
+
))
|
|
21
|
+
}
|
|
22
|
+
</ul>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { messages } from "../localization.js";
|
|
3
|
+
import { content } from "virtual:cookbook/config";
|
|
4
|
+
import { PackageVersionRoot } from "./LayoutComponents.js";
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
version?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const version = Astro.props.version?.trim();
|
|
11
|
+
const label = version?.startsWith("v") ? version : version ? `v${version}` : "";
|
|
12
|
+
const ui = messages(Astro.locals.cookbookRoute?.lang ?? "en", content);
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
{
|
|
16
|
+
label && (
|
|
17
|
+
<PackageVersionRoot
|
|
18
|
+
className="td-package-version"
|
|
19
|
+
aria-label={`${ui.version} ${version}`}
|
|
20
|
+
data-tasty-anatomy="PackageVersion"
|
|
21
|
+
>
|
|
22
|
+
{label}
|
|
23
|
+
</PackageVersionRoot>
|
|
24
|
+
)
|
|
25
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { PageActionsRoot } from "./LayoutComponents.js";
|
|
3
|
+
import { content } from "virtual:cookbook/config";
|
|
4
|
+
import { navigationPath } from "../navigation.js";
|
|
5
|
+
import { agentPagePath } from "../page-metadata.js";
|
|
6
|
+
import { messages } from "../localization.js";
|
|
7
|
+
const route = navigationPath(Astro.url.pathname, content.base);
|
|
8
|
+
const entry = content.entries.find((entry) => entry.route === route);
|
|
9
|
+
const ui = messages(Astro.locals.cookbookRoute.lang, content);
|
|
10
|
+
const enabled =
|
|
11
|
+
entry && !entry.frontmatter.draft && content.site.seo?.copyPage !== false;
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
{
|
|
15
|
+
enabled && (
|
|
16
|
+
<PageActionsRoot data-tasty-anatomy="PageActions">
|
|
17
|
+
<button type="button" data-copy-page={agentPagePath(route, content.base)}>
|
|
18
|
+
{ui.copyPage}
|
|
19
|
+
</button>
|
|
20
|
+
<a href={agentPagePath(route, content.base)} download>
|
|
21
|
+
{ui.viewMarkdown}
|
|
22
|
+
</a>
|
|
23
|
+
<span role="status" aria-live="polite" />
|
|
24
|
+
</PageActionsRoot>
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
<script>
|
|
28
|
+
import "../client/page-copy.js";
|
|
29
|
+
</script>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
const { dir, pagination } = Astro.locals.cookbookRoute;
|
|
3
|
+
const { prev, next } = pagination;
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
{
|
|
7
|
+
(next || prev) && (
|
|
8
|
+
<div class="pagination-links" dir={dir} data-tasty-anatomy="Pagination">
|
|
9
|
+
{next && (
|
|
10
|
+
<a href={next.href} rel="next">
|
|
11
|
+
<span>
|
|
12
|
+
{Astro.locals.t("page.nextLink")}
|
|
13
|
+
<br />
|
|
14
|
+
<span class="link-title">{next.label}</span>
|
|
15
|
+
</span>
|
|
16
|
+
</a>
|
|
17
|
+
)}
|
|
18
|
+
{prev && (
|
|
19
|
+
<a href={prev.href} rel="prev">
|
|
20
|
+
<span>
|
|
21
|
+
{Astro.locals.t("page.previousLink")}
|
|
22
|
+
<br />
|
|
23
|
+
<span class="link-title">{prev.label}</span>
|
|
24
|
+
</span>
|
|
25
|
+
</a>
|
|
26
|
+
)}
|
|
27
|
+
</div>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { messages, requestLanguage } from "../localization.js";
|
|
3
|
+
import { content } from "virtual:cookbook/config";
|
|
4
|
+
import { PreviewRoot } from "./TastyComponents.js";
|
|
5
|
+
|
|
6
|
+
import type { PreviewProps as Props } from "./props.js";
|
|
7
|
+
|
|
8
|
+
const { title, html = "", css = "", javascript } = Astro.props;
|
|
9
|
+
const source = `<!doctype html><meta charset="utf-8"><style>${css}</style>${html}${javascript ? `<script>${javascript}<\/script>` : ""}`;
|
|
10
|
+
const ui = messages(
|
|
11
|
+
requestLanguage(Astro.url.pathname, content.base, content),
|
|
12
|
+
content,
|
|
13
|
+
);
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
<PreviewRoot
|
|
17
|
+
className="td-preview"
|
|
18
|
+
aria-label={title}
|
|
19
|
+
data-tasty-anatomy="Preview"
|
|
20
|
+
>
|
|
21
|
+
<PreviewRoot.Caption><strong>{title}</strong></PreviewRoot.Caption>
|
|
22
|
+
<PreviewRoot.Stage className="td-preview__stage">
|
|
23
|
+
<PreviewRoot.Frame
|
|
24
|
+
className="td-preview__frame"
|
|
25
|
+
title={title}
|
|
26
|
+
sandbox={javascript ? "allow-scripts" : ""}
|
|
27
|
+
srcDoc={source}
|
|
28
|
+
/>
|
|
29
|
+
</PreviewRoot.Stage>
|
|
30
|
+
<PreviewRoot.Code className="td-preview__code">
|
|
31
|
+
<PreviewRoot.Summary>{ui.viewSource}</PreviewRoot.Summary>
|
|
32
|
+
<PreviewRoot.Pre><code>{source}</code></PreviewRoot.Pre>
|
|
33
|
+
</PreviewRoot.Code>
|
|
34
|
+
</PreviewRoot>
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { SidebarEntry } from "../route-context.js";
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
entries: SidebarEntry[];
|
|
6
|
+
depth?: number;
|
|
7
|
+
path?: string[];
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const { entries, depth = 0, path = [] } = Astro.props;
|
|
11
|
+
const containsCurrent = (items: SidebarEntry[]): boolean =>
|
|
12
|
+
items.some((item) =>
|
|
13
|
+
item.type === "link" ? item.isCurrent : containsCurrent(item.entries),
|
|
14
|
+
);
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
<ul class:list={{ "top-level": depth === 0 }}>
|
|
18
|
+
{
|
|
19
|
+
entries.map((entry, index) => {
|
|
20
|
+
const groupPath = [...path, `${index}:${entry.label}`];
|
|
21
|
+
const first = entry.type === "group" ? entry.entries[0] : undefined;
|
|
22
|
+
const groupLink =
|
|
23
|
+
first?.type === "link" && "data-cookbook-group-link" in first.attrs
|
|
24
|
+
? first
|
|
25
|
+
: undefined;
|
|
26
|
+
const children =
|
|
27
|
+
entry.type === "group" ? entry.entries.slice(groupLink ? 1 : 0) : [];
|
|
28
|
+
const open = Boolean(groupLink?.isCurrent) || containsCurrent(children);
|
|
29
|
+
const badge = entry.badge && (
|
|
30
|
+
<span
|
|
31
|
+
class:list={["sidebar-badge", entry.badge.variant, entry.badge.class]}
|
|
32
|
+
>
|
|
33
|
+
{entry.badge.text}
|
|
34
|
+
</span>
|
|
35
|
+
);
|
|
36
|
+
const label = (
|
|
37
|
+
<span class="group-label">
|
|
38
|
+
<span>{entry.label}</span>
|
|
39
|
+
{badge}
|
|
40
|
+
</span>
|
|
41
|
+
);
|
|
42
|
+
const caret = (
|
|
43
|
+
<svg class="sidebar-caret" viewBox="0 0 16 16" aria-hidden="true">
|
|
44
|
+
<path
|
|
45
|
+
d="m6 4 4 4-4 4"
|
|
46
|
+
fill="none"
|
|
47
|
+
stroke="currentColor"
|
|
48
|
+
stroke-width="1.5"
|
|
49
|
+
stroke-linecap="round"
|
|
50
|
+
stroke-linejoin="round"
|
|
51
|
+
/>
|
|
52
|
+
</svg>
|
|
53
|
+
);
|
|
54
|
+
return (
|
|
55
|
+
<li>
|
|
56
|
+
{entry.type === "link" ? (
|
|
57
|
+
<a
|
|
58
|
+
{...entry.attrs}
|
|
59
|
+
href={entry.href}
|
|
60
|
+
aria-current={entry.isCurrent ? "page" : undefined}
|
|
61
|
+
class:list={[entry.attrs.class, { large: depth === 0 }]}
|
|
62
|
+
>
|
|
63
|
+
<span>{entry.label}</span>
|
|
64
|
+
{badge}
|
|
65
|
+
</a>
|
|
66
|
+
) : depth === 0 ? (
|
|
67
|
+
<>
|
|
68
|
+
<h2 class="sidebar-section-label group-label">
|
|
69
|
+
{groupLink ? (
|
|
70
|
+
<a
|
|
71
|
+
{...groupLink.attrs}
|
|
72
|
+
href={groupLink.href}
|
|
73
|
+
aria-current={groupLink.isCurrent ? "page" : undefined}
|
|
74
|
+
>
|
|
75
|
+
<span>{entry.label}</span>
|
|
76
|
+
{badge}
|
|
77
|
+
</a>
|
|
78
|
+
) : (
|
|
79
|
+
<>
|
|
80
|
+
<span>{entry.label}</span>
|
|
81
|
+
{badge}
|
|
82
|
+
</>
|
|
83
|
+
)}
|
|
84
|
+
</h2>
|
|
85
|
+
<Astro.self
|
|
86
|
+
entries={children}
|
|
87
|
+
depth={depth + 1}
|
|
88
|
+
path={groupPath}
|
|
89
|
+
/>
|
|
90
|
+
</>
|
|
91
|
+
) : (
|
|
92
|
+
<details open={open} data-sidebar-group={JSON.stringify(groupPath)}>
|
|
93
|
+
<summary tabindex={groupLink ? -1 : undefined}>
|
|
94
|
+
{groupLink ? (
|
|
95
|
+
<a
|
|
96
|
+
{...groupLink.attrs}
|
|
97
|
+
href={groupLink.href}
|
|
98
|
+
aria-current={groupLink.isCurrent ? "page" : undefined}
|
|
99
|
+
aria-expanded={open}
|
|
100
|
+
>
|
|
101
|
+
{label}
|
|
102
|
+
{caret}
|
|
103
|
+
</a>
|
|
104
|
+
) : (
|
|
105
|
+
<>
|
|
106
|
+
{label}
|
|
107
|
+
{caret}
|
|
108
|
+
</>
|
|
109
|
+
)}
|
|
110
|
+
</summary>
|
|
111
|
+
<Astro.self
|
|
112
|
+
entries={children}
|
|
113
|
+
depth={depth + 1}
|
|
114
|
+
path={groupPath}
|
|
115
|
+
/>
|
|
116
|
+
</details>
|
|
117
|
+
)}
|
|
118
|
+
</li>
|
|
119
|
+
);
|
|
120
|
+
})
|
|
121
|
+
}
|
|
122
|
+
</ul>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { content } from "virtual:cookbook/config";
|
|
3
|
+
import Logo from "./Logo.astro";
|
|
4
|
+
import { SiteLogoRoot } from "./LayoutComponents.js";
|
|
5
|
+
interface Props {
|
|
6
|
+
class?: string;
|
|
7
|
+
}
|
|
8
|
+
const logo = content.logo;
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
{
|
|
12
|
+
logo === false ? null : logo ? (
|
|
13
|
+
<SiteLogoRoot
|
|
14
|
+
className={Astro.props.class}
|
|
15
|
+
data-tasty-anatomy="SiteLogo"
|
|
16
|
+
aria-hidden={logo.decorative ? "true" : undefined}
|
|
17
|
+
>
|
|
18
|
+
<img
|
|
19
|
+
class={logo.dark ? "td-site-logo__light" : undefined}
|
|
20
|
+
src={logo.light.src}
|
|
21
|
+
width={logo.light.width}
|
|
22
|
+
height={logo.light.height}
|
|
23
|
+
alt={logo.decorative ? "" : logo.alt}
|
|
24
|
+
decoding="async"
|
|
25
|
+
/>
|
|
26
|
+
{logo.dark && (
|
|
27
|
+
<img
|
|
28
|
+
class="td-site-logo__dark"
|
|
29
|
+
src={logo.dark.src}
|
|
30
|
+
width={logo.dark.width}
|
|
31
|
+
height={logo.dark.height}
|
|
32
|
+
alt={logo.decorative ? "" : logo.alt}
|
|
33
|
+
decoding="async"
|
|
34
|
+
/>
|
|
35
|
+
)}
|
|
36
|
+
</SiteLogoRoot>
|
|
37
|
+
) : (
|
|
38
|
+
<Logo class={Astro.props.class} decorative />
|
|
39
|
+
)
|
|
40
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { TabRoot } from "./TastyComponents.js";
|
|
3
|
+
import type { TabProps as Props } from "./props.js";
|
|
4
|
+
const { label } = Astro.props;
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<TabRoot data-tab-panel data-label={label}>
|
|
8
|
+
<TabRoot.Heading data-tab-heading>{label}</TabRoot.Heading>
|
|
9
|
+
<slot />
|
|
10
|
+
</TabRoot>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { TocItem } from "../route-context.js";
|
|
3
|
+
interface Props {
|
|
4
|
+
items: TocItem[];
|
|
5
|
+
nested?: boolean;
|
|
6
|
+
}
|
|
7
|
+
const { items, nested = false } = Astro.props;
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
<ul>
|
|
11
|
+
{
|
|
12
|
+
items.map((item) => (
|
|
13
|
+
<li>
|
|
14
|
+
<a href={`#${item.slug}`}>
|
|
15
|
+
<span>{item.text}</span>
|
|
16
|
+
</a>
|
|
17
|
+
{item.children.length > 0 && (
|
|
18
|
+
<Astro.self items={item.children} nested />
|
|
19
|
+
)}
|
|
20
|
+
</li>
|
|
21
|
+
))
|
|
22
|
+
}
|
|
23
|
+
</ul>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { TabsRoot } from "./TastyComponents.js";
|
|
3
|
+
import type { TabsProps as Props } from "./props.js";
|
|
4
|
+
const { label = "Examples" } = Astro.props;
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<TabsRoot data-cookbook-tabs aria-label={label}>
|
|
8
|
+
<TabsRoot.List data-tabs-list />
|
|
9
|
+
<slot />
|
|
10
|
+
</TabsRoot>
|
|
11
|
+
|
|
12
|
+
<script>
|
|
13
|
+
import { initializeTabs } from "../client/tabs.js";
|
|
14
|
+
initializeTabs();
|
|
15
|
+
document.addEventListener("astro:page-load", initializeTabs);
|
|
16
|
+
</script>
|