@stainless-api/docs 0.1.0-beta.4 → 0.1.0-beta.41

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 (108) hide show
  1. package/CHANGELOG.md +297 -0
  2. package/components/variables.css +2 -32
  3. package/eslint-suppressions.json +47 -0
  4. package/locals.d.ts +14 -0
  5. package/package.json +35 -31
  6. package/plugin/buildAlgoliaIndex.ts +31 -6
  7. package/plugin/cms/server.ts +98 -55
  8. package/plugin/cms/sidebar-builder.ts +7 -26
  9. package/plugin/cms/worker.ts +3 -3
  10. package/plugin/components/SDKSelect.astro +7 -5
  11. package/plugin/components/SnippetCode.tsx +11 -7
  12. package/plugin/components/search/SearchAlgolia.astro +5 -20
  13. package/plugin/components/search/SearchIsland.tsx +33 -22
  14. package/plugin/generateAPIReferenceLink.ts +2 -2
  15. package/plugin/globalJs/ai-dropdown-options.ts +235 -0
  16. package/plugin/globalJs/navigation.ts +7 -27
  17. package/plugin/helpers/getPageLoadEvent.ts +1 -1
  18. package/plugin/index.ts +52 -25
  19. package/plugin/languages.ts +2 -2
  20. package/plugin/loadPluginConfig.ts +103 -32
  21. package/plugin/middlewareBuilder/stainlessMiddleware.d.ts +1 -1
  22. package/plugin/react/Routing.tsx +60 -57
  23. package/plugin/referencePlaceholderUtils.ts +1 -1
  24. package/plugin/replaceSidebarPlaceholderMiddleware.ts +5 -1
  25. package/plugin/routes/Docs.astro +59 -85
  26. package/plugin/routes/Overview.astro +10 -16
  27. package/plugin/routes/markdown.ts +7 -7
  28. package/plugin/vendor/preview.worker.docs.js +7566 -6784
  29. package/resolveSrcFile.ts +10 -0
  30. package/scripts/vendor_deps.ts +1 -1
  31. package/shared/getSharedLogger.ts +15 -0
  32. package/shared/terminalUtils.ts +3 -0
  33. package/src/content.config.ts +9 -0
  34. package/stl-docs/components/AIDropdown.tsx +63 -0
  35. package/stl-docs/components/{content-panel/ContentBreadcrumbs.tsx → ContentBreadcrumbs.tsx} +2 -2
  36. package/stl-docs/components/Head.astro +16 -0
  37. package/stl-docs/components/Header.astro +3 -2
  38. package/stl-docs/components/PageTitle.astro +82 -0
  39. package/stl-docs/components/TableOfContents.astro +34 -0
  40. package/stl-docs/components/ThemeSelect.astro +80 -112
  41. package/stl-docs/components/content-panel/ContentPanel.astro +9 -39
  42. package/stl-docs/components/headers/DefaultHeader.astro +1 -1
  43. package/stl-docs/components/headers/HeaderLinks.astro +1 -1
  44. package/stl-docs/components/headers/SplashMobileMenuToggle.astro +19 -0
  45. package/stl-docs/components/headers/StackedHeader.astro +29 -24
  46. package/stl-docs/components/icons/chat-gpt.tsx +17 -0
  47. package/stl-docs/components/icons/claude.tsx +10 -0
  48. package/stl-docs/components/icons/cursor.tsx +10 -0
  49. package/stl-docs/components/icons/gemini.tsx +19 -0
  50. package/stl-docs/components/icons/markdown.tsx +10 -0
  51. package/stl-docs/components/index.ts +1 -0
  52. package/stl-docs/components/mintlify-compat/Accordion.astro +7 -38
  53. package/stl-docs/components/mintlify-compat/AccordionGroup.astro +9 -23
  54. package/stl-docs/components/mintlify-compat/Columns.astro +40 -42
  55. package/stl-docs/components/mintlify-compat/Frame.astro +16 -18
  56. package/stl-docs/components/mintlify-compat/Step.astro +30 -32
  57. package/stl-docs/components/mintlify-compat/Steps.astro +8 -10
  58. package/stl-docs/components/mintlify-compat/callouts/Callout.astro +10 -3
  59. package/stl-docs/components/mintlify-compat/callouts/Check.astro +7 -3
  60. package/stl-docs/components/mintlify-compat/callouts/Danger.astro +7 -3
  61. package/stl-docs/components/mintlify-compat/callouts/Info.astro +7 -3
  62. package/stl-docs/components/mintlify-compat/callouts/Note.astro +7 -3
  63. package/stl-docs/components/mintlify-compat/callouts/Tip.astro +7 -3
  64. package/stl-docs/components/mintlify-compat/callouts/Warning.astro +7 -3
  65. package/stl-docs/components/mintlify-compat/card.css +33 -35
  66. package/stl-docs/components/nav-tabs/NavDropdown.astro +29 -63
  67. package/stl-docs/components/nav-tabs/NavTabs.astro +79 -65
  68. package/stl-docs/components/nav-tabs/SecondaryNavTabs.astro +15 -7
  69. package/stl-docs/components/nav-tabs/buildNavLinks.ts +4 -3
  70. package/stl-docs/components/pagination/HomeLink.astro +10 -0
  71. package/stl-docs/components/pagination/Pagination.astro +173 -0
  72. package/stl-docs/components/pagination/PaginationLinkEmphasized.astro +22 -0
  73. package/stl-docs/components/pagination/PaginationLinkQuiet.astro +13 -0
  74. package/stl-docs/components/pagination/util.ts +71 -0
  75. package/stl-docs/components/scripts.ts +1 -0
  76. package/stl-docs/components/{Sidebar.astro → sidebars/BaseSidebar.astro} +2 -3
  77. package/stl-docs/components/sidebars/SDKSelectSidebar.astro +8 -0
  78. package/stl-docs/disableCalloutSyntax.ts +36 -0
  79. package/stl-docs/index.ts +76 -27
  80. package/stl-docs/loadStlDocsConfig.ts +35 -5
  81. package/stl-docs/proseMarkdown/proseMarkdownIntegration.ts +64 -0
  82. package/stl-docs/proseMarkdown/proseMarkdownMiddleware.ts +34 -0
  83. package/stl-docs/proseMarkdown/toMarkdown.ts +158 -0
  84. package/stl-docs/tabsMiddleware.ts +12 -4
  85. package/styles/code.css +115 -127
  86. package/styles/fonts.css +32 -17
  87. package/styles/links.css +10 -49
  88. package/styles/overrides.css +53 -57
  89. package/styles/page.css +90 -59
  90. package/styles/sdk_select.css +9 -7
  91. package/styles/search.css +59 -69
  92. package/styles/sidebar.css +190 -127
  93. package/styles/toc.css +37 -33
  94. package/theme.css +9 -1
  95. package/tsconfig.json +2 -5
  96. package/virtual-module.d.ts +7 -4
  97. package/plugin/globalJs/ai-dropdown.ts +0 -57
  98. package/stl-docs/components/APIReferenceAIDropdown.tsx +0 -86
  99. package/stl-docs/components/content-panel/ProseAIDropdown.tsx +0 -64
  100. /package/{plugin/assets → assets}/fonts/geist/OFL.txt +0 -0
  101. /package/{plugin/assets → assets}/fonts/geist/geist-italic-latin-ext.woff2 +0 -0
  102. /package/{plugin/assets → assets}/fonts/geist/geist-italic-latin.woff2 +0 -0
  103. /package/{plugin/assets → assets}/fonts/geist/geist-latin-ext.woff2 +0 -0
  104. /package/{plugin/assets → assets}/fonts/geist/geist-latin.woff2 +0 -0
  105. /package/{plugin/assets → assets}/fonts/geist/geist-mono-italic-latin-ext.woff2 +0 -0
  106. /package/{plugin/assets → assets}/fonts/geist/geist-mono-italic-latin.woff2 +0 -0
  107. /package/{plugin/assets → assets}/fonts/geist/geist-mono-latin-ext.woff2 +0 -0
  108. /package/{plugin/assets → assets}/fonts/geist/geist-mono-latin.woff2 +0 -0
@@ -1,168 +1,231 @@
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
  }
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-ui-foreground-secondary);
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-ui-foreground-secondary);
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-ui-muted-background);
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);
97
+ ul ul li {
98
+ border-inline-start: 1px solid var(--stl-ui-border-muted);
99
+ margin-inline-start: var(--stl-sidebar-indent);
100
+ &:has(> a[aria-current='page']) {
101
+ border-inline-start: 2px solid var(--stl-ui-foreground-accent);
102
+ & > a {
103
+ margin-left: -1px;
104
+ }
105
+ }
99
106
  }
100
107
 
101
- .stl-mobile-only-sidebar-item[aria-current='page']::after {
102
- background-color: transparent;
103
- }
108
+ /* Method & resource icons */
104
109
 
105
- /* CSS is the only way to customize the Starlight sidebar, so the SVGs have to be here. */
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: var(--stl-ui-swatch-gray-white);
106
118
 
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>');
119
+ &[data-stldocs-method='get'] {
120
+ --stl-ui-sidebar-icon-color: var(--stl-ui-swatch-green-base);
121
+ --stl-ui-sidebar-icon-color-faint: var(--stl-ui-swatch-green-faint);
122
+ --stl-ui-sidebar-icon-color-muted: var(--stl-ui-swatch-green-muted);
111
123
  }
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>');
124
+ &[data-stldocs-method='post'] {
125
+ --stl-ui-sidebar-icon-color: var(--stl-ui-swatch-blue-base);
126
+ --stl-ui-sidebar-icon-color-faint: var(--stl-ui-swatch-blue-faint);
127
+ --stl-ui-sidebar-icon-color-muted: var(--stl-ui-swatch-blue-muted);
116
128
  }
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>');
129
+ &[data-stldocs-method='patch'],
130
+ &[data-stldocs-method='put'] {
131
+ --stl-ui-sidebar-icon-color: var(--stl-ui-swatch-orange-base);
132
+ --stl-ui-sidebar-icon-color-faint: var(--stl-ui-swatch-orange-faint);
133
+ --stl-ui-sidebar-icon-color-muted: var(--stl-ui-swatch-orange-muted);
122
134
  }
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>');
135
+ &[data-stldocs-method='delete'] {
136
+ --stl-ui-sidebar-icon-color: var(--stl-ui-swatch-red-base);
137
+ --stl-ui-sidebar-icon-color-faint: var(--stl-ui-swatch-red-faint);
138
+ --stl-ui-sidebar-icon-color-muted: var(--stl-ui-swatch-red-muted);
127
139
  }
128
- }
129
140
 
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>');
141
+ &[data-stldocs-method='get'] {
142
+ --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
143
  }
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>');
144
+ &[data-stldocs-method='post'],
145
+ &[data-stldocs-method='put'],
146
+ &[data-stldocs-method='patch'] {
147
+ --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
148
  }
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>');
149
+ &[data-stldocs-method='delete'] {
150
+ --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
151
  }
152
+ }
146
153
 
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
- }
154
+ a[data-stldocs-resource] {
155
+ /* not yet implemented in markup */
156
+ --stl-ui-sidebar-icon-color: var(--stl-ui-foreground-muted);
157
+ --stl-ui-sidebar-icon-color-faint: var(--stl-ui-muted-background);
158
+ --stl-ui-sidebar-icon-color-inverse: var(--stl-ui-inverse-foreground);
159
+ --stl-ui-sidebar-icon-size-inner: 14px;
160
+ --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
161
  }
152
162
 
153
- .stl-sidebar-header-links {
163
+ a[data-stldocs-method],
164
+ a[data-stldocs-resource] {
154
165
  display: flex;
155
- gap: 1rem;
156
- flex-direction: column-reverse;
166
+ gap: var(--stl-ui-sidebar-icon-margin);
167
+ align-items: center;
168
+ position: relative;
169
+
170
+ &::before,
171
+ &::after {
172
+ content: '';
173
+ width: var(--stl-ui-sidebar-icon-size-outer);
174
+ height: var(--stl-ui-sidebar-icon-size-outer);
175
+ display: block;
176
+ }
177
+ &::before {
178
+ border-radius: 4px;
179
+ background-color: var(--stl-ui-sidebar-icon-color-faint);
180
+ flex: 0 0 auto;
181
+ }
182
+ /* yuck (we can clean this up once we are changing sidebar markup) */
183
+ &::after {
184
+ background-color: var(--stl-ui-sidebar-icon-color);
185
+ mask-image: var(--stl-ui-sidebar-icon-url);
186
+ mask-size: var(--stl-ui-sidebar-icon-size-inner) var(--stl-ui-sidebar-icon-size-inner);
187
+ mask-repeat: no-repeat;
188
+ mask-position: center;
189
+ position: absolute;
190
+ left: var(--stl-sidebar-item-padding-inline);
191
+ top: 50%;
192
+ transform: translateY(-50%);
193
+ }
194
+
195
+ &:hover {
196
+ &::before {
197
+ background-color: var(--stl-ui-sidebar-icon-color-muted);
198
+ }
199
+ }
200
+ &[aria-current='page'] {
201
+ &::before {
202
+ background-color: var(--stl-ui-sidebar-icon-color);
203
+ }
204
+ &::after {
205
+ background-color: var(--stl-ui-sidebar-icon-color-inverse);
206
+ }
207
+ }
157
208
  }
209
+ }
158
210
 
159
- @media (min-width: 50rem) {
160
- .stl-mobile-only-sidebar-item {
161
- display: none;
162
- }
211
+ .sidebar-content .stl-mobile-only-sidebar-item-last {
212
+ margin-bottom: 2rem;
213
+ position: relative;
214
+ }
163
215
 
164
- .stl-sidebar-header-links {
165
- display: none;
166
- }
216
+ .stl-sidebar-header-links {
217
+ display: flex;
218
+ gap: 1rem;
219
+ flex-direction: column-reverse;
220
+ }
221
+
222
+ @media (min-width: 50rem) {
223
+ .stl-mobile-only-sidebar-item,
224
+ li:has(> .stl-mobile-only-sidebar-item) {
225
+ display: none;
226
+ }
227
+
228
+ .stl-sidebar-header-links {
229
+ display: none;
167
230
  }
168
231
  }
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/styles/resets.css';
18
+ @import '@stainless-api/docs-ui/styles/primitives.css';
19
+ @import '@stainless-api/docs-ui/styles/main.css';
20
+ @import '@stainless-api/docs-ui/styles/snippets.css';
21
+ @import '@stainless-api/docs-ui/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
  }
@@ -1,8 +1,7 @@
1
1
  declare module 'virtual:stl-starlight-virtual-module' {
2
2
  import type { CreateShikiHighlighterOptions } from '@astrojs/markdown-remark';
3
- import type { PropertySettingsType } from '@stainless-api/docs-ui/src/contexts';
3
+ import type { PropertySettingsType } from '@stainless-api/docs-ui/contexts';
4
4
  import type { StlStarlightMiddleware } from '@stainless-api/docs/plugin/MiddlewareTypes';
5
- import type { StainlessStarlightUserConfig } from './plugin/loadPluginConfig';
6
5
 
7
6
  export const BASE_PATH: string;
8
7
  export const CMS_PORT: number;
@@ -17,10 +16,10 @@ declare module 'virtual:stl-starlight-virtual-module' {
17
16
  export const EXPERIMENTAL_COLLAPSIBLE_SNIPPETS: boolean | undefined;
18
17
  export const PROPERTY_SETTINGS: PropertySettingsType;
19
18
  export const MIDDLEWARE: StlStarlightMiddleware;
20
- export const SEARCH: StainlessStarlightUserConfig['search'];
19
+ export const ENABLE_CONTEXT_MENU: boolean;
21
20
  }
22
21
 
23
- declare module 'virtual:stl-stl-starlight-virtual-module' {
22
+ declare module 'virtual:stl-docs-virtual-module' {
24
23
  import type { ButtonVariant } from '@stainless-api/ui-primitives';
25
24
  import type { AnchorHTMLAttributes } from 'react';
26
25
 
@@ -40,4 +39,8 @@ declare module 'virtual:stl-stl-starlight-virtual-module' {
40
39
  export const SPLIT_TABS_ENABLED: boolean;
41
40
  export const HEADER_LAYOUT: 'default' | 'stacked';
42
41
  export const ENABLE_CLIENT_ROUTER: boolean;
42
+ export const API_REFERENCE_BASE_PATH: string | null;
43
+ export const ENABLE_PROSE_MARKDOWN_RENDERING: boolean;
44
+ export const ENABLE_CONTEXT_MENU: boolean;
45
+ export const RENDER_PAGE_DESCRIPTIONS: boolean;
43
46
  }
@@ -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
- }