@docs-sdk-dev/solid 0.0.1 → 0.0.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.
- package/README.md +1 -1
- package/assets/agent.ts +11 -0
- package/assets/client.tsx +57 -41
- package/assets/copy.ts +30 -0
- package/assets/examples.tsx +96 -0
- package/assets/highlight.ts +64 -0
- package/assets/labels.ts +109 -0
- package/assets/render.tsx +173 -35
- package/assets/search.tsx +99 -0
- package/assets/style.css +556 -3
- package/assets/virtual.d.ts +6 -0
- package/dist/component-reference.d.ts +38 -3
- package/dist/component-reference.js +125 -29
- package/dist/index.d.ts +37 -3
- package/dist/index.js +144 -16
- package/package.json +5 -3
package/assets/style.css
CHANGED
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
--muted: #5d5d5d;
|
|
6
6
|
--line: #e5e5e5;
|
|
7
7
|
--subtle: #f3f3f3;
|
|
8
|
+
--control: #8a8a8a;
|
|
8
9
|
--accent: #204fd6;
|
|
10
|
+
--on-accent: #ffffff;
|
|
9
11
|
font: 15px/1.65 system-ui,sans-serif;
|
|
10
12
|
}
|
|
11
13
|
@media(prefers-color-scheme:dark) {
|
|
@@ -15,7 +17,9 @@
|
|
|
15
17
|
--muted: #b7b7b7;
|
|
16
18
|
--line: #353535;
|
|
17
19
|
--subtle: #212121;
|
|
20
|
+
--control: #707070;
|
|
18
21
|
--accent: #a8bbff;
|
|
22
|
+
--on-accent: #111a33;
|
|
19
23
|
}
|
|
20
24
|
}
|
|
21
25
|
* {
|
|
@@ -56,6 +60,9 @@ button {
|
|
|
56
60
|
border-bottom: 1px solid var(--line);
|
|
57
61
|
height: 64px;
|
|
58
62
|
}
|
|
63
|
+
.brand {
|
|
64
|
+
white-space: nowrap;
|
|
65
|
+
}
|
|
59
66
|
.brand {
|
|
60
67
|
font-size: 17px;
|
|
61
68
|
font-weight: 650;
|
|
@@ -65,12 +72,122 @@ button {
|
|
|
65
72
|
display: flex;
|
|
66
73
|
gap: 1.3rem;
|
|
67
74
|
}
|
|
68
|
-
.bar nav
|
|
75
|
+
.bar nav {
|
|
69
76
|
font-size: 14px;
|
|
70
77
|
color: var(--muted);
|
|
71
78
|
}
|
|
72
|
-
|
|
79
|
+
|
|
80
|
+
.search {
|
|
81
|
+
margin-left: auto;
|
|
82
|
+
}
|
|
83
|
+
.search > button,
|
|
84
|
+
.search [data-slot="dialog-trigger"] {
|
|
85
|
+
display: inline-flex;
|
|
86
|
+
align-items: center;
|
|
87
|
+
gap: .6rem;
|
|
88
|
+
border: 1px solid var(--control);
|
|
89
|
+
border-radius: 8px;
|
|
90
|
+
background: var(--bg);
|
|
91
|
+
color: var(--muted);
|
|
92
|
+
padding: .3rem .55rem .3rem .75rem;
|
|
93
|
+
font-size: 14px;
|
|
94
|
+
min-width: 11rem;
|
|
95
|
+
cursor: pointer;
|
|
96
|
+
}
|
|
97
|
+
.search [data-slot="dialog-shortcut"] {
|
|
73
98
|
margin-left: auto;
|
|
99
|
+
font: 12px ui-monospace,monospace;
|
|
100
|
+
border: 1px solid var(--line);
|
|
101
|
+
border-radius: 4px;
|
|
102
|
+
padding: 0 .3rem;
|
|
103
|
+
}
|
|
104
|
+
/* A keyboard shortcut means nothing on a touch-only device, such as a phone. */
|
|
105
|
+
@media not (any-pointer: fine) {
|
|
106
|
+
.search [data-slot="dialog-shortcut"] {
|
|
107
|
+
display: none;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
[data-slot="dialog-backdrop"] {
|
|
111
|
+
position: fixed;
|
|
112
|
+
inset: 0;
|
|
113
|
+
background: rgb(0 0 0 / .35);
|
|
114
|
+
}
|
|
115
|
+
[data-slot="dialog-content"] {
|
|
116
|
+
position: fixed;
|
|
117
|
+
inset: 12vh auto auto 50%;
|
|
118
|
+
transform: translateX(-50%);
|
|
119
|
+
width: min(640px, calc(100vw - 2rem));
|
|
120
|
+
max-height: 70vh;
|
|
121
|
+
display: flex;
|
|
122
|
+
flex-direction: column;
|
|
123
|
+
margin: 0;
|
|
124
|
+
padding: 0;
|
|
125
|
+
border: 1px solid var(--line);
|
|
126
|
+
border-radius: 12px;
|
|
127
|
+
background: var(--bg);
|
|
128
|
+
color: var(--fg);
|
|
129
|
+
box-shadow: 0 20px 50px rgb(0 0 0 / .25);
|
|
130
|
+
overflow: hidden;
|
|
131
|
+
}
|
|
132
|
+
[data-slot="dialog-title"] {
|
|
133
|
+
position: absolute;
|
|
134
|
+
width: 1px;
|
|
135
|
+
height: 1px;
|
|
136
|
+
overflow: hidden;
|
|
137
|
+
clip-path: inset(50%);
|
|
138
|
+
}
|
|
139
|
+
[data-slot="command"] {
|
|
140
|
+
display: flex;
|
|
141
|
+
flex-direction: column;
|
|
142
|
+
min-height: 0;
|
|
143
|
+
}
|
|
144
|
+
[data-slot="command-input"] {
|
|
145
|
+
font: inherit;
|
|
146
|
+
font-size: 16px;
|
|
147
|
+
color: inherit;
|
|
148
|
+
background: transparent;
|
|
149
|
+
border: 0;
|
|
150
|
+
border-bottom: 1px solid var(--control);
|
|
151
|
+
padding: .9rem 1rem;
|
|
152
|
+
outline: none;
|
|
153
|
+
}
|
|
154
|
+
[data-slot="command-empty"] {
|
|
155
|
+
padding: 1rem;
|
|
156
|
+
color: var(--muted);
|
|
157
|
+
font-size: 14px;
|
|
158
|
+
}
|
|
159
|
+
[data-slot="command-empty"]:not([data-empty]) {
|
|
160
|
+
display: none;
|
|
161
|
+
}
|
|
162
|
+
[data-slot="command-list"] {
|
|
163
|
+
overflow-y: auto;
|
|
164
|
+
padding: .4rem;
|
|
165
|
+
}
|
|
166
|
+
[data-slot="command-list"]:empty {
|
|
167
|
+
display: none;
|
|
168
|
+
}
|
|
169
|
+
[data-slot="command-item"] {
|
|
170
|
+
display: flex;
|
|
171
|
+
flex-direction: column;
|
|
172
|
+
gap: .15rem;
|
|
173
|
+
padding: .55rem .7rem;
|
|
174
|
+
border-radius: 8px;
|
|
175
|
+
cursor: pointer;
|
|
176
|
+
}
|
|
177
|
+
[data-slot="command-item"][data-highlighted] {
|
|
178
|
+
background: var(--subtle);
|
|
179
|
+
box-shadow: inset 3px 0 0 var(--accent);
|
|
180
|
+
}
|
|
181
|
+
[data-search="title"] {
|
|
182
|
+
font-weight: 600;
|
|
183
|
+
font-size: 14px;
|
|
184
|
+
}
|
|
185
|
+
[data-search="snippet"] {
|
|
186
|
+
color: var(--muted);
|
|
187
|
+
font-size: 13px;
|
|
188
|
+
overflow: hidden;
|
|
189
|
+
text-overflow: ellipsis;
|
|
190
|
+
white-space: nowrap;
|
|
74
191
|
}
|
|
75
192
|
.layout {
|
|
76
193
|
display: grid;
|
|
@@ -92,6 +209,19 @@ button {
|
|
|
92
209
|
font-size: 13px;
|
|
93
210
|
font-weight: 650;
|
|
94
211
|
}
|
|
212
|
+
/* On large sites another group is one link: it reads as that group's heading, with an arrow saying it leads there. */
|
|
213
|
+
.sidebar [data-collapsed] a {
|
|
214
|
+
display: inline;
|
|
215
|
+
padding: 0;
|
|
216
|
+
color: inherit;
|
|
217
|
+
}
|
|
218
|
+
.sidebar [data-collapsed] a::after {
|
|
219
|
+
content: " →" / "";
|
|
220
|
+
color: var(--muted);
|
|
221
|
+
}
|
|
222
|
+
.sidebar [data-collapsed] a:hover {
|
|
223
|
+
text-decoration: underline;
|
|
224
|
+
}
|
|
95
225
|
.sidebar a,.outline a {
|
|
96
226
|
display: block;
|
|
97
227
|
color: var(--muted);
|
|
@@ -102,10 +232,36 @@ button {
|
|
|
102
232
|
padding-left: .55rem;
|
|
103
233
|
border-radius: 5px;
|
|
104
234
|
}
|
|
235
|
+
/* Nested scopes are folders: a summary line, then their pages and folders indented beneath. */
|
|
236
|
+
.nav-folder {
|
|
237
|
+
margin: .15rem 0;
|
|
238
|
+
}
|
|
239
|
+
.nav-folder > summary {
|
|
240
|
+
cursor: pointer;
|
|
241
|
+
font-size: 13px;
|
|
242
|
+
padding: .2rem 0;
|
|
243
|
+
color: var(--muted);
|
|
244
|
+
}
|
|
245
|
+
.nav-folder[open] > summary {
|
|
246
|
+
color: var(--fg);
|
|
247
|
+
}
|
|
248
|
+
.nav-folder > :not(summary) {
|
|
249
|
+
margin-left: .75rem;
|
|
250
|
+
}
|
|
251
|
+
.nav-folder[data-collapsed] {
|
|
252
|
+
font-size: 13px;
|
|
253
|
+
padding: .2rem 0;
|
|
254
|
+
}
|
|
255
|
+
/* Wider screens show the open copy of the navigation; phones show the Menu copy (see the 560px rules). */
|
|
256
|
+
.nav-mobile {
|
|
257
|
+
display: none;
|
|
258
|
+
}
|
|
259
|
+
/* The current page carries the accent, so it is found at a glance in a long sidebar. */
|
|
105
260
|
.sidebar [aria-current] {
|
|
106
261
|
background: var(--subtle);
|
|
107
|
-
color: var(--
|
|
262
|
+
color: var(--accent);
|
|
108
263
|
font-weight: 600;
|
|
264
|
+
box-shadow: inset 2px 0 0 var(--accent);
|
|
109
265
|
}
|
|
110
266
|
main {
|
|
111
267
|
padding: 3rem 0 5rem;
|
|
@@ -123,6 +279,63 @@ h1 {
|
|
|
123
279
|
letter-spacing: -.055em;
|
|
124
280
|
margin: .55rem 0 1.5rem;
|
|
125
281
|
}
|
|
282
|
+
/* Edition parts from Core: one row per dimension, each value a pill; a value without that edition is plain, muted text.
|
|
283
|
+
Styled by the parts' attributes, as UI SDK parts are. Works without scripts. */
|
|
284
|
+
[data-slot="editions"] {
|
|
285
|
+
display: grid;
|
|
286
|
+
gap: .45rem;
|
|
287
|
+
margin: -.75rem 0 1.5rem;
|
|
288
|
+
font-size: 13px;
|
|
289
|
+
}
|
|
290
|
+
[data-slot="edition-dimension"] {
|
|
291
|
+
display: flex;
|
|
292
|
+
flex-wrap: wrap;
|
|
293
|
+
align-items: baseline;
|
|
294
|
+
gap: .4rem .6rem;
|
|
295
|
+
}
|
|
296
|
+
[data-slot="edition-dimension"] > span {
|
|
297
|
+
min-width: 4.5rem;
|
|
298
|
+
color: var(--muted);
|
|
299
|
+
}
|
|
300
|
+
[data-slot="edition-dimension"] ul,
|
|
301
|
+
[data-slot="edition-list"] ul {
|
|
302
|
+
display: flex;
|
|
303
|
+
flex-wrap: wrap;
|
|
304
|
+
gap: .4rem;
|
|
305
|
+
margin: 0;
|
|
306
|
+
padding: 0;
|
|
307
|
+
list-style: none;
|
|
308
|
+
}
|
|
309
|
+
[data-slot="edition-dimension"] a,
|
|
310
|
+
[data-slot="edition-list"] a,
|
|
311
|
+
[data-unavailable] {
|
|
312
|
+
display: inline-block;
|
|
313
|
+
border: 1px solid var(--line);
|
|
314
|
+
border-radius: 999px;
|
|
315
|
+
padding: .1rem .65rem;
|
|
316
|
+
color: var(--muted);
|
|
317
|
+
}
|
|
318
|
+
[data-unavailable] {
|
|
319
|
+
border-style: dashed;
|
|
320
|
+
opacity: .75;
|
|
321
|
+
}
|
|
322
|
+
[data-slot="editions"] [aria-current] {
|
|
323
|
+
background: var(--subtle);
|
|
324
|
+
color: var(--fg);
|
|
325
|
+
font-weight: 600;
|
|
326
|
+
}
|
|
327
|
+
[data-slot="edition-list"] summary {
|
|
328
|
+
color: var(--muted);
|
|
329
|
+
cursor: pointer;
|
|
330
|
+
}
|
|
331
|
+
[data-slot="edition-list"] nav {
|
|
332
|
+
margin-top: .45rem;
|
|
333
|
+
}
|
|
334
|
+
.bar nav [aria-current] {
|
|
335
|
+
text-decoration: underline 2px var(--accent);
|
|
336
|
+
text-underline-offset: 8px;
|
|
337
|
+
color: var(--fg);
|
|
338
|
+
}
|
|
126
339
|
h2 {
|
|
127
340
|
font-size: 1.4rem;
|
|
128
341
|
letter-spacing: -.025em;
|
|
@@ -138,9 +351,41 @@ section {
|
|
|
138
351
|
.outline {
|
|
139
352
|
padding-top: 3rem;
|
|
140
353
|
}
|
|
354
|
+
.outline a[data-level="2"] {
|
|
355
|
+
padding-inline-start: .75rem;
|
|
356
|
+
}
|
|
141
357
|
.download {
|
|
142
358
|
margin-top: 1.15rem;
|
|
143
359
|
}
|
|
360
|
+
.pager {
|
|
361
|
+
display: flex;
|
|
362
|
+
justify-content: space-between;
|
|
363
|
+
gap: 1rem;
|
|
364
|
+
margin-top: 3rem;
|
|
365
|
+
padding-top: 1.25rem;
|
|
366
|
+
border-top: 1px solid var(--line);
|
|
367
|
+
}
|
|
368
|
+
.pager a {
|
|
369
|
+
display: flex;
|
|
370
|
+
flex-direction: column;
|
|
371
|
+
max-width: 48%;
|
|
372
|
+
color: var(--fg);
|
|
373
|
+
text-decoration: none;
|
|
374
|
+
}
|
|
375
|
+
.pager a[rel="next"] {
|
|
376
|
+
margin-inline-start: auto;
|
|
377
|
+
text-align: end;
|
|
378
|
+
}
|
|
379
|
+
.pager span {
|
|
380
|
+
color: var(--muted);
|
|
381
|
+
font-size: 13px;
|
|
382
|
+
}
|
|
383
|
+
.pager a:hover {
|
|
384
|
+
color: var(--accent);
|
|
385
|
+
}
|
|
386
|
+
.outline .edit {
|
|
387
|
+
margin-top: .1rem;
|
|
388
|
+
}
|
|
144
389
|
pre,table,.example:not(:empty) {
|
|
145
390
|
border: 1px solid var(--line);
|
|
146
391
|
border-radius: 8px;
|
|
@@ -153,11 +398,49 @@ pre {
|
|
|
153
398
|
code {
|
|
154
399
|
font-size: .89em;
|
|
155
400
|
}
|
|
401
|
+
/* Highlighted code: each token carries its light and dark colors; the color scheme picks one. */
|
|
402
|
+
pre[data-highlighted] span[style] {
|
|
403
|
+
color: var(--docs-token-light);
|
|
404
|
+
}
|
|
405
|
+
@media(prefers-color-scheme:dark) {
|
|
406
|
+
pre[data-highlighted] span[style] {
|
|
407
|
+
color: var(--docs-token-dark);
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
/* A titled code block: the title sits on top of the block as one bordered unit. */
|
|
411
|
+
.prose figure {
|
|
412
|
+
margin: 1rem 0;
|
|
413
|
+
}
|
|
414
|
+
.prose figcaption {
|
|
415
|
+
padding: .4rem 1rem;
|
|
416
|
+
font: 13px ui-monospace,monospace;
|
|
417
|
+
border: 1px solid var(--line);
|
|
418
|
+
border-bottom: 0;
|
|
419
|
+
border-radius: 8px 8px 0 0;
|
|
420
|
+
background: var(--bg);
|
|
421
|
+
}
|
|
422
|
+
.prose figcaption + pre {
|
|
423
|
+
margin-top: 0;
|
|
424
|
+
border-top-left-radius: 0;
|
|
425
|
+
border-top-right-radius: 0;
|
|
426
|
+
}
|
|
156
427
|
table {
|
|
157
428
|
border-spacing: 0;
|
|
158
429
|
width: 100%;
|
|
159
430
|
font-size: 14px;
|
|
160
431
|
}
|
|
432
|
+
/* A table wider than the column scrolls inside its box; the table keeps its border and full width when it fits. */
|
|
433
|
+
.table-scroll {
|
|
434
|
+
overflow-x: auto;
|
|
435
|
+
margin: 1rem 0;
|
|
436
|
+
}
|
|
437
|
+
.table-scroll > table {
|
|
438
|
+
margin: 0;
|
|
439
|
+
}
|
|
440
|
+
.table-scroll:focus-visible {
|
|
441
|
+
outline: 2px solid var(--accent);
|
|
442
|
+
outline-offset: 2px;
|
|
443
|
+
}
|
|
161
444
|
th,td {
|
|
162
445
|
text-align: left;
|
|
163
446
|
padding: .5rem .75rem;
|
|
@@ -206,14 +489,37 @@ tr:last-child td {
|
|
|
206
489
|
padding: 0 1rem;
|
|
207
490
|
gap: 1rem;
|
|
208
491
|
}
|
|
492
|
+
.bar nav {
|
|
493
|
+
display: none;
|
|
494
|
+
}
|
|
495
|
+
.search > button,
|
|
496
|
+
.search [data-slot="dialog-trigger"] {
|
|
497
|
+
min-width: 0;
|
|
498
|
+
}
|
|
209
499
|
.sidebar {
|
|
210
500
|
border: 0;
|
|
211
501
|
border-bottom: 1px solid var(--line);
|
|
212
502
|
padding: 1rem 0;
|
|
503
|
+
}
|
|
504
|
+
.nav-groups {
|
|
213
505
|
display: flex;
|
|
214
506
|
flex-wrap: wrap;
|
|
215
507
|
gap: .75rem 1.15rem;
|
|
216
508
|
}
|
|
509
|
+
.nav-desktop {
|
|
510
|
+
display: none;
|
|
511
|
+
}
|
|
512
|
+
.nav-mobile {
|
|
513
|
+
display: block;
|
|
514
|
+
}
|
|
515
|
+
.nav-mobile > summary {
|
|
516
|
+
cursor: pointer;
|
|
517
|
+
font-weight: 600;
|
|
518
|
+
padding: .25rem 0;
|
|
519
|
+
}
|
|
520
|
+
.nav-mobile[open] > summary {
|
|
521
|
+
margin-bottom: .75rem;
|
|
522
|
+
}
|
|
217
523
|
.nav-group {
|
|
218
524
|
margin: 0;
|
|
219
525
|
}
|
|
@@ -224,3 +530,250 @@ tr:last-child td {
|
|
|
224
530
|
padding: 1.5rem 0;
|
|
225
531
|
}
|
|
226
532
|
}
|
|
533
|
+
.prose pre.has-copy {
|
|
534
|
+
position: relative;
|
|
535
|
+
}
|
|
536
|
+
/* On a phone the code's first line runs under the button; give the button its own row above the code instead. */
|
|
537
|
+
@media(max-width:560px) {
|
|
538
|
+
.prose pre.has-copy {
|
|
539
|
+
padding-top: 2.75rem;
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
.copy {
|
|
543
|
+
position: absolute;
|
|
544
|
+
inset-block-start: .5rem;
|
|
545
|
+
inset-inline-end: .5rem;
|
|
546
|
+
font: inherit;
|
|
547
|
+
font-size: 12px;
|
|
548
|
+
padding: .15rem .5rem;
|
|
549
|
+
color: var(--fg);
|
|
550
|
+
background: var(--bg);
|
|
551
|
+
border: 1px solid var(--control);
|
|
552
|
+
border-radius: 6px;
|
|
553
|
+
cursor: pointer;
|
|
554
|
+
}
|
|
555
|
+
.copy:focus-visible {
|
|
556
|
+
outline: 2px solid var(--accent);
|
|
557
|
+
outline-offset: 2px;
|
|
558
|
+
}
|
|
559
|
+
.visually-hidden {
|
|
560
|
+
position: absolute;
|
|
561
|
+
width: 1px;
|
|
562
|
+
height: 1px;
|
|
563
|
+
overflow: hidden;
|
|
564
|
+
clip-path: inset(50%);
|
|
565
|
+
white-space: nowrap;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
/* The home layout: the site's name, the page's description as the lead, its actions, then its content. The page's
|
|
569
|
+
first list shows as cards; it stays a plain list in the Markdown agents read. */
|
|
570
|
+
.layout[data-layout="home"] {
|
|
571
|
+
grid-template-columns: 220px minmax(0,1fr);
|
|
572
|
+
max-width: 1180px;
|
|
573
|
+
}
|
|
574
|
+
.hero {
|
|
575
|
+
padding: 1.5rem 0 2.5rem;
|
|
576
|
+
border-bottom: 1px solid var(--line);
|
|
577
|
+
margin-bottom: 2rem;
|
|
578
|
+
}
|
|
579
|
+
.hero h1 {
|
|
580
|
+
font-size: clamp(2.6rem, 6vw, 4rem);
|
|
581
|
+
margin: 0 0 .75rem;
|
|
582
|
+
}
|
|
583
|
+
.hero .lead {
|
|
584
|
+
max-width: 38rem;
|
|
585
|
+
margin: 0;
|
|
586
|
+
font-size: 1.2rem;
|
|
587
|
+
line-height: 1.55;
|
|
588
|
+
color: var(--muted);
|
|
589
|
+
text-wrap: pretty;
|
|
590
|
+
}
|
|
591
|
+
.actions {
|
|
592
|
+
display: flex;
|
|
593
|
+
flex-wrap: wrap;
|
|
594
|
+
gap: .75rem;
|
|
595
|
+
margin-top: 1.75rem;
|
|
596
|
+
}
|
|
597
|
+
.action {
|
|
598
|
+
display: inline-flex;
|
|
599
|
+
align-items: center;
|
|
600
|
+
min-height: 2.5rem;
|
|
601
|
+
padding: 0 1.1rem;
|
|
602
|
+
border: 1px solid var(--line);
|
|
603
|
+
border-radius: 999px;
|
|
604
|
+
font-weight: 600;
|
|
605
|
+
font-size: 14px;
|
|
606
|
+
}
|
|
607
|
+
.action[data-primary] {
|
|
608
|
+
background: var(--accent);
|
|
609
|
+
border-color: var(--accent);
|
|
610
|
+
color: var(--on-accent);
|
|
611
|
+
}
|
|
612
|
+
.action:hover {
|
|
613
|
+
text-decoration: none;
|
|
614
|
+
border-color: var(--accent);
|
|
615
|
+
}
|
|
616
|
+
.action:focus-visible {
|
|
617
|
+
outline: 2px solid var(--accent);
|
|
618
|
+
outline-offset: 2px;
|
|
619
|
+
}
|
|
620
|
+
[data-layout="home"] main section:first-of-type .prose > ul:first-of-type {
|
|
621
|
+
display: grid;
|
|
622
|
+
grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
|
|
623
|
+
gap: 1rem;
|
|
624
|
+
padding: 0;
|
|
625
|
+
list-style: none;
|
|
626
|
+
}
|
|
627
|
+
[data-layout="home"] main section:first-of-type .prose > ul:first-of-type > li {
|
|
628
|
+
margin: 0;
|
|
629
|
+
padding: 1rem 1.1rem;
|
|
630
|
+
border: 1px solid var(--line);
|
|
631
|
+
border-radius: 12px;
|
|
632
|
+
background: var(--subtle);
|
|
633
|
+
}
|
|
634
|
+
[data-layout="home"] main section:first-of-type .prose > ul:first-of-type > li > strong:first-child {
|
|
635
|
+
display: block;
|
|
636
|
+
margin-bottom: .3rem;
|
|
637
|
+
}
|
|
638
|
+
.site-footer {
|
|
639
|
+
display: flex;
|
|
640
|
+
flex-wrap: wrap;
|
|
641
|
+
gap: .5rem 1.25rem;
|
|
642
|
+
max-width: 1340px;
|
|
643
|
+
margin: 0 auto;
|
|
644
|
+
padding: 1.5rem 2rem 2.5rem;
|
|
645
|
+
border-top: 1px solid var(--line);
|
|
646
|
+
font-size: 13px;
|
|
647
|
+
color: var(--muted);
|
|
648
|
+
}
|
|
649
|
+
.site-footer span {
|
|
650
|
+
font-weight: 600;
|
|
651
|
+
}
|
|
652
|
+
@media(max-width:900px) {
|
|
653
|
+
.layout[data-layout="home"] {
|
|
654
|
+
grid-template-columns: 175px minmax(0,1fr);
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
@media(max-width:560px) {
|
|
658
|
+
.hero h1 {
|
|
659
|
+
font-size: 2.4rem;
|
|
660
|
+
}
|
|
661
|
+
.site-footer {
|
|
662
|
+
padding: 1.25rem 1rem 2rem;
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
/* The props playground: one row per prop, generated from the component's prop facts. UI SDK parts are unstyled; these
|
|
667
|
+
rules follow their data-slot and state attributes. */
|
|
668
|
+
.playground-controls {
|
|
669
|
+
display: grid;
|
|
670
|
+
grid-template-columns: max-content minmax(0, 1fr);
|
|
671
|
+
gap: .6rem 1rem;
|
|
672
|
+
align-items: center;
|
|
673
|
+
margin: 1rem 0 0;
|
|
674
|
+
padding: 1rem;
|
|
675
|
+
border: 1px solid var(--line);
|
|
676
|
+
border-radius: 10px;
|
|
677
|
+
font-size: 13px;
|
|
678
|
+
}
|
|
679
|
+
.playground-controls legend {
|
|
680
|
+
padding: 0 .35rem;
|
|
681
|
+
font-weight: 600;
|
|
682
|
+
color: var(--muted);
|
|
683
|
+
}
|
|
684
|
+
.playground-controls .control,
|
|
685
|
+
.playground-controls [data-slot="select"] {
|
|
686
|
+
display: contents;
|
|
687
|
+
}
|
|
688
|
+
.playground-controls [data-slot="field-label"],
|
|
689
|
+
.playground-controls .control > span,
|
|
690
|
+
.playground-controls [data-slot="select-label"] {
|
|
691
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
692
|
+
color: var(--fg);
|
|
693
|
+
}
|
|
694
|
+
.playground-controls input,
|
|
695
|
+
.playground-controls [data-slot="select-trigger"] {
|
|
696
|
+
width: 100%;
|
|
697
|
+
min-height: 2rem;
|
|
698
|
+
padding: 0 .6rem;
|
|
699
|
+
border: 1px solid var(--line);
|
|
700
|
+
border-radius: 6px;
|
|
701
|
+
background: var(--bg);
|
|
702
|
+
color: var(--fg);
|
|
703
|
+
font: inherit;
|
|
704
|
+
text-align: start;
|
|
705
|
+
}
|
|
706
|
+
.playground-controls input:focus-visible,
|
|
707
|
+
.playground-controls [data-slot="select-trigger"]:focus-visible,
|
|
708
|
+
.playground-controls [data-slot="switch"]:focus-visible,
|
|
709
|
+
.playground-reset:focus-visible {
|
|
710
|
+
outline: 2px solid var(--accent);
|
|
711
|
+
outline-offset: 2px;
|
|
712
|
+
}
|
|
713
|
+
[data-slot="switch"] {
|
|
714
|
+
position: relative;
|
|
715
|
+
width: 2.25rem;
|
|
716
|
+
height: 1.3rem;
|
|
717
|
+
padding: 0;
|
|
718
|
+
border: 1px solid var(--control);
|
|
719
|
+
border-radius: 999px;
|
|
720
|
+
background: var(--subtle);
|
|
721
|
+
cursor: pointer;
|
|
722
|
+
justify-self: start;
|
|
723
|
+
}
|
|
724
|
+
[data-slot="switch"][data-checked] {
|
|
725
|
+
background: var(--accent);
|
|
726
|
+
border-color: var(--accent);
|
|
727
|
+
}
|
|
728
|
+
[data-slot="switch-thumb"] {
|
|
729
|
+
position: absolute;
|
|
730
|
+
inset-block-start: 2px;
|
|
731
|
+
inset-inline-start: 2px;
|
|
732
|
+
width: calc(1.3rem - 6px);
|
|
733
|
+
height: calc(1.3rem - 6px);
|
|
734
|
+
border-radius: 50%;
|
|
735
|
+
background: var(--control);
|
|
736
|
+
transition: translate .15s ease;
|
|
737
|
+
}
|
|
738
|
+
[data-slot="switch-thumb"][data-checked] {
|
|
739
|
+
background: var(--on-accent);
|
|
740
|
+
translate: .95rem 0;
|
|
741
|
+
}
|
|
742
|
+
[dir="rtl"] [data-slot="switch-thumb"][data-checked] {
|
|
743
|
+
translate: -.95rem 0;
|
|
744
|
+
}
|
|
745
|
+
@media (prefers-reduced-motion: reduce) {
|
|
746
|
+
[data-slot="switch-thumb"] {
|
|
747
|
+
transition: none;
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
[data-slot="select-content"] {
|
|
751
|
+
min-width: 10rem;
|
|
752
|
+
padding: .25rem;
|
|
753
|
+
border: 1px solid var(--line);
|
|
754
|
+
border-radius: 8px;
|
|
755
|
+
background: var(--bg);
|
|
756
|
+
box-shadow: 0 8px 24px rgb(0 0 0 / .12);
|
|
757
|
+
}
|
|
758
|
+
[data-slot="select-item"] {
|
|
759
|
+
padding: .35rem .6rem;
|
|
760
|
+
border-radius: 5px;
|
|
761
|
+
cursor: pointer;
|
|
762
|
+
}
|
|
763
|
+
[data-slot="select-item"][data-highlighted] {
|
|
764
|
+
background: var(--subtle);
|
|
765
|
+
}
|
|
766
|
+
[data-slot="select-item"][data-selected] {
|
|
767
|
+
color: var(--accent);
|
|
768
|
+
font-weight: 600;
|
|
769
|
+
}
|
|
770
|
+
.playground-reset {
|
|
771
|
+
grid-column: 1 / -1;
|
|
772
|
+
justify-self: start;
|
|
773
|
+
margin-top: .25rem;
|
|
774
|
+
padding: .3rem .8rem;
|
|
775
|
+
border: 1px solid var(--line);
|
|
776
|
+
border-radius: 999px;
|
|
777
|
+
background: none;
|
|
778
|
+
cursor: pointer;
|
|
779
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
declare module "virtual:docs-examples" {
|
|
2
|
+
import type { JSX } from "@solidjs/web"
|
|
3
|
+
/** Declared example sources mapped to their on-demand loaders, generated per build. */
|
|
4
|
+
const examples: Record<string, () => Promise<{ default: () => JSX.Element }>>
|
|
5
|
+
export default examples
|
|
6
|
+
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { type Entry, type ReadSource } from "@docs-sdk-dev/core";
|
|
1
|
+
import { type Entry, type ExampleControls, type ReadSource } from "@docs-sdk-dev/core";
|
|
2
|
+
import { type PropFact } from "@docs-sdk-dev/typescript";
|
|
3
|
+
export type { PropFact } from "@docs-sdk-dev/typescript";
|
|
2
4
|
type ComponentInput = {
|
|
3
5
|
source: string;
|
|
4
6
|
export: string;
|
|
@@ -6,15 +8,48 @@ type ComponentInput = {
|
|
|
6
8
|
summary: string;
|
|
7
9
|
accessibility: string;
|
|
8
10
|
};
|
|
11
|
+
type Ids = {
|
|
12
|
+
component: string;
|
|
13
|
+
symbol: string;
|
|
14
|
+
example: string;
|
|
15
|
+
};
|
|
9
16
|
type ComponentData = ComponentInput & {
|
|
10
17
|
code: string;
|
|
11
|
-
|
|
18
|
+
props: PropFact[];
|
|
12
19
|
revision: string;
|
|
20
|
+
ids: Ids;
|
|
21
|
+
text: PresetText;
|
|
22
|
+
controls?: ExampleControls;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* The text this preset writes inside sections, per locale. `{source}`, `{name}`, `{web}` and `{revision}` are filled in
|
|
26
|
+
* as inline code. Section titles are not here: entries name them with section overrides, like any template.
|
|
27
|
+
*/
|
|
28
|
+
export declare const englishPresetText: {
|
|
29
|
+
installation: string;
|
|
30
|
+
preview: string;
|
|
31
|
+
source: string;
|
|
32
|
+
prop: string;
|
|
33
|
+
type: string;
|
|
34
|
+
required: string;
|
|
35
|
+
default: string;
|
|
36
|
+
description: string;
|
|
37
|
+
yes: string;
|
|
38
|
+
no: string;
|
|
39
|
+
deprecated: string;
|
|
13
40
|
};
|
|
41
|
+
export type PresetText = typeof englishPresetText;
|
|
42
|
+
/** The text for a locale: project overrides, then built-in text for the locale or its language, then English. */
|
|
43
|
+
export declare function presetTextFor(locale: string | undefined, overrides?: Record<string, Partial<PresetText>>): PresetText;
|
|
44
|
+
/** Props table projected from extracted facts. The facts, not this text, are the source of truth. */
|
|
45
|
+
export declare const propsTable: (props: readonly PropFact[], text?: PresetText) => string;
|
|
14
46
|
export declare function componentReference(options: {
|
|
15
47
|
id: string;
|
|
16
48
|
scope: string;
|
|
17
49
|
templateConfig?: string;
|
|
50
|
+
/** Where the entries are declared, recorded as their provenance. */
|
|
51
|
+
source?: string;
|
|
18
52
|
entries: readonly Entry<ComponentInput>[];
|
|
53
|
+
/** Replacements for the text the preset writes, by locale or language, such as `{ fr: { required: "Obligatoire" } }`. */
|
|
54
|
+
text?: Record<string, Partial<PresetText>>;
|
|
19
55
|
}, read: ReadSource): import("@docs-sdk-dev/core").Collection<ComponentData>;
|
|
20
|
-
export {};
|