@stainless-api/docs-ui 0.1.0-beta.72 → 0.1.0-beta.74

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 (135) hide show
  1. package/dist/{chunk-BN_g-Awi.js → chunk-BYypO7fO.js} +3 -3
  2. package/dist/components/MaskedInput.d.ts +1 -1
  3. package/dist/components/MaskedInput.js +1 -1
  4. package/dist/components/breadcrumbs.d.ts +24 -1
  5. package/dist/components/breadcrumbs.js +62 -7
  6. package/dist/components/icons.d.ts +12 -12
  7. package/dist/components/icons.js +883 -1
  8. package/dist/components/index.d.ts +16 -14
  9. package/dist/components/index.js +72 -18
  10. package/dist/components/method.d.ts +58 -1
  11. package/dist/components/method.js +95 -8
  12. package/dist/components/overview.d.ts +38 -1
  13. package/dist/components/overview.js +137 -9
  14. package/dist/components/primitives.d.ts +104 -1
  15. package/dist/components/primitives.js +250 -6
  16. package/dist/components/properties.d.ts +53 -1
  17. package/dist/components/properties.js +138 -7
  18. package/dist/components/sdk-sidebar.d.ts +14 -1
  19. package/dist/components/sdk-sidebar.js +50 -8
  20. package/dist/components/sdk.d.ts +121 -1
  21. package/dist/components/sdk.js +404 -8
  22. package/dist/components/snippets.d.ts +70 -13
  23. package/dist/components/snippets.js +182 -7
  24. package/dist/components/stl-sidebar.d.ts +57 -1
  25. package/dist/components/stl-sidebar.js +105 -3
  26. package/dist/contexts/component-generics.d.ts +29 -1
  27. package/dist/contexts/component-generics.js +31 -1
  28. package/dist/contexts/component-types.d.ts +4 -15
  29. package/dist/contexts/component.d.ts +7 -17
  30. package/dist/contexts/component.js +22 -28
  31. package/dist/contexts/docs.d.ts +61 -1
  32. package/dist/contexts/docs.js +89 -1
  33. package/dist/contexts/index.d.ts +13 -14
  34. package/dist/contexts/index.js +44 -6
  35. package/dist/contexts/markdown.d.ts +21 -1
  36. package/dist/contexts/markdown.js +47 -2
  37. package/dist/contexts/navigation.d.ts +28 -1
  38. package/dist/contexts/navigation.js +22 -1
  39. package/dist/contexts/use-components.d.ts +1 -13
  40. package/dist/contexts/use-components.js +6 -2
  41. package/dist/{index-W4Td2Hl7.d.ts → index-PdnFhQF9.d.ts} +1 -1
  42. package/dist/index.d.ts +4 -14
  43. package/dist/index.js +7 -30
  44. package/dist/languages/cli.d.ts +38 -14
  45. package/dist/languages/cli.js +166 -20
  46. package/dist/languages/csharp.d.ts +42 -14
  47. package/dist/languages/csharp.js +283 -8
  48. package/dist/languages/go.d.ts +40 -14
  49. package/dist/languages/go.js +303 -8
  50. package/dist/languages/http.d.ts +46 -14
  51. package/dist/languages/http.js +390 -19
  52. package/dist/languages/index.d.ts +50 -14
  53. package/dist/languages/index.js +30 -28
  54. package/dist/languages/java.d.ts +43 -14
  55. package/dist/languages/java.js +403 -8
  56. package/dist/languages/python.d.ts +40 -14
  57. package/dist/languages/python.js +269 -8
  58. package/dist/languages/ruby.d.ts +40 -14
  59. package/dist/languages/ruby.js +387 -8
  60. package/dist/languages/terraform.d.ts +48 -14
  61. package/dist/languages/terraform.js +243 -8
  62. package/dist/languages/typescript.d.ts +40 -14
  63. package/dist/languages/typescript.js +449 -8
  64. package/dist/markdown/index.d.ts +1 -2
  65. package/dist/markdown/index.js +1 -28
  66. package/dist/markdown/printer.d.ts +2 -2
  67. package/dist/markdown/printer.js +6 -30
  68. package/dist/markdown/utils.d.ts +3 -3
  69. package/dist/routing.d.ts +61 -2
  70. package/dist/routing.js +204 -2
  71. package/dist/spec.d.ts +4 -4
  72. package/dist/spec.js +2 -2
  73. package/dist/style.js +176 -1
  74. package/dist/use-strict-context-L0c8JKg4.js +16 -0
  75. package/dist/utils.d.ts +1 -1
  76. package/dist/utils.js +53 -2
  77. package/package.json +3 -3
  78. package/dist/breadcrumbs-46Qjx1Pd.d.ts +0 -25
  79. package/dist/breadcrumbs-BZ4wBC9-.d.ts +0 -25
  80. package/dist/breadcrumbs-BiBfNqBI.js +0 -63
  81. package/dist/cli-hduQ5XS1.js +0 -166
  82. package/dist/component-BU8BTbqz.js +0 -23
  83. package/dist/component-generics-Bw4ZOyEG.d.ts +0 -30
  84. package/dist/component-generics-D-WarFUb.d.ts +0 -30
  85. package/dist/component-generics-POFirVVb.js +0 -45
  86. package/dist/components-9NMl1791.js +0 -72
  87. package/dist/contexts-_NNW5yqC.js +0 -44
  88. package/dist/csharp-sn5CJu9t.js +0 -283
  89. package/dist/docs-Cu9Yl6-y.d.ts +0 -66
  90. package/dist/docs-YgoQ3bzY.js +0 -81
  91. package/dist/docs-xb5wYGjM.d.ts +0 -66
  92. package/dist/go-BoaAVmP0.js +0 -303
  93. package/dist/http-B3qTyMc3.js +0 -389
  94. package/dist/icons-BYKn5X8E.js +0 -885
  95. package/dist/index-BOmn7DHa.d.ts +0 -428
  96. package/dist/index-BvcPmB0r.d.ts +0 -428
  97. package/dist/java-BiLRuLuD.js +0 -403
  98. package/dist/languages-vUhD5Hu_.js +0 -30
  99. package/dist/markdown-BszOPZhh.d.ts +0 -22
  100. package/dist/markdown-Cq3XEhrR.js +0 -49
  101. package/dist/markdown-plMAoN22.d.ts +0 -22
  102. package/dist/method-C4PgTWAu.d.ts +0 -59
  103. package/dist/method-D6R_farj.d.ts +0 -59
  104. package/dist/method-DjzVBzZe.js +0 -96
  105. package/dist/navigation-HiZWRl34.d.ts +0 -29
  106. package/dist/navigation-MrP4Ubbg.d.ts +0 -29
  107. package/dist/navigation-aoYZ_tl4.js +0 -24
  108. package/dist/overview-CTeKhpQq.d.ts +0 -39
  109. package/dist/overview-Yf1PTJNi.d.ts +0 -39
  110. package/dist/overview-ocTARt-j.js +0 -138
  111. package/dist/primitives-CNG-fEhQ.js +0 -250
  112. package/dist/primitives-K7NijV36.d.ts +0 -105
  113. package/dist/primitives-WGxdBJDS.d.ts +0 -105
  114. package/dist/properties-Bu4nW9JD.d.ts +0 -54
  115. package/dist/properties-Bynmj9_H.d.ts +0 -54
  116. package/dist/properties-DQU0NBzb.js +0 -138
  117. package/dist/python-nqOBH7GS.js +0 -269
  118. package/dist/routing-C64k4fmX.js +0 -205
  119. package/dist/routing-pAL4V4hv.d.ts +0 -61
  120. package/dist/ruby-BBc8HdIt.js +0 -387
  121. package/dist/sdk-BSdgEEJw.js +0 -405
  122. package/dist/sdk-BVCk1ox2.d.ts +0 -122
  123. package/dist/sdk-Dm0S-XQE.d.ts +0 -122
  124. package/dist/sdk-sidebar-B1ehT_xI.d.ts +0 -15
  125. package/dist/sdk-sidebar-BDn8S1xS.js +0 -50
  126. package/dist/sdk-sidebar-Dqeu7C1-.d.ts +0 -15
  127. package/dist/snippets-CLpNVNlA.js +0 -181
  128. package/dist/stl-sidebar-BTTErIJs.d.ts +0 -58
  129. package/dist/stl-sidebar-C7GNALtk.d.ts +0 -58
  130. package/dist/stl-sidebar-DC5UOJiT.js +0 -106
  131. package/dist/style-DJIYkFhO.js +0 -178
  132. package/dist/terraform-DVx2ea2h.js +0 -243
  133. package/dist/typescript-Cmk-jBBw.js +0 -449
  134. package/dist/use-components-BUz3GbO4.js +0 -7
  135. package/dist/utils-DPbkW1Tz.js +0 -54
@@ -1,50 +0,0 @@
1
- import { n as useNavigation } from "./navigation-aoYZ_tl4.js";
2
- import { i as isResourceEmpty } from "./utils-DPbkW1Tz.js";
3
- import { t as StlSidebar } from "./stl-sidebar-DC5UOJiT.js";
4
- import * as React$1 from "react";
5
- import { jsx } from "react/jsx-runtime";
6
- import { Badge, getHttpMethod } from "@stainless-api/ui-primitives";
7
-
8
- //#region src/components/sdk-sidebar.tsx
9
- function resourceToEntry(resource, selectedPath) {
10
- const result = {
11
- type: "group",
12
- collapsed: false,
13
- label: resource.title,
14
- entries: [],
15
- target: {
16
- type: "stainlessPath",
17
- stainlessPath: resource.stainlessPath
18
- },
19
- isCurrent: selectedPath === resource.stainlessPath
20
- };
21
- for (const method of Object.values(resource.methods)) {
22
- const httpMethod = getHttpMethod(method.httpMethod);
23
- result.entries.push({
24
- type: "link",
25
- target: {
26
- type: "stainlessPath",
27
- stainlessPath: method.stainlessPath
28
- },
29
- label: method.title,
30
- isCurrent: selectedPath === method.stainlessPath,
31
- icon: httpMethod ? /* @__PURE__ */ jsx(Badge.HTTP, {
32
- method: httpMethod,
33
- iconOnly: true,
34
- size: "sm"
35
- }) : void 0
36
- });
37
- }
38
- for (const subresource of Object.values(resource.subresources ?? {})) result.entries.push(resourceToEntry(subresource, selectedPath));
39
- return result;
40
- }
41
- /**
42
- * Given some SDKJSON.Resources, calls into StlSidebar with the appropriate sidebar entries.
43
- */
44
- function SDKSidebar({ resources }) {
45
- const { selectedPath } = useNavigation();
46
- return /* @__PURE__ */ jsx(StlSidebar, { entries: React$1.useMemo(() => resources.filter((resource) => !isResourceEmpty(resource)).map((resource) => resourceToEntry(resource, selectedPath)), [resources, selectedPath]) });
47
- }
48
-
49
- //#endregion
50
- export { SDKSidebar as t };
@@ -1,15 +0,0 @@
1
- import { m as Resource } from "./index-W4Td2Hl7.js";
2
- import * as react_jsx_runtime37 from "react/jsx-runtime";
3
-
4
- //#region src/components/sdk-sidebar.d.ts
5
- type SDKSidebarProps = {
6
- resources: Resource[];
7
- };
8
- /**
9
- * Given some SDKJSON.Resources, calls into StlSidebar with the appropriate sidebar entries.
10
- */
11
- declare function SDKSidebar({
12
- resources
13
- }: SDKSidebarProps): react_jsx_runtime37.JSX.Element;
14
- //#endregion
15
- export { SDKSidebarProps as n, SDKSidebar as t };
@@ -1,181 +0,0 @@
1
- import { d as useSnippetIds, f as useSnippetResponse, i as useDeclaration, s as useLanguage, u as useSnippet } from "./docs-YgoQ3bzY.js";
2
- import { r as useHighlight } from "./markdown-Cq3XEhrR.js";
3
- import { t as useComponents } from "./use-components-BUz3GbO4.js";
4
- import { t as style_default } from "./style-DJIYkFhO.js";
5
- import * as React$1 from "react";
6
- import { jsx, jsxs } from "react/jsx-runtime";
7
- import clsx from "clsx";
8
- import { CheckIcon, CircleAlertIcon, CopyIcon } from "lucide-react";
9
- import { Badge, Button, getHttpMethod } from "@stainless-api/ui-primitives";
10
-
11
- //#region src/components/snippets.tsx
12
- function SnippetCode({ content, language }) {
13
- const lang = useLanguage();
14
- const highlighted = useHighlight(content, language || lang);
15
- return /* @__PURE__ */ jsx("div", {
16
- className: style_default.SnippetCode,
17
- "data-stldocs-copy-content": true,
18
- dangerouslySetInnerHTML: { __html: highlighted }
19
- });
20
- }
21
- function SnippetContainer({ children, className, ...props }) {
22
- return /* @__PURE__ */ jsx("div", {
23
- className: clsx(style_default.Snippet, className),
24
- ...props,
25
- children
26
- });
27
- }
28
- function SnippetRequestContainer({ children }) {
29
- return /* @__PURE__ */ jsx("div", { children });
30
- }
31
- function Snippet({ requestTitle, method, snippet, transformRequestSnippet }) {
32
- const Docs = useComponents();
33
- const language = useLanguage();
34
- const originalSnippetContent = useSnippet(method.stainlessPath, void 0, snippet);
35
- const snippetResponses = useSnippetResponse(method.stainlessPath, snippet);
36
- const decl = useDeclaration(method.stainlessPath, false);
37
- const signature = decl && "qualified" in decl ? decl.qualified : void 0;
38
- if (!originalSnippetContent) {
39
- console.warn(`Snippet not found for method '${method.stainlessPath}'`);
40
- return null;
41
- }
42
- const snippetContent = transformRequestSnippet ? transformRequestSnippet({
43
- snippet: originalSnippetContent,
44
- language
45
- }) : originalSnippetContent;
46
- const httpMethod = getHttpMethod(method.httpMethod);
47
- return /* @__PURE__ */ jsxs(Docs.SnippetContainer, {
48
- signature,
49
- method,
50
- children: [snippetContent && /* @__PURE__ */ jsx(Docs.SnippetRequestContainer, {
51
- signature,
52
- children: /* @__PURE__ */ jsxs("div", {
53
- className: style_default.SnippetRequest,
54
- "data-stldocs-copy-parent": true,
55
- children: [
56
- /* @__PURE__ */ jsxs("div", {
57
- className: style_default.SnippetRequestTitle,
58
- children: [
59
- /* @__PURE__ */ jsxs("div", {
60
- className: style_default.SnippetRequestTitleMethod,
61
- children: [httpMethod && /* @__PURE__ */ jsx(Badge.HTTP, {
62
- method: httpMethod,
63
- iconOnly: true
64
- }), /* @__PURE__ */ jsx("h3", { children: method.summary || method.title })]
65
- }),
66
- /* @__PURE__ */ jsx("div", {
67
- className: style_default.SnippetRequestTitleContent,
68
- children: requestTitle
69
- }),
70
- /* @__PURE__ */ jsx(Docs.SnippetButtons, { content: snippetContent })
71
- ]
72
- }),
73
- /* @__PURE__ */ jsx(Docs.SnippetCode, {
74
- content: snippetContent,
75
- signature
76
- }),
77
- /* @__PURE__ */ jsx(Docs.SnippetFooter, {})
78
- ]
79
- })
80
- }), /* @__PURE__ */ jsx(Docs.SnippetResponse, { responses: snippetResponses })]
81
- });
82
- }
83
- function MultiSnippets({ requestTitle, method }) {
84
- const snippetIds = useSnippetIds(method.stainlessPath)?.filter((id) => id !== "default");
85
- const radioId = React$1.useId();
86
- if (!snippetIds) return null;
87
- return /* @__PURE__ */ jsxs("div", {
88
- className: style_default.SnippetMulti,
89
- "data-stldocs-multi-snippet-container": true,
90
- children: [/* @__PURE__ */ jsx("div", {
91
- className: style_default.SnippetMultiTabs,
92
- "data-stldocs-multi-snippet-tabs": true,
93
- children: snippetIds.map((snid, idx) => /* @__PURE__ */ jsxs("label", {
94
- className: style_default.SnippetMultiTab,
95
- children: [/* @__PURE__ */ jsx("input", {
96
- type: "radio",
97
- name: `snippet-example-radio-${radioId}`,
98
- value: idx,
99
- defaultChecked: idx === 0
100
- }), /* @__PURE__ */ jsx("span", { children: snid.slice(7) })]
101
- }, `snippet-example-${idx}`))
102
- }), /* @__PURE__ */ jsx("div", {
103
- className: style_default.SnippetMultiContent,
104
- children: snippetIds.map((snid, idx) => {
105
- return /* @__PURE__ */ jsx("div", {
106
- className: clsx(style_default.SnippetMultiPane, idx === 0 && style_default.SnippetMultiPaneActive),
107
- "data-stldocs-multi-snippet-id": idx,
108
- children: /* @__PURE__ */ jsx(Snippet, {
109
- method,
110
- snippet: snid,
111
- requestTitle
112
- })
113
- }, `snippet-example-content-${idx}`);
114
- })
115
- })]
116
- });
117
- }
118
- function SnippetButtons({ content }) {
119
- const [CopyButtonIcon, setCopyIcon] = React$1.useState(CopyIcon);
120
- async function handleCopy() {
121
- try {
122
- await navigator.clipboard.writeText(content);
123
- setCopyIcon(CheckIcon);
124
- } catch {
125
- setCopyIcon(CircleAlertIcon);
126
- }
127
- setTimeout(() => setCopyIcon(CopyIcon), 1e3);
128
- }
129
- return /* @__PURE__ */ jsx(Button, {
130
- variant: "outline",
131
- "data-stldocs-snippet-copy": true,
132
- children: /* @__PURE__ */ jsx(CopyButtonIcon, {
133
- size: 16,
134
- className: style_default.Icon,
135
- onClick: handleCopy
136
- })
137
- });
138
- }
139
- function SnippetFooter() {
140
- return null;
141
- }
142
- function SnippetResponse({ responses }) {
143
- const Docs = useComponents();
144
- if (!responses || responses.length === 0) return null;
145
- const tabs = responses.map(({ status }, index) => ({
146
- status,
147
- index,
148
- label: status ? `${status} example` : null
149
- }));
150
- const hasTabs = tabs.length > 1 || tabs.some((tab) => tab.label);
151
- return /* @__PURE__ */ jsx("div", {
152
- className: style_default.SnippetMultiResponse,
153
- children: /* @__PURE__ */ jsxs("div", {
154
- className: clsx(style_default.Snippet),
155
- children: [hasTabs && /* @__PURE__ */ jsx("div", {
156
- className: clsx(style_default.SnippetResponseTab, tabs.length === 1 && style_default.SnippetResponseTabSingleReturn),
157
- children: tabs.map(({ status, label }, index) => /* @__PURE__ */ jsx("div", {
158
- "data-snippet-response-tab-id": `snippet-response-tab-${status}-${index}`,
159
- className: clsx(style_default.SnippetResponseTabItem, index === 0 && style_default.SnippetResponseTabItemActive),
160
- children: /* @__PURE__ */ jsx(Button, {
161
- disabled: responses.length === 1,
162
- variant: "ghost",
163
- children: label ?? `Example ${index + 1}`
164
- })
165
- }, `snippet-response-tab-item-${status}-${index}`))
166
- }), responses.map(({ status, content, contentType }, index) => {
167
- return typeof content === "string" ? /* @__PURE__ */ jsx("div", {
168
- className: clsx(style_default.SnippetResponsePane, index === 0 && style_default.SnippetResponsePaneActive),
169
- "data-snippet-response-pane-id": `snippet-response-tab-${status}-${index}`,
170
- children: /* @__PURE__ */ jsx(Docs.SnippetCode, {
171
- content,
172
- language: contentType === "application/json" || !contentType ? "json" : "none"
173
- })
174
- }, `snippet-response-${status}-${index}`) : null;
175
- })]
176
- })
177
- });
178
- }
179
-
180
- //#endregion
181
- export { SnippetContainer as a, SnippetResponse as c, SnippetCode as i, Snippet as n, SnippetFooter as o, SnippetButtons as r, SnippetRequestContainer as s, MultiSnippets as t };
@@ -1,58 +0,0 @@
1
- import { ReactNode } from "react";
2
- import * as react_jsx_runtime52 from "react/jsx-runtime";
3
-
4
- //#region src/components/stl-sidebar.d.ts
5
- declare module 'react' {
6
- namespace JSX {
7
- interface IntrinsicElements {
8
- /**
9
- * Custom element defined by Starlight's <SidebarPersister>.
10
- */
11
- 'sl-sidebar-restore': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
12
- }
13
- }
14
- }
15
- type StlSidebarTarget = {
16
- type: 'href';
17
- href: string;
18
- } | {
19
- type: 'stainlessPath';
20
- stainlessPath: string;
21
- };
22
- interface StlSidebarLink {
23
- type: 'link';
24
- icon?: ReactNode;
25
- label: string;
26
- /** Current sidebar item is highlighted. */
27
- isCurrent?: boolean;
28
- target: StlSidebarTarget;
29
- /** Additional HTML attributes that will be attached to the anchor element. */
30
- attrs?: Record<string, unknown>;
31
- }
32
- interface StlSidebarGroup {
33
- type: 'group';
34
- icon?: ReactNode;
35
- label: string;
36
- entries: Array<StlSidebarLink | StlSidebarGroup>;
37
- /** Defaults to true. */
38
- collapsible?: boolean;
39
- collapsed?: boolean;
40
- /** Current sidebar item is highlighted. */
41
- isCurrent?: boolean;
42
- target?: StlSidebarTarget;
43
- }
44
- type StlSidebarEntry = StlSidebarLink | StlSidebarGroup;
45
- type StlSidebarProps = {
46
- entries: StlSidebarEntry[];
47
- /**
48
- * If set, add <sl-sidebar-restore> custom elements (as defined by Starlight's SidebarPersister)
49
- * which are used to save/restore sidebar state.
50
- */
51
- withStarlightRestoration?: boolean;
52
- };
53
- declare function StlSidebar({
54
- entries,
55
- withStarlightRestoration
56
- }: StlSidebarProps): react_jsx_runtime52.JSX.Element;
57
- //#endregion
58
- export { StlSidebarProps as a, StlSidebarLink as i, StlSidebarEntry as n, StlSidebarTarget as o, StlSidebarGroup as r, StlSidebar as t };
@@ -1,58 +0,0 @@
1
- import { ReactNode } from "react";
2
- import * as react_jsx_runtime57 from "react/jsx-runtime";
3
-
4
- //#region src/components/stl-sidebar.d.ts
5
- declare module 'react' {
6
- namespace JSX {
7
- interface IntrinsicElements {
8
- /**
9
- * Custom element defined by Starlight's <SidebarPersister>.
10
- */
11
- 'sl-sidebar-restore': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
12
- }
13
- }
14
- }
15
- type StlSidebarTarget = {
16
- type: 'href';
17
- href: string;
18
- } | {
19
- type: 'stainlessPath';
20
- stainlessPath: string;
21
- };
22
- interface StlSidebarLink {
23
- type: 'link';
24
- icon?: ReactNode;
25
- label: string;
26
- /** Current sidebar item is highlighted. */
27
- isCurrent?: boolean;
28
- target: StlSidebarTarget;
29
- /** Additional HTML attributes that will be attached to the anchor element. */
30
- attrs?: Record<string, unknown>;
31
- }
32
- interface StlSidebarGroup {
33
- type: 'group';
34
- icon?: ReactNode;
35
- label: string;
36
- entries: Array<StlSidebarLink | StlSidebarGroup>;
37
- /** Defaults to true. */
38
- collapsible?: boolean;
39
- collapsed?: boolean;
40
- /** Current sidebar item is highlighted. */
41
- isCurrent?: boolean;
42
- target?: StlSidebarTarget;
43
- }
44
- type StlSidebarEntry = StlSidebarLink | StlSidebarGroup;
45
- type StlSidebarProps = {
46
- entries: StlSidebarEntry[];
47
- /**
48
- * If set, add <sl-sidebar-restore> custom elements (as defined by Starlight's SidebarPersister)
49
- * which are used to save/restore sidebar state.
50
- */
51
- withStarlightRestoration?: boolean;
52
- };
53
- declare function StlSidebar({
54
- entries,
55
- withStarlightRestoration
56
- }: StlSidebarProps): react_jsx_runtime57.JSX.Element;
57
- //#endregion
58
- export { StlSidebarProps as a, StlSidebarLink as i, StlSidebarEntry as n, StlSidebarTarget as o, StlSidebarGroup as r, StlSidebar as t };
@@ -1,106 +0,0 @@
1
- import { t as useComponents } from "./use-components-BUz3GbO4.js";
2
- import { t as style_default } from "./style-DJIYkFhO.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 targetToAttributes(target) {
9
- return {
10
- href: target.type === "href" ? target.href : void 0,
11
- stainlessPath: target.type === "stainlessPath" ? target.stainlessPath : void 0
12
- };
13
- }
14
- function StlSidebarSublist({ entries, entryToIndex }) {
15
- return /* @__PURE__ */ jsx("ul", {
16
- className: style_default.SidebarList,
17
- children: entries.map((entry, index) => entry.type === "link" ? /* @__PURE__ */ jsx(LinkEntry, { entry }, index) : /* @__PURE__ */ jsx(GroupEntry, {
18
- entry,
19
- entryToIndex
20
- }, index))
21
- });
22
- }
23
- function EntryItem({ className, children }) {
24
- return /* @__PURE__ */ jsx("li", {
25
- className: clsx(style_default.SidebarEntry, className),
26
- children
27
- });
28
- }
29
- function LinkEntry({ entry }) {
30
- const Docs = useComponents();
31
- return /* @__PURE__ */ jsx(EntryItem, {
32
- className: style_default.SidebarEntryLink,
33
- children: /* @__PURE__ */ jsxs(Docs.Link, {
34
- ...targetToAttributes(entry.target),
35
- "aria-current": entry.isCurrent ? "page" : void 0,
36
- ...entry.attrs,
37
- children: [entry.icon, entry.label]
38
- })
39
- });
40
- }
41
- function GroupEntry({ entry, entryToIndex }) {
42
- const Docs = useComponents();
43
- const restorePointIndex = entryToIndex?.get(entry);
44
- const { collapsible = true } = entry;
45
- const labelWithIcon = /* @__PURE__ */ jsxs(Fragment, { children: [entry.label, entry.icon] });
46
- const GroupElement = collapsible ? "details" : "div";
47
- const GroupLabelElement = collapsible ? "summary" : "div";
48
- return /* @__PURE__ */ jsxs(EntryItem, {
49
- className: style_default.SidebarEntryGroup,
50
- children: [entry.target && /* @__PURE__ */ jsx(Docs.Link, {
51
- ...targetToAttributes(entry.target),
52
- "aria-current": entry.isCurrent ? "page" : void 0,
53
- children: labelWithIcon
54
- }), /* @__PURE__ */ jsxs(GroupElement, {
55
- className: style_default.SidebarExpander,
56
- ...collapsible ? { open: flattenStlSidebar(entry.entries).some((i) => i.isCurrent) || !entry.collapsed } : {},
57
- children: [
58
- /* @__PURE__ */ jsxs(GroupLabelElement, {
59
- className: style_default.ExpanderSummary,
60
- children: [/* @__PURE__ */ jsx("span", {
61
- "aria-hidden": entry.target ? "true" : void 0,
62
- children: labelWithIcon
63
- }), entry.entries.length > 0 && collapsible && /* @__PURE__ */ jsx(ChevronRight, {
64
- size: 16,
65
- strokeWidth: 1,
66
- className: `${style_default.Icon} ${style_default.ExpanderSummaryIcon}`
67
- })]
68
- }),
69
- restorePointIndex !== void 0 && /* @__PURE__ */ jsx("sl-sidebar-restore", { "data-index": restorePointIndex }),
70
- entry.entries.length > 0 && /* @__PURE__ */ jsx(StlSidebarSublist, {
71
- entries: entry.entries,
72
- entryToIndex
73
- })
74
- ]
75
- })]
76
- });
77
- }
78
- function StlSidebar({ entries, withStarlightRestoration }) {
79
- const entryToIndex = withStarlightRestoration ? computeEntryToIndex(entries) : void 0;
80
- return /* @__PURE__ */ jsx("div", {
81
- className: `${style_default.Root} ${style_default.Sidebar}`,
82
- children: /* @__PURE__ */ jsx(StlSidebarSublist, {
83
- entries,
84
- entryToIndex
85
- })
86
- });
87
- }
88
- function computeEntryToIndex(allEntries) {
89
- const entryToIndex = /* @__PURE__ */ new Map();
90
- let currentIndex = 0;
91
- function addEntries(entries) {
92
- for (const entry of entries) if (entry.type === "group") {
93
- entryToIndex.set(entry, currentIndex);
94
- currentIndex++;
95
- addEntries(entry.entries);
96
- }
97
- }
98
- addEntries(allEntries);
99
- return entryToIndex;
100
- }
101
- function flattenStlSidebar(sidebar) {
102
- return sidebar.flatMap((entry) => entry.type === "group" ? flattenStlSidebar(entry.entries) : entry);
103
- }
104
-
105
- //#endregion
106
- export { StlSidebar as t };
@@ -1,178 +0,0 @@
1
- //#region src/style.ts
2
- var style_default = {
3
- TextIdentifier: "stldocs-text-identifier",
4
- TextOperator: "stldocs-text-operator",
5
- TextPunctuation: "stldocs-text-punctuation",
6
- TextKeyword: "stldocs-text-keyword",
7
- ContentArea: "stldocs-content-area",
8
- Markdown: "stldocs-markdown",
9
- Content: "stldocs-content",
10
- Truncation: "stldocs-truncation",
11
- Expander: "stldocs-expander",
12
- ExpanderContent: "stldocs-expander-content",
13
- ExpanderSummary: "stldocs-expander-summary",
14
- ExpanderSummaryIcon: "stldocs-expander-summary-icon",
15
- ExpanderSummaryContent: "stldocs-expander-summary-content",
16
- ExpanderIndent: "stldocs-expander-indent",
17
- Badge: "stldocs-badge",
18
- Icon: "stldocs-icon",
19
- Tooltip: "stldocs-tooltip",
20
- TooltipHost: "stldocs-tooltip-host",
21
- TooltipContent: "stldocs-tooltip-content",
22
- Input: "stldocs-input",
23
- InputDisabled: "stldocs-input-disabled",
24
- InputTextField: "stldocs-input-textfield",
25
- MaskedInputWrapper: "stldocs-masked-input-wrapper",
26
- MaskedInputDisplay: "stldocs-masked-input-display",
27
- MaskedInputObscured: "stldocs-masked-input-obscured",
28
- ToggleButton: "stldocs-togglebutton",
29
- ListView: "stldocs-listview",
30
- ListViewItem: "stldocs-listview-item",
31
- ExpandToggle: "stldocs-expand-toggle",
32
- ExpandToggleContent: "stldocs-expand-toggle-content",
33
- LoadingSpinner: "stldocs-loading-spinner",
34
- Type: "stldocs-type",
35
- TypeName: "stldocs-typename",
36
- TypeKeyword: "stldocs-type-keyword",
37
- TypeString: "stldocs-type-string",
38
- TypeArray: "stldocs-type-array",
39
- TypeReference: "stldocs-type-reference",
40
- TypeBracket: "stldocs-type-bracket",
41
- TypeBrace: "stldocs-type-brace",
42
- TypePropertyName: "stldocs-type-propertyname",
43
- TypePlain: "stldocs-type-plain",
44
- TypePreview: "stldocs-type-preview",
45
- TypePreviewContent: "stldocs-type-preview-content",
46
- LiteralString: "stldocs-literal-string",
47
- LiteralNumeric: "stldocs-literal-numeric",
48
- LiteralBoolean: "stldocs-literal-boolean",
49
- Snippet: "stldocs-snippet",
50
- SnippetCode: "stldocs-snippet-code",
51
- SnippetFooter: "stldocs-snippet-footer",
52
- SnippetRequest: "stldocs-snippet-request",
53
- SnippetRequestTitle: "stldocs-snippet-request-title",
54
- SnippetRequestTitleContent: "stldocs-snippet-request-title-content",
55
- SnippetRequestTitleLabel: "stldocs-snippet-request-title-label",
56
- SnippetRequestTitleLanguage: "stldocs-snippet-request-title-language",
57
- SnippetRequestTitleMethod: "stldocs-snippet-request-title-method",
58
- SnippetResponse: "stldocs-snippet-response",
59
- SnippetMultiResponse: "stldocs-snippet-multi-response",
60
- SnippetResponseOpen: "stldocs-snippet-response-opened",
61
- SnippetResponseTab: "stldocs-snippet-response-tab",
62
- SnippetResponseTabItem: "stldocs-snippet-response-tab-item",
63
- SnippetResponseTabItemActive: "stldocs-snippet-response-tab-item-active",
64
- SnippetResponseTabSingleReturn: "stldocs-snippet-response-tab-single-return",
65
- SnippetResponsePane: "stldocs-snippet-response-pane",
66
- SnippetResponsePaneActive: "stldocs-snippet-response-pane-active",
67
- SnippetMulti: "stldocs-snippet-multi",
68
- SnippetMultiTabs: "stldocs-snippet-multi-tabs",
69
- SnippetMultiTab: "stldocs-snippet-multi-tab",
70
- SnippetMultiContent: "stldocs-snippet-multi-content",
71
- SnippetMultiPane: "stldocs-snippet-multi-pane",
72
- SnippetMultiPaneActive: "stldocs-snippet-multi-pane-active",
73
- Method: "stldocs-method",
74
- MethodHeader: "stldocs-method-header",
75
- MethodBody: "stldocs-method-body",
76
- MethodInfo: "stldocs-method-info",
77
- MethodInfoSection: "stldocs-method-info-section",
78
- MethodExample: "stldocs-method-example",
79
- MethodResponseColumn: "stldocs-method-response-column",
80
- MethodTitle: "stldocs-method-title",
81
- MethodBadges: "stldocs-method-badges",
82
- MethodSignature: "stldocs-method-signature",
83
- MethodDescription: "stldocs-method-description",
84
- MethodParameters: "stldocs-method-parameters",
85
- MethodReturns: "stldocs-method-returns",
86
- MethodContent: "stldocs-method-content",
87
- MethodContentColumn: "stldocs-method-content-column",
88
- MethodRouteEndpoint: "stldocs-method-route-endpoint",
89
- MethodRoute: "stldocs-method-route",
90
- MethodSummary: "stldocs-method-summary",
91
- MethodSinglePane: "stldocs-method-single-pane",
92
- MethodDoublePane: "stldocs-method-double-pane",
93
- MethodAvailableLanguages: "stldocs-method-available-languages",
94
- SignatureTitle: "stldocs-signature-title",
95
- SignatureName: "stldocs-signature-name",
96
- SignatureQualified: "stldocs-signature-qualified",
97
- SignatureParams: "stldoc-signature-params",
98
- SignatureParen: "stldocs-signature-paren",
99
- SignatureReturns: "stldocs-signature-returns",
100
- TerraformResourceTitle: "stldocs-terraform-resource-title",
101
- Property: "stldocs-property",
102
- Properties: "stldocs-properties",
103
- PropertyHeader: "stldocs-property-header",
104
- PropertyInfo: "stldocs-property-info",
105
- PropertyDeclaration: "stldocs-property-declaration",
106
- PropertyDeprecated: "stldocs-property-deprecated",
107
- PropertyDeprecatedMessage: "stldocs-property-deprecated-message",
108
- PropertyContent: "stldocs-property-content",
109
- PropertyChildren: "stldocs-property-children",
110
- PropertyConstraints: "stldocs-property-constraints",
111
- PropertyConstraint: "stldocs-property-constraint",
112
- PropertyConstraintName: "stldocs-property-constraint-name",
113
- PropertyConstraintValue: "stldocs-property-constraint-value",
114
- PropertyDefault: "stldocs-property-default",
115
- PropertyDescription: "stldocs-property-description",
116
- PropertyTitle: "stldocs-property-title",
117
- PropertyAnnotation: "stldocs-property-annotation",
118
- PropertyName: "stldocs-property-name",
119
- PropertyBadges: "stldocs-property-badges",
120
- PropertyTypeName: "stldocs-property-typename",
121
- PropertyType: "stldocs-property-type",
122
- Overview: "stldocs-overview",
123
- OverviewHeader: "stldocs-overview-header",
124
- OverviewHeaderInfo: "stldocs-overview-header-info",
125
- OverviewHeaderInfoTimestamp: "stldocs-overview-header-info-timestamp",
126
- Resource: "stldocs-resource",
127
- ResourceContent: "stldocs-resource-content",
128
- ResourceContentProperties: "stldocs-resource-content-properties",
129
- ResourceContentGroup: "stldocs-resource-content-group",
130
- ResourceContentGroupName: "stldocs-resource-content-group-name",
131
- ResourceContentGroupModelTitle: "stldocs-resource-content-group-model-title",
132
- ResourceHeader: "stldocs-resource-header",
133
- ResourceTitle: "stldocs-resource-title",
134
- ResourceTitleSegment: "stldocs-resource-title-segment",
135
- ResourceDescription: "stldocs-resource-description",
136
- ResourceName: "stldocs-resource-name",
137
- Model: "stldocs-model",
138
- Root: "stldocs-root",
139
- Sidebar: "stldocs-sidebar",
140
- SidebarList: "stldocs-sidebar-list",
141
- SidebarExpander: "stldocs-sidebar-expander",
142
- SidebarExpanderSummary: "stldocs-sidebar-expander-summary",
143
- SidebarExpanderContent: "stldocs-sidebar-expander-content",
144
- SidebarEntry: "stldocs-sidebar-entry",
145
- SidebarEntryLink: "stldocs-sidebar-entry-link",
146
- SidebarEntryGroup: "stldocs-sidebar-entry-group",
147
- SearchForm: "stldocs-search-form",
148
- SearchModal: "stldocs-search-modal",
149
- SearchFilter: "stldocs-search-filter",
150
- SearchFilterLabel: "stldocs-search-filter-label",
151
- SearchFilterCount: "stldocs-search-filter-count",
152
- SearchBreadcrumb: "stldocs-search-breadcrumb",
153
- SearchBreadcrumbItem: "stldocs-search-breadcrumb-item",
154
- SearchBreadcrumbDivider: "stldocs-search-breadcrumb-divider",
155
- SearchResult: "stldocs-search-result",
156
- SearchResultResourceInfo: "stldocs-search-result-resource-info",
157
- SearchResultResourceTitle: "stldocs-search-result-resource-title",
158
- SearchResultResourcePath: "stldocs-search-result-resource-path",
159
- SearchResultGuideTitle: "stldocs-search-result-guide-title",
160
- SearchResultGuideExcerpt: "stldocs-search-result-guide-excerpt",
161
- SearchDisabledStateContainer: "stldocs-search-disabled-state-container",
162
- SearchModalCloseButton: "stldocs-search-modal-close-button",
163
- LanguageBlock: "stldocs-language-block",
164
- LanguageBlockContent: "stldocs-language-block-content",
165
- LanguageBlockContentIcon: "stldocs-language-block-content-icon",
166
- LanguageBlockContentInfo: "stldocs-language-block-content-info",
167
- LanguageBlockContentInfoLanguage: "stldocs-language-block-content-info-language",
168
- LanguageBlockContentInfoVersion: "stldocs-language-block-content-info-version",
169
- LanguageBlockLinks: "stldocs-language-block-links",
170
- LanguageBlockInstall: "stldocs-language-block-install",
171
- Breadcrumbs: "stldocs-breadcrumbs",
172
- BreadcrumbsItem: "stldocs-breadcrumbs-item",
173
- BreadcrumbsLink: "stldocs-breadcrumbs-link",
174
- BreadcrumbsNonLink: "stldocs-breadcrumbs-non-link"
175
- };
176
-
177
- //#endregion
178
- export { style_default as t };