@stainless-api/docs 0.1.0-beta.1 → 0.1.0-beta.100

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 (158) hide show
  1. package/CHANGELOG.md +917 -0
  2. package/eslint-suppressions.json +27 -0
  3. package/locals.d.ts +17 -0
  4. package/package.json +50 -40
  5. package/playground-virtual-modules.d.ts +96 -0
  6. package/plugin/assets/languages/cli.svg +14 -0
  7. package/plugin/assets/languages/csharp.svg +1 -0
  8. package/plugin/assets/languages/php.svg +4 -0
  9. package/plugin/buildAlgoliaIndex.ts +40 -39
  10. package/plugin/components/MethodDescription.tsx +54 -0
  11. package/plugin/components/RequestBuilder/ParamEditor.tsx +55 -0
  12. package/plugin/components/RequestBuilder/SnippetStainlessIsland.tsx +107 -0
  13. package/plugin/components/RequestBuilder/index.tsx +37 -0
  14. package/plugin/components/RequestBuilder/props.ts +9 -0
  15. package/plugin/components/RequestBuilder/spec-helpers.ts +47 -0
  16. package/plugin/components/RequestBuilder/styles.css +67 -0
  17. package/plugin/components/SDKSelect.astro +18 -105
  18. package/plugin/components/SnippetCode.tsx +111 -66
  19. package/plugin/components/StainlessIslands.tsx +126 -0
  20. package/plugin/components/search/SearchAlgolia.astro +45 -35
  21. package/plugin/components/search/SearchIsland.tsx +47 -29
  22. package/plugin/generateAPIReferenceLink.ts +2 -2
  23. package/plugin/globalJs/ai-dropdown-options.ts +243 -0
  24. package/plugin/globalJs/code-snippets.ts +40 -11
  25. package/plugin/globalJs/copy.ts +95 -17
  26. package/plugin/globalJs/create-playground.shim.ts +3 -0
  27. package/plugin/globalJs/method-descriptions.ts +33 -0
  28. package/plugin/globalJs/navigation.ts +12 -33
  29. package/plugin/globalJs/playground-data.shim.ts +1 -0
  30. package/plugin/globalJs/playground-data.ts +14 -0
  31. package/plugin/helpers/generateDocsRoutes.ts +59 -0
  32. package/plugin/helpers/getPageLoadEvent.ts +1 -1
  33. package/plugin/helpers/multiSpec.ts +8 -0
  34. package/plugin/index.ts +299 -117
  35. package/plugin/languages.ts +8 -2
  36. package/plugin/loadPluginConfig.ts +254 -102
  37. package/plugin/middlewareBuilder/stainlessMiddleware.d.ts +1 -1
  38. package/plugin/react/Routing.tsx +210 -140
  39. package/plugin/referencePlaceholderUtils.ts +18 -15
  40. package/plugin/replaceSidebarPlaceholderMiddleware.ts +40 -32
  41. package/plugin/routes/Docs.astro +70 -119
  42. package/plugin/routes/DocsStatic.astro +6 -5
  43. package/plugin/routes/Overview.astro +37 -27
  44. package/plugin/routes/markdown.ts +13 -12
  45. package/plugin/{cms → sidebar-utils}/sidebar-builder.ts +49 -60
  46. package/plugin/specs/FileCache.ts +99 -0
  47. package/plugin/specs/fetchSpecSSR.ts +27 -0
  48. package/plugin/specs/generateSpec.ts +112 -0
  49. package/plugin/specs/index.ts +132 -0
  50. package/plugin/specs/inputResolver.ts +146 -0
  51. package/plugin/{cms → specs}/worker.ts +82 -5
  52. package/plugin/vendor/preview.worker.docs.js +22406 -17955
  53. package/plugin/vendor/templates/cli.md +1 -0
  54. package/plugin/vendor/templates/go.md +4 -2
  55. package/plugin/vendor/templates/java.md +3 -1
  56. package/plugin/vendor/templates/kotlin.md +3 -1
  57. package/plugin/vendor/templates/node.md +4 -2
  58. package/plugin/vendor/templates/python.md +4 -2
  59. package/plugin/vendor/templates/ruby.md +4 -2
  60. package/plugin/vendor/templates/terraform.md +1 -1
  61. package/plugin/vendor/templates/typescript.md +3 -1
  62. package/resolveSrcFile.ts +10 -0
  63. package/scripts/vendor_deps.ts +5 -5
  64. package/shared/getProsePages.ts +42 -0
  65. package/shared/getSharedLogger.ts +15 -0
  66. package/shared/terminalUtils.ts +3 -0
  67. package/shared/virtualModule.ts +54 -1
  68. package/src/content.config.ts +9 -0
  69. package/stl-docs/components/AIDropdown.tsx +63 -0
  70. package/stl-docs/components/AiChatIsland.tsx +14 -0
  71. package/stl-docs/components/{content-panel/ContentBreadcrumbs.tsx → ContentBreadcrumbs.tsx} +2 -2
  72. package/stl-docs/components/Head.astro +20 -0
  73. package/stl-docs/components/Header.astro +7 -9
  74. package/stl-docs/components/PageFrame.astro +18 -0
  75. package/stl-docs/components/PageTitle.astro +82 -0
  76. package/stl-docs/components/TableOfContents.astro +34 -0
  77. package/stl-docs/components/ThemeProvider.astro +36 -0
  78. package/stl-docs/components/ThemeSelect.astro +84 -144
  79. package/stl-docs/components/content-panel/ContentPanel.astro +16 -46
  80. package/stl-docs/components/headers/DefaultHeader.astro +1 -1
  81. package/stl-docs/components/headers/HeaderLinks.astro +1 -1
  82. package/stl-docs/components/headers/SplashMobileMenuToggle.astro +17 -1
  83. package/stl-docs/components/headers/StackedHeader.astro +29 -24
  84. package/stl-docs/components/icons/chat-gpt.tsx +17 -0
  85. package/stl-docs/components/icons/claude.tsx +10 -0
  86. package/stl-docs/components/icons/cursor.tsx +10 -0
  87. package/stl-docs/components/icons/gemini.tsx +19 -0
  88. package/stl-docs/components/icons/markdown.tsx +10 -0
  89. package/stl-docs/components/index.ts +1 -0
  90. package/stl-docs/components/mintlify-compat/Accordion.astro +7 -38
  91. package/stl-docs/components/mintlify-compat/AccordionGroup.astro +9 -23
  92. package/stl-docs/components/mintlify-compat/Columns.astro +40 -42
  93. package/stl-docs/components/mintlify-compat/Frame.astro +16 -18
  94. package/stl-docs/components/mintlify-compat/callouts/Callout.astro +10 -3
  95. package/stl-docs/components/mintlify-compat/callouts/Check.astro +7 -3
  96. package/stl-docs/components/mintlify-compat/callouts/Danger.astro +7 -3
  97. package/stl-docs/components/mintlify-compat/callouts/Info.astro +7 -3
  98. package/stl-docs/components/mintlify-compat/callouts/Note.astro +7 -3
  99. package/stl-docs/components/mintlify-compat/callouts/Tip.astro +7 -3
  100. package/stl-docs/components/mintlify-compat/callouts/Warning.astro +7 -3
  101. package/stl-docs/components/mintlify-compat/card.css +33 -35
  102. package/stl-docs/components/mintlify-compat/index.ts +2 -4
  103. package/stl-docs/components/nav-tabs/NavDropdown.astro +31 -75
  104. package/stl-docs/components/nav-tabs/NavTabs.astro +78 -80
  105. package/stl-docs/components/nav-tabs/SecondaryNavTabs.astro +15 -8
  106. package/stl-docs/components/nav-tabs/buildNavLinks.ts +4 -3
  107. package/stl-docs/components/pagination/HomeLink.astro +10 -0
  108. package/stl-docs/components/pagination/Pagination.astro +175 -0
  109. package/stl-docs/components/pagination/PaginationLinkEmphasized.astro +22 -0
  110. package/stl-docs/components/pagination/PaginationLinkQuiet.astro +13 -0
  111. package/stl-docs/components/pagination/util.ts +71 -0
  112. package/stl-docs/components/scripts.ts +1 -0
  113. package/stl-docs/components/sidebars/BaseSidebar.astro +87 -0
  114. package/stl-docs/components/sidebars/SDKSelectSidebar.astro +8 -0
  115. package/stl-docs/components/sidebars/SidebarWithComponents.tsx +10 -0
  116. package/stl-docs/components/sidebars/convertAstroSidebarToStl.tsx +62 -0
  117. package/stl-docs/disableCalloutSyntax.ts +36 -0
  118. package/stl-docs/fonts.ts +186 -0
  119. package/stl-docs/index.ts +159 -43
  120. package/stl-docs/loadStlDocsConfig.ts +60 -9
  121. package/stl-docs/proseMarkdown/proseMarkdownIntegration.ts +61 -0
  122. package/stl-docs/proseMarkdown/proseMarkdownMiddleware.ts +41 -0
  123. package/stl-docs/proseMarkdown/toMarkdown.ts +158 -0
  124. package/stl-docs/proseSearchIndexing.ts +606 -0
  125. package/stl-docs/tabsMiddleware.ts +14 -5
  126. package/styles/code.css +133 -136
  127. package/styles/links.css +11 -48
  128. package/styles/method-descriptions.css +36 -0
  129. package/styles/overrides.css +49 -57
  130. package/styles/page.css +100 -59
  131. package/styles/sdk_select.css +9 -7
  132. package/styles/search.css +57 -69
  133. package/styles/sidebar.css +26 -156
  134. package/styles/{variables.css → sl-variables.css} +3 -2
  135. package/styles/stldocs-variables.css +6 -0
  136. package/styles/toc.css +41 -34
  137. package/theme.css +13 -3
  138. package/tsconfig.json +2 -5
  139. package/virtual-module.d.ts +65 -7
  140. package/components/variables.css +0 -139
  141. package/plugin/cms/client.ts +0 -62
  142. package/plugin/cms/server.ts +0 -268
  143. package/plugin/globalJs/ai-dropdown.ts +0 -57
  144. package/stl-docs/components/APIReferenceAIDropdown.tsx +0 -86
  145. package/stl-docs/components/Sidebar.astro +0 -11
  146. package/stl-docs/components/content-panel/ProseAIDropdown.tsx +0 -64
  147. package/stl-docs/components/mintlify-compat/Step.astro +0 -58
  148. package/stl-docs/components/mintlify-compat/Steps.astro +0 -17
  149. package/styles/fonts.css +0 -68
  150. /package/{plugin/assets → assets}/fonts/geist/OFL.txt +0 -0
  151. /package/{plugin/assets → assets}/fonts/geist/geist-italic-latin-ext.woff2 +0 -0
  152. /package/{plugin/assets → assets}/fonts/geist/geist-italic-latin.woff2 +0 -0
  153. /package/{plugin/assets → assets}/fonts/geist/geist-latin-ext.woff2 +0 -0
  154. /package/{plugin/assets → assets}/fonts/geist/geist-latin.woff2 +0 -0
  155. /package/{plugin/assets → assets}/fonts/geist/geist-mono-italic-latin-ext.woff2 +0 -0
  156. /package/{plugin/assets → assets}/fonts/geist/geist-mono-italic-latin.woff2 +0 -0
  157. /package/{plugin/assets → assets}/fonts/geist/geist-mono-latin-ext.woff2 +0 -0
  158. /package/{plugin/assets → assets}/fonts/geist/geist-mono-latin.woff2 +0 -0
package/styles/page.css CHANGED
@@ -1,76 +1,117 @@
1
- /* Styles for supporting a max-width layout */
2
- @layer stainless {
3
- .page {
4
- position: relative;
5
- max-width: var(--sl-page-max-width);
6
- margin: 0 auto;
7
-
8
- .sidebar-pane {
9
- left: auto;
10
- }
1
+ .page,
2
+ .page > header .header,
3
+ .page > header .stl-secondary-nav-tabs {
4
+ max-width: var(--sl-page-max-width);
5
+ margin: 0 auto;
11
6
 
12
- > header {
13
- .stl-secondary-nav-tabs,
14
- .header {
15
- max-width: var(--sl-page-max-width);
16
- margin: 0 auto;
17
- }
18
- }
7
+ @media (min-width: 50rem) {
8
+ padding-inline: var(--stl-ui-page-padding-inline);
9
+ }
10
+ }
19
11
 
20
- .right-sidebar {
21
- border-inline-start: unset;
22
- }
12
+ .page {
13
+ position: relative;
14
+ max-width: var(--sl-page-max-width);
23
15
 
24
- .mobile-preferences {
25
- margin-top: 1rem;
26
- }
16
+ .right-sidebar {
17
+ border-inline-start: unset;
27
18
  }
28
19
 
29
- @media (min-width: 50rem) {
30
- .page {
31
- padding-left: var(--sl-sidebar-pad-x);
32
- padding-right: var(--sl-sidebar-pad-x);
33
-
34
- > header {
35
- .header,
36
- .stl-secondary-nav-tabs {
37
- padding: 0 1.5rem;
38
- }
39
- }
40
- }
20
+ .mobile-preferences {
21
+ margin-top: 1rem;
22
+ display: flex;
23
+ justify-content: flex-end;
24
+ }
25
+ }
41
26
 
42
- .header,
43
- .header {
44
- padding-inline-start: 0;
45
- padding-inline-end: 0;
46
- }
27
+ :root {
28
+ --sl-mobile-toc-height: 4rem;
29
+ }
47
30
 
48
- mobile-starlight-toc nav {
49
- inset-inline-start: calc(var(--sl-content-inline-start, 0) + var(--sl-sidebar-pad-x));
50
- }
51
- .sidebar-content {
52
- padding-left: 0;
53
- }
31
+ @media (min-width: 50rem) {
32
+ .page .sidebar-pane {
33
+ left: unset;
34
+ }
35
+ /* on desktop, adjust sidebar so that its _text content_ aligns with the page left edge.
36
+ * padding (visible on hover) bleeds out beyond the page left edge, covered by --stl-ui-page-padding-inline */
37
+ .sidebar-pane {
38
+ /* 12px comes from --stl-sidebar-item-padding-inline (which is unfortunately defined deeper than
39
+ this component). Please keep in sync. */
40
+ margin-inline-start: calc(-1 * (var(--sl-sidebar-pad-x) + 12px));
54
41
  }
55
42
 
56
- .stl-content-breadcrumbs {
57
- .stldocs-breadcrumbs {
58
- padding-left: 0;
59
- }
43
+ .header,
44
+ .header {
45
+ padding-inline-start: 0;
46
+ padding-inline-end: 0;
60
47
  }
61
48
 
62
- .stl-page-nav-container {
63
- display: flex;
64
- align-items: center;
65
- justify-content: space-between;
66
- gap: 1rem;
67
- padding: 1rem 1rem 0;
68
- flex-wrap: wrap;
49
+ mobile-starlight-toc nav {
50
+ inset-inline-start: calc(var(--sl-content-inline-start, 0) + var(--sl-sidebar-pad-x));
69
51
  }
70
52
  }
71
53
 
72
- @media (min-width: 50em) {
54
+ .stl-content-breadcrumbs {
55
+ .stldocs-breadcrumbs {
56
+ padding-left: 0;
57
+ }
58
+ }
59
+
60
+ .stl-page-nav-container {
61
+ display: flex;
62
+ align-items: center;
63
+ justify-content: space-between;
64
+ gap: 1rem;
65
+ padding: 1rem 0 0 0;
66
+ flex-wrap: wrap;
67
+ }
68
+
69
+ .stl-page-nav-container {
70
+ display: flex;
71
+ align-items: center;
72
+ justify-content: space-between;
73
+ gap: 1rem;
74
+ padding: 1rem 0 0 0;
75
+ flex-wrap: wrap;
76
+ }
77
+
78
+ .stldocs-root .stl-page-nav-container {
79
+ padding: 1rem 0 0 var(--stldocs-content-padding);
80
+ }
81
+
82
+ [data-has-sidebar]:not([data-has-toc]) .sl-container {
83
+ max-width: 1428px;
84
+ }
85
+
86
+ .stl-overview {
87
+ max-width: var(--sl-content-width);
88
+ }
89
+
90
+ @media (min-width: 50rem) {
73
91
  :root[data-has-sidebar] {
74
- --sl-content-inline-start: calc(var(--sl-sidebar-width) + 1rem);
92
+ --sl-content-inline-start: calc(var(--sl-sidebar-width) + 2rem);
93
+ }
94
+
95
+ .stldocs-root .stl-page-nav-container {
96
+ padding: 1rem 0 0 0;
97
+ }
98
+ }
99
+
100
+ @media (min-width: 72rem) {
101
+ :root {
102
+ --sl-mobile-toc-height: 0rem;
103
+ }
104
+ }
105
+
106
+ .content-panel footer {
107
+ /* Don’t render empty footer meta, which results in extra margin getting applied on behalf of the flex gap.
108
+ * Instead, move its margin to its parent. */
109
+ margin-top: 3rem;
110
+ .meta {
111
+ margin-top: 0;
112
+ &:empty,
113
+ &:not(:has(> *)) {
114
+ display: none;
115
+ }
75
116
  }
76
117
  }
@@ -1,11 +1,13 @@
1
- @layer stainless {
2
- .stl-sdk-select-dropdown-menu {
3
- min-width: 200px;
4
- }
1
+ .stl-sdk-select {
2
+ .stl-ui-dropdown {
3
+ width: 100%;
5
4
 
6
- .stl-sdk-select {
7
- .stldocs-icon.http path {
8
- fill: var(--stldocs-color-text);
5
+ .stl-ui-dropdown__button {
6
+ width: 100%;
7
+ justify-content: space-between;
9
8
  }
10
9
  }
10
+ .stldocs-icon.http path {
11
+ fill: var(--stl-color-foreground);
12
+ }
11
13
  }
package/styles/search.css CHANGED
@@ -1,84 +1,72 @@
1
- @layer stainless {
2
- /* Search input styles for Astro and Algolia */
3
- site-search {
4
- display: contents;
5
-
6
- > astro-island > div {
7
- position: absolute;
8
- }
9
-
10
- > button {
11
- padding: var(--sl-button-padding-y) var(--sl-button-padding-x);
12
- min-width: unset;
13
- display: flex;
14
- align-items: center;
15
- gap: 0.5rem;
16
- padding: 0;
17
- width: var(--sl-button-size);
18
- justify-content: center;
19
- background-color: var(--sl-color-bg-ui);
20
- border: 1px solid var(--sl-color-hairline);
21
- border-radius: var(--sl-button-border-radius);
22
- height: var(--sl-button-size);
23
-
24
- &:hover {
25
- border-color: var(--sl-color-hairline-shade);
26
- }
1
+ /* Search input styles for Astro and Algolia */
2
+ site-search {
3
+ display: contents;
27
4
 
28
- span {
29
- font-size: var(--sl-text-sm);
30
- color: var(--sl-color-text-secondary);
31
- line-height: 150%;
32
- padding-left: var(--sl-button-icon-offset);
33
- padding-right: var(--sl-button-icon-offset);
34
- }
5
+ > astro-island > div {
6
+ position: absolute;
7
+ }
35
8
 
36
- > svg {
37
- width: var(--sl-text-sm);
38
- height: var(--sl-text-sm);
39
- }
9
+ > button {
10
+ padding: var(--sl-button-padding-y) var(--sl-button-padding-x);
11
+ min-width: unset;
12
+ display: flex;
13
+ align-items: center;
14
+ gap: 0.5rem;
15
+ padding: 0;
16
+ width: var(--sl-button-size);
17
+ justify-content: center;
18
+ background-color: var(--stl-color-ui-background);
19
+ border: 1px solid var(--stl-color-border);
20
+ border-radius: var(--sl-button-border-radius);
21
+ height: var(--sl-button-size);
40
22
 
41
- &.stldocs-button {
42
- padding: 0;
43
- }
23
+ &:hover {
24
+ background: var(--stl-color-ui-background-hover);
44
25
  }
45
26
 
46
- button > kbd {
47
- border-radius: 0.25rem;
48
- font-size: var(--sl-text-2xs);
49
- gap: 0.25em;
50
- padding-inline: 0.375rem;
51
- background-color: var(--sl-color-gray-6);
52
- margin-right: -0.3rem;
27
+ span {
28
+ font-size: var(--stl-typography-scale-sm);
29
+ color: var(--stl-color-foreground-reduced);
30
+ line-height: 150%;
31
+ padding-left: var(--sl-button-icon-offset);
32
+ padding-right: var(--sl-button-icon-offset);
53
33
  }
54
34
 
55
- kbd {
56
- font-family: var(--__sl-font);
57
- color: var(--sl-color-text);
35
+ > svg {
36
+ width: var(--stl-typography-scale-sm);
37
+ height: var(--stl-typography-scale-sm);
58
38
  }
59
39
  }
60
40
 
61
- @media (min-width: 50rem) {
62
- site-search {
63
- > button {
64
- border-radius: var(--sl-button-border-radius);
65
- padding-inline-start: var(--sl-button-padding-x);
66
- padding-inline-end: var(--sl-button-padding-x);
67
- width: 100%;
68
- max-width: 30rem;
69
- justify-content: start;
41
+ button > kbd {
42
+ border-radius: 0.25rem;
43
+ font-size: var(--stl-typography-scale-xs);
44
+ gap: 0.25em;
45
+ padding-inline: 0.375rem;
46
+ background-color: var(--stl-color-muted-background);
47
+ margin-right: -0.3rem;
48
+ }
49
+
50
+ kbd {
51
+ font-family: var(--__sl-font);
52
+ color: var(--stl-color-foreground-reduced);
53
+ }
54
+ }
70
55
 
71
- &.stldocs-button {
72
- padding-inline-start: var(--sl-button-padding-x);
73
- padding-inline-end: var(--sl-button-padding-x);
74
- }
56
+ @media (min-width: 50rem) {
57
+ site-search {
58
+ > button {
59
+ border-radius: var(--sl-button-border-radius);
60
+ width: 100%;
61
+ max-width: 30rem;
62
+ justify-content: start;
63
+ padding: var(--sl-button-padding-y) var(--sl-button-padding-x);
75
64
 
76
- > :last-child {
77
- margin-inline-start: auto;
78
- }
79
- > svg {
80
- margin-left: calc(-1 * var(--sl-button-icon-offset));
81
- }
65
+ > :last-child {
66
+ margin-inline-start: auto;
67
+ }
68
+ > svg {
69
+ margin-left: calc(-1 * var(--sl-button-icon-offset));
82
70
  }
83
71
  }
84
72
  }
@@ -1,168 +1,38 @@
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;
14
- }
15
- }
16
-
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
- }
26
-
27
- summary {
28
- padding: 0.435rem var(--sl-sidebar-item-padding-inline);
29
- padding-right: 4px;
30
- }
31
-
32
- .top-level > li:first-child > a,
33
- .top-level li:first-child details > summary {
34
- padding-top: 0;
35
- }
36
-
37
- li a {
38
- position: relative;
39
- padding: 0.435rem var(--sl-sidebar-item-padding-inline);
40
- }
41
-
42
- details > summary > svg {
43
- opacity: 0.5;
44
- }
45
-
46
- details[open] > summary > svg {
47
- opacity: 1;
48
- }
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);
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;
56
9
  }
57
10
  }
58
-
59
- a.large[aria-current='page'] span {
60
- color: var(--sl-color-text-accent);
61
- }
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;
67
- }
68
- }
69
-
70
- .stl-sdk-select {
71
- .dropdown-toggle {
72
- width: 100%;
73
- }
74
- }
75
-
76
- [data-stldocs-method] {
77
- display: flex;
78
- gap: 0.6rem;
79
- }
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;
88
- }
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;
103
- }
104
-
105
- /* CSS is the only way to customize the Starlight sidebar, so the SVGs have to be here. */
106
-
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>');
111
- }
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>');
116
- }
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>');
122
- }
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>');
127
- }
128
11
  }
12
+ }
129
13
 
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
- }
14
+ .sidebar-pane {
15
+ border-inline-end: 1px solid var(--stl-color-border-faint);
16
+ }
135
17
 
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
- }
18
+ .sidebar-content .stl-mobile-only-sidebar-item-last {
19
+ margin-bottom: 2rem;
20
+ position: relative;
21
+ }
140
22
 
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
- }
23
+ .stl-sidebar-header-links {
24
+ display: flex;
25
+ gap: 1rem;
26
+ flex-direction: column-reverse;
27
+ }
146
28
 
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
- }
29
+ @media (min-width: 50rem) {
30
+ .stl-mobile-only-sidebar-item,
31
+ li:has(> .stl-mobile-only-sidebar-item) {
32
+ display: none;
151
33
  }
152
34
 
153
35
  .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
- }
36
+ display: none;
167
37
  }
168
38
  }
@@ -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,8 +1,6 @@
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
- @import './styles/fonts.css';
5
- @import './styles/variables.css';
6
4
  @import './styles/links.css';
7
5
  @import './styles/sidebar.css';
8
6
  @import './styles/search.css';
@@ -11,5 +9,17 @@
11
9
  @import './styles/overrides.css';
12
10
  @import './styles/code.css';
13
11
  @import './styles/sdk_select.css';
12
+ @import './styles/method-descriptions.css';
13
+
14
14
  @import '@stainless-api/ui-primitives/styles.css';
15
+
16
+ @import './styles/sl-variables.css';
17
+ @import '@stainless-api/ui-primitives/styles/starlight-compat.css';
15
18
  @import './styles/mintlify-compat.css';
19
+
20
+ @import './styles/stldocs-variables.css';
21
+ @import '@stainless-api/docs-ui/styles/resets.css';
22
+ @import '@stainless-api/docs-ui/styles/primitives.css';
23
+ @import '@stainless-api/docs-ui/styles/main.css';
24
+ @import '@stainless-api/docs-ui/styles/search.css';
25
+ @import '@stainless-api/docs-ui/styles/sidebar.css';