@stainless-api/docs-ui 0.1.0-beta.2 → 0.1.0-beta.20

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 (57) hide show
  1. package/dist/index.js +1312 -1871
  2. package/dist/mcp.cjs +983441 -0
  3. package/dist/routing.js +4 -4
  4. package/dist/styles/main.css +743 -747
  5. package/dist/styles/primitives.css +444 -426
  6. package/dist/styles/resets.css +33 -41
  7. package/dist/styles/search.css +265 -248
  8. package/dist/styles/sidebar.css +58 -60
  9. package/dist/styles/snippets.css +86 -88
  10. package/dist/styles/variables.css +85 -89
  11. package/package.json +19 -10
  12. package/src/components/breadcrumbs.tsx +1 -1
  13. package/src/components/chat.tsx +18 -15
  14. package/src/components/method.tsx +12 -11
  15. package/src/components/overview.tsx +32 -19
  16. package/src/components/primitives.tsx +36 -19
  17. package/src/components/properties.tsx +4 -2
  18. package/src/components/scripts/dropdown.ts +1 -1
  19. package/src/components/sdk.tsx +28 -22
  20. package/src/components/sidebar.tsx +3 -3
  21. package/src/components/snippets.tsx +29 -11
  22. package/src/contexts/component-generics.tsx +10 -15
  23. package/src/contexts/docs.tsx +15 -4
  24. package/src/contexts/index.tsx +8 -5
  25. package/src/contexts/markdown.tsx +7 -6
  26. package/src/contexts/search.tsx +4 -5
  27. package/src/hooks/use-strict-context.tsx +16 -0
  28. package/src/languages/go.tsx +3 -3
  29. package/src/languages/http.tsx +31 -23
  30. package/src/languages/index.ts +7 -7
  31. package/src/languages/java.tsx +4 -4
  32. package/src/languages/python.tsx +12 -9
  33. package/src/languages/ruby.tsx +20 -13
  34. package/src/languages/typescript.tsx +18 -12
  35. package/src/markdown/index.ts +17 -12
  36. package/src/markdown/utils.ts +6 -3
  37. package/src/routing.ts +9 -9
  38. package/src/search/form.tsx +11 -8
  39. package/src/search/indexer.ts +17 -15
  40. package/src/search/mcp.ts +108 -16
  41. package/src/search/printer.tsx +1 -1
  42. package/src/search/providers/algolia.ts +5 -5
  43. package/src/search/providers/fuse.ts +4 -4
  44. package/src/search/providers/pagefind.ts +1 -1
  45. package/src/search/providers/walker.ts +5 -3
  46. package/src/search/results.tsx +9 -7
  47. package/src/search/types.ts +2 -2
  48. package/src/style.ts +1 -1
  49. package/src/styles/main.css +743 -747
  50. package/src/styles/primitives.css +444 -426
  51. package/src/styles/resets.css +33 -41
  52. package/src/styles/search.css +265 -248
  53. package/src/styles/sidebar.css +58 -60
  54. package/src/styles/snippets.css +86 -88
  55. package/src/styles/variables.css +85 -89
  56. package/src/utils.ts +14 -15
  57. package/dist/mcp.js +0 -16003
@@ -1,572 +1,590 @@
1
- @layer docs-ui {
2
- /* Design System Defaults */
3
- .stldocs-root {
4
- font-family: var(--stldocs-font);
5
- background-color: var(--stldocs-color-bg);
1
+ /* Design System Defaults */
2
+ .stldocs-root {
3
+ font-family: var(--stldocs-font);
4
+ background-color: var(--stldocs-color-bg);
5
+ color: var(--stldocs-color-text);
6
+ letter-spacing: -0.01em;
7
+
8
+ h1 {
9
+ font-size: var(--stldocs-font-size-h1);
10
+ letter-spacing: -0.03em;
11
+ }
12
+
13
+ h2 {
14
+ font-size: var(--stldocs-font-size-h2);
15
+ letter-spacing: -0.03em;
16
+ }
17
+
18
+ h3 {
19
+ font-size: var(--stldocs-font-size-h3);
20
+ letter-spacing: -0.02em;
21
+ }
22
+
23
+ h4 {
24
+ font-size: var(--stldocs-font-size-h4);
25
+ letter-spacing: -0.02em;
26
+ }
27
+
28
+ h5 {
29
+ font-size: var(--stldocs-font-size-h5);
30
+ letter-spacing: -0.02em;
31
+ }
32
+ }
33
+
34
+ /* Color mapping for types */
35
+ .stldocs-root {
36
+ .stldocs-text-keyword {
37
+ color: var(--stldocs-color-text-muted);
38
+ }
6
39
 
7
- h1 {
8
- font-size: var(--stldocs-font-size-h1);
40
+ .stldocs-property-type,
41
+ .stldocs-property-declaration,
42
+ .stldocs-type:not(.stldocs-property-typename .stldocs-type) {
43
+ font-family: var(--stldocs-font-mono);
44
+
45
+ .stldocs-type-keyword {
46
+ color: var(--stldocs-syntax-color-orange);
9
47
  }
10
48
 
11
- h2 {
12
- font-size: var(--stldocs-font-size-h2);
49
+ .stldocs-type-string {
50
+ color: var(--stldocs-syntax-color-green);
13
51
  }
14
52
 
15
- h3 {
16
- font-size: var(--stldocs-font-size-h3);
53
+ .stldocs-type-brace,
54
+ .stldocs-type-bracket,
55
+ .stldocs-type-plain,
56
+ .stldocs-text-operator,
57
+ .stldocs-text-punctuation,
58
+ .stldocs-truncation,
59
+ .stldocs-type-array {
60
+ color: var(--stldocs-color-text-tertiary);
17
61
  }
18
62
 
19
- h4 {
20
- font-size: var(--stldocs-font-size-h4);
63
+ .stldocs-type-plain {
64
+ font-family: var(--stldocs-font);
21
65
  }
22
66
 
23
- h5 {
24
- font-size: var(--stldocs-font-size-h5);
67
+ .stldocs-type-reference {
68
+ color: var(--stldocs-syntax-color-blue);
69
+ font-weight: 600;
70
+ a:hover {
71
+ text-decoration: underline;
72
+ }
25
73
  }
26
- }
27
74
 
28
- /* Color mapping for types */
29
- .stldocs-root {
30
- .stldocs-text-keyword {
31
- color: var(--stldocs-color-text-muted);
75
+ .stldocs-literal-string {
76
+ color: var(--stldocs-syntax-color-green);
32
77
  }
33
78
 
34
- .stldocs-property-type,
35
- .stldocs-property-declaration,
36
- .stldocs-type:not(.stldocs-property-typename .stldocs-type) {
37
- font-family: var(--stldocs-font-mono);
79
+ .stldocs-literal-numeric {
80
+ color: var(--stldocs-syntax-color-orange);
81
+ }
38
82
 
39
- .stldocs-type-keyword {
40
- color: var(--stldocs-syntax-color-orange);
41
- }
83
+ .stldocs-text-identifier {
84
+ font-family: var(--stldocs-font-mono);
85
+ color: var(--stldocs-color-text);
86
+ }
42
87
 
43
- .stldocs-type-string {
44
- color: var(--stldocs-syntax-color-green);
45
- }
88
+ .stldocs-type-propertyname .stldocs-text-identifier {
89
+ font-family: var(--stldocs-font);
90
+ font-weight: 600;
91
+ }
92
+ }
46
93
 
47
- .stldocs-type-brace,
48
- .stldocs-type-bracket,
49
- .stldocs-type-plain,
50
- .stldocs-text-operator,
51
- .stldocs-text-punctuation,
94
+ [data-stldocs-language='http'] {
95
+ .stldocs-property-type,
96
+ .stldocs-property-declaration {
52
97
  .stldocs-truncation,
53
- .stldocs-type-array {
54
- color: var(--stldocs-color-text-tertiary);
55
- }
56
-
57
- .stldocs-type-plain {
98
+ .stldocs-type-array,
99
+ .stldocs-text-punctuation {
58
100
  font-family: var(--stldocs-font);
59
101
  }
102
+ }
103
+ }
104
+ }
60
105
 
61
- .stldocs-type-reference {
62
- color: var(--stldocs-syntax-color-blue);
63
- font-weight: 600;
64
- }
106
+ /* HTTP Method Color Settings */
107
+ .stldocs-root .stldocs-method-route,
108
+ .stldocs-root .stldocs-sidebar-method {
109
+ [data-method='get'] {
110
+ background: var(--stldocs-color-http-get-bg);
111
+ color: var(--stldocs-color-http-get);
112
+ border-color: var(--stldocs-color-http-get);
113
+ }
65
114
 
66
- .stldocs-literal-string {
67
- color: var(--stldocs-syntax-color-green);
68
- }
115
+ [data-method='post'] {
116
+ background: var(--stldocs-color-http-post-bg);
117
+ color: var(--stldocs-color-http-post);
118
+ border-color: var(--stldocs-color-http-post);
119
+ }
69
120
 
70
- .stldocs-literal-numeric {
71
- color: var(--stldocs-syntax-color-orange);
72
- }
121
+ [data-method='patch'],
122
+ [data-method='put'] {
123
+ background: var(--stldocs-color-http-put-bg);
124
+ color: var(--stldocs-color-http-put);
125
+ border-color: var(--stldocs-color-http-put);
126
+ }
73
127
 
74
- .stldocs-text-identifier {
75
- font-family: var(--stldocs-font-mono);
76
- color: var(--stldocs-color-text);
77
- }
128
+ [data-method='delete'] {
129
+ background: var(--stldocs-color-http-delete-bg);
130
+ color: var(--stldocs-color-http-delete);
131
+ border-color: var(--stldocs-color-http-delete);
132
+ }
133
+ }
78
134
 
79
- .stldocs-type-propertyname .stldocs-text-identifier {
80
- font-family: var(--stldocs-font);
81
- font-weight: 600;
82
- }
135
+ /* Generic expand/collapse button */
136
+ .stldocs-root .stldocs-expander {
137
+ &[data-stldocs-expander-muted='true'] {
138
+ .stldocs-icon {
139
+ visibility: hidden;
83
140
  }
84
141
 
85
- [data-stldocs-language='http'] {
86
- .stldocs-property-type,
87
- .stldocs-property-declaration {
88
- .stldocs-truncation,
89
- .stldocs-type-array,
90
- .stldocs-text-punctuation {
91
- font-family: var(--stldocs-font);
92
- }
142
+ &:hover {
143
+ .stldocs-icon {
144
+ visibility: visible;
93
145
  }
94
146
  }
95
147
  }
96
148
 
97
- /* HTTP Method Color Settings */
98
- .stldocs-root .stldocs-method-route,
99
- .stldocs-root .stldocs-sidebar-method {
100
- [data-method='get'] {
101
- background: var(--stldocs-color-http-get-bg);
102
- color: var(--stldocs-color-http-get);
103
- border-color: var(--stldocs-color-http-get);
104
- }
105
-
106
- [data-method='post'] {
107
- background: var(--stldocs-color-http-post-bg);
108
- color: var(--stldocs-color-http-post);
109
- border-color: var(--stldocs-color-http-post);
110
- }
149
+ .stldocs-expander-summary {
150
+ cursor: pointer;
151
+ display: flex;
152
+ /* padding: 0.4rem 0; */
111
153
 
112
- [data-method='patch'],
113
- [data-method='put'] {
114
- background: var(--stldocs-color-http-put-bg);
115
- color: var(--stldocs-color-http-put);
116
- border-color: var(--stldocs-color-http-put);
117
- }
154
+ & > .stldocs-expander-summary-icon {
155
+ margin-right: 8px;
156
+ transform: translateX(-0.5px) translateY(-0.5px);
118
157
 
119
- [data-method='delete'] {
120
- background: var(--stldocs-color-http-delete-bg);
121
- color: var(--stldocs-color-http-delete);
122
- border-color: var(--stldocs-color-http-delete);
123
- }
124
- }
125
-
126
- /* Generic expand/collapse button */
127
- .stldocs-root .stldocs-expander {
128
- &[data-stldocs-expander-muted='true'] {
129
- .stldocs-icon {
130
- visibility: hidden;
158
+ & > .stldocs-icon {
159
+ vertical-align: middle;
160
+ color: var(--stldocs-color-text-tertiary);
161
+ background-color: var(--stldocs-color-bg);
131
162
  }
132
163
 
133
- &:hover {
134
- .stldocs-icon {
135
- visibility: visible;
136
- }
164
+ & > :last-child {
165
+ display: none;
137
166
  }
138
167
  }
168
+ }
139
169
 
140
- .stldocs-expander-summary {
141
- cursor: pointer;
142
- display: flex;
143
- /* padding: 0.4rem 0; */
170
+ &[open],
171
+ &[data-open='true'] {
172
+ & > .stldocs-expander-summary {
173
+ .stldocs-type-preview-content {
174
+ display: none;
175
+ }
144
176
 
145
177
  & > .stldocs-expander-summary-icon {
146
- margin-right: 8px;
147
- transform: translateX(-0.5px) translateY(-0.5px);
148
-
149
- & > .stldocs-icon {
150
- vertical-align: middle;
151
- color: var(--stldocs-color-text-tertiary);
152
- background-color: var(--stldocs-color-bg);
178
+ & > :first-child {
179
+ display: none;
153
180
  }
154
181
 
155
182
  & > :last-child {
156
- display: none;
183
+ display: inline;
157
184
  }
158
185
  }
159
186
  }
160
187
 
161
- &[open],
162
- &[data-open='true'] {
163
- & > .stldocs-expander-summary {
164
- .stldocs-type-preview-content {
165
- display: none;
166
- }
188
+ & > .stldocs-expander-content {
189
+ margin-left: var(--stldocs-expander-margin-shift);
190
+ line-height: 150%;
167
191
 
168
- & > .stldocs-expander-summary-icon {
169
- & > :first-child {
170
- display: none;
171
- }
192
+ & > .stldocs-property-children {
193
+ border-left: 1px solid var(--stldocs-color-hairline-light);
194
+ padding-left: 16px;
172
195
 
173
- & > :last-child {
174
- display: inline;
175
- }
196
+ .stldocs-expander {
197
+ margin-left: calc(-1 * var(--stldocs-expander-margin-shift));
198
+ padding-right: var(--stldocs-expander-right-margin);
176
199
  }
177
200
  }
201
+ }
202
+ }
203
+ }
178
204
 
179
- & > .stldocs-expander-content {
180
- margin-left: var(--stldocs-expander-margin-shift);
181
- line-height: 150%;
205
+ /* Markdown content */
206
+ .stldocs-root .stldocs-content {
207
+ a {
208
+ color: var(--stldocs-color-text-accent);
209
+ }
182
210
 
183
- & > .stldocs-property-children {
184
- border-left: 1px solid var(--stldocs-color-hairline-light);
185
- padding-left: 16px;
211
+ code {
212
+ font-family: var(--stldocs-font-mono);
213
+ border-radius: 4px;
214
+ padding: 0 4px;
215
+ background-color: var(--stldocs-color-bg-inline-code);
216
+ word-break: break-all;
217
+ font-size: 0.84rem;
218
+ }
186
219
 
187
- .stldocs-expander {
188
- margin-left: calc(-1 * var(--stldocs-expander-margin-shift));
189
- padding-right: var(--stldocs-expander-right-margin);
190
- }
191
- }
192
- }
193
- }
220
+ strong {
221
+ font-weight: bold;
194
222
  }
195
223
 
196
- /* Markdown content */
197
- .stldocs-root .stldocs-content {
198
- a {
199
- color: var(--stldocs-color-text-accent);
200
- }
224
+ em {
225
+ font-style: italic;
226
+ }
201
227
 
202
- code {
203
- font-family: var(--stldocs-font-mono);
204
- border-radius: 4px;
205
- padding: 0 4px;
206
- background-color: var(--stldocs-color-bg-inline-code);
207
- word-break: break-all;
208
- font-size: 0.84rem;
209
- }
228
+ p {
229
+ display: block;
230
+ margin: 0 0 1em;
210
231
 
211
- strong {
212
- font-weight: bold;
232
+ &:last-child {
233
+ margin: 0;
213
234
  }
235
+ }
214
236
 
215
- em {
216
- font-style: italic;
217
- }
237
+ li {
238
+ margin-bottom: 0.25rem;
239
+ display: list-item;
240
+ }
218
241
 
219
- p {
220
- display: block;
221
- margin: 0 0 1em;
242
+ ol,
243
+ ul {
244
+ display: block;
245
+ list-style-type: initial;
246
+ margin-left: 2rem;
247
+ margin-bottom: 0.8rem;
248
+ }
222
249
 
223
- &:last-child {
224
- margin: 0;
225
- }
226
- }
250
+ ol {
251
+ list-style-type: decimal;
252
+ }
253
+ }
227
254
 
228
- li {
229
- margin-bottom: 0.25rem;
230
- display: list-item;
231
- }
255
+ .stldocs-root .stldocs-input {
256
+ border: 1px solid var(--stldocs-color-hairline);
257
+ border-radius: 0.3rem;
258
+ padding: 0.5rem;
259
+ display: flex;
260
+ gap: 0.5rem;
232
261
 
233
- ol,
234
- ul {
235
- display: block;
236
- list-style-type: initial;
237
- margin-left: 2rem;
238
- margin-bottom: 0.8rem;
239
- }
262
+ input {
263
+ flex-grow: 1;
264
+ border: none;
265
+ background-color: transparent;
240
266
 
241
- ol {
242
- list-style-type: decimal;
267
+ &:focus {
268
+ outline: none;
243
269
  }
244
270
  }
245
271
 
246
- .stldocs-root .stldocs-input {
247
- border: 1px solid var(--stldocs-color-hairline);
248
- border-radius: 0.3rem;
249
- padding: 0.5rem;
250
- display: flex;
251
- gap: 0.5rem;
272
+ .stldocs-icon {
273
+ margin-top: auto;
274
+ margin-bottom: auto;
275
+ }
276
+ }
252
277
 
253
- input {
254
- flex-grow: 1;
255
- }
278
+ .stldocs-root .stldocs-listview {
279
+ overflow-y: scroll;
256
280
 
257
- .stldocs-icon {
258
- margin-top: auto;
259
- margin-bottom: auto;
260
- }
281
+ .stldocs-listview-item:not(:last-child) {
282
+ border-bottom: 1px solid var(--stldocs-color-hairline);
261
283
  }
262
284
 
263
- .stldocs-root .stldocs-listview {
264
- overflow-y: scroll;
265
-
266
- .stldocs-listview-item:not(:last-child) {
267
- border-bottom: 1px solid var(--stldocs-color-hairline);
268
- }
285
+ [data-stldocs-listview-selected='true'] > :first-child {
286
+ background-color: var(--stldocs-color-selected);
287
+ border-radius: 0.5rem;
288
+ }
289
+ }
269
290
 
270
- [data-stldocs-listview-selected='true'] > :first-child {
271
- background-color: var(--stldocs-color-selected);
272
- border-radius: 0.5rem;
273
- }
291
+ .stldocs-root {
292
+ .stldocs-tooltip-host {
293
+ display: inline-block;
274
294
  }
275
295
 
276
- .stldocs-root {
277
- .stldocs-tooltip-host {
278
- display: inline-block;
296
+ .stldocs-tooltip-content {
297
+ border: 1px solid var(--stldocs-color-hairline);
298
+ background: var(--stldocs-color-bg);
299
+ border-radius: 8px;
300
+ padding: 0.2rem 0.4rem;
301
+
302
+ * {
303
+ font-size: 0.8rem !important;
279
304
  }
280
305
 
281
- .stldocs-tooltip-content {
282
- border: 1px solid var(--stldocs-color-hairline);
283
- background: var(--stldocs-color-bg);
284
- border-radius: 8px;
285
- padding: 0.2rem 0.4rem;
306
+ position: absolute;
286
307
 
287
- * {
288
- font-size: 0.8rem !important;
289
- }
308
+ transition:
309
+ opacity 0.3s ease-in-out,
310
+ visibility 0.3s step-end 0.3s;
311
+ visibility: hidden;
312
+ opacity: 0;
290
313
 
291
- position: absolute;
314
+ max-width: 400px;
315
+ max-height: 300px;
316
+ overflow: auto;
292
317
 
293
- transition:
294
- opacity 0.3s ease-in-out,
295
- visibility 0.3s step-end 0.3s;
296
- visibility: hidden;
297
- opacity: 0;
318
+ .stldocs-property-description {
319
+ display: none;
320
+ }
321
+ }
298
322
 
299
- max-width: 400px;
300
- max-height: 300px;
301
- overflow: auto;
323
+ .stldocs-tooltip:hover .stldocs-tooltip-content {
324
+ transition-delay: 0s, 0s;
325
+ visibility: visible;
326
+ opacity: 1;
327
+ }
328
+ }
302
329
 
303
- .stldocs-property-description {
304
- display: none;
305
- }
330
+ .stldocs-root {
331
+ .stldocs-breadcrumbs {
332
+ display: flex;
333
+ align-items: center;
334
+ gap: 0.5rem;
335
+
336
+ svg {
337
+ width: 1rem;
338
+ min-width: 1rem;
339
+ stroke: var(--stldocs-color-text-secondary);
340
+ opacity: 0.25;
341
+ margin: 0;
306
342
  }
307
343
 
308
- .stldocs-tooltip:hover .stldocs-tooltip-content {
309
- transition-delay: 0s, 0s;
310
- visibility: visible;
311
- opacity: 1;
344
+ .stldocs-breadcrumbs-non-link,
345
+ .stldocs-breadcrumbs-link {
346
+ color: var(--stldocs-color-text-secondary);
347
+ font-size: var(--stldocs-font-size-small);
348
+ line-height: 150%;
349
+ text-decoration: none;
350
+ }
351
+
352
+ .stldocs-breadcrumbs-link:hover {
353
+ text-decoration: underline;
354
+ color: var(--stldocs-color-text);
312
355
  }
313
- }
314
356
 
315
- .stldocs-root {
316
- .stldocs-breadcrumbs {
357
+ .stldocs-breadcrumbs-item {
317
358
  display: flex;
318
359
  align-items: center;
319
360
  gap: 0.5rem;
361
+ margin: 0;
362
+ height: var(--stldocs-button-size);
363
+ }
364
+ }
320
365
 
321
- svg {
322
- width: 1rem;
323
- min-width: 1rem;
324
- stroke: var(--stldocs-color-text-secondary);
325
- opacity: 0.25;
326
- margin: 0;
327
- }
366
+ /* Dropdown component styles */
367
+ .stldocs-dropdown {
368
+ position: relative;
369
+ font-size: 0.85rem;
328
370
 
329
- .stldocs-breadcrumbs-non-link,
330
- .stldocs-breadcrumbs-link {
331
- color: var(--stldocs-color-text-secondary);
332
- font-size: var(--stldocs-font-size-small);
333
- line-height: 150%;
334
- text-decoration: none;
335
- }
371
+ span {
372
+ display: flex;
373
+ align-items: center;
374
+ justify-content: center;
375
+ }
376
+ }
336
377
 
337
- .stldocs-breadcrumbs-link:hover {
338
- text-decoration: underline;
339
- color: var(--stldocs-color-text);
340
- }
378
+ .stldocs-dropdown-trigger {
379
+ display: flex;
380
+ align-items: center;
381
+ justify-content: space-between;
382
+ gap: 6px;
383
+ padding: 0.5rem;
341
384
 
342
- .stldocs-breadcrumbs-item {
343
- display: flex;
344
- align-items: center;
345
- gap: 0.5rem;
346
- margin: 0;
347
- height: var(--stldocs-button-size);
348
- }
385
+ .stldocs-icon {
386
+ margin: unset;
387
+ width: 16px;
349
388
  }
350
389
 
351
- /* Dropdown component styles */
352
- .stldocs-dropdown {
353
- position: relative;
354
- font-size: 0.85rem;
355
-
356
- span {
357
- display: flex;
358
- align-items: center;
359
- justify-content: center;
360
- }
390
+ &:hover {
391
+ border-color: var(--stldocs-color-hairline-shade);
361
392
  }
393
+ }
362
394
 
363
- .stldocs-dropdown-trigger {
364
- display: flex;
365
- align-items: center;
366
- justify-content: space-between;
367
- gap: 6px;
368
- padding: 0.5rem;
395
+ .stldocs-dropdown-trigger-content {
396
+ display: flex;
397
+ align-items: center;
398
+ gap: 8px;
399
+ }
369
400
 
370
- .stldocs-icon {
371
- margin: unset;
372
- width: 16px;
373
- }
401
+ .stldocs-dropdown-chevron {
402
+ margin-right: calc(-1 * var(--sl-button-icon-offset));
403
+ padding: 0;
404
+ opacity: 0.25;
405
+ }
374
406
 
375
- &:hover {
376
- border-color: var(--stldocs-color-hairline-shade);
377
- }
407
+ .stldocs-dropdown-chevron svg path {
408
+ stroke: var(--stldocs-color-text-secondary);
409
+ }
410
+
411
+ .stldocs-dropdown-menu {
412
+ --stldocs-dropdown-menu-border-radius: 8px;
413
+ --stldocs-dropdown-menu-background-color: var(--stldocs-color-bg);
414
+ --stldocs-dropdown-menu-border-color: var(--stldocs-color-hairline);
415
+
416
+ position: absolute;
417
+ right: 0;
418
+ bottom: 100%;
419
+ z-index: var(--stldocs-z-index-theme-select);
420
+ background: var(--stldocs-dropdown-menu-background-color);
421
+ border: 1px solid var(--stldocs-dropdown-menu-border-color);
422
+ border-radius: var(--stldocs-dropdown-menu-border-radius);
423
+ margin-bottom: 4px;
424
+ padding: 0;
425
+ width: 100%;
426
+ min-width: 100px;
427
+ overflow: hidden;
428
+ display: none;
429
+ box-shadow: 0px 4px 4px -2px #00000014;
430
+
431
+ &.below {
432
+ margin-bottom: unset;
433
+ bottom: unset;
434
+ top: 100%;
435
+ margin-top: 4px;
378
436
  }
437
+ }
379
438
 
380
- .stldocs-dropdown-trigger-content {
439
+ .stldocs-dropdown-menu.open {
440
+ display: block;
441
+ }
442
+
443
+ .stldocs-dropdown-item {
444
+ display: flex;
445
+ align-items: center;
446
+ justify-content: space-between;
447
+ gap: 8px;
448
+ padding: 6px 10px;
449
+ cursor: pointer;
450
+ height: 32px;
451
+
452
+ div {
381
453
  display: flex;
382
454
  align-items: center;
383
455
  gap: 8px;
384
456
  }
385
457
 
386
- .stldocs-dropdown-chevron {
387
- margin-right: calc(-1 * var(--sl-button-icon-offset));
388
- padding: 0;
389
- opacity: 0.25;
390
- }
391
-
392
- .stldocs-dropdown-chevron svg path {
393
- stroke: var(--stldocs-color-text-secondary);
394
- }
395
-
396
- .stldocs-dropdown-menu {
397
- position: absolute;
398
- right: 0;
399
- bottom: 100%;
400
- z-index: var(--stldocs-z-index-theme-select);
401
- background: var(--stldocs-color-bg);
402
- border: 1px solid var(--stldocs-color-hairline);
403
- border-radius: var(--stldocs-button-border-radius);
404
- margin-bottom: 4px;
405
- padding: 0;
406
- width: 100%;
407
- min-width: 100px;
408
- overflow: hidden;
458
+ .lucide-check {
459
+ height: var(--stlodcs-font-size-body);
460
+ width: var(--stlodcs-font-size-body);
409
461
  display: none;
410
- box-shadow: 0px 4px 4px -2px #00000014;
411
-
412
- &.below {
413
- margin-bottom: unset;
414
- bottom: unset;
415
- top: 100%;
416
- margin-top: 4px;
417
- }
418
462
  }
419
463
 
420
- .stldocs-dropdown-menu.open {
421
- display: block;
464
+ .stldocs-icon {
465
+ width: 16px;
422
466
  }
423
467
 
424
- .stldocs-dropdown-item {
425
- display: flex;
426
- align-items: center;
427
- justify-content: space-between;
428
- gap: 8px;
429
- padding: 6px 10px;
430
- cursor: pointer;
431
- height: 32px;
468
+ &.stldocs-dropdown-item-link {
469
+ padding: 0;
470
+ height: unset;
471
+ gap: 0;
432
472
 
433
- div {
473
+ a {
434
474
  display: flex;
435
475
  align-items: center;
476
+ justify-content: space-between;
436
477
  gap: 8px;
437
- }
438
-
439
- .lucide-check {
440
- height: var(--stlodcs-font-size-body);
441
- width: var(--stlodcs-font-size-body);
442
- display: none;
443
- }
444
-
445
- .stldocs-icon {
446
- width: 16px;
447
- }
448
-
449
- &.stldocs-dropdown-item-link {
450
- padding: 0;
451
- height: unset;
452
- gap: 0;
453
-
454
- a {
455
- display: flex;
456
- align-items: center;
457
- justify-content: space-between;
458
- gap: 8px;
459
- padding: 6px 10px;
460
- cursor: pointer;
461
- height: 32px;
462
- width: 100%;
463
- text-decoration: none;
464
- color: inherit;
465
- }
478
+ padding: 6px 10px;
479
+ cursor: pointer;
480
+ height: 32px;
481
+ width: 100%;
482
+ text-decoration: none;
483
+ color: inherit;
466
484
  }
467
485
  }
486
+ }
468
487
 
469
- .stldocs-dropdown-item:hover {
470
- background-color: var(--stldocs-color-bg-inline-code);
471
- }
488
+ .stldocs-dropdown-item:hover {
489
+ background-color: var(--stldocs-color-bg-inline-code);
490
+ }
472
491
 
473
- .stldocs-dropdown-item.selected {
474
- .lucide-check {
475
- display: inline;
476
- }
492
+ .stldocs-dropdown-item.selected {
493
+ .lucide-check {
494
+ display: inline;
477
495
  }
496
+ }
478
497
 
479
- @media (min-width: 50rem) {
480
- .stldocs-dropdown-menu {
481
- margin-bottom: unset;
482
- bottom: unset;
483
- top: 100%;
484
- margin-top: 4px;
485
- }
498
+ @media (min-width: 50rem) {
499
+ .stldocs-dropdown-menu {
500
+ margin-bottom: unset;
501
+ bottom: unset;
502
+ top: 100%;
503
+ margin-top: 4px;
486
504
  }
487
505
  }
506
+ }
488
507
 
489
- /* Intentionally not using the stldocs-root selector here, as buttons are sometimes outside the stldocs-root. */
490
- .stldocs-button {
491
- border-radius: var(--stldocs-button-border-radius);
492
- display: flex;
493
- padding: var(--stldocs-button-padding-y) var(--stldocs-button-padding-x);
494
- justify-content: center;
495
- align-items: center;
496
- height: var(--stldocs-button-size);
497
- cursor: pointer;
498
- text-decoration: none;
499
- text-wrap: nowrap;
500
- font-weight: 500;
501
- line-height: 150%;
508
+ /* Intentionally not using the stldocs-root selector here, as buttons are sometimes outside the stldocs-root. */
509
+ .stldocs-button {
510
+ border-radius: var(--stldocs-button-border-radius);
511
+ display: flex;
512
+ padding: var(--stldocs-button-padding-y) var(--stldocs-button-padding-x);
513
+ justify-content: center;
514
+ align-items: center;
515
+ height: var(--stldocs-button-size);
516
+ cursor: pointer;
517
+ text-decoration: none;
518
+ text-wrap: nowrap;
519
+ font-weight: 500;
520
+ line-height: 150%;
521
+ font-size: var(--sl-text-sm);
522
+
523
+ span {
524
+ padding-left: var(--sl-button-icon-offset);
525
+ padding-right: var(--sl-button-icon-offset);
502
526
  font-size: var(--sl-text-sm);
503
-
504
- span {
505
- padding-left: var(--sl-button-icon-offset);
506
- padding-right: var(--sl-button-icon-offset);
507
- font-size: var(--sl-text-sm);
508
- }
509
-
510
- &.stldocs-button-icon {
511
- > svg {
512
- margin: 0;
513
- }
514
- }
515
527
  }
516
528
 
517
- .stldocs-button-icon {
529
+ &.stldocs-button-icon {
518
530
  > svg {
519
531
  margin: 0;
520
532
  }
521
533
  }
534
+ }
522
535
 
523
- .stldocs-button-primary {
524
- background-color: var(--stldocs-color-text);
525
- color: var(--stldocs-color-text-invert);
536
+ .stldocs-button-icon {
537
+ > svg {
538
+ margin: 0;
526
539
  }
540
+ }
527
541
 
528
- .stldocs-button-secondary {
529
- background-color: var(--stldocs-color-bg-ui);
530
- border: 1px solid var(--stldocs-color-hairline);
531
- border-radius: var(--stldocs-button-border-radius);
532
- font-weight: 400;
542
+ .stldocs-button-primary {
543
+ background-color: var(--stldocs-color-text);
544
+ color: var(--stldocs-color-text-invert);
545
+ }
533
546
 
534
- &:hover {
535
- border-color: var(--stldocs-color-hairline-shade);
536
- }
537
- }
547
+ .stldocs-button-secondary {
548
+ background-color: var(--stldocs-color-bg-ui);
549
+ border: 1px solid var(--stldocs-color-hairline);
550
+ border-radius: var(--stldocs-button-border-radius);
551
+ font-weight: 400;
538
552
 
539
- .stldocs-button-tertiary {
540
- border: none;
541
- color: var(--stldocs-color-text-secondary);
542
- background-color: transparent;
553
+ &:hover {
554
+ border-color: var(--stldocs-color-hairline-shade);
543
555
  }
556
+ }
544
557
 
545
- .stldocs-root .stldocs-expand-toggle {
546
- font-size: var(--stldocs-font-size-body);
547
- display: flex;
548
- flex-grow: 1;
549
- justify-content: flex-end;
550
- user-select: none;
558
+ .stldocs-button-tertiary {
559
+ border: none;
560
+ color: var(--stldocs-color-text-secondary);
561
+ background-color: transparent;
562
+ }
551
563
 
552
- &[data-stldocs-property-toggle-expanded='false'] {
553
- .stldocs-expand-toggle-content:last-child {
554
- display: none;
555
- }
564
+ .stldocs-root .stldocs-expand-toggle {
565
+ font-size: var(--stldocs-font-size-body);
566
+ display: flex;
567
+ flex-grow: 1;
568
+ justify-content: flex-end;
569
+ user-select: none;
570
+
571
+ &[data-stldocs-property-toggle-expanded='false'] {
572
+ .stldocs-expand-toggle-content:last-child {
573
+ display: none;
556
574
  }
575
+ }
557
576
 
558
- &[data-stldocs-property-toggle-expanded='true'] {
559
- .stldocs-expand-toggle-content:first-child {
560
- display: none;
561
- }
577
+ &[data-stldocs-property-toggle-expanded='true'] {
578
+ .stldocs-expand-toggle-content:first-child {
579
+ display: none;
562
580
  }
581
+ }
563
582
 
564
- .stldocs-expand-toggle-content {
565
- cursor: pointer;
583
+ .stldocs-expand-toggle-content {
584
+ cursor: pointer;
566
585
 
567
- .stldocs-icon {
568
- vertical-align: middle;
569
- }
586
+ .stldocs-icon {
587
+ vertical-align: middle;
570
588
  }
571
589
  }
572
590
  }