@doccov/ui 0.2.1

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.
@@ -0,0 +1,234 @@
1
+ import { AnnotationHandler } from "codehike/code";
2
+ declare const callout: AnnotationHandler;
3
+ import { AnnotationHandler as AnnotationHandler2, RawCode } from "codehike/code";
4
+ type CodeOptions = {
5
+ copyButton?: boolean;
6
+ lineNumbers?: boolean;
7
+ wordWrap?: boolean;
8
+ animate?: boolean;
9
+ };
10
+ type CodeInfo = {
11
+ storage?: string;
12
+ options: CodeOptions;
13
+ tabs: {
14
+ options: CodeOptions;
15
+ title: string;
16
+ code: string;
17
+ pre: React.ReactNode;
18
+ icon: React.ReactNode;
19
+ lang: string;
20
+ }[];
21
+ };
22
+ declare const theme = "github-from-css";
23
+ /**
24
+ * Convert flags string to options object.
25
+ *
26
+ * @example
27
+ * flagsToOptions("na") // { lineNumbers: true, animate: true }
28
+ * flagsToOptions("c") // { copyButton: true }
29
+ */
30
+ declare function flagsToOptions(flags?: string);
31
+ declare function DocsKitCode(props: {
32
+ codeblock: RawCode;
33
+ handlers?: AnnotationHandler2[];
34
+ className?: string;
35
+ });
36
+ declare function SingleCode(props: {
37
+ group: CodeInfo;
38
+ className?: string;
39
+ });
40
+ declare function toCodeGroup(props: {
41
+ codeblocks: RawCode[];
42
+ flags?: string;
43
+ storage?: string;
44
+ handlers?: AnnotationHandler2[];
45
+ }): Promise<CodeInfo>;
46
+ declare function MultiCode({ group, className }: {
47
+ group: CodeInfo;
48
+ className?: string;
49
+ });
50
+ import { AnnotationHandler as AnnotationHandler3, RawCode as RawCode2 } from "codehike/code";
51
+ /**
52
+ * Client-side code block with syntax highlighting.
53
+ * Highlights code in useEffect to avoid SSR memory issues.
54
+ */
55
+ declare function ClientDocsKitCode(props: {
56
+ codeblock: RawCode2;
57
+ handlers?: AnnotationHandler3[];
58
+ className?: string;
59
+ });
60
+ /**
61
+ * Client-side terminal-style code block.
62
+ */
63
+ declare function ClientTerminal(props: {
64
+ codeblock: RawCode2;
65
+ handlers?: AnnotationHandler3[];
66
+ });
67
+ /**
68
+ * Client-side inline code with syntax highlighting.
69
+ */
70
+ declare function ClientInlineCode({ codeblock }: {
71
+ codeblock: RawCode2;
72
+ });
73
+ /**
74
+ * Client-side code tabs with multiple files.
75
+ */
76
+ declare function ClientCode(props: {
77
+ codeblocks: RawCode2[];
78
+ flags?: string;
79
+ storage?: string;
80
+ });
81
+ declare function CopyButton({ text, className, variant }: {
82
+ text: string;
83
+ className?: string;
84
+ variant?: "floating" | "inline";
85
+ });
86
+ import { AnnotationHandler as AnnotationHandler4, RawCode as RawCode3 } from "codehike/code";
87
+ interface DiffStats {
88
+ additions?: number;
89
+ deletions?: number;
90
+ }
91
+ interface ClientDiffCodeProps {
92
+ codeblock: RawCode3;
93
+ /** Full file path (e.g., "src/components/") */
94
+ path?: string;
95
+ /** Filename (e.g., "index.ts") - if not provided, extracted from codeblock meta */
96
+ filename?: string;
97
+ /** Diff statistics */
98
+ diff?: DiffStats;
99
+ /** Extra annotation handlers */
100
+ handlers?: AnnotationHandler4[];
101
+ /** Wrapper className */
102
+ className?: string;
103
+ /** Start collapsed */
104
+ defaultOpen?: boolean;
105
+ }
106
+ /**
107
+ * DocKit code block variant with file change row header.
108
+ * Displays path/filename with diff stats, collapsible with syntax-highlighted code.
109
+ */
110
+ declare function ClientDiffCode(props: ClientDiffCodeProps);
111
+ declare function CodeIcon({ title, lang, className }: {
112
+ title: string;
113
+ lang: string;
114
+ className?: string;
115
+ });
116
+ import { RawCode as RawCode4 } from "codehike/code";
117
+ declare function DocsKitInlineCode({ codeblock }: {
118
+ codeblock: RawCode4;
119
+ });
120
+ type PackageManager = "npm" | "bun" | "pnpm" | "yarn";
121
+ interface PackageInstallProps {
122
+ /** The package name to install */
123
+ package: string;
124
+ /** Whether this is a dev dependency */
125
+ dev?: boolean;
126
+ /** Whether this is a global install */
127
+ global?: boolean;
128
+ /** Which package managers to show (defaults to all) */
129
+ managers?: PackageManager[];
130
+ /** Whether to show the copy button */
131
+ copyButton?: boolean;
132
+ }
133
+ /**
134
+ * Package installation command with tabs for different package managers.
135
+ *
136
+ * @example
137
+ * ```tsx
138
+ * <PackageInstall package="@doccov/ui" />
139
+ * <PackageInstall package="typescript" dev />
140
+ * <PackageInstall package="opencode-ai" global />
141
+ * ```
142
+ */
143
+ declare function PackageInstall({ package: pkg, dev, global: isGlobal, managers, copyButton }: PackageInstallProps);
144
+ /**
145
+ * Loading skeleton for code blocks.
146
+ */
147
+ declare function CodeBlockSkeleton({ hasTitle, lines }: {
148
+ hasTitle?: boolean;
149
+ lines?: number;
150
+ });
151
+ /**
152
+ * Loading skeleton for terminal-style code blocks.
153
+ */
154
+ declare function TerminalSkeleton({ lines }: {
155
+ lines?: number;
156
+ });
157
+ /**
158
+ * Loading skeleton for inline code.
159
+ */
160
+ declare function InlineCodeSkeleton();
161
+ /**
162
+ * Loading skeleton for code tabs.
163
+ */
164
+ declare function CodeTabsSkeleton({ tabs, lines }: {
165
+ tabs?: number;
166
+ lines?: number;
167
+ });
168
+ import { RawCode as RawCode5 } from "codehike/code";
169
+ declare function CodeGroup(props: unknown);
170
+ declare function Code(props: {
171
+ codeblocks: RawCode5[];
172
+ flags?: string;
173
+ storage?: string;
174
+ });
175
+ import { AnnotationHandler as AnnotationHandler5, RawCode as RawCode6 } from "codehike/code";
176
+ /**
177
+ * Terminal-style code block with macOS window controls.
178
+ *
179
+ * @example
180
+ * ```tsx
181
+ * <Terminal
182
+ * codeblock={{
183
+ * value: "npm install @opencode-ai/sdk",
184
+ * lang: "bash",
185
+ * meta: "-c",
186
+ * }}
187
+ * />
188
+ * ```
189
+ */
190
+ declare function Terminal(props: {
191
+ codeblock: RawCode6;
192
+ handlers?: AnnotationHandler5[];
193
+ });
194
+ declare const collapse: unknown;
195
+ import { AnnotationHandler as AnnotationHandler6 } from "codehike/code";
196
+ declare const diff: AnnotationHandler6;
197
+ import React2 from "react";
198
+ declare function addDocsKit<T extends Record<string, React2.ElementType | string>>(components: T): T;
199
+ import { AnnotationHandler as AnnotationHandler7 } from "codehike/code";
200
+ declare const expandable: AnnotationHandler7;
201
+ import { AnnotationHandler as AnnotationHandler8 } from "codehike/code";
202
+ import React3 from "react";
203
+ declare function WithHover(props: {
204
+ children: React3.ReactNode;
205
+ });
206
+ declare function HoverLink(props: {
207
+ href?: string;
208
+ children?: React3.ReactNode;
209
+ });
210
+ declare const hover: AnnotationHandler8;
211
+ import { AnnotationHandler as AnnotationHandler9 } from "codehike/code";
212
+ declare const lineNumbers2: AnnotationHandler9;
213
+ import { AnnotationHandler as AnnotationHandler10 } from "codehike/code";
214
+ declare const link: AnnotationHandler10;
215
+ import { AnnotationHandler as AnnotationHandler11 } from "codehike/code";
216
+ declare const mark: AnnotationHandler11;
217
+ declare function WithNotes({ children,...rest }: {
218
+ children: React.ReactNode;
219
+ });
220
+ import * as TabsPrimitive from "@radix-ui/react-tabs";
221
+ import * as React4 from "react";
222
+ declare function Tabs({ className,...props }: React4.ComponentProps<typeof TabsPrimitive.Root>);
223
+ declare function TabsList({ className,...props }: React4.ComponentProps<typeof TabsPrimitive.List>);
224
+ declare function TabsTrigger({ className,...props }: React4.ComponentProps<typeof TabsPrimitive.Trigger>);
225
+ declare function TabsContent({ className,...props }: React4.ComponentProps<typeof TabsPrimitive.Content>);
226
+ import { AnnotationHandler as AnnotationHandler12 } from "codehike/code";
227
+ declare const tooltip: AnnotationHandler12;
228
+ declare function TooltipLink(props: {
229
+ href?: string;
230
+ children?: React.ReactNode;
231
+ });
232
+ import { AnnotationHandler as AnnotationHandler13 } from "codehike/code";
233
+ declare const wordWrap2: AnnotationHandler13;
234
+ export { wordWrap2 as wordWrap, tooltip, toCodeGroup, theme, mark, link, lineNumbers2 as lineNumbers, hover, flagsToOptions, expandable, diff, collapse, callout, addDocsKit, WithNotes, WithHover, TooltipLink, TerminalSkeleton, Terminal, TabsTrigger, TabsList, TabsContent, Tabs, SingleCode, PackageInstall, MultiCode, InlineCodeSkeleton, HoverLink, DocsKitInlineCode, DocsKitCode, DiffStats, CopyButton, CodeTabsSkeleton, CodeInfo, CodeIcon, CodeGroup, CodeBlockSkeleton, Code, ClientTerminal, ClientInlineCode, ClientDocsKitCode, ClientDiffCodeProps, ClientDiffCode, ClientCode };