@stainless-api/docs-ui 0.1.0-beta.85 → 0.1.0-beta.87

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 (115) hide show
  1. package/dist/breadcrumbs-DC2_z7nh.d.ts +25 -0
  2. package/dist/chunk-pbuEa-1d.js +13 -0
  3. package/dist/component-generics-DYxBWv1v.js +42 -0
  4. package/dist/component-generics-q-ujwX4P.d.ts +30 -0
  5. package/dist/components/MaskedInput.d.ts +1 -1
  6. package/dist/components/MaskedInput.js +1 -3
  7. package/dist/components/breadcrumbs.d.ts +1 -24
  8. package/dist/components/breadcrumbs.js +2 -4
  9. package/dist/components/icons.js +4 -6
  10. package/dist/components/index.d.ts +10 -16
  11. package/dist/components/index.js +3 -5
  12. package/dist/components/method.d.ts +1 -58
  13. package/dist/components/method.js +12 -14
  14. package/dist/components/overview.d.ts +1 -38
  15. package/dist/components/overview.js +6 -5
  16. package/dist/components/primitives.d.ts +1 -106
  17. package/dist/components/primitives.js +2 -4
  18. package/dist/components/properties.d.ts +1 -53
  19. package/dist/components/properties.js +17 -19
  20. package/dist/components/sdk-sidebar.d.ts +1 -14
  21. package/dist/components/sdk-sidebar.js +2 -4
  22. package/dist/components/sdk.d.ts +1 -127
  23. package/dist/components/sdk.js +3 -5
  24. package/dist/components/snippets.d.ts +1 -70
  25. package/dist/components/snippets.js +16 -16
  26. package/dist/components/stl-sidebar.d.ts +1 -57
  27. package/dist/components/stl-sidebar.js +2 -4
  28. package/dist/contexts/component-generics.d.ts +1 -29
  29. package/dist/contexts/component-generics.js +2 -33
  30. package/dist/contexts/component-types.d.ts +3 -5
  31. package/dist/contexts/component.d.ts +4 -5
  32. package/dist/contexts/component.js +2 -5
  33. package/dist/contexts/docs.d.ts +1 -61
  34. package/dist/contexts/docs.js +1 -3
  35. package/dist/contexts/index.d.ts +6 -13
  36. package/dist/contexts/index.js +5 -7
  37. package/dist/contexts/markdown.d.ts +2 -22
  38. package/dist/contexts/markdown.js +28 -15
  39. package/dist/contexts/navigation.d.ts +1 -28
  40. package/dist/contexts/navigation.js +1 -3
  41. package/dist/contexts/use-components.d.ts +1 -2
  42. package/dist/contexts/use-components.js +2 -5
  43. package/dist/docs-BomxNGuD.d.ts +62 -0
  44. package/dist/docs-DSjdvCh5.d.ts +62 -0
  45. package/dist/index-gGDaf6FK.d.ts +464 -0
  46. package/dist/index-uRQlPa4x.d.ts +464 -0
  47. package/dist/index.d.ts +2 -4
  48. package/dist/index.js +2 -3
  49. package/dist/languages/cli.d.ts +2 -38
  50. package/dist/languages/cli.js +3 -5
  51. package/dist/languages/csharp.d.ts +2 -42
  52. package/dist/languages/csharp.js +3 -5
  53. package/dist/languages/go.d.ts +2 -40
  54. package/dist/languages/go.js +3 -5
  55. package/dist/languages/http.d.ts +2 -46
  56. package/dist/languages/http.js +5 -7
  57. package/dist/languages/index.d.ts +2 -51
  58. package/dist/languages/index.js +3 -5
  59. package/dist/languages/java.d.ts +2 -43
  60. package/dist/languages/java.js +3 -5
  61. package/dist/languages/php.d.ts +2 -40
  62. package/dist/languages/php.js +3 -5
  63. package/dist/languages/python.d.ts +2 -40
  64. package/dist/languages/python.js +3 -5
  65. package/dist/languages/ruby.d.ts +2 -40
  66. package/dist/languages/ruby.js +3 -5
  67. package/dist/languages/terraform.d.ts +2 -48
  68. package/dist/languages/terraform.js +25 -10
  69. package/dist/languages/typescript.d.ts +2 -40
  70. package/dist/languages/typescript.js +5 -7
  71. package/dist/markdown/index.d.ts +1 -1
  72. package/dist/markdown/index.js +3 -6
  73. package/dist/markdown/md.js +1 -3
  74. package/dist/markdown/printer.d.ts +2 -2
  75. package/dist/markdown/printer.js +3 -5
  76. package/dist/markdown/utils.d.ts +3 -3
  77. package/dist/markdown/utils.js +2 -4
  78. package/dist/markdown-Cwdboi_V.d.ts +33 -0
  79. package/dist/method-CNRMOUfn.d.ts +59 -0
  80. package/dist/navigation-22WDJvRF.d.ts +29 -0
  81. package/dist/navigation-C9ckAfpV.d.ts +29 -0
  82. package/dist/overview-CDvh184n.d.ts +39 -0
  83. package/dist/primitives-DFE_4MvV.d.ts +107 -0
  84. package/dist/properties-CVwrzWVa.d.ts +54 -0
  85. package/dist/routing-C_fawH40.d.ts +61 -0
  86. package/dist/routing-yTSG7nWM.d.ts +61 -0
  87. package/dist/routing.d.ts +2 -61
  88. package/dist/routing.js +2 -4
  89. package/dist/sdk-BkW3MDco.d.ts +128 -0
  90. package/dist/sdk-Cx2Z7bDk.d.ts +128 -0
  91. package/dist/sdk-sidebar-BpDlOMat.d.ts +15 -0
  92. package/dist/spec.d.ts +2 -2
  93. package/dist/spec.js +1 -3
  94. package/dist/stl-sidebar-CKrR5ZGs.d.ts +58 -0
  95. package/dist/style.js +1 -2
  96. package/dist/styles/main.css +333 -351
  97. package/dist/styles/primitives.css +133 -185
  98. package/dist/styles/resets.css +7 -14
  99. package/dist/styles/search.css +91 -96
  100. package/dist/styles/sidebar.css +44 -71
  101. package/dist/styles/variables.css +0 -5
  102. package/dist/styles.css +1008 -1263
  103. package/dist/utils.d.ts +1 -1
  104. package/dist/utils.js +2 -4
  105. package/package.json +9 -8
  106. package/dist/chunk-BYypO7fO.js +0 -18
  107. package/dist/styles/main.js +0 -0
  108. package/dist/styles/primitives.js +0 -0
  109. package/dist/styles/resets.js +0 -0
  110. package/dist/styles/search.js +0 -0
  111. package/dist/styles/sidebar.js +0 -0
  112. package/dist/styles/variables.js +0 -0
  113. package/dist/styles.mjs +0 -1
  114. package/dist/use-strict-context-Clb6Yjly.js +0 -16
  115. /package/dist/{index-pvh-w1xa.d.ts → index-DFr9Mesr.d.ts} +0 -0
@@ -1,54 +1,2 @@
1
- import { ReactNode } from "react";
2
- import * as react_jsx_runtime0 from "react/jsx-runtime";
3
-
4
- //#region src/components/properties.d.ts
5
- type PropertyToggleProps = {
6
- target: string;
7
- };
8
- declare function PropertyToggle({
9
- target
10
- }: PropertyToggleProps): react_jsx_runtime0.JSX.Element;
11
- type PropertyDescriptionProps = {
12
- description?: string;
13
- };
14
- declare function PropertyDescription({
15
- description
16
- }: PropertyDescriptionProps): react_jsx_runtime0.JSX.Element | undefined;
17
- type PropertyTitleProps = {
18
- title?: string;
19
- };
20
- declare function PropertyTitle({
21
- title
22
- }: PropertyTitleProps): react_jsx_runtime0.JSX.Element | undefined;
23
- type PropertyProps = {
24
- id?: string;
25
- name?: ReactNode;
26
- typeName?: ReactNode;
27
- badges?: ReactNode;
28
- type?: ReactNode;
29
- description?: string;
30
- title?: string;
31
- expand?: boolean;
32
- deprecated?: boolean | string;
33
- additional?: ReactNode;
34
- declaration?: ReactNode;
35
- constraints?: ReactNode;
36
- children?: ReactNode;
37
- };
38
- declare function Property({
39
- id,
40
- name,
41
- typeName,
42
- badges,
43
- type,
44
- declaration,
45
- description,
46
- title,
47
- deprecated,
48
- expand,
49
- additional,
50
- constraints,
51
- children
52
- }: PropertyProps): react_jsx_runtime0.JSX.Element | null;
53
- //#endregion
1
+ import { a as PropertyTitle, c as PropertyToggleProps, i as PropertyProps, n as PropertyDescription, o as PropertyTitleProps, r as PropertyDescriptionProps, s as PropertyToggle, t as Property } from "../properties-CVwrzWVa.js";
54
2
  export { Property, PropertyDescription, PropertyDescriptionProps, PropertyProps, PropertyTitle, PropertyTitleProps, PropertyToggle, PropertyToggleProps };
@@ -1,12 +1,11 @@
1
1
  import { useIgnoredResources, useLanguage, useSettings } from "../contexts/docs.js";
2
- import "../use-strict-context-Clb6Yjly.js";
2
+ import "../component-generics-DYxBWv1v.js";
3
3
  import "../contexts/index.js";
4
4
  import { useComponents } from "../contexts/use-components.js";
5
5
  import style_default from "../style.js";
6
6
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
7
  import { ArrowDownWideNarrowIcon, ArrowUpNarrowWideIcon, LinkIcon } from "lucide-react";
8
8
  import { Button } from "@stainless-api/ui-primitives";
9
-
10
9
  //#region src/components/properties.tsx
11
10
  function PropertyToggle({ target }) {
12
11
  return /* @__PURE__ */ jsxs("span", {
@@ -59,10 +58,10 @@ function Property({ id, name, typeName, badges, type, declaration, description,
59
58
  children: deprecated
60
59
  }),
61
60
  descRest && /* @__PURE__ */ jsx(Docs.PropertyDescription, { description: descRest }),
62
- constraints && /* @__PURE__ */ jsx("div", {
61
+ constraints ? /* @__PURE__ */ jsx("div", {
63
62
  className: style_default.PropertyContent,
64
63
  children: constraints
65
- })
64
+ }) : null
66
65
  ] });
67
66
  const rich = /* @__PURE__ */ jsxs(Fragment, { children: [
68
67
  /* @__PURE__ */ jsxs("div", {
@@ -73,41 +72,41 @@ function Property({ id, name, typeName, badges, type, declaration, description,
73
72
  children: "Deprecated"
74
73
  }),
75
74
  declaration,
76
- badges && /* @__PURE__ */ jsx("span", {
75
+ badges ? /* @__PURE__ */ jsx("span", {
77
76
  className: style_default.PropertyBadges,
78
77
  children: badges
79
- })
78
+ }) : null
80
79
  ]
81
80
  }),
82
81
  title && showTitle && /* @__PURE__ */ jsx(Docs.PropertyTitle, { title }),
83
82
  collapseDescription === false ? textContent : descFirstLine && /* @__PURE__ */ jsx(Docs.PropertyDescription, { description: descFirstLine })
84
83
  ] });
85
84
  const simple = /* @__PURE__ */ jsxs(Fragment, { children: [
86
- name && /* @__PURE__ */ jsxs("div", {
85
+ name ? /* @__PURE__ */ jsxs("div", {
87
86
  className: style_default.PropertyHeader,
88
87
  children: [
89
88
  deprecated && /* @__PURE__ */ jsx("span", {
90
89
  className: style_default.PropertyDeprecated,
91
90
  children: "Deprecated"
92
91
  }),
93
- name && /* @__PURE__ */ jsx("span", {
92
+ /* @__PURE__ */ jsx("span", {
94
93
  className: style_default.PropertyName,
95
94
  children: name
96
95
  }),
97
- typeName && /* @__PURE__ */ jsx("span", {
96
+ typeName ? /* @__PURE__ */ jsx("span", {
98
97
  className: style_default.PropertyTypeName,
99
98
  children: typeName
100
- }),
101
- badges && /* @__PURE__ */ jsx("span", {
99
+ }) : null,
100
+ badges ? /* @__PURE__ */ jsx("span", {
102
101
  className: style_default.PropertyBadges,
103
102
  children: badges
104
- })
103
+ }) : null
105
104
  ]
106
- }),
107
- type && /* @__PURE__ */ jsx("div", {
105
+ }) : null,
106
+ type ? /* @__PURE__ */ jsx("div", {
108
107
  className: style_default.PropertyType,
109
108
  children: type
110
- }),
109
+ }) : null,
111
110
  title && showTitle && /* @__PURE__ */ jsx(Docs.PropertyTitle, { title }),
112
111
  collapseDescription === false ? textContent : null
113
112
  ] });
@@ -126,10 +125,10 @@ function Property({ id, name, typeName, badges, type, declaration, description,
126
125
  children: [
127
126
  collapseDescription !== false ? textContent : null,
128
127
  additional,
129
- children && /* @__PURE__ */ jsx("div", {
128
+ children ? /* @__PURE__ */ jsx("div", {
130
129
  className: style_default.PropertyChildren,
131
130
  children
132
- })
131
+ }) : null
133
132
  ]
134
133
  }) : content, id && /* @__PURE__ */ jsx(Button, {
135
134
  className: style_default.DeepLinkButton,
@@ -141,6 +140,5 @@ function Property({ id, name, typeName, badges, type, declaration, description,
141
140
  })]
142
141
  });
143
142
  }
144
-
145
143
  //#endregion
146
- export { Property, PropertyDescription, PropertyTitle, PropertyToggle };
144
+ export { Property, PropertyDescription, PropertyTitle, PropertyToggle };
@@ -1,15 +1,2 @@
1
- import { h as Resource } from "../index-pvh-w1xa.js";
2
- import * as react_jsx_runtime0 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_runtime0.JSX.Element;
14
- //#endregion
1
+ import { n as SDKSidebarProps, t as SDKSidebar } from "../sdk-sidebar-BpDlOMat.js";
15
2
  export { SDKSidebar, SDKSidebarProps };
@@ -1,4 +1,4 @@
1
- import "../use-strict-context-Clb6Yjly.js";
1
+ import "../component-generics-DYxBWv1v.js";
2
2
  import { useNavigation } from "../contexts/navigation.js";
3
3
  import "../contexts/index.js";
4
4
  import { isResourceEmpty } from "../utils.js";
@@ -6,7 +6,6 @@ import { StlSidebar } from "./stl-sidebar.js";
6
6
  import * as React$1 from "react";
7
7
  import { jsx } from "react/jsx-runtime";
8
8
  import { Badge, getHttpMethod } from "@stainless-api/ui-primitives";
9
-
10
9
  //#region src/components/sdk-sidebar.tsx
11
10
  function resourceToEntry(resource, selectedPath) {
12
11
  const result = {
@@ -47,6 +46,5 @@ function SDKSidebar({ resources }) {
47
46
  const { selectedPath } = useNavigation();
48
47
  return /* @__PURE__ */ jsx(StlSidebar, { entries: React$1.useMemo(() => resources.filter((resource) => !isResourceEmpty(resource)).map((resource) => resourceToEntry(resource, selectedPath)), [resources, selectedPath]) });
49
48
  }
50
-
51
49
  //#endregion
52
- export { SDKSidebar };
50
+ export { SDKSidebar };
@@ -1,128 +1,2 @@
1
- import { _ as SnippetLanguage, c as ID, d as Method, f as Model, o as HasStainlessPath, t as BaseDeclaration } from "../index-pvh-w1xa.js";
2
- import { DocsLanguage } from "../routing.js";
3
- import * as React$1 from "react";
4
- import * as react_jsx_runtime0 from "react/jsx-runtime";
5
-
6
- //#region src/components/sdk.d.ts
7
- type PropertyModelContextType = {
8
- modelPath?: string;
9
- propertyPath?: string;
10
- };
11
- declare const PropertyModelContext: React$1.Context<PropertyModelContextType>;
12
- declare function usePropertyModel(): PropertyModelContextType;
13
- type ReferenceNestingContextType = string[];
14
- declare const ReferenceNestingContext: React$1.Context<ReferenceNestingContextType>;
15
- declare function useReferenceNesting(): ReferenceNestingContextType;
16
- type DeclarationParentsContextType = ReadonlySet<string>;
17
- declare function useDeclarationParents(): DeclarationParentsContextType;
18
- type SDKSnippetLanguagesType = Record<SnippetLanguage, {
19
- name: string;
20
- }>;
21
- declare const SDKSnippetLanguages: SDKSnippetLanguagesType;
22
- type TransformRequestSnippetFn = ({
23
- snippet,
24
- language
25
- }: {
26
- snippet: string;
27
- language: DocsLanguage;
28
- }) => string;
29
- type SDKChildrenProps = {
30
- paths: ID[];
31
- expand?: boolean;
32
- depth?: number;
33
- };
34
- declare function SDKChildren({
35
- paths,
36
- expand,
37
- depth
38
- }: SDKChildrenProps): react_jsx_runtime0.JSX.Element;
39
- type SDKDeclarationProps = {
40
- path: string;
41
- expand?: boolean;
42
- depth?: number;
43
- };
44
- declare function SDKDeclaration({
45
- path,
46
- expand,
47
- depth
48
- }: SDKDeclarationProps): react_jsx_runtime0.JSX.Element;
49
- type SDKConstraintsProps = {
50
- constraints?: Record<string, unknown>;
51
- };
52
- declare function SDKConstraints({
53
- constraints
54
- }: SDKConstraintsProps): react_jsx_runtime0.JSX.Element | undefined;
55
- type SDKIconProps = {
56
- language: SnippetLanguage;
57
- size?: number;
58
- };
59
- declare function SDKIcon({
60
- language
61
- }: SDKIconProps): react_jsx_runtime0.JSX.Element | null;
62
- type SDKRequestTitleProps = {
63
- snippetLanguage: SnippetLanguage;
64
- };
65
- declare function SDKRequestTitle({
66
- snippetLanguage
67
- }: SDKRequestTitleProps): react_jsx_runtime0.JSX.Element;
68
- type SDKExampleProps = {
69
- method: Partial<Method> & HasStainlessPath;
70
- transformRequestSnippet?: TransformRequestSnippetFn;
71
- };
72
- declare function SDKExample({
73
- method,
74
- transformRequestSnippet
75
- }: SDKExampleProps): react_jsx_runtime0.JSX.Element;
76
- type SDKMethodProps = {
77
- method: Method;
78
- transformRequestSnippet?: TransformRequestSnippetFn;
79
- };
80
- declare function SDKMethodHeader({
81
- method
82
- }: SDKMethodProps): react_jsx_runtime0.JSX.Element;
83
- declare function useStreamingResponse(method: BaseDeclaration): ID | undefined;
84
- declare function SDKMethodInfo({
85
- method,
86
- children
87
- }: SDKMethodProps & {
88
- children?: React$1.ReactNode;
89
- }): react_jsx_runtime0.JSX.Element;
90
- declare function SDKMethodNotImplemented({
91
- method
92
- }: SDKMethodProps): react_jsx_runtime0.JSX.Element;
93
- declare function SDKMethodInfoContent(_props: SDKMethodProps): React$1.ReactNode;
94
- declare function SDKMethod({
95
- method,
96
- transformRequestSnippet
97
- }: SDKMethodProps): react_jsx_runtime0.JSX.Element;
98
- type SDKModelProps = {
99
- model: Model;
100
- };
101
- declare function SDKModel({
102
- model
103
- }: SDKModelProps): react_jsx_runtime0.JSX.Element | null;
104
- type SDKReferenceProps = {
105
- stainlessPath: string;
106
- children?: React$1.ReactNode;
107
- };
108
- declare function SDKReference({
109
- stainlessPath,
110
- children
111
- }: SDKReferenceProps): string | number | bigint | boolean | Iterable<React$1.ReactNode> | Promise<string | number | bigint | boolean | React$1.ReactPortal | React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | Iterable<React$1.ReactNode> | null | undefined> | react_jsx_runtime0.JSX.Element | null | undefined;
112
- type SDKLanguageBlockProps = {
113
- language: DocsLanguage;
114
- version: string;
115
- install: string;
116
- links: {
117
- repo: string;
118
- docs: string;
119
- };
120
- };
121
- declare function SDKLanguageBlock({
122
- language,
123
- version,
124
- install,
125
- links
126
- }: SDKLanguageBlockProps): react_jsx_runtime0.JSX.Element;
127
- //#endregion
1
+ import { A as useStreamingResponse, C as SDKRequestTitleProps, D as useDeclarationParents, E as TransformRequestSnippetFn, O as usePropertyModel, S as SDKRequestTitle, T as SDKSnippetLanguagesType, _ as SDKMethodNotImplemented, a as ReferenceNestingContextType, b as SDKModelProps, c as SDKConstraintsProps, d as SDKIcon, f as SDKLanguageBlock, g as SDKMethodInfoContent, h as SDKMethodInfo, i as ReferenceNestingContext, k as useReferenceNesting, l as SDKDeclaration, m as SDKMethodHeader, n as PropertyModelContext, o as SDKChildren, p as SDKMethod, r as PropertyModelContextType, s as SDKConstraints, t as DeclarationParentsContextType, u as SDKExample, v as SDKMethodProps, w as SDKSnippetLanguages, x as SDKReference, y as SDKModel } from "../sdk-Cx2Z7bDk.js";
128
2
  export { DeclarationParentsContextType, PropertyModelContext, PropertyModelContextType, ReferenceNestingContext, ReferenceNestingContextType, SDKChildren, SDKConstraints, SDKConstraintsProps, SDKDeclaration, SDKExample, SDKIcon, SDKLanguageBlock, SDKMethod, SDKMethodHeader, SDKMethodInfo, SDKMethodInfoContent, SDKMethodNotImplemented, SDKMethodProps, SDKModel, SDKModelProps, SDKReference, SDKRequestTitle, SDKRequestTitleProps, SDKSnippetLanguages, SDKSnippetLanguagesType, TransformRequestSnippetFn, useDeclarationParents, usePropertyModel, useReferenceNesting, useStreamingResponse };
@@ -1,5 +1,5 @@
1
1
  import { useAvailableLanguages, useContentPanelLayout, useDeclaration, useLanguage, useSettings, useSnippetIds, useSnippetResponse, useSpec } from "../contexts/docs.js";
2
- import "../use-strict-context-Clb6Yjly.js";
2
+ import "../component-generics-DYxBWv1v.js";
3
3
  import { useNavigation } from "../contexts/navigation.js";
4
4
  import { useLanguageComponents } from "../contexts/index.js";
5
5
  import { useComponents } from "../contexts/use-components.js";
@@ -11,7 +11,6 @@ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
11
11
  import clsx from "clsx";
12
12
  import { BookOpen, Copy, Github } from "lucide-react";
13
13
  import { Button, Callout } from "@stainless-api/ui-primitives";
14
-
15
14
  //#region src/components/sdk.tsx
16
15
  const PropertyModelContext = React$1.createContext({});
17
16
  function usePropertyModel() {
@@ -164,7 +163,7 @@ function SDKDeclaration({ path, expand, depth = 0 }) {
164
163
  const parsedPath = selectedPath ? parseStainlessPath(selectedPath) : null;
165
164
  const modelPropSetting = settings?.properties?.includeModelProperties;
166
165
  const inlineModelProps = modelPropSetting === "method-page" ? Boolean(parsedPath?.method) : modelPropSetting !== false;
167
- const isUnion = "childrenParentSchema" in decl && decl.childrenParentSchema && decl.kind !== "CLIFlag" && decl.kind !== "CLISchemaProperty" && ["enum", "union"].includes(decl.childrenParentSchema);
166
+ const isUnion = "childrenParentSchema" in decl && !!decl.childrenParentSchema && decl.kind !== "CLIFlag" && decl.kind !== "CLISchemaProperty" && ["enum", "union"].includes(decl.childrenParentSchema);
168
167
  const id = model?.propertyPath ? `${model.propertyPath} + ${path}` : path;
169
168
  const shouldExpand = selectedPath?.startsWith(path) && nesting.length < 1 || settings?.properties?.expandDepth && depth <= settings?.properties?.expandDepth && !isUnion || expand;
170
169
  const hasChildren = "children" in decl && (decl.children?.length ?? 0) > 0 && !decl.children?.includes(path) && !(isUnion && decl.childrenParentSchema === "enum" && decl.children?.length === 1) && (inlineModelProps || !("modelPath" in decl));
@@ -482,6 +481,5 @@ function SDKLanguageBlock({ language, version, install, links }) {
482
481
  ]
483
482
  });
484
483
  }
485
-
486
484
  //#endregion
487
- export { PropertyModelContext, ReferenceNestingContext, SDKChildren, SDKConstraints, SDKDeclaration, SDKExample, SDKIcon, SDKLanguageBlock, SDKMethod, SDKMethodHeader, SDKMethodInfo, SDKMethodInfoContent, SDKMethodNotImplemented, SDKModel, SDKReference, SDKRequestTitle, SDKSnippetLanguages, useDeclarationParents, usePropertyModel, useReferenceNesting, useStreamingResponse };
485
+ export { PropertyModelContext, ReferenceNestingContext, SDKChildren, SDKConstraints, SDKDeclaration, SDKExample, SDKIcon, SDKLanguageBlock, SDKMethod, SDKMethodHeader, SDKMethodInfo, SDKMethodInfoContent, SDKMethodNotImplemented, SDKModel, SDKReference, SDKRequestTitle, SDKSnippetLanguages, useDeclarationParents, usePropertyModel, useReferenceNesting, useStreamingResponse };
@@ -1,71 +1,2 @@
1
- import { d as Method, o as HasStainlessPath } from "../index-pvh-w1xa.js";
2
- import { TransformRequestSnippetFn } from "./sdk.js";
3
- import { useSnippet } from "../contexts/docs.js";
4
- import "../contexts/index.js";
5
- import * as React$1 from "react";
6
- import * as react_jsx_runtime0 from "react/jsx-runtime";
7
-
8
- //#region src/components/snippets.d.ts
9
- type SnippetCodeProps = {
10
- content: string;
11
- signature?: string;
12
- language?: string;
13
- };
14
- declare function SnippetCode({
15
- content,
16
- language
17
- }: SnippetCodeProps): react_jsx_runtime0.JSX.Element;
18
- type SnippetContainerProps = {
19
- method: Partial<Method> & HasStainlessPath;
20
- children: React$1.ReactNode;
21
- signature?: string;
22
- } & React$1.ComponentProps<'div'>;
23
- declare function SnippetContainer({
24
- children,
25
- className,
26
- ...props
27
- }: SnippetContainerProps): react_jsx_runtime0.JSX.Element;
28
- type SnippetRequestContainerProps = {
29
- children?: React$1.ReactNode;
30
- signature?: string;
31
- };
32
- declare function SnippetRequestContainer({
33
- children
34
- }: SnippetRequestContainerProps): react_jsx_runtime0.JSX.Element;
35
- type SnippetProps = {
36
- requestTitle?: React$1.ReactNode;
37
- method: Partial<Method> & HasStainlessPath;
38
- snippet?: Parameters<typeof useSnippet>[2];
39
- transformRequestSnippet?: TransformRequestSnippetFn;
40
- };
41
- declare function Snippet({
42
- requestTitle,
43
- method,
44
- snippet,
45
- transformRequestSnippet
46
- }: SnippetProps): react_jsx_runtime0.JSX.Element | null;
47
- type MultiSnippetsProps = {
48
- method: Partial<Method> & HasStainlessPath;
49
- requestTitle?: React$1.ReactNode;
50
- };
51
- declare function MultiSnippets({
52
- requestTitle,
53
- method
54
- }: MultiSnippetsProps): react_jsx_runtime0.JSX.Element | null;
55
- declare function SnippetButtons({
56
- content
57
- }: {
58
- content: string;
59
- }): react_jsx_runtime0.JSX.Element;
60
- declare function SnippetFooter(): React$1.ReactNode;
61
- declare function SnippetResponse({
62
- responses
63
- }: {
64
- responses?: {
65
- status?: string;
66
- content: string;
67
- contentType?: string;
68
- }[];
69
- }): react_jsx_runtime0.JSX.Element | null;
70
- //#endregion
1
+ import { a as SnippetButtons, c as SnippetContainer, d as SnippetProps, f as SnippetRequestContainer, i as Snippet, l as SnippetContainerProps, m as SnippetResponse, n as MultiSnippets, o as SnippetCode, p as SnippetRequestContainerProps, r as MultiSnippetsProps, s as SnippetCodeProps, u as SnippetFooter } from "../index-uRQlPa4x.js";
71
2
  export { MultiSnippets, MultiSnippetsProps, Snippet, SnippetButtons, SnippetCode, SnippetCodeProps, SnippetContainer, SnippetContainerProps, SnippetFooter, SnippetProps, SnippetRequestContainer, SnippetRequestContainerProps, SnippetResponse };
@@ -1,15 +1,14 @@
1
1
  import { useDeclaration, useLanguage, useSnippet, useSnippetIds, useSnippetResponse } from "../contexts/docs.js";
2
- import "../use-strict-context-Clb6Yjly.js";
2
+ import "../component-generics-DYxBWv1v.js";
3
3
  import { useHighlight } from "../contexts/markdown.js";
4
4
  import "../contexts/index.js";
5
5
  import { useComponents } from "../contexts/use-components.js";
6
6
  import style_default from "../style.js";
7
- import * as React$1 from "react";
7
+ import { useCallback, useId, useRef, useState } from "react";
8
8
  import { jsx, jsxs } from "react/jsx-runtime";
9
9
  import clsx from "clsx";
10
10
  import { CheckIcon, CircleAlertIcon, CopyIcon } from "lucide-react";
11
11
  import { Badge, Button, getHttpMethod } from "@stainless-api/ui-primitives";
12
-
13
12
  //#region src/components/snippets.tsx
14
13
  function SnippetCode({ content, language }) {
15
14
  const lang = useLanguage();
@@ -84,7 +83,7 @@ function Snippet({ requestTitle, method, snippet, transformRequestSnippet }) {
84
83
  }
85
84
  function MultiSnippets({ requestTitle, method }) {
86
85
  const snippetIds = useSnippetIds(method.stainlessPath)?.filter((id) => id !== "default");
87
- const radioId = React$1.useId();
86
+ const radioId = useId();
88
87
  const Docs = useComponents();
89
88
  if (!snippetIds) return null;
90
89
  return /* @__PURE__ */ jsxs("div", {
@@ -119,16 +118,18 @@ function MultiSnippets({ requestTitle, method }) {
119
118
  });
120
119
  }
121
120
  function SnippetButtons({ content }) {
122
- const [CopyButtonIcon, setCopyIcon] = React$1.useState(CopyIcon);
123
- async function handleCopy() {
124
- try {
125
- await navigator.clipboard.writeText(content);
126
- setCopyIcon(CheckIcon);
127
- } catch {
128
- setCopyIcon(CircleAlertIcon);
129
- }
130
- setTimeout(() => setCopyIcon(CopyIcon), 1e3);
131
- }
121
+ const [CopyButtonIcon, setCopyButtonIcon] = useState(CopyIcon);
122
+ const timeoutRef = useRef(null);
123
+ const handleCopy = useCallback(() => {
124
+ if (timeoutRef.current) clearTimeout(timeoutRef.current);
125
+ navigator.clipboard.writeText(content).then(() => {
126
+ setCopyButtonIcon(CheckIcon);
127
+ }).catch(() => {
128
+ setCopyButtonIcon(CircleAlertIcon);
129
+ }).finally(() => {
130
+ timeoutRef.current = setTimeout(() => setCopyButtonIcon(CopyIcon), 1e3);
131
+ });
132
+ }, [content]);
132
133
  return /* @__PURE__ */ jsx(Button, {
133
134
  variant: "outline",
134
135
  "data-stldocs-snippet-copy": true,
@@ -179,6 +180,5 @@ function SnippetResponse({ responses }) {
179
180
  })
180
181
  });
181
182
  }
182
-
183
183
  //#endregion
184
- export { MultiSnippets, Snippet, SnippetButtons, SnippetCode, SnippetContainer, SnippetFooter, SnippetRequestContainer, SnippetResponse };
184
+ export { MultiSnippets, Snippet, SnippetButtons, SnippetCode, SnippetContainer, SnippetFooter, SnippetRequestContainer, SnippetResponse };
@@ -1,58 +1,2 @@
1
- import { ReactNode } from "react";
2
- import * as react_jsx_runtime0 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_runtime0.JSX.Element;
57
- //#endregion
1
+ import { a as StlSidebarProps, i as StlSidebarLink, n as StlSidebarEntry, o as StlSidebarTarget, r as StlSidebarGroup, t as StlSidebar } from "../stl-sidebar-CKrR5ZGs.js";
58
2
  export { StlSidebar, StlSidebarEntry, StlSidebarGroup, StlSidebarLink, StlSidebarProps, StlSidebarTarget };
@@ -1,10 +1,9 @@
1
- import "../use-strict-context-Clb6Yjly.js";
1
+ import "../component-generics-DYxBWv1v.js";
2
2
  import { useComponents } from "../contexts/use-components.js";
3
3
  import style_default from "../style.js";
4
4
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
5
  import clsx from "clsx";
6
6
  import { ChevronRight } from "lucide-react";
7
-
8
7
  //#region src/components/stl-sidebar.tsx
9
8
  function targetToAttributes(target) {
10
9
  return {
@@ -109,6 +108,5 @@ function isAnyItemCurrent(entries) {
109
108
  for (const e of walkSidebar(entries)) if (e.isCurrent) return true;
110
109
  return false;
111
110
  }
112
-
113
111
  //#endregion
114
- export { StlSidebar };
112
+ export { StlSidebar };
@@ -1,30 +1,2 @@
1
- import * as React$1 from "react";
2
- import * as react_jsx_runtime0 from "react/jsx-runtime";
3
-
4
- //#region src/contexts/component-generics.d.ts
5
- type DeepPartialMap<L> = { [K in keyof L]?: Partial<L[K]> };
6
- type ComponentsContextType<C, L> = {
7
- components: C;
8
- language: L;
9
- };
10
- declare const useComponentContext: () => ComponentsContextType<any, any>;
11
- declare function useComponents<C = unknown>(): C;
12
- declare function customizeComponents<C, L>(defaults: {
13
- components: C;
14
- language: L;
15
- }, overrides?: {
16
- components?: Partial<C>;
17
- language?: DeepPartialMap<L>;
18
- }): {
19
- components: C;
20
- language: L;
21
- };
22
- declare function ComponentProvider<C, L>({
23
- value,
24
- children
25
- }: {
26
- value: ComponentsContextType<C, L>;
27
- children: React$1.ReactNode;
28
- }): react_jsx_runtime0.JSX.Element;
29
- //#endregion
1
+ import { a as useComponents, i as useComponentContext, n as ComponentsContextType, r as customizeComponents, t as ComponentProvider } from "../component-generics-q-ujwX4P.js";
30
2
  export { ComponentProvider, ComponentsContextType, customizeComponents, useComponentContext, useComponents };
@@ -1,33 +1,2 @@
1
- import { t as createStrictContext } from "../use-strict-context-Clb6Yjly.js";
2
- import "react";
3
- import { jsx } from "react/jsx-runtime";
4
-
5
- //#region src/contexts/component-generics.tsx
6
- const [Provider, useComponentContext] = createStrictContext("Component");
7
- function useComponents() {
8
- return useComponentContext().components;
9
- }
10
- function customizeComponents(defaults, overrides = {}) {
11
- return {
12
- components: {
13
- ...defaults.components,
14
- ...overrides.components ?? {}
15
- },
16
- language: Object.keys(defaults.language).reduce((acc, key) => {
17
- acc[key] = {
18
- ...defaults.language[key],
19
- ...overrides.language?.[key] ?? {}
20
- };
21
- return acc;
22
- }, {})
23
- };
24
- }
25
- function ComponentProvider({ value, children }) {
26
- return /* @__PURE__ */ jsx(Provider, {
27
- value,
28
- children
29
- });
30
- }
31
-
32
- //#endregion
33
- export { ComponentProvider, customizeComponents, useComponentContext, useComponents };
1
+ import { i as useComponents, n as customizeComponents, r as useComponentContext, t as ComponentProvider } from "../component-generics-DYxBWv1v.js";
2
+ export { ComponentProvider, customizeComponents, useComponentContext, useComponents };
@@ -1,8 +1,6 @@
1
- import { t as index_d_exports } from "../languages/index.js";
2
- import { t as index_d_exports$1 } from "../components/index.js";
3
-
1
+ import { t as index_d_exports, y as index_d_exports$1 } from "../index-uRQlPa4x.js";
4
2
  //#region src/contexts/component-types.d.ts
5
- type AppComponents = typeof index_d_exports$1;
6
- type AppLanguage = typeof index_d_exports;
3
+ type AppComponents = typeof index_d_exports;
4
+ type AppLanguage = typeof index_d_exports$1;
7
5
  //#endregion
8
6
  export { AppComponents, AppLanguage };