@tenphi/renderer 0.21.1 → 0.21.2
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/dist/component-styles-DstqPFf3.js +21 -0
- package/dist/component-styles-DstqPFf3.js.map +1 -0
- package/dist/components/Banner.styles.js +19 -0
- package/dist/components/Button.styles.d.ts +9 -0
- package/dist/components/Button.styles.js +14 -0
- package/dist/components/Callout.astro +1 -1
- package/dist/components/Callout.styles.js +54 -0
- package/dist/components/Card.astro +4 -4
- package/dist/components/Card.styles.js +64 -0
- package/dist/components/CodeGroup.astro +9 -4
- package/dist/components/CodeGroup.styles.js +27 -0
- package/dist/components/Document.styles.js +230 -0
- package/dist/components/EditLink.astro +1 -1
- package/dist/components/Footer.styles.js +45 -0
- package/dist/components/Header.styles.js +96 -0
- package/dist/components/HeaderFrame.styles.js +20 -0
- package/dist/components/HeaderLinks.astro +2 -2
- package/dist/components/HeaderLinks.styles.js +149 -0
- package/dist/components/Hero.styles.js +129 -0
- package/dist/components/LanguageSelect.styles.js +169 -0
- package/dist/components/LastUpdated.astro +1 -1
- package/dist/components/Logo.astro +4 -8
- package/dist/components/Logo.styles.js +27 -0
- package/dist/components/MainContent.styles.js +38 -0
- package/dist/components/MainPane.styles.js +19 -0
- package/dist/components/MarkdownAlert.styles.js +61 -0
- package/dist/components/MarkdownCodeBlock.styles.js +131 -0
- package/dist/components/MarkdownContent.styles.js +231 -0
- package/dist/components/MarkdownHeading.styles.js +117 -0
- package/dist/components/MarkdownInlineCode.styles.js +19 -0
- package/dist/components/MarkdownTable.styles.js +58 -0
- package/dist/components/Mermaid.styles.js +50 -0
- package/dist/components/MermaidSource.styles.js +21 -0
- package/dist/components/MobileMenuFooter.styles.js +27 -0
- package/dist/components/MobileMenuToggle.styles.js +49 -0
- package/dist/components/MobileNavigationTabs.astro +1 -2
- package/dist/components/MobileNavigationTabs.styles.js +88 -0
- package/dist/components/MobileTableOfContents.styles.js +59 -0
- package/dist/components/PackageVersion.astro +1 -2
- package/dist/components/PackageVersion.styles.js +23 -0
- package/dist/components/PageActions.astro +2 -2
- package/dist/components/PageActions.styles.js +51 -0
- package/dist/components/PageFrame.styles.js +34 -0
- package/dist/components/Pagination.astro +3 -2
- package/dist/components/Pagination.styles.js +126 -0
- package/dist/components/Preview.astro +2 -6
- package/dist/components/Preview.styles.js +78 -0
- package/dist/components/Search.styles.js +132 -0
- package/dist/components/SearchButton.styles.js +68 -0
- package/dist/components/SearchResults.styles.js +200 -0
- package/dist/components/SelectPopover.astro +1 -0
- package/dist/components/Sidebar.styles.js +309 -0
- package/dist/components/SiteLogo.astro +1 -2
- package/dist/components/SiteLogo.styles.js +32 -0
- package/dist/components/SiteTitle.astro +1 -1
- package/dist/components/SkipLink.styles.js +24 -0
- package/dist/components/SocialIcons.styles.js +36 -0
- package/dist/components/Steps.astro +2 -2
- package/dist/components/Steps.styles.js +25 -0
- package/dist/components/SyntaxHighlight.styles.js +87 -0
- package/dist/components/Tab.astro +1 -1
- package/dist/components/Tab.styles.js +30 -0
- package/dist/components/TableOfContents.styles.js +62 -0
- package/dist/components/TableOfContentsLayout.styles.js +38 -0
- package/dist/components/Tabs.astro +1 -1
- package/dist/components/Tabs.styles.js +60 -0
- package/dist/components/ThemeSelect.styles.js +177 -0
- package/dist/components/TopNavigation.styles.js +52 -0
- package/dist/components/VersionSwitcher.astro +2 -2
- package/dist/components/VersionSwitcher.styles.js +45 -0
- package/dist/components/component-styles.test.ts +0 -10
- package/dist/components/component-styles.ts +0 -7
- package/dist/components/inherit-component-parts.d.ts +1 -0
- package/dist/components/inherit-component-parts.js +7 -0
- package/dist/components/select-popover-styles.js +34 -16
- package/dist/components/tasty-states.js +13 -1
- package/dist/define-component-BP4YwMak.js +28 -0
- package/dist/define-component-BP4YwMak.js.map +1 -0
- package/dist/define-component.d.ts +17 -0
- package/dist/define-component.d.ts.map +1 -0
- package/dist/define-component.js +2 -0
- package/dist/eslint-plugin.d.ts +5 -0
- package/dist/eslint-plugin.d.ts.map +1 -1
- package/dist/eslint-plugin.js +26 -3
- package/dist/eslint-plugin.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/overrides/Footer.astro +6 -5
- package/dist/overrides/Header.astro +13 -17
- package/dist/overrides/Hero.astro +3 -2
- package/dist/overrides/LanguageSelect.astro +3 -3
- package/dist/overrides/MarkdownContent.astro +7 -1
- package/dist/overrides/MobileMenuFooter.astro +2 -5
- package/dist/overrides/MobileMenuToggle.astro +4 -3
- package/dist/overrides/MobileTableOfContents.astro +2 -2
- package/dist/overrides/PageFrame.astro +9 -11
- package/dist/overrides/Search.astro +13 -9
- package/dist/overrides/Sidebar.astro +4 -1
- package/dist/overrides/SocialIcons.astro +2 -2
- package/dist/overrides/ThemeSelect.astro +9 -3
- package/dist/routes/Page.astro +22 -11
- package/dist/styling.d.ts +5 -10
- package/dist/styling.d.ts.map +1 -1
- package/dist/styling.js +18 -11
- package/dist/styling.js.map +1 -1
- package/dist/tasty-states-_JhxFdK1.js +47 -0
- package/dist/tasty-states-_JhxFdK1.js.map +1 -0
- package/dist/theme/defaults.d.ts.map +1 -1
- package/dist/theme/defaults.js +22 -1
- package/dist/theme/defaults.js.map +1 -1
- package/dist/theme/tasty-config.d.ts +23 -1
- package/dist/theme/tasty-config.d.ts.map +1 -1
- package/dist/theme/tasty-config.js +23 -1
- package/dist/theme/tasty-config.js.map +1 -1
- package/package.json +4 -4
- package/dist/components/GlobalStyles.js +0 -1792
- package/dist/components/LayoutComponents.js +0 -872
- package/dist/components/TastyComponents.js +0 -269
- package/dist/components/customize-component.js +0 -8
- package/dist/tasty-states-rTLFy26t.js +0 -57
- package/dist/tasty-states-rTLFy26t.js.map +0 -1
|
@@ -5,19 +5,20 @@ import { content } from "virtual:cookbook/config";
|
|
|
5
5
|
import EditLink from "virtual:cookbook/components/EditLink";
|
|
6
6
|
import LastUpdated from "virtual:cookbook/components/LastUpdated";
|
|
7
7
|
import Pagination from "virtual:cookbook/components/Pagination";
|
|
8
|
-
import { FooterRoot } from "../components/
|
|
8
|
+
import { FooterRoot } from "../components/Footer.styles.js";
|
|
9
9
|
const ui = messages(Astro.locals.cookbookRoute?.lang ?? "en", content);
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
-
<FooterRoot className="td-footer"
|
|
13
|
-
<div
|
|
12
|
+
<FooterRoot className="td-footer">
|
|
13
|
+
<div data-element="Meta">
|
|
14
14
|
<EditLink />
|
|
15
15
|
<LastUpdated />
|
|
16
16
|
</div>
|
|
17
17
|
<PageActions />
|
|
18
18
|
<Pagination />
|
|
19
|
-
<p
|
|
19
|
+
<p data-element="Credit">
|
|
20
20
|
{ui.generatedWith}{" "}
|
|
21
|
-
<a href="https://cookbook.tenphi.me/">Cookbook</a
|
|
21
|
+
<a data-element="CreditLink" href="https://cookbook.tenphi.me/">Cookbook</a
|
|
22
|
+
>.
|
|
22
23
|
</p>
|
|
23
24
|
</FooterRoot>
|
|
@@ -15,14 +15,11 @@ import ThemeSelect from "virtual:cookbook/components/ThemeSelect";
|
|
|
15
15
|
import { content } from "virtual:cookbook/config";
|
|
16
16
|
import { layout as configuredLayout } from "virtual:cookbook/layout";
|
|
17
17
|
import { activeNavigationTab, navigationPath } from "../navigation.js";
|
|
18
|
-
import GlobalStyles from "../components/GlobalStyles.js";
|
|
19
18
|
import Logo from "../components/SiteLogo.astro";
|
|
20
19
|
import PackageVersion from "../components/PackageVersion.astro";
|
|
21
20
|
import VersionSwitcher from "../components/VersionSwitcher.astro";
|
|
22
|
-
import {
|
|
23
|
-
|
|
24
|
-
TopNavigationRoot,
|
|
25
|
-
} from "../components/LayoutComponents.js";
|
|
21
|
+
import { HeaderRoot } from "../components/Header.styles.js";
|
|
22
|
+
import { TopNavigationRoot } from "../components/TopNavigation.styles.js";
|
|
26
23
|
|
|
27
24
|
const shouldRenderSearch = content.search;
|
|
28
25
|
const base = import.meta.env.BASE_URL.replace(/\/$/, "");
|
|
@@ -52,18 +49,16 @@ function tabHref(link: string): string {
|
|
|
52
49
|
const ui = messages(Astro.locals.cookbookRoute?.lang ?? "en", content);
|
|
53
50
|
---
|
|
54
51
|
|
|
55
|
-
<GlobalStyles />
|
|
56
52
|
<HeaderRoot
|
|
57
53
|
className={`td-header${layout.tabs.length ? " td-header--with-tabs" : ""}`}
|
|
58
|
-
data-tasty-anatomy="Header"
|
|
59
54
|
data-has-sidebar={Astro.locals.cookbookRoute.hasSidebar ? "" : undefined}
|
|
60
55
|
>
|
|
61
|
-
<div
|
|
62
|
-
<div
|
|
56
|
+
<div data-element="Primary">
|
|
57
|
+
<div data-element="Title">
|
|
63
58
|
{
|
|
64
59
|
content.logo !== false && (
|
|
65
60
|
<a
|
|
66
|
-
|
|
61
|
+
data-element="LogoLink"
|
|
67
62
|
href={localeHref(
|
|
68
63
|
content.logo ? (content.logo.href ?? "/") : "/",
|
|
69
64
|
currentPath,
|
|
@@ -77,7 +72,7 @@ const ui = messages(Astro.locals.cookbookRoute?.lang ?? "en", content);
|
|
|
77
72
|
: `${siteTitle}: ${ui.home}`
|
|
78
73
|
}
|
|
79
74
|
>
|
|
80
|
-
<Logo
|
|
75
|
+
<Logo />
|
|
81
76
|
</a>
|
|
82
77
|
)
|
|
83
78
|
}
|
|
@@ -98,27 +93,29 @@ const ui = messages(Astro.locals.cookbookRoute?.lang ?? "en", content);
|
|
|
98
93
|
/>
|
|
99
94
|
)
|
|
100
95
|
}
|
|
101
|
-
<div class="
|
|
96
|
+
<div data-element="Search" class="cookbook-print-hidden">
|
|
102
97
|
{shouldRenderSearch && <Search />}
|
|
103
98
|
</div>
|
|
104
99
|
<HeaderLinks />
|
|
105
100
|
<div
|
|
106
|
-
|
|
101
|
+
data-element="MobileTheme"
|
|
102
|
+
class="md:cookbook-hidden cookbook-print-hidden"
|
|
107
103
|
>
|
|
108
104
|
<ThemeSelect />
|
|
109
105
|
</div>
|
|
110
106
|
{
|
|
111
107
|
!Astro.locals.cookbookRoute.hasSidebar &&
|
|
112
108
|
Object.keys(content.locales ?? {}).length > 1 && (
|
|
113
|
-
<div class="
|
|
109
|
+
<div data-element="MobileLanguage" class="cookbook-print-hidden">
|
|
114
110
|
<LanguageSelect compact />
|
|
115
111
|
</div>
|
|
116
112
|
)
|
|
117
113
|
}
|
|
118
114
|
<div
|
|
119
|
-
|
|
115
|
+
data-element="Tools"
|
|
116
|
+
class="cookbook-hidden md:cookbook-flex cookbook-print-hidden"
|
|
120
117
|
>
|
|
121
|
-
<div
|
|
118
|
+
<div data-element="Social"><SocialIcons /></div>
|
|
122
119
|
<ThemeSelect />
|
|
123
120
|
<LanguageSelect />
|
|
124
121
|
</div>
|
|
@@ -128,7 +125,6 @@ const ui = messages(Astro.locals.cookbookRoute?.lang ?? "en", content);
|
|
|
128
125
|
<TopNavigationRoot
|
|
129
126
|
className="td-top-tabs cookbook-print-hidden"
|
|
130
127
|
aria-label={ui.primary}
|
|
131
|
-
data-tasty-anatomy="TopNavigation"
|
|
132
128
|
>
|
|
133
129
|
{layout.tabs.map((tab, index) => (
|
|
134
130
|
<a
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
import DraftContentNotice from "virtual:cookbook/components/DraftContentNotice";
|
|
3
|
+
import { HeroRoot } from "../components/Hero.styles.js";
|
|
3
4
|
|
|
4
5
|
const { data } = Astro.locals.cookbookRoute.entry;
|
|
5
6
|
const { title = data.title, tagline, image, actions = [] } = data.hero ?? {};
|
|
@@ -25,7 +26,7 @@ if (image) {
|
|
|
25
26
|
}
|
|
26
27
|
---
|
|
27
28
|
|
|
28
|
-
<
|
|
29
|
+
<HeroRoot className="hero">
|
|
29
30
|
{
|
|
30
31
|
darkImage && (
|
|
31
32
|
<img
|
|
@@ -70,4 +71,4 @@ if (image) {
|
|
|
70
71
|
)
|
|
71
72
|
}
|
|
72
73
|
</div>
|
|
73
|
-
</
|
|
74
|
+
</HeroRoot>
|
|
@@ -3,6 +3,7 @@ import { content } from "virtual:cookbook/config";
|
|
|
3
3
|
import { localeTarget, routeLocale, messages } from "../localization.js";
|
|
4
4
|
import { navigationPath } from "../navigation.js";
|
|
5
5
|
import SelectPopover from "../components/SelectPopover.astro";
|
|
6
|
+
import { LanguageSelectRoot } from "../components/LanguageSelect.styles.js";
|
|
6
7
|
interface Props {
|
|
7
8
|
compact?: boolean;
|
|
8
9
|
sidebar?: boolean;
|
|
@@ -34,10 +35,9 @@ const selectedOption = options.find((option) => option.locale === selected);
|
|
|
34
35
|
|
|
35
36
|
{
|
|
36
37
|
options.length > 1 && (
|
|
37
|
-
<
|
|
38
|
+
<LanguageSelectRoot
|
|
38
39
|
data-compact={compact ? "" : undefined}
|
|
39
40
|
data-sidebar={sidebar ? "" : undefined}
|
|
40
|
-
data-tasty-anatomy="LanguageSelect"
|
|
41
41
|
>
|
|
42
42
|
<SelectPopover
|
|
43
43
|
triggerLabel={`${accessibleLabel}: ${selectedOption?.label ?? ""}`}
|
|
@@ -52,6 +52,6 @@ const selectedOption = options.find((option) => option.locale === selected);
|
|
|
52
52
|
current: option.locale === selected,
|
|
53
53
|
}))}
|
|
54
54
|
/>
|
|
55
|
-
</
|
|
55
|
+
</LanguageSelectRoot>
|
|
56
56
|
)
|
|
57
57
|
}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { addHeadingPermalinks } from "../markdown/rendered-content.js";
|
|
3
|
+
import MarkdownStyles from "../components/MarkdownContent.styles.js";
|
|
3
4
|
|
|
4
5
|
const content = addHeadingPermalinks(await Astro.slots.render("default"));
|
|
5
6
|
---
|
|
6
7
|
|
|
7
|
-
<
|
|
8
|
+
<MarkdownStyles />
|
|
9
|
+
<div
|
|
10
|
+
class="cookbook-markdown-content"
|
|
11
|
+
data-element="Markdown"
|
|
12
|
+
set:html={content}
|
|
13
|
+
/>
|
|
8
14
|
|
|
9
15
|
<script>
|
|
10
16
|
import { initializeHeadingLinks } from "../client/heading-links.js";
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
import LanguageSelect from "virtual:cookbook/components/LanguageSelect";
|
|
3
3
|
import SocialIcons from "virtual:cookbook/components/SocialIcons";
|
|
4
|
-
import { MobileMenuFooterRoot } from "../components/
|
|
4
|
+
import { MobileMenuFooterRoot } from "../components/MobileMenuFooter.styles.js";
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
<MobileMenuFooterRoot
|
|
8
|
-
className="td-mobile-preferences"
|
|
9
|
-
data-tasty-anatomy="MobileMenuFooter"
|
|
10
|
-
>
|
|
7
|
+
<MobileMenuFooterRoot className="td-mobile-preferences">
|
|
11
8
|
<div class="td-mobile-preferences__social">
|
|
12
9
|
<SocialIcons />
|
|
13
10
|
</div>
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { localizedNavigation, localePath } from "../localization.js";
|
|
3
3
|
import { content } from "virtual:cookbook/config";
|
|
4
4
|
import Icon from "../components/Icon.astro";
|
|
5
|
+
import { MobileMenuToggleRoot } from "../components/MobileMenuToggle.styles.js";
|
|
5
6
|
import { layout as configuredLayout } from "virtual:cookbook/layout";
|
|
6
7
|
import { activeNavigationTab, navigationPath } from "../navigation.js";
|
|
7
8
|
const route = Astro.locals.cookbookRoute;
|
|
@@ -21,16 +22,16 @@ const active = activeNavigationTab(
|
|
|
21
22
|
const section = layout.tabs[active]?.label;
|
|
22
23
|
---
|
|
23
24
|
|
|
24
|
-
<
|
|
25
|
+
<MobileMenuToggleRoot
|
|
25
26
|
type="button"
|
|
26
27
|
popovertarget="cookbook__sidebar"
|
|
27
28
|
aria-controls="cookbook__sidebar"
|
|
28
29
|
aria-expanded="false"
|
|
29
|
-
|
|
30
|
+
className="td-menu-button cookbook-menu-button cookbook-print-hidden"
|
|
30
31
|
>
|
|
31
32
|
<Icon name="bars" class="open-menu" />
|
|
32
33
|
<span class="sr-only">{Astro.locals.t("menuButton.accessibleLabel")}</span>
|
|
33
34
|
{section && <span class="td-menu-button__section">{section}</span>}
|
|
34
35
|
{section && <Icon name="right-caret" />}
|
|
35
36
|
<span class="td-menu-button__page">{route.entry.data.title}</span>
|
|
36
|
-
</
|
|
37
|
+
</MobileMenuToggleRoot>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { content } from "virtual:cookbook/config";
|
|
3
3
|
import { navigationPath } from "../navigation.js";
|
|
4
|
-
import { MobileTableOfContentsRoot } from "../components/
|
|
4
|
+
import { MobileTableOfContentsRoot } from "../components/MobileTableOfContents.styles.js";
|
|
5
5
|
import MobileTocList from "../components/MobileTocList.astro";
|
|
6
6
|
const { toc } = Astro.locals.cookbookRoute;
|
|
7
7
|
const entry = content.entries.find(
|
|
@@ -20,7 +20,7 @@ const label = Astro.locals.t("tableOfContents.onThisPage");
|
|
|
20
20
|
toc.items.some(
|
|
21
21
|
(item) => item.slug !== "_top" || item.children.length > 0,
|
|
22
22
|
) && (
|
|
23
|
-
<MobileTableOfContentsRoot
|
|
23
|
+
<MobileTableOfContentsRoot>
|
|
24
24
|
<details>
|
|
25
25
|
<>
|
|
26
26
|
<summary>{label}</summary>
|
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { PageFrameRoot } from "../components/
|
|
2
|
+
import { PageFrameRoot } from "../components/PageFrame.styles.js";
|
|
3
|
+
import { HeaderFrameRoot } from "../components/HeaderFrame.styles.js";
|
|
4
|
+
import { SidebarRoot } from "../components/Sidebar.styles.js";
|
|
3
5
|
const { hasSidebar } = Astro.locals.cookbookRoute;
|
|
4
6
|
---
|
|
5
7
|
|
|
6
|
-
<PageFrameRoot
|
|
7
|
-
className="
|
|
8
|
-
data-tasty-anatomy="PageFrame"
|
|
9
|
-
data-has-sidebar={hasSidebar ? "" : undefined}
|
|
10
|
-
>
|
|
11
|
-
<header class="header"><slot name="header" /></header>
|
|
8
|
+
<PageFrameRoot className="page" data-has-sidebar={hasSidebar ? "" : undefined}>
|
|
9
|
+
<HeaderFrameRoot className="header"><slot name="header" /></HeaderFrameRoot>
|
|
12
10
|
{
|
|
13
11
|
hasSidebar && (
|
|
14
|
-
<
|
|
12
|
+
<SidebarRoot
|
|
15
13
|
id="cookbook__sidebar"
|
|
16
|
-
|
|
14
|
+
className="sidebar-pane cookbook-print-hidden"
|
|
17
15
|
popover="auto"
|
|
18
16
|
aria-label={Astro.locals.t("sidebarNav.accessibleLabel")}
|
|
19
|
-
|
|
17
|
+
tabIndex={-1}
|
|
20
18
|
>
|
|
21
19
|
<nav
|
|
22
20
|
class="sidebar-content"
|
|
@@ -24,7 +22,7 @@ const { hasSidebar } = Astro.locals.cookbookRoute;
|
|
|
24
22
|
>
|
|
25
23
|
<slot name="sidebar" />
|
|
26
24
|
</nav>
|
|
27
|
-
</
|
|
25
|
+
</SidebarRoot>
|
|
28
26
|
)
|
|
29
27
|
}
|
|
30
28
|
<div class="main-frame"><slot /></div>
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { messages } from "../localization.js";
|
|
3
3
|
import { content } from "virtual:cookbook/config";
|
|
4
|
+
import { SearchRoot } from "../components/Search.styles.js";
|
|
5
|
+
import { SearchButtonRoot } from "../components/SearchButton.styles.js";
|
|
6
|
+
import { SearchResultsRoot } from "../components/SearchResults.styles.js";
|
|
4
7
|
const label = Astro.locals.t("search.label");
|
|
5
8
|
const translations = {
|
|
6
9
|
placeholder: label,
|
|
@@ -13,13 +16,13 @@ const translations = {
|
|
|
13
16
|
};
|
|
14
17
|
---
|
|
15
18
|
|
|
16
|
-
<
|
|
17
|
-
|
|
19
|
+
<SearchRoot
|
|
20
|
+
className={Astro.props.class}
|
|
18
21
|
data-translations={JSON.stringify(translations)}
|
|
19
22
|
data-strip-trailing-slash={import.meta.env.TRAILING_SLASH === "never" ||
|
|
20
23
|
undefined}
|
|
21
24
|
>
|
|
22
|
-
<
|
|
25
|
+
<SearchButtonRoot
|
|
23
26
|
type="button"
|
|
24
27
|
data-open-modal
|
|
25
28
|
disabled
|
|
@@ -30,22 +33,23 @@ const translations = {
|
|
|
30
33
|
<kbd data-pending aria-hidden="true"
|
|
31
34
|
><kbd>{Astro.locals.t("search.ctrlKey")}</kbd><kbd>K</kbd></kbd
|
|
32
35
|
>
|
|
33
|
-
</
|
|
36
|
+
</SearchButtonRoot>
|
|
34
37
|
<dialog aria-label={label}>
|
|
35
38
|
<div class="dialog-frame">
|
|
36
39
|
<button
|
|
37
40
|
type="button"
|
|
41
|
+
data-element="Close"
|
|
38
42
|
data-close-modal
|
|
39
43
|
aria-label={Astro.locals.t("search.cancelLabel")}></button>
|
|
40
44
|
{
|
|
41
45
|
import.meta.env.DEV ? (
|
|
42
|
-
<p data-search-status dir="ltr">
|
|
46
|
+
<p data-element="Status" data-search-status dir="ltr">
|
|
43
47
|
{Astro.locals.t("search.devWarning")}
|
|
44
48
|
</p>
|
|
45
49
|
) : (
|
|
46
50
|
<div class="search-container">
|
|
47
|
-
<p data-search-status role="status" hidden />
|
|
48
|
-
<
|
|
51
|
+
<p data-element="Status" data-search-status role="status" hidden />
|
|
52
|
+
<SearchResultsRoot id="cookbook__search">
|
|
49
53
|
<div class="pagefind-ui" role="search" aria-label={label}>
|
|
50
54
|
<div class="cookbook-search-field">
|
|
51
55
|
<input
|
|
@@ -69,13 +73,13 @@ const translations = {
|
|
|
69
73
|
</div>
|
|
70
74
|
<div data-search-results />
|
|
71
75
|
</div>
|
|
72
|
-
</
|
|
76
|
+
</SearchResultsRoot>
|
|
73
77
|
</div>
|
|
74
78
|
)
|
|
75
79
|
}
|
|
76
80
|
</div>
|
|
77
81
|
</dialog>
|
|
78
|
-
</
|
|
82
|
+
</SearchRoot>
|
|
79
83
|
<script>
|
|
80
84
|
import { initializeSearch } from "../client/search.js";
|
|
81
85
|
document.querySelectorAll<HTMLElement>("site-search").forEach((element) => {
|
|
@@ -48,6 +48,7 @@ const ui = messages(Astro.locals.cookbookRoute?.lang ?? "en", content);
|
|
|
48
48
|
|
|
49
49
|
<div class="td-sidebar-heading">
|
|
50
50
|
<a
|
|
51
|
+
data-element="HomeLink"
|
|
51
52
|
class="td-sidebar-heading__home"
|
|
52
53
|
href={localeHref(
|
|
53
54
|
(content.logo && content.logo.href) || "/",
|
|
@@ -58,7 +59,9 @@ const ui = messages(Astro.locals.cookbookRoute?.lang ?? "en", content);
|
|
|
58
59
|
)}
|
|
59
60
|
>
|
|
60
61
|
<Logo />
|
|
61
|
-
<span data-site-title
|
|
62
|
+
<span data-element="HomeLabel" data-site-title
|
|
63
|
+
>{Astro.locals.cookbookRoute.siteTitle}</span
|
|
64
|
+
>
|
|
62
65
|
</a>
|
|
63
66
|
<button
|
|
64
67
|
type="button"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { content } from "virtual:cookbook/config";
|
|
3
3
|
import Icon from "../components/Icon.astro";
|
|
4
|
-
import { SocialIconsRoot } from "../components/
|
|
4
|
+
import { SocialIconsRoot } from "../components/SocialIcons.styles.js";
|
|
5
5
|
|
|
6
6
|
const repository = content.site.repository;
|
|
7
7
|
const icon = repository?.includes("github.com")
|
|
@@ -16,7 +16,7 @@ const links = repository
|
|
|
16
16
|
|
|
17
17
|
{
|
|
18
18
|
links.length > 0 && (
|
|
19
|
-
<SocialIconsRoot
|
|
19
|
+
<SocialIconsRoot>
|
|
20
20
|
{links.map(({ label, href, icon }) => (
|
|
21
21
|
<a href={href} rel="me" aria-label={label} title={label}>
|
|
22
22
|
<Icon name={icon} />
|
|
@@ -4,7 +4,7 @@ import { content } from "virtual:cookbook/config";
|
|
|
4
4
|
import Icon from "../components/Icon.astro";
|
|
5
5
|
import paletteIcon from "../icons/palette.svg?raw";
|
|
6
6
|
import ContrastIcon from "../components/ContrastIcon.astro";
|
|
7
|
-
import { ThemeSelectRoot } from "../components/
|
|
7
|
+
import { ThemeSelectRoot } from "../components/ThemeSelect.styles.js";
|
|
8
8
|
|
|
9
9
|
const ui = messages(Astro.locals.cookbookRoute?.lang ?? "en", content);
|
|
10
10
|
const id = `appearance-${crypto.randomUUID()}`;
|
|
@@ -20,7 +20,7 @@ const contrasts = [
|
|
|
20
20
|
] as const;
|
|
21
21
|
---
|
|
22
22
|
|
|
23
|
-
<ThemeSelectRoot
|
|
23
|
+
<ThemeSelectRoot>
|
|
24
24
|
<button
|
|
25
25
|
type="button"
|
|
26
26
|
popovertarget={id}
|
|
@@ -29,7 +29,13 @@ const contrasts = [
|
|
|
29
29
|
>
|
|
30
30
|
<span aria-hidden="true" set:html={paletteIcon} />
|
|
31
31
|
</button>
|
|
32
|
-
<div
|
|
32
|
+
<div
|
|
33
|
+
data-element="Panel"
|
|
34
|
+
id={id}
|
|
35
|
+
popover="auto"
|
|
36
|
+
role="group"
|
|
37
|
+
aria-label={ui.appearance}
|
|
38
|
+
>
|
|
33
39
|
<fieldset>
|
|
34
40
|
<legend>{ui.colorScheme}</legend>
|
|
35
41
|
{
|
package/dist/routes/Page.astro
CHANGED
|
@@ -14,6 +14,13 @@ import MarkdownContent from "virtual:cookbook/components/MarkdownContent";
|
|
|
14
14
|
import MobileTableOfContents from "virtual:cookbook/components/MobileTableOfContents";
|
|
15
15
|
import DraftContentNotice from "virtual:cookbook/components/DraftContentNotice";
|
|
16
16
|
import TableOfContents from "virtual:cookbook/components/TableOfContents";
|
|
17
|
+
import DocumentStyles from "../components/Document.styles.js";
|
|
18
|
+
import { SkipLinkRoot } from "../components/SkipLink.styles.js";
|
|
19
|
+
import { MainPaneRoot } from "../components/MainPane.styles.js";
|
|
20
|
+
import { MainContentRoot } from "../components/MainContent.styles.js";
|
|
21
|
+
import { BannerRoot } from "../components/Banner.styles.js";
|
|
22
|
+
import { TableOfContentsLayoutRoot } from "../components/TableOfContentsLayout.styles.js";
|
|
23
|
+
import { TableOfContentsRoot } from "../components/TableOfContents.styles.js";
|
|
17
24
|
|
|
18
25
|
interface Props {
|
|
19
26
|
frontmatter: Record<string, any>;
|
|
@@ -44,11 +51,12 @@ const indexed = route.id !== "/404" && data.pagefind !== false && !data.draft;
|
|
|
44
51
|
<head>
|
|
45
52
|
<meta charset="utf-8" />
|
|
46
53
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
54
|
+
<DocumentStyles />
|
|
47
55
|
<Head />
|
|
48
56
|
</head>
|
|
49
57
|
<body>
|
|
50
|
-
<
|
|
51
|
-
>{Astro.locals.t("page.skipToContent")}</
|
|
58
|
+
<SkipLinkRoot className="cookbook-skip-link" href="#main-content"
|
|
59
|
+
>{Astro.locals.t("page.skipToContent")}</SkipLinkRoot
|
|
52
60
|
>
|
|
53
61
|
<PageFrame>
|
|
54
62
|
<Header slot="header" />
|
|
@@ -56,23 +64,23 @@ const indexed = route.id !== "/404" && data.pagefind !== false && !data.draft;
|
|
|
56
64
|
<div>
|
|
57
65
|
{
|
|
58
66
|
route.toc && (
|
|
59
|
-
<
|
|
67
|
+
<TableOfContentsLayoutRoot className="right-sidebar-container cookbook-print-hidden">
|
|
60
68
|
<div class="right-sidebar">
|
|
61
69
|
<MobileTableOfContents />
|
|
62
|
-
<
|
|
70
|
+
<TableOfContentsRoot className="right-sidebar-panel">
|
|
63
71
|
<h2>{Astro.locals.t("tableOfContents.onThisPage")}</h2>
|
|
64
72
|
<nav
|
|
65
73
|
aria-label={Astro.locals.t("tableOfContents.onThisPage")}
|
|
66
74
|
>
|
|
67
75
|
<TableOfContents items={route.toc.items} />
|
|
68
76
|
</nav>
|
|
69
|
-
</
|
|
77
|
+
</TableOfContentsRoot>
|
|
70
78
|
</div>
|
|
71
|
-
</
|
|
79
|
+
</TableOfContentsLayoutRoot>
|
|
72
80
|
)
|
|
73
81
|
}
|
|
74
|
-
<
|
|
75
|
-
<
|
|
82
|
+
<MainPaneRoot className="main-pane">
|
|
83
|
+
<MainContentRoot
|
|
76
84
|
id="main-content"
|
|
77
85
|
data-pagefind-body={indexed ? "" : undefined}
|
|
78
86
|
lang={route.entryMeta.lang}
|
|
@@ -80,7 +88,10 @@ const indexed = route.id !== "/404" && data.pagefind !== false && !data.draft;
|
|
|
80
88
|
>
|
|
81
89
|
{
|
|
82
90
|
data.banner && (
|
|
83
|
-
<
|
|
91
|
+
<BannerRoot
|
|
92
|
+
className="cookbook-banner"
|
|
93
|
+
set:html={data.banner.content}
|
|
94
|
+
/>
|
|
84
95
|
)
|
|
85
96
|
}
|
|
86
97
|
{
|
|
@@ -113,8 +124,8 @@ const indexed = route.id !== "/404" && data.pagefind !== false && !data.draft;
|
|
|
113
124
|
</>
|
|
114
125
|
)
|
|
115
126
|
}
|
|
116
|
-
</
|
|
117
|
-
</
|
|
127
|
+
</MainContentRoot>
|
|
128
|
+
</MainPaneRoot>
|
|
118
129
|
</div>
|
|
119
130
|
</PageFrame>
|
|
120
131
|
<script>
|
package/dist/styling.d.ts
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
|
+
import { defineComponent, extendComponent } from "./define-component.js";
|
|
1
2
|
import { Styles as Styles$1 } from "@tenphi/tasty/core";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
type SubElementTag<Definition extends ElementsDefinition[string]> = Definition extends string ? Definition : Definition extends {
|
|
6
|
-
as?: infer Tag;
|
|
7
|
-
} ? Tag extends keyof JSX.IntrinsicElements ? Tag : "div" : "div";
|
|
8
|
-
type SubElements<E extends ElementsDefinition> = { [Name in keyof E]: ForwardRefExoticComponent<PropsWithoutRef<SubElementProps<SubElementTag<E[Name]>>> & RefAttributes<SubElementTag<E[Name]> extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[SubElementTag<E[Name]>] : unknown>>; };
|
|
9
|
-
/** Create a named Tasty component with theme.styles[name] merged into its defaults. */
|
|
10
|
-
declare function defineComponent<K extends readonly (keyof StylesInterface)[], V extends VariantMap, E extends ElementsDefinition = Record<string, never>, AsType extends ElementType = "div", M extends ModPropsInput = readonly never[], TP extends TokenPropsInput = readonly never[]>(name: string, options: TastyElementOptions<K, V, E, AsType, M, TP>): TastyPolymorphicComponent<AsType, K, V, M, TP> & SubElements<E>;
|
|
3
|
+
import { Styles, TastyPolymorphicComponent, mergeStyles, tasty, useGlobalStyles } from "@tenphi/tasty";
|
|
4
|
+
//#region src/components/Button.styles.d.ts
|
|
5
|
+
declare const Button: TastyPolymorphicComponent<"button", readonly never[], Record<string, never>, readonly never[], readonly never[]>;
|
|
11
6
|
//#endregion
|
|
12
7
|
//#region src/components/component-styles.d.ts
|
|
13
8
|
/** Merge a partial theme override into a built-in or consumer style tree. */
|
|
14
9
|
declare function resolveComponentStyles(name: string, baseStyles: Styles$1): Styles$1;
|
|
15
10
|
//#endregion
|
|
16
|
-
export { type Styles, defineComponent, mergeStyles, resolveComponentStyles, tasty, useGlobalStyles };
|
|
11
|
+
export { Button, type Styles, defineComponent, extendComponent, mergeStyles, resolveComponentStyles, tasty, useGlobalStyles };
|
|
17
12
|
//# sourceMappingURL=styling.d.ts.map
|
package/dist/styling.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styling.d.ts","names":[],"sources":["../src/
|
|
1
|
+
{"version":3,"file":"styling.d.ts","names":[],"sources":["../src/components/Button.styles.d.ts","../src/components/component-styles.ts"],"mappings":";;;;cAEa,QAAQ,sDAGnB;;;;iBCYc,uBACd,cACA,YAAY,WACX"}
|
package/dist/styling.js
CHANGED
|
@@ -1,17 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { n as resolveComponentStyles } from "./component-styles-DstqPFf3.js";
|
|
2
|
+
import { t as configureCookbookStates } from "./tasty-states-_JhxFdK1.js";
|
|
3
|
+
import { n as extendComponent, t as defineComponent } from "./define-component-BP4YwMak.js";
|
|
4
|
+
import { mergeStyles, tasty, useGlobalStyles } from "@tenphi/tasty";
|
|
5
|
+
//#region src/components/Button.styles.js
|
|
6
|
+
/** Shared button foundation; descendants own their layout and interaction anatomy. */
|
|
7
|
+
const Button = defineComponent("Button", {
|
|
8
|
+
as: "button",
|
|
9
|
+
styles: {
|
|
10
|
+
display: "flex",
|
|
11
|
+
alignItems: "center",
|
|
12
|
+
gap: "$gap",
|
|
13
|
+
blockSize: "min 0",
|
|
14
|
+
color: "#text-soft",
|
|
15
|
+
cursor: "pointer"
|
|
16
|
+
}
|
|
17
|
+
});
|
|
11
18
|
//#endregion
|
|
12
19
|
//#region src/styling.ts
|
|
13
20
|
configureCookbookStates();
|
|
14
21
|
//#endregion
|
|
15
|
-
export { defineComponent, mergeStyles, resolveComponentStyles, tasty, useGlobalStyles };
|
|
22
|
+
export { Button, defineComponent, extendComponent, mergeStyles, resolveComponentStyles, tasty, useGlobalStyles };
|
|
16
23
|
|
|
17
24
|
//# sourceMappingURL=styling.js.map
|
package/dist/styling.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styling.js","names":[
|
|
1
|
+
{"version":3,"file":"styling.js","names":[],"sources":["../src/components/Button.styles.js","../src/styling.ts"],"sourcesContent":["import { defineComponent } from \"../define-component.js\";\n\n/** Shared button foundation; descendants own their layout and interaction anatomy. */\nexport const Button = defineComponent(\"Button\", {\n as: \"button\",\n styles: {\n display: \"flex\",\n alignItems: \"center\",\n gap: \"$gap\",\n blockSize: \"min 0\",\n color: \"#text-soft\",\n cursor: \"pointer\",\n },\n});\n","import { configureCookbookStates } from \"./components/tasty-states.js\";\n\n// Consumer components can be evaluated before Cookbook's own components.\nconfigureCookbookStates();\n\nexport { tasty, useGlobalStyles, mergeStyles } from \"@tenphi/tasty\";\nexport type { Styles } from \"@tenphi/tasty\";\nexport { defineComponent, extendComponent } from \"./define-component.js\";\nexport { Button } from \"./components/Button.styles.js\";\nexport { resolveComponentStyles } from \"./components/component-styles.js\";\n"],"mappings":";;;;;;AAGA,MAAa,SAAS,gBAAgB,UAAU;CAC9C,IAAI;CACJ,QAAQ;EACN,SAAS;EACT,YAAY;EACZ,KAAK;EACL,WAAW;EACX,OAAO;EACP,QAAQ;CACV;AACF,CAAC;;;ACVD,wBAAwB"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { resolveTypographyPresets } from "./theme/defaults.js";
|
|
2
|
+
import { TASTY_SPACING_PROPERTIES, TASTY_UNITS } from "./theme/tasty-config.js";
|
|
3
|
+
import { configure, getGlobalPredefinedStates } from "@tenphi/tasty";
|
|
4
|
+
//#region src/components/tasty-states.js
|
|
5
|
+
const systemLight = "@media(prefers-color-scheme: light)";
|
|
6
|
+
const systemDark = "@media(prefers-color-scheme: dark)";
|
|
7
|
+
const cookbookStates = {
|
|
8
|
+
"@system-light": systemLight,
|
|
9
|
+
"@system-dark": systemDark,
|
|
10
|
+
"@light": `@root(theme=light) | (!@root(theme) & ${systemLight})`,
|
|
11
|
+
"@dark": `@root(theme=dark) | (!@root(theme) & ${systemDark})`,
|
|
12
|
+
"@mobile": "@media(w < 50rem)",
|
|
13
|
+
"@desktop": "@media(w >= 50rem)",
|
|
14
|
+
"@small": "@media(w <= 40rem)",
|
|
15
|
+
"@compact": "@media(w <= 23rem)",
|
|
16
|
+
"@shell-mobile": "@media(w <= 48rem)",
|
|
17
|
+
"@shell-desktop": "@media(w > 48rem)",
|
|
18
|
+
"@narrow-layout": "@media(w < 72rem)",
|
|
19
|
+
"@medium-layout": "@media(w >= 50rem) & @media(w < 72rem)",
|
|
20
|
+
"@reduced-motion": "@media(prefers-reduced-motion: reduce)",
|
|
21
|
+
"@popover-open": ":is(:popover-open)"
|
|
22
|
+
};
|
|
23
|
+
let configured = false;
|
|
24
|
+
let configuredRuntime;
|
|
25
|
+
/** Configure aliases in the renderer's Tasty module before styles are parsed. */
|
|
26
|
+
function configureCookbookStates() {
|
|
27
|
+
const runtime = globalThis.__tenphiCookbookTastyRuntime;
|
|
28
|
+
if (configured && configuredRuntime === runtime) return;
|
|
29
|
+
configure({
|
|
30
|
+
presets: resolveTypographyPresets(),
|
|
31
|
+
properties: TASTY_SPACING_PROPERTIES,
|
|
32
|
+
...runtime,
|
|
33
|
+
units: {
|
|
34
|
+
...TASTY_UNITS,
|
|
35
|
+
...runtime?.units
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
configuredRuntime = runtime;
|
|
39
|
+
const existingStates = getGlobalPredefinedStates();
|
|
40
|
+
const missingStates = Object.fromEntries(Object.entries(cookbookStates).filter(([name]) => existingStates[name] === void 0));
|
|
41
|
+
if (Object.keys(missingStates).length) configure({ states: missingStates });
|
|
42
|
+
configured = true;
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
export { cookbookStates as n, configureCookbookStates as t };
|
|
46
|
+
|
|
47
|
+
//# sourceMappingURL=tasty-states-_JhxFdK1.js.map
|