@tenphi/starlight 0.5.0 → 0.6.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.
- package/dist/components/Card.astro +5 -3
- package/dist/components/GlobalStyles.js +785 -0
- package/dist/components/LayoutComponents.js +752 -0
- package/dist/components/Logo.astro +39 -0
- package/dist/components/MobileNavigationTabs.astro +7 -2
- package/dist/components/NavigationTree.astro +6 -2
- package/dist/components/PackageVersion.astro +22 -0
- package/dist/components/Preview.astro +21 -10
- package/dist/components/Steps.astro +5 -1
- package/dist/components/Tabs.astro +9 -2
- package/dist/components/TastyComponents.js +156 -0
- package/dist/components/component-styles.test.ts +75 -0
- package/dist/components/component-styles.ts +79 -0
- package/dist/components/customize-component.js +10 -0
- package/dist/components/svg-icon.test.ts +11 -0
- package/dist/components/svg-icon.ts +11 -0
- package/dist/components/tasty-states.d.ts +2 -0
- package/dist/components/tasty-states.js +21 -0
- package/dist/components-public.d.ts +1 -0
- package/dist/components.d.ts +2 -1
- package/dist/components.js +2 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +238 -139
- package/dist/index.js.map +1 -1
- package/dist/overrides/Header.astro +28 -5
- package/dist/overrides/MobileMenuFooter.astro +15 -0
- package/dist/overrides/ThemeSelect.astro +69 -0
- package/dist/routes/DocsPage.astro +71 -30
- package/package.json +5 -8
- package/dist/styles.css +0 -1346
- package/dist/styles.d.ts +0 -1
|
@@ -0,0 +1,752 @@
|
|
|
1
|
+
import { tasty } from "@tenphi/tasty";
|
|
2
|
+
import chevronDownIcon from "../icons/chevron-down.svg?raw";
|
|
3
|
+
import closeIcon from "../icons/close.svg?raw";
|
|
4
|
+
import contrastIcon from "../icons/contrast.svg?raw";
|
|
5
|
+
import deviceIcon from "../icons/device-desktop.svg?raw";
|
|
6
|
+
import moonIcon from "../icons/moon.svg?raw";
|
|
7
|
+
import searchIcon from "../icons/search.svg?raw";
|
|
8
|
+
import sunIcon from "../icons/sun.svg?raw";
|
|
9
|
+
import { customizeComponent } from "./customize-component.js";
|
|
10
|
+
import { svgIconUrl } from "./svg-icon.js";
|
|
11
|
+
import { configureCookbookStates } from "./tasty-states.js";
|
|
12
|
+
|
|
13
|
+
configureCookbookStates();
|
|
14
|
+
|
|
15
|
+
export const LogoRoot = customizeComponent(
|
|
16
|
+
"Logo",
|
|
17
|
+
{ as: "span" },
|
|
18
|
+
tasty({
|
|
19
|
+
as: "span",
|
|
20
|
+
styles: {
|
|
21
|
+
display: "inline-grid",
|
|
22
|
+
flexGrow: "0",
|
|
23
|
+
flexShrink: "0",
|
|
24
|
+
flexBasis: "auto",
|
|
25
|
+
inlineSize: "4rem",
|
|
26
|
+
blockSize: "4rem",
|
|
27
|
+
color: "#accent-surface",
|
|
28
|
+
Svg: {
|
|
29
|
+
$: "> svg",
|
|
30
|
+
display: "block",
|
|
31
|
+
inlineSize: "100%",
|
|
32
|
+
blockSize: "100%",
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
}),
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
export const PackageVersionRoot = customizeComponent(
|
|
39
|
+
"PackageVersion",
|
|
40
|
+
{ as: "span" },
|
|
41
|
+
tasty({
|
|
42
|
+
as: "span",
|
|
43
|
+
styles: {
|
|
44
|
+
display: "inline-flex",
|
|
45
|
+
alignItems: "center",
|
|
46
|
+
flexShrink: "0",
|
|
47
|
+
minBlockSize: "1.5rem",
|
|
48
|
+
paddingInlineStart: "($gap * 0.75)",
|
|
49
|
+
paddingInlineEnd: "($gap * 0.75)",
|
|
50
|
+
color: "#text-soft",
|
|
51
|
+
fill: "#surface-2",
|
|
52
|
+
border: true,
|
|
53
|
+
radius: "999px",
|
|
54
|
+
preset: "small",
|
|
55
|
+
whiteSpace: "nowrap",
|
|
56
|
+
},
|
|
57
|
+
}),
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
export const TopNavigationRoot = customizeComponent(
|
|
61
|
+
"TopNavigation",
|
|
62
|
+
{ as: "nav" },
|
|
63
|
+
tasty({
|
|
64
|
+
as: "nav",
|
|
65
|
+
styles: {
|
|
66
|
+
display: "flex",
|
|
67
|
+
hide: { "": false, "@mobile": true },
|
|
68
|
+
alignItems: "stretch",
|
|
69
|
+
gap: "clamp(1.25rem, 2.5vw, 2.5rem)",
|
|
70
|
+
inlineSize: "100%",
|
|
71
|
+
minBlockSize: "2.5rem",
|
|
72
|
+
overflowX: "auto",
|
|
73
|
+
scrollbar: "none",
|
|
74
|
+
|
|
75
|
+
Scrollbar: { $: "&::-webkit-scrollbar", hide: true },
|
|
76
|
+
Link: {
|
|
77
|
+
$: "a",
|
|
78
|
+
position: "relative",
|
|
79
|
+
display: "inline-flex",
|
|
80
|
+
alignItems: "center",
|
|
81
|
+
flexGrow: "0",
|
|
82
|
+
flexShrink: "0",
|
|
83
|
+
flexBasis: "auto",
|
|
84
|
+
paddingBlockStart: "($gap * 0.75)",
|
|
85
|
+
paddingBlockEnd: "$gap",
|
|
86
|
+
color: "#text-soft",
|
|
87
|
+
preset: "navigation",
|
|
88
|
+
textDecoration: "none",
|
|
89
|
+
whiteSpace: "nowrap",
|
|
90
|
+
},
|
|
91
|
+
HoverLink: { $: "a:hover", color: "#text" },
|
|
92
|
+
CurrentLink: { $: 'a[aria-current="page"]', color: "#accent-text" },
|
|
93
|
+
ActiveIndicator: {
|
|
94
|
+
$: 'a[aria-current="page"]::after',
|
|
95
|
+
content: '""',
|
|
96
|
+
position: "absolute",
|
|
97
|
+
inset: "auto 0 0",
|
|
98
|
+
blockSize: "2px",
|
|
99
|
+
radius: "999px",
|
|
100
|
+
fill: "#accent-surface",
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
}),
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
export const StarlightHeaderRoot = customizeComponent(
|
|
107
|
+
"StarlightHeader",
|
|
108
|
+
{ as: "div" },
|
|
109
|
+
tasty({
|
|
110
|
+
as: "div",
|
|
111
|
+
styles: {
|
|
112
|
+
display: "flex",
|
|
113
|
+
flow: "column",
|
|
114
|
+
inlineSize: "100%",
|
|
115
|
+
maxInlineSize: "($layout-width - ($sl-sidebar-pad-x * 2))",
|
|
116
|
+
blockSize: "100%",
|
|
117
|
+
minInlineSize: "0",
|
|
118
|
+
marginInlineStart: "auto",
|
|
119
|
+
marginInlineEnd: "auto",
|
|
120
|
+
|
|
121
|
+
Primary: {
|
|
122
|
+
$: ".td-header__primary",
|
|
123
|
+
display: {
|
|
124
|
+
"": "grid",
|
|
125
|
+
"@mobile": "flex",
|
|
126
|
+
},
|
|
127
|
+
gridColumns:
|
|
128
|
+
"minmax(9rem, $sidebar-width) minmax(12rem, 28rem) minmax(5rem, 1fr)",
|
|
129
|
+
placeItems: "center stretch",
|
|
130
|
+
justifyContent: {
|
|
131
|
+
"": "normal",
|
|
132
|
+
"@mobile": "space-between",
|
|
133
|
+
},
|
|
134
|
+
flexGrow: "1",
|
|
135
|
+
flexShrink: "1",
|
|
136
|
+
flexBasis: "0%",
|
|
137
|
+
gap: {
|
|
138
|
+
"": "clamp(1rem, 2.5vw, 2.5rem)",
|
|
139
|
+
"@mobile": "$gap",
|
|
140
|
+
},
|
|
141
|
+
minBlockSize: "0",
|
|
142
|
+
},
|
|
143
|
+
TitleAndSearch: {
|
|
144
|
+
$: ".td-header__title, .td-header__search",
|
|
145
|
+
display: "flex",
|
|
146
|
+
alignItems: "center",
|
|
147
|
+
minInlineSize: "0",
|
|
148
|
+
},
|
|
149
|
+
Title: {
|
|
150
|
+
$: ".td-header__title",
|
|
151
|
+
display: "flex",
|
|
152
|
+
flow: "row",
|
|
153
|
+
gap: "$gap",
|
|
154
|
+
overflow: "hidden",
|
|
155
|
+
maxInlineSize: {
|
|
156
|
+
"": "none",
|
|
157
|
+
"@mobile": "(100% - (($sl-menu-button-size + $sl-nav-gap) * 3))",
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
SiteTitle: {
|
|
161
|
+
$: ".site-title",
|
|
162
|
+
color: "#text",
|
|
163
|
+
preset: { "": "h4 / strong", "@mobile": "h5 / strong" },
|
|
164
|
+
},
|
|
165
|
+
Search: {
|
|
166
|
+
$: ".td-header__search",
|
|
167
|
+
position: { "": "static", "@mobile": "fixed" },
|
|
168
|
+
zIndex: { "": "auto", "@mobile": "10" },
|
|
169
|
+
inset: {
|
|
170
|
+
"": "auto top",
|
|
171
|
+
"@mobile": "(($sl-nav-height - $sl-menu-button-size) / 2) top",
|
|
172
|
+
},
|
|
173
|
+
insetInlineEnd: {
|
|
174
|
+
"": "auto",
|
|
175
|
+
"@mobile":
|
|
176
|
+
"($sl-nav-pad-x + (($sl-menu-button-size + $sl-nav-gap) * 2))",
|
|
177
|
+
},
|
|
178
|
+
placeItems: { "": "normal", "@mobile": "center" },
|
|
179
|
+
inlineSize: { "": "auto", "@mobile": "$sl-menu-button-size" },
|
|
180
|
+
blockSize: { "": "auto", "@mobile": "$sl-menu-button-size" },
|
|
181
|
+
marginInlineStart: "0",
|
|
182
|
+
},
|
|
183
|
+
SearchElement: {
|
|
184
|
+
$: ".td-header__search site-search",
|
|
185
|
+
inlineSize: "100%",
|
|
186
|
+
blockSize: { "": "auto", "@mobile": "$sl-menu-button-size" },
|
|
187
|
+
},
|
|
188
|
+
Tools: {
|
|
189
|
+
$: ".td-header__tools",
|
|
190
|
+
display: "flex",
|
|
191
|
+
flow: "row",
|
|
192
|
+
alignItems: "center",
|
|
193
|
+
justifyContent: "flex-end",
|
|
194
|
+
gap: "($gap * 1.5)",
|
|
195
|
+
},
|
|
196
|
+
ToolItem: {
|
|
197
|
+
$: ".td-header__tools > *",
|
|
198
|
+
margin: "0",
|
|
199
|
+
},
|
|
200
|
+
Social: {
|
|
201
|
+
$: ".td-header__social",
|
|
202
|
+
display: "flex",
|
|
203
|
+
alignItems: "center",
|
|
204
|
+
},
|
|
205
|
+
MobileTheme: {
|
|
206
|
+
$: ".td-header__mobile-theme",
|
|
207
|
+
display: "grid",
|
|
208
|
+
hide: { "": true, "@mobile": false },
|
|
209
|
+
position: { "": "static", "@mobile": "fixed" },
|
|
210
|
+
zIndex: { "": "auto", "@mobile": "10" },
|
|
211
|
+
inset: {
|
|
212
|
+
"": "auto top",
|
|
213
|
+
"@mobile": "(($sl-nav-height - $sl-menu-button-size) / 2) top",
|
|
214
|
+
},
|
|
215
|
+
insetInlineEnd: {
|
|
216
|
+
"": "auto",
|
|
217
|
+
"@mobile": "($sl-nav-pad-x + $sl-menu-button-size + $sl-nav-gap)",
|
|
218
|
+
},
|
|
219
|
+
placeItems: { "": "normal", "@mobile": "center" },
|
|
220
|
+
inlineSize: { "": "auto", "@mobile": "$sl-menu-button-size" },
|
|
221
|
+
blockSize: { "": "auto", "@mobile": "$sl-menu-button-size" },
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
}),
|
|
225
|
+
);
|
|
226
|
+
|
|
227
|
+
export const ThemeSelectRoot = customizeComponent(
|
|
228
|
+
"ThemeSelect",
|
|
229
|
+
{ as: "starlight-theme-select" },
|
|
230
|
+
tasty({
|
|
231
|
+
as: "starlight-theme-select",
|
|
232
|
+
styles: {
|
|
233
|
+
display: "grid",
|
|
234
|
+
placeItems: "center",
|
|
235
|
+
margin: "0",
|
|
236
|
+
inlineSize: {
|
|
237
|
+
"": "$control-height",
|
|
238
|
+
"@mobile": "$sl-menu-button-size",
|
|
239
|
+
},
|
|
240
|
+
blockSize: {
|
|
241
|
+
"": "$control-height",
|
|
242
|
+
"@mobile": "$sl-menu-button-size",
|
|
243
|
+
},
|
|
244
|
+
|
|
245
|
+
Label: {
|
|
246
|
+
$: "label",
|
|
247
|
+
boxSizing: "border-box",
|
|
248
|
+
position: "relative",
|
|
249
|
+
display: "inline-flex",
|
|
250
|
+
alignItems: "center",
|
|
251
|
+
inlineSize: "100%",
|
|
252
|
+
blockSize: "100%",
|
|
253
|
+
padding: "0",
|
|
254
|
+
border: "0",
|
|
255
|
+
fill: "#clear",
|
|
256
|
+
},
|
|
257
|
+
Icon: {
|
|
258
|
+
$: ".label-icon",
|
|
259
|
+
position: "absolute",
|
|
260
|
+
zIndex: "1",
|
|
261
|
+
insetInlineStart: "50%",
|
|
262
|
+
inlineSize: "1rem",
|
|
263
|
+
blockSize: "1rem",
|
|
264
|
+
color: "#text-soft",
|
|
265
|
+
translate: "-50% 0",
|
|
266
|
+
pointerEvents: "none",
|
|
267
|
+
},
|
|
268
|
+
Select: {
|
|
269
|
+
$: "select",
|
|
270
|
+
appearance: "base-select",
|
|
271
|
+
position: "static",
|
|
272
|
+
inlineSize: "100%",
|
|
273
|
+
minInlineSize: "0",
|
|
274
|
+
blockSize: "100%",
|
|
275
|
+
minBlockSize: "0",
|
|
276
|
+
padding: "0",
|
|
277
|
+
margin: "0",
|
|
278
|
+
color: "#clear",
|
|
279
|
+
preset: "small / strong",
|
|
280
|
+
border: true,
|
|
281
|
+
radius: "$radius",
|
|
282
|
+
fill: {
|
|
283
|
+
"": "#surface-3",
|
|
284
|
+
":hover": "#surface-3-hover",
|
|
285
|
+
":active": "#surface-3-pressed",
|
|
286
|
+
},
|
|
287
|
+
shadow: "none",
|
|
288
|
+
cursor: "pointer",
|
|
289
|
+
transition: "color 120ms ease, fill 120ms ease",
|
|
290
|
+
},
|
|
291
|
+
PickerIcon: { $: "select::picker-icon", hide: true },
|
|
292
|
+
Picker: {
|
|
293
|
+
$: "select::picker(select)",
|
|
294
|
+
appearance: "base-select",
|
|
295
|
+
gap: "1px",
|
|
296
|
+
minInlineSize: "8rem",
|
|
297
|
+
marginBlockStart: "0.5rem",
|
|
298
|
+
padding: "4px",
|
|
299
|
+
color: "#text",
|
|
300
|
+
border: true,
|
|
301
|
+
radius: "$card-radius",
|
|
302
|
+
fill: "#surface-2",
|
|
303
|
+
shadow: "0 0.75rem 2rem #shadow",
|
|
304
|
+
},
|
|
305
|
+
OpenPicker: {
|
|
306
|
+
$: "select::picker(select):popover-open",
|
|
307
|
+
display: "grid",
|
|
308
|
+
},
|
|
309
|
+
Option: {
|
|
310
|
+
$: "option",
|
|
311
|
+
padding: "0.625rem 0.75rem",
|
|
312
|
+
color: "#text",
|
|
313
|
+
preset: "small",
|
|
314
|
+
radius: "$radius",
|
|
315
|
+
fill: "#surface-2",
|
|
316
|
+
},
|
|
317
|
+
HoverOption: {
|
|
318
|
+
$: "option:hover, option:focus",
|
|
319
|
+
fill: "#surface-2-hover",
|
|
320
|
+
},
|
|
321
|
+
CheckedOption: {
|
|
322
|
+
$: "option:checked",
|
|
323
|
+
color: "#accent-text",
|
|
324
|
+
fill: "color-mix(in oklab, #accent-surface 12%, #surface-2)",
|
|
325
|
+
},
|
|
326
|
+
Checkmark: {
|
|
327
|
+
$: "option::checkmark",
|
|
328
|
+
order: "1",
|
|
329
|
+
marginInlineStart: "auto",
|
|
330
|
+
},
|
|
331
|
+
},
|
|
332
|
+
}),
|
|
333
|
+
);
|
|
334
|
+
|
|
335
|
+
export const MobileNavigationTabsRoot = customizeComponent(
|
|
336
|
+
"MobileNavigationTabs",
|
|
337
|
+
{ as: "nav" },
|
|
338
|
+
tasty({
|
|
339
|
+
as: "nav",
|
|
340
|
+
styles: {
|
|
341
|
+
display: "grid",
|
|
342
|
+
hide: { "": false, "@desktop": true },
|
|
343
|
+
gap: "$gap",
|
|
344
|
+
marginBlockEnd: "($gap * 2)",
|
|
345
|
+
paddingBlockEnd: "($gap * 2)",
|
|
346
|
+
borderBlockEnd: "$border-width solid #border",
|
|
347
|
+
Label: {
|
|
348
|
+
$: ".td-mobile-tabs__label",
|
|
349
|
+
paddingInline: "($gap * 1.25)",
|
|
350
|
+
color: "#text",
|
|
351
|
+
preset: "navigation",
|
|
352
|
+
},
|
|
353
|
+
List: {
|
|
354
|
+
$: "ul",
|
|
355
|
+
display: "grid",
|
|
356
|
+
gridColumns: "repeat(2, minmax(0, 1fr))",
|
|
357
|
+
gap: "$gap",
|
|
358
|
+
padding: "0",
|
|
359
|
+
margin: "0",
|
|
360
|
+
listStyle: "none",
|
|
361
|
+
},
|
|
362
|
+
Item: { $: "li", margin: "0" },
|
|
363
|
+
Link: {
|
|
364
|
+
$: "a",
|
|
365
|
+
display: "flex",
|
|
366
|
+
alignItems: "center",
|
|
367
|
+
minBlockSize: "2.25rem",
|
|
368
|
+
padding: "($gap * 0.75) ($gap * 1.25)",
|
|
369
|
+
color: "#text-soft",
|
|
370
|
+
preset: "navigation",
|
|
371
|
+
textDecoration: "none",
|
|
372
|
+
radius: "$radius",
|
|
373
|
+
},
|
|
374
|
+
HoverLink: {
|
|
375
|
+
$: "a:hover",
|
|
376
|
+
color: "#text",
|
|
377
|
+
fill: "#surface-2-hover",
|
|
378
|
+
},
|
|
379
|
+
CurrentLink: {
|
|
380
|
+
$: 'a[aria-current="page"]',
|
|
381
|
+
color: "#accent-text",
|
|
382
|
+
fill: "color-mix(in oklab, #accent-surface 12%, #surface)",
|
|
383
|
+
},
|
|
384
|
+
},
|
|
385
|
+
}),
|
|
386
|
+
);
|
|
387
|
+
|
|
388
|
+
export const MobileMenuFooterRoot = customizeComponent(
|
|
389
|
+
"MobileMenuFooter",
|
|
390
|
+
{ as: "div" },
|
|
391
|
+
tasty({
|
|
392
|
+
as: "div",
|
|
393
|
+
styles: {
|
|
394
|
+
display: "flex",
|
|
395
|
+
alignItems: "center",
|
|
396
|
+
justifyContent: "space-between",
|
|
397
|
+
flow: "row wrap",
|
|
398
|
+
gap: "($gap * 2)",
|
|
399
|
+
paddingBlock: "$gap",
|
|
400
|
+
borderBlockStart: "$border-width solid #border",
|
|
401
|
+
Social: {
|
|
402
|
+
$: ".td-mobile-preferences__social",
|
|
403
|
+
display: "flex",
|
|
404
|
+
hide: { "": false, ":empty": true },
|
|
405
|
+
alignItems: "center",
|
|
406
|
+
gap: "($gap * 2)",
|
|
407
|
+
marginInlineEnd: "auto",
|
|
408
|
+
paddingBlock: "($gap * 2)",
|
|
409
|
+
},
|
|
410
|
+
},
|
|
411
|
+
}),
|
|
412
|
+
);
|
|
413
|
+
|
|
414
|
+
export const NavigationTreeRoot = customizeComponent(
|
|
415
|
+
"NavigationTree",
|
|
416
|
+
{ as: "ul" },
|
|
417
|
+
tasty({
|
|
418
|
+
as: "ul",
|
|
419
|
+
styles: {
|
|
420
|
+
margin: "0",
|
|
421
|
+
padding: "0",
|
|
422
|
+
listStyle: "none",
|
|
423
|
+
NestedList: {
|
|
424
|
+
$: "ul",
|
|
425
|
+
margin: "0",
|
|
426
|
+
padding: "0 0 0 ($gap * 1.5)",
|
|
427
|
+
listStyle: "none",
|
|
428
|
+
},
|
|
429
|
+
Summary: {
|
|
430
|
+
$: "details > summary",
|
|
431
|
+
display: "flex",
|
|
432
|
+
alignItems: "center",
|
|
433
|
+
justifyContent: "space-between",
|
|
434
|
+
padding: "($gap * 0.9) ($gap * 1.25)",
|
|
435
|
+
color: "#text",
|
|
436
|
+
preset: "body / strong",
|
|
437
|
+
cursor: "pointer",
|
|
438
|
+
listStyle: "none",
|
|
439
|
+
},
|
|
440
|
+
Marker: { $: "details > summary::-webkit-details-marker", hide: true },
|
|
441
|
+
SummaryIcon: {
|
|
442
|
+
$: "details > summary::after",
|
|
443
|
+
content: '""',
|
|
444
|
+
inlineSize: "1rem",
|
|
445
|
+
blockSize: "1rem",
|
|
446
|
+
fill: "#text-soft",
|
|
447
|
+
mask: `url("${svgIconUrl(chevronDownIcon)}") center / contain no-repeat`,
|
|
448
|
+
},
|
|
449
|
+
ClosedSummaryIcon: {
|
|
450
|
+
$: "details:not([open]) > summary::after",
|
|
451
|
+
rotate: "-90deg",
|
|
452
|
+
},
|
|
453
|
+
Link: {
|
|
454
|
+
$: "a",
|
|
455
|
+
display: "block",
|
|
456
|
+
padding: "($gap * 0.9) ($gap * 1.25)",
|
|
457
|
+
color: "#text-soft",
|
|
458
|
+
radius: "$radius",
|
|
459
|
+
textDecoration: "none",
|
|
460
|
+
},
|
|
461
|
+
HoverLink: { $: "a:hover", color: "#text", fill: "#surface-2" },
|
|
462
|
+
CurrentLink: {
|
|
463
|
+
$: 'a[aria-current="page"]',
|
|
464
|
+
color: "#accent-text",
|
|
465
|
+
preset: "body / strong",
|
|
466
|
+
fill: "color-mix(in oklab, #accent-surface 12%, #surface)",
|
|
467
|
+
},
|
|
468
|
+
},
|
|
469
|
+
}),
|
|
470
|
+
);
|
|
471
|
+
|
|
472
|
+
export const StandaloneHeaderRoot = customizeComponent(
|
|
473
|
+
"StandaloneHeader",
|
|
474
|
+
{ as: "header" },
|
|
475
|
+
tasty({
|
|
476
|
+
as: "header",
|
|
477
|
+
styles: {
|
|
478
|
+
position: "sticky",
|
|
479
|
+
inset: "0 top",
|
|
480
|
+
zIndex: "2",
|
|
481
|
+
display: "flex",
|
|
482
|
+
flow: "column",
|
|
483
|
+
paddingInline: {
|
|
484
|
+
"": "clamp(1.25rem, 3vw, 2rem)",
|
|
485
|
+
"@shell-mobile": "1rem",
|
|
486
|
+
},
|
|
487
|
+
fill: "color-mix(in oklab, #surface 96%, #clear)",
|
|
488
|
+
backdropFilter: "blur(12px)",
|
|
489
|
+
border: { "": "0", "@desktop": "1bw bottom" },
|
|
490
|
+
Primary: {
|
|
491
|
+
$: ".td-shell__header-primary",
|
|
492
|
+
display: "flex",
|
|
493
|
+
alignItems: "center",
|
|
494
|
+
justifyContent: "space-between",
|
|
495
|
+
gap: "($gap * 3)",
|
|
496
|
+
inlineSize: "100%",
|
|
497
|
+
maxInlineSize: "($layout-width - ($gap * 6))",
|
|
498
|
+
minBlockSize: "4.5rem",
|
|
499
|
+
marginInlineStart: "auto",
|
|
500
|
+
marginInlineEnd: "auto",
|
|
501
|
+
},
|
|
502
|
+
Brand: {
|
|
503
|
+
$: ".td-shell__brand",
|
|
504
|
+
display: "flex",
|
|
505
|
+
alignItems: "center",
|
|
506
|
+
gap: "$gap",
|
|
507
|
+
minInlineSize: "0",
|
|
508
|
+
},
|
|
509
|
+
BrandLink: {
|
|
510
|
+
$: ".td-shell__brand > a",
|
|
511
|
+
color: "#text",
|
|
512
|
+
preset: "heading",
|
|
513
|
+
textDecoration: "none",
|
|
514
|
+
},
|
|
515
|
+
Actions: {
|
|
516
|
+
$: ".td-shell__actions",
|
|
517
|
+
display: "flex",
|
|
518
|
+
alignItems: { "": "center", "@shell-mobile": "stretch" },
|
|
519
|
+
flow: { "": "row nowrap", "@shell-mobile": "row wrap" },
|
|
520
|
+
gap: "$gap",
|
|
521
|
+
},
|
|
522
|
+
TopNavigation: {
|
|
523
|
+
$: "> .td-top-tabs",
|
|
524
|
+
maxInlineSize: "($layout-width - ($gap * 6))",
|
|
525
|
+
marginInlineStart: "auto",
|
|
526
|
+
marginInlineEnd: "auto",
|
|
527
|
+
},
|
|
528
|
+
},
|
|
529
|
+
}),
|
|
530
|
+
);
|
|
531
|
+
|
|
532
|
+
export const AppearanceControlRoot = customizeComponent(
|
|
533
|
+
"AppearanceControl",
|
|
534
|
+
{ as: "label" },
|
|
535
|
+
tasty({
|
|
536
|
+
as: "label",
|
|
537
|
+
styles: {
|
|
538
|
+
position: "relative",
|
|
539
|
+
display: "grid",
|
|
540
|
+
placeItems: "center",
|
|
541
|
+
inlineSize: "$control-height",
|
|
542
|
+
blockSize: "$control-height",
|
|
543
|
+
radius: "$radius",
|
|
544
|
+
fill: { "": "#surface-2", ":hover": "#surface-2-hover" },
|
|
545
|
+
Select: {
|
|
546
|
+
$: "select",
|
|
547
|
+
position: "absolute",
|
|
548
|
+
inset: "0",
|
|
549
|
+
inlineSize: "100%",
|
|
550
|
+
blockSize: "100%",
|
|
551
|
+
padding: "0",
|
|
552
|
+
border: "0",
|
|
553
|
+
opacity: "0",
|
|
554
|
+
cursor: "pointer",
|
|
555
|
+
},
|
|
556
|
+
Icon: {
|
|
557
|
+
$: "&::before",
|
|
558
|
+
content: '""',
|
|
559
|
+
inlineSize: "1rem",
|
|
560
|
+
blockSize: "1rem",
|
|
561
|
+
fill: "#text-soft",
|
|
562
|
+
mask: {
|
|
563
|
+
"": `url("${svgIconUrl(deviceIcon)}") center / contain no-repeat`,
|
|
564
|
+
':has([data-docs-theme] option[value="light"]:checked)': `url("${svgIconUrl(sunIcon)}") center / contain no-repeat`,
|
|
565
|
+
':has([data-docs-theme] option[value="dark"]:checked)': `url("${svgIconUrl(moonIcon)}") center / contain no-repeat`,
|
|
566
|
+
".td-appearance-control--contrast": `url("${svgIconUrl(contrastIcon)}") center / contain no-repeat`,
|
|
567
|
+
},
|
|
568
|
+
pointerEvents: "none",
|
|
569
|
+
},
|
|
570
|
+
},
|
|
571
|
+
}),
|
|
572
|
+
);
|
|
573
|
+
|
|
574
|
+
export const SearchTriggerRoot = customizeComponent(
|
|
575
|
+
"SearchTrigger",
|
|
576
|
+
{ as: "button" },
|
|
577
|
+
tasty({
|
|
578
|
+
as: "button",
|
|
579
|
+
styles: {
|
|
580
|
+
display: "inline-flex",
|
|
581
|
+
alignItems: "center",
|
|
582
|
+
gap: "$gap",
|
|
583
|
+
paddingInline: "($gap * 1.5)",
|
|
584
|
+
color: "#text",
|
|
585
|
+
border: true,
|
|
586
|
+
radius: "$radius",
|
|
587
|
+
fill: {
|
|
588
|
+
"": "#surface-2",
|
|
589
|
+
":hover": "#surface-2-hover",
|
|
590
|
+
":active": "#surface-2-pressed",
|
|
591
|
+
},
|
|
592
|
+
transition: "fill 120ms ease",
|
|
593
|
+
Icon: {
|
|
594
|
+
$: "&::before",
|
|
595
|
+
content: '""',
|
|
596
|
+
inlineSize: "1rem",
|
|
597
|
+
blockSize: "1rem",
|
|
598
|
+
flexGrow: "0",
|
|
599
|
+
flexShrink: "0",
|
|
600
|
+
flexBasis: "auto",
|
|
601
|
+
fill: "#current",
|
|
602
|
+
mask: `url("${svgIconUrl(searchIcon)}") center / contain no-repeat`,
|
|
603
|
+
},
|
|
604
|
+
Shortcut: {
|
|
605
|
+
$: "> kbd",
|
|
606
|
+
display: "flex",
|
|
607
|
+
gap: "0.125rem",
|
|
608
|
+
marginInlineStart: "($gap * 1.5)",
|
|
609
|
+
color: "#text-soft",
|
|
610
|
+
preset: "small",
|
|
611
|
+
font: "$body-font-family",
|
|
612
|
+
},
|
|
613
|
+
Key: { $: "kbd", font: "$body-font-family" },
|
|
614
|
+
},
|
|
615
|
+
}),
|
|
616
|
+
);
|
|
617
|
+
|
|
618
|
+
export const DocsLayoutRoot = customizeComponent(
|
|
619
|
+
"DocsLayout",
|
|
620
|
+
{ as: "div" },
|
|
621
|
+
tasty({
|
|
622
|
+
as: "div",
|
|
623
|
+
styles: {
|
|
624
|
+
display: "grid",
|
|
625
|
+
gridColumns: {
|
|
626
|
+
"": "minmax(13rem, $sidebar-width) minmax(0, 1fr)",
|
|
627
|
+
"@shell-mobile": "1fr",
|
|
628
|
+
},
|
|
629
|
+
inlineSize: "min(100%, $layout-width)",
|
|
630
|
+
minBlockSize: "100vh",
|
|
631
|
+
marginInlineStart: "auto",
|
|
632
|
+
marginInlineEnd: "auto",
|
|
633
|
+
},
|
|
634
|
+
}),
|
|
635
|
+
);
|
|
636
|
+
|
|
637
|
+
export const DocsSidebarRoot = customizeComponent(
|
|
638
|
+
"DocsSidebar",
|
|
639
|
+
{ as: "nav" },
|
|
640
|
+
tasty({
|
|
641
|
+
as: "nav",
|
|
642
|
+
styles: {
|
|
643
|
+
padding: {
|
|
644
|
+
"": "($gap * 5) ($gap * 3)",
|
|
645
|
+
"@shell-mobile": "($gap * 2) ($gap * 3)",
|
|
646
|
+
},
|
|
647
|
+
},
|
|
648
|
+
}),
|
|
649
|
+
);
|
|
650
|
+
|
|
651
|
+
export const DocsArticleRoot = customizeComponent(
|
|
652
|
+
"DocsArticle",
|
|
653
|
+
{ as: "main" },
|
|
654
|
+
tasty({
|
|
655
|
+
as: "main",
|
|
656
|
+
styles: {
|
|
657
|
+
inlineSize: "min(100%, $content-width)",
|
|
658
|
+
padding: "($gap * 3) clamp(1.5rem, 5vw, 4rem) ($gap * 10)",
|
|
659
|
+
},
|
|
660
|
+
}),
|
|
661
|
+
);
|
|
662
|
+
|
|
663
|
+
export const SearchDialogRoot = customizeComponent(
|
|
664
|
+
"SearchDialog",
|
|
665
|
+
{ as: "dialog" },
|
|
666
|
+
tasty({
|
|
667
|
+
as: "dialog",
|
|
668
|
+
styles: {
|
|
669
|
+
inlineSize: "min(42rem, calc(100% - 2rem))",
|
|
670
|
+
padding: "($gap * 2.5)",
|
|
671
|
+
color: "#text",
|
|
672
|
+
fill: "#surface",
|
|
673
|
+
border: "$border-width solid #border-strong",
|
|
674
|
+
radius: "$card-radius",
|
|
675
|
+
shadow: "$sl-shadow-lg",
|
|
676
|
+
Backdrop: { $: "&::backdrop", fill: "#overlay" },
|
|
677
|
+
Form: { $: "form", float: "inline-end" },
|
|
678
|
+
LabelAndInput: {
|
|
679
|
+
$: "label, input",
|
|
680
|
+
display: "block",
|
|
681
|
+
inlineSize: "100%",
|
|
682
|
+
},
|
|
683
|
+
Input: {
|
|
684
|
+
$: "input",
|
|
685
|
+
marginBlock: "$gap ($gap * 2)",
|
|
686
|
+
paddingInline: "($gap * 1.5)",
|
|
687
|
+
color: "#text",
|
|
688
|
+
border: true,
|
|
689
|
+
radius: "$radius",
|
|
690
|
+
fill: "#surface",
|
|
691
|
+
},
|
|
692
|
+
Close: {
|
|
693
|
+
$: 'button[aria-label="Close search"]',
|
|
694
|
+
display: "grid",
|
|
695
|
+
placeItems: "center",
|
|
696
|
+
inlineSize: "$control-height",
|
|
697
|
+
padding: "0",
|
|
698
|
+
overflow: "hidden",
|
|
699
|
+
color: "#clear",
|
|
700
|
+
border: true,
|
|
701
|
+
radius: "$radius",
|
|
702
|
+
fill: {
|
|
703
|
+
"": "#surface-2",
|
|
704
|
+
":hover": "#surface-2-hover",
|
|
705
|
+
":active": "#surface-2-pressed",
|
|
706
|
+
},
|
|
707
|
+
},
|
|
708
|
+
CloseIcon: {
|
|
709
|
+
$: 'button[aria-label="Close search"]::before',
|
|
710
|
+
content: '""',
|
|
711
|
+
inlineSize: "1rem",
|
|
712
|
+
blockSize: "1rem",
|
|
713
|
+
color: "#text",
|
|
714
|
+
fill: "#current",
|
|
715
|
+
mask: `url("${svgIconUrl(closeIcon)}") center / contain no-repeat`,
|
|
716
|
+
},
|
|
717
|
+
},
|
|
718
|
+
}),
|
|
719
|
+
);
|
|
720
|
+
|
|
721
|
+
export const SkipLinkRoot = customizeComponent(
|
|
722
|
+
"SkipLink",
|
|
723
|
+
{ as: "a" },
|
|
724
|
+
tasty({
|
|
725
|
+
as: "a",
|
|
726
|
+
styles: {
|
|
727
|
+
position: "fixed",
|
|
728
|
+
inset: "$gap auto auto $gap",
|
|
729
|
+
zIndex: "4",
|
|
730
|
+
translate: { "": "0 -150%", ":focus": "0" },
|
|
731
|
+
padding: "$gap ($gap * 1.5)",
|
|
732
|
+
color: "#accent-surface-text",
|
|
733
|
+
radius: "$radius",
|
|
734
|
+
fill: "#accent-surface",
|
|
735
|
+
},
|
|
736
|
+
}),
|
|
737
|
+
);
|
|
738
|
+
|
|
739
|
+
export const VisuallyHiddenRoot = tasty({
|
|
740
|
+
as: "span",
|
|
741
|
+
styles: {
|
|
742
|
+
position: "absolute",
|
|
743
|
+
inlineSize: "1px",
|
|
744
|
+
blockSize: "1px",
|
|
745
|
+
padding: "0",
|
|
746
|
+
margin: "-1px",
|
|
747
|
+
overflow: "hidden",
|
|
748
|
+
clip: "rect(0, 0, 0, 0)",
|
|
749
|
+
whiteSpace: "nowrap",
|
|
750
|
+
border: "0",
|
|
751
|
+
},
|
|
752
|
+
});
|