@stainless-api/docs 0.1.0-beta.3 → 0.1.0-beta.30

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 (100) hide show
  1. package/CHANGELOG.md +214 -0
  2. package/components/variables.css +1 -27
  3. package/eslint-suppressions.json +47 -0
  4. package/locals.d.ts +14 -0
  5. package/package.json +30 -27
  6. package/plugin/buildAlgoliaIndex.ts +29 -4
  7. package/plugin/cms/server.ts +97 -54
  8. package/plugin/cms/sidebar-builder.ts +6 -25
  9. package/plugin/cms/worker.ts +2 -2
  10. package/plugin/components/SnippetCode.tsx +7 -4
  11. package/plugin/components/search/SearchAlgolia.astro +0 -7
  12. package/plugin/components/search/SearchIsland.tsx +30 -17
  13. package/plugin/generateAPIReferenceLink.ts +1 -1
  14. package/plugin/globalJs/ai-dropdown-options.ts +161 -0
  15. package/plugin/globalJs/navigation.ts +0 -23
  16. package/plugin/helpers/getPageLoadEvent.ts +1 -1
  17. package/plugin/index.ts +48 -18
  18. package/plugin/languages.ts +1 -1
  19. package/plugin/loadPluginConfig.ts +100 -13
  20. package/plugin/react/Routing.tsx +30 -33
  21. package/plugin/referencePlaceholderUtils.ts +1 -1
  22. package/plugin/replaceSidebarPlaceholderMiddleware.ts +4 -0
  23. package/plugin/routes/Docs.astro +59 -85
  24. package/plugin/routes/Overview.astro +9 -15
  25. package/plugin/routes/markdown.ts +1 -1
  26. package/plugin/vendor/preview.worker.docs.js +7566 -6784
  27. package/resolveSrcFile.ts +10 -0
  28. package/shared/getSharedLogger.ts +15 -0
  29. package/shared/terminalUtils.ts +3 -0
  30. package/src/content.config.ts +9 -0
  31. package/stl-docs/components/AIDropdown.tsx +52 -0
  32. package/stl-docs/components/Head.astro +16 -0
  33. package/stl-docs/components/Header.astro +3 -2
  34. package/stl-docs/components/PageTitle.astro +64 -0
  35. package/stl-docs/components/TableOfContents.astro +34 -0
  36. package/stl-docs/components/ThemeSelect.astro +4 -2
  37. package/stl-docs/components/content-panel/ContentPanel.astro +9 -39
  38. package/stl-docs/components/headers/DefaultHeader.astro +1 -1
  39. package/stl-docs/components/headers/HeaderLinks.astro +1 -1
  40. package/stl-docs/components/headers/StackedHeader.astro +29 -24
  41. package/stl-docs/components/icons/chat-gpt.tsx +17 -0
  42. package/stl-docs/components/icons/claude.tsx +10 -0
  43. package/stl-docs/components/icons/markdown.tsx +10 -0
  44. package/stl-docs/components/index.ts +2 -0
  45. package/stl-docs/components/mintlify-compat/Accordion.astro +7 -38
  46. package/stl-docs/components/mintlify-compat/AccordionGroup.astro +9 -23
  47. package/stl-docs/components/mintlify-compat/Columns.astro +40 -42
  48. package/stl-docs/components/mintlify-compat/Frame.astro +16 -18
  49. package/stl-docs/components/mintlify-compat/Step.astro +30 -32
  50. package/stl-docs/components/mintlify-compat/Steps.astro +8 -10
  51. package/stl-docs/components/mintlify-compat/callouts/Callout.astro +10 -3
  52. package/stl-docs/components/mintlify-compat/callouts/Check.astro +7 -3
  53. package/stl-docs/components/mintlify-compat/callouts/Danger.astro +7 -3
  54. package/stl-docs/components/mintlify-compat/callouts/Info.astro +7 -3
  55. package/stl-docs/components/mintlify-compat/callouts/Note.astro +7 -3
  56. package/stl-docs/components/mintlify-compat/callouts/Tip.astro +7 -3
  57. package/stl-docs/components/mintlify-compat/callouts/Warning.astro +7 -3
  58. package/stl-docs/components/mintlify-compat/card.css +33 -35
  59. package/stl-docs/components/nav-tabs/NavDropdown.astro +1 -1
  60. package/stl-docs/components/nav-tabs/SecondaryNavTabs.astro +15 -7
  61. package/stl-docs/components/nav-tabs/buildNavLinks.ts +4 -3
  62. package/stl-docs/components/pagination/HomeLink.astro +10 -0
  63. package/stl-docs/components/pagination/Pagination.astro +173 -0
  64. package/stl-docs/components/pagination/PaginationLinkEmphasized.astro +22 -0
  65. package/stl-docs/components/pagination/PaginationLinkQuiet.astro +13 -0
  66. package/stl-docs/components/pagination/util.ts +71 -0
  67. package/stl-docs/components/{Sidebar.astro → sidebars/BaseSidebar.astro} +2 -3
  68. package/stl-docs/components/sidebars/SDKSelectSidebar.astro +8 -0
  69. package/stl-docs/disableCalloutSyntax.ts +36 -0
  70. package/stl-docs/index.ts +76 -26
  71. package/stl-docs/loadStlDocsConfig.ts +25 -3
  72. package/stl-docs/proseMarkdown/proseMarkdownIntegration.ts +64 -0
  73. package/stl-docs/proseMarkdown/proseMarkdownMiddleware.ts +34 -0
  74. package/stl-docs/proseMarkdown/toMarkdown.ts +158 -0
  75. package/stl-docs/tabsMiddleware.ts +12 -4
  76. package/styles/code.css +115 -127
  77. package/styles/fonts.css +32 -17
  78. package/styles/links.css +10 -49
  79. package/styles/overrides.css +54 -57
  80. package/styles/page.css +89 -59
  81. package/styles/sdk_select.css +6 -7
  82. package/styles/search.css +65 -67
  83. package/styles/sidebar.css +199 -128
  84. package/styles/toc.css +37 -33
  85. package/theme.css +9 -1
  86. package/tsconfig.json +2 -5
  87. package/virtual-module.d.ts +5 -1
  88. package/plugin/globalJs/ai-dropdown.ts +0 -57
  89. package/stl-docs/components/APIReferenceAIDropdown.tsx +0 -86
  90. package/stl-docs/components/content-panel/ProseAIDropdown.tsx +0 -64
  91. /package/{plugin/assets → assets}/fonts/geist/OFL.txt +0 -0
  92. /package/{plugin/assets → assets}/fonts/geist/geist-italic-latin-ext.woff2 +0 -0
  93. /package/{plugin/assets → assets}/fonts/geist/geist-italic-latin.woff2 +0 -0
  94. /package/{plugin/assets → assets}/fonts/geist/geist-latin-ext.woff2 +0 -0
  95. /package/{plugin/assets → assets}/fonts/geist/geist-latin.woff2 +0 -0
  96. /package/{plugin/assets → assets}/fonts/geist/geist-mono-italic-latin-ext.woff2 +0 -0
  97. /package/{plugin/assets → assets}/fonts/geist/geist-mono-italic-latin.woff2 +0 -0
  98. /package/{plugin/assets → assets}/fonts/geist/geist-mono-latin-ext.woff2 +0 -0
  99. /package/{plugin/assets → assets}/fonts/geist/geist-mono-latin.woff2 +0 -0
  100. /package/stl-docs/components/{content-panel/ContentBreadcrumbs.tsx → ContentBreadcrumbs.tsx} +0 -0
@@ -1,168 +1,239 @@
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-ui-type-scale-text-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(--sl-color-hairline-light);
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-ui-foreground);
48
64
  }
49
-
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
- }
65
+ }
66
+ .stl-sdk-select .stldocs-dropdown-trigger {
67
+ /* dropdown should match link padding, accounting for 1px border */
68
+ padding: calc(var(--stl-sidebar-item-padding-block) - 1px)
69
+ calc(var(--stl-sidebar-item-padding-inline) - 1px);
70
+ }
71
+ li a {
72
+ color: var(--stl-ui-foreground-secondary);
73
+ font-weight: 400;
74
+ display: flex;
75
+ text-decoration: none;
76
+ span {
77
+ font-weight: inherit;
57
78
  }
58
79
 
59
- a.large[aria-current='page'] span {
60
- color: var(--sl-color-text-accent);
80
+ &:hover {
81
+ text-decoration: underline;
82
+ text-decoration-color: var(--stl-ui-foreground-secondary);
61
83
  }
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;
84
+ &[aria-current='page'] {
85
+ font-weight: 500;
67
86
  }
68
87
  }
69
-
70
- .stl-sdk-select {
71
- .dropdown-toggle {
72
- width: 100%;
73
- }
88
+ li:has(> a:is(:hover, [aria-current='page'])),
89
+ summary:hover {
90
+ background-color: var(--stl-ui-muted-background);
74
91
  }
75
92
 
76
- [data-stldocs-method] {
77
- display: flex;
78
- gap: 0.6rem;
93
+ /* nested list items have flat left edge */
94
+ ul ul :is(summary, li) {
95
+ border-start-start-radius: 0;
96
+ border-end-start-radius: 0;
79
97
  }
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;
98
+ ul {
99
+ padding: 0;
88
100
  }
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);
101
+ ul ul li {
102
+ border-inline-start: 1px solid var(--stl-ui-border-muted);
103
+ margin-inline-start: var(--stl-sidebar-indent);
104
+ &:has(> a[aria-current='page']) {
105
+ border-inline-start: 2px solid var(--stl-ui-foreground-accent);
106
+ & > a {
107
+ margin-left: -1px;
108
+ }
109
+ }
99
110
  }
100
111
 
101
- .stl-mobile-only-sidebar-item[aria-current='page']::after {
102
- background-color: transparent;
103
- }
112
+ /* Method & resource icons */
104
113
 
105
- /* CSS is the only way to customize the Starlight sidebar, so the SVGs have to be here. */
114
+ a[data-stldocs-method],
115
+ a[data-stldocs-resource] {
116
+ --stl-ui-sidebar-icon-size-outer: 18px;
117
+ --stl-ui-sidebar-icon-margin: 8px;
118
+ }
119
+ a[data-stldocs-method] {
120
+ --stl-ui-sidebar-icon-size-inner: 16px;
121
+ --stl-ui-sidebar-icon-color-inverse: var(--stl-ui-swatch-gray-white);
106
122
 
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>');
123
+ &[data-stldocs-method='get'] {
124
+ --stl-ui-sidebar-icon-color: var(--stl-ui-swatch-green-base);
125
+ --stl-ui-sidebar-icon-color-faint: var(--stl-ui-swatch-green-faint);
126
+ --stl-ui-sidebar-icon-color-muted: var(--stl-ui-swatch-green-muted);
111
127
  }
112
-
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>');
128
+ &[data-stldocs-method='post'] {
129
+ --stl-ui-sidebar-icon-color: var(--stl-ui-swatch-blue-base);
130
+ --stl-ui-sidebar-icon-color-faint: var(--stl-ui-swatch-blue-faint);
131
+ --stl-ui-sidebar-icon-color-muted: var(--stl-ui-swatch-blue-muted);
116
132
  }
117
-
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>');
133
+ &[data-stldocs-method='patch'],
134
+ &[data-stldocs-method='put'] {
135
+ --stl-ui-sidebar-icon-color: var(--stl-ui-swatch-orange-base);
136
+ --stl-ui-sidebar-icon-color-faint: var(--stl-ui-swatch-orange-faint);
137
+ --stl-ui-sidebar-icon-color-muted: var(--stl-ui-swatch-orange-muted);
122
138
  }
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>');
139
+ &[data-stldocs-method='delete'] {
140
+ --stl-ui-sidebar-icon-color: var(--stl-ui-swatch-red-base);
141
+ --stl-ui-sidebar-icon-color-faint: var(--stl-ui-swatch-red-faint);
142
+ --stl-ui-sidebar-icon-color-muted: var(--stl-ui-swatch-red-muted);
127
143
  }
128
- }
129
144
 
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>');
145
+ &[data-stldocs-method='get'] {
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="M17 7 7 17"/><path d="M17 17H7V7"/></svg>');
134
147
  }
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>');
148
+ &[data-stldocs-method='post'],
149
+ &[data-stldocs-method='put'],
150
+ &[data-stldocs-method='patch'] {
151
+ --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>');
139
152
  }
140
-
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>');
153
+ &[data-stldocs-method='delete'] {
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="M18 6 6 18"/><path d="m6 6 12 12"/></svg>');
145
155
  }
156
+ }
146
157
 
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
- }
158
+ a[data-stldocs-resource] {
159
+ /* not yet implemented in markup */
160
+ --stl-ui-sidebar-icon-color: var(--stl-ui-foreground-muted);
161
+ --stl-ui-sidebar-icon-color-faint: var(--stl-ui-muted-background);
162
+ --stl-ui-sidebar-icon-color-inverse: var(--stl-ui-inverse-foreground);
163
+ --stl-ui-sidebar-icon-size-inner: 14px;
164
+ --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>');
151
165
  }
152
166
 
153
- .stl-sidebar-header-links {
167
+ a[data-stldocs-method],
168
+ a[data-stldocs-resource] {
154
169
  display: flex;
155
- gap: 1rem;
156
- flex-direction: column-reverse;
170
+ gap: var(--stl-ui-sidebar-icon-margin);
171
+ align-items: center;
172
+ position: relative;
173
+
174
+ &::before,
175
+ &::after {
176
+ content: '';
177
+ width: var(--stl-ui-sidebar-icon-size-outer);
178
+ height: var(--stl-ui-sidebar-icon-size-outer);
179
+ display: block;
180
+ }
181
+ &::before {
182
+ border-radius: 4px;
183
+ background-color: var(--stl-ui-sidebar-icon-color-faint);
184
+ flex: 0 0 auto;
185
+ }
186
+ /* yuck (we can clean this up once we are changing sidebar markup) */
187
+ &::after {
188
+ background-color: var(--stl-ui-sidebar-icon-color);
189
+ mask-image: var(--stl-ui-sidebar-icon-url);
190
+ mask-size: var(--stl-ui-sidebar-icon-size-inner) var(--stl-ui-sidebar-icon-size-inner);
191
+ mask-repeat: no-repeat;
192
+ mask-position: center;
193
+ position: absolute;
194
+ left: var(--stl-sidebar-item-padding-inline);
195
+ top: 50%;
196
+ transform: translateY(-50%);
197
+ }
198
+
199
+ &:hover {
200
+ &::before {
201
+ background-color: var(--stl-ui-sidebar-icon-color-muted);
202
+ }
203
+ }
204
+ &[aria-current='page'] {
205
+ &::before {
206
+ background-color: var(--stl-ui-sidebar-icon-color);
207
+ }
208
+ &::after {
209
+ background-color: var(--stl-ui-sidebar-icon-color-inverse);
210
+ }
211
+ }
157
212
  }
213
+ }
158
214
 
159
- @media (min-width: 50rem) {
160
- .stl-mobile-only-sidebar-item {
161
- display: none;
162
- }
215
+ .sidebar-content .stl-mobile-only-sidebar-item-last {
216
+ margin-bottom: 2rem;
217
+ position: relative;
218
+ }
163
219
 
164
- .stl-sidebar-header-links {
165
- display: none;
166
- }
220
+ .stl-sdk-select .dropdown-toggle {
221
+ width: 100%;
222
+ }
223
+
224
+ .stl-sidebar-header-links {
225
+ display: flex;
226
+ gap: 1rem;
227
+ flex-direction: column-reverse;
228
+ }
229
+
230
+ @media (min-width: 50rem) {
231
+ .stl-mobile-only-sidebar-item,
232
+ li:has(> .stl-mobile-only-sidebar-item) {
233
+ display: none;
234
+ }
235
+
236
+ .stl-sidebar-header-links {
237
+ display: none;
167
238
  }
168
239
  }
package/styles/toc.css CHANGED
@@ -1,42 +1,46 @@
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
+ nav > ul {
3
+ padding-top: 0;
4
+ border-left: 1px solid var(--sl-color-hairline-light);
5
+ }
6
+
7
+ ul ul {
8
+ padding-top: 0;
9
+ }
10
10
 
11
- ul > li > a {
12
- --pad-inline: 1rem;
13
- font-weight: 400;
11
+ ul > li > a {
12
+ --pad-inline: 1rem;
13
+ font-weight: 400;
14
+ padding-block: 0.32rem;
15
+ color: var(--sl-color-text-secondary);
16
+ position: relative;
17
+
18
+ &:hover {
19
+ text-decoration: underline;
14
20
  color: var(--sl-color-text);
15
- padding-block: 0.32rem;
16
- color: var(--sl-color-text-secondary);
17
- position: relative;
21
+ text-decoration-color: var(--sl-color-text-tertiary);
22
+ }
18
23
 
19
- &[aria-current='true'] {
20
- color: var(--sl-color-text-accent);
24
+ &[aria-current='true'] {
25
+ color: var(--sl-color-text-accent);
21
26
 
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
- }
27
+ &::after {
28
+ content: '';
29
+ position: absolute;
30
+ height: 100%;
31
+ width: 2px;
32
+ background-color: var(--sl-color-text-accent);
33
+ left: -1px;
34
+ top: 0;
31
35
  }
32
36
  }
37
+ }
33
38
 
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;
40
- }
39
+ h2 {
40
+ color: var(--stldocs-color-text-secondary);
41
+ font-size: var(--stldocs-font-size-small);
42
+ line-height: 150%;
43
+ text-decoration: none;
44
+ font-weight: 400;
41
45
  }
42
46
  }
package/theme.css CHANGED
@@ -1,5 +1,5 @@
1
1
  @layer starlight.base, starlight.reset, starlight.core, starlight.content, starlight.components, starlight.utils;
2
- @layer starlight, docs-ui, stl-ui, stainless;
2
+ @layer starlight;
3
3
 
4
4
  @import './styles/fonts.css';
5
5
  @import './styles/variables.css';
@@ -13,3 +13,11 @@
13
13
  @import './styles/sdk_select.css';
14
14
  @import '@stainless-api/ui-primitives/styles.css';
15
15
  @import './styles/mintlify-compat.css';
16
+
17
+ @import '@stainless-api/docs-ui/src/styles/resets.css';
18
+ @import '@stainless-api/docs-ui/src/styles/primitives.css';
19
+ @import '@stainless-api/docs-ui/src/styles/main.css';
20
+ @import '@stainless-api/docs-ui/src/styles/snippets.css';
21
+ @import '@stainless-api/docs-ui/src/styles/search.css';
22
+
23
+ @import './components/variables.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
  }
@@ -18,9 +18,10 @@ declare module 'virtual:stl-starlight-virtual-module' {
18
18
  export const PROPERTY_SETTINGS: PropertySettingsType;
19
19
  export const MIDDLEWARE: StlStarlightMiddleware;
20
20
  export const SEARCH: StainlessStarlightUserConfig['search'];
21
+ export const ENABLE_CONTEXT_MENU: boolean;
21
22
  }
22
23
 
23
- declare module 'virtual:stl-stl-starlight-virtual-module' {
24
+ declare module 'virtual:stl-docs-virtual-module' {
24
25
  import type { ButtonVariant } from '@stainless-api/ui-primitives';
25
26
  import type { AnchorHTMLAttributes } from 'react';
26
27
 
@@ -40,4 +41,7 @@ declare module 'virtual:stl-stl-starlight-virtual-module' {
40
41
  export const SPLIT_TABS_ENABLED: boolean;
41
42
  export const HEADER_LAYOUT: 'default' | 'stacked';
42
43
  export const ENABLE_CLIENT_ROUTER: boolean;
44
+ export const API_REFERENCE_BASE_PATH: string | null;
45
+ export const ENABLE_PROSE_MARKDOWN_RENDERING: boolean;
46
+ export const ENABLE_CONTEXT_MENU: boolean;
43
47
  }
@@ -1,57 +0,0 @@
1
- export const copyCurrentPageAsMarkdown = async () => {
2
- const currentUrl = new URL(window.location.href);
3
- const markdownUrl = `${currentUrl.origin}${currentUrl.pathname}.md`;
4
-
5
- try {
6
- const response = await fetch(markdownUrl);
7
- if (!response.ok) {
8
- throw new Error('Network response was not ok');
9
- }
10
- const markdown = await response.text();
11
- await navigator.clipboard.writeText(markdown);
12
- console.log('Markdown copied to clipboard');
13
- } catch (error) {
14
- console.error('There has been a problem with your fetch operation:', error);
15
- }
16
- };
17
-
18
- export function onSelectAIOption(value: string, makeMarkdownLink: boolean = true) {
19
- if (value === 'copy-markdown') {
20
- copyCurrentPageAsMarkdown();
21
- }
22
- if (value === 'view-as-markdown') {
23
- const currentUrl = new URL(window.location.href);
24
- const markdownUrl = `${currentUrl.origin}${currentUrl.pathname}.md`;
25
- window.open(markdownUrl, '_blank');
26
- }
27
-
28
- if (value === 'chat-gpt') {
29
- const currentUrl = new URL(window.location.href);
30
- const llmUrl = makeMarkdownLink ? `${currentUrl.origin}${currentUrl.pathname}.md` : currentUrl.href;
31
-
32
- const prompt = `Read from ${llmUrl} so I can ask questions about it.`;
33
-
34
- const chatGptUrl = `https://chatgpt.com/?hints=search&prompt=${encodeURIComponent(prompt)}`;
35
- window.open(chatGptUrl, '_blank');
36
- }
37
-
38
- if (value === 'claude') {
39
- const currentUrl = new URL(window.location.href);
40
- const llmUrl = makeMarkdownLink ? `${currentUrl.origin}${currentUrl.pathname}.md` : currentUrl.href;
41
-
42
- const prompt = `Read from ${llmUrl} so I can ask questions about it.`;
43
-
44
- const claudeUrl = `https://claude.ai/new?q=${encodeURIComponent(prompt)}`;
45
- window.open(claudeUrl, '_blank');
46
- }
47
-
48
- if (value === 'cursor') {
49
- const currentUrl = new URL(window.location.href);
50
- const llmUrl = makeMarkdownLink ? `${currentUrl.origin}${currentUrl.pathname}.md` : currentUrl.href;
51
-
52
- const prompt = `Read from ${llmUrl} so I can ask questions about it.`;
53
-
54
- const cursorUrl = `https://www.cursor.so/?prompt=${encodeURIComponent(prompt)}`;
55
- window.open(cursorUrl, '_blank');
56
- }
57
- }