@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,309 @@
1
+ import { configureCookbookStates } from "./tasty-states.js";
2
+ import { defineComponent } from "../define-component.js";
3
+
4
+ configureCookbookStates();
5
+
6
+ export const SidebarRoot = defineComponent("Sidebar", {
7
+ as: "cookbook-sidebar-pane",
8
+ "data-element": "Sidebar",
9
+ styles: {
10
+ "$sidebar-transition": "120ms",
11
+ display: { "@desktop": "block" },
12
+ visibility: {
13
+ "": "visible",
14
+ "@mobile": "hidden",
15
+ "@popover-open & @mobile": "visible",
16
+ },
17
+ position: "fixed",
18
+ zIndex: { "": "8", "@mobile": "12" },
19
+ blockInset: { "": "$docs-nav-height start, 0 end", "@mobile": "0" },
20
+ inlineInset: {
21
+ "": "0 start, auto end",
22
+ "@desktop": "max(0px, calc((100% - $layout-width) / 2)) start, auto end",
23
+ },
24
+ inlineSize: {
25
+ "": "$sidebar-width",
26
+ "@mobile": "min(22rem, calc(100% - 2rem))",
27
+ },
28
+ blockSize: "auto",
29
+ margin: "0",
30
+ padding: "0",
31
+ border: "0",
32
+ color: "#text",
33
+ overflowY: "auto",
34
+ scrollbar: "auto stable",
35
+ fill: "#surface",
36
+ overscrollBehavior: "contain",
37
+ shadow: { "": "none", "@mobile": "0.25rem 0 1rem #shadow" },
38
+ translate: {
39
+ "": "0",
40
+ "@mobile": "-100% 0",
41
+ "@popover-open & [data-open] & @mobile": "0",
42
+ },
43
+ transition: {
44
+ "": "none",
45
+ "@mobile & !@reduced-motion":
46
+ "translate $sidebar-transition ease-out, visibility $sidebar-transition, display $sidebar-transition allow-discrete, overlay $sidebar-transition allow-discrete",
47
+ },
48
+ Backdrop: {
49
+ $: "&::backdrop",
50
+ fill: "#overlay",
51
+ opacity: "0",
52
+ transition: {
53
+ "": "none",
54
+ "@mobile & !@reduced-motion":
55
+ "opacity $sidebar-transition ease-out, display $sidebar-transition allow-discrete, overlay $sidebar-transition allow-discrete",
56
+ },
57
+ },
58
+ OpenBackdrop: {
59
+ $: "&::backdrop",
60
+ opacity: { "": null, "@popover-open & [data-open]": "1" },
61
+ },
62
+ MobileHeading: {
63
+ $: ".td-sidebar-heading",
64
+ display: "flex",
65
+ hide: { "": true, "@mobile": false },
66
+ alignItems: "center",
67
+ justifyContent: "space-between",
68
+ gap: "$gap",
69
+ },
70
+ HomeLink: {
71
+ display: "flex",
72
+ alignItems: "center",
73
+ textDecoration: "none",
74
+ inlineSize: "min 0",
75
+ padding: "0",
76
+ gap: "$gap",
77
+ color: "#text",
78
+ preset: "h4",
79
+ },
80
+ HomeLogo: {
81
+ $: 'HomeLink > [data-element="Logo"]',
82
+ inlineSize: "2rem",
83
+ blockSize: "2rem",
84
+ },
85
+ HomeLabel: {
86
+ overflow: "hidden",
87
+ textOverflow: "ellipsis",
88
+ whiteSpace: "nowrap",
89
+ },
90
+ Close: {
91
+ $: ".td-sidebar-heading > button",
92
+ display: "grid",
93
+ placeItems: "center",
94
+ flexShrink: "0",
95
+ inlineSize: "$docs-menu-button-size",
96
+ blockSize: "$docs-menu-button-size",
97
+ padding: "0",
98
+ border: "0",
99
+ color: "#text-soft",
100
+ fill: "#clear",
101
+ radius: "$header-control-radius",
102
+ },
103
+ HoverClose: {
104
+ $: ".td-sidebar-heading > button",
105
+ color: {
106
+ "": null,
107
+ "@own(:is(.td-sidebar-heading > button:hover))": "#text",
108
+ },
109
+ fill: {
110
+ "": null,
111
+ "@own(:is(.td-sidebar-heading > button:hover))": "#surface-2-hover",
112
+ },
113
+ },
114
+ CloseIcon: {
115
+ $: ".td-sidebar-heading > button > svg",
116
+ inlineSize: "1.25rem",
117
+ blockSize: "1.25rem",
118
+ },
119
+ CurrentLink: {
120
+ $: "cookbook-sidebar a",
121
+ color: {
122
+ "": null,
123
+ '@own([aria-current="page"])': "#accent-text",
124
+ },
125
+ fill: {
126
+ "": null,
127
+ '@own([aria-current="page"])': "#accent-surface-subtle",
128
+ },
129
+ preset: {
130
+ "": null,
131
+ '@own([aria-current="page"])': "navigation / strong",
132
+ },
133
+ },
134
+ Content: {
135
+ $: ".sidebar-content",
136
+ display: "flex",
137
+ flow: "column",
138
+ blockSize: "min 100%",
139
+ inlinePadding: "$docs-sidebar-pad-x",
140
+ gap: "($gap * 2)",
141
+ blockPadding: {
142
+ "": "($gap * 3) start, ($gap * 6) end",
143
+ "@mobile": "($gap * 2) start, ($gap * 6) end",
144
+ },
145
+ },
146
+ Tree: { $: "cookbook-sidebar", display: "block" },
147
+ List: {
148
+ $: "cookbook-sidebar ul",
149
+ display: "grid",
150
+ gridColumns: "minmax(0, 1fr)",
151
+ gap: "1bw",
152
+ margin: "0",
153
+ padding: "0",
154
+ listStyle: "none",
155
+ },
156
+ Item: { $: "cookbook-sidebar li", overflowWrap: "anywhere" },
157
+ TopLevelSpacing: { $: ".top-level > li + li", blockMargin: "0 start" },
158
+ GroupSpacing: {
159
+ $: ".top-level > li + li",
160
+ blockMargin: {
161
+ "": null,
162
+ "@own(:is(.top-level > li + li:has(> .sidebar-section-label)))":
163
+ "($gap * 2.5) start",
164
+ },
165
+ },
166
+ NestedItem: {
167
+ $: "cookbook-sidebar details > ul > li",
168
+ inlineMargin: "($gap * 1.5) start",
169
+ },
170
+ SectionHeading: {
171
+ $: ".sidebar-section-label",
172
+ margin: "0 0 1bw",
173
+ padding: "($gap * 0.75) ($gap * 1.25)",
174
+ color: "#text",
175
+ preset: "small / strong",
176
+ },
177
+ Control: {
178
+ $: "cookbook-sidebar summary, cookbook-sidebar a",
179
+ blockSize: "min 2.25rem",
180
+ padding: "($gap * 0.75) ($gap * 1.25)",
181
+ color: "#sidebar-text",
182
+ preset: "navigation",
183
+ radius: "$radius",
184
+ textDecoration: "none",
185
+ },
186
+ Summary: {
187
+ $: "cookbook-sidebar summary",
188
+ blockMargin: "1bw end",
189
+ display: "flex",
190
+ alignItems: "center",
191
+ justifyContent: "space-between",
192
+ gap: "1x",
193
+ cursor: "pointer",
194
+ userSelect: "none",
195
+ },
196
+ GroupLabel: {
197
+ $: ".group-label",
198
+ display: "flex",
199
+ alignItems: "center",
200
+ inlineSize: "min 0",
201
+ gap: "0.25em",
202
+ },
203
+ GroupLabelText: {
204
+ $: ".group-label > span",
205
+ inlineSize: {
206
+ "": null,
207
+ "@own(:is(.group-label > span:first-child))": "min 0",
208
+ },
209
+ overflow: {
210
+ "": null,
211
+ "@own(:is(.group-label > span:first-child))": "hidden",
212
+ },
213
+ textOverflow: {
214
+ "": null,
215
+ "@own(:is(.group-label > span:first-child))": "ellipsis",
216
+ },
217
+ whiteSpace: {
218
+ "": null,
219
+ "@own(:is(.group-label > span:first-child))": "nowrap",
220
+ },
221
+ },
222
+ Link: {
223
+ $: "cookbook-sidebar a",
224
+ inlineSize: "0 100% initial",
225
+ display: "flex",
226
+ alignItems: "center",
227
+ gap: "0.25em",
228
+ fill: "#surface",
229
+ preset: "navigation",
230
+ },
231
+ LinkLabel: {
232
+ $: "a > span",
233
+ inlineSize: { "": null, "@own(:is(a > span:first-child))": "min 0" },
234
+ overflow: { "": null, "@own(:is(a > span:first-child))": "hidden" },
235
+ textOverflow: { "": null, "@own(:is(a > span:first-child))": "ellipsis" },
236
+ whiteSpace: { "": null, "@own(:is(a > span:first-child))": "nowrap" },
237
+ },
238
+ InteractiveControl: {
239
+ $: "cookbook-sidebar a, cookbook-sidebar summary",
240
+ color: {
241
+ "": null,
242
+ '@own((:hover | :focus-visible) & ![aria-current="page"])': "#text",
243
+ },
244
+ fill: {
245
+ "": null,
246
+ '@own((:hover | :focus-visible) & ![aria-current="page"])':
247
+ "#surface-2-hover",
248
+ },
249
+ },
250
+ SummaryMarker: {
251
+ $: "cookbook-sidebar summary::marker, summary::-webkit-details-marker",
252
+ hide: true,
253
+ },
254
+ Caret: {
255
+ $: ".sidebar-caret",
256
+ flexShrink: "0",
257
+ inlineSize: "1rem",
258
+ blockSize: "1rem",
259
+ // Tasty and browsers support :dir(); the lint rule's pseudo list omits it.
260
+ // eslint-disable-next-line tasty/valid-state-key
261
+ transform: { "": "none", ":dir(rtl)": "rotate(180deg)" },
262
+ },
263
+ ExpandedCaret: {
264
+ $: "details > summary > .sidebar-caret, details > summary > a > .sidebar-caret",
265
+ transform: {
266
+ "": null,
267
+ "@own(:is(details[open] > summary > .sidebar-caret)) | @own(:is(details[open] > summary > a > .sidebar-caret))":
268
+ "rotate(90deg)",
269
+ },
270
+ },
271
+ LinkedSummary: {
272
+ $: "summary",
273
+ padding: { "": null, "@own(:has(> a))": "0" },
274
+ },
275
+ GroupLink: { $: "summary > a", justifyContent: "space-between" },
276
+ LinkedSectionHeading: {
277
+ $: ".sidebar-section-label",
278
+ padding: { "": null, "@own(:has(> a))": "0" },
279
+ },
280
+ SectionLink: {
281
+ $: ".sidebar-section-label > a",
282
+ color: {
283
+ "": null,
284
+ '@own(:is(.sidebar-section-label > a:not([aria-current="page"])))':
285
+ "#text",
286
+ },
287
+ preset: {
288
+ "": null,
289
+ '@own(:is(.sidebar-section-label > a:not([aria-current="page"])))':
290
+ "small / strong",
291
+ },
292
+ },
293
+ Badge: {
294
+ $: ".sidebar-badge",
295
+ flexShrink: "0",
296
+ padding: "0.125rem 0.375rem",
297
+ color: "#text-soft",
298
+ fill: "#surface-3",
299
+ border: "$border-width solid #border",
300
+ radius: "$radius",
301
+ preset: "small",
302
+ },
303
+ TopLevelLink: {
304
+ $: "a.large",
305
+ color: { "": null, '@own(:not([aria-current="page"]))': "#sidebar-text" },
306
+ preset: { "": null, '@own(:not([aria-current="page"]))': "navigation" },
307
+ },
308
+ },
309
+ });
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  import { content } from "virtual:cookbook/config";
3
3
  import Logo from "./Logo.astro";
4
- import { SiteLogoRoot } from "./LayoutComponents.js";
4
+ import { SiteLogoRoot } from "./SiteLogo.styles.js";
5
5
  interface Props {
6
6
  class?: string;
7
7
  }
@@ -12,7 +12,6 @@ const logo = content.logo;
12
12
  logo === false ? null : logo ? (
13
13
  <SiteLogoRoot
14
14
  className={Astro.props.class}
15
- data-tasty-anatomy="SiteLogo"
16
15
  aria-hidden={logo.decorative ? "true" : undefined}
17
16
  >
18
17
  <img
@@ -0,0 +1,32 @@
1
+ import { configureCookbookStates } from "./tasty-states.js";
2
+ import { defineComponent } from "../define-component.js";
3
+
4
+ configureCookbookStates();
5
+
6
+ export const SiteLogoRoot = defineComponent("SiteLogo", {
7
+ as: "span",
8
+ "data-element": "SiteLogo",
9
+ styles: {
10
+ display: "inline-flex",
11
+ alignItems: "center",
12
+ justifyContent: "center",
13
+ flexShrink: 0,
14
+ inlineSize: { "": "auto max 12rem", "@mobile": "auto max 30vw" },
15
+ blockSize: { "": "2rem", "@mobile": "1.75rem" },
16
+ Image: {
17
+ $: "> img",
18
+ display: "block",
19
+ inlineSize: "auto max 100%",
20
+ blockSize: "100%",
21
+ objectFit: "contain",
22
+ },
23
+ Light: {
24
+ $: "> .td-site-logo__light",
25
+ hide: { "": false, "@dark": true },
26
+ },
27
+ Dark: {
28
+ $: "> .td-site-logo__dark",
29
+ hide: { "": true, "@dark": false },
30
+ },
31
+ },
32
+ });
@@ -2,6 +2,6 @@
2
2
  const { siteTitle, siteTitleHref } = Astro.locals.cookbookRoute;
3
3
  ---
4
4
 
5
- <a href={siteTitleHref} class="site-title"
5
+ <a href={siteTitleHref} data-element="SiteTitle" class="site-title"
6
6
  ><span translate="no">{siteTitle}</span></a
7
7
  >
@@ -0,0 +1,24 @@
1
+ import { configureCookbookStates } from "./tasty-states.js";
2
+ import { defineComponent } from "../define-component.js";
3
+
4
+ configureCookbookStates();
5
+
6
+ export const SkipLinkRoot = defineComponent("SkipLink", {
7
+ as: "a",
8
+ "data-element": "SkipLink",
9
+ styles: {
10
+ zIndex: { "": null, ":focus": "20" },
11
+ color: { "": null, ":focus": "#accent-surface-text" },
12
+ fill: { "": null, ":focus": "#accent-surface" },
13
+ radius: { "": null, ":focus": "$radius" },
14
+ shadow: { "": null, ":focus": "0 1rem 3rem #shadow" },
15
+ textDecoration: { "": null, ":focus": "none" },
16
+ position: "fixed",
17
+ inset: "($gap * 1.5) auto auto ($gap * 1.5)",
18
+ inlineSize: { "": "1px", ":focus": "auto" },
19
+ blockSize: { "": "1px", ":focus": "auto" },
20
+ padding: { "": "0", ":focus": "$gap ($gap * 2)" },
21
+ overflow: { "": "hidden", ":focus": "visible" },
22
+ clip: { "": "rect(0, 0, 0, 0)", ":focus": "auto" },
23
+ },
24
+ });
@@ -0,0 +1,36 @@
1
+ import { configureCookbookStates } from "./tasty-states.js";
2
+ import { defineComponent } from "../define-component.js";
3
+
4
+ configureCookbookStates();
5
+
6
+ export const SocialIconsRoot = defineComponent("SocialIcons", {
7
+ as: "div",
8
+ "data-element": "SocialIcons",
9
+ styles: {
10
+ display: "flex",
11
+ alignItems: "center",
12
+ gap: "($gap * 0.5)",
13
+ Link: {
14
+ $: "a",
15
+ display: "grid",
16
+ placeItems: "center",
17
+ inlineSize: "$control-height",
18
+ blockSize: "$control-height",
19
+ color: "#text-soft",
20
+ fill: "#clear",
21
+ radius: "$header-control-radius",
22
+ textDecoration: "none",
23
+ },
24
+ HoverLink: {
25
+ $: "a",
26
+ color: { "": null, "@own(:hover)": "#text" },
27
+ fill: { "": null, "@own(:hover)": "#surface-2-hover" },
28
+ },
29
+ Icon: {
30
+ $: "a > svg",
31
+ display: "block",
32
+ inlineSize: "1.25rem",
33
+ blockSize: "1.25rem",
34
+ },
35
+ },
36
+ });
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  import type { StepsProps as Props } from "./props.js";
3
- import { StepsRoot } from "./TastyComponents.js";
3
+ import { StepsRoot } from "./Steps.styles.js";
4
4
  ---
5
5
 
6
- <StepsRoot className="td-steps" data-tasty-anatomy="Steps"><slot /></StepsRoot>
6
+ <StepsRoot className="td-steps"><slot /></StepsRoot>
@@ -0,0 +1,25 @@
1
+ import { configureCookbookStates } from "./tasty-states.js";
2
+ import { defineComponent } from "../define-component.js";
3
+
4
+ configureCookbookStates();
5
+
6
+ export const StepsRoot = defineComponent("Steps", {
7
+ as: "ol",
8
+ "data-element": "Steps",
9
+ styles: {
10
+ display: "grid",
11
+ gap: "2x",
12
+ padding: "4x left",
13
+ border: "1bw left #border",
14
+
15
+ Item: {
16
+ $: "> li",
17
+ padding: "1x left",
18
+ },
19
+ Marker: {
20
+ $: "> li::marker",
21
+ color: "#accent-text",
22
+ preset: "strong",
23
+ },
24
+ },
25
+ });
@@ -0,0 +1,87 @@
1
+ import { useGlobalStyles } from "@tenphi/tasty";
2
+ import { resolveComponentStyles } from "./component-styles.js";
3
+ import { configureCookbookStates } from "./tasty-states.js";
4
+
5
+ configureCookbookStates();
6
+
7
+ export function SyntaxHighlightStyles() {
8
+ useGlobalStyles(
9
+ // State conditions add no specificity; preserve the former root category weight.
10
+ ".tasty-code.tasty-code",
11
+ resolveComponentStyles("SyntaxHighlight", {
12
+ color: {
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" },
32
+ // Descendant identities stay neutral so these rules retain their original weight.
33
+ Marker: { $: ":where(.td-syntax-marker)", userSelect: "none" },
34
+ Comment: {
35
+ $: ":where(.td-syntax-comment)",
36
+ color: "#syntax-comment",
37
+ },
38
+ Punctuation: {
39
+ $: ":where(.td-syntax-punctuation)",
40
+ color: "#syntax-punctuation",
41
+ },
42
+ Keyword: {
43
+ $: ":where(.td-syntax-keyword)",
44
+ color: "#syntax-keyword",
45
+ },
46
+ String: {
47
+ $: ":where(.td-syntax-string)",
48
+ color: "#syntax-string",
49
+ },
50
+ Token: {
51
+ $: ":where(.td-syntax-token)",
52
+ color: "#syntax-token",
53
+ },
54
+ Property: {
55
+ $: ":where(.td-syntax-property)",
56
+ color: "#syntax-property",
57
+ },
58
+ Number: {
59
+ $: ":where(.td-syntax-number)",
60
+ color: "#syntax-number",
61
+ },
62
+ Function: {
63
+ $: ":where(.td-syntax-function)",
64
+ color: "#syntax-function",
65
+ },
66
+ Value: {
67
+ $: ":where(.td-syntax-value)",
68
+ color: "#syntax-value",
69
+ },
70
+ 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" },
80
+ Underline: {
81
+ $: ":where(.td-syntax-underline)",
82
+ textDecoration: "underline",
83
+ },
84
+ }),
85
+ );
86
+ return null;
87
+ }
@@ -1,5 +1,5 @@
1
1
  ---
2
- import { TabRoot } from "./TastyComponents.js";
2
+ import { TabRoot } from "./Tab.styles.js";
3
3
  import type { TabProps as Props } from "./props.js";
4
4
  const { label } = Astro.props;
5
5
  ---
@@ -0,0 +1,30 @@
1
+ import { configureCookbookStates } from "./tasty-states.js";
2
+ import { defineComponent } from "../define-component.js";
3
+
4
+ configureCookbookStates();
5
+
6
+ export const TabRoot = defineComponent("Tab", {
7
+ as: "section",
8
+ "data-element": "Tab",
9
+ styles: {
10
+ hide: { "": null, "[hidden]": true },
11
+
12
+ "$margin-block-start": "0",
13
+ "$margin-block-end": "0",
14
+ blockMargin: "$margin-block-start $margin-block-end",
15
+ inlineMargin: "0",
16
+ padding: "2x",
17
+ Heading: {
18
+ "$margin-block-start": "0",
19
+ "$margin-block-end": "1x",
20
+ blockMargin: "$margin-block-start $margin-block-end",
21
+ inlineMargin: "0",
22
+ preset: "h3",
23
+ },
24
+ HiddenHeading: {
25
+ $: "> *",
26
+ hide: { "": null, "@own([data-tab-heading] & [hidden])": true },
27
+ },
28
+ },
29
+ elements: { Heading: "h3" },
30
+ });
@@ -0,0 +1,62 @@
1
+ import { configureCookbookStates } from "./tasty-states.js";
2
+ import { defineComponent } from "../define-component.js";
3
+
4
+ configureCookbookStates();
5
+
6
+ export const TableOfContentsRoot = defineComponent("TableOfContents", {
7
+ as: "cookbook-table-of-contents",
8
+ "data-element": "TableOfContents",
9
+ styles: {
10
+ display: "block",
11
+ hide: { "": false, "@narrow-layout": true },
12
+ blockPadding: "($gap * 4) start",
13
+ inlinePadding: "$docs-sidebar-pad-x",
14
+ Heading: {
15
+ $: "h2",
16
+ margin: "0 0 $gap",
17
+ color: "#text",
18
+ preset: "small / strong",
19
+ },
20
+ List: {
21
+ $: "ul",
22
+ display: "grid",
23
+ gridColumns: "minmax(0, 1fr)",
24
+ inlineSize: "min 0",
25
+ gap: "1px",
26
+ margin: "0",
27
+ padding: "0",
28
+ listStyle: "none",
29
+ },
30
+ Item: {
31
+ $: "li",
32
+ inlineSize: "min 0",
33
+ margin: "0",
34
+ padding: "0",
35
+ listStyle: "none",
36
+ },
37
+ Link: {
38
+ $: "a",
39
+ display: "block",
40
+ inlineSize: "0 auto 100%",
41
+ blockPadding: "($gap * 0.5)",
42
+ color: "#text-muted",
43
+ preset: "small",
44
+ textDecoration: "none",
45
+ overflowWrap: "anywhere",
46
+ },
47
+ LinkLabel: {
48
+ $: "a > span",
49
+ display: "block",
50
+ inlineSize: "min 0",
51
+ overflow: "hidden",
52
+ textOverflow: "ellipsis",
53
+ whiteSpace: "nowrap",
54
+ },
55
+ HoverLink: { $: "a", color: { "": null, "@own(:hover)": "#text" } },
56
+ CurrentLink: {
57
+ $: "a",
58
+ color: { "": null, '@own([aria-current="location"])': "#accent-text" },
59
+ preset: { "": null, '@own([aria-current="location"])': "small / strong" },
60
+ },
61
+ },
62
+ });