@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
package/dist/client/code-copy.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as message } from "../messages-
|
|
1
|
+
import { t as message } from "../messages-bS8G9Pj8.js";
|
|
2
2
|
//#region src/client/heading-links.ts
|
|
3
3
|
/** Keep real fragment links as the no-JavaScript and modified-click fallback. */
|
|
4
4
|
function initializeHeadingLinks() {
|
package/dist/client/page-copy.js
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { mergeStyles } from "@tenphi/tasty/core";
|
|
2
|
+
//#region src/components/component-styles.ts
|
|
3
|
+
const sharedConfiguration = globalThis;
|
|
4
|
+
function configureComponentStyles(styles) {
|
|
5
|
+
sharedConfiguration.__tenphiCookbookComponentStyles = styles ?? {};
|
|
6
|
+
sharedConfiguration.__tenphiCookbookUsedComponentStyles = /* @__PURE__ */ new Set();
|
|
7
|
+
}
|
|
8
|
+
/** Merge a partial theme override into a built-in or consumer style tree. */
|
|
9
|
+
function resolveComponentStyles(name, baseStyles) {
|
|
10
|
+
sharedConfiguration.__tenphiCookbookUsedComponentStyles?.add(name);
|
|
11
|
+
const configuredStyles = sharedConfiguration.__tenphiCookbookComponentStyles?.[name];
|
|
12
|
+
return configuredStyles ? mergeStyles(baseStyles, configuredStyles) : baseStyles;
|
|
13
|
+
}
|
|
14
|
+
/** Find custom names without a component style resolver match. */
|
|
15
|
+
function unusedCustomStyleNames(styles) {
|
|
16
|
+
return Object.keys(styles ?? {}).filter((name) => !sharedConfiguration.__tenphiCookbookUsedComponentStyles?.has(name));
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { resolveComponentStyles as n, unusedCustomStyleNames as r, configureComponentStyles as t };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=component-styles-DstqPFf3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-styles-DstqPFf3.js","names":[],"sources":["../src/components/component-styles.ts"],"sourcesContent":["import { mergeStyles, type Styles } from \"@tenphi/tasty/core\";\n\n// Astro can load the integration and renderer through separate module graphs.\n// Keep their component configuration on the shared process global.\nconst sharedConfiguration = globalThis as typeof globalThis & {\n __tenphiCookbookComponentStyles?: Record<string, Styles | undefined>;\n __tenphiCookbookUsedComponentStyles?: Set<string>;\n};\n\nexport function configureComponentStyles(\n styles: Record<string, Styles | undefined> | undefined,\n): void {\n sharedConfiguration.__tenphiCookbookComponentStyles = styles ?? {};\n sharedConfiguration.__tenphiCookbookUsedComponentStyles = new Set();\n}\n\n/** Merge a partial theme override into a built-in or consumer style tree. */\nexport function resolveComponentStyles(\n name: string,\n baseStyles: Styles,\n): Styles {\n sharedConfiguration.__tenphiCookbookUsedComponentStyles?.add(name);\n const configuredStyles = sharedConfiguration\n .__tenphiCookbookComponentStyles?.[name] as Styles | undefined;\n return configuredStyles\n ? mergeStyles(baseStyles, configuredStyles as Styles)\n : baseStyles;\n}\n\n/** Find custom names without a component style resolver match. */\nexport function unusedCustomStyleNames(\n styles: Record<string, Styles> | undefined,\n): string[] {\n return Object.keys(styles ?? {}).filter(\n (name) =>\n !sharedConfiguration.__tenphiCookbookUsedComponentStyles?.has(name),\n );\n}\n"],"mappings":";;AAIA,MAAM,sBAAsB;AAK5B,SAAgB,yBACd,QACM;CACN,oBAAoB,kCAAkC,UAAU,CAAC;CACjE,oBAAoB,sDAAsC,IAAI,IAAI;AACpE;;AAGA,SAAgB,uBACd,MACA,YACQ;CACR,oBAAoB,qCAAqC,IAAI,IAAI;CACjE,MAAM,mBAAmB,oBACtB,kCAAkC;CACrC,OAAO,mBACH,YAAY,YAAY,gBAA0B,IAClD;AACN;;AAGA,SAAgB,uBACd,QACU;CACV,OAAO,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,QAC9B,SACC,CAAC,oBAAoB,qCAAqC,IAAI,IAAI,CACtE;AACF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { configureCookbookStates } from "./tasty-states.js";
|
|
2
|
+
import { defineComponent } from "../define-component.js";
|
|
3
|
+
|
|
4
|
+
configureCookbookStates();
|
|
5
|
+
|
|
6
|
+
export const BannerRoot = defineComponent("Banner", {
|
|
7
|
+
as: "div",
|
|
8
|
+
"data-element": "Banner",
|
|
9
|
+
styles: {
|
|
10
|
+
padding: "($gap * 1.5) $docs-nav-pad-x",
|
|
11
|
+
color: "#accent-surface-text",
|
|
12
|
+
fill: "#accent-surface",
|
|
13
|
+
preset: "body / strong",
|
|
14
|
+
textAlign: "center",
|
|
15
|
+
textWrap: "balance",
|
|
16
|
+
shadow: "none",
|
|
17
|
+
Link: { $: "a", color: "#accent-surface-text" },
|
|
18
|
+
},
|
|
19
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { defineComponent } from "../define-component.js";
|
|
2
|
+
|
|
3
|
+
/** Shared button foundation; descendants own their layout and interaction anatomy. */
|
|
4
|
+
export const Button = defineComponent("Button", {
|
|
5
|
+
as: "button",
|
|
6
|
+
styles: {
|
|
7
|
+
display: "flex",
|
|
8
|
+
alignItems: "center",
|
|
9
|
+
gap: "$gap",
|
|
10
|
+
blockSize: "min 0",
|
|
11
|
+
color: "#text-soft",
|
|
12
|
+
cursor: "pointer",
|
|
13
|
+
},
|
|
14
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { configureCookbookStates } from "./tasty-states.js";
|
|
2
|
+
import { defineComponent } from "../define-component.js";
|
|
3
|
+
|
|
4
|
+
configureCookbookStates();
|
|
5
|
+
|
|
6
|
+
export const CalloutRoot = defineComponent("Callout", {
|
|
7
|
+
as: "aside",
|
|
8
|
+
"data-element": "Callout",
|
|
9
|
+
styles: {
|
|
10
|
+
"#callout-border": {
|
|
11
|
+
"": "#info",
|
|
12
|
+
'[data-kind="tip"]': "#success",
|
|
13
|
+
'[data-kind="caution"]': "#warning",
|
|
14
|
+
'[data-kind="danger"]': "#danger",
|
|
15
|
+
},
|
|
16
|
+
"#callout-text": {
|
|
17
|
+
"": "#info-text",
|
|
18
|
+
'[data-kind="tip"]': "#success-text",
|
|
19
|
+
'[data-kind="caution"]': "#warning-text",
|
|
20
|
+
'[data-kind="danger"]': "#danger-text",
|
|
21
|
+
},
|
|
22
|
+
"#callout-surface": {
|
|
23
|
+
"": "#info-surface",
|
|
24
|
+
'[data-kind="tip"]': "#success-surface",
|
|
25
|
+
'[data-kind="caution"]': "#warning-surface",
|
|
26
|
+
'[data-kind="danger"]': "#danger-surface",
|
|
27
|
+
},
|
|
28
|
+
"$margin-block-start": "2x",
|
|
29
|
+
"$margin-block-end": "2x",
|
|
30
|
+
blockMargin: "$margin-block-start $margin-block-end",
|
|
31
|
+
inlineMargin: "0",
|
|
32
|
+
padding: "2x 3x",
|
|
33
|
+
border: "1bw #callout-border",
|
|
34
|
+
radius: "1cr",
|
|
35
|
+
fill: "#callout-surface",
|
|
36
|
+
color: "#text",
|
|
37
|
+
Title: {
|
|
38
|
+
preset: "body / strong",
|
|
39
|
+
color: "#callout-text",
|
|
40
|
+
"$margin-block-start": "0",
|
|
41
|
+
"$margin-block-end": "1x",
|
|
42
|
+
blockMargin: "$margin-block-start $margin-block-end",
|
|
43
|
+
inlineMargin: "0",
|
|
44
|
+
},
|
|
45
|
+
Body: {
|
|
46
|
+
color: "#text",
|
|
47
|
+
"$margin-block-start": "0",
|
|
48
|
+
"$margin-block-end": "0",
|
|
49
|
+
blockMargin: "$margin-block-start $margin-block-end",
|
|
50
|
+
inlineMargin: "0",
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
elements: { Title: "p", Body: "div" },
|
|
54
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { CardLink, CardRoot } from "./
|
|
2
|
+
import { CardLink, CardRoot } from "./Card.styles.js";
|
|
3
3
|
|
|
4
4
|
import type { CardProps as Props } from "./props.js";
|
|
5
5
|
|
|
@@ -7,7 +7,7 @@ const { title, href } = Astro.props;
|
|
|
7
7
|
const Root = href ? CardLink : CardRoot;
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
<Root className="td-card" href={href}
|
|
11
|
-
{title && <h3
|
|
12
|
-
<div
|
|
10
|
+
<Root className="td-card" href={href}>
|
|
11
|
+
{title && <h3>{title}</h3>}
|
|
12
|
+
<div><slot /></div>
|
|
13
13
|
</Root>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { configureCookbookStates } from "./tasty-states.js";
|
|
2
|
+
import { tasty } from "@tenphi/tasty";
|
|
3
|
+
import { defineComponent } from "../define-component.js";
|
|
4
|
+
|
|
5
|
+
configureCookbookStates();
|
|
6
|
+
|
|
7
|
+
export const CardRoot = defineComponent("Card", {
|
|
8
|
+
as: "article",
|
|
9
|
+
"data-element": "Card",
|
|
10
|
+
styles: {
|
|
11
|
+
display: "grid",
|
|
12
|
+
gap: "1.5x",
|
|
13
|
+
padding: "2.5x",
|
|
14
|
+
color: "#text",
|
|
15
|
+
textDecoration: "none",
|
|
16
|
+
border: true,
|
|
17
|
+
radius: "1cr",
|
|
18
|
+
fill: "#surface-2",
|
|
19
|
+
shadow: "0 1px 2px #shadow",
|
|
20
|
+
transition: "fill $transition, shadow $transition, translate $transition",
|
|
21
|
+
|
|
22
|
+
Heading2: {
|
|
23
|
+
$: "h2",
|
|
24
|
+
"$margin-block-start": "0",
|
|
25
|
+
"$margin-block-end": "0",
|
|
26
|
+
blockMargin: "$margin-block-start $margin-block-end",
|
|
27
|
+
inlineMargin: "0",
|
|
28
|
+
},
|
|
29
|
+
Heading3: {
|
|
30
|
+
$: "h3",
|
|
31
|
+
"$margin-block-start": "0",
|
|
32
|
+
"$margin-block-end": "0",
|
|
33
|
+
blockMargin: "$margin-block-start $margin-block-end",
|
|
34
|
+
inlineMargin: "0",
|
|
35
|
+
},
|
|
36
|
+
Paragraph: {
|
|
37
|
+
$: "p",
|
|
38
|
+
"$margin-block-start": "0",
|
|
39
|
+
"$margin-block-end": "0",
|
|
40
|
+
blockMargin: "$margin-block-start $margin-block-end",
|
|
41
|
+
inlineMargin: "0",
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
export const CardLink = tasty(CardRoot, {
|
|
47
|
+
as: "a",
|
|
48
|
+
styles: {
|
|
49
|
+
fill: {
|
|
50
|
+
"": "#surface-2",
|
|
51
|
+
":hover": "#surface-2-hover",
|
|
52
|
+
":active": "#surface-2-pressed",
|
|
53
|
+
},
|
|
54
|
+
shadow: {
|
|
55
|
+
"": "0 1px 2px #shadow",
|
|
56
|
+
":hover": "0 .75x 2x #shadow",
|
|
57
|
+
},
|
|
58
|
+
translate: {
|
|
59
|
+
"": "0",
|
|
60
|
+
":hover": "0 -1px",
|
|
61
|
+
":active": "0",
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
});
|
|
@@ -2,14 +2,18 @@
|
|
|
2
2
|
import { Code } from "astro:components";
|
|
3
3
|
import Tabs from "./Tabs.astro";
|
|
4
4
|
import Tab from "./Tab.astro";
|
|
5
|
-
import { CodeGroupRoot } from "./
|
|
5
|
+
import { CodeGroupRoot } from "./CodeGroup.styles.js";
|
|
6
|
+
import { MarkdownCodeBlockStyles } from "./MarkdownCodeBlock.styles.js";
|
|
7
|
+
import { SyntaxHighlightStyles } from "./SyntaxHighlight.styles.js";
|
|
6
8
|
import { codeGroupHighlighting } from "../theme/shiki-theme.js";
|
|
7
9
|
import type { CodeGroupProps as Props } from "./props.js";
|
|
8
10
|
const { label = "Code examples", items } = Astro.props;
|
|
9
11
|
const highlight = codeGroupHighlighting();
|
|
10
12
|
---
|
|
11
13
|
|
|
12
|
-
<
|
|
14
|
+
<MarkdownCodeBlockStyles />
|
|
15
|
+
<SyntaxHighlightStyles />
|
|
16
|
+
<CodeGroupRoot>
|
|
13
17
|
<Tabs label={label}>
|
|
14
18
|
{
|
|
15
19
|
items.map((item) => (
|
|
@@ -19,7 +23,7 @@ const highlight = codeGroupHighlighting();
|
|
|
19
23
|
)}
|
|
20
24
|
<cookbook-code-block
|
|
21
25
|
class="td-code-block"
|
|
22
|
-
data-
|
|
26
|
+
data-element="MarkdownCodeBlock"
|
|
23
27
|
>
|
|
24
28
|
<Code
|
|
25
29
|
code={item.code}
|
|
@@ -30,11 +34,12 @@ const highlight = codeGroupHighlighting();
|
|
|
30
34
|
/>
|
|
31
35
|
<button
|
|
32
36
|
type="button"
|
|
37
|
+
data-element="CopyButton"
|
|
33
38
|
data-copy-code
|
|
34
39
|
aria-label="Copy code"
|
|
35
40
|
title="Copy code"
|
|
36
41
|
>
|
|
37
|
-
<span data-copy-icon aria-hidden="true" />
|
|
42
|
+
<span data-element="CopyIcon" data-copy-icon aria-hidden="true" />
|
|
38
43
|
</button>
|
|
39
44
|
</cookbook-code-block>
|
|
40
45
|
</Tab>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { configureCookbookStates } from "./tasty-states.js";
|
|
2
|
+
import { defineComponent } from "../define-component.js";
|
|
3
|
+
|
|
4
|
+
configureCookbookStates();
|
|
5
|
+
|
|
6
|
+
export const CodeGroupRoot = defineComponent("CodeGroup", {
|
|
7
|
+
as: "div",
|
|
8
|
+
"data-element": "CodeGroup",
|
|
9
|
+
styles: {
|
|
10
|
+
Caption: {
|
|
11
|
+
preset: "small",
|
|
12
|
+
color: "#text-soft",
|
|
13
|
+
"$margin-block-start": "0",
|
|
14
|
+
"$margin-block-end": "1x",
|
|
15
|
+
blockMargin: "$margin-block-start $margin-block-end",
|
|
16
|
+
inlineMargin: "0",
|
|
17
|
+
},
|
|
18
|
+
Pre: { $: "pre" },
|
|
19
|
+
Code: {
|
|
20
|
+
$: "pre code",
|
|
21
|
+
preset: "code",
|
|
22
|
+
color: "#syntax-text",
|
|
23
|
+
whiteSpace: "pre",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
elements: { Caption: "p", Pre: "pre", Code: "code" },
|
|
27
|
+
});
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { useFontFace, useGlobalStyles } from "@tenphi/tasty";
|
|
2
|
+
import jetBrainsMonoLatin from "@fontsource-variable/jetbrains-mono/files/jetbrains-mono-latin-wght-normal.woff2?url";
|
|
3
|
+
import onestLatin from "@fontsource-variable/onest/files/onest-latin-wght-normal.woff2?url";
|
|
4
|
+
import { resolveComponentStyles } from "./component-styles.js";
|
|
5
|
+
import { configureCookbookStates } from "./tasty-states.js";
|
|
6
|
+
import { TASTY_SPACING_PROPERTIES } from "../theme/tasty-config.js";
|
|
7
|
+
import { getDefaultFontUsage, getFontFaces } from "../theme/fonts.js";
|
|
8
|
+
|
|
9
|
+
configureCookbookStates();
|
|
10
|
+
|
|
11
|
+
export default function DocumentStyles() {
|
|
12
|
+
const defaultFonts = getDefaultFontUsage();
|
|
13
|
+
if (defaultFonts.onest)
|
|
14
|
+
useFontFace("Onest Variable", {
|
|
15
|
+
src: `url("${onestLatin}") format("woff2-variations")`,
|
|
16
|
+
fontWeight: "100 900",
|
|
17
|
+
fontDisplay: defaultFonts.display ?? "swap",
|
|
18
|
+
});
|
|
19
|
+
if (defaultFonts.mono)
|
|
20
|
+
useFontFace("JetBrains Mono Variable", {
|
|
21
|
+
src: `url("${jetBrainsMonoLatin}") format("woff2-variations")`,
|
|
22
|
+
fontWeight: "100 800",
|
|
23
|
+
fontDisplay: defaultFonts.display ?? "swap",
|
|
24
|
+
});
|
|
25
|
+
for (const face of getFontFaces()) useFontFace(face.family, face.descriptors);
|
|
26
|
+
|
|
27
|
+
useGlobalStyles(
|
|
28
|
+
":root",
|
|
29
|
+
resolveComponentStyles("Layout", {
|
|
30
|
+
overflow: {
|
|
31
|
+
"": null,
|
|
32
|
+
":has(#cookbook__sidebar:popover-open) & @mobile": "hidden",
|
|
33
|
+
},
|
|
34
|
+
colorScheme: {
|
|
35
|
+
"": "dark",
|
|
36
|
+
'[data-theme="light"]': "light",
|
|
37
|
+
"![data-theme] & @system-light": "light",
|
|
38
|
+
},
|
|
39
|
+
"$docs-nav-height": {
|
|
40
|
+
"": "4.5rem",
|
|
41
|
+
":has(.td-top-tabs)": "7.25rem",
|
|
42
|
+
"@mobile": "3.5rem",
|
|
43
|
+
"@mobile & [data-has-sidebar]": "6.5rem",
|
|
44
|
+
},
|
|
45
|
+
"$docs-nav-pad-x": {
|
|
46
|
+
"": "clamp(1.25rem, 2.5vw, 2rem)",
|
|
47
|
+
"@mobile": "1rem",
|
|
48
|
+
},
|
|
49
|
+
"$docs-nav-gap": { "": "0.75rem", "@mobile": "0.5rem" },
|
|
50
|
+
"$docs-sidebar-pad-x": "1.5rem",
|
|
51
|
+
"$docs-content-pad-x": {
|
|
52
|
+
"": "clamp(1.5rem, 4vw, 4rem)",
|
|
53
|
+
"@mobile": "1rem",
|
|
54
|
+
},
|
|
55
|
+
"$docs-menu-button-size": { "": "2.5rem", "@mobile": "2.25rem" },
|
|
56
|
+
"$docs-mobile-toc-height": "0rem",
|
|
57
|
+
Islands: {
|
|
58
|
+
$: "astro-island, astro-slot, astro-static-slot",
|
|
59
|
+
display: "contents",
|
|
60
|
+
},
|
|
61
|
+
}),
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
useGlobalStyles(
|
|
65
|
+
":where(html)",
|
|
66
|
+
resolveComponentStyles("Document", {
|
|
67
|
+
"@property": TASTY_SPACING_PROPERTIES,
|
|
68
|
+
boxSizing: "border-box",
|
|
69
|
+
scrollBehavior: { "@reduced-motion": "auto" },
|
|
70
|
+
transitionDuration: { "@reduced-motion": "0.01ms" },
|
|
71
|
+
"$margin-block-start": "0",
|
|
72
|
+
"$margin-block-end": "0",
|
|
73
|
+
blockSize: "min 100%",
|
|
74
|
+
blockScrollPadding:
|
|
75
|
+
"(1.5rem + $docs-nav-height + $docs-mobile-toc-height) start",
|
|
76
|
+
All: {
|
|
77
|
+
$: "&::before, &::after, *, *::before, *::after",
|
|
78
|
+
boxSizing: "border-box",
|
|
79
|
+
scrollBehavior: {
|
|
80
|
+
"@reduced-motion": "auto",
|
|
81
|
+
},
|
|
82
|
+
transitionDuration: {
|
|
83
|
+
"@reduced-motion": "0.01ms",
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
BlockSpacing: {
|
|
87
|
+
$: "*",
|
|
88
|
+
// Reset on each element: spacing tokens must never leak into its children.
|
|
89
|
+
"$margin-block-start": {
|
|
90
|
+
"": "0",
|
|
91
|
+
"@own(:is(p,ul,ol,dl,blockquote,pre,figure))": "1em",
|
|
92
|
+
"@own(:is(hr))": "0.5em",
|
|
93
|
+
"@own(:is(h1))": "0.67em",
|
|
94
|
+
"@own(:is(h2))": "0.83em",
|
|
95
|
+
"@own(:is(h3))": "1em",
|
|
96
|
+
"@own(:is(h4))": "1.33em",
|
|
97
|
+
"@own(:is(h5))": "1.67em",
|
|
98
|
+
"@own(:is(h6))": "2.33em",
|
|
99
|
+
},
|
|
100
|
+
"$margin-block-end": {
|
|
101
|
+
"": "0",
|
|
102
|
+
"@own(:is(p,ul,ol,dl,blockquote,pre,figure))": "1em",
|
|
103
|
+
"@own(:is(hr))": "0.5em",
|
|
104
|
+
"@own(:is(h1))": "0.67em",
|
|
105
|
+
"@own(:is(h2))": "0.83em",
|
|
106
|
+
"@own(:is(h3))": "1em",
|
|
107
|
+
"@own(:is(h4))": "1.33em",
|
|
108
|
+
"@own(:is(h5))": "1.67em",
|
|
109
|
+
"@own(:is(h6))": "2.33em",
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
Body: {
|
|
113
|
+
$: "body",
|
|
114
|
+
inlineSize: "min 0",
|
|
115
|
+
blockSize: "min 100%",
|
|
116
|
+
margin: "0",
|
|
117
|
+
color: "#text",
|
|
118
|
+
fill: "#surface",
|
|
119
|
+
preset: "body",
|
|
120
|
+
},
|
|
121
|
+
Control: {
|
|
122
|
+
$: ":where(button), :where(input), :where(select), :where(textarea)",
|
|
123
|
+
preset: "body",
|
|
124
|
+
blockSize: "min $control-height",
|
|
125
|
+
radius: "$radius",
|
|
126
|
+
shadow: "none",
|
|
127
|
+
},
|
|
128
|
+
Pointer: {
|
|
129
|
+
$: ":where(button), :where(summary), :where(select)",
|
|
130
|
+
cursor: "pointer",
|
|
131
|
+
},
|
|
132
|
+
ResponsiveWidth: {
|
|
133
|
+
$: "img, :where(picture), video, canvas, svg, iframe",
|
|
134
|
+
inlineSize: {
|
|
135
|
+
"": null,
|
|
136
|
+
"@own(![width] | :is(picture))": "max 100%",
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
ResponsiveHeight: {
|
|
140
|
+
$: "img, :where(picture), video, canvas, svg",
|
|
141
|
+
blockSize: {
|
|
142
|
+
"": null,
|
|
143
|
+
"@own(![height] | :is(picture))": "auto",
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
Hidden: {
|
|
147
|
+
$: ":where(*), :where(.cookbook-hidden)",
|
|
148
|
+
hide: {
|
|
149
|
+
"": null,
|
|
150
|
+
"@own([hidden] | .cookbook-hidden)": true,
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
PrintHidden: {
|
|
154
|
+
$: ".cookbook-print-hidden",
|
|
155
|
+
display: { "@media:print": "none" },
|
|
156
|
+
},
|
|
157
|
+
DesktopBlock: {
|
|
158
|
+
$: ":is(.md\\:cookbook-block)",
|
|
159
|
+
display: { "": "block", "@mobile": "none" },
|
|
160
|
+
},
|
|
161
|
+
DesktopFlex: {
|
|
162
|
+
$: ":is(.md\\:cookbook-flex)",
|
|
163
|
+
display: { "": "flex", "@mobile": "none" },
|
|
164
|
+
},
|
|
165
|
+
ScreenReaderOnly: {
|
|
166
|
+
$: ".sr-only",
|
|
167
|
+
position: "absolute",
|
|
168
|
+
inlineSize: "1px",
|
|
169
|
+
blockSize: "1px",
|
|
170
|
+
padding: "0",
|
|
171
|
+
margin: "-1px",
|
|
172
|
+
overflow: "hidden",
|
|
173
|
+
clip: "rect(0, 0, 0, 0)",
|
|
174
|
+
whiteSpace: "nowrap",
|
|
175
|
+
border: "0",
|
|
176
|
+
},
|
|
177
|
+
Strong: { $: ":where(strong), :where(b)", preset: "strong" },
|
|
178
|
+
Link: { $: "a", color: "#accent-text" },
|
|
179
|
+
NarrowBlock: {
|
|
180
|
+
$: ":is(.lg\\:cookbook-hidden)",
|
|
181
|
+
display: { "": "none", "@narrow-layout": "block" },
|
|
182
|
+
},
|
|
183
|
+
MobileBlock: {
|
|
184
|
+
$: ":is(.md\\:cookbook-hidden)",
|
|
185
|
+
display: { "": "none", "@mobile": "block" },
|
|
186
|
+
},
|
|
187
|
+
Code: {
|
|
188
|
+
$: ":where(code), :where(kbd), :where(samp), :where(pre)",
|
|
189
|
+
preset: "code",
|
|
190
|
+
},
|
|
191
|
+
FocusRing: {
|
|
192
|
+
$: ":where(a), :where(button), :where(input), :where(select), :where(textarea), :where(summary)",
|
|
193
|
+
outline: {
|
|
194
|
+
"": null,
|
|
195
|
+
"@own(:focus-visible)":
|
|
196
|
+
"$outline-width solid #focus / $outline-offset",
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
CurrentLink: {
|
|
200
|
+
$: "a",
|
|
201
|
+
radius: { "": null, '@own([aria-current="page"])': "$radius" },
|
|
202
|
+
},
|
|
203
|
+
SearchOpen: {
|
|
204
|
+
$: "body",
|
|
205
|
+
overflow: { "": null, "@own([data-search-modal-open])": "hidden" },
|
|
206
|
+
},
|
|
207
|
+
}),
|
|
208
|
+
);
|
|
209
|
+
|
|
210
|
+
useGlobalStyles(
|
|
211
|
+
":where(h1, h2, h3, h4, h5, h6, .site-title)",
|
|
212
|
+
resolveComponentStyles("Heading", {
|
|
213
|
+
color: "#heading",
|
|
214
|
+
preset: {
|
|
215
|
+
"": "heading",
|
|
216
|
+
":is(h1)": "h1",
|
|
217
|
+
":is(h2)": "h2",
|
|
218
|
+
":is(h3)": "h3",
|
|
219
|
+
":is(h4)": "h4",
|
|
220
|
+
":is(h5)": "h5",
|
|
221
|
+
":is(h6)": "h6",
|
|
222
|
+
},
|
|
223
|
+
textWrap: "balance",
|
|
224
|
+
"$margin-block-start": { "": null, '[id="_top"]': "($gap * 2)" },
|
|
225
|
+
blockMargin: "$margin-block-start $margin-block-end",
|
|
226
|
+
}),
|
|
227
|
+
);
|
|
228
|
+
|
|
229
|
+
return null;
|
|
230
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { configureCookbookStates } from "./tasty-states.js";
|
|
2
|
+
import { defineComponent } from "../define-component.js";
|
|
3
|
+
|
|
4
|
+
configureCookbookStates();
|
|
5
|
+
|
|
6
|
+
export const FooterRoot = defineComponent("Footer", {
|
|
7
|
+
as: "footer",
|
|
8
|
+
"data-element": "Footer",
|
|
9
|
+
styles: {
|
|
10
|
+
display: "flex",
|
|
11
|
+
flow: "column",
|
|
12
|
+
gap: "($gap * 3)",
|
|
13
|
+
Meta: {
|
|
14
|
+
display: "flex",
|
|
15
|
+
flow: "row wrap",
|
|
16
|
+
justifyContent: "space-between",
|
|
17
|
+
gap: "($gap * 1.5) ($gap * 6)",
|
|
18
|
+
blockMargin: "($gap * 6) start",
|
|
19
|
+
color: "#text-muted",
|
|
20
|
+
preset: "small",
|
|
21
|
+
},
|
|
22
|
+
MetaLink: {
|
|
23
|
+
display: "flex",
|
|
24
|
+
alignItems: "center",
|
|
25
|
+
gap: "$gap",
|
|
26
|
+
inlineMargin: { "": "0", "@own(:only-child)": "auto start" },
|
|
27
|
+
color: { "": "#text-muted", "@own(:hover)": "#text" },
|
|
28
|
+
textDecoration: "none",
|
|
29
|
+
},
|
|
30
|
+
MetaUpdated: {
|
|
31
|
+
inlineMargin: { "": "0", "@own(:only-child)": "auto start" },
|
|
32
|
+
},
|
|
33
|
+
Credit: {
|
|
34
|
+
margin: "($gap * 3) auto",
|
|
35
|
+
color: "#text",
|
|
36
|
+
preset: "small",
|
|
37
|
+
textAlign: "center",
|
|
38
|
+
},
|
|
39
|
+
CreditLink: {
|
|
40
|
+
color: { "": "#accent-text", "@own(:hover)": "#text" },
|
|
41
|
+
preset: "small / strong",
|
|
42
|
+
textDecoration: "none",
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
});
|