@tenphi/renderer 0.21.0 → 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 @@
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;iBAiDxC,mBAAmB,SAAQ,cAAmB;iBAI9C,yBACd,UAAS,mBACT,eAAc,QAAQ,+CACrB,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"}
@@ -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":";;;cAGa;WACX;WACA;WACA;WACA;;iBAGc,YAAY,OAAO,oBAAoB"}
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
@@ -1 +1 @@
1
- {"version":3,"file":"tasty-config.js","names":[],"sources":["../../src/theme/tasty-config.ts"],"sourcesContent":["import type { ConfigTokens } from \"@tenphi/tasty/core\";\nimport type { ResolvedDocsTheme } from \"./index.js\";\n\nexport const TASTY_UNITS = {\n x: \"var(--gap)\",\n r: \"var(--radius)\",\n cr: \"var(--card-radius)\",\n bw: \"var(--border-width)\",\n} as const;\n\nexport function tastyTokens(theme: ResolvedDocsTheme): ConfigTokens {\n const tokens = Object.fromEntries(\n Object.entries(theme.tokens).filter(([name]) => name.startsWith(\"$\")),\n ) as ConfigTokens;\n\n Object.assign(tokens, theme.colorTokens as ConfigTokens);\n\n return tokens;\n}\n"],"mappings":";AAGA,MAAa,cAAc;CACzB,GAAG;CACH,GAAG;CACH,IAAI;CACJ,IAAI;AACN;AAEA,SAAgB,YAAY,OAAwC;CAClE,MAAM,SAAS,OAAO,YACpB,OAAO,QAAQ,MAAM,MAAM,CAAC,CAAC,QAAQ,CAAC,UAAU,KAAK,WAAW,GAAG,CAAC,CACtE;CAEA,OAAO,OAAO,QAAQ,MAAM,WAA2B;CAEvD,OAAO;AACT"}
1
+ {"version":3,"file":"tasty-config.js","names":[],"sources":["../../src/theme/tasty-config.ts"],"sourcesContent":["import type { ConfigTokens } from \"@tenphi/tasty/core\";\nimport type { ResolvedDocsTheme } from \"./index.js\";\n\n// Margin edges accept automatic centering as well as lengths and percentages.\n// Explicit types prevent Tasty's first length assignment from excluding `auto`.\nexport const TASTY_SPACING_PROPERTIES = {\n \"$margin-block-start\": {\n syntax: \"<length-percentage> | auto\",\n inherits: false,\n initialValue: \"0px\",\n },\n \"$margin-block-end\": {\n syntax: \"<length-percentage> | auto\",\n inherits: false,\n initialValue: \"0px\",\n },\n \"$padding-block-start\": {\n syntax: \"<length-percentage>\",\n inherits: false,\n initialValue: \"0px\",\n },\n \"$padding-block-end\": {\n syntax: \"<length-percentage>\",\n inherits: false,\n initialValue: \"0px\",\n },\n} as const;\n\nexport const TASTY_UNITS = {\n x: \"var(--gap)\",\n r: \"var(--radius)\",\n cr: \"var(--card-radius)\",\n bw: \"var(--border-width)\",\n} as const;\n\nexport function tastyTokens(theme: ResolvedDocsTheme): ConfigTokens {\n const tokens = Object.fromEntries(\n Object.entries(theme.tokens).filter(([name]) => name.startsWith(\"$\")),\n ) as ConfigTokens;\n\n Object.assign(tokens, theme.colorTokens as ConfigTokens);\n\n return tokens;\n}\n"],"mappings":";AAKA,MAAa,2BAA2B;CACtC,uBAAuB;EACrB,QAAQ;EACR,UAAU;EACV,cAAc;CAChB;CACA,qBAAqB;EACnB,QAAQ;EACR,UAAU;EACV,cAAc;CAChB;CACA,wBAAwB;EACtB,QAAQ;EACR,UAAU;EACV,cAAc;CAChB;CACA,sBAAsB;EACpB,QAAQ;EACR,UAAU;EACV,cAAc;CAChB;AACF;AAEA,MAAa,cAAc;CACzB,GAAG;CACH,GAAG;CACH,IAAI;CACJ,IAAI;AACN;AAEA,SAAgB,YAAY,OAAwC;CAClE,MAAM,SAAS,OAAO,YACpB,OAAO,QAAQ,MAAM,MAAM,CAAC,CAAC,QAAQ,CAAC,UAAU,KAAK,WAAW,GAAG,CAAC,CACtE;CAEA,OAAO,OAAO,QAAQ,MAAM,WAA2B;CAEvD,OAAO;AACT"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tenphi/renderer",
3
- "version": "0.21.0",
3
+ "version": "0.21.2",
4
4
  "description": "Astro renderer and Tasty theme for Cookbook",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -61,10 +61,10 @@
61
61
  "@fontsource-variable/jetbrains-mono": "^5.3.0",
62
62
  "@fontsource-variable/onest": "^5.3.0",
63
63
  "@pagefind/default-ui": "1.5.2",
64
- "@tenphi/docs": "0.21.0",
65
- "@tenphi/eslint-plugin-tasty": "1.1.0",
64
+ "@tenphi/docs": "0.21.2",
65
+ "@tenphi/eslint-plugin-tasty": "1.5.1",
66
66
  "@tenphi/glaze": "2.0.0",
67
- "@tenphi/tasty": "3.8.0",
67
+ "@tenphi/tasty": "3.9.6",
68
68
  "beautiful-mermaid": "^1.1.3",
69
69
  "hast-util-from-html": "^2.0.3",
70
70
  "pagefind": "1.5.2",