@stainless-api/docs-ui 0.1.0-beta.7 → 0.1.0-beta.8

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stainless-api/docs-ui",
3
3
  "private": false,
4
- "version": "0.1.0-beta.7",
4
+ "version": "0.1.0-beta.8",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -20,7 +20,7 @@
20
20
  "lucide-react": "^0.544.0",
21
21
  "react": "^19.1.1",
22
22
  "react-dom": "^19.1.1",
23
- "@stainless-api/ui-primitives": "0.1.0-beta.8"
23
+ "@stainless-api/ui-primitives": "0.1.0-beta.9"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@types/node": "^24.4.0",
@@ -42,15 +42,17 @@ export function MethodIconBadge({ httpMethod, showName }: MethodIconProps) {
42
42
 
43
43
  export type MethodHeaderProps = {
44
44
  title: ReactNode;
45
+ level?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5';
45
46
  signature?: ReactNode;
46
47
  badges?: ReactNode;
47
48
  children?: ReactNode;
48
49
  };
49
50
 
50
- export function MethodHeader({ title, badges, signature, children }: MethodHeaderProps) {
51
+ export function MethodHeader({ title, badges, signature, children, level }: MethodHeaderProps) {
52
+ const Heading = level ?? 'h5';
51
53
  return (
52
54
  <div className={style.MethodHeader}>
53
- <h5 className={style.MethodTitle}>{title}</h5>
55
+ <Heading className={style.MethodTitle}>{title}</Heading>
54
56
  {badges && <div className={style.MethodBadges}>{badges}</div>}
55
57
  {signature}
56
58
  {children}
@@ -58,6 +58,7 @@ export function SDKMethodSummary({ method }: SDKMethodSummaryProps) {
58
58
 
59
59
  return (
60
60
  <Docs.MethodHeader
61
+ level="h5"
61
62
  title={<Docs.Link stainlessPath={method.stainlessPath}>{method.summary ?? method.title}</Docs.Link>}
62
63
  signature={<Lang.MethodSignature decl={decl} />}
63
64
  badges={method.deprecated && <Docs.Badge id="deprecated">Deprecated</Docs.Badge>}
@@ -243,6 +243,7 @@ export function SDKMethodHeader({ method }: SDKMethodProps) {
243
243
 
244
244
  return (
245
245
  <Docs.MethodHeader
246
+ level="h1"
246
247
  title={method.summary ?? method.title}
247
248
  signature={<Lang.MethodSignature decl={decl} />}
248
249
  badges={method.deprecated && <Docs.Badge id="deprecated">Deprecated</Docs.Badge>}
@@ -383,9 +384,9 @@ export function SDKLanguageBlock({ language, version, install, links }: SDKLangu
383
384
 
384
385
  <div className={style.LanguageBlockInstall} data-stldocs-copy-parent>
385
386
  <pre data-stldocs-copy-content>{install}</pre>{' '}
386
- <button data-stldocs-snippet-copy>
387
+ <Button variant="ghost" size="sm" data-stldocs-snippet-copy>
387
388
  <Copy size={16} className={style.Icon} />
388
- </button>
389
+ </Button>
389
390
  </div>
390
391
 
391
392
  <div className={style.LanguageBlockLinks}>
@@ -6,6 +6,7 @@ import style from '../style';
6
6
  import clsx from 'clsx';
7
7
  import type * as SDKJSON from '~/lib/json-spec-v2/types';
8
8
  import type { TransformRequestSnippetFn } from './sdk';
9
+ import { Button } from '@stainless-api/ui-primitives';
9
10
 
10
11
  export type SnippetCodeProps = {
11
12
  content: string;
@@ -90,9 +91,9 @@ export function Snippet({ requestTitle, method, transformRequestSnippet }: Snipp
90
91
  <h5>{method.summary}</h5>
91
92
  </div>
92
93
  <div className={style.SnippetRequestTitleContent}>{requestTitle}</div>
93
- <button data-stldocs-snippet-copy className={style.SnippetRequestTitleCopyButton}>
94
+ <Button variant="ghost" data-stldocs-snippet-copy>
94
95
  <CopyButtonIcon size={16} className={style.Icon} onClick={handleCopy} />
95
- </button>
96
+ </Button>
96
97
  </div>
97
98
  <Docs.SnippetCode content={snippet} signature={signature} />
98
99
  </div>
@@ -109,6 +109,7 @@ export function SearchResultContent({ result }: SearchResultProps) {
109
109
  return (
110
110
  <>
111
111
  <Docs.MethodHeader
112
+ level="h5"
112
113
  title={<Highlight result={result} name={result.summary ? 'summary' : 'title'} />}
113
114
  signature={result['qualified'] && <Highlight result={result} name={'qualified'} />}
114
115
  >
package/src/style.ts CHANGED
@@ -55,7 +55,6 @@ export default {
55
55
  SnippetRequestTitleLabel: 'stldocs-snippet-request-title-label',
56
56
  SnippetRequestTitleLanguage: 'stldocs-snippet-request-title-language',
57
57
  SnippetRequestTitleMethod: 'stldocs-snippet-request-title-method',
58
- SnippetRequestTitleCopyButton: 'stldocs-snippet-request-title-copy-button',
59
58
 
60
59
  SnippetResponse: 'stldocs-snippet-response',
61
60
  SnippetMultiResponse: 'stldocs-snippet-multi-response',