@tenphi/renderer 0.22.1 → 0.24.0

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 (90) hide show
  1. package/dist/client/client-navigation.d.ts +1 -0
  2. package/dist/client/client-navigation.js +32 -0
  3. package/dist/client/client-navigation.js.map +1 -0
  4. package/dist/client/code-copy.js +3 -3
  5. package/dist/client/code-copy.js.map +1 -1
  6. package/dist/client/heading-links.js +4 -4
  7. package/dist/client/heading-links.js.map +1 -1
  8. package/dist/client/navigation-router.d.ts +2 -0
  9. package/dist/client/navigation-router.js +36 -0
  10. package/dist/client/navigation-router.js.map +1 -0
  11. package/dist/client/navigation.js +3 -3
  12. package/dist/client/navigation.js.map +1 -1
  13. package/dist/client/search.d.ts.map +1 -1
  14. package/dist/client/search.js +16 -2
  15. package/dist/client/search.js.map +1 -1
  16. package/dist/client/table-of-contents.js +2 -2
  17. package/dist/client/table-of-contents.js.map +1 -1
  18. package/dist/components/AppearanceInit.astro +6 -0
  19. package/dist/components/Card.styles.js +1 -0
  20. package/dist/components/CodeGroup.astro +8 -1
  21. package/dist/components/CodeGroup.styles.js +1 -2
  22. package/dist/components/Document.styles.js +54 -25
  23. package/dist/components/EditLink.astro +1 -1
  24. package/dist/components/Header.styles.js +13 -13
  25. package/dist/components/HeaderLinks.astro +4 -8
  26. package/dist/components/HeaderLinks.styles.js +17 -17
  27. package/dist/components/Hero.styles.js +28 -30
  28. package/dist/components/Icon.astro +3 -3
  29. package/dist/components/LanguageSelect.styles.js +8 -8
  30. package/dist/components/MainContent.styles.js +3 -3
  31. package/dist/components/MainPane.styles.js +1 -1
  32. package/dist/components/MarkdownAlert.styles.js +16 -17
  33. package/dist/components/MarkdownCodeBlock.styles.js +31 -19
  34. package/dist/components/MarkdownContent.styles.js +47 -89
  35. package/dist/components/MarkdownHeading.styles.js +23 -24
  36. package/dist/components/MarkdownInlineCode.styles.js +1 -1
  37. package/dist/components/MarkdownTable.styles.js +5 -5
  38. package/dist/components/Mermaid.styles.js +4 -1
  39. package/dist/components/MermaidSource.styles.js +1 -1
  40. package/dist/components/MobileMenuFooter.styles.js +1 -1
  41. package/dist/components/MobileMenuToggle.styles.js +3 -3
  42. package/dist/components/MobileNavigationTabs.astro +3 -2
  43. package/dist/components/MobileNavigationTabs.styles.js +3 -3
  44. package/dist/components/MobileTableOfContents.styles.js +2 -2
  45. package/dist/components/PackageVersion.styles.js +1 -1
  46. package/dist/components/PageFrame.styles.js +6 -6
  47. package/dist/components/Pagination.astro +2 -2
  48. package/dist/components/Pagination.styles.js +10 -10
  49. package/dist/components/Preview.astro +3 -4
  50. package/dist/components/Preview.styles.js +2 -2
  51. package/dist/components/Search.styles.js +13 -13
  52. package/dist/components/SearchButton.styles.js +10 -10
  53. package/dist/components/SearchResults.styles.js +21 -31
  54. package/dist/components/SelectPopover.astro +18 -9
  55. package/dist/components/Sidebar.styles.js +58 -49
  56. package/dist/components/SidebarList.astro +9 -6
  57. package/dist/components/SiteLogo.astro +2 -2
  58. package/dist/components/SiteLogo.styles.js +4 -4
  59. package/dist/components/SyntaxHighlight.styles.js +69 -48
  60. package/dist/components/TableOfContents.styles.js +1 -1
  61. package/dist/components/TableOfContentsLayout.styles.js +7 -7
  62. package/dist/components/ThemeSelect.styles.js +12 -12
  63. package/dist/components/TopNavigation.styles.js +1 -1
  64. package/dist/components/VersionSwitcher.styles.js +1 -1
  65. package/dist/components/appearance-bootstrap.js +21 -0
  66. package/dist/components/select-popover-styles.js +14 -14
  67. package/dist/components/tasty-states.js +10 -9
  68. package/dist/eslint-plugin.js +6 -9
  69. package/dist/eslint-plugin.js.map +1 -1
  70. package/dist/index.js +14 -11
  71. package/dist/index.js.map +1 -1
  72. package/dist/markdown/rendered-content.js +2 -2
  73. package/dist/markdown/rendered-content.js.map +1 -1
  74. package/dist/overrides/Header.astro +8 -12
  75. package/dist/overrides/Hero.astro +11 -6
  76. package/dist/overrides/MobileMenuFooter.astro +1 -1
  77. package/dist/overrides/MobileMenuToggle.astro +6 -5
  78. package/dist/overrides/PageFrame.astro +4 -3
  79. package/dist/overrides/Search.astro +22 -15
  80. package/dist/overrides/Sidebar.astro +2 -3
  81. package/dist/overrides/ThemeSelect.astro +2 -2
  82. package/dist/routes/Page.astro +17 -9
  83. package/dist/styling.js +1 -1
  84. package/dist/{tasty-states-_JhxFdK1.js → tasty-states-BIgiJQ3N.js} +7 -10
  85. package/dist/tasty-states-BIgiJQ3N.js.map +1 -0
  86. package/dist/theme/shiki-theme.d.ts.map +1 -1
  87. package/dist/theme/shiki-theme.js +37 -19
  88. package/dist/theme/shiki-theme.js.map +1 -1
  89. package/package.json +3 -3
  90. package/dist/tasty-states-_JhxFdK1.js.map +0 -1
@@ -14,7 +14,7 @@ const containsCurrent = (items: SidebarEntry[]): boolean =>
14
14
  );
15
15
  ---
16
16
 
17
- <ul class:list={{ "top-level": depth === 0 }}>
17
+ <ul>
18
18
  {
19
19
  entries.map((entry, index) => {
20
20
  const groupPath = [...path, `${index}:${entry.label}`];
@@ -30,13 +30,13 @@ const containsCurrent = (items: SidebarEntry[]): boolean =>
30
30
  <span data-element="Badge">{entry.badge}</span>
31
31
  );
32
32
  const label = (
33
- <span class="group-label">
33
+ <span data-element="GroupLabel">
34
34
  <span>{entry.label}</span>
35
35
  {badge}
36
36
  </span>
37
37
  );
38
38
  const caret = (
39
- <svg class="sidebar-caret" viewBox="0 0 16 16" aria-hidden="true">
39
+ <svg data-element="Caret" viewBox="0 0 16 16" aria-hidden="true">
40
40
  <path
41
41
  d="m6 4 4 4-4 4"
42
42
  fill="none"
@@ -48,20 +48,23 @@ const containsCurrent = (items: SidebarEntry[]): boolean =>
48
48
  </svg>
49
49
  );
50
50
  return (
51
- <li>
51
+ <li
52
+ data-top-level={depth === 0 ? "" : undefined}
53
+ data-section={depth === 0 && entry.type === "group" ? "" : undefined}
54
+ >
52
55
  {entry.type === "link" ? (
53
56
  <a
54
57
  {...entry.attrs}
55
58
  href={entry.href}
56
59
  aria-current={entry.isCurrent ? "page" : undefined}
57
- class:list={[entry.attrs.class, { large: depth === 0 }]}
60
+ data-top-level={depth === 0 ? "" : undefined}
58
61
  >
59
62
  <span>{entry.label}</span>
60
63
  {badge}
61
64
  </a>
62
65
  ) : depth === 0 ? (
63
66
  <>
64
- <h2 class="sidebar-section-label group-label">
67
+ <h2 data-element="SectionHeading">
65
68
  {groupLink ? (
66
69
  <a
67
70
  {...groupLink.attrs}
@@ -15,7 +15,7 @@ const logo = content.logo;
15
15
  aria-hidden={logo.decorative ? "true" : undefined}
16
16
  >
17
17
  <img
18
- class={logo.dark ? "td-site-logo__light" : undefined}
18
+ data-element={logo.dark ? "Light" : undefined}
19
19
  src={logo.light.src}
20
20
  width={logo.light.width}
21
21
  height={logo.light.height}
@@ -24,7 +24,7 @@ const logo = content.logo;
24
24
  />
25
25
  {logo.dark && (
26
26
  <img
27
- class="td-site-logo__dark"
27
+ data-element="Dark"
28
28
  src={logo.dark.src}
29
29
  width={logo.dark.width}
30
30
  height={logo.dark.height}
@@ -11,8 +11,8 @@ export const SiteLogoRoot = defineComponent("SiteLogo", {
11
11
  alignItems: "center",
12
12
  justifyContent: "center",
13
13
  flexShrink: 0,
14
- inlineSize: { "": "auto max 12rem", "@mobile": "auto max 30vw" },
15
- blockSize: { "": "2rem", "@mobile": "1.75rem" },
14
+ inlineSize: { "": "auto max 12rem", "!@md": "auto max 30vw" },
15
+ blockSize: { "": "2rem", "!@md": "1.75rem" },
16
16
  Image: {
17
17
  $: "> img",
18
18
  display: "block",
@@ -21,11 +21,11 @@ export const SiteLogoRoot = defineComponent("SiteLogo", {
21
21
  objectFit: "contain",
22
22
  },
23
23
  Light: {
24
- $: "> .td-site-logo__light",
24
+ $: "> Light",
25
25
  hide: { "": false, "@dark": true },
26
26
  },
27
27
  Dark: {
28
- $: "> .td-site-logo__dark",
28
+ $: "> Dark",
29
29
  hide: { "": true, "@dark": false },
30
30
  },
31
31
  },
@@ -11,75 +11,96 @@ export function SyntaxHighlightStyles() {
11
11
  resolveComponentStyles("SyntaxHighlight", {
12
12
  color: {
13
13
  "": null,
14
- ".td-syntax-comment": "#syntax-comment",
15
- ".td-syntax-punctuation": "#syntax-punctuation",
16
- ".td-syntax-keyword": "#syntax-keyword",
17
- ".td-syntax-string": "#syntax-string",
18
- ".td-syntax-token": "#syntax-token",
19
- ".td-syntax-property": "#syntax-property",
20
- ".td-syntax-number": "#syntax-number",
21
- ".td-syntax-function": "#syntax-function",
22
- ".td-syntax-value": "#syntax-value",
23
- ".td-syntax-operator": "#syntax-operator",
24
- ".td-syntax-text": "#syntax-text",
25
- ".td-green-text": "#green-text",
26
- ".td-red-text": "#red-text",
27
- },
28
- fill: { "": null, ".td-syntax-bg": "#syntax-bg" },
29
- overflowX: { "": null, ".td-syntax-scroll": "auto" },
30
- whiteSpace: { "": null, ".td-syntax-wrap": "pre-wrap" },
31
- overflowWrap: { "": null, ".td-syntax-wrap": "break-word" },
14
+ "[data-syntax-comment]": "#syntax-comment",
15
+ "[data-syntax-punctuation]": "#syntax-punctuation",
16
+ "[data-syntax-keyword]": "#syntax-keyword",
17
+ "[data-syntax-string]": "#syntax-string",
18
+ "[data-syntax-token]": "#syntax-token",
19
+ "[data-syntax-property]": "#syntax-property",
20
+ "[data-syntax-number]": "#syntax-number",
21
+ "[data-syntax-function]": "#syntax-function",
22
+ "[data-syntax-value]": "#syntax-value",
23
+ "[data-syntax-operator]": "#syntax-operator",
24
+ "[data-syntax-text]": "#syntax-text",
25
+ "[data-green-text]": "#green-text",
26
+ "[data-red-text]": "#red-text",
27
+ },
28
+ fill: { "": null, "[data-syntax-bg]": "#syntax-bg" },
29
+ overflowX: { "": null, "[data-syntax-scroll]": "auto" },
30
+ whiteSpace: { "": null, "[data-syntax-wrap]": "pre-wrap" },
31
+ overflowWrap: { "": null, "[data-syntax-wrap]": "break-word" },
32
32
  // Descendant identities stay neutral so these rules retain their original weight.
33
- Marker: { $: ":where(.td-syntax-marker)", userSelect: "none" },
33
+ Marker: {
34
+ $: ":where(span)",
35
+ userSelect: { "": null, "@own(syntax-marker)": "none" },
36
+ },
34
37
  Comment: {
35
- $: ":where(.td-syntax-comment)",
36
- color: "#syntax-comment",
38
+ $: ":where(span)",
39
+ color: { "": null, "@own(syntax-comment)": "#syntax-comment" },
37
40
  },
38
41
  Punctuation: {
39
- $: ":where(.td-syntax-punctuation)",
40
- color: "#syntax-punctuation",
42
+ $: ":where(span)",
43
+ color: { "": null, "@own(syntax-punctuation)": "#syntax-punctuation" },
41
44
  },
42
45
  Keyword: {
43
- $: ":where(.td-syntax-keyword)",
44
- color: "#syntax-keyword",
46
+ $: ":where(span)",
47
+ color: { "": null, "@own(syntax-keyword)": "#syntax-keyword" },
45
48
  },
46
49
  String: {
47
- $: ":where(.td-syntax-string)",
48
- color: "#syntax-string",
50
+ $: ":where(span)",
51
+ color: { "": null, "@own(syntax-string)": "#syntax-string" },
49
52
  },
50
53
  Token: {
51
- $: ":where(.td-syntax-token)",
52
- color: "#syntax-token",
54
+ $: ":where(span)",
55
+ color: { "": null, "@own(syntax-token)": "#syntax-token" },
53
56
  },
54
57
  Property: {
55
- $: ":where(.td-syntax-property)",
56
- color: "#syntax-property",
58
+ $: ":where(span)",
59
+ color: { "": null, "@own(syntax-property)": "#syntax-property" },
57
60
  },
58
61
  Number: {
59
- $: ":where(.td-syntax-number)",
60
- color: "#syntax-number",
62
+ $: ":where(span)",
63
+ color: { "": null, "@own(syntax-number)": "#syntax-number" },
61
64
  },
62
65
  Function: {
63
- $: ":where(.td-syntax-function)",
64
- color: "#syntax-function",
66
+ $: ":where(span)",
67
+ color: { "": null, "@own(syntax-function)": "#syntax-function" },
65
68
  },
66
69
  Value: {
67
- $: ":where(.td-syntax-value)",
68
- color: "#syntax-value",
70
+ $: ":where(span)",
71
+ color: { "": null, "@own(syntax-value)": "#syntax-value" },
69
72
  },
70
73
  Operator: {
71
- $: ":where(.td-syntax-operator)",
72
- color: "#syntax-operator",
73
- },
74
- Text: { $: ":where(.td-syntax-text)", color: "#syntax-text" },
75
- Bg: { $: ":where(.td-syntax-bg)", fill: "#syntax-bg" },
76
- Inserted: { $: ":where(.td-green-text)", color: "#green-text" },
77
- Deleted: { $: ":where(.td-red-text)", color: "#red-text" },
78
- Italic: { $: ":where(.td-syntax-italic)", preset: "italic" },
79
- Strong: { $: ":where(.td-syntax-strong)", preset: "strong" },
74
+ $: ":where(span)",
75
+ color: { "": null, "@own(syntax-operator)": "#syntax-operator" },
76
+ },
77
+ Text: {
78
+ $: ":where(span)",
79
+ color: { "": null, "@own(syntax-text)": "#syntax-text" },
80
+ },
81
+ Bg: {
82
+ $: ":where(span)",
83
+ fill: { "": null, "@own(syntax-bg)": "#syntax-bg" },
84
+ },
85
+ Inserted: {
86
+ $: ":where(span)",
87
+ color: { "": null, "@own(green-text)": "#green-text" },
88
+ },
89
+ Deleted: {
90
+ $: ":where(span)",
91
+ color: { "": null, "@own(red-text)": "#red-text" },
92
+ },
93
+ Italic: {
94
+ $: ":where(span)",
95
+ preset: { "": null, "@own(syntax-italic)": "italic" },
96
+ },
97
+ Strong: {
98
+ $: ":where(span)",
99
+ preset: { "": null, "@own(syntax-strong)": "strong" },
100
+ },
80
101
  Underline: {
81
- $: ":where(.td-syntax-underline)",
82
- textDecoration: "underline",
102
+ $: ":where(span)",
103
+ textDecoration: { "": null, "@own(syntax-underline)": "underline" },
83
104
  },
84
105
  }),
85
106
  );
@@ -8,7 +8,7 @@ export const TableOfContentsRoot = defineComponent("TableOfContents", {
8
8
  "data-element": "TableOfContents",
9
9
  styles: {
10
10
  display: "block",
11
- hide: { "": false, "@narrow-layout": true },
11
+ hide: { "": false, "!@lg": true },
12
12
  blockPadding: "($gap * 4) start",
13
13
  inlinePadding: "$docs-sidebar-pad-x",
14
14
  Heading: {
@@ -12,25 +12,25 @@ export const TableOfContentsLayoutRoot = defineComponent(
12
12
  display: { "": "", ":has(cookbook-mobile-toc)": "block" },
13
13
  hide: {
14
14
  "": false,
15
- "@narrow-layout": true,
15
+ "!@lg": true,
16
16
  ":has(cookbook-mobile-toc)": false,
17
17
  },
18
- order: { "": "2", "@narrow-layout": "0" },
18
+ order: { "": "2", "!@lg": "0" },
19
19
  position: "relative",
20
20
  inlineSize: {
21
21
  "": "max($sidebar-width, calc($sidebar-width + (100% - $content-width - $sidebar-width) / 2))",
22
- "@narrow-layout": "100%",
22
+ "!@lg": "100%",
23
23
  },
24
24
  Content: {
25
- $: ".right-sidebar",
26
- position: { "": "sticky", "@narrow-layout": "static" },
25
+ $: "Content",
26
+ position: { "": "sticky", "!@lg": "static" },
27
27
  blockInset: "$docs-nav-height start",
28
28
  inlineSize: "100%",
29
29
  blockSize: {
30
30
  "": "(100vh - $docs-nav-height)",
31
- "@narrow-layout": "auto",
31
+ "!@lg": "auto",
32
32
  },
33
- overflowY: { "": "auto", "@narrow-layout": "visible" },
33
+ overflowY: { "": "auto", "!@lg": "visible" },
34
34
  scrollbar: "none",
35
35
  },
36
36
  },
@@ -16,11 +16,11 @@ export const ThemeSelectRoot = defineComponent("ThemeSelect", {
16
16
  placeItems: "center",
17
17
  inlineSize: {
18
18
  "": "$control-height",
19
- "@mobile": "$docs-menu-button-size",
19
+ "!@md": "$docs-menu-button-size",
20
20
  },
21
21
  blockSize: {
22
22
  "": "$control-height",
23
- "@mobile": "$docs-menu-button-size",
23
+ "!@md": "$docs-menu-button-size",
24
24
  },
25
25
  padding: "0",
26
26
  color: "#text-soft",
@@ -33,11 +33,11 @@ export const ThemeSelectRoot = defineComponent("ThemeSelect", {
33
33
  $: "> button",
34
34
  color: {
35
35
  "": null,
36
- "@own(:hover) | :has([popover]:popover-open)": "#text",
36
+ "@own(:hover) | :has([popover]:is(:popover-open))": "#text",
37
37
  },
38
38
  fill: {
39
39
  "": null,
40
- "@own(:hover) | :has([popover]:popover-open)": "#surface-2-hover",
40
+ "@own(:hover) | :has([popover]:is(:popover-open))": "#surface-2-hover",
41
41
  },
42
42
  },
43
43
  ActiveTrigger: {
@@ -48,14 +48,14 @@ export const ThemeSelectRoot = defineComponent("ThemeSelect", {
48
48
  Icon: {
49
49
  $: "> button svg",
50
50
  display: "block",
51
- inlineSize: { "": "1.25rem", "@mobile": "1.125rem" },
52
- blockSize: { "": "1.25rem", "@mobile": "1.125rem" },
51
+ inlineSize: { "": "1.25rem", "!@md": "1.125rem" },
52
+ blockSize: { "": "1.25rem", "!@md": "1.125rem" },
53
53
  },
54
54
  Panel: {
55
55
  $: "Panel",
56
56
  position: "fixed",
57
57
  inset: "auto",
58
- blockInset: { "": "4rem start", "@mobile": "3.5rem start" },
58
+ blockInset: { "": "4rem start", "!@md": "3.5rem start" },
59
59
  inlineInset:
60
60
  "max($docs-nav-pad-x, ((100vw - $layout-width) / 2 + $docs-sidebar-pad-x)) end",
61
61
  inlineSize: "min(15rem, calc(100vw - 2 * $docs-nav-pad-x))",
@@ -81,9 +81,9 @@ export const ThemeSelectRoot = defineComponent("ThemeSelect", {
81
81
  $: '[data-element="Panel"]',
82
82
  opacity: {
83
83
  "": null,
84
- "@own(@popover-open & [data-open])": "1",
84
+ "@own(:is(:popover-open) & [data-open])": "1",
85
85
  },
86
- scale: { "": null, "@own(@popover-open & [data-open])": "1" },
86
+ scale: { "": null, "@own(:is(:popover-open) & [data-open])": "1" },
87
87
  },
88
88
  Section: {
89
89
  $: "fieldset",
@@ -164,15 +164,15 @@ export const ThemeSelectRoot = defineComponent("ThemeSelect", {
164
164
  $: "label > svg",
165
165
  inlineMargin: {
166
166
  "": null,
167
- "@own(:is(label > svg:last-child))": "auto start",
167
+ "@own(:last-child)": "auto start",
168
168
  },
169
- visibility: { "": null, "@own(:is(label > svg:last-child))": "hidden" },
169
+ visibility: { "": null, "@own(:last-child)": "hidden" },
170
170
  },
171
171
  SelectedCheckmark: {
172
172
  $: "label > svg",
173
173
  visibility: {
174
174
  "": null,
175
- "@own(:is(label:has(input:checked) > svg:last-child))": "visible",
175
+ "@own(:last-child & :is(:has(input:checked) >))": "visible",
176
176
  },
177
177
  },
178
178
  },
@@ -8,7 +8,7 @@ export const TopNavigationRoot = defineComponent("TopNavigation", {
8
8
  "data-element": "TopNavigation",
9
9
  styles: {
10
10
  display: "flex",
11
- hide: { "": false, "@mobile": true },
11
+ hide: { "": false, "!@md": true },
12
12
  alignItems: "stretch",
13
13
  gap: "clamp(1.25rem, 2.5vw, 2.5rem)",
14
14
  inlineSize: "100%",
@@ -38,7 +38,7 @@ export const VersionSwitcherRoot = defineComponent("VersionSwitcher", {
38
38
  blockInset: "(anchor(bottom) + $gap) start, auto end",
39
39
  inlineInset: {
40
40
  "": "anchor(left) start, auto end",
41
- "@mobile": "auto start, anchor(right) end",
41
+ "!@md": "auto start, anchor(right) end",
42
42
  },
43
43
  },
44
44
  },
@@ -0,0 +1,21 @@
1
+ // Kept dependency-free for the page shell's synchronous, pre-paint script.
2
+ (() => {
3
+ const root = globalThis.document.documentElement;
4
+ try {
5
+ const scheme = globalThis.localStorage.getItem("cookbook-theme");
6
+ if (scheme === "light" || scheme === "dark") root.dataset.theme = scheme;
7
+ else delete root.dataset.theme;
8
+ } catch {
9
+ // Without storage, the document's system appearance rules remain active.
10
+ }
11
+ try {
12
+ const appearance = JSON.parse(
13
+ globalThis.localStorage.getItem("cookbook-appearance") ?? "{}",
14
+ );
15
+ if (appearance?.contrast === "normal" || appearance?.contrast === "more")
16
+ root.dataset.contrast = appearance.contrast;
17
+ else delete root.dataset.contrast;
18
+ } catch {
19
+ // Malformed or unavailable storage must not prevent the first paint.
20
+ }
21
+ })();
@@ -21,21 +21,21 @@ export function selectPopoverStyles({
21
21
  $: "> button",
22
22
  color: {
23
23
  "": null,
24
- "@own(:hover) | :has([popover]:popover-open)": "#text",
24
+ "@own(:hover) | :has([popover]:is(:popover-open))": "#text",
25
25
  },
26
26
  fill: {
27
27
  "": null,
28
- "@own(:hover) | :has([popover]:popover-open)": "#surface-2-hover",
28
+ "@own(:hover) | :has([popover]:is(:popover-open))": "#surface-2-hover",
29
29
  },
30
30
  },
31
31
  TriggerLabel: {
32
- $: ".trigger-label",
32
+ $: "TriggerLabel",
33
33
  overflow: "hidden",
34
34
  textOverflow: "ellipsis",
35
35
  whiteSpace: "nowrap",
36
36
  },
37
37
  Caret: {
38
- $: "> button > .caret",
38
+ $: "> button > Caret",
39
39
  flexShrink: "0",
40
40
  inlineSize: "0.875rem",
41
41
  blockSize: "0.875rem",
@@ -67,12 +67,12 @@ export function selectPopoverStyles({
67
67
  $: '> [data-element="Panel"]',
68
68
  opacity: {
69
69
  "": null,
70
- "@own(@popover-open & [data-open])": "1",
70
+ "@own(:is(:popover-open) & [data-open])": "1",
71
71
  },
72
- scale: { "": null, "@own(@popover-open & [data-open])": "1" },
72
+ scale: { "": null, "@own(:is(:popover-open) & [data-open])": "1" },
73
73
  },
74
74
  PanelTitle: {
75
- $: ".panel-title",
75
+ $: "PanelTitle",
76
76
  padding: "($gap * 0.75) $gap",
77
77
  color: "#text-muted",
78
78
  preset: "small / strong",
@@ -92,22 +92,22 @@ export function selectPopoverStyles({
92
92
  },
93
93
  [hoverOption]: {
94
94
  $: "nav a",
95
- color: { "": null, "@own(:is(nav a:hover))": "#text" },
96
- fill: { "": null, "@own(:is(nav a:hover))": "#surface-2-hover" },
95
+ color: { "": null, "@own(:hover)": "#text" },
96
+ fill: { "": null, "@own(:hover)": "#surface-2-hover" },
97
97
  },
98
98
  [currentOption]: {
99
99
  $: "nav a",
100
100
  color: {
101
101
  "": null,
102
- '@own(:is(nav a[aria-current="page"]))': "#accent-text",
102
+ '@own([aria-current="page"])': "#accent-text",
103
103
  },
104
104
  fill: {
105
105
  "": null,
106
- '@own(:is(nav a[aria-current="page"]))': "#accent-surface-2-subtle",
106
+ '@own([aria-current="page"])': "#accent-surface-2-subtle",
107
107
  },
108
108
  },
109
109
  Checkmark: {
110
- $: "nav a > .checkmark",
110
+ $: "nav a > Checkmark",
111
111
  flexShrink: "0",
112
112
  inlineMargin: "auto start",
113
113
  inlineSize: "1rem",
@@ -115,10 +115,10 @@ export function selectPopoverStyles({
115
115
  visibility: "hidden",
116
116
  },
117
117
  SelectedCheckmark: {
118
- $: "nav a > .checkmark",
118
+ $: "nav a > [data-element=Checkmark]",
119
119
  visibility: {
120
120
  "": null,
121
- '@own(:is(nav a[aria-current="page"] > .checkmark))': "visible",
121
+ '@own(:is([aria-current="page"] >))': "visible",
122
122
  },
123
123
  },
124
124
  };
@@ -13,16 +13,17 @@ export const cookbookStates = {
13
13
  "@system-dark": systemDark,
14
14
  "@light": `@root(theme=light) | (!@root(theme) & ${systemLight})`,
15
15
  "@dark": `@root(theme=dark) | (!@root(theme) & ${systemDark})`,
16
- "@mobile": "@media(w < 50rem)",
17
- "@desktop": "@media(w >= 50rem)",
18
- "@small": "@media(w <= 40rem)",
19
- "@compact": "@media(w <= 23rem)",
20
- "@shell-mobile": "@media(w <= 48rem)",
21
- "@shell-desktop": "@media(w > 48rem)",
22
- "@narrow-layout": "@media(w < 72rem)",
23
- "@medium-layout": "@media(w >= 50rem) & @media(w < 72rem)",
16
+ "@sm": "@media(w > 40rem)",
17
+ "@md": "@media(w >= 50rem)",
18
+ "@lg": "@media(w >= 72rem)",
24
19
  "@reduced-motion": "@media(prefers-reduced-motion: reduce)",
25
- "@popover-open": ":is(:popover-open)",
20
+ // Check each selected element's ancestry so isolated sections do not affect
21
+ // surrounding prose in the same Markdown root.
22
+ "@prose": "@own(!:is([data-not-content] *))",
23
+ "@prose-block":
24
+ "@own(!:is([data-not-content] *)) & (@own(block) | @own(!:is(a,strong,em,del,span,input,code,br,li,dt,dd))) & (@own(:is(:not(a,strong,em,del,span,input,code,br) + *)) | @own(:is([data-block] + *)))",
25
+ "@prose-heading":
26
+ "@own(!:is([data-not-content] *)) & @own(!:is(h1 + *,h2 + *,h3 + *,h4 + *,h5 + *,h6 + *,[data-heading] + *))",
26
27
  };
27
28
 
28
29
  let configured = false;
@@ -126,16 +126,13 @@ var tasty_config_default = {
126
126
  "@system-dark",
127
127
  "@light",
128
128
  "@dark",
129
- "@mobile",
130
- "@desktop",
131
- "@small",
132
- "@compact",
133
- "@shell-mobile",
134
- "@shell-desktop",
135
- "@narrow-layout",
136
- "@medium-layout",
129
+ "@sm",
130
+ "@md",
131
+ "@lg",
137
132
  "@reduced-motion",
138
- "@popover-open"
133
+ "@prose",
134
+ "@prose-block",
135
+ "@prose-heading"
139
136
  ],
140
137
  presets: [
141
138
  "body",
@@ -1 +1 @@
1
- {"version":3,"file":"eslint-plugin.js","names":["validationConfig"],"sources":["../src/tasty.config.ts","../src/eslint-plugin.ts"],"sourcesContent":["import type { TastyValidationConfig } from \"@tenphi/eslint-plugin-tasty\";\n\nexport default {\n importSources: [\n \"@tenphi/cookbook/styling\",\n \"@tenphi/renderer/styling\",\n \"./component-styles.js\",\n \"../define-component.js\",\n ],\n styleFunctions: {\n defineComponent: { argument: 1, kind: \"options\" },\n extendComponent: { argument: 2, kind: \"options\", partial: true },\n resolveComponentStyles: { argument: 1, kind: \"styles\" },\n mergeStyles: { argument: \"all\", kind: \"styles\", partial: true },\n },\n tokens: [\n \"$gap\",\n \"$margin-block-start\",\n \"$margin-block-end\",\n \"$padding-block-start\",\n \"$padding-block-end\",\n \"$radius\",\n \"$header-control-radius\",\n \"$card-radius\",\n \"$border-width\",\n \"$outline-width\",\n \"$outline-offset\",\n \"$layout-width\",\n \"$content-width\",\n \"$sidebar-width\",\n \"$control-height\",\n \"$transition\",\n \"$sharp-radius\",\n \"$bold-font-weight\",\n \"#white\",\n \"#black\",\n \"#clear\",\n \"#current\",\n \"#surface\",\n \"#header\",\n \"#heading\",\n \"#surface-2\",\n \"#surface-3\",\n \"#surface-2-hover\",\n \"#surface-2-pressed\",\n \"#surface-3-hover\",\n \"#surface-3-pressed\",\n \"#text\",\n \"#text-soft\",\n \"#text-muted\",\n \"#sidebar-text\",\n \"#border\",\n \"#border-strong\",\n \"#accent-text\",\n \"#accent-surface\",\n \"#accent-surface-text\",\n \"#logo-surface\",\n \"#logo-mark\",\n \"#accent-surface-subtle\",\n \"#accent-surface-2-subtle\",\n \"#focus\",\n \"#shadow\",\n \"#overlay\",\n \"#syntax-bg\",\n \"#syntax-text\",\n \"#syntax-comment\",\n \"#syntax-punctuation\",\n \"#syntax-keyword\",\n \"#syntax-string\",\n \"#syntax-token\",\n \"#syntax-property\",\n \"#syntax-number\",\n \"#syntax-function\",\n \"#syntax-value\",\n \"#syntax-operator\",\n \"#info\",\n \"#info-surface\",\n \"#info-text\",\n \"#success\",\n \"#success-surface\",\n \"#success-text\",\n \"#warning\",\n \"#warning-surface\",\n \"#warning-text\",\n \"#danger\",\n \"#danger-surface\",\n \"#danger-text\",\n \"#orange-surface\",\n \"#orange\",\n \"#orange-text\",\n \"#green-surface\",\n \"#green\",\n \"#green-text\",\n \"#blue-surface\",\n \"#blue\",\n \"#blue-text\",\n \"#purple-surface\",\n \"#purple\",\n \"#purple-text\",\n \"#red-surface\",\n \"#red\",\n \"#red-text\",\n ],\n units: [\"x\", \"r\", \"cr\", \"bw\"],\n states: [\n \"@system-light\",\n \"@system-dark\",\n \"@light\",\n \"@dark\",\n \"@mobile\",\n \"@desktop\",\n \"@small\",\n \"@compact\",\n \"@shell-mobile\",\n \"@shell-desktop\",\n \"@narrow-layout\",\n \"@medium-layout\",\n \"@reduced-motion\",\n \"@popover-open\",\n ],\n presets: [\n \"body\",\n \"heading\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n \"h6\",\n \"navigation\",\n \"small\",\n \"code\",\n \"hero-title\",\n \"hero-tagline\",\n \"prose\",\n \"inline-code\",\n ],\n} satisfies TastyValidationConfig;\n","export { default, recommended, strict } from \"@tenphi/eslint-plugin-tasty\";\nexport type {\n ResolvedConfig,\n StyleFunctionConfig,\n TastyValidationConfig,\n} from \"@tenphi/eslint-plugin-tasty\";\nexport { default as validationConfig } from \"./tasty.config.js\";\n\nimport type { ThemeConfig } from \"@tenphi/docs\";\nimport type { TastyValidationConfig } from \"@tenphi/eslint-plugin-tasty\";\nimport validationConfig from \"./tasty.config.js\";\n\n/** Keep editor/linter names aligned with a Cookbook theme. */\nexport function createValidationConfig(\n theme: ThemeConfig = {},\n): TastyValidationConfig {\n return {\n ...validationConfig,\n tokens: [\n ...validationConfig.tokens,\n ...Object.keys(theme.tokens ?? {}),\n ...Object.keys(theme.palette ?? {}).map((name) => `#${name}`),\n ],\n units: [...validationConfig.units, ...Object.keys(theme.units ?? {})],\n states: [...validationConfig.states, ...Object.keys(theme.states ?? {})],\n presets: [...validationConfig.presets, ...Object.keys(theme.presets ?? {})],\n recipes: Object.keys(theme.recipes ?? {}),\n };\n}\n"],"mappings":";;AAEA,IAAA,uBAAe;CACb,eAAe;EACb;EACA;EACA;EACA;CACF;CACA,gBAAgB;EACd,iBAAiB;GAAE,UAAU;GAAG,MAAM;EAAU;EAChD,iBAAiB;GAAE,UAAU;GAAG,MAAM;GAAW,SAAS;EAAK;EAC/D,wBAAwB;GAAE,UAAU;GAAG,MAAM;EAAS;EACtD,aAAa;GAAE,UAAU;GAAO,MAAM;GAAU,SAAS;EAAK;CAChE;CACA,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,OAAO;EAAC;EAAK;EAAK;EAAM;CAAI;CAC5B,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,SAAS;EACP;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF;;;;AC5HA,SAAgB,uBACd,QAAqB,CAAC,GACC;CACvB,OAAO;EACL,GAAGA;EACH,QAAQ;GACN,GAAGA,qBAAiB;GACpB,GAAG,OAAO,KAAK,MAAM,UAAU,CAAC,CAAC;GACjC,GAAG,OAAO,KAAK,MAAM,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK,SAAS,IAAI,MAAM;EAC9D;EACA,OAAO,CAAC,GAAGA,qBAAiB,OAAO,GAAG,OAAO,KAAK,MAAM,SAAS,CAAC,CAAC,CAAC;EACpE,QAAQ,CAAC,GAAGA,qBAAiB,QAAQ,GAAG,OAAO,KAAK,MAAM,UAAU,CAAC,CAAC,CAAC;EACvE,SAAS,CAAC,GAAGA,qBAAiB,SAAS,GAAG,OAAO,KAAK,MAAM,WAAW,CAAC,CAAC,CAAC;EAC1E,SAAS,OAAO,KAAK,MAAM,WAAW,CAAC,CAAC;CAC1C;AACF"}
1
+ {"version":3,"file":"eslint-plugin.js","names":["validationConfig"],"sources":["../src/tasty.config.ts","../src/eslint-plugin.ts"],"sourcesContent":["import type { TastyValidationConfig } from \"@tenphi/eslint-plugin-tasty\";\n\nexport default {\n importSources: [\n \"@tenphi/cookbook/styling\",\n \"@tenphi/renderer/styling\",\n \"./component-styles.js\",\n \"../define-component.js\",\n ],\n styleFunctions: {\n defineComponent: { argument: 1, kind: \"options\" },\n extendComponent: { argument: 2, kind: \"options\", partial: true },\n resolveComponentStyles: { argument: 1, kind: \"styles\" },\n mergeStyles: { argument: \"all\", kind: \"styles\", partial: true },\n },\n tokens: [\n \"$gap\",\n \"$margin-block-start\",\n \"$margin-block-end\",\n \"$padding-block-start\",\n \"$padding-block-end\",\n \"$radius\",\n \"$header-control-radius\",\n \"$card-radius\",\n \"$border-width\",\n \"$outline-width\",\n \"$outline-offset\",\n \"$layout-width\",\n \"$content-width\",\n \"$sidebar-width\",\n \"$control-height\",\n \"$transition\",\n \"$sharp-radius\",\n \"$bold-font-weight\",\n \"#white\",\n \"#black\",\n \"#clear\",\n \"#current\",\n \"#surface\",\n \"#header\",\n \"#heading\",\n \"#surface-2\",\n \"#surface-3\",\n \"#surface-2-hover\",\n \"#surface-2-pressed\",\n \"#surface-3-hover\",\n \"#surface-3-pressed\",\n \"#text\",\n \"#text-soft\",\n \"#text-muted\",\n \"#sidebar-text\",\n \"#border\",\n \"#border-strong\",\n \"#accent-text\",\n \"#accent-surface\",\n \"#accent-surface-text\",\n \"#logo-surface\",\n \"#logo-mark\",\n \"#accent-surface-subtle\",\n \"#accent-surface-2-subtle\",\n \"#focus\",\n \"#shadow\",\n \"#overlay\",\n \"#syntax-bg\",\n \"#syntax-text\",\n \"#syntax-comment\",\n \"#syntax-punctuation\",\n \"#syntax-keyword\",\n \"#syntax-string\",\n \"#syntax-token\",\n \"#syntax-property\",\n \"#syntax-number\",\n \"#syntax-function\",\n \"#syntax-value\",\n \"#syntax-operator\",\n \"#info\",\n \"#info-surface\",\n \"#info-text\",\n \"#success\",\n \"#success-surface\",\n \"#success-text\",\n \"#warning\",\n \"#warning-surface\",\n \"#warning-text\",\n \"#danger\",\n \"#danger-surface\",\n \"#danger-text\",\n \"#orange-surface\",\n \"#orange\",\n \"#orange-text\",\n \"#green-surface\",\n \"#green\",\n \"#green-text\",\n \"#blue-surface\",\n \"#blue\",\n \"#blue-text\",\n \"#purple-surface\",\n \"#purple\",\n \"#purple-text\",\n \"#red-surface\",\n \"#red\",\n \"#red-text\",\n ],\n units: [\"x\", \"r\", \"cr\", \"bw\"],\n states: [\n \"@system-light\",\n \"@system-dark\",\n \"@light\",\n \"@dark\",\n \"@sm\",\n \"@md\",\n \"@lg\",\n \"@reduced-motion\",\n \"@prose\",\n \"@prose-block\",\n \"@prose-heading\",\n ],\n presets: [\n \"body\",\n \"heading\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n \"h6\",\n \"navigation\",\n \"small\",\n \"code\",\n \"hero-title\",\n \"hero-tagline\",\n \"prose\",\n \"inline-code\",\n ],\n} satisfies TastyValidationConfig;\n","export { default, recommended, strict } from \"@tenphi/eslint-plugin-tasty\";\nexport type {\n ResolvedConfig,\n StyleFunctionConfig,\n TastyValidationConfig,\n} from \"@tenphi/eslint-plugin-tasty\";\nexport { default as validationConfig } from \"./tasty.config.js\";\n\nimport type { ThemeConfig } from \"@tenphi/docs\";\nimport type { TastyValidationConfig } from \"@tenphi/eslint-plugin-tasty\";\nimport validationConfig from \"./tasty.config.js\";\n\n/** Keep editor/linter names aligned with a Cookbook theme. */\nexport function createValidationConfig(\n theme: ThemeConfig = {},\n): TastyValidationConfig {\n return {\n ...validationConfig,\n tokens: [\n ...validationConfig.tokens,\n ...Object.keys(theme.tokens ?? {}),\n ...Object.keys(theme.palette ?? {}).map((name) => `#${name}`),\n ],\n units: [...validationConfig.units, ...Object.keys(theme.units ?? {})],\n states: [...validationConfig.states, ...Object.keys(theme.states ?? {})],\n presets: [...validationConfig.presets, ...Object.keys(theme.presets ?? {})],\n recipes: Object.keys(theme.recipes ?? {}),\n };\n}\n"],"mappings":";;AAEA,IAAA,uBAAe;CACb,eAAe;EACb;EACA;EACA;EACA;CACF;CACA,gBAAgB;EACd,iBAAiB;GAAE,UAAU;GAAG,MAAM;EAAU;EAChD,iBAAiB;GAAE,UAAU;GAAG,MAAM;GAAW,SAAS;EAAK;EAC/D,wBAAwB;GAAE,UAAU;GAAG,MAAM;EAAS;EACtD,aAAa;GAAE,UAAU;GAAO,MAAM;GAAU,SAAS;EAAK;CAChE;CACA,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,OAAO;EAAC;EAAK;EAAK;EAAM;CAAI;CAC5B,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,SAAS;EACP;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF;;;;ACzHA,SAAgB,uBACd,QAAqB,CAAC,GACC;CACvB,OAAO;EACL,GAAGA;EACH,QAAQ;GACN,GAAGA,qBAAiB;GACpB,GAAG,OAAO,KAAK,MAAM,UAAU,CAAC,CAAC;GACjC,GAAG,OAAO,KAAK,MAAM,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK,SAAS,IAAI,MAAM;EAC9D;EACA,OAAO,CAAC,GAAGA,qBAAiB,OAAO,GAAG,OAAO,KAAK,MAAM,SAAS,CAAC,CAAC,CAAC;EACpE,QAAQ,CAAC,GAAGA,qBAAiB,QAAQ,GAAG,OAAO,KAAK,MAAM,UAAU,CAAC,CAAC,CAAC;EACvE,SAAS,CAAC,GAAGA,qBAAiB,SAAS,GAAG,OAAO,KAAK,MAAM,WAAW,CAAC,CAAC,CAAC;EAC1E,SAAS,OAAO,KAAK,MAAM,WAAW,CAAC,CAAC;CAC1C;AACF"}