@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.
Files changed (122) hide show
  1. package/dist/component-styles-DstqPFf3.js +21 -0
  2. package/dist/component-styles-DstqPFf3.js.map +1 -0
  3. package/dist/components/Banner.styles.js +19 -0
  4. package/dist/components/Button.styles.d.ts +9 -0
  5. package/dist/components/Button.styles.js +14 -0
  6. package/dist/components/Callout.astro +1 -1
  7. package/dist/components/Callout.styles.js +54 -0
  8. package/dist/components/Card.astro +4 -4
  9. package/dist/components/Card.styles.js +64 -0
  10. package/dist/components/CodeGroup.astro +9 -4
  11. package/dist/components/CodeGroup.styles.js +27 -0
  12. package/dist/components/Document.styles.js +230 -0
  13. package/dist/components/EditLink.astro +1 -1
  14. package/dist/components/Footer.styles.js +45 -0
  15. package/dist/components/Header.styles.js +96 -0
  16. package/dist/components/HeaderFrame.styles.js +20 -0
  17. package/dist/components/HeaderLinks.astro +2 -2
  18. package/dist/components/HeaderLinks.styles.js +149 -0
  19. package/dist/components/Hero.styles.js +129 -0
  20. package/dist/components/LanguageSelect.styles.js +169 -0
  21. package/dist/components/LastUpdated.astro +1 -1
  22. package/dist/components/Logo.astro +4 -8
  23. package/dist/components/Logo.styles.js +27 -0
  24. package/dist/components/MainContent.styles.js +38 -0
  25. package/dist/components/MainPane.styles.js +19 -0
  26. package/dist/components/MarkdownAlert.styles.js +61 -0
  27. package/dist/components/MarkdownCodeBlock.styles.js +131 -0
  28. package/dist/components/MarkdownContent.styles.js +231 -0
  29. package/dist/components/MarkdownHeading.styles.js +117 -0
  30. package/dist/components/MarkdownInlineCode.styles.js +19 -0
  31. package/dist/components/MarkdownTable.styles.js +58 -0
  32. package/dist/components/Mermaid.styles.js +50 -0
  33. package/dist/components/MermaidSource.styles.js +21 -0
  34. package/dist/components/MobileMenuFooter.styles.js +27 -0
  35. package/dist/components/MobileMenuToggle.styles.js +49 -0
  36. package/dist/components/MobileNavigationTabs.astro +1 -2
  37. package/dist/components/MobileNavigationTabs.styles.js +88 -0
  38. package/dist/components/MobileTableOfContents.styles.js +59 -0
  39. package/dist/components/PackageVersion.astro +1 -2
  40. package/dist/components/PackageVersion.styles.js +23 -0
  41. package/dist/components/PageActions.astro +2 -2
  42. package/dist/components/PageActions.styles.js +51 -0
  43. package/dist/components/PageFrame.styles.js +34 -0
  44. package/dist/components/Pagination.astro +3 -2
  45. package/dist/components/Pagination.styles.js +126 -0
  46. package/dist/components/Preview.astro +2 -6
  47. package/dist/components/Preview.styles.js +78 -0
  48. package/dist/components/Search.styles.js +132 -0
  49. package/dist/components/SearchButton.styles.js +68 -0
  50. package/dist/components/SearchResults.styles.js +200 -0
  51. package/dist/components/SelectPopover.astro +1 -0
  52. package/dist/components/Sidebar.styles.js +309 -0
  53. package/dist/components/SiteLogo.astro +1 -2
  54. package/dist/components/SiteLogo.styles.js +32 -0
  55. package/dist/components/SiteTitle.astro +1 -1
  56. package/dist/components/SkipLink.styles.js +24 -0
  57. package/dist/components/SocialIcons.styles.js +36 -0
  58. package/dist/components/Steps.astro +2 -2
  59. package/dist/components/Steps.styles.js +25 -0
  60. package/dist/components/SyntaxHighlight.styles.js +87 -0
  61. package/dist/components/Tab.astro +1 -1
  62. package/dist/components/Tab.styles.js +30 -0
  63. package/dist/components/TableOfContents.styles.js +62 -0
  64. package/dist/components/TableOfContentsLayout.styles.js +38 -0
  65. package/dist/components/Tabs.astro +1 -1
  66. package/dist/components/Tabs.styles.js +60 -0
  67. package/dist/components/ThemeSelect.styles.js +177 -0
  68. package/dist/components/TopNavigation.styles.js +52 -0
  69. package/dist/components/VersionSwitcher.astro +2 -2
  70. package/dist/components/VersionSwitcher.styles.js +45 -0
  71. package/dist/components/component-styles.test.ts +0 -10
  72. package/dist/components/component-styles.ts +0 -7
  73. package/dist/components/inherit-component-parts.d.ts +1 -0
  74. package/dist/components/inherit-component-parts.js +7 -0
  75. package/dist/components/select-popover-styles.js +34 -16
  76. package/dist/components/tasty-states.js +13 -1
  77. package/dist/define-component-BP4YwMak.js +28 -0
  78. package/dist/define-component-BP4YwMak.js.map +1 -0
  79. package/dist/define-component.d.ts +17 -0
  80. package/dist/define-component.d.ts.map +1 -0
  81. package/dist/define-component.js +2 -0
  82. package/dist/eslint-plugin.d.ts +5 -0
  83. package/dist/eslint-plugin.d.ts.map +1 -1
  84. package/dist/eslint-plugin.js +26 -3
  85. package/dist/eslint-plugin.js.map +1 -1
  86. package/dist/index.d.ts.map +1 -1
  87. package/dist/index.js +7 -3
  88. package/dist/index.js.map +1 -1
  89. package/dist/overrides/Footer.astro +6 -5
  90. package/dist/overrides/Header.astro +13 -17
  91. package/dist/overrides/Hero.astro +3 -2
  92. package/dist/overrides/LanguageSelect.astro +3 -3
  93. package/dist/overrides/MarkdownContent.astro +7 -1
  94. package/dist/overrides/MobileMenuFooter.astro +2 -5
  95. package/dist/overrides/MobileMenuToggle.astro +4 -3
  96. package/dist/overrides/MobileTableOfContents.astro +2 -2
  97. package/dist/overrides/PageFrame.astro +9 -11
  98. package/dist/overrides/Search.astro +13 -9
  99. package/dist/overrides/Sidebar.astro +4 -1
  100. package/dist/overrides/SocialIcons.astro +2 -2
  101. package/dist/overrides/ThemeSelect.astro +9 -3
  102. package/dist/routes/Page.astro +22 -11
  103. package/dist/styling.d.ts +5 -10
  104. package/dist/styling.d.ts.map +1 -1
  105. package/dist/styling.js +18 -11
  106. package/dist/styling.js.map +1 -1
  107. package/dist/tasty-states-_JhxFdK1.js +47 -0
  108. package/dist/tasty-states-_JhxFdK1.js.map +1 -0
  109. package/dist/theme/defaults.d.ts.map +1 -1
  110. package/dist/theme/defaults.js +22 -1
  111. package/dist/theme/defaults.js.map +1 -1
  112. package/dist/theme/tasty-config.d.ts +23 -1
  113. package/dist/theme/tasty-config.d.ts.map +1 -1
  114. package/dist/theme/tasty-config.js +23 -1
  115. package/dist/theme/tasty-config.js.map +1 -1
  116. package/package.json +4 -4
  117. package/dist/components/GlobalStyles.js +0 -1792
  118. package/dist/components/LayoutComponents.js +0 -872
  119. package/dist/components/TastyComponents.js +0 -269
  120. package/dist/components/customize-component.js +0 -8
  121. package/dist/tasty-states-rTLFy26t.js +0 -57
  122. package/dist/tasty-states-rTLFy26t.js.map +0 -1
@@ -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,9 @@
1
+ import type { TastyPolymorphicComponent } from "@tenphi/tasty";
2
+
3
+ export const Button: TastyPolymorphicComponent<
4
+ "button",
5
+ readonly never[],
6
+ Record<string, never>,
7
+ readonly never[],
8
+ readonly never[]
9
+ >;
@@ -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
+ });
@@ -1,5 +1,5 @@
1
1
  ---
2
- import { CalloutRoot } from "./TastyComponents.js";
2
+ import { CalloutRoot } from "./Callout.styles.js";
3
3
  import type { CalloutProps as Props } from "./props.js";
4
4
  const {
5
5
  kind = "note",
@@ -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 "./TastyComponents.js";
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} data-tasty-anatomy="Card">
11
- {title && <h3 data-tasty-anatomy="CardTitle">{title}</h3>}
12
- <div data-tasty-anatomy="CardBody"><slot /></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 "./TastyComponents.js";
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
- <CodeGroupRoot data-tasty-anatomy="CodeGroup">
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-tasty-anatomy="MarkdownCodeBlock"
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
+ }
@@ -4,7 +4,7 @@ const { editUrl } = Astro.locals.cookbookRoute;
4
4
 
5
5
  {
6
6
  editUrl && (
7
- <a href={editUrl} class="cookbook-print-hidden">
7
+ <a data-element="MetaLink" href={editUrl} class="cookbook-print-hidden">
8
8
  {Astro.locals.t("page.editLink")}
9
9
  </a>
10
10
  )
@@ -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
+ });
@@ -0,0 +1,96 @@
1
+ import { configureCookbookStates } from "./tasty-states.js";
2
+ import { defineComponent } from "../define-component.js";
3
+
4
+ configureCookbookStates();
5
+
6
+ export const HeaderRoot = defineComponent("Header", {
7
+ as: "div",
8
+ "data-element": "Header",
9
+ styles: {
10
+ display: "flex",
11
+ flow: "column",
12
+ inlineSize: "0 100% ($layout-width - ($docs-sidebar-pad-x * 2))",
13
+ blockSize: "100%",
14
+ inlineMargin: "auto",
15
+
16
+ Primary: {
17
+ display: "flex",
18
+ alignItems: "center",
19
+ gap: { "": "clamp(0.5rem, 1.5vw, 1.5rem)", "@mobile": "0.5rem" },
20
+ blockSize: { "": "4.5rem", "@mobile": "3.5rem" },
21
+ flexShrink: "0",
22
+ },
23
+ Title: {
24
+ display: "flex",
25
+ alignItems: "center",
26
+ flow: "row",
27
+ gap: "$gap",
28
+ overflow: "hidden",
29
+ flexShrink: "1",
30
+ inlineSize: "min 0",
31
+ inlineMargin: { "": "0 end", "@mobile": "auto end" },
32
+ },
33
+ LogoLink: {
34
+ display: "inline-grid",
35
+ flexShrink: "0",
36
+ placeItems: "center",
37
+ color: "#text",
38
+ textDecoration: "none",
39
+ },
40
+ Logo: {
41
+ inlineSize: { "": "2rem", "@mobile": "1.75rem" },
42
+ blockSize: { "": "2rem", "@mobile": "1.75rem" },
43
+ },
44
+ SiteTitle: {
45
+ inlineSize: "min 0",
46
+ overflow: "hidden",
47
+ color: "#text",
48
+ preset: { "": "h4", "@mobile": "h5" },
49
+ textDecoration: "none",
50
+ whiteSpace: "nowrap",
51
+ textOverflow: "ellipsis",
52
+ },
53
+ Search: {
54
+ $: "Primary > Search",
55
+ display: "flex",
56
+ alignItems: "center",
57
+ flexGrow: { "": "1", "@mobile": "0" },
58
+ flexShrink: { "": "1", "@mobile": "0" },
59
+ inlineSize: { "": "min 0", "@mobile": "$docs-menu-button-size" },
60
+ inlineMargin: { "": "auto", "@mobile": "0" },
61
+ },
62
+ SearchElement: {
63
+ $: "Search site-search",
64
+ inlineSize: "0 100% 28rem",
65
+ inlineMargin: "auto",
66
+ },
67
+ Tools: {
68
+ display: "flex",
69
+ hide: { "": false, "@mobile": true },
70
+ flow: "row",
71
+ alignItems: "center",
72
+ justifyContent: "flex-end",
73
+ gap: "($gap * 0.5)",
74
+ },
75
+ Social: {
76
+ display: "flex",
77
+ alignItems: "center",
78
+ },
79
+ MobileTheme: {
80
+ display: "grid",
81
+ hide: { "": true, "@mobile": false },
82
+ flexShrink: "0",
83
+ order: "1",
84
+ inlineSize: "$docs-menu-button-size",
85
+ blockSize: "$docs-menu-button-size",
86
+ },
87
+ MobileLanguage: {
88
+ display: "grid",
89
+ hide: { "": true, "@mobile": false },
90
+ flexShrink: "0",
91
+ order: "1",
92
+ inlineSize: "$docs-menu-button-size",
93
+ blockSize: "$docs-menu-button-size",
94
+ },
95
+ },
96
+ });