@stainless-api/docs 0.1.0-beta.7 → 0.1.0-beta.70

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 (120) hide show
  1. package/CHANGELOG.md +554 -0
  2. package/README.md +1 -1
  3. package/eslint-suppressions.json +52 -0
  4. package/locals.d.ts +17 -0
  5. package/package.json +51 -40
  6. package/plugin/assets/languages/csharp.svg +1 -0
  7. package/plugin/buildAlgoliaIndex.ts +32 -7
  8. package/plugin/cms/server.ts +130 -58
  9. package/plugin/cms/sidebar-builder.ts +7 -26
  10. package/plugin/cms/worker.ts +83 -5
  11. package/plugin/components/MethodDescription.tsx +54 -0
  12. package/plugin/components/SDKSelect.astro +7 -87
  13. package/plugin/components/SnippetCode.tsx +53 -8
  14. package/plugin/components/search/SearchAlgolia.astro +45 -28
  15. package/plugin/components/search/SearchIsland.tsx +38 -24
  16. package/plugin/create-playground.shim.tsx +3 -0
  17. package/plugin/generateAPIReferenceLink.ts +2 -2
  18. package/plugin/globalJs/ai-dropdown-options.ts +243 -0
  19. package/plugin/globalJs/code-snippets.ts +15 -8
  20. package/plugin/globalJs/copy.ts +81 -16
  21. package/plugin/globalJs/method-descriptions.ts +33 -0
  22. package/plugin/globalJs/navigation.ts +7 -4
  23. package/plugin/helpers/generateDocsRoutes.ts +27 -0
  24. package/plugin/index.ts +178 -35
  25. package/plugin/languages.ts +5 -2
  26. package/plugin/loadPluginConfig.ts +121 -32
  27. package/plugin/middlewareBuilder/stainlessMiddleware.d.ts +1 -1
  28. package/plugin/react/Routing.tsx +208 -129
  29. package/plugin/referencePlaceholderUtils.ts +1 -1
  30. package/plugin/replaceSidebarPlaceholderMiddleware.ts +5 -1
  31. package/plugin/routes/Docs.astro +62 -89
  32. package/plugin/routes/DocsStatic.astro +1 -1
  33. package/plugin/routes/Overview.astro +10 -16
  34. package/plugin/routes/markdown.ts +9 -8
  35. package/plugin/vendor/preview.worker.docs.js +19768 -17702
  36. package/plugin/vendor/templates/go.md +1 -1
  37. package/plugin/vendor/templates/python.md +1 -1
  38. package/resolveSrcFile.ts +10 -0
  39. package/scripts/vendor_deps.ts +5 -5
  40. package/shared/getProsePages.ts +42 -0
  41. package/shared/getSharedLogger.ts +15 -0
  42. package/shared/terminalUtils.ts +3 -0
  43. package/src/content.config.ts +9 -0
  44. package/stl-docs/components/AIDropdown.tsx +63 -0
  45. package/stl-docs/components/AiChatIsland.tsx +14 -0
  46. package/stl-docs/components/{content-panel/ContentBreadcrumbs.tsx → ContentBreadcrumbs.tsx} +10 -18
  47. package/stl-docs/components/Head.astro +16 -0
  48. package/stl-docs/components/Header.astro +6 -8
  49. package/stl-docs/components/PageFrame.astro +18 -0
  50. package/stl-docs/components/PageTitle.astro +82 -0
  51. package/stl-docs/components/TableOfContents.astro +34 -0
  52. package/stl-docs/components/ThemeProvider.astro +36 -0
  53. package/stl-docs/components/ThemeSelect.astro +84 -139
  54. package/stl-docs/components/content-panel/ContentPanel.astro +16 -25
  55. package/stl-docs/components/headers/SplashMobileMenuToggle.astro +17 -1
  56. package/stl-docs/components/headers/StackedHeader.astro +29 -24
  57. package/stl-docs/components/icons/chat-gpt.tsx +17 -0
  58. package/stl-docs/components/icons/claude.tsx +10 -0
  59. package/stl-docs/components/icons/cursor.tsx +10 -0
  60. package/stl-docs/components/icons/gemini.tsx +19 -0
  61. package/stl-docs/components/icons/markdown.tsx +10 -0
  62. package/stl-docs/components/index.ts +1 -0
  63. package/stl-docs/components/mintlify-compat/Accordion.astro +7 -5
  64. package/stl-docs/components/mintlify-compat/AccordionGroup.astro +7 -3
  65. package/stl-docs/components/mintlify-compat/Columns.astro +40 -42
  66. package/stl-docs/components/mintlify-compat/Frame.astro +16 -18
  67. package/stl-docs/components/mintlify-compat/callouts/Callout.astro +1 -1
  68. package/stl-docs/components/mintlify-compat/callouts/Check.astro +1 -1
  69. package/stl-docs/components/mintlify-compat/callouts/Danger.astro +1 -1
  70. package/stl-docs/components/mintlify-compat/callouts/Info.astro +1 -1
  71. package/stl-docs/components/mintlify-compat/callouts/Note.astro +1 -1
  72. package/stl-docs/components/mintlify-compat/callouts/Tip.astro +1 -1
  73. package/stl-docs/components/mintlify-compat/callouts/Warning.astro +1 -1
  74. package/stl-docs/components/mintlify-compat/card.css +33 -35
  75. package/stl-docs/components/mintlify-compat/index.ts +2 -4
  76. package/stl-docs/components/nav-tabs/NavDropdown.astro +31 -70
  77. package/stl-docs/components/nav-tabs/NavTabs.astro +78 -80
  78. package/stl-docs/components/nav-tabs/SecondaryNavTabs.astro +15 -8
  79. package/stl-docs/components/nav-tabs/buildNavLinks.ts +3 -2
  80. package/stl-docs/components/pagination/HomeLink.astro +10 -0
  81. package/stl-docs/components/pagination/Pagination.astro +175 -0
  82. package/stl-docs/components/pagination/PaginationLinkEmphasized.astro +22 -0
  83. package/stl-docs/components/pagination/PaginationLinkQuiet.astro +13 -0
  84. package/stl-docs/components/pagination/util.ts +71 -0
  85. package/stl-docs/components/scripts.ts +1 -0
  86. package/stl-docs/disableCalloutSyntax.ts +36 -0
  87. package/stl-docs/index.ts +141 -50
  88. package/stl-docs/loadStlDocsConfig.ts +45 -5
  89. package/stl-docs/proseMarkdown/proseMarkdownIntegration.ts +61 -0
  90. package/stl-docs/proseMarkdown/proseMarkdownMiddleware.ts +39 -0
  91. package/stl-docs/proseMarkdown/toMarkdown.ts +158 -0
  92. package/stl-docs/proseSearchIndexing.ts +450 -0
  93. package/stl-docs/tabsMiddleware.ts +11 -3
  94. package/styles/code.css +108 -140
  95. package/styles/fonts.css +32 -17
  96. package/styles/links.css +11 -48
  97. package/styles/method-descriptions.css +36 -0
  98. package/styles/overrides.css +48 -60
  99. package/styles/page.css +92 -52
  100. package/styles/sdk_select.css +9 -7
  101. package/styles/search.css +56 -69
  102. package/styles/sidebar.css +211 -131
  103. package/styles/{variables.css → sl-variables.css} +3 -2
  104. package/styles/stldocs-variables.css +6 -0
  105. package/styles/toc.css +41 -34
  106. package/theme.css +10 -10
  107. package/tsconfig.json +2 -5
  108. package/virtual-module.d.ts +26 -4
  109. package/components/variables.css +0 -135
  110. package/stl-docs/components/mintlify-compat/Step.astro +0 -58
  111. package/stl-docs/components/mintlify-compat/Steps.astro +0 -17
  112. /package/{plugin/assets → assets}/fonts/geist/OFL.txt +0 -0
  113. /package/{plugin/assets → assets}/fonts/geist/geist-italic-latin-ext.woff2 +0 -0
  114. /package/{plugin/assets → assets}/fonts/geist/geist-italic-latin.woff2 +0 -0
  115. /package/{plugin/assets → assets}/fonts/geist/geist-latin-ext.woff2 +0 -0
  116. /package/{plugin/assets → assets}/fonts/geist/geist-latin.woff2 +0 -0
  117. /package/{plugin/assets → assets}/fonts/geist/geist-mono-italic-latin-ext.woff2 +0 -0
  118. /package/{plugin/assets → assets}/fonts/geist/geist-mono-italic-latin.woff2 +0 -0
  119. /package/{plugin/assets → assets}/fonts/geist/geist-mono-latin-ext.woff2 +0 -0
  120. /package/{plugin/assets → assets}/fonts/geist/geist-mono-latin.woff2 +0 -0
@@ -1,168 +1,248 @@
1
- @layer stainless {
2
- .sidebar-pane {
3
- border-inline-end: 1px solid var(--sl-color-hairline-light);
4
- background-color: var(--sl-color-bg);
5
- }
6
-
7
- .sidebar-content {
8
- li a[aria-current='page'] {
9
- background-color: unset;
10
- color: var(--sl-color-text-accent);
11
-
12
- span {
13
- font-weight: normal;
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;
14
9
  }
15
10
  }
11
+ }
12
+ }
16
13
 
17
- li {
18
- margin-top: 0;
19
- }
20
-
21
- .group-label span,
22
- li a span {
23
- font-size: var(--sl-text-sm);
24
- line-height: 150%;
25
- }
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-typography-scale-sm);
19
+ }
26
20
 
27
- summary {
28
- padding: 0.435rem var(--sl-sidebar-item-padding-inline);
29
- padding-right: 4px;
30
- }
21
+ .sidebar-pane {
22
+ border-inline-end: 1px solid var(--stl-color-border-faint);
23
+ }
31
24
 
32
- .top-level > li:first-child > a,
33
- .top-level li:first-child details > summary {
34
- padding-top: 0;
35
- }
25
+ .sidebar-content {
26
+ ul,
27
+ summary {
28
+ list-style-type: none;
29
+ }
36
30
 
37
- li a {
38
- position: relative;
39
- padding: 0.435rem var(--sl-sidebar-item-padding-inline);
40
- }
31
+ /* collapsible sections */
32
+ details > summary {
33
+ display: flex;
34
+ align-items: center;
35
+ font-weight: 500;
41
36
 
42
- details > summary > svg {
43
- opacity: 0.5;
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
44
  }
45
+ }
46
+ details[open] > summary .caret {
47
+ opacity: 1;
48
+ transform: rotate(90deg);
49
+ }
45
50
 
46
- details[open] > summary > svg {
47
- opacity: 1;
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-color-foreground);
48
64
  }
65
+ }
49
66
 
50
- a.large span {
51
- font-weight: 400;
52
- color: var(--sl-color-gray-2);
53
-
54
- &:hover {
55
- color: var(--sl-color-white);
56
- }
67
+ li a {
68
+ color: var(--stl-color-foreground-reduced);
69
+ font-weight: 400;
70
+ display: flex;
71
+ text-decoration: none;
72
+ span {
73
+ font-weight: inherit;
57
74
  }
58
75
 
59
- a.large[aria-current='page'] span {
60
- color: var(--sl-color-text-accent);
76
+ &:hover {
77
+ text-decoration: underline;
78
+ text-decoration-color: var(--stl-color-foreground-reduced);
61
79
  }
62
-
63
- .stl-mobile-only-sidebar-item-last {
64
- border-bottom: 1px solid var(--sl-color-hairline-light);
65
- padding-bottom: 1rem;
66
- margin-bottom: 0.5rem;
80
+ &[aria-current='page'] {
81
+ font-weight: 500;
67
82
  }
68
83
  }
69
-
70
- .stl-sdk-select {
71
- .dropdown-toggle {
72
- width: 100%;
73
- }
84
+ li:has(> a:is(:hover, [aria-current='page'])),
85
+ summary:hover {
86
+ background-color: var(--stl-color-background-hover);
74
87
  }
75
88
 
76
- [data-stldocs-method] {
77
- display: flex;
78
- gap: 0.6rem;
89
+ /* nested list items have flat left edge */
90
+ ul ul :is(summary, li) {
91
+ border-start-start-radius: 0;
92
+ border-end-start-radius: 0;
79
93
  }
80
-
81
- [data-stldocs-method]::before {
82
- content: '';
83
- min-width: 20px;
84
- height: 20px;
85
- border-radius: 4px;
86
- text-align: center;
87
- margin-top: 1px;
94
+ ul {
95
+ padding: 0;
88
96
  }
89
-
90
- [aria-current='page']::after {
91
- content: '';
92
- position: absolute;
93
- /* Shift left accounting for sidebar item padding - current item width. Sidebar border width is not a variable, it's always set to 1px */
94
- left: calc(-1 * var(--sl-sidebar-item-padding-inline) - 1px);
95
- top: 10%;
96
- height: 80%;
97
- width: 2px;
98
- background-color: var(--sl-color-text-accent);
99
- }
100
-
101
- .stl-mobile-only-sidebar-item[aria-current='page']::after {
102
- background-color: transparent;
97
+ ul ul li {
98
+ border-inline-start: 1px solid var(--stl-color-border-faint);
99
+ margin-inline-start: var(--stl-sidebar-indent);
100
+ &:has(> a[aria-current='page']) {
101
+ border-inline-start: 2px solid var(--stl-color-accent-border-strong);
102
+ & > a {
103
+ margin-left: -1px;
104
+ }
105
+ }
103
106
  }
104
107
 
105
- /* CSS is the only way to customize the Starlight sidebar, so the SVGs have to be here. */
108
+ /* Method & resource icons */
106
109
 
107
- :root[data-theme='dark'] {
108
- [data-stldocs-method='get']::before {
109
- background-color: var(--sl-color-green-low);
110
- content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 -2 24 24" fill="none" stroke="rgba(74, 194, 107)" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-down-left-icon lucide-arrow-down-left"><path d="M17 7 7 17"/><path d="M17 17H7V7"/></svg>');
110
+ a[data-stldocs-method],
111
+ a[data-stldocs-resource] {
112
+ --stl-ui-sidebar-icon-size-outer: 18px;
113
+ --stl-ui-sidebar-icon-margin: 8px;
114
+ }
115
+ a[data-stldocs-method] {
116
+ --stl-ui-sidebar-icon-size-inner: 16px;
117
+ --stl-ui-sidebar-icon-color-inverse-background: var(--stl-ui-sidebar-icon-color);
118
+
119
+ &[data-stldocs-method='get'] {
120
+ --stl-ui-sidebar-icon-color: var(--stl-color-green-foreground);
121
+ --stl-ui-sidebar-icon-color-border: var(--stl-color-green-border);
122
+ --stl-ui-sidebar-icon-color-background: var(--stl-color-green-muted-background);
123
+ --stl-ui-sidebar-icon-color-background-hover: var(--stl-color-green-muted-background-hover);
124
+ --stl-ui-sidebar-icon-color-inverse-background: var(--stl-color-green-inverse-background);
125
+ --stl-ui-sidebar-icon-color-inverse-foreground: var(--stl-color-green-inverse-foreground);
126
+ }
127
+ &[data-stldocs-method='post'] {
128
+ --stl-ui-sidebar-icon-color: var(--stl-color-blue-foreground);
129
+ --stl-ui-sidebar-icon-color-border: var(--stl-color-blue-border);
130
+ --stl-ui-sidebar-icon-color-background: var(--stl-color-blue-muted-background);
131
+ --stl-ui-sidebar-icon-color-background-hover: var(--stl-color-blue-muted-background-hover);
132
+ --stl-ui-sidebar-icon-color-inverse-background: var(--stl-color-blue-inverse-background);
133
+ --stl-ui-sidebar-icon-color-inverse-foreground: var(--stl-color-blue-inverse-foreground);
134
+ }
135
+ &[data-stldocs-method='patch'],
136
+ &[data-stldocs-method='put'] {
137
+ --stl-ui-sidebar-icon-color: var(--stl-color-orange-foreground);
138
+ --stl-ui-sidebar-icon-color-border: var(--stl-color-orange-border);
139
+ --stl-ui-sidebar-icon-color-background: var(--stl-color-orange-muted-background);
140
+ --stl-ui-sidebar-icon-color-background-hover: var(--stl-color-orange-muted-background-hover);
141
+ --stl-ui-sidebar-icon-color-inverse-background: var(--stl-color-orange-inverse-background);
142
+ --stl-ui-sidebar-icon-color-inverse-foreground: var(--stl-color-orange-inverse-foreground);
143
+ }
144
+ &[data-stldocs-method='delete'] {
145
+ --stl-ui-sidebar-icon-color: var(--stl-color-red-foreground);
146
+ --stl-ui-sidebar-icon-color-border: var(--stl-color-red-border);
147
+ --stl-ui-sidebar-icon-color-background: var(--stl-color-red-muted-background);
148
+ --stl-ui-sidebar-icon-color-background-hover: var(--stl-color-red-muted-background-hover);
149
+ --stl-ui-sidebar-icon-color-inverse-background: var(--stl-color-red-inverse-background);
150
+ --stl-ui-sidebar-icon-color-inverse-foreground: var(--stl-color-red-inverse-foreground);
151
+ }
152
+
153
+ &[data-stldocs-method='get'] {
154
+ --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>');
155
+ }
156
+ &[data-stldocs-method='post'],
157
+ &[data-stldocs-method='put'],
158
+ &[data-stldocs-method='patch'] {
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="M7 7h10v10"/><path d="M7 17 17 7"/></svg>');
160
+ }
161
+ &[data-stldocs-method='delete'] {
162
+ --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>');
111
163
  }
164
+ }
112
165
 
113
- [data-stldocs-method='post']::before {
114
- background-color: var(--sl-color-blue-low);
115
- content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 -2 24 24" fill="none" stroke="rgba(84, 174, 255)" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-up-right-icon lucide-arrow-up-right"><path d="M7 7h10v10"/><path d="M7 17 17 7"/></svg>');
116
- }
166
+ a[data-stldocs-resource] {
167
+ /* not yet implemented in markup */
168
+ --stl-ui-sidebar-icon-color: var(--stl-color-foreground-muted);
169
+ --stl-ui-sidebar-icon-color-border: var(--stl-color-border);
170
+ --stl-ui-sidebar-icon-color-background: var(--stl-color-faint-background);
171
+ --stl-ui-sidebar-icon-color-background-hover: var(--stl-color-faint-background-hover);
172
+ --stl-ui-sidebar-icon-color-inverse-background: var(--stl-color-inverse-background);
173
+ --stl-ui-sidebar-icon-color-inverse-foreground: var(--stl-color-inverse-foreground);
174
+
175
+ --stl-ui-sidebar-icon-size-inner: 14px;
176
+ --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>');
177
+ }
117
178
 
118
- [data-stldocs-method='patch']::before,
119
- [data-stldocs-method='put']::before {
120
- background-color: var(--sl-color-orange-low);
121
- content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 -2 24 24" fill="none" stroke="rgba(251, 143, 68)" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-up-right-icon lucide-arrow-up-right"><path d="M7 7h10v10"/><path d="M7 17 17 7"/></svg>');
179
+ a[data-stldocs-method],
180
+ a[data-stldocs-resource] {
181
+ display: flex;
182
+ gap: var(--stl-ui-sidebar-icon-margin);
183
+ align-items: center;
184
+ position: relative;
185
+
186
+ &::before,
187
+ &::after {
188
+ content: '';
189
+ width: var(--stl-ui-sidebar-icon-size-outer);
190
+ height: var(--stl-ui-sidebar-icon-size-outer);
191
+ display: block;
192
+ }
193
+ &::before {
194
+ border-radius: 4px;
195
+ background-color: var(--stl-ui-sidebar-icon-color-background);
196
+ flex: 0 0 auto;
197
+ border: 1px solid var(--stl-ui-sidebar-icon-color-border, transparent);
198
+ }
199
+ /* yuck (we can clean this up once we are changing sidebar markup) */
200
+ &::after {
201
+ background-color: var(--stl-ui-sidebar-icon-color);
202
+ mask-image: var(--stl-ui-sidebar-icon-url);
203
+ mask-size: var(--stl-ui-sidebar-icon-size-inner) var(--stl-ui-sidebar-icon-size-inner);
204
+ mask-repeat: no-repeat;
205
+ mask-position: center;
206
+ position: absolute;
207
+ left: var(--stl-sidebar-item-padding-inline);
208
+ top: 50%;
209
+ transform: translateY(-50%);
210
+ }
211
+
212
+ &:hover {
213
+ &::before {
214
+ background-color: var(--stl-ui-sidebar-icon-color-background-hover);
215
+ }
122
216
  }
123
-
124
- [data-stldocs-method='delete']::before {
125
- background-color: var(--sl-color-red-low);
126
- content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 -2 24 24" fill="none" stroke="rgba(248, 89, 92)" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-x-icon lucide-x"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>');
217
+ &[aria-current='page'] {
218
+ &::before {
219
+ background-color: var(--stl-ui-sidebar-icon-color-inverse-background);
220
+ }
221
+ &::after {
222
+ background-color: var(--stl-ui-sidebar-icon-color-inverse-foreground);
223
+ }
127
224
  }
128
225
  }
226
+ }
129
227
 
130
- :root[data-theme='light'] {
131
- [data-stldocs-method='get']::before {
132
- background-color: var(--sl-color-green-low);
133
- content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 -2 24 24" fill="none" stroke="rgba(31, 124, 58)" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-down-left-icon lucide-arrow-down-left"><path d="M17 7 7 17"/><path d="M17 17H7V7"/></svg>');
134
- }
135
-
136
- [data-stldocs-method='post']::before {
137
- background-color: var(--sl-color-blue-low);
138
- content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 -2 24 24" fill="none" stroke="rgba(9, 105, 218)" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-up-right-icon lucide-arrow-up-right"><path d="M7 7h10v10"/><path d="M7 17 17 7"/></svg>');
139
- }
228
+ .sidebar-content .stl-mobile-only-sidebar-item-last {
229
+ margin-bottom: 2rem;
230
+ position: relative;
231
+ }
140
232
 
141
- [data-stldocs-method='patch']::before,
142
- [data-stldocs-method='put']::before {
143
- background-color: var(--sl-color-orange-low);
144
- content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 -2 24 24" fill="none" stroke="rgba(210, 86, 1)" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-up-right-icon lucide-arrow-up-right"><path d="M7 7h10v10"/><path d="M7 17 17 7"/></svg>');
145
- }
233
+ .stl-sidebar-header-links {
234
+ display: flex;
235
+ gap: 1rem;
236
+ flex-direction: column-reverse;
237
+ }
146
238
 
147
- [data-stldocs-method='delete']::before {
148
- background-color: var(--sl-color-red-low);
149
- content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 -2 24 24" fill="none" stroke="rgba(207, 34, 46)" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-x-icon lucide-x"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>');
150
- }
239
+ @media (min-width: 50rem) {
240
+ .stl-mobile-only-sidebar-item,
241
+ li:has(> .stl-mobile-only-sidebar-item) {
242
+ display: none;
151
243
  }
152
244
 
153
245
  .stl-sidebar-header-links {
154
- display: flex;
155
- gap: 1rem;
156
- flex-direction: column-reverse;
157
- }
158
-
159
- @media (min-width: 50rem) {
160
- .stl-mobile-only-sidebar-item {
161
- display: none;
162
- }
163
-
164
- .stl-sidebar-header-links {
165
- display: none;
166
- }
246
+ display: none;
167
247
  }
168
248
  }
@@ -1,7 +1,6 @@
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
4
  --sl-content-width: 52rem;
6
5
  --sl-nav-pad-y: 0.5rem;
7
6
  --sl-nav-height: 56px;
@@ -13,6 +12,8 @@
13
12
  --sl-menu-button-size: var(--sl-button-size);
14
13
 
15
14
  --sl-nav-gap: 0.5rem;
16
- --sl-icon-color: var(--sl-color-text);
15
+ --sl-icon-color: var(--stl-color-foreground);
17
16
  --sl-page-max-width: unset;
17
+
18
+ --sl-content-pad-x: 1rem;
18
19
  }
@@ -0,0 +1,6 @@
1
+ @import '@stainless-api/docs-ui/styles/variables.css';
2
+
3
+ :root {
4
+ --stldocs-content-width: var(--sl-content-width);
5
+ --stldocs-content-padding: var(--sl-content-pad-x);
6
+ }
package/styles/toc.css CHANGED
@@ -1,42 +1,49 @@
1
- @layer stainless {
2
- .right-sidebar-panel {
3
- nav > ul {
4
- padding-top: 0;
5
- border-left: 1px solid var(--sl-color-hairline-light);
6
- }
7
- ul ul {
8
- padding-top: 0;
9
- }
1
+ .right-sidebar-panel {
2
+ font-size: var(--stl-typography-scale-sm);
10
3
 
11
- ul > li > a {
12
- --pad-inline: 1rem;
13
- font-weight: 400;
14
- color: var(--sl-color-text);
15
- padding-block: 0.32rem;
16
- color: var(--sl-color-text-secondary);
17
- position: relative;
4
+ nav > ul {
5
+ padding-top: 0;
6
+ border-left: 1px solid var(--stl-color-border);
7
+ }
18
8
 
19
- &[aria-current='true'] {
20
- color: var(--sl-color-text-accent);
9
+ ul ul {
10
+ padding-top: 0;
11
+ }
21
12
 
22
- &::after {
23
- content: '';
24
- position: absolute;
25
- height: 100%;
26
- width: 2px;
27
- background-color: var(--sl-color-text-accent);
28
- left: -1px;
29
- top: 0;
30
- }
31
- }
13
+ ul > li > a {
14
+ --pad-inline: 1rem;
15
+ font-weight: 400;
16
+ padding-block: 0.32rem;
17
+ color: var(--stl-color-foreground-reduced);
18
+ position: relative;
19
+ font-size: inherit;
20
+
21
+ &:hover {
22
+ text-decoration: underline;
23
+ color: var(--stl-color-foreground);
24
+ text-decoration-color: var(--stl-color-foreground-reduced);
32
25
  }
33
26
 
34
- h2 {
35
- color: var(--stldocs-color-text-secondary);
36
- font-size: var(--stldocs-font-size-small);
37
- line-height: 150%;
38
- text-decoration: none;
39
- font-weight: 400;
27
+ &[aria-current='true'] {
28
+ color: var(--stl-color-accent-foreground);
29
+
30
+ &::after {
31
+ content: '';
32
+ position: absolute;
33
+ height: 100%;
34
+ width: 2px;
35
+ background-color: var(--stl-color-accent-border-strong);
36
+ left: -1px;
37
+ top: 0;
38
+ }
40
39
  }
41
40
  }
41
+
42
+ h2 {
43
+ color: var(--stl-color-foreground-reduced);
44
+ font-size: inherit;
45
+ line-height: 150%;
46
+ text-decoration: none;
47
+ font-weight: 400;
48
+ }
42
49
  }
package/theme.css CHANGED
@@ -1,10 +1,7 @@
1
1
  @layer starlight.base, starlight.reset, starlight.core, starlight.content, starlight.components, starlight.utils;
2
2
  @layer starlight;
3
- @layer stl-ui.starlight-compat, stl-ui.typography, stl-ui.components;
4
- @layer stl-ui, docs-ui, stainless;
5
3
 
6
4
  @import './styles/fonts.css';
7
- @import './styles/variables.css';
8
5
  @import './styles/links.css';
9
6
  @import './styles/sidebar.css';
10
7
  @import './styles/search.css';
@@ -13,13 +10,16 @@
13
10
  @import './styles/overrides.css';
14
11
  @import './styles/code.css';
15
12
  @import './styles/sdk_select.css';
13
+ @import './styles/method-descriptions.css';
14
+
16
15
  @import '@stainless-api/ui-primitives/styles.css';
17
- @import './styles/mintlify-compat.css';
18
16
 
19
- @import '@stainless-api/docs-ui/src/styles/resets.css';
20
- @import '@stainless-api/docs-ui/src/styles/primitives.css';
21
- @import '@stainless-api/docs-ui/src/styles/main.css';
22
- @import '@stainless-api/docs-ui/src/styles/snippets.css';
23
- @import '@stainless-api/docs-ui/src/styles/search.css';
17
+ @import './styles/sl-variables.css';
18
+ @import '@stainless-api/ui-primitives/styles/starlight-compat.css';
19
+ @import './styles/mintlify-compat.css';
24
20
 
25
- @import './components/variables.css';
21
+ @import './styles/stldocs-variables.css';
22
+ @import '@stainless-api/docs-ui/styles/resets.css';
23
+ @import '@stainless-api/docs-ui/styles/primitives.css';
24
+ @import '@stainless-api/docs-ui/styles/main.css';
25
+ @import '@stainless-api/docs-ui/styles/search.css';
package/tsconfig.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "extends": "astro/tsconfigs/strict",
2
+ "extends": "../../tsconfig.base.json",
3
3
  "include": [
4
4
  ".astro/*",
5
5
  "node_modules/@astrojs/starlight/**/*.d.ts",
@@ -7,11 +7,8 @@
7
7
  ".stl-docs/**/*",
8
8
  "./plugin/**/*"
9
9
  ],
10
- "exclude": ["dist"],
10
+ "exclude": ["dist", "**/preview.worker.docs.js"],
11
11
  "compilerOptions": {
12
- "paths": {
13
- "~/*": ["../../../stainless/legacy-dir-root/*"]
14
- },
15
12
  "jsx": "react-jsx",
16
13
  "jsxImportSource": "react"
17
14
  }
@@ -1,12 +1,16 @@
1
+ declare module 'virtual:stl-playground/create' {
2
+ export const createPlayground: CreatePlayground;
3
+ }
4
+
1
5
  declare module 'virtual:stl-starlight-virtual-module' {
2
6
  import type { CreateShikiHighlighterOptions } from '@astrojs/markdown-remark';
3
- import type { PropertySettingsType } from '@stainless-api/docs-ui/src/contexts';
7
+ import type { PropertySettingsType } from '@stainless-api/docs-ui/contexts';
4
8
  import type { StlStarlightMiddleware } from '@stainless-api/docs/plugin/MiddlewareTypes';
5
- import type { StainlessStarlightUserConfig } from './plugin/loadPluginConfig';
9
+ import type { DocsLanguage } from '@stainless-api/docs-ui/routing';
6
10
 
7
11
  export const BASE_PATH: string;
8
12
  export const CMS_PORT: number;
9
- export const EXCLUDE_LANGUAGES: string[];
13
+ export const EXCLUDE_LANGUAGES: DocsLanguage[];
10
14
  export const DEFAULT_LANGUAGE: string;
11
15
  export const BREADCRUMB_CONFIG: {
12
16
  includeCurrentPage?: boolean;
@@ -15,9 +19,11 @@ declare module 'virtual:stl-starlight-virtual-module' {
15
19
  export const HIGHLIGHT_THEMES: CreateShikiHighlighterOptions['themes'];
16
20
  export const CONTENT_PANEL_LAYOUT: 'double-pane' | 'single-pane';
17
21
  export const EXPERIMENTAL_COLLAPSIBLE_SNIPPETS: boolean | undefined;
22
+ export const EXPERIMENTAL_COLLAPSIBLE_METHOD_DESCRIPTIONS: boolean | undefined;
23
+ export const EXPERIMENTAL_PLAYGROUNDS: boolean | undefined;
18
24
  export const PROPERTY_SETTINGS: PropertySettingsType;
19
25
  export const MIDDLEWARE: StlStarlightMiddleware;
20
- export const SEARCH: StainlessStarlightUserConfig['search'];
26
+ export const ENABLE_CONTEXT_MENU: boolean;
21
27
  }
22
28
 
23
29
  declare module 'virtual:stl-docs-virtual-module' {
@@ -40,4 +46,20 @@ declare module 'virtual:stl-docs-virtual-module' {
40
46
  export const SPLIT_TABS_ENABLED: boolean;
41
47
  export const HEADER_LAYOUT: 'default' | 'stacked';
42
48
  export const ENABLE_CLIENT_ROUTER: boolean;
49
+ export const API_REFERENCE_BASE_PATH: string | null;
50
+ export const ENABLE_PROSE_MARKDOWN_RENDERING: boolean;
51
+ export const ENABLE_CONTEXT_MENU: boolean;
52
+ export const RENDER_PAGE_DESCRIPTIONS: boolean;
53
+ }
54
+
55
+ declare module 'virtual:stl-docs/components/AiChat.tsx' {
56
+ const AiChatComponent:
57
+ | import('react').ComponentType<{
58
+ projectId: string;
59
+ language: import('@stainless-api/docs-ui/routing').DocsLanguage | undefined;
60
+ siteTitle: string | undefined;
61
+ }>
62
+ | null;
63
+ export default AiChatComponent;
64
+ export const STAINLESS_PROJECT: string | undefined;
43
65
  }