@tenphi/renderer 0.21.1 → 0.21.4
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/client/code-copy.js +1 -1
- package/dist/client/heading-links.js +1 -1
- package/dist/client/page-copy.js +1 -1
- 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 +11 -6
- package/dist/index.js.map +1 -1
- package/dist/localization.d.ts +2 -42
- package/dist/localization.d.ts.map +1 -1
- package/dist/localization.js +1 -87
- package/dist/localization.js.map +1 -1
- package/dist/messages-BqBGDIoP.js +143 -0
- package/dist/messages-BqBGDIoP.js.map +1 -0
- package/dist/messages-ClTf2nFf.d.ts +52 -0
- package/dist/messages-ClTf2nFf.d.ts.map +1 -0
- package/dist/{messages-B_3xUzUb.js → messages-bS8G9Pj8.js} +2 -2
- package/dist/{messages-B_3xUzUb.js.map → messages-bS8G9Pj8.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/dist/ui.d.ts +2 -6
- package/dist/ui.js +1 -58
- 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
- package/dist/ui.d.ts.map +0 -1
- package/dist/ui.js.map +0 -1
|
@@ -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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasty-states-_JhxFdK1.js","names":[],"sources":["../src/components/tasty-states.js"],"sourcesContent":["import { configure, getGlobalPredefinedStates } from \"@tenphi/tasty\";\nimport { resolveTypographyPresets } from \"../theme/defaults.js\";\nimport {\n TASTY_UNITS,\n TASTY_SPACING_PROPERTIES,\n} from \"../theme/tasty-config.js\";\n\nconst systemLight = \"@media(prefers-color-scheme: light)\";\nconst systemDark = \"@media(prefers-color-scheme: dark)\";\n\nexport const cookbookStates = {\n \"@system-light\": systemLight,\n \"@system-dark\": systemDark,\n \"@light\": `@root(theme=light) | (!@root(theme) & ${systemLight})`,\n \"@dark\": `@root(theme=dark) | (!@root(theme) & ${systemDark})`,\n \"@mobile\": \"@media(w < 50rem)\",\n \"@desktop\": \"@media(w >= 50rem)\",\n \"@small\": \"@media(w <= 40rem)\",\n \"@compact\": \"@media(w <= 23rem)\",\n \"@shell-mobile\": \"@media(w <= 48rem)\",\n \"@shell-desktop\": \"@media(w > 48rem)\",\n \"@narrow-layout\": \"@media(w < 72rem)\",\n \"@medium-layout\": \"@media(w >= 50rem) & @media(w < 72rem)\",\n \"@reduced-motion\": \"@media(prefers-reduced-motion: reduce)\",\n \"@popover-open\": \":is(:popover-open)\",\n};\n\nlet configured = false;\nlet configuredRuntime;\n\n/** Configure aliases in the renderer's Tasty module before styles are parsed. */\nexport function configureCookbookStates() {\n // Process-local server configuration shared across Astro/Vite module graphs.\n // The integration prevents this module from entering browser bundles.\n const runtime = globalThis.__tenphiCookbookTastyRuntime;\n if (configured && configuredRuntime === runtime) return;\n configure({\n presets: resolveTypographyPresets(),\n properties: TASTY_SPACING_PROPERTIES,\n ...runtime,\n units: { ...TASTY_UNITS, ...runtime?.units },\n });\n configuredRuntime = runtime;\n // The integration may have configured this runtime already, including\n // consumer overrides of built-in breakpoints. Only supply missing aliases.\n const existingStates = getGlobalPredefinedStates();\n const missingStates = Object.fromEntries(\n Object.entries(cookbookStates).filter(\n ([name]) => existingStates[name] === undefined,\n ),\n );\n if (Object.keys(missingStates).length) configure({ states: missingStates });\n configured = true;\n}\n"],"mappings":";;;;AAOA,MAAM,cAAc;AACpB,MAAM,aAAa;AAEnB,MAAa,iBAAiB;CAC5B,iBAAiB;CACjB,gBAAgB;CAChB,UAAU,yCAAyC,YAAY;CAC/D,SAAS,wCAAwC,WAAW;CAC5D,WAAW;CACX,YAAY;CACZ,UAAU;CACV,YAAY;CACZ,iBAAiB;CACjB,kBAAkB;CAClB,kBAAkB;CAClB,kBAAkB;CAClB,mBAAmB;CACnB,iBAAiB;AACnB;AAEA,IAAI,aAAa;AACjB,IAAI;;AAGJ,SAAgB,0BAA0B;CAGxC,MAAM,UAAU,WAAW;CAC3B,IAAI,cAAc,sBAAsB,SAAS;CACjD,UAAU;EACR,SAAS,yBAAyB;EAClC,YAAY;EACZ,GAAG;EACH,OAAO;GAAE,GAAG;GAAa,GAAG,SAAS;EAAM;CAC7C,CAAC;CACD,oBAAoB;CAGpB,MAAM,iBAAiB,0BAA0B;CACjD,MAAM,gBAAgB,OAAO,YAC3B,OAAO,QAAQ,cAAc,CAAC,CAAC,QAC5B,CAAC,UAAU,eAAe,UAAU,KAAA,CACvC,CACF;CACA,IAAI,OAAO,KAAK,aAAa,CAAC,CAAC,QAAQ,UAAU,EAAE,QAAQ,cAAc,CAAC;CAC1E,aAAa;AACf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.d.ts","names":[],"sources":["../../src/theme/defaults.ts"],"mappings":";;cAMa;;;;;;;;;;;;;cAmBA,4BAA4B,eAAe;
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","names":[],"sources":["../../src/theme/defaults.ts"],"mappings":";;cAMa;;;;;;;;;;;;;cAmBA,4BAA4B,eAAe;iBA4ExC,mBAAmB,SAAQ,cAAmB;iBAI9C,yBACd,UAAS,mBACT,eAAc,QAAQ,+CACrB,eAAe"}
|
package/dist/theme/defaults.js
CHANGED
|
@@ -59,8 +59,29 @@ const DEFAULT_TYPOGRAPHY_PRESETS = {
|
|
|
59
59
|
letterSpacing: "0",
|
|
60
60
|
fontWeight: 400,
|
|
61
61
|
boldFontWeight: 650
|
|
62
|
-
}
|
|
62
|
+
},
|
|
63
|
+
"hero-title": derivedPreset("h1", { fontSize: "clamp(2.75rem, 7vw, 4.75rem)" }),
|
|
64
|
+
"hero-tagline": derivedPreset("body", {
|
|
65
|
+
fontSize: "clamp(1.05rem, 2.5vw, 1.35rem)",
|
|
66
|
+
lineHeight: 1.55
|
|
67
|
+
}),
|
|
68
|
+
prose: derivedPreset("body", { fontSize: "1.025rem" }),
|
|
69
|
+
"inline-code": derivedPreset("code", { fontSize: "0.875em" })
|
|
63
70
|
};
|
|
71
|
+
/** Keep specialized typography linked to user-configured base presets. */
|
|
72
|
+
function derivedPreset(base, overrides) {
|
|
73
|
+
return {
|
|
74
|
+
fontFamily: `var(--${base}-font-family)`,
|
|
75
|
+
fontSize: `var(--${base}-font-size)`,
|
|
76
|
+
lineHeight: `var(--${base}-line-height)`,
|
|
77
|
+
letterSpacing: `var(--${base}-letter-spacing)`,
|
|
78
|
+
fontWeight: `var(--${base}-font-weight)`,
|
|
79
|
+
boldFontWeight: `var(--${base}-bold-font-weight)`,
|
|
80
|
+
fontStyle: `var(--${base}-font-style, var(--default-font-style))`,
|
|
81
|
+
textTransform: `var(--${base}-text-transform, var(--default-text-transform))`,
|
|
82
|
+
...overrides
|
|
83
|
+
};
|
|
84
|
+
}
|
|
64
85
|
function resolveThemeTokens(tokens = {}) {
|
|
65
86
|
return {
|
|
66
87
|
...DEFAULT_THEME_TOKENS,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.js","names":[],"sources":["../../src/theme/defaults.ts"],"sourcesContent":["import type {\n ThemeTokens,\n TypographyPreset,\n TypographyPresets,\n} from \"@tenphi/docs\";\n\nexport const DEFAULT_THEME_TOKENS = {\n $gap: \"0.5rem\",\n $radius: \"8px\",\n \"$header-control-radius\": \"999px\",\n \"$card-radius\": \"16px\",\n \"$border-width\": \"1px\",\n \"$outline-width\": \"2px\",\n \"$outline-offset\": \"2px\",\n \"$layout-width\": \"87.5rem\",\n \"$content-width\": \"58rem\",\n \"$sidebar-width\": \"17.5rem\",\n \"$control-height\": \"2.5rem\",\n} satisfies ThemeTokens;\n\nconst BODY_FONT =\n \"'Onest Variable', Onest, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\";\nconst MONO_FONT =\n \"'JetBrains Mono Variable', 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace\";\n\nexport const DEFAULT_TYPOGRAPHY_PRESETS: Record<string, TypographyPreset> = {\n body: {\n fontFamily: BODY_FONT,\n fontSize: \"1rem\",\n lineHeight: 1.65,\n letterSpacing: \"0\",\n fontWeight: 400,\n boldFontWeight: 640,\n },\n heading: {\n fontFamily: BODY_FONT,\n fontSize: \"1rem\",\n lineHeight: 1.15,\n letterSpacing: \"-0.006em\",\n fontWeight: 610,\n boldFontWeight: 720,\n },\n h1: heading(\"clamp(2.5rem, 5vw, 3.25rem)\", 1.05, \"-0.015em\"),\n h2: heading(\"clamp(1.75rem, 3vw, 2.125rem)\", 1.1, \"-0.01em\"),\n h3: heading(\"1.5rem\", 1.15, \"-0.006em\"),\n h4: heading(\"1.25rem\", 1.2, \"-0.003em\"),\n h5: heading(\"1.125rem\", 1.25, \"0\"),\n h6: heading(\"1rem\", 1.3, \"0\"),\n navigation: {\n fontFamily: \"var(--body-font-family)\",\n fontSize: \"0.9375rem\",\n lineHeight: 1.4,\n letterSpacing: \"0\",\n fontWeight: 450,\n boldFontWeight: 580,\n },\n small: {\n fontFamily: \"var(--body-font-family)\",\n fontSize: \"0.875rem\",\n lineHeight: 1.45,\n letterSpacing: \"-0.002em\",\n fontWeight: 420,\n boldFontWeight: 600,\n },\n code: {\n fontFamily: MONO_FONT,\n fontSize: \"0.875rem\",\n lineHeight: 1.65,\n letterSpacing: \"0\",\n fontWeight: 400,\n boldFontWeight: 650,\n },\n};\n\nexport function resolveThemeTokens(tokens: ThemeTokens = {}): ThemeTokens {\n return { ...DEFAULT_THEME_TOKENS, ...tokens };\n}\n\nexport function resolveTypographyPresets(\n presets: TypographyPresets = {},\n fontFamilies: Partial<Record<\"body\" | \"heading\" | \"code\", string>> = {},\n): Record<string, TypographyPreset> {\n const body = DEFAULT_TYPOGRAPHY_PRESETS.body;\n if (!body) throw new Error(\"The body typography preset is required.\");\n const names = new Set([\n ...Object.keys(DEFAULT_TYPOGRAPHY_PRESETS),\n ...Object.keys(presets),\n ]);\n return Object.fromEntries(\n [...names].map((name) => [\n name,\n {\n ...(DEFAULT_TYPOGRAPHY_PRESETS[name] ?? body),\n ...(name in fontFamilies\n ? { fontFamily: fontFamilies[name as keyof typeof fontFamilies] }\n : {}),\n ...(presets[name] ?? {}),\n },\n ]),\n );\n}\n\nfunction heading(\n fontSize: string,\n lineHeight: number,\n letterSpacing: string,\n): TypographyPreset {\n return {\n fontFamily: \"var(--heading-font-family)\",\n fontSize,\n lineHeight,\n letterSpacing,\n fontWeight: \"var(--heading-font-weight)\",\n boldFontWeight: \"var(--heading-bold-font-weight)\",\n };\n}\n"],"mappings":";AAMA,MAAa,uBAAuB;CAClC,MAAM;CACN,SAAS;CACT,0BAA0B;CAC1B,gBAAgB;CAChB,iBAAiB;CACjB,kBAAkB;CAClB,mBAAmB;CACnB,iBAAiB;CACjB,kBAAkB;CAClB,kBAAkB;CAClB,mBAAmB;AACrB;AAEA,MAAM,YACJ;AAIF,MAAa,6BAA+D;CAC1E,MAAM;EACJ,YAAY;EACZ,UAAU;EACV,YAAY;EACZ,eAAe;EACf,YAAY;EACZ,gBAAgB;CAClB;CACA,SAAS;EACP,YAAY;EACZ,UAAU;EACV,YAAY;EACZ,eAAe;EACf,YAAY;EACZ,gBAAgB;CAClB;CACA,IAAI,QAAQ,+BAA+B,MAAM,UAAU;CAC3D,IAAI,QAAQ,iCAAiC,KAAK,SAAS;CAC3D,IAAI,QAAQ,UAAU,MAAM,UAAU;CACtC,IAAI,QAAQ,WAAW,KAAK,UAAU;CACtC,IAAI,QAAQ,YAAY,MAAM,GAAG;CACjC,IAAI,QAAQ,QAAQ,KAAK,GAAG;CAC5B,YAAY;EACV,YAAY;EACZ,UAAU;EACV,YAAY;EACZ,eAAe;EACf,YAAY;EACZ,gBAAgB;CAClB;CACA,OAAO;EACL,YAAY;EACZ,UAAU;EACV,YAAY;EACZ,eAAe;EACf,YAAY;EACZ,gBAAgB;CAClB;CACA,MAAM;EACJ,YAAY;EACZ,UAAU;EACV,YAAY;EACZ,eAAe;EACf,YAAY;EACZ,gBAAgB;CAClB;AACF;AAEA,SAAgB,mBAAmB,SAAsB,CAAC,GAAgB;CACxE,OAAO;EAAE,GAAG;EAAsB,GAAG;CAAO;AAC9C;AAEA,SAAgB,yBACd,UAA6B,CAAC,GAC9B,eAAqE,CAAC,GACpC;CAClC,MAAM,OAAO,2BAA2B;CACxC,IAAI,CAAC,MAAM,MAAM,IAAI,MAAM,yCAAyC;CACpE,MAAM,wBAAQ,IAAI,IAAI,CACpB,GAAG,OAAO,KAAK,0BAA0B,GACzC,GAAG,OAAO,KAAK,OAAO,CACxB,CAAC;CACD,OAAO,OAAO,YACZ,CAAC,GAAG,KAAK,CAAC,CAAC,KAAK,SAAS,CACvB,MACA;EACE,GAAI,2BAA2B,SAAS;EACxC,GAAI,QAAQ,eACR,EAAE,YAAY,aAAa,MAAmC,IAC9D,CAAC;EACL,GAAI,QAAQ,SAAS,CAAC;CACxB,CACF,CAAC,CACH;AACF;AAEA,SAAS,QACP,UACA,YACA,eACkB;CAClB,OAAO;EACL,YAAY;EACZ;EACA;EACA;EACA,YAAY;EACZ,gBAAgB;CAClB;AACF"}
|
|
1
|
+
{"version":3,"file":"defaults.js","names":[],"sources":["../../src/theme/defaults.ts"],"sourcesContent":["import type {\n ThemeTokens,\n TypographyPreset,\n TypographyPresets,\n} from \"@tenphi/docs\";\n\nexport const DEFAULT_THEME_TOKENS = {\n $gap: \"0.5rem\",\n $radius: \"8px\",\n \"$header-control-radius\": \"999px\",\n \"$card-radius\": \"16px\",\n \"$border-width\": \"1px\",\n \"$outline-width\": \"2px\",\n \"$outline-offset\": \"2px\",\n \"$layout-width\": \"87.5rem\",\n \"$content-width\": \"58rem\",\n \"$sidebar-width\": \"17.5rem\",\n \"$control-height\": \"2.5rem\",\n} satisfies ThemeTokens;\n\nconst BODY_FONT =\n \"'Onest Variable', Onest, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\";\nconst MONO_FONT =\n \"'JetBrains Mono Variable', 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace\";\n\nexport const DEFAULT_TYPOGRAPHY_PRESETS: Record<string, TypographyPreset> = {\n body: {\n fontFamily: BODY_FONT,\n fontSize: \"1rem\",\n lineHeight: 1.65,\n letterSpacing: \"0\",\n fontWeight: 400,\n boldFontWeight: 640,\n },\n heading: {\n fontFamily: BODY_FONT,\n fontSize: \"1rem\",\n lineHeight: 1.15,\n letterSpacing: \"-0.006em\",\n fontWeight: 610,\n boldFontWeight: 720,\n },\n h1: heading(\"clamp(2.5rem, 5vw, 3.25rem)\", 1.05, \"-0.015em\"),\n h2: heading(\"clamp(1.75rem, 3vw, 2.125rem)\", 1.1, \"-0.01em\"),\n h3: heading(\"1.5rem\", 1.15, \"-0.006em\"),\n h4: heading(\"1.25rem\", 1.2, \"-0.003em\"),\n h5: heading(\"1.125rem\", 1.25, \"0\"),\n h6: heading(\"1rem\", 1.3, \"0\"),\n navigation: {\n fontFamily: \"var(--body-font-family)\",\n fontSize: \"0.9375rem\",\n lineHeight: 1.4,\n letterSpacing: \"0\",\n fontWeight: 450,\n boldFontWeight: 580,\n },\n small: {\n fontFamily: \"var(--body-font-family)\",\n fontSize: \"0.875rem\",\n lineHeight: 1.45,\n letterSpacing: \"-0.002em\",\n fontWeight: 420,\n boldFontWeight: 600,\n },\n code: {\n fontFamily: MONO_FONT,\n fontSize: \"0.875rem\",\n lineHeight: 1.65,\n letterSpacing: \"0\",\n fontWeight: 400,\n boldFontWeight: 650,\n },\n \"hero-title\": derivedPreset(\"h1\", {\n fontSize: \"clamp(2.75rem, 7vw, 4.75rem)\",\n }),\n \"hero-tagline\": derivedPreset(\"body\", {\n fontSize: \"clamp(1.05rem, 2.5vw, 1.35rem)\",\n lineHeight: 1.55,\n }),\n prose: derivedPreset(\"body\", { fontSize: \"1.025rem\" }),\n \"inline-code\": derivedPreset(\"code\", { fontSize: \"0.875em\" }),\n};\n\n/** Keep specialized typography linked to user-configured base presets. */\nfunction derivedPreset(\n base: string,\n overrides: TypographyPreset,\n): TypographyPreset {\n return {\n fontFamily: `var(--${base}-font-family)`,\n fontSize: `var(--${base}-font-size)`,\n lineHeight: `var(--${base}-line-height)`,\n letterSpacing: `var(--${base}-letter-spacing)`,\n fontWeight: `var(--${base}-font-weight)`,\n boldFontWeight: `var(--${base}-bold-font-weight)`,\n fontStyle: `var(--${base}-font-style, var(--default-font-style))`,\n textTransform: `var(--${base}-text-transform, var(--default-text-transform))`,\n ...overrides,\n };\n}\n\nexport function resolveThemeTokens(tokens: ThemeTokens = {}): ThemeTokens {\n return { ...DEFAULT_THEME_TOKENS, ...tokens };\n}\n\nexport function resolveTypographyPresets(\n presets: TypographyPresets = {},\n fontFamilies: Partial<Record<\"body\" | \"heading\" | \"code\", string>> = {},\n): Record<string, TypographyPreset> {\n const body = DEFAULT_TYPOGRAPHY_PRESETS.body;\n if (!body) throw new Error(\"The body typography preset is required.\");\n const names = new Set([\n ...Object.keys(DEFAULT_TYPOGRAPHY_PRESETS),\n ...Object.keys(presets),\n ]);\n return Object.fromEntries(\n [...names].map((name) => [\n name,\n {\n ...(DEFAULT_TYPOGRAPHY_PRESETS[name] ?? body),\n ...(name in fontFamilies\n ? { fontFamily: fontFamilies[name as keyof typeof fontFamilies] }\n : {}),\n ...(presets[name] ?? {}),\n },\n ]),\n );\n}\n\nfunction heading(\n fontSize: string,\n lineHeight: number,\n letterSpacing: string,\n): TypographyPreset {\n return {\n fontFamily: \"var(--heading-font-family)\",\n fontSize,\n lineHeight,\n letterSpacing,\n fontWeight: \"var(--heading-font-weight)\",\n boldFontWeight: \"var(--heading-bold-font-weight)\",\n };\n}\n"],"mappings":";AAMA,MAAa,uBAAuB;CAClC,MAAM;CACN,SAAS;CACT,0BAA0B;CAC1B,gBAAgB;CAChB,iBAAiB;CACjB,kBAAkB;CAClB,mBAAmB;CACnB,iBAAiB;CACjB,kBAAkB;CAClB,kBAAkB;CAClB,mBAAmB;AACrB;AAEA,MAAM,YACJ;AAIF,MAAa,6BAA+D;CAC1E,MAAM;EACJ,YAAY;EACZ,UAAU;EACV,YAAY;EACZ,eAAe;EACf,YAAY;EACZ,gBAAgB;CAClB;CACA,SAAS;EACP,YAAY;EACZ,UAAU;EACV,YAAY;EACZ,eAAe;EACf,YAAY;EACZ,gBAAgB;CAClB;CACA,IAAI,QAAQ,+BAA+B,MAAM,UAAU;CAC3D,IAAI,QAAQ,iCAAiC,KAAK,SAAS;CAC3D,IAAI,QAAQ,UAAU,MAAM,UAAU;CACtC,IAAI,QAAQ,WAAW,KAAK,UAAU;CACtC,IAAI,QAAQ,YAAY,MAAM,GAAG;CACjC,IAAI,QAAQ,QAAQ,KAAK,GAAG;CAC5B,YAAY;EACV,YAAY;EACZ,UAAU;EACV,YAAY;EACZ,eAAe;EACf,YAAY;EACZ,gBAAgB;CAClB;CACA,OAAO;EACL,YAAY;EACZ,UAAU;EACV,YAAY;EACZ,eAAe;EACf,YAAY;EACZ,gBAAgB;CAClB;CACA,MAAM;EACJ,YAAY;EACZ,UAAU;EACV,YAAY;EACZ,eAAe;EACf,YAAY;EACZ,gBAAgB;CAClB;CACA,cAAc,cAAc,MAAM,EAChC,UAAU,+BACZ,CAAC;CACD,gBAAgB,cAAc,QAAQ;EACpC,UAAU;EACV,YAAY;CACd,CAAC;CACD,OAAO,cAAc,QAAQ,EAAE,UAAU,WAAW,CAAC;CACrD,eAAe,cAAc,QAAQ,EAAE,UAAU,UAAU,CAAC;AAC9D;;AAGA,SAAS,cACP,MACA,WACkB;CAClB,OAAO;EACL,YAAY,SAAS,KAAK;EAC1B,UAAU,SAAS,KAAK;EACxB,YAAY,SAAS,KAAK;EAC1B,eAAe,SAAS,KAAK;EAC7B,YAAY,SAAS,KAAK;EAC1B,gBAAgB,SAAS,KAAK;EAC9B,WAAW,SAAS,KAAK;EACzB,eAAe,SAAS,KAAK;EAC7B,GAAG;CACL;AACF;AAEA,SAAgB,mBAAmB,SAAsB,CAAC,GAAgB;CACxE,OAAO;EAAE,GAAG;EAAsB,GAAG;CAAO;AAC9C;AAEA,SAAgB,yBACd,UAA6B,CAAC,GAC9B,eAAqE,CAAC,GACpC;CAClC,MAAM,OAAO,2BAA2B;CACxC,IAAI,CAAC,MAAM,MAAM,IAAI,MAAM,yCAAyC;CACpE,MAAM,wBAAQ,IAAI,IAAI,CACpB,GAAG,OAAO,KAAK,0BAA0B,GACzC,GAAG,OAAO,KAAK,OAAO,CACxB,CAAC;CACD,OAAO,OAAO,YACZ,CAAC,GAAG,KAAK,CAAC,CAAC,KAAK,SAAS,CACvB,MACA;EACE,GAAI,2BAA2B,SAAS;EACxC,GAAI,QAAQ,eACR,EAAE,YAAY,aAAa,MAAmC,IAC9D,CAAC;EACL,GAAI,QAAQ,SAAS,CAAC;CACxB,CACF,CAAC,CACH;AACF;AAEA,SAAS,QACP,UACA,YACA,eACkB;CAClB,OAAO;EACL,YAAY;EACZ;EACA;EACA;EACA,YAAY;EACZ,gBAAgB;CAClB;AACF"}
|
|
@@ -1,6 +1,28 @@
|
|
|
1
1
|
import { t as ResolvedDocsTheme } from "../index-BuX_Sb5c.js";
|
|
2
2
|
import { ConfigTokens } from "@tenphi/tasty/core";
|
|
3
3
|
//#region src/theme/tasty-config.d.ts
|
|
4
|
+
declare const TASTY_SPACING_PROPERTIES: {
|
|
5
|
+
readonly "$margin-block-start": {
|
|
6
|
+
readonly syntax: "<length-percentage> | auto";
|
|
7
|
+
readonly inherits: false;
|
|
8
|
+
readonly initialValue: "0px";
|
|
9
|
+
};
|
|
10
|
+
readonly "$margin-block-end": {
|
|
11
|
+
readonly syntax: "<length-percentage> | auto";
|
|
12
|
+
readonly inherits: false;
|
|
13
|
+
readonly initialValue: "0px";
|
|
14
|
+
};
|
|
15
|
+
readonly "$padding-block-start": {
|
|
16
|
+
readonly syntax: "<length-percentage>";
|
|
17
|
+
readonly inherits: false;
|
|
18
|
+
readonly initialValue: "0px";
|
|
19
|
+
};
|
|
20
|
+
readonly "$padding-block-end": {
|
|
21
|
+
readonly syntax: "<length-percentage>";
|
|
22
|
+
readonly inherits: false;
|
|
23
|
+
readonly initialValue: "0px";
|
|
24
|
+
};
|
|
25
|
+
};
|
|
4
26
|
declare const TASTY_UNITS: {
|
|
5
27
|
readonly x: "var(--gap)";
|
|
6
28
|
readonly r: "var(--radius)";
|
|
@@ -9,5 +31,5 @@ declare const TASTY_UNITS: {
|
|
|
9
31
|
};
|
|
10
32
|
declare function tastyTokens(theme: ResolvedDocsTheme): ConfigTokens;
|
|
11
33
|
//#endregion
|
|
12
|
-
export { TASTY_UNITS, tastyTokens };
|
|
34
|
+
export { TASTY_SPACING_PROPERTIES, TASTY_UNITS, tastyTokens };
|
|
13
35
|
//# sourceMappingURL=tasty-config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tasty-config.d.ts","names":[],"sources":["../../src/theme/tasty-config.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"tasty-config.d.ts","names":[],"sources":["../../src/theme/tasty-config.ts"],"mappings":";;;cAKa;WACX;aACE;aACA;aACA;;WAEF;aACE;aACA;aACA;;WAEF;aACE;aACA;aACA;;WAEF;aACE;aACA;aACA;;;cAIS;WACX;WACA;WACA;WACA;;iBAGc,YAAY,OAAO,oBAAoB"}
|
|
@@ -1,4 +1,26 @@
|
|
|
1
1
|
//#region src/theme/tasty-config.ts
|
|
2
|
+
const TASTY_SPACING_PROPERTIES = {
|
|
3
|
+
"$margin-block-start": {
|
|
4
|
+
syntax: "<length-percentage> | auto",
|
|
5
|
+
inherits: false,
|
|
6
|
+
initialValue: "0px"
|
|
7
|
+
},
|
|
8
|
+
"$margin-block-end": {
|
|
9
|
+
syntax: "<length-percentage> | auto",
|
|
10
|
+
inherits: false,
|
|
11
|
+
initialValue: "0px"
|
|
12
|
+
},
|
|
13
|
+
"$padding-block-start": {
|
|
14
|
+
syntax: "<length-percentage>",
|
|
15
|
+
inherits: false,
|
|
16
|
+
initialValue: "0px"
|
|
17
|
+
},
|
|
18
|
+
"$padding-block-end": {
|
|
19
|
+
syntax: "<length-percentage>",
|
|
20
|
+
inherits: false,
|
|
21
|
+
initialValue: "0px"
|
|
22
|
+
}
|
|
23
|
+
};
|
|
2
24
|
const TASTY_UNITS = {
|
|
3
25
|
x: "var(--gap)",
|
|
4
26
|
r: "var(--radius)",
|
|
@@ -11,6 +33,6 @@ function tastyTokens(theme) {
|
|
|
11
33
|
return tokens;
|
|
12
34
|
}
|
|
13
35
|
//#endregion
|
|
14
|
-
export { TASTY_UNITS, tastyTokens };
|
|
36
|
+
export { TASTY_SPACING_PROPERTIES, TASTY_UNITS, tastyTokens };
|
|
15
37
|
|
|
16
38
|
//# sourceMappingURL=tasty-config.js.map
|