@stainless-api/docs 0.1.0-beta.12 → 0.1.0-beta.120

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 (152) hide show
  1. package/CHANGELOG.md +998 -0
  2. package/eslint-suppressions.json +95 -0
  3. package/{eslint.config.js → eslint.config.ts} +0 -2
  4. package/locals.d.ts +17 -0
  5. package/package.json +57 -43
  6. package/playground-virtual-modules.d.ts +96 -0
  7. package/plugin/assets/languages/cli.svg +14 -0
  8. package/plugin/assets/languages/csharp.svg +1 -0
  9. package/plugin/assets/languages/php.svg +4 -0
  10. package/plugin/buildAlgoliaIndex.ts +40 -39
  11. package/plugin/components/MethodDescription.tsx +54 -0
  12. package/plugin/components/RequestBuilder/ParamEditor.tsx +55 -0
  13. package/plugin/components/RequestBuilder/SnippetStainlessIsland.tsx +107 -0
  14. package/plugin/components/RequestBuilder/index.tsx +40 -0
  15. package/plugin/components/RequestBuilder/props.ts +9 -0
  16. package/plugin/components/RequestBuilder/spec-helpers.ts +47 -0
  17. package/plugin/components/RequestBuilder/styles.css +67 -0
  18. package/plugin/components/SDKSelect.astro +18 -111
  19. package/plugin/components/SnippetCode.tsx +112 -70
  20. package/plugin/components/StainlessIslands.tsx +126 -0
  21. package/plugin/components/search/SearchAlgolia.astro +46 -29
  22. package/plugin/components/search/SearchIsland.tsx +52 -29
  23. package/plugin/generateAPIReferenceLink.ts +2 -2
  24. package/plugin/globalJs/ai-dropdown-options.ts +248 -0
  25. package/plugin/globalJs/code-snippets.ts +45 -16
  26. package/plugin/globalJs/copy.ts +115 -27
  27. package/plugin/globalJs/create-playground.shim.ts +3 -0
  28. package/plugin/globalJs/method-descriptions.ts +33 -0
  29. package/plugin/globalJs/navigation.ts +15 -33
  30. package/plugin/globalJs/playground-data.shim.ts +1 -0
  31. package/plugin/globalJs/playground-data.ts +14 -0
  32. package/plugin/globalJs/summary-selection-tweak.ts +29 -0
  33. package/plugin/helpers/generateDocsRoutes.ts +59 -0
  34. package/plugin/helpers/multiSpec.ts +8 -0
  35. package/plugin/index.ts +306 -142
  36. package/plugin/languages.ts +8 -2
  37. package/plugin/loadPluginConfig.ts +251 -107
  38. package/plugin/middlewareBuilder/stainlessMiddleware.d.ts +3 -1
  39. package/plugin/react/Routing.tsx +214 -143
  40. package/plugin/referencePlaceholderUtils.ts +18 -15
  41. package/plugin/replaceSidebarPlaceholderMiddleware.ts +39 -35
  42. package/plugin/routes/Docs.astro +71 -111
  43. package/plugin/routes/DocsStatic.astro +6 -5
  44. package/plugin/routes/Overview.astro +46 -22
  45. package/plugin/routes/markdown.ts +13 -12
  46. package/plugin/{cms → sidebar-utils}/sidebar-builder.ts +83 -63
  47. package/plugin/specs/FileCache.ts +99 -0
  48. package/plugin/specs/fetchSpecSSR.ts +27 -0
  49. package/plugin/specs/generateSpec.ts +112 -0
  50. package/plugin/specs/index.ts +137 -0
  51. package/plugin/specs/inputResolver.ts +148 -0
  52. package/plugin/{cms → specs}/worker.ts +82 -5
  53. package/plugin/vendor/preview.worker.docs.js +27234 -17991
  54. package/plugin/vendor/templates/cli.md +1 -0
  55. package/plugin/vendor/templates/go.md +4 -2
  56. package/plugin/vendor/templates/java.md +5 -1
  57. package/plugin/vendor/templates/kotlin.md +5 -1
  58. package/plugin/vendor/templates/node.md +4 -2
  59. package/plugin/vendor/templates/python.md +4 -2
  60. package/plugin/vendor/templates/ruby.md +4 -2
  61. package/plugin/vendor/templates/terraform.md +1 -1
  62. package/plugin/vendor/templates/typescript.md +3 -1
  63. package/resolveSrcFile.ts +10 -0
  64. package/scripts/vendor_deps.ts +5 -5
  65. package/shared/conditionalIntegration.ts +28 -0
  66. package/shared/getProsePages.ts +41 -0
  67. package/shared/getSharedLogger.ts +15 -0
  68. package/shared/terminalUtils.ts +3 -0
  69. package/shared/virtualModule.ts +54 -1
  70. package/src/content.config.ts +9 -0
  71. package/stl-docs/components/AIDropdown.tsx +63 -0
  72. package/stl-docs/components/AiChatIsland.tsx +14 -0
  73. package/stl-docs/components/{content-panel/ContentBreadcrumbs.tsx → ContentBreadcrumbs.tsx} +2 -2
  74. package/stl-docs/components/ContentPanel.astro +9 -0
  75. package/stl-docs/components/Footer.astro +89 -0
  76. package/stl-docs/components/Head.astro +20 -0
  77. package/stl-docs/components/Header.astro +3 -10
  78. package/stl-docs/components/PageFrame.astro +34 -0
  79. package/stl-docs/components/PageSidebar.astro +11 -0
  80. package/stl-docs/components/PageTitle.astro +82 -0
  81. package/stl-docs/components/StainlessLogo.svg +4 -0
  82. package/stl-docs/components/TableOfContents.astro +34 -0
  83. package/stl-docs/components/ThemeProvider.astro +36 -0
  84. package/stl-docs/components/ThemeSelect.astro +84 -146
  85. package/stl-docs/components/TwoColumnContent.astro +2 -0
  86. package/stl-docs/components/headers/DefaultHeader.astro +4 -6
  87. package/stl-docs/components/headers/StackedHeader.astro +8 -51
  88. package/stl-docs/components/icons/chat-gpt.tsx +2 -2
  89. package/stl-docs/components/icons/cursor.tsx +10 -0
  90. package/stl-docs/components/icons/gemini.tsx +19 -0
  91. package/stl-docs/components/icons/markdown.tsx +1 -1
  92. package/stl-docs/components/index.ts +1 -0
  93. package/stl-docs/components/mintlify-compat/Frame.astro +4 -4
  94. package/stl-docs/components/mintlify-compat/card.css +4 -4
  95. package/stl-docs/components/mintlify-compat/index.ts +2 -4
  96. package/stl-docs/components/nav-tabs/NavDropdown.astro +31 -75
  97. package/stl-docs/components/nav-tabs/NavTabs.astro +79 -81
  98. package/stl-docs/components/nav-tabs/SecondaryNavTabs.astro +15 -7
  99. package/stl-docs/components/nav-tabs/buildNavLinks.ts +3 -2
  100. package/stl-docs/components/pagination/HomeLink.astro +10 -0
  101. package/stl-docs/components/pagination/Pagination.astro +177 -0
  102. package/stl-docs/components/pagination/PaginationLinkEmphasized.astro +22 -0
  103. package/stl-docs/components/pagination/PaginationLinkQuiet.astro +13 -0
  104. package/stl-docs/components/pagination/util.ts +71 -0
  105. package/stl-docs/components/scripts.ts +1 -0
  106. package/stl-docs/components/sidebars/BaseSidebar.astro +80 -2
  107. package/stl-docs/components/sidebars/SidebarWithComponents.tsx +10 -0
  108. package/stl-docs/components/sidebars/convertAstroSidebarToStl.tsx +62 -0
  109. package/stl-docs/disableCalloutSyntax.ts +36 -0
  110. package/stl-docs/fonts.ts +186 -0
  111. package/stl-docs/index.ts +169 -51
  112. package/stl-docs/loadStlDocsConfig.ts +64 -8
  113. package/stl-docs/proseDocSync.ts +314 -0
  114. package/stl-docs/proseMarkdown/proseMarkdownIntegration.ts +53 -0
  115. package/stl-docs/proseMarkdown/proseMarkdownMiddleware.ts +41 -0
  116. package/stl-docs/proseMarkdown/toMarkdown.ts +158 -0
  117. package/stl-docs/proseSearchIndexing.ts +222 -0
  118. package/stl-docs/tabsMiddleware.ts +14 -5
  119. package/styles/code.css +53 -49
  120. package/styles/links.css +2 -37
  121. package/styles/method-descriptions.css +36 -0
  122. package/styles/overrides.css +28 -46
  123. package/styles/page.css +230 -52
  124. package/styles/sdk_select.css +9 -6
  125. package/styles/search.css +11 -21
  126. package/styles/sidebar.css +28 -211
  127. package/styles/{variables.css → sl-variables.css} +4 -8
  128. package/styles/stldocs-variables.css +6 -0
  129. package/styles/toc.css +19 -8
  130. package/theme.css +11 -9
  131. package/tsconfig.json +1 -4
  132. package/virtual-module.d.ts +65 -8
  133. package/components/variables.css +0 -112
  134. package/plugin/cms/client.ts +0 -62
  135. package/plugin/cms/server.ts +0 -268
  136. package/plugin/globalJs/ai-dropdown.ts +0 -57
  137. package/stl-docs/components/APIReferenceAIDropdown.tsx +0 -58
  138. package/stl-docs/components/content-panel/ContentPanel.astro +0 -69
  139. package/stl-docs/components/content-panel/ProseAIDropdown.tsx +0 -55
  140. package/stl-docs/components/headers/SplashMobileMenuToggle.astro +0 -49
  141. package/stl-docs/components/mintlify-compat/Step.astro +0 -56
  142. package/stl-docs/components/mintlify-compat/Steps.astro +0 -15
  143. package/styles/fonts.css +0 -68
  144. /package/{plugin/assets → assets}/fonts/geist/OFL.txt +0 -0
  145. /package/{plugin/assets → assets}/fonts/geist/geist-italic-latin-ext.woff2 +0 -0
  146. /package/{plugin/assets → assets}/fonts/geist/geist-italic-latin.woff2 +0 -0
  147. /package/{plugin/assets → assets}/fonts/geist/geist-latin-ext.woff2 +0 -0
  148. /package/{plugin/assets → assets}/fonts/geist/geist-latin.woff2 +0 -0
  149. /package/{plugin/assets → assets}/fonts/geist/geist-mono-italic-latin-ext.woff2 +0 -0
  150. /package/{plugin/assets → assets}/fonts/geist/geist-mono-italic-latin.woff2 +0 -0
  151. /package/{plugin/assets → assets}/fonts/geist/geist-mono-latin-ext.woff2 +0 -0
  152. /package/{plugin/assets → assets}/fonts/geist/geist-mono-latin.woff2 +0 -0
package/styles/page.css CHANGED
@@ -1,78 +1,256 @@
1
- .page {
2
- position: relative;
3
- max-width: var(--sl-page-max-width);
4
- margin: 0 auto;
1
+ :root {
2
+ --stl-page-max-width: 90rem;
5
3
 
6
- .sidebar-pane {
7
- left: auto;
8
- }
4
+ /* 0.75rem at 25rem width (phone); 1.5rem at 72rem width (desktop) */
5
+ --_stl-page-min-padding-mobile-rem: 0.75;
6
+ --_stl-page-min-padding-desktop-rem: 1.5;
7
+ --_stl-page-min-padding-slope: (
8
+ (var(--_stl-page-min-padding-desktop-rem) - var(--_stl-page-min-padding-mobile-rem)) / (72 - 25)
9
+ );
10
+ --stl-page-min-padding: clamp(
11
+ var(--_stl-page-min-padding-mobile-rem) * 1rem,
12
+ var(--_stl-page-min-padding-slope) * (100vw - 25rem) + var(--_stl-page-min-padding-mobile-rem) * 1rem,
13
+ var(--_stl-page-min-padding-desktop-rem) * 1rem
14
+ );
15
+
16
+ --stl-content-max-width: 52rem;
17
+ --stl-content-padding: 2rem;
18
+ --stl-two-column-content-max-width: 80rem;
19
+
20
+ --stl-sidebar-width: 16.5rem;
21
+ --stl-nav-height: 3.5rem; /* has to be statically sized in order to correctly position the viewport-end grid area :( */
22
+ --stl-nav-gap: 0.5rem;
23
+
24
+ --stl-page-width: min(var(--stl-page-max-width), 100vw);
25
+ --vw: calc(var(--stl-page-width) / 100);
9
26
 
10
- > header {
11
- .stl-secondary-nav-tabs,
12
- .header {
13
- max-width: var(--sl-page-max-width);
14
- margin: 0 auto;
27
+ scroll-padding-top: calc(var(--stl-nav-height) + 1rem);
28
+ }
29
+ @media (min-width: 50rem) {
30
+ :root:has(.stl-secondary-nav-tabs) {
31
+ --stl-nav-height: 5.5rem;
32
+ header {
33
+ padding-top: 0.25rem;
15
34
  }
16
35
  }
36
+ }
17
37
 
18
- .right-sidebar {
19
- border-inline-start: unset;
20
- }
38
+ /* Grid layout */
21
39
 
22
- .mobile-preferences {
23
- margin-top: 1rem;
24
- }
40
+ .page {
41
+ display: grid;
42
+
43
+ /* TODO: verify that env-safe-area-inset is behaving as we expect */
44
+ --stl-viewport-width: calc(
45
+ 100vw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px) -
46
+ var(--stl-chat-panel-width, 0px)
47
+ );
48
+ --stl-page-gutter-left: calc(
49
+ env(safe-area-inset-left, 0px) +
50
+ max(var(--stl-page-min-padding), (var(--stl-viewport-width) - var(--stl-page-max-width)) / 2)
51
+ );
52
+ --stl-page-gutter-right: calc(
53
+ env(safe-area-inset-right, 0px) +
54
+ max(var(--stl-page-min-padding), (var(--stl-viewport-width) - var(--stl-page-max-width)) / 2)
55
+ );
56
+
57
+ /* prettier-ignore */
58
+ grid:
59
+ /* header + content have two identical columns because in mobile layout the menu trigger takes up the latter */
60
+ ' gutter-left header header header header gutter-right chat' var(--stl-nav-height) /* nav */
61
+ ' gutter-left sidebar content content toc gutter-right chat' calc(100dvh - var(--stl-nav-height)) /* viewport (above the fold) */
62
+ [viewport-end]
63
+ ' gutter-left . content content . gutter-right . ' auto /* rest of page height */
64
+ / var(--stl-page-gutter-left) var(--stl-sidebar-width) minmax(0, 1fr) auto auto var(--stl-page-gutter-right) auto;
25
65
  }
26
66
 
27
- @media (min-width: 50rem) {
28
- .page {
29
- padding-left: var(--sl-sidebar-pad-x);
30
- padding-right: var(--sl-sidebar-pad-x);
31
-
32
- > header {
33
- .header,
34
- .stl-secondary-nav-tabs {
35
- padding: 0 1.5rem;
36
- }
37
- }
67
+ .page > main,
68
+ .page > .sidebar > .sidebar-pane,
69
+ .page > .right-sidebar-panel nav {
70
+ padding-block-start: 1rem;
71
+ }
38
72
 
39
- > header {
40
- .stl-secondary-nav-tabs {
41
- padding-left: 0.55rem;
42
- }
43
- }
44
- }
73
+ /* Sticky header and tabs */
45
74
 
46
- .header,
47
- .header {
48
- padding-inline-start: 0;
49
- padding-inline-end: 0;
50
- }
75
+ .page > header {
76
+ grid-area: header;
77
+ margin-left: calc(-1 * var(--stl-page-gutter-left));
78
+ margin-right: calc(-1 * var(--stl-page-gutter-right));
79
+ padding-left: var(--stl-page-gutter-left);
80
+ padding-right: var(--stl-page-gutter-right);
81
+ }
51
82
 
52
- mobile-starlight-toc nav {
53
- inset-inline-start: calc(var(--sl-content-inline-start, 0) + var(--sl-sidebar-pad-x));
54
- }
55
- .sidebar-content {
56
- padding-left: 0;
83
+ header {
84
+ display: flex;
85
+ flex-direction: column;
86
+ border-bottom: 1px solid var(--stl-color-border-faint);
87
+ position: sticky;
88
+ top: 0;
89
+ z-index: 10;
90
+ background: var(--stl-color-background);
91
+ }
92
+
93
+ @layer starlight.core {
94
+ header > .header {
95
+ all: revert-layer;
57
96
  }
58
97
  }
59
98
 
60
- .stl-content-breadcrumbs {
61
- .stldocs-breadcrumbs {
62
- padding-left: 0;
99
+ header > .header {
100
+ flex: 1;
101
+ display: flex;
102
+ gap: var(--stl-nav-gap);
103
+ align-items: center;
104
+ justify-content: space-between;
105
+ }
106
+
107
+ .header site-search > button {
108
+ @media (min-width: 50rem) {
109
+ margin-inline: 2rem;
110
+ flex: 1 1 12rem;
63
111
  }
64
112
  }
65
113
 
114
+ .header .right-group {
115
+ display: flex;
116
+ align-items: stretch;
117
+ }
118
+
119
+ /* Sticky sidebar and toc. Outer wrapper “sticks” to top of page, subgrid pushes child down below header */
120
+ .page > .sidebar {
121
+ grid-area: sidebar;
122
+ /* sidebar should bleed to left edge of page in case people want to color it */
123
+ margin-left: calc(-1 * var(--stl-page-gutter-left));
124
+ padding-left: var(--stl-page-gutter-left);
125
+ }
126
+
127
+ .page > .right-sidebar-panel {
128
+ grid-area: toc;
129
+ }
130
+
131
+ .page > .sidebar,
132
+ .page > .right-sidebar-panel {
133
+ align-self: start;
134
+ grid-row-start: header-start;
135
+ display: grid;
136
+ grid-template-rows: subgrid;
137
+ grid-template-columns: subgrid;
138
+ position: sticky;
139
+ top: 0;
140
+ }
141
+ .page > .sidebar > .sidebar-pane,
142
+ .page > .right-sidebar-panel > starlight-toc {
143
+ grid-area: inherit;
144
+ grid-row-start: header-end;
145
+ overflow-y: auto;
146
+ overflow-x: clip;
147
+ }
148
+
149
+ /* Page content */
150
+
151
+ .page > main {
152
+ grid-area: content;
153
+ width: 100%;
154
+ max-width: min(var(--stl-content-max-width), 100%);
155
+ justify-self: center;
156
+ padding-inline: var(--stl-content-padding);
157
+ }
158
+
66
159
  .stl-page-nav-container {
67
160
  display: flex;
68
161
  align-items: center;
69
162
  justify-content: space-between;
70
163
  gap: 1rem;
71
- padding: 1rem 0 0 1rem;
72
164
  flex-wrap: wrap;
73
165
  }
74
- @media (min-width: 50em) {
75
- :root[data-has-sidebar] {
76
- --sl-content-inline-start: calc(var(--sl-sidebar-width) + 1rem);
166
+
167
+ .mobile-preferences {
168
+ margin-top: 1rem;
169
+ display: flex;
170
+ justify-content: flex-end;
171
+ }
172
+
173
+ /* Two-column layouts go wider */
174
+ .page > main:where(:has(.stldocs-method-double-pane)) {
175
+ max-width: min(var(--stl-two-column-content-max-width), 100%);
176
+ padding-inline-start: clamp(
177
+ var(--stl-content-padding),
178
+ var(--stl-page-gutter-right) - env(safe-area-inset-right, 0px),
179
+ var(--stl-content-padding) * 2
180
+ );
181
+ padding-inline-end: 0;
182
+ }
183
+
184
+ /* Responsive page layout */
185
+
186
+ /* On smaller screens, the main panel takes up the full width and the TOC is hidden */
187
+ @media not (min-width: 72rem) {
188
+ .page > main {
189
+ /* right edge of content goes up to right gutter to align with header */
190
+ padding-inline-end: 0;
191
+ max-width: 100%;
192
+ }
193
+
194
+ .page > .right-sidebar-panel {
195
+ display: none;
196
+ }
197
+ }
198
+
199
+ /* On mobile screens, the sidebar and nav links collapse */
200
+ @media not (min-width: 50rem) {
201
+ header {
202
+ padding-top: 0;
203
+ display: grid;
204
+ grid-template-columns: subgrid;
205
+ }
206
+
207
+ header > .header {
208
+ grid-column: span 2;
209
+ }
210
+
211
+ /* Sidebar moves to cover content area, hidden by default */
212
+ :root {
213
+ --stl-sidebar-width: 0px;
214
+ }
215
+ .page > .sidebar,
216
+ .page > .sidebar.hidden {
217
+ display: contents;
218
+ }
219
+ .page > .sidebar > .sidebar-pane {
220
+ visibility: hidden;
221
+ grid-area: content;
222
+ grid-row-end: viewport-end;
223
+ z-index: 9;
224
+ /* extend to right edge of page */
225
+ margin-inline-end: calc(-1 * var(--stl-page-gutter-right));
226
+ padding-inline-end: var(--stl-page-gutter-right);
227
+ border-inline-end: 0;
228
+ }
229
+ .page > .sidebar > starlight-menu-button[aria-expanded='true'] ~ .sidebar-pane {
230
+ visibility: visible;
231
+ }
232
+
233
+ /* left padding becomes the left gutter when there’s no sidebar */
234
+ .page > main {
235
+ padding-inline-start: 0;
236
+ }
237
+
238
+ /* Sidebar menu button moves to end of header; takes up space in layout (not absolutely positioned as in starlight) */
239
+ .sidebar starlight-menu-button {
240
+ grid-column: span 1 / content-end;
241
+ grid-row: header;
242
+ display: flex;
243
+ align-items: center;
244
+ position: sticky;
245
+ top: 0;
246
+ padding-left: var(--stl-nav-gap);
247
+ z-index: 11;
248
+ }
249
+ .sidebar starlight-menu-button button {
250
+ position: static;
251
+ }
252
+
253
+ .header .right-group {
254
+ display: none;
77
255
  }
78
256
  }
@@ -1,10 +1,13 @@
1
- .stldocs-root {
2
- .stldocs-dropdown-menu.stl-sdk-select-dropdown-menu {
3
- min-width: 200px;
4
- }
5
- }
6
1
  .stl-sdk-select {
2
+ .stl-ui-dropdown {
3
+ width: 100%;
4
+
5
+ .stl-ui-dropdown__button {
6
+ width: 100%;
7
+ justify-content: space-between;
8
+ }
9
+ }
7
10
  .stldocs-icon.http path {
8
- fill: var(--stldocs-color-text);
11
+ fill: var(--stl-color-foreground);
9
12
  }
10
13
  }
package/styles/search.css CHANGED
@@ -15,45 +15,41 @@ site-search {
15
15
  padding: 0;
16
16
  width: var(--sl-button-size);
17
17
  justify-content: center;
18
- background-color: var(--sl-color-bg-ui);
19
- border: 1px solid var(--sl-color-hairline);
18
+ background-color: var(--stl-color-ui-background);
19
+ border: 1px solid var(--stl-color-border);
20
20
  border-radius: var(--sl-button-border-radius);
21
21
  height: var(--sl-button-size);
22
22
 
23
23
  &:hover {
24
- border-color: var(--sl-color-hairline-shade);
24
+ background: var(--stl-color-ui-background-hover);
25
25
  }
26
26
 
27
27
  span {
28
- font-size: var(--sl-text-sm);
29
- color: var(--sl-color-text-secondary);
28
+ font-size: var(--stl-typography-scale-sm);
29
+ color: var(--stl-color-foreground-reduced);
30
30
  line-height: 150%;
31
31
  padding-left: var(--sl-button-icon-offset);
32
32
  padding-right: var(--sl-button-icon-offset);
33
33
  }
34
34
 
35
35
  > svg {
36
- width: var(--sl-text-sm);
37
- height: var(--sl-text-sm);
38
- }
39
-
40
- &.stldocs-button {
41
- padding: 0;
36
+ width: var(--stl-typography-scale-sm);
37
+ height: var(--stl-typography-scale-sm);
42
38
  }
43
39
  }
44
40
 
45
41
  button > kbd {
46
42
  border-radius: 0.25rem;
47
- font-size: var(--sl-text-2xs);
43
+ font-size: var(--stl-typography-scale-xs);
48
44
  gap: 0.25em;
49
45
  padding-inline: 0.375rem;
50
- background-color: var(--sl-color-gray-6);
46
+ background-color: var(--stl-color-muted-background);
51
47
  margin-right: -0.3rem;
52
48
  }
53
49
 
54
50
  kbd {
55
51
  font-family: var(--__sl-font);
56
- color: var(--sl-color-text);
52
+ color: var(--stl-color-foreground-reduced);
57
53
  }
58
54
  }
59
55
 
@@ -61,16 +57,10 @@ site-search {
61
57
  site-search {
62
58
  > button {
63
59
  border-radius: var(--sl-button-border-radius);
64
- padding-inline-start: var(--sl-button-padding-x);
65
- padding-inline-end: var(--sl-button-padding-x);
66
60
  width: 100%;
67
61
  max-width: 30rem;
68
62
  justify-content: start;
69
-
70
- &.stldocs-button {
71
- padding-inline-start: var(--sl-button-padding-x);
72
- padding-inline-end: var(--sl-button-padding-x);
73
- }
63
+ padding: var(--sl-button-padding-y) var(--sl-button-padding-x);
74
64
 
75
65
  > :last-child {
76
66
  margin-inline-start: auto;
@@ -1,219 +1,27 @@
1
- /* reset starlight styles */
2
- @layer starlight.core {
3
- .sidebar .sidebar-pane .sidebar-content {
4
- * {
5
- all: revert-layer;
6
- &::before,
7
- &::after {
8
- all: revert-layer;
9
- }
10
- }
11
- }
12
- }
13
-
14
- .sidebar {
15
- --stl-sidebar-item-padding-inline: 12px;
16
- --stl-sidebar-item-padding-block: 6px;
17
- --stl-sidebar-indent: 12px;
18
- font-size: var(--stl-ui-type-scale-text-sm);
19
- }
20
-
21
- .sidebar-pane {
22
- border-inline-end: 1px solid var(--sl-color-hairline-light);
23
- }
24
-
25
- .sidebar-content {
26
- ul,
27
- summary {
28
- list-style-type: none;
29
- }
30
-
31
- /* collapsible sections */
32
- details > summary {
33
- display: flex;
34
- align-items: center;
35
- font-weight: 500;
36
-
37
- .caret {
38
- margin-left: auto;
39
- margin-right: -4px;
40
- opacity: 0.65;
41
- transition:
42
- opacity 0.1s ease-out,
43
- transform 0.1s ease-out;
44
- }
45
- }
46
- details[open] > summary .caret {
47
- opacity: 1;
48
- transform: rotate(90deg);
49
- }
50
-
51
- /* list items */
52
- summary,
53
- li {
54
- margin: 0;
55
- border-radius: 8px;
56
- }
57
- summary,
58
- li a {
59
- cursor: pointer;
60
- padding: var(--stl-sidebar-item-padding-block) var(--stl-sidebar-item-padding-inline);
61
- &:hover,
62
- &[aria-current='page'] {
63
- color: var(--stl-ui-foreground);
64
- }
65
- }
66
- li a {
67
- color: var(--stl-ui-foreground-secondary);
68
- font-weight: 400;
69
- display: flex;
70
- text-decoration: none;
71
- span {
72
- font-weight: inherit;
73
- }
74
-
75
- &:hover {
76
- text-decoration: underline;
77
- text-decoration-color: var(--stl-ui-foreground-secondary);
78
- }
79
- &[aria-current='page'] {
80
- font-weight: 500;
81
- }
82
- }
83
- li:has(> a:is(:hover, [aria-current='page'])),
84
- summary:hover {
85
- background-color: var(--stl-ui-muted-background);
86
- }
87
-
88
- /* nested list items have flat left edge */
89
- ul ul :is(summary, li) {
90
- border-start-start-radius: 0;
91
- border-end-start-radius: 0;
92
- }
93
- ul {
94
- padding: 0;
95
- }
96
- ul ul li {
97
- border-inline-start: 1px solid var(--stl-ui-border-muted);
98
- margin-inline-start: var(--stl-sidebar-indent);
99
- &:has(> a[aria-current='page']) {
100
- border-inline-start: 2px solid var(--stl-ui-foreground-accent);
101
- & > a {
102
- margin-left: -1px;
103
- }
104
- }
105
- }
106
-
107
- /* Method & resource icons */
108
-
109
- a[data-stldocs-method],
110
- a[data-stldocs-resource] {
111
- --stl-ui-sidebar-icon-size-outer: 18px;
112
- --stl-ui-sidebar-icon-margin: 8px;
113
- }
114
- a[data-stldocs-method] {
115
- --stl-ui-sidebar-icon-size-inner: 16px;
116
- --stl-ui-sidebar-icon-color-inverse: var(--stl-ui-swatch-gray-white);
117
-
118
- &[data-stldocs-method='get'] {
119
- --stl-ui-sidebar-icon-color: var(--stl-ui-swatch-green-base);
120
- --stl-ui-sidebar-icon-color-faint: var(--stl-ui-swatch-green-faint);
121
- --stl-ui-sidebar-icon-color-muted: var(--stl-ui-swatch-green-muted);
122
- }
123
- &[data-stldocs-method='post'] {
124
- --stl-ui-sidebar-icon-color: var(--stl-ui-swatch-blue-base);
125
- --stl-ui-sidebar-icon-color-faint: var(--stl-ui-swatch-blue-faint);
126
- --stl-ui-sidebar-icon-color-muted: var(--stl-ui-swatch-blue-muted);
127
- }
128
- &[data-stldocs-method='patch'],
129
- &[data-stldocs-method='put'] {
130
- --stl-ui-sidebar-icon-color: var(--stl-ui-swatch-orange-base);
131
- --stl-ui-sidebar-icon-color-faint: var(--stl-ui-swatch-orange-faint);
132
- --stl-ui-sidebar-icon-color-muted: var(--stl-ui-swatch-orange-muted);
133
- }
134
- &[data-stldocs-method='delete'] {
135
- --stl-ui-sidebar-icon-color: var(--stl-ui-swatch-red-base);
136
- --stl-ui-sidebar-icon-color-faint: var(--stl-ui-swatch-red-faint);
137
- --stl-ui-sidebar-icon-color-muted: var(--stl-ui-swatch-red-muted);
138
- }
139
-
140
- &[data-stldocs-method='get'] {
141
- --stl-ui-sidebar-icon-url: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17 7 7 17"/><path d="M17 17H7V7"/></svg>');
142
- }
143
- &[data-stldocs-method='post'],
144
- &[data-stldocs-method='put'],
145
- &[data-stldocs-method='patch'] {
146
- --stl-ui-sidebar-icon-url: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M7 7h10v10"/><path d="M7 17 17 7"/></svg>');
147
- }
148
- &[data-stldocs-method='delete'] {
149
- --stl-ui-sidebar-icon-url: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>');
150
- }
151
- }
152
-
153
- a[data-stldocs-resource] {
154
- /* not yet implemented in markup */
155
- --stl-ui-sidebar-icon-color: var(--stl-ui-foreground-muted);
156
- --stl-ui-sidebar-icon-color-faint: var(--stl-ui-muted-background);
157
- --stl-ui-sidebar-icon-color-inverse: var(--stl-ui-inverse-foreground);
158
- --stl-ui-sidebar-icon-size-inner: 14px;
159
- --stl-ui-sidebar-icon-url: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1"/><path d="M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1"/></svg>');
160
- }
1
+ .page > .sidebar > .sidebar-pane {
2
+ padding-inline-end: 1rem;
3
+ border-inline-end: 1px solid var(--stl-color-border-faint);
4
+ padding-block-end: calc(2rem + env(safe-area-inset-bottom));
161
5
 
162
- a[data-stldocs-method],
163
- a[data-stldocs-resource] {
164
- display: flex;
165
- gap: var(--stl-ui-sidebar-icon-margin);
166
- align-items: center;
167
- position: relative;
6
+ /* make sure the sidebar doesn’t get clipped on the left by overflow */
7
+ margin-inline-start: calc(-1 * var(--stl-page-gutter-left));
8
+ padding-inline-start: var(--stl-page-gutter-left);
168
9
 
169
- &::before,
170
- &::after {
171
- content: '';
172
- width: var(--stl-ui-sidebar-icon-size-outer);
173
- height: var(--stl-ui-sidebar-icon-size-outer);
174
- display: block;
175
- }
176
- &::before {
177
- border-radius: 4px;
178
- background-color: var(--stl-ui-sidebar-icon-color-faint);
179
- flex: 0 0 auto;
180
- }
181
- /* yuck (we can clean this up once we are changing sidebar markup) */
182
- &::after {
183
- background-color: var(--stl-ui-sidebar-icon-color);
184
- mask-image: var(--stl-ui-sidebar-icon-url);
185
- mask-size: var(--stl-ui-sidebar-icon-size-inner) var(--stl-ui-sidebar-icon-size-inner);
186
- mask-repeat: no-repeat;
187
- mask-position: center;
188
- position: absolute;
189
- left: var(--stl-sidebar-item-padding-inline);
190
- top: 50%;
191
- transform: translateY(-50%);
192
- }
10
+ background-color: var(--stl-color-background);
11
+ /* work around chrome bug where the background-color isn’t getting painted in the overscroll? */
12
+ background-image: linear-gradient(to bottom, var(--stl-color-background), var(--stl-color-background));
13
+ background-attachment: fixed;
193
14
 
194
- &:hover {
195
- &::before {
196
- background-color: var(--stl-ui-sidebar-icon-color-muted);
197
- }
198
- }
199
- &[aria-current='page'] {
200
- &::before {
201
- background-color: var(--stl-ui-sidebar-icon-color);
202
- }
203
- &::after {
204
- background-color: var(--stl-ui-sidebar-icon-color-inverse);
205
- }
206
- }
207
- }
208
- }
209
-
210
- .sidebar-content .stl-mobile-only-sidebar-item-last {
211
- margin-bottom: 2rem;
212
- position: relative;
15
+ display: flex;
16
+ flex-direction: column;
17
+ gap: 1rem;
213
18
  }
214
19
 
215
- .stl-sdk-select .dropdown-toggle {
216
- width: 100%;
20
+ @media (min-width: 50rem) {
21
+ .page > .sidebar :is(.stl-sdk-select, .stldocs-sidebar) {
22
+ /* align left edge of text with container */
23
+ margin-inline-start: calc(-1 * var(--stldocs-sidebar-item-padding-inline));
24
+ }
217
25
  }
218
26
 
219
27
  .stl-sidebar-header-links {
@@ -232,3 +40,12 @@
232
40
  display: none;
233
41
  }
234
42
  }
43
+
44
+ /* No sidebar on splash pages */
45
+ .page > .sidebar.hidden {
46
+ /* Note: on mobile, this will be overridden to display: contents; in order to show the mobile menu */
47
+ display: none;
48
+ }
49
+ :root:has(.page > .sidebar.hidden) {
50
+ --stl-sidebar-width: 0px;
51
+ }
@@ -1,18 +1,14 @@
1
1
  :root {
2
2
  --sl-color-bg-table-row: #ffffff0a;
3
3
  --sl-button-border-radius: 8px;
4
- --sl-text-body-sm: 0.86rem;
5
- --sl-content-width: 52rem;
6
- --sl-nav-pad-y: 0.5rem;
7
- --sl-nav-height: 56px;
8
- --sl-sidebar-width: 19rem;
9
4
  --sl-button-size: 32px;
10
5
  --sl-button-padding-x: 0.75rem;
11
6
  --sl-button-padding-y: 0.5rem;
12
7
  --sl-button-icon-offset: 0.2rem;
13
- --sl-menu-button-size: var(--sl-button-size);
8
+
9
+ /* TODO: remove --sl-nav-height dependencies */
10
+ --sl-nav-height: 56px;
14
11
 
15
12
  --sl-nav-gap: 0.5rem;
16
- --sl-icon-color: var(--sl-color-text);
17
- --sl-page-max-width: unset;
13
+ --sl-icon-color: var(--stl-color-foreground);
18
14
  }
@@ -0,0 +1,6 @@
1
+ @import '@stainless-api/docs-ui/styles/variables.css';
2
+
3
+ :root {
4
+ --stldocs-content-width: var(--stl-content-max-width);
5
+ --stldocs-content-padding-inline: 0;
6
+ }