@stainless-api/docs-ui 0.1.0-beta.60 → 0.1.0-beta.62

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 (150) hide show
  1. package/dist/{breadcrumbs-seA1JsK4.d.ts → breadcrumbs-C14t6IEW.d.ts} +3 -3
  2. package/dist/{breadcrumbs-BagP1oN2.d.ts → breadcrumbs-IxKxOsE0.d.ts} +1 -1
  3. package/dist/{breadcrumbs-85Y-pybq.js → breadcrumbs-Q76uwfdC.js} +3 -3
  4. package/dist/{cli-CoLvH9jq.js → cli-lM9nDBQl.js} +5 -5
  5. package/dist/{component-CF9lLzZX.js → component-D93BctHn.js} +3 -3
  6. package/dist/{component-generics-DS5pysMb.d.ts → component-generics-Bd4PJtTE.d.ts} +2 -2
  7. package/dist/{component-generics-BblkOh-y.d.ts → component-generics-BmJeLTNJ.d.ts} +2 -2
  8. package/dist/components/MaskedInput.d.ts +3 -3
  9. package/dist/components/MaskedInput.js +1 -1
  10. package/dist/components/breadcrumbs.d.ts +1 -1
  11. package/dist/components/breadcrumbs.js +7 -7
  12. package/dist/components/icons.d.ts +12 -12
  13. package/dist/components/icons.js +1 -1
  14. package/dist/components/index.d.ts +11 -10
  15. package/dist/components/index.js +18 -17
  16. package/dist/components/method.d.ts +1 -1
  17. package/dist/components/method.js +8 -8
  18. package/dist/components/overview.d.ts +1 -1
  19. package/dist/components/overview.js +9 -9
  20. package/dist/components/primitives.d.ts +1 -1
  21. package/dist/components/primitives.js +6 -6
  22. package/dist/components/properties.d.ts +1 -1
  23. package/dist/components/properties.js +7 -7
  24. package/dist/components/sdk-sidebar.d.ts +2 -0
  25. package/dist/components/sdk-sidebar.js +10 -0
  26. package/dist/components/sdk.d.ts +2 -2
  27. package/dist/components/sdk.js +9 -9
  28. package/dist/components/snippets.d.ts +2 -2
  29. package/dist/components/snippets.js +7 -7
  30. package/dist/components/stl-sidebar.d.ts +2 -0
  31. package/dist/components/stl-sidebar.js +5 -0
  32. package/dist/{components-Bz5h0Y4x.js → components-DmiarGZ9.js} +15 -14
  33. package/dist/contexts/component-generics.d.ts +1 -1
  34. package/dist/contexts/component-generics.js +1 -1
  35. package/dist/contexts/component-types.d.ts +11 -10
  36. package/dist/contexts/component.d.ts +14 -13
  37. package/dist/contexts/component.js +27 -26
  38. package/dist/contexts/docs.d.ts +2 -2
  39. package/dist/contexts/docs.js +2 -2
  40. package/dist/contexts/index.d.ts +17 -16
  41. package/dist/contexts/index.js +6 -6
  42. package/dist/contexts/markdown.d.ts +1 -1
  43. package/dist/contexts/markdown.js +2 -2
  44. package/dist/contexts/navigation.d.ts +1 -1
  45. package/dist/contexts/navigation.js +1 -1
  46. package/dist/contexts/use-components.d.ts +10 -9
  47. package/dist/contexts/use-components.js +2 -2
  48. package/dist/{contexts-DZfPd182.js → contexts-DMjqoc7S.js} +6 -5
  49. package/dist/{csharp-BbNnLZWW.js → csharp-BD37FKH6.js} +4 -4
  50. package/dist/{docs-Bw-eLYjA.js → docs-6PYi1eEV.js} +5 -1
  51. package/dist/{docs-DdWB4Wsv.d.ts → docs-Dzjz2m8E.d.ts} +6 -5
  52. package/dist/{docs-DFS6wkGm.d.ts → docs-cYeV7nR2.d.ts} +5 -4
  53. package/dist/{go-OFa_5xje.js → go-v-i4WDzK.js} +4 -4
  54. package/dist/{http-olFAYLFq.js → http-CXjSoAxs.js} +14 -10
  55. package/dist/{index-BdrPd64A.d.ts → index-6vTGbgXx.d.ts} +35 -35
  56. package/dist/index-C619u0I1.d.ts +16 -0
  57. package/dist/index-CiZUWHkc.d.ts +16 -0
  58. package/dist/{index-Ct7H30x1.d.ts → index-DuHyTVVD.d.ts} +1 -1
  59. package/dist/{index-CLMudlDX.d.ts → index-wOU588Um.d.ts} +35 -35
  60. package/dist/index.d.ts +16 -15
  61. package/dist/index.js +29 -28
  62. package/dist/{java-Bw0o13Wk.js → java-A6j1NMJ7.js} +5 -5
  63. package/dist/languages/cli.d.ts +11 -10
  64. package/dist/languages/cli.js +19 -18
  65. package/dist/languages/csharp.d.ts +11 -10
  66. package/dist/languages/csharp.js +7 -7
  67. package/dist/languages/go.d.ts +11 -10
  68. package/dist/languages/go.js +7 -7
  69. package/dist/languages/http.d.ts +11 -10
  70. package/dist/languages/http.js +18 -17
  71. package/dist/languages/index.d.ts +11 -10
  72. package/dist/languages/index.js +26 -25
  73. package/dist/languages/java.d.ts +11 -10
  74. package/dist/languages/java.js +7 -7
  75. package/dist/languages/python.d.ts +11 -10
  76. package/dist/languages/python.js +7 -7
  77. package/dist/languages/ruby.d.ts +11 -10
  78. package/dist/languages/ruby.js +7 -7
  79. package/dist/languages/typescript.d.ts +11 -10
  80. package/dist/languages/typescript.js +7 -7
  81. package/dist/languages-C6gLi0rP.js +28 -0
  82. package/dist/markdown/index.d.ts +2 -2
  83. package/dist/markdown/index.js +28 -27
  84. package/dist/markdown/printer.d.ts +2 -2
  85. package/dist/markdown/printer.js +29 -28
  86. package/dist/markdown/utils.d.ts +3 -3
  87. package/dist/markdown/utils.js +2 -2
  88. package/dist/{markdown-ZzVcn4kq.js → markdown-DHjcD13O.js} +1 -1
  89. package/dist/{markdown-Dyn0NA2f.d.ts → markdown-DkGIT8Kx.d.ts} +2 -2
  90. package/dist/{markdown-DtbgEdDt.d.ts → markdown-DmrCjnT8.d.ts} +2 -2
  91. package/dist/{method-CxjUvijp.d.ts → method-BlxcOrX4.d.ts} +6 -6
  92. package/dist/{method-Dktsfckf.js → method-mosT_h9v.js} +3 -3
  93. package/dist/{navigation-Dk55c7au.d.ts → navigation-865UcdP7.d.ts} +1 -1
  94. package/dist/{navigation-DLQvobDt.d.ts → navigation-CRKiHkwL.d.ts} +3 -3
  95. package/dist/{overview-rRsC-Yi_.d.ts → overview-CAxvIfWH.d.ts} +7 -7
  96. package/dist/{overview-EkRigi6e.js → overview-CDIg0UWY.js} +8 -8
  97. package/dist/{overview-DVu-9kpm.d.ts → overview-J95gyke9.d.ts} +7 -7
  98. package/dist/{primitives-DR4XbZ2t.d.ts → primitives-8XXs7qDy.d.ts} +12 -12
  99. package/dist/{primitives-BVaiiY63.js → primitives-CRiUE1em.js} +6 -6
  100. package/dist/{primitives-DP-cTr1W.d.ts → primitives-KIlfflF9.d.ts} +12 -12
  101. package/dist/{properties-Ll927UYJ.d.ts → properties-0U_JmHNb.d.ts} +5 -5
  102. package/dist/{properties-BHvUHbcf.js → properties-4w8hy0hf.js} +3 -3
  103. package/dist/{properties-lx53LZPl.d.ts → properties-hAqMR9G-.d.ts} +5 -5
  104. package/dist/{python-D8NWX7Cb.js → python-CtQJaLw5.js} +4 -4
  105. package/dist/{routing-Fzn1XfX_.js → routing-D6595ovf.js} +10 -2
  106. package/dist/{routing-sjrF8U7O.d.ts → routing-DmNHIb6b.d.ts} +13 -3
  107. package/dist/routing-Wb-T6WOm.d.ts +64 -0
  108. package/dist/routing.d.ts +2 -2
  109. package/dist/routing.js +2 -2
  110. package/dist/{ruby-DOUaLhKJ.js → ruby-DJqEHgOw.js} +5 -5
  111. package/dist/{sdk-Dhu_gfzq.d.ts → sdk-CoiDgyHc.d.ts} +20 -16
  112. package/dist/{sdk-DrK2bq-v.js → sdk-DXS8pW0X.js} +48 -18
  113. package/dist/sdk-sidebar-BoRTRjDJ.d.ts +15 -0
  114. package/dist/sdk-sidebar-CF3tb0Yl.js +36 -0
  115. package/dist/sdk-sidebar-CYjEwB-m.d.ts +15 -0
  116. package/dist/{sdk-DdW_-RBy.d.ts → sdk-swLaCpqB.d.ts} +20 -16
  117. package/dist/{snippets-Bi0ZADmt.d.ts → snippets-BPK_oVIf.d.ts} +9 -9
  118. package/dist/{snippets-CocIZMn0.d.ts → snippets-CaCkByky.d.ts} +9 -9
  119. package/dist/{snippets-D4VhtZIC.js → snippets-bh8lfniq.js} +4 -4
  120. package/dist/spec.d.ts +2 -2
  121. package/dist/spec.js +5 -5
  122. package/dist/stl-sidebar-BQvhLYPO.d.ts +45 -0
  123. package/dist/stl-sidebar-BSx0HI2z.d.ts +45 -0
  124. package/dist/stl-sidebar-DdxZx2KK.js +82 -0
  125. package/dist/{style-TeAZuiHh.js → style-Bxr5gqcM.js} +4 -4
  126. package/dist/style.d.ts +4 -4
  127. package/dist/style.js +1 -1
  128. package/dist/styles/primitives.css +6 -0
  129. package/dist/styles/resets.css +1 -1
  130. package/dist/styles/sidebar.css +219 -49
  131. package/dist/styles.css +231 -50
  132. package/dist/{typescript-DDa446mB.js → typescript-DA7mcN1t.js} +5 -5
  133. package/dist/{use-components-Dbin0y07.js → use-components-BUz3GbO4.js} +1 -1
  134. package/dist/{utils-BoRmEFRn.js → utils-BpKHeVMe.js} +2 -2
  135. package/dist/utils.d.ts +1 -1
  136. package/dist/utils.js +1 -1
  137. package/package.json +3 -3
  138. package/dist/components/sidebar.d.ts +0 -2
  139. package/dist/components/sidebar.js +0 -9
  140. package/dist/index-DTl8aUkb.d.ts +0 -15
  141. package/dist/index-Dp5biTf5.d.ts +0 -15
  142. package/dist/languages-DW_T-Th6.js +0 -28
  143. package/dist/sidebar-BLGIKgRI.js +0 -85
  144. package/dist/sidebar-CUaX1IBW.d.ts +0 -36
  145. package/dist/sidebar-DukWbBrE.d.ts +0 -36
  146. /package/dist/{chunk-Du3t87LU.js → chunk-BN_g-Awi.js} +0 -0
  147. /package/dist/{component-generics-CmIGbBLq.js → component-generics-POFirVVb.js} +0 -0
  148. /package/dist/{icons-DMkAA03z.js → icons-BYKn5X8E.js} +0 -0
  149. /package/dist/{method-C850sHPB.d.ts → method-DzUn_qWF.d.ts} +0 -0
  150. /package/dist/{navigation-By1sQl6M.js → navigation-aoYZ_tl4.js} +0 -0
@@ -1,7 +1,7 @@
1
- import { l as Method } from "./index-Ct7H30x1.js";
2
- import { C as TransformRequestSnippetFn } from "./sdk-DdW_-RBy.js";
1
+ import { u as Method } from "./index-DuHyTVVD.js";
2
+ import { w as TransformRequestSnippetFn } from "./sdk-CoiDgyHc.js";
3
3
  import * as React$1 from "react";
4
- import * as react_jsx_runtime75 from "react/jsx-runtime";
4
+ import * as react_jsx_runtime56 from "react/jsx-runtime";
5
5
 
6
6
  //#region src/components/snippets.d.ts
7
7
  type SnippetCodeProps = {
@@ -12,7 +12,7 @@ type SnippetCodeProps = {
12
12
  declare function SnippetCode({
13
13
  content,
14
14
  language
15
- }: SnippetCodeProps): react_jsx_runtime75.JSX.Element;
15
+ }: SnippetCodeProps): react_jsx_runtime56.JSX.Element;
16
16
  type SnippetProps = {
17
17
  method: Method;
18
18
  requestTitle?: React$1.ReactNode;
@@ -25,29 +25,29 @@ type SnippetContainerProps = {
25
25
  };
26
26
  declare function SnippetContainer({
27
27
  children
28
- }: SnippetContainerProps): react_jsx_runtime75.JSX.Element;
28
+ }: SnippetContainerProps): react_jsx_runtime56.JSX.Element;
29
29
  type SnippetRequestContainerProps = {
30
30
  children?: React$1.ReactNode;
31
31
  signature?: string;
32
32
  };
33
33
  declare function SnippetRequestContainer({
34
34
  children
35
- }: SnippetRequestContainerProps): react_jsx_runtime75.JSX.Element;
35
+ }: SnippetRequestContainerProps): react_jsx_runtime56.JSX.Element;
36
36
  declare function Snippet({
37
37
  requestTitle,
38
38
  method,
39
39
  transformRequestSnippet
40
- }: SnippetProps): react_jsx_runtime75.JSX.Element | null;
40
+ }: SnippetProps): react_jsx_runtime56.JSX.Element | null;
41
41
  declare function SnippetButtons({
42
42
  content
43
43
  }: {
44
44
  content: string;
45
- }): react_jsx_runtime75.JSX.Element;
45
+ }): react_jsx_runtime56.JSX.Element;
46
46
  declare function SnippetFooter(): React$1.ReactNode;
47
47
  declare function SnippetResponse({
48
48
  responses
49
49
  }: {
50
50
  responses: Method['exampleResponses'];
51
- }): react_jsx_runtime75.JSX.Element | null;
51
+ }): react_jsx_runtime56.JSX.Element | null;
52
52
  //#endregion
53
53
  export { SnippetContainer as a, SnippetProps as c, SnippetResponse as d, SnippetCodeProps as i, SnippetRequestContainer as l, SnippetButtons as n, SnippetContainerProps as o, SnippetCode as r, SnippetFooter as s, Snippet as t, SnippetRequestContainerProps as u };
@@ -1,7 +1,7 @@
1
- import { a as useLanguage, c as useSnippet, r as useDeclaration } from "./docs-Bw-eLYjA.js";
2
- import { r as useHighlight } from "./markdown-ZzVcn4kq.js";
3
- import { t as useComponents } from "./use-components-Dbin0y07.js";
4
- import { t as style_default } from "./style-TeAZuiHh.js";
1
+ import { i as useDeclaration, l as useSnippet, o as useLanguage } from "./docs-6PYi1eEV.js";
2
+ import { r as useHighlight } from "./markdown-DHjcD13O.js";
3
+ import { t as useComponents } from "./use-components-BUz3GbO4.js";
4
+ import { t as style_default } from "./style-Bxr5gqcM.js";
5
5
  import * as React$1 from "react";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
  import clsx from "clsx";
package/dist/spec.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { f as Resource, g as SpecLanguage, h as Spec, l as Method, r as DeclarationNode, u as Model } from "./index-Ct7H30x1.js";
2
- import { t as DocsLanguage } from "./routing-sjrF8U7O.js";
1
+ import { _ as SpecLanguage, d as Model, g as Spec, i as DeclarationNode, p as Resource, u as Method } from "./index-DuHyTVVD.js";
2
+ import { t as DocsLanguage } from "./routing-Wb-T6WOm.js";
3
3
 
4
4
  //#region src/spec.d.ts
5
5
  type SecurityScheme = Spec['security_schemes'][number];
package/dist/spec.js CHANGED
@@ -1,5 +1,5 @@
1
- import { n as Languages } from "./routing-Fzn1XfX_.js";
2
- import { r as isResourceEmpty } from "./utils-BoRmEFRn.js";
1
+ import { n as Languages } from "./routing-D6595ovf.js";
2
+ import { r as isResourceEmpty } from "./utils-BpKHeVMe.js";
3
3
 
4
4
  //#region src/spec.ts
5
5
  const defaultTransforms = {
@@ -90,15 +90,15 @@ function generateSpecForResource(spec, name, lang, transforms) {
90
90
  security_schemes: spec.security_schemes?.map((scheme) => transforms.securityScheme(scheme)),
91
91
  decls: { [lang]: mapEntries({
92
92
  input: spec.decls[lang] ?? {},
93
- filter: (name$1) => name$1.startsWith(resource.stainlessPath) || name$1.startsWith("(resource) $shared"),
93
+ filter: (name) => name.startsWith(resource.stainlessPath) || name.startsWith("(resource) $shared"),
94
94
  fn: (decl) => transforms.declaration(decl, lang)
95
95
  }) },
96
96
  snippets: mapEntries({
97
97
  input: spec.snippets,
98
- filter: (name$1) => name$1.startsWith(lang),
98
+ filter: (name) => name.startsWith(lang),
99
99
  fn: (snippets) => mapEntries({
100
100
  input: snippets,
101
- filter: (name$1) => name$1.startsWith(resource.stainlessPath),
101
+ filter: (name) => name.startsWith(resource.stainlessPath),
102
102
  fn: (snippet) => transforms.snippet(snippet, lang)
103
103
  }) ?? {}
104
104
  })
@@ -0,0 +1,45 @@
1
+ import * as react_jsx_runtime27 from "react/jsx-runtime";
2
+
3
+ //#region src/components/stl-sidebar.d.ts
4
+ declare module 'react' {
5
+ namespace JSX {
6
+ interface IntrinsicElements {
7
+ /**
8
+ * Custom element defined by Starlight's <SidebarPersister>.
9
+ */
10
+ 'sl-sidebar-restore': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
11
+ }
12
+ }
13
+ }
14
+ interface StlSidebarLink {
15
+ type: 'link';
16
+ label: string;
17
+ isCurrent?: boolean;
18
+ attrs: Record<string, unknown>;
19
+ href?: string;
20
+ stainlessPath?: string;
21
+ }
22
+ interface StlSidebarGroup {
23
+ type: 'group';
24
+ label: string;
25
+ entries: Array<StlSidebarLink | StlSidebarGroup>;
26
+ collapsed: boolean;
27
+ isCurrent?: boolean;
28
+ href?: string;
29
+ stainlessPath?: string;
30
+ }
31
+ type StlSidebarEntry = StlSidebarLink | StlSidebarGroup;
32
+ type StlSidebarProps = {
33
+ entries: StlSidebarEntry[];
34
+ /**
35
+ * If set, add <sl-sidebar-restore> custom elements (as defined by Starlight's SidebarPersister)
36
+ * which are used to save/restore sidebar state.
37
+ */
38
+ withStarlightRestoration?: boolean;
39
+ };
40
+ declare function StlSidebar({
41
+ entries,
42
+ withStarlightRestoration
43
+ }: StlSidebarProps): react_jsx_runtime27.JSX.Element;
44
+ //#endregion
45
+ export { StlSidebarProps as a, StlSidebarLink as i, StlSidebarEntry as n, StlSidebarGroup as r, StlSidebar as t };
@@ -0,0 +1,45 @@
1
+ import * as react_jsx_runtime62 from "react/jsx-runtime";
2
+
3
+ //#region src/components/stl-sidebar.d.ts
4
+ declare module 'react' {
5
+ namespace JSX {
6
+ interface IntrinsicElements {
7
+ /**
8
+ * Custom element defined by Starlight's <SidebarPersister>.
9
+ */
10
+ 'sl-sidebar-restore': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
11
+ }
12
+ }
13
+ }
14
+ interface StlSidebarLink {
15
+ type: 'link';
16
+ label: string;
17
+ isCurrent?: boolean;
18
+ attrs: Record<string, unknown>;
19
+ href?: string;
20
+ stainlessPath?: string;
21
+ }
22
+ interface StlSidebarGroup {
23
+ type: 'group';
24
+ label: string;
25
+ entries: Array<StlSidebarLink | StlSidebarGroup>;
26
+ collapsed: boolean;
27
+ isCurrent?: boolean;
28
+ href?: string;
29
+ stainlessPath?: string;
30
+ }
31
+ type StlSidebarEntry = StlSidebarLink | StlSidebarGroup;
32
+ type StlSidebarProps = {
33
+ entries: StlSidebarEntry[];
34
+ /**
35
+ * If set, add <sl-sidebar-restore> custom elements (as defined by Starlight's SidebarPersister)
36
+ * which are used to save/restore sidebar state.
37
+ */
38
+ withStarlightRestoration?: boolean;
39
+ };
40
+ declare function StlSidebar({
41
+ entries,
42
+ withStarlightRestoration
43
+ }: StlSidebarProps): react_jsx_runtime62.JSX.Element;
44
+ //#endregion
45
+ export { StlSidebarProps as a, StlSidebarLink as i, StlSidebarEntry as n, StlSidebarGroup as r, StlSidebar as t };
@@ -0,0 +1,82 @@
1
+ import { t as useComponents } from "./use-components-BUz3GbO4.js";
2
+ import { t as style_default } from "./style-Bxr5gqcM.js";
3
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
+ import clsx from "clsx";
5
+ import { ChevronRight } from "lucide-react";
6
+
7
+ //#region src/components/stl-sidebar.tsx
8
+ function StlSidebarSublist({ entries, entryToIndex }) {
9
+ const Docs = useComponents();
10
+ return /* @__PURE__ */ jsx("ul", {
11
+ className: style_default.SidebarList,
12
+ children: entries.map((entry, index) => {
13
+ const restorePointIndex = entryToIndex?.get(entry);
14
+ const hasLink = !!(entry.href || entry.stainlessPath);
15
+ return /* @__PURE__ */ jsx("li", {
16
+ className: clsx(style_default.SidebarEntry, entry.type === "link" ? style_default.SidebarEntryLink : style_default.SidebarEntryGroup),
17
+ children: entry.type === "link" ? /* @__PURE__ */ jsx(Docs.Link, {
18
+ href: entry.href,
19
+ stainlessPath: entry.stainlessPath,
20
+ "aria-current": entry.isCurrent ? "page" : void 0,
21
+ ...entry.attrs,
22
+ children: entry.label
23
+ }) : /* @__PURE__ */ jsxs(Fragment, { children: [hasLink && /* @__PURE__ */ jsx(Docs.Link, {
24
+ href: entry.href,
25
+ stainlessPath: entry.stainlessPath,
26
+ "aria-current": entry.isCurrent ? "page" : void 0,
27
+ children: entry.label
28
+ }), /* @__PURE__ */ jsxs("details", {
29
+ className: style_default.SidebarExpander,
30
+ open: flattenStlSidebar(entry.entries).some((i) => i.isCurrent) || !entry.collapsed,
31
+ children: [
32
+ /* @__PURE__ */ jsxs("summary", {
33
+ className: style_default.ExpanderSummary,
34
+ children: [/* @__PURE__ */ jsx("span", {
35
+ "aria-hidden": hasLink ? "true" : void 0,
36
+ children: entry.label
37
+ }), entry.entries.length > 0 && /* @__PURE__ */ jsx(ChevronRight, {
38
+ size: 16,
39
+ strokeWidth: 1,
40
+ className: `${style_default.Icon} ${style_default.ExpanderSummaryIcon}`
41
+ })]
42
+ }),
43
+ restorePointIndex !== void 0 && /* @__PURE__ */ jsx("sl-sidebar-restore", { "data-index": restorePointIndex }),
44
+ entry.entries.length > 0 && /* @__PURE__ */ jsx(StlSidebarSublist, {
45
+ entries: entry.entries,
46
+ entryToIndex
47
+ })
48
+ ]
49
+ })] })
50
+ }, index);
51
+ })
52
+ });
53
+ }
54
+ function StlSidebar({ entries, withStarlightRestoration }) {
55
+ const entryToIndex = withStarlightRestoration ? computeEntryToIndex(entries) : void 0;
56
+ return /* @__PURE__ */ jsx("div", {
57
+ className: `${style_default.Root} ${style_default.Sidebar}`,
58
+ children: /* @__PURE__ */ jsx(StlSidebarSublist, {
59
+ entries,
60
+ entryToIndex
61
+ })
62
+ });
63
+ }
64
+ function computeEntryToIndex(allEntries) {
65
+ const entryToIndex = /* @__PURE__ */ new Map();
66
+ let currentIndex = 0;
67
+ function addEntries(entries) {
68
+ for (const entry of entries) if (entry.type === "group") {
69
+ entryToIndex.set(entry, currentIndex);
70
+ currentIndex++;
71
+ addEntries(entry.entries);
72
+ }
73
+ }
74
+ addEntries(allEntries);
75
+ return entryToIndex;
76
+ }
77
+ function flattenStlSidebar(sidebar) {
78
+ return sidebar.flatMap((entry) => entry.type === "group" ? flattenStlSidebar(entry.entries) : entry);
79
+ }
80
+
81
+ //#endregion
82
+ export { StlSidebar as t };
@@ -129,13 +129,13 @@ var style_default = {
129
129
  Model: "stldocs-model",
130
130
  Root: "stldocs-root",
131
131
  Sidebar: "stldocs-sidebar",
132
- SidebarResource: "stldocs-sidebar-resource",
133
- SidebarResourceTitle: "stldocs-sidebar-resource-title",
134
- SidebarMethod: "stldocs-sidebar-method",
135
- SidebarItemTitle: "stldocs-sidebar-resource-title",
132
+ SidebarList: "stldocs-sidebar-list",
136
133
  SidebarExpander: "stldocs-sidebar-expander",
137
134
  SidebarExpanderSummary: "stldocs-sidebar-expander-summary",
138
135
  SidebarExpanderContent: "stldocs-sidebar-expander-content",
136
+ SidebarEntry: "stldocs-sidebar-entry",
137
+ SidebarEntryLink: "stldocs-sidebar-entry-link",
138
+ SidebarEntryGroup: "stldocs-sidebar-entry-group",
139
139
  SearchForm: "stldocs-search-form",
140
140
  SearchModal: "stldocs-search-modal",
141
141
  SearchFilter: "stldocs-search-filter",
package/dist/style.d.ts CHANGED
@@ -129,13 +129,13 @@ declare const _default: {
129
129
  readonly Model: "stldocs-model";
130
130
  readonly Root: "stldocs-root";
131
131
  readonly Sidebar: "stldocs-sidebar";
132
- readonly SidebarResource: "stldocs-sidebar-resource";
133
- readonly SidebarResourceTitle: "stldocs-sidebar-resource-title";
134
- readonly SidebarMethod: "stldocs-sidebar-method";
135
- readonly SidebarItemTitle: "stldocs-sidebar-resource-title";
132
+ readonly SidebarList: "stldocs-sidebar-list";
136
133
  readonly SidebarExpander: "stldocs-sidebar-expander";
137
134
  readonly SidebarExpanderSummary: "stldocs-sidebar-expander-summary";
138
135
  readonly SidebarExpanderContent: "stldocs-sidebar-expander-content";
136
+ readonly SidebarEntry: "stldocs-sidebar-entry";
137
+ readonly SidebarEntryLink: "stldocs-sidebar-entry-link";
138
+ readonly SidebarEntryGroup: "stldocs-sidebar-entry-group";
139
139
  readonly SearchForm: "stldocs-search-form";
140
140
  readonly SearchModal: "stldocs-search-modal";
141
141
  readonly SearchFilter: "stldocs-search-filter";
package/dist/style.js CHANGED
@@ -1,3 +1,3 @@
1
- import { t as style_default } from "./style-TeAZuiHh.js";
1
+ import { t as style_default } from "./style-Bxr5gqcM.js";
2
2
 
3
3
  export { style_default as default };
@@ -251,6 +251,12 @@
251
251
  ol {
252
252
  list-style-type: decimal;
253
253
  }
254
+
255
+ hr {
256
+ margin-bottom: 16px;
257
+ border: none;
258
+ border-bottom: 1px solid var(--stl-color-border);
259
+ }
254
260
  }
255
261
 
256
262
  .stldocs-root .stldocs-input {
@@ -3,7 +3,7 @@
3
3
  line-height: 1.5;
4
4
  letter-spacing: -0.01em;
5
5
 
6
- a {
6
+ a:not(.stl-ui-callout a) {
7
7
  color: inherit;
8
8
  cursor: pointer;
9
9
  text-decoration: none;
@@ -1,80 +1,250 @@
1
1
  .stldocs-sidebar {
2
2
  font-family: var(--stl-typography-font);
3
3
  font-size: var(--stl-typography-scale-sm);
4
+ /* Remove background color from stldocs-root reset. */
5
+ background-color: transparent;
6
+ --stldocs-sidebar-item-padding-inline: 12px;
7
+ --stldocs-sidebar-item-padding-block: 6px;
8
+ --stldocs-sidebar-indent: 12px;
4
9
 
5
- a {
6
- text-decoration: none;
7
- color: var(--stl-color-foreground-reduced);
10
+ ul,
11
+ summary {
12
+ list-style-type: none;
8
13
  }
9
14
 
10
- .stldocs-sidebar-resource-title {
11
- padding-bottom: 6px;
15
+ .stldocs-expander-summary,
16
+ .stldocs-sidebar-entry-group > a {
17
+ font-weight: 500;
12
18
  }
13
19
 
14
- .stldocs-sidebar-resource,
15
- .stldocs-sidebar-method {
16
- padding: 6px;
20
+ .stldocs-expander-summary {
17
21
  display: flex;
18
- gap: 0.5rem;
22
+ align-items: center;
23
+ user-select: none;
19
24
 
20
- &[data-selected='true'] {
21
- & > a,
22
- & > details > summary > a {
23
- color: var(--stl-color-foreground);
25
+ .stldocs-expander-summary-icon {
26
+ margin-left: 4px;
27
+ opacity: 0.65;
28
+ transition:
29
+ opacity 0.1s ease-out,
30
+ transform 0.1s ease-out;
31
+ border-radius: 4px;
32
+
33
+ &:hover {
34
+ background-color: var(--stl-color-background-hover);
24
35
  }
25
36
  }
37
+
38
+ span[aria-hidden='true'] {
39
+ opacity: 0;
40
+ }
26
41
  }
27
42
 
28
- .stldocs-sidebar-resource-title {
29
- display: block;
43
+ .stldocs-sidebar-entry-group {
44
+ position: relative;
30
45
 
31
- a {
32
- color: var(--stl-color-foreground);
46
+ /* Anchor is positioned over the <details>. */
47
+ > a {
48
+ position: absolute;
49
+ top: 0;
50
+ left: 0;
51
+ right: 0;
52
+ padding-block: var(--stldocs-sidebar-item-padding-block);
53
+ padding-inline: var(--stldocs-sidebar-item-padding-inline);
54
+ }
55
+ }
56
+
57
+ .stldocs-sidebar-expander[open] > .stldocs-expander-summary .stldocs-expander-summary-icon {
58
+ opacity: 1;
59
+ transform: rotate(90deg);
60
+ }
61
+
62
+ /* List items. */
63
+ .stldocs-sidebar-entry,
64
+ .stldocs-expander-summary {
65
+ margin: 0;
66
+ border-radius: 8px;
67
+ }
68
+
69
+ .stldocs-expander-summary,
70
+ .stldocs-sidebar-entry-link a {
71
+ cursor: pointer;
72
+ padding: var(--stldocs-sidebar-item-padding-block) var(--stldocs-sidebar-item-padding-inline);
73
+ }
74
+
75
+ .stldocs-sidebar-entry-link a:hover {
76
+ color: var(--stl-color-foreground);
77
+ }
78
+
79
+ .stldocs-sidebar-entry-link a {
80
+ color: var(--stl-color-foreground-reduced);
81
+ font-weight: 400;
82
+ display: flex;
83
+ text-decoration: none;
84
+ span {
85
+ font-weight: inherit;
86
+ }
87
+
88
+ &:hover {
89
+ text-decoration: underline;
90
+ text-decoration-color: var(--stl-color-foreground-reduced);
91
+ }
92
+ &[aria-current='page'] {
33
93
  font-weight: 500;
94
+ color: var(--stl-color-foreground);
34
95
  }
35
96
  }
36
97
 
37
- .stldocs-sidebar-expander {
38
- .stldocs-expander-summary {
39
- cursor: pointer;
40
- display: flex;
98
+ /* When the sidebar entry has a link, disable pointer events on the <details> text
99
+ so that they pass through to the <a>. */
100
+ .stldocs-sidebar-entry-group:has(> a) .stldocs-expander-summary > span {
101
+ pointer-events: none;
102
+ }
41
103
 
42
- & > .stldocs-expander-summary-icon {
43
- transform: translateX(-0.5px) translateY(-0.5px);
44
- margin-left: 8px;
104
+ .stldocs-sidebar-entry-link:has(> a:is(:hover, [aria-current='page'])),
105
+ .stldocs-sidebar-entry-group:has(> a:is(:hover, [aria-current='page']))
106
+ > .stldocs-sidebar-expander
107
+ > .stldocs-expander-summary,
108
+ .stldocs-expander-summary:hover {
109
+ background-color: var(--stl-color-background-hover);
110
+ }
45
111
 
46
- & > .stldocs-icon {
47
- vertical-align: middle;
48
- color: var(--stl-color-foreground-muted);
49
- }
112
+ /* Nested list items have flat left edge. */
113
+ .stldocs-sidebar-list .stldocs-sidebar-list :is(.stldocs-expander-summary, .stldocs-sidebar-entry) {
114
+ border-start-start-radius: 0;
115
+ border-end-start-radius: 0;
116
+ }
50
117
 
51
- & > :last-child {
52
- display: none;
53
- }
118
+ .stldocs-sidebar-list {
119
+ padding: 0;
120
+ }
121
+
122
+ .stldocs-sidebar-list .stldocs-sidebar-list .stldocs-sidebar-entry {
123
+ border-inline-start: 1px solid var(--stl-color-border-faint);
124
+ margin-inline-start: var(--stldocs-sidebar-indent);
125
+ &:has(> a[aria-current='page']) {
126
+ border-inline-start: 2px solid var(--stl-color-accent-border-strong);
127
+ & > a {
128
+ margin-left: -1px;
54
129
  }
55
130
  }
131
+ }
56
132
 
57
- &[open],
58
- &[data-open='true'] {
59
- & > .stldocs-expander-summary {
60
- .stldocs-type-preview-content {
61
- display: none;
62
- }
133
+ /* Method & resource icons. */
63
134
 
64
- & > .stldocs-expander-summary-icon {
65
- & > :first-child {
66
- display: none;
67
- }
135
+ a[data-stldocs-method],
136
+ a[data-stldocs-resource] {
137
+ --stldocs-sidebar-icon-size-outer: 18px;
138
+ --stldocs-sidebar-icon-margin: 8px;
139
+ }
140
+ a[data-stldocs-method] {
141
+ --stldocs-sidebar-icon-size-inner: 16px;
142
+ --stldocs-sidebar-icon-color-inverse-background: var(--stldocs-sidebar-icon-color);
68
143
 
69
- & > :last-child {
70
- display: inline;
71
- }
72
- }
73
- }
144
+ &[data-stldocs-method='get'] {
145
+ --stldocs-sidebar-icon-color: var(--stl-color-green-foreground);
146
+ --stldocs-sidebar-icon-color-border: var(--stl-color-green-border);
147
+ --stldocs-sidebar-icon-color-background: var(--stl-color-green-muted-background);
148
+ --stldocs-sidebar-icon-color-background-hover: var(--stl-color-green-muted-background-hover);
149
+ --stldocs-sidebar-icon-color-inverse-background: var(--stl-color-green-inverse-background);
150
+ --stldocs-sidebar-icon-color-inverse-foreground: var(--stl-color-green-inverse-foreground);
151
+ }
152
+ &[data-stldocs-method='post'] {
153
+ --stldocs-sidebar-icon-color: var(--stl-color-blue-foreground);
154
+ --stldocs-sidebar-icon-color-border: var(--stl-color-blue-border);
155
+ --stldocs-sidebar-icon-color-background: var(--stl-color-blue-muted-background);
156
+ --stldocs-sidebar-icon-color-background-hover: var(--stl-color-blue-muted-background-hover);
157
+ --stldocs-sidebar-icon-color-inverse-background: var(--stl-color-blue-inverse-background);
158
+ --stldocs-sidebar-icon-color-inverse-foreground: var(--stl-color-blue-inverse-foreground);
159
+ }
160
+ &[data-stldocs-method='patch'],
161
+ &[data-stldocs-method='put'] {
162
+ --stldocs-sidebar-icon-color: var(--stl-color-orange-foreground);
163
+ --stldocs-sidebar-icon-color-border: var(--stl-color-orange-border);
164
+ --stldocs-sidebar-icon-color-background: var(--stl-color-orange-muted-background);
165
+ --stldocs-sidebar-icon-color-background-hover: var(--stl-color-orange-muted-background-hover);
166
+ --stldocs-sidebar-icon-color-inverse-background: var(--stl-color-orange-inverse-background);
167
+ --stldocs-sidebar-icon-color-inverse-foreground: var(--stl-color-orange-inverse-foreground);
168
+ }
169
+ &[data-stldocs-method='delete'] {
170
+ --stldocs-sidebar-icon-color: var(--stl-color-red-foreground);
171
+ --stldocs-sidebar-icon-color-border: var(--stl-color-red-border);
172
+ --stldocs-sidebar-icon-color-background: var(--stl-color-red-muted-background);
173
+ --stldocs-sidebar-icon-color-background-hover: var(--stl-color-red-muted-background-hover);
174
+ --stldocs-sidebar-icon-color-inverse-background: var(--stl-color-red-inverse-background);
175
+ --stldocs-sidebar-icon-color-inverse-foreground: var(--stl-color-red-inverse-foreground);
176
+ }
177
+
178
+ &[data-stldocs-method='get'] {
179
+ --stldocs-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>');
180
+ }
181
+ &[data-stldocs-method='post'],
182
+ &[data-stldocs-method='put'],
183
+ &[data-stldocs-method='patch'] {
184
+ --stldocs-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>');
185
+ }
186
+ &[data-stldocs-method='delete'] {
187
+ --stldocs-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>');
188
+ }
189
+ }
190
+
191
+ a[data-stldocs-resource] {
192
+ /* not yet implemented in markup */
193
+ --stldocs-sidebar-icon-color: var(--stl-color-foreground-muted);
194
+ --stldocs-sidebar-icon-color-border: var(--stl-color-border);
195
+ --stldocs-sidebar-icon-color-background: var(--stl-color-faint-background);
196
+ --stldocs-sidebar-icon-color-background-hover: var(--stl-color-faint-background-hover);
197
+ --stldocs-sidebar-icon-color-inverse-background: var(--stl-color-inverse-background);
198
+ --stldocs-sidebar-icon-color-inverse-foreground: var(--stl-color-inverse-foreground);
199
+
200
+ --stldocs-sidebar-icon-size-inner: 14px;
201
+ --stldocs-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>');
202
+ }
74
203
 
75
- & > .stldocs-expander-content {
76
- margin-left: 10px;
77
- line-height: 150%;
204
+ a[data-stldocs-method],
205
+ a[data-stldocs-resource] {
206
+ display: flex;
207
+ gap: var(--stldocs-sidebar-icon-margin);
208
+ align-items: center;
209
+ position: relative;
210
+
211
+ &::before,
212
+ &::after {
213
+ content: '';
214
+ width: var(--stldocs-sidebar-icon-size-outer);
215
+ height: var(--stldocs-sidebar-icon-size-outer);
216
+ display: block;
217
+ }
218
+ &::before {
219
+ border-radius: 4px;
220
+ background-color: var(--stldocs-sidebar-icon-color-background);
221
+ flex: 0 0 auto;
222
+ border: 1px solid var(--stldocs-sidebar-icon-color-border, transparent);
223
+ }
224
+ /* yuck (we can clean this up once we are changing sidebar markup) */
225
+ &::after {
226
+ background-color: var(--stldocs-sidebar-icon-color);
227
+ mask-image: var(--stldocs-sidebar-icon-url);
228
+ mask-size: var(--stldocs-sidebar-icon-size-inner) var(--stldocs-sidebar-icon-size-inner);
229
+ mask-repeat: no-repeat;
230
+ mask-position: center;
231
+ position: absolute;
232
+ left: var(--stldocs-sidebar-item-padding-inline);
233
+ top: 50%;
234
+ transform: translateY(-50%);
235
+ }
236
+
237
+ &:hover {
238
+ &::before {
239
+ background-color: var(--stldocs-sidebar-icon-color-background-hover);
240
+ }
241
+ }
242
+ &[aria-current='page'] {
243
+ &::before {
244
+ background-color: var(--stldocs-sidebar-icon-color-inverse-background);
245
+ }
246
+ &::after {
247
+ background-color: var(--stldocs-sidebar-icon-color-inverse-foreground);
78
248
  }
79
249
  }
80
250
  }