@clarify-labs/renderer 0.6.4 → 0.6.5
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/output/{OpenApiOperation-BI41nyGy.cjs → OpenApiOperation-CsDX1s-6.cjs} +867 -80
- package/output/OpenApiOperation-CsDX1s-6.cjs.map +1 -0
- package/output/{OpenApiOperation-DcK7Ekkx.js → OpenApiOperation-WntXLbai.js} +770 -73
- package/output/OpenApiOperation-WntXLbai.js.map +1 -0
- package/output/ThemeRoot-DXoVzHSZ.cjs +1800 -0
- package/output/ThemeRoot-DXoVzHSZ.cjs.map +1 -0
- package/output/ThemeRoot-Dr8JC8Yc.js +1757 -0
- package/output/ThemeRoot-Dr8JC8Yc.js.map +1 -0
- package/output/app/ErrorBoundary.d.ts +29 -0
- package/output/client.cjs +5 -1
- package/output/client.d.ts +2 -0
- package/output/client.js +3 -2
- package/output/core/i18n.d.ts +1 -1
- package/output/core/types.d.ts +30 -9
- package/output/index.cjs +41 -31
- package/output/index.cjs.map +1 -1
- package/output/index.d.ts +3 -1
- package/output/index.js +18 -11
- package/output/index.js.map +1 -1
- package/output/openapi/entry.d.ts +1 -0
- package/output/preview.cjs +4 -3
- package/output/preview.cjs.map +1 -1
- package/output/preview.js +4 -3
- package/output/preview.js.map +1 -1
- package/output/{render-CjZt3edL.cjs → render-BfNmzJeJ.cjs} +12 -8
- package/output/render-BfNmzJeJ.cjs.map +1 -0
- package/output/{render-BpavVnAe.js → render-DS2wcTZJ.js} +12 -8
- package/output/render-DS2wcTZJ.js.map +1 -0
- package/output/renderer.css +450 -565
- package/output/server.cjs +11 -7
- package/output/server.cjs.map +1 -1
- package/output/server.js +11 -7
- package/output/server.js.map +1 -1
- package/output/{shell-_MyLsMUI.cjs → shell-D4tS8Jts.cjs} +112 -1016
- package/output/shell-D4tS8Jts.cjs.map +1 -0
- package/output/{shell-BlMMdTpZ.js → shell-DvTfFx6M.js} +107 -933
- package/output/shell-DvTfFx6M.js.map +1 -0
- package/output/theme/ThemeEditor.d.ts +67 -0
- package/output/theme/ThemeProvider.d.ts +1 -1
- package/output/theme/ThemeRoot.d.ts +9 -0
- package/output/theme/randomTheme.d.ts +2 -0
- package/output/theme/variables.d.ts +62 -0
- package/package.json +1 -1
- package/output/AppShell-D3FsVHQK.js +0 -390
- package/output/AppShell-D3FsVHQK.js.map +0 -1
- package/output/AppShell-DeaJ-rgo.cjs +0 -409
- package/output/AppShell-DeaJ-rgo.cjs.map +0 -1
- package/output/OpenApiOperation-BI41nyGy.cjs.map +0 -1
- package/output/OpenApiOperation-DcK7Ekkx.js.map +0 -1
- package/output/render-BpavVnAe.js.map +0 -1
- package/output/render-CjZt3edL.cjs.map +0 -1
- package/output/shell-BlMMdTpZ.js.map +0 -1
- package/output/shell-_MyLsMUI.cjs.map +0 -1
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as useSectionStore, c as resolveLucideIconName, o as remToPx, s as lucideIconRegistry, v as copyTextToClipboard, y as useBuiltInText } from "./shell-DvTfFx6M.js";
|
|
2
2
|
import { t as markdownRemarkPlugins } from "./remark-o5sg9Ilv.js";
|
|
3
3
|
import clsx from "clsx";
|
|
4
|
-
import { createElement, useState } from "react";
|
|
4
|
+
import { Children, createContext, createElement, forwardRef, isValidElement, useContext, useEffect, useId, useLayoutEffect, useRef, useState } from "react";
|
|
5
5
|
import { Link } from "react-router-dom";
|
|
6
|
-
import { Listbox, ListboxButton, ListboxOption, ListboxOptions } from "@headlessui/react";
|
|
7
|
-
import { CheckIcon, ChevronDown, ChevronDownIcon, ChevronRight, ChevronsUpDownIcon, ClipboardIcon, CodeIcon, LockKeyholeIcon, PackageIcon, ServerIcon, UnlockKeyholeIcon } from "lucide-react";
|
|
6
|
+
import { Listbox, ListboxButton, ListboxOption, ListboxOptions, Tab, TabGroup, TabList, TabPanel, TabPanels, Transition } from "@headlessui/react";
|
|
7
|
+
import { AlertTriangle, ArrowRight, CheckCircle2, CheckIcon, ChevronDown, ChevronDownIcon, ChevronRight, ChevronsUpDownIcon, CircleCheck, Clipboard, ClipboardIcon, CodeIcon, Info, Lightbulb, LinkIcon, LockKeyholeIcon, PackageIcon, ServerIcon, UnlockKeyholeIcon, XCircle } from "lucide-react";
|
|
8
8
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { useInView } from "framer-motion";
|
|
10
|
+
import { create } from "zustand";
|
|
9
11
|
import ReactMarkdown from "react-markdown";
|
|
10
12
|
import { slug } from "github-slugger";
|
|
11
13
|
import { snippetz } from "@scalar/snippetz";
|
|
@@ -21,6 +23,729 @@ var __exportAll = (all, no_symbols) => {
|
|
|
21
23
|
return target;
|
|
22
24
|
};
|
|
23
25
|
//#endregion
|
|
26
|
+
//#region source/components/Button.tsx
|
|
27
|
+
var buttonVariantStyles = {
|
|
28
|
+
primary: "rounded-full bg-(--clarify-theme-tokens-colors-foreground) px-3 py-1 text-(--clarify-theme-tokens-colors-background) hover:opacity-80 dark:bg-(--clarify-theme-tokens-colors-primary)/10 dark:text-(--clarify-theme-tokens-colors-primary) dark:ring-1 dark:ring-inset dark:ring-(--clarify-theme-tokens-colors-primary)/20 dark:hover:opacity-80",
|
|
29
|
+
secondary: "rounded-full bg-(--clarify-theme-tokens-colors-code-background) px-3 py-1 text-(--clarify-ui-text-soft) ring-1 ring-inset ring-(--clarify-theme-tokens-colors-border) hover:bg-(--clarify-ui-hover-background) hover:text-(--clarify-theme-tokens-colors-foreground)",
|
|
30
|
+
filled: "rounded-full bg-(--clarify-theme-tokens-colors-foreground) px-3 py-1 text-(--clarify-theme-tokens-colors-background) hover:opacity-80 dark:bg-(--clarify-theme-tokens-colors-primary) dark:hover:opacity-80",
|
|
31
|
+
outline: "rounded-full px-3 py-1 text-(--clarify-ui-text-soft) ring-1 ring-inset ring-(--clarify-theme-tokens-colors-border) hover:bg-(--clarify-ui-hover-background) hover:text-(--clarify-theme-tokens-colors-foreground)",
|
|
32
|
+
text: "text-(--clarify-theme-tokens-colors-primary) hover:opacity-80 dark:text-(--clarify-theme-tokens-colors-primary) dark:hover:opacity-80"
|
|
33
|
+
};
|
|
34
|
+
function Button(arg0) {
|
|
35
|
+
const { variant = "primary", className, children, arrow, ...props } = arg0;
|
|
36
|
+
const classes = clsx("clarify-button inline-flex justify-center gap-0.5 overflow-hidden text-sm font-medium transition", buttonVariantStyles[variant], className);
|
|
37
|
+
const arrowIcon = /* @__PURE__ */ jsx(ArrowRight, { className: clsx("mt-0.5 h-5 w-5", variant === "text" && "relative top-px", arrow === "left" && "-ml-1 rotate-180", arrow === "right" && "-mr-1") });
|
|
38
|
+
const inner = /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
39
|
+
arrow === "left" ? arrowIcon : null,
|
|
40
|
+
children,
|
|
41
|
+
arrow === "right" ? arrowIcon : null
|
|
42
|
+
] });
|
|
43
|
+
if (typeof props.href === "undefined") return /* @__PURE__ */ jsx("button", {
|
|
44
|
+
className: classes,
|
|
45
|
+
...props,
|
|
46
|
+
children: inner
|
|
47
|
+
});
|
|
48
|
+
return /* @__PURE__ */ jsx("a", {
|
|
49
|
+
className: classes,
|
|
50
|
+
...props,
|
|
51
|
+
children: inner
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region source/components/Callout.tsx
|
|
56
|
+
var calloutStyles = {
|
|
57
|
+
info: {
|
|
58
|
+
container: "border-sky-500/20 bg-sky-50/50 text-sky-950 dark:border-sky-400/30 dark:bg-sky-400/5 dark:text-sky-100",
|
|
59
|
+
icon: "text-sky-600 dark:text-sky-400",
|
|
60
|
+
title: "text-sky-900 dark:text-sky-100",
|
|
61
|
+
Icon: Info
|
|
62
|
+
},
|
|
63
|
+
note: {
|
|
64
|
+
container: "border-zinc-500/20 bg-zinc-50 text-zinc-900 dark:border-white/10 dark:bg-white/5 dark:text-zinc-200",
|
|
65
|
+
icon: "text-zinc-500 dark:text-zinc-400",
|
|
66
|
+
title: "text-zinc-900 dark:text-white",
|
|
67
|
+
Icon: Info
|
|
68
|
+
},
|
|
69
|
+
tip: {
|
|
70
|
+
container: "border-emerald-500/20 bg-emerald-50/50 text-emerald-950 dark:border-emerald-400/30 dark:bg-emerald-400/5 dark:text-emerald-100",
|
|
71
|
+
icon: "text-emerald-600 dark:text-emerald-400",
|
|
72
|
+
title: "text-emerald-900 dark:text-emerald-100",
|
|
73
|
+
Icon: Lightbulb
|
|
74
|
+
},
|
|
75
|
+
warning: {
|
|
76
|
+
container: "border-amber-500/20 bg-amber-50/70 text-amber-950 dark:border-amber-400/30 dark:bg-amber-400/5 dark:text-amber-100",
|
|
77
|
+
icon: "text-amber-600 dark:text-amber-400",
|
|
78
|
+
title: "text-amber-900 dark:text-amber-100",
|
|
79
|
+
Icon: AlertTriangle
|
|
80
|
+
},
|
|
81
|
+
danger: {
|
|
82
|
+
container: "border-rose-500/20 bg-rose-50/70 text-rose-950 dark:border-rose-400/30 dark:bg-rose-400/5 dark:text-rose-100",
|
|
83
|
+
icon: "text-rose-600 dark:text-rose-400",
|
|
84
|
+
title: "text-rose-900 dark:text-rose-100",
|
|
85
|
+
Icon: XCircle
|
|
86
|
+
},
|
|
87
|
+
success: {
|
|
88
|
+
container: "border-emerald-500/20 bg-emerald-50/50 text-emerald-950 dark:border-emerald-400/30 dark:bg-emerald-400/5 dark:text-emerald-100",
|
|
89
|
+
icon: "text-emerald-600 dark:text-emerald-400",
|
|
90
|
+
title: "text-emerald-900 dark:text-emerald-100",
|
|
91
|
+
Icon: CheckCircle2
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
var defaultTitleKeys = {
|
|
95
|
+
info: "callout.info",
|
|
96
|
+
note: "callout.note",
|
|
97
|
+
tip: "callout.tip",
|
|
98
|
+
warning: "callout.warning",
|
|
99
|
+
danger: "callout.danger",
|
|
100
|
+
success: "callout.success"
|
|
101
|
+
};
|
|
102
|
+
function Callout(arg0) {
|
|
103
|
+
const { children, type = "info", title, icon = true, className, ...props } = arg0;
|
|
104
|
+
const t = useBuiltInText();
|
|
105
|
+
const style = calloutStyles[type];
|
|
106
|
+
const Icon = style.Icon;
|
|
107
|
+
const resolvedTitle = title === void 0 ? t(defaultTitleKeys[type]) : title;
|
|
108
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
109
|
+
className: clsx("clarify-callout my-6 flex gap-3 rounded-(--clarify-theme-tokens-radius-xl) border p-4 text-sm/6", style.container, className),
|
|
110
|
+
...props,
|
|
111
|
+
children: [icon ? /* @__PURE__ */ jsx(Icon, {
|
|
112
|
+
className: clsx("mt-1 size-4 flex-none", style.icon),
|
|
113
|
+
"aria-hidden": "true"
|
|
114
|
+
}) : null, /* @__PURE__ */ jsxs("div", {
|
|
115
|
+
className: "min-w-0 flex-1 *:first:mt-0 *:last:mb-0",
|
|
116
|
+
children: [resolvedTitle ? /* @__PURE__ */ jsx("p", {
|
|
117
|
+
className: clsx("mb-1 font-semibold", style.title),
|
|
118
|
+
children: resolvedTitle
|
|
119
|
+
}) : null, /* @__PURE__ */ jsx("div", {
|
|
120
|
+
className: "*:first:mt-0 *:last:mb-0",
|
|
121
|
+
children
|
|
122
|
+
})]
|
|
123
|
+
})]
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
//#endregion
|
|
127
|
+
//#region source/components/Card.tsx
|
|
128
|
+
function CardIcon(arg0) {
|
|
129
|
+
const { name } = arg0;
|
|
130
|
+
if (!name) return null;
|
|
131
|
+
const iconName = resolveLucideIconName(name);
|
|
132
|
+
if (!iconName) return null;
|
|
133
|
+
const Icon = lucideIconRegistry[iconName];
|
|
134
|
+
if (!Icon) return null;
|
|
135
|
+
return /* @__PURE__ */ jsx("span", {
|
|
136
|
+
className: "flex size-9 flex-none items-center justify-center rounded-(--clarify-theme-tokens-radius-lg) bg-(--clarify-ui-accent-background) text-(--clarify-ui-accent-text) ring-1 ring-(--clarify-ui-accent-border)",
|
|
137
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
138
|
+
className: "size-5",
|
|
139
|
+
"aria-hidden": "true"
|
|
140
|
+
})
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
var cardGroupColumnStyles = {
|
|
144
|
+
1: "grid-cols-1",
|
|
145
|
+
2: "grid-cols-1 sm:grid-cols-2",
|
|
146
|
+
3: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",
|
|
147
|
+
4: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4"
|
|
148
|
+
};
|
|
149
|
+
function CardGroup(arg0) {
|
|
150
|
+
const { children, cols = 2, className } = arg0;
|
|
151
|
+
return /* @__PURE__ */ jsx("div", {
|
|
152
|
+
className: clsx("not-prose my-10 grid gap-4", cardGroupColumnStyles[cols], className),
|
|
153
|
+
children
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
function Card(arg0) {
|
|
157
|
+
const { title, icon, href, children, className, ...props } = arg0;
|
|
158
|
+
const content = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("div", {
|
|
159
|
+
className: "flex items-start gap-4",
|
|
160
|
+
children: [/* @__PURE__ */ jsx(CardIcon, { name: icon }), /* @__PURE__ */ jsxs("div", {
|
|
161
|
+
className: "min-w-0 flex-1",
|
|
162
|
+
children: [/* @__PURE__ */ jsx("h3", {
|
|
163
|
+
className: "m-0 text-base font-semibold text-(--clarify-theme-tokens-colors-foreground)",
|
|
164
|
+
children: title
|
|
165
|
+
}), children ? /* @__PURE__ */ jsx("div", {
|
|
166
|
+
className: "mt-2 text-sm/6 text-(--clarify-ui-text-soft) *:m-0",
|
|
167
|
+
children
|
|
168
|
+
}) : null]
|
|
169
|
+
})]
|
|
170
|
+
}), href ? /* @__PURE__ */ jsx("span", {
|
|
171
|
+
className: "absolute inset-0 rounded-(--clarify-theme-tokens-radius-xl)",
|
|
172
|
+
"aria-hidden": "true"
|
|
173
|
+
}) : null] });
|
|
174
|
+
const classes = clsx("group relative block rounded-(--clarify-theme-tokens-radius-xl) border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) p-5 shadow-(--clarify-ui-accent-glow) transition hover:shadow-xs", className);
|
|
175
|
+
if (!href) return /* @__PURE__ */ jsx("div", {
|
|
176
|
+
className: classes,
|
|
177
|
+
children: content
|
|
178
|
+
});
|
|
179
|
+
if (href.startsWith("/") && !href.startsWith("//")) return /* @__PURE__ */ jsx(Link, {
|
|
180
|
+
to: href,
|
|
181
|
+
className: classes,
|
|
182
|
+
...props,
|
|
183
|
+
children: content
|
|
184
|
+
});
|
|
185
|
+
return /* @__PURE__ */ jsx("a", {
|
|
186
|
+
href,
|
|
187
|
+
className: classes,
|
|
188
|
+
...props,
|
|
189
|
+
children: content
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
//#endregion
|
|
193
|
+
//#region source/components/Code.tsx
|
|
194
|
+
var languageNames = {
|
|
195
|
+
js: "JavaScript",
|
|
196
|
+
ts: "TypeScript",
|
|
197
|
+
jsx: "React JSX",
|
|
198
|
+
tsx: "React TSX",
|
|
199
|
+
javascript: "JavaScript",
|
|
200
|
+
typescript: "TypeScript",
|
|
201
|
+
php: "PHP",
|
|
202
|
+
python: "Python",
|
|
203
|
+
ruby: "Ruby",
|
|
204
|
+
go: "Go",
|
|
205
|
+
bash: "Shell",
|
|
206
|
+
sh: "Shell",
|
|
207
|
+
shell: "Shell",
|
|
208
|
+
json: "JSON"
|
|
209
|
+
};
|
|
210
|
+
function getPanelTitle(arg0) {
|
|
211
|
+
const { title, language, fallbackTitle = "Code" } = arg0;
|
|
212
|
+
if (title) return title;
|
|
213
|
+
if (language && language in languageNames) return languageNames[language];
|
|
214
|
+
return fallbackTitle;
|
|
215
|
+
}
|
|
216
|
+
function getNodeText(node) {
|
|
217
|
+
if (typeof node === "string" || typeof node === "number") return String(node);
|
|
218
|
+
if (Array.isArray(node)) return node.map(getNodeText).join("");
|
|
219
|
+
if (isValidElement(node)) return getNodeText(node.props.children);
|
|
220
|
+
return "";
|
|
221
|
+
}
|
|
222
|
+
function CopyButton(arg0) {
|
|
223
|
+
const { code } = arg0;
|
|
224
|
+
const t = useBuiltInText();
|
|
225
|
+
const [copyCount, setCopyCount] = useState(0);
|
|
226
|
+
const copied = copyCount > 0;
|
|
227
|
+
useEffect(() => {
|
|
228
|
+
if (copyCount === 0) return void 0;
|
|
229
|
+
const timeout = window.setTimeout(() => setCopyCount(0), 1e3);
|
|
230
|
+
return () => window.clearTimeout(timeout);
|
|
231
|
+
}, [copyCount]);
|
|
232
|
+
if (!code) return null;
|
|
233
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
234
|
+
type: "button",
|
|
235
|
+
className: clsx("clarify-code-copy group/button absolute top-3.5 right-4 overflow-hidden rounded-full py-1 pr-3 pl-2 text-2xs font-medium opacity-0 backdrop-blur-sm transition group-hover:opacity-100 focus:opacity-100", copied ? "clarify-code-copy-copied" : "bg-white/5 hover:bg-white/7.5 dark:bg-white/2.5 dark:hover:bg-white/5"),
|
|
236
|
+
onClick: () => {
|
|
237
|
+
copyTextToClipboard(code).then((ok) => {
|
|
238
|
+
if (ok) setCopyCount((count) => count + 1);
|
|
239
|
+
});
|
|
240
|
+
},
|
|
241
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
242
|
+
"aria-hidden": copied,
|
|
243
|
+
className: clsx("pointer-events-none flex items-center gap-0.5 text-zinc-400 transition duration-300", copied && "-translate-y-1.5 opacity-0"),
|
|
244
|
+
children: [/* @__PURE__ */ jsx(Clipboard, { className: "h-5 w-5 stroke-zinc-500 transition-colors group-hover/button:stroke-zinc-400" }), t("actions.copy")]
|
|
245
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
246
|
+
"aria-hidden": !copied,
|
|
247
|
+
className: clsx("pointer-events-none absolute inset-0 flex items-center justify-center text-(--clarify-theme-tokens-colors-primary) transition duration-300", !copied && "translate-y-1.5 opacity-0"),
|
|
248
|
+
children: t("actions.copied")
|
|
249
|
+
})]
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
function CodePanelHeader(arg0) {
|
|
253
|
+
const { tag, label } = arg0;
|
|
254
|
+
if (!tag && !label) return null;
|
|
255
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
256
|
+
className: "clarify-code-panel-header flex h-9 items-center gap-2 border-y border-t-transparent border-b-white/7.5 bg-zinc-900 px-4 dark:border-b-white/5 dark:bg-white/1",
|
|
257
|
+
children: [
|
|
258
|
+
tag ? /* @__PURE__ */ jsx("span", {
|
|
259
|
+
className: "clarify-code-panel-tag font-semibold text-(--clarify-theme-tokens-colors-primary)",
|
|
260
|
+
children: tag
|
|
261
|
+
}) : null,
|
|
262
|
+
tag && label ? /* @__PURE__ */ jsx("span", { className: "h-0.5 w-0.5 rounded-full bg-zinc-500" }) : null,
|
|
263
|
+
label ? /* @__PURE__ */ jsx("span", {
|
|
264
|
+
className: "text-xs text-zinc-400",
|
|
265
|
+
children: label
|
|
266
|
+
}) : null
|
|
267
|
+
]
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
function CodePanel(arg0) {
|
|
271
|
+
const { children } = arg0;
|
|
272
|
+
let { tag, label, code } = arg0;
|
|
273
|
+
const child = Children.only(children);
|
|
274
|
+
if (isValidElement(child)) {
|
|
275
|
+
const props = child.props;
|
|
276
|
+
tag = props.tag ?? tag;
|
|
277
|
+
label = props.label ?? label;
|
|
278
|
+
code = props.code ?? code ?? getNodeText(props.children);
|
|
279
|
+
}
|
|
280
|
+
const copyText = code ?? getNodeText(children);
|
|
281
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
282
|
+
className: "clarify-code-panel group dark:bg-white/2.5",
|
|
283
|
+
children: [/* @__PURE__ */ jsx(CodePanelHeader, {
|
|
284
|
+
tag,
|
|
285
|
+
label
|
|
286
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
287
|
+
className: "relative",
|
|
288
|
+
children: [/* @__PURE__ */ jsx("pre", {
|
|
289
|
+
className: "clarify-code-pre overflow-x-auto p-4 text-xs text-white",
|
|
290
|
+
children
|
|
291
|
+
}), /* @__PURE__ */ jsx(CopyButton, { code: copyText })]
|
|
292
|
+
})]
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
function CodeGroupHeader(arg0) {
|
|
296
|
+
const { title, children, selectedIndex } = arg0;
|
|
297
|
+
const t = useBuiltInText();
|
|
298
|
+
const hasTabs = Children.count(children) > 1;
|
|
299
|
+
if (!title && !hasTabs) return null;
|
|
300
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
301
|
+
className: "clarify-code-group-header flex min-h-(--clarify-code-header-min-height) flex-wrap items-start gap-x-4 border-b border-zinc-700 bg-zinc-800 px-4 dark:border-zinc-800 dark:bg-transparent",
|
|
302
|
+
children: [title ? /* @__PURE__ */ jsx("h3", {
|
|
303
|
+
className: "mr-auto pt-3 text-xs font-semibold text-white",
|
|
304
|
+
children: title
|
|
305
|
+
}) : null, hasTabs ? /* @__PURE__ */ jsx(TabList, {
|
|
306
|
+
className: "clarify-code-tabs -mb-px flex gap-4 text-xs font-medium",
|
|
307
|
+
children: Children.map(children, (child, childIndex) => /* @__PURE__ */ jsx(Tab, {
|
|
308
|
+
className: clsx("clarify-code-tab border-b py-3 transition data-selected:not-data-focus:outline-hidden", childIndex === selectedIndex ? "border-(--clarify-theme-tokens-colors-primary) text-(--clarify-theme-tokens-colors-primary)" : "border-transparent text-zinc-400 hover:text-zinc-300"),
|
|
309
|
+
children: getPanelTitle({
|
|
310
|
+
...isValidElement(child) ? child.props : {},
|
|
311
|
+
fallbackTitle: t("actions.code")
|
|
312
|
+
})
|
|
313
|
+
}))
|
|
314
|
+
}) : null]
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
function CodeGroupPanels(arg0) {
|
|
318
|
+
const { children, ...props } = arg0;
|
|
319
|
+
if (Children.count(children) > 1) return /* @__PURE__ */ jsx(TabPanels, { children: Children.map(children, (child) => /* @__PURE__ */ jsx(TabPanel, { children: /* @__PURE__ */ jsx(CodePanel, {
|
|
320
|
+
...props,
|
|
321
|
+
children: child
|
|
322
|
+
}) })) });
|
|
323
|
+
return /* @__PURE__ */ jsx(CodePanel, {
|
|
324
|
+
...props,
|
|
325
|
+
children
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
function usePreventLayoutShift() {
|
|
329
|
+
const positionRef = useRef(null);
|
|
330
|
+
const rafRef = useRef(void 0);
|
|
331
|
+
useEffect(() => {
|
|
332
|
+
return () => {
|
|
333
|
+
if (typeof rafRef.current !== "undefined") window.cancelAnimationFrame(rafRef.current);
|
|
334
|
+
};
|
|
335
|
+
}, []);
|
|
336
|
+
return {
|
|
337
|
+
positionRef,
|
|
338
|
+
preventLayoutShift(callback) {
|
|
339
|
+
if (!positionRef.current) return;
|
|
340
|
+
const initialTop = positionRef.current.getBoundingClientRect().top;
|
|
341
|
+
callback();
|
|
342
|
+
rafRef.current = window.requestAnimationFrame(() => {
|
|
343
|
+
const newTop = positionRef.current?.getBoundingClientRect().top ?? initialTop;
|
|
344
|
+
window.scrollBy(0, newTop - initialTop);
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
var usePreferredLanguageStore = create()((set) => ({
|
|
350
|
+
preferredLanguages: [],
|
|
351
|
+
addPreferredLanguage: (language) => set((state) => ({ preferredLanguages: [...state.preferredLanguages.filter((preferredLanguage) => preferredLanguage !== language), language] }))
|
|
352
|
+
}));
|
|
353
|
+
function useTabGroupProps(availableLanguages) {
|
|
354
|
+
const { preferredLanguages, addPreferredLanguage } = usePreferredLanguageStore();
|
|
355
|
+
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
356
|
+
if (new Set(availableLanguages).size === availableLanguages.length) {
|
|
357
|
+
const activeLanguage = [...availableLanguages].sort((a, z) => preferredLanguages.indexOf(z) - preferredLanguages.indexOf(a))[0];
|
|
358
|
+
const languageIndex = availableLanguages.indexOf(activeLanguage);
|
|
359
|
+
const newSelectedIndex = languageIndex === -1 ? selectedIndex : languageIndex;
|
|
360
|
+
if (newSelectedIndex !== selectedIndex) setSelectedIndex(newSelectedIndex);
|
|
361
|
+
}
|
|
362
|
+
const { positionRef, preventLayoutShift } = usePreventLayoutShift();
|
|
363
|
+
return {
|
|
364
|
+
as: "div",
|
|
365
|
+
ref: positionRef,
|
|
366
|
+
selectedIndex,
|
|
367
|
+
onChange: (nextSelectedIndex) => {
|
|
368
|
+
setSelectedIndex(nextSelectedIndex);
|
|
369
|
+
preventLayoutShift(() => addPreferredLanguage(availableLanguages[nextSelectedIndex]));
|
|
370
|
+
}
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
var CodeGroupContext = createContext(false);
|
|
374
|
+
function CodeGroup(arg0) {
|
|
375
|
+
const { children, title, ...props } = arg0;
|
|
376
|
+
const t = useBuiltInText();
|
|
377
|
+
const tabGroupProps = useTabGroupProps(Children.map(children, (child) => getPanelTitle({
|
|
378
|
+
...isValidElement(child) ? child.props : {},
|
|
379
|
+
fallbackTitle: t("actions.code")
|
|
380
|
+
})) ?? []);
|
|
381
|
+
const hasTabs = Children.count(children) > 1;
|
|
382
|
+
const containerClassName = "clarify-code-group my-6 overflow-hidden rounded-2xl bg-zinc-900 shadow-md dark:ring-1 dark:ring-white/10";
|
|
383
|
+
const header = /* @__PURE__ */ jsx(CodeGroupHeader, {
|
|
384
|
+
title,
|
|
385
|
+
selectedIndex: tabGroupProps.selectedIndex,
|
|
386
|
+
children
|
|
387
|
+
});
|
|
388
|
+
const panels = /* @__PURE__ */ jsx(CodeGroupPanels, {
|
|
389
|
+
...props,
|
|
390
|
+
children
|
|
391
|
+
});
|
|
392
|
+
return /* @__PURE__ */ jsx(CodeGroupContext.Provider, {
|
|
393
|
+
value: true,
|
|
394
|
+
children: hasTabs ? /* @__PURE__ */ jsx(TabGroup, {
|
|
395
|
+
...tabGroupProps,
|
|
396
|
+
className: containerClassName,
|
|
397
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
398
|
+
className: "not-prose",
|
|
399
|
+
children: [header, panels]
|
|
400
|
+
})
|
|
401
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
402
|
+
className: containerClassName,
|
|
403
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
404
|
+
className: "not-prose",
|
|
405
|
+
children: [header, panels]
|
|
406
|
+
})
|
|
407
|
+
})
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
function Code(arg0) {
|
|
411
|
+
const { children, ...props } = arg0;
|
|
412
|
+
if (useContext(CodeGroupContext) && typeof children === "string") return /* @__PURE__ */ jsx("code", {
|
|
413
|
+
...props,
|
|
414
|
+
dangerouslySetInnerHTML: { __html: children }
|
|
415
|
+
});
|
|
416
|
+
return /* @__PURE__ */ jsx("code", {
|
|
417
|
+
...props,
|
|
418
|
+
children
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
function Pre(arg0) {
|
|
422
|
+
const { children, ...props } = arg0;
|
|
423
|
+
if (useContext(CodeGroupContext)) return children;
|
|
424
|
+
return /* @__PURE__ */ jsx(CodeGroup, {
|
|
425
|
+
...props,
|
|
426
|
+
children
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
//#endregion
|
|
430
|
+
//#region source/components/Collapse.tsx
|
|
431
|
+
function Collapse(arg0) {
|
|
432
|
+
const { children, title, summary, defaultOpen = false, className, ...props } = arg0;
|
|
433
|
+
const [open, setOpen] = useState(defaultOpen);
|
|
434
|
+
const contentRef = useRef(null);
|
|
435
|
+
const [maxHeight, setMaxHeight] = useState("0px");
|
|
436
|
+
const summaryLabel = title ?? summary ?? "Details";
|
|
437
|
+
const contentId = useId();
|
|
438
|
+
useLayoutEffect(() => {
|
|
439
|
+
if (!contentRef.current) return;
|
|
440
|
+
setMaxHeight(open ? `${contentRef.current.scrollHeight}px` : "0px");
|
|
441
|
+
}, [open, children]);
|
|
442
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
443
|
+
className: clsx("clarify-collapse my-6 overflow-hidden rounded-(--clarify-theme-tokens-radius-xl) border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) shadow-sm", className),
|
|
444
|
+
...props,
|
|
445
|
+
children: [/* @__PURE__ */ jsxs("button", {
|
|
446
|
+
type: "button",
|
|
447
|
+
className: "flex w-full cursor-pointer items-center justify-between gap-3 px-4 py-3 text-left text-sm font-semibold text-(--clarify-theme-tokens-colors-foreground) transition hover:bg-(--clarify-ui-hover-background) focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--clarify-theme-tokens-colors-primary) focus-visible:ring-offset-2 focus-visible:ring-offset-(--clarify-theme-tokens-colors-background)",
|
|
448
|
+
"aria-expanded": open,
|
|
449
|
+
"aria-controls": contentId,
|
|
450
|
+
onClick: () => setOpen((value) => !value),
|
|
451
|
+
children: [/* @__PURE__ */ jsx("span", { children: summaryLabel }), /* @__PURE__ */ jsx(ChevronDown, {
|
|
452
|
+
className: clsx("h-4 w-4 text-(--clarify-theme-tokens-colors-muted) transition-transform duration-200", open && "rotate-180"),
|
|
453
|
+
"aria-hidden": "true"
|
|
454
|
+
})]
|
|
455
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
456
|
+
id: contentId,
|
|
457
|
+
className: "clarify-collapse-content overflow-hidden border-t border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-background) duration-200 ease-out",
|
|
458
|
+
style: {
|
|
459
|
+
maxHeight,
|
|
460
|
+
willChange: "max-height, opacity, transform"
|
|
461
|
+
},
|
|
462
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
463
|
+
ref: contentRef,
|
|
464
|
+
className: clsx("px-4 py-4 text-sm/6 text-(--clarify-theme-tokens-colors-foreground) transition-opacity duration-200 ease-out", open ? "opacity-100 translate-y-0" : "opacity-0 -translate-y-1"),
|
|
465
|
+
children
|
|
466
|
+
})
|
|
467
|
+
})]
|
|
468
|
+
});
|
|
469
|
+
}
|
|
470
|
+
//#endregion
|
|
471
|
+
//#region source/components/Feedback.tsx
|
|
472
|
+
function FeedbackButton(props) {
|
|
473
|
+
return /* @__PURE__ */ jsx("button", {
|
|
474
|
+
type: "submit",
|
|
475
|
+
className: "clarify-feedback-button px-3 text-sm font-medium text-(--clarify-ui-text-soft) transition hover:bg-(--clarify-ui-hover-background) hover:text-(--clarify-theme-tokens-colors-foreground)",
|
|
476
|
+
...props
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
var FeedbackForm = forwardRef(function FeedbackForm(arg0, ref) {
|
|
480
|
+
const { onSubmit, className, ...props } = arg0;
|
|
481
|
+
const t = useBuiltInText();
|
|
482
|
+
return /* @__PURE__ */ jsxs("form", {
|
|
483
|
+
...props,
|
|
484
|
+
ref,
|
|
485
|
+
onSubmit,
|
|
486
|
+
className: clsx(className, "clarify-feedback-form absolute inset-0 flex items-center justify-center gap-6 md:justify-start"),
|
|
487
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
488
|
+
className: "text-sm text-(--clarify-ui-text-soft)",
|
|
489
|
+
children: t("feedback.prompt")
|
|
490
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
491
|
+
className: "clarify-feedback-actions group grid h-8 grid-cols-(--clarify-feedback-actions-grid) overflow-hidden rounded-full border border-(--clarify-theme-tokens-colors-border)",
|
|
492
|
+
children: [
|
|
493
|
+
/* @__PURE__ */ jsx(FeedbackButton, {
|
|
494
|
+
"data-response": "yes",
|
|
495
|
+
children: t("feedback.yes")
|
|
496
|
+
}),
|
|
497
|
+
/* @__PURE__ */ jsx("div", { className: "bg-(--clarify-theme-tokens-colors-border)" }),
|
|
498
|
+
/* @__PURE__ */ jsx(FeedbackButton, {
|
|
499
|
+
"data-response": "no",
|
|
500
|
+
children: t("feedback.no")
|
|
501
|
+
})
|
|
502
|
+
]
|
|
503
|
+
})]
|
|
504
|
+
});
|
|
505
|
+
});
|
|
506
|
+
var FeedbackThanks = forwardRef(function FeedbackThanks(arg0, ref) {
|
|
507
|
+
const { className, ...props } = arg0;
|
|
508
|
+
const t = useBuiltInText();
|
|
509
|
+
return /* @__PURE__ */ jsx("div", {
|
|
510
|
+
...props,
|
|
511
|
+
ref,
|
|
512
|
+
className: clsx(className, "clarify-feedback-thanks absolute inset-0 flex justify-center md:justify-start"),
|
|
513
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
514
|
+
className: "flex items-center gap-3 rounded-full bg-(--clarify-ui-accent-background) py-1 pr-3 pl-1.5 text-sm text-(--clarify-ui-accent-text) ring-1 ring-(--clarify-ui-accent-border) ring-inset",
|
|
515
|
+
children: [/* @__PURE__ */ jsx(CircleCheck, { className: "h-5 w-5 flex-none stroke-(--clarify-ui-accent-text)" }), t("feedback.thanks")]
|
|
516
|
+
})
|
|
517
|
+
});
|
|
518
|
+
});
|
|
519
|
+
function Feedback() {
|
|
520
|
+
const [submitted, setSubmitted] = useState(false);
|
|
521
|
+
function onSubmit(event) {
|
|
522
|
+
event.preventDefault();
|
|
523
|
+
setSubmitted(true);
|
|
524
|
+
}
|
|
525
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
526
|
+
className: "clarify-feedback relative h-8",
|
|
527
|
+
children: [/* @__PURE__ */ jsx(Transition, {
|
|
528
|
+
show: !submitted,
|
|
529
|
+
children: /* @__PURE__ */ jsx(FeedbackForm, {
|
|
530
|
+
className: "duration-300 data-closed:opacity-0 data-leave:pointer-events-none",
|
|
531
|
+
onSubmit
|
|
532
|
+
})
|
|
533
|
+
}), /* @__PURE__ */ jsx(Transition, {
|
|
534
|
+
show: submitted,
|
|
535
|
+
children: /* @__PURE__ */ jsx(FeedbackThanks, { className: "delay-150 duration-300 data-closed:opacity-0" })
|
|
536
|
+
})]
|
|
537
|
+
});
|
|
538
|
+
}
|
|
539
|
+
//#endregion
|
|
540
|
+
//#region source/components/Tag.tsx
|
|
541
|
+
var tagVariantStyles = {
|
|
542
|
+
small: "",
|
|
543
|
+
medium: "rounded-lg px-1.5 ring-1 ring-inset"
|
|
544
|
+
};
|
|
545
|
+
var tagColorStyles = {
|
|
546
|
+
emerald: {
|
|
547
|
+
small: "text-emerald-500 dark:text-emerald-400",
|
|
548
|
+
medium: "bg-emerald-400/10 text-emerald-500 ring-emerald-300 dark:text-emerald-400 dark:ring-emerald-400/30"
|
|
549
|
+
},
|
|
550
|
+
sky: {
|
|
551
|
+
small: "text-sky-500 dark:text-sky-400",
|
|
552
|
+
medium: "bg-sky-400/10 text-sky-500 ring-sky-300 dark:text-sky-400 dark:ring-sky-400/30"
|
|
553
|
+
},
|
|
554
|
+
amber: {
|
|
555
|
+
small: "text-amber-500 dark:text-amber-400",
|
|
556
|
+
medium: "bg-amber-400/10 text-amber-500 ring-amber-300 dark:text-amber-400 dark:ring-amber-400/30"
|
|
557
|
+
},
|
|
558
|
+
rose: {
|
|
559
|
+
small: "text-red-500 dark:text-rose-500",
|
|
560
|
+
medium: "bg-rose-50 text-red-500 ring-rose-200 dark:bg-rose-400/10 dark:text-rose-400 dark:ring-rose-500/20"
|
|
561
|
+
},
|
|
562
|
+
zinc: {
|
|
563
|
+
small: "text-(--clarify-theme-tokens-colors-muted)",
|
|
564
|
+
medium: "bg-(--clarify-theme-tokens-colors-code-background) text-(--clarify-theme-tokens-colors-muted) ring-(--clarify-theme-tokens-colors-border)"
|
|
565
|
+
}
|
|
566
|
+
};
|
|
567
|
+
var tagValueColorMap = {
|
|
568
|
+
GET: "emerald",
|
|
569
|
+
POST: "sky",
|
|
570
|
+
PUT: "amber",
|
|
571
|
+
PATCH: "amber",
|
|
572
|
+
DELETE: "rose"
|
|
573
|
+
};
|
|
574
|
+
function Tag(arg0) {
|
|
575
|
+
const { children, variant = "medium", color } = arg0;
|
|
576
|
+
const value = typeof children === "string" ? children.toUpperCase() : "";
|
|
577
|
+
const resolvedColor = color ?? tagValueColorMap[value] ?? "emerald";
|
|
578
|
+
return /* @__PURE__ */ jsx("span", {
|
|
579
|
+
className: clsx("clarify-tag font-bold", tagVariantStyles[variant], tagColorStyles[resolvedColor][variant]),
|
|
580
|
+
children
|
|
581
|
+
});
|
|
582
|
+
}
|
|
583
|
+
//#endregion
|
|
584
|
+
//#region source/components/Heading.tsx
|
|
585
|
+
function Eyebrow(arg0) {
|
|
586
|
+
const { tag, label } = arg0;
|
|
587
|
+
if (!tag && !label) return null;
|
|
588
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
589
|
+
className: "flex items-center gap-x-3",
|
|
590
|
+
children: [
|
|
591
|
+
tag ? /* @__PURE__ */ jsx(Tag, { children: tag }) : null,
|
|
592
|
+
tag && label ? /* @__PURE__ */ jsx("span", { className: "h-0.5 w-0.5 rounded-full bg-zinc-300 dark:bg-zinc-600" }) : null,
|
|
593
|
+
label ? /* @__PURE__ */ jsx("span", {
|
|
594
|
+
className: "text-xs text-zinc-400",
|
|
595
|
+
children: label
|
|
596
|
+
}) : null
|
|
597
|
+
]
|
|
598
|
+
});
|
|
599
|
+
}
|
|
600
|
+
function Anchor(arg0) {
|
|
601
|
+
const { id, inView, children } = arg0;
|
|
602
|
+
return /* @__PURE__ */ jsxs("a", {
|
|
603
|
+
href: `#${id}`,
|
|
604
|
+
className: "clarify-anchor group text-inherit no-underline hover:text-inherit",
|
|
605
|
+
children: [inView ? /* @__PURE__ */ jsx("div", {
|
|
606
|
+
className: "absolute mt-1 -ml-(--width) hidden w-(--width) opacity-0 transition [--width:var(--clarify-heading-anchor-width)] group-hover:opacity-100 group-focus:opacity-100 md:block lg:z-50 2xl:[--width:var(--clarify-heading-anchor-width-wide)]",
|
|
607
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
608
|
+
className: "group/anchor block h-5 w-5 rounded-lg bg-zinc-50 ring-1 ring-inset ring-zinc-300 transition hover:ring-zinc-500 dark:bg-zinc-800 dark:ring-zinc-700 dark:hover:bg-zinc-700 dark:hover:ring-zinc-600",
|
|
609
|
+
children: /* @__PURE__ */ jsx(LinkIcon, { className: "h-5 w-5 stroke-zinc-500 transition dark:stroke-zinc-400 dark:group-hover/anchor:stroke-white" })
|
|
610
|
+
})
|
|
611
|
+
}) : null, children]
|
|
612
|
+
});
|
|
613
|
+
}
|
|
614
|
+
function Heading(arg0) {
|
|
615
|
+
const { children, className, tag, label, level, anchor = true, ...props } = arg0;
|
|
616
|
+
const resolvedLevel = level ?? 2;
|
|
617
|
+
const Component = `h${resolvedLevel}`;
|
|
618
|
+
const ref = useRef(null);
|
|
619
|
+
const registerHeading = useSectionStore((state) => state.registerHeading);
|
|
620
|
+
const inView = useInView(ref, {
|
|
621
|
+
margin: `${remToPx(-3.5)}px 0px 0px 0px`,
|
|
622
|
+
amount: "all"
|
|
623
|
+
});
|
|
624
|
+
useEffect(() => {
|
|
625
|
+
if (resolvedLevel === 2) registerHeading({
|
|
626
|
+
id: props.id,
|
|
627
|
+
ref,
|
|
628
|
+
offsetRem: tag || label ? 8 : 6
|
|
629
|
+
});
|
|
630
|
+
}, [
|
|
631
|
+
label,
|
|
632
|
+
props.id,
|
|
633
|
+
registerHeading,
|
|
634
|
+
resolvedLevel,
|
|
635
|
+
tag
|
|
636
|
+
]);
|
|
637
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Eyebrow, {
|
|
638
|
+
tag,
|
|
639
|
+
label
|
|
640
|
+
}), /* @__PURE__ */ jsx(Component, {
|
|
641
|
+
ref,
|
|
642
|
+
className: clsx("clarify-heading", tag || label ? "mt-2 scroll-mt-32" : "scroll-mt-24", className),
|
|
643
|
+
...props,
|
|
644
|
+
children: anchor ? /* @__PURE__ */ jsx(Anchor, {
|
|
645
|
+
id: props.id,
|
|
646
|
+
inView,
|
|
647
|
+
children
|
|
648
|
+
}) : children
|
|
649
|
+
})] });
|
|
650
|
+
}
|
|
651
|
+
//#endregion
|
|
652
|
+
//#region source/components/Logo.tsx
|
|
653
|
+
function Logo(props) {
|
|
654
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
655
|
+
viewBox: "0 0 99 24",
|
|
656
|
+
"aria-hidden": "true",
|
|
657
|
+
...props,
|
|
658
|
+
className: clsx("clarify-logo", props.className),
|
|
659
|
+
children: [/* @__PURE__ */ jsx("path", {
|
|
660
|
+
className: "fill-(--clarify-theme-tokens-colors-primary)",
|
|
661
|
+
d: "M16 8a5 5 0 0 0-5-5H5a5 5 0 0 0-5 5v13.927a1 1 0 0 0 1.623.782l3.684-2.93a4 4 0 0 1 2.49-.87H11a5 5 0 0 0 5-5V8Z"
|
|
662
|
+
}), /* @__PURE__ */ jsx("path", {
|
|
663
|
+
className: "fill-(--clarify-theme-tokens-colors-foreground) dark:fill-white",
|
|
664
|
+
d: "M26.538 18h2.654v-3.999h2.576c2.672 0 4.456-1.723 4.456-4.333V9.65c0-2.61-1.784-4.333-4.456-4.333h-5.23V18Zm4.58-10.582c1.52 0 2.416.8 2.416 2.241v.018c0 1.441-.896 2.25-2.417 2.25h-1.925V7.418h1.925ZM38.051 18h2.566v-5.414c0-1.371.923-2.206 2.382-2.206.396 0 .791.061 1.178.15V8.287a3.843 3.843 0 0 0-.958-.123c-1.257 0-2.136.615-2.443 1.661h-.159V8.323h-2.566V18Zm11.55.202c2.979 0 4.772-1.88 4.772-5.036v-.018c0-3.128-1.82-5.036-4.773-5.036-2.953 0-4.772 1.916-4.772 5.036v.018c0 3.146 1.793 5.036 4.772 5.036Zm0-2.013c-1.372 0-2.145-1.116-2.145-3.023v-.018c0-1.89.782-3.023 2.144-3.023 1.354 0 2.145 1.134 2.145 3.023v.018c0 1.907-.782 3.023-2.145 3.023Zm10.52 1.846c.492 0 .967-.053 1.283-.114v-1.907a6.057 6.057 0 0 1-.755.044c-.87 0-1.24-.387-1.24-1.257v-4.544h1.995V8.323H59.41V6.012h-2.592v2.311h-1.495v1.934h1.495v5.133c0 1.88.949 2.645 3.304 2.645Zm7.287.167c2.98 0 4.772-1.88 4.772-5.036v-.018c0-3.128-1.82-5.036-4.772-5.036-2.954 0-4.773 1.916-4.773 5.036v.018c0 3.146 1.793 5.036 4.773 5.036Zm0-2.013c-1.372 0-2.145-1.116-2.145-3.023v-.018c0-1.89.782-3.023 2.145-3.023 1.353 0 2.144 1.134 2.144 3.023v.018c0 1.907-.782 3.023-2.144 3.023Zm10.767 2.013c2.522 0 4.034-1.353 4.297-3.463l.01-.053h-2.374l-.017.036c-.229.966-.853 1.467-1.908 1.467-1.37 0-2.135-1.08-2.135-3.04v-.018c0-1.934.755-3.006 2.135-3.006 1.099 0 1.74.615 1.908 1.556l.008.017h2.391v-.026c-.228-2.162-1.749-3.56-4.315-3.56-3.033 0-4.738 1.837-4.738 5.019v.017c0 3.217 1.714 5.054 4.738 5.054Zm10.257 0c2.98 0 4.772-1.88 4.772-5.036v-.018c0-3.128-1.82-5.036-4.772-5.036-2.953 0-4.773 1.916-4.773 5.036v.018c0 3.146 1.793 5.036 4.773 5.036Zm0-2.013c-1.371 0-2.145-1.116-2.145-3.023v-.018c0-1.89.782-3.023 2.145-3.023 1.353 0 2.144 1.134 2.144 3.023v.018c0 1.907-.782 3.023-2.144 3.023ZM95.025 18h2.566V4.623h-2.566V18Z"
|
|
665
|
+
})]
|
|
666
|
+
});
|
|
667
|
+
}
|
|
668
|
+
//#endregion
|
|
669
|
+
//#region source/components/patterns.tsx
|
|
670
|
+
function GridPattern(arg0) {
|
|
671
|
+
const { width, height, x, y, squares, ...props } = arg0;
|
|
672
|
+
const patternId = useId();
|
|
673
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
674
|
+
"aria-hidden": "true",
|
|
675
|
+
...props,
|
|
676
|
+
children: [
|
|
677
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("pattern", {
|
|
678
|
+
id: patternId,
|
|
679
|
+
width,
|
|
680
|
+
height,
|
|
681
|
+
patternUnits: "userSpaceOnUse",
|
|
682
|
+
x,
|
|
683
|
+
y,
|
|
684
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
685
|
+
d: `M.5 ${height}V.5H${width}`,
|
|
686
|
+
fill: "none"
|
|
687
|
+
})
|
|
688
|
+
}) }),
|
|
689
|
+
/* @__PURE__ */ jsx("rect", {
|
|
690
|
+
width: "100%",
|
|
691
|
+
height: "100%",
|
|
692
|
+
strokeWidth: 0,
|
|
693
|
+
fill: `url(#${patternId})`
|
|
694
|
+
}),
|
|
695
|
+
squares ? /* @__PURE__ */ jsx("svg", {
|
|
696
|
+
x,
|
|
697
|
+
y,
|
|
698
|
+
className: "overflow-visible",
|
|
699
|
+
children: squares.map(([squareX, squareY]) => /* @__PURE__ */ jsx("rect", {
|
|
700
|
+
width: width + 1,
|
|
701
|
+
height: height + 1,
|
|
702
|
+
x: squareX * width,
|
|
703
|
+
y: squareY * height,
|
|
704
|
+
strokeWidth: "0"
|
|
705
|
+
}, `${squareX}-${squareY}`))
|
|
706
|
+
}) : null
|
|
707
|
+
]
|
|
708
|
+
});
|
|
709
|
+
}
|
|
710
|
+
function HeroPattern() {
|
|
711
|
+
return /* @__PURE__ */ jsx("div", {
|
|
712
|
+
className: "absolute inset-0 -z-10 mx-0 max-w-none overflow-hidden",
|
|
713
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
714
|
+
className: "clarify-hero-pattern-mask absolute top-0 left-1/2 -ml-152 h-100 w-325",
|
|
715
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
716
|
+
className: "clarify-hero-pattern-gradient absolute inset-0 opacity-35 dark:opacity-55",
|
|
717
|
+
children: /* @__PURE__ */ jsx(GridPattern, {
|
|
718
|
+
width: 72,
|
|
719
|
+
height: 56,
|
|
720
|
+
x: -12,
|
|
721
|
+
y: 4,
|
|
722
|
+
squares: [
|
|
723
|
+
[4, 3],
|
|
724
|
+
[2, 1],
|
|
725
|
+
[7, 3],
|
|
726
|
+
[10, 6]
|
|
727
|
+
],
|
|
728
|
+
className: "clarify-hero-pattern-grid absolute inset-x-0 w-full -skew-y-18 fill-black/40 stroke-black/50 mix-blend-overlay dark:fill-white/2.5 dark:stroke-white/5"
|
|
729
|
+
})
|
|
730
|
+
}), /* @__PURE__ */ jsx("svg", {
|
|
731
|
+
viewBox: "0 0 1113 440",
|
|
732
|
+
"aria-hidden": "true",
|
|
733
|
+
className: "absolute top-0 left-1/2 -ml-76 w-278.25 fill-white blur-xl dark:hidden",
|
|
734
|
+
children: /* @__PURE__ */ jsx("path", { d: "M.016 439.5s-9.5-300 434-300S882.516 20 882.516 20V0h230.004v439.5H.016Z" })
|
|
735
|
+
})]
|
|
736
|
+
})
|
|
737
|
+
});
|
|
738
|
+
}
|
|
739
|
+
//#endregion
|
|
740
|
+
//#region source/components/Prose.tsx
|
|
741
|
+
function Prose(arg0) {
|
|
742
|
+
const { as, className, ...props } = arg0;
|
|
743
|
+
return /* @__PURE__ */ jsx(as ?? "div", {
|
|
744
|
+
className: clsx(className, "clarify-prose prose max-w-none dark:prose-invert", "[html_:where(&>*)]:w-full [html_:where(&>*)]:min-w-0 [html_:where(&>*)]:max-w-full"),
|
|
745
|
+
...props
|
|
746
|
+
});
|
|
747
|
+
}
|
|
748
|
+
//#endregion
|
|
24
749
|
//#region source/mdx/primitives.tsx
|
|
25
750
|
var primitives_exports = /* @__PURE__ */ __exportAll({
|
|
26
751
|
Button: () => Button,
|
|
@@ -75,39 +800,11 @@ function h3(props) {
|
|
|
75
800
|
...props
|
|
76
801
|
});
|
|
77
802
|
}
|
|
78
|
-
function InfoIcon(props) {
|
|
79
|
-
return /* @__PURE__ */ jsxs("svg", {
|
|
80
|
-
viewBox: "0 0 16 16",
|
|
81
|
-
"aria-hidden": "true",
|
|
82
|
-
...props,
|
|
83
|
-
children: [
|
|
84
|
-
/* @__PURE__ */ jsx("circle", {
|
|
85
|
-
cx: "8",
|
|
86
|
-
cy: "8",
|
|
87
|
-
r: "8",
|
|
88
|
-
strokeWidth: "0"
|
|
89
|
-
}),
|
|
90
|
-
/* @__PURE__ */ jsx("path", {
|
|
91
|
-
fill: "none",
|
|
92
|
-
strokeLinecap: "round",
|
|
93
|
-
strokeLinejoin: "round",
|
|
94
|
-
strokeWidth: "1.5",
|
|
95
|
-
d: "M6.75 7.75h1.5v3.5"
|
|
96
|
-
}),
|
|
97
|
-
/* @__PURE__ */ jsx("circle", {
|
|
98
|
-
cx: "8",
|
|
99
|
-
cy: "4",
|
|
100
|
-
r: ".5",
|
|
101
|
-
fill: "none"
|
|
102
|
-
})
|
|
103
|
-
]
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
803
|
function Note(arg0) {
|
|
107
804
|
const { children } = arg0;
|
|
108
805
|
return /* @__PURE__ */ jsxs("div", {
|
|
109
|
-
className: "clarify-note my-6 flex gap-2.5 rounded-(--clarify-theme-tokens-radius-xl) border border-(--clarify-ui-accent-border) bg-(--clarify-ui-accent-background) p-4 text-sm/6 text-(--clarify-theme-tokens-colors-foreground)
|
|
110
|
-
children: [/* @__PURE__ */ jsx(
|
|
806
|
+
className: "clarify-note my-6 flex gap-2.5 rounded-(--clarify-theme-tokens-radius-xl) border border-(--clarify-ui-accent-border) bg-(--clarify-ui-accent-background) p-4 text-sm/6 text-(--clarify-theme-tokens-colors-foreground) [--tw-prose-links-hover:var(--clarify-ui-accent-text)] [--tw-prose-links:var(--clarify-theme-tokens-colors-foreground)]",
|
|
807
|
+
children: [/* @__PURE__ */ jsx(Info, { className: "mt-1 h-4 w-4 flex-none stroke-(--clarify-ui-accent-text)" }), /* @__PURE__ */ jsx("div", {
|
|
111
808
|
className: "*:first:mt-0 *:last:mb-0",
|
|
112
809
|
children
|
|
113
810
|
})]
|
|
@@ -133,7 +830,7 @@ function Properties(arg0) {
|
|
|
133
830
|
className: "clarify-properties my-6",
|
|
134
831
|
children: /* @__PURE__ */ jsx("ul", {
|
|
135
832
|
role: "list",
|
|
136
|
-
className: "m-0 list-none divide-y divide-
|
|
833
|
+
className: "m-0 list-none divide-y divide-(--clarify-theme-tokens-colors-border) p-0",
|
|
137
834
|
children
|
|
138
835
|
})
|
|
139
836
|
});
|
|
@@ -150,14 +847,14 @@ function Property(arg0) {
|
|
|
150
847
|
children: "Name"
|
|
151
848
|
}),
|
|
152
849
|
/* @__PURE__ */ jsx("dd", { children: /* @__PURE__ */ jsx("span", {
|
|
153
|
-
className: "text-sm/5 font-semibold text-
|
|
850
|
+
className: "text-sm/5 font-semibold text-(--clarify-theme-tokens-colors-foreground)",
|
|
154
851
|
children: name
|
|
155
852
|
}) }),
|
|
156
853
|
type ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("dt", {
|
|
157
854
|
className: "sr-only",
|
|
158
855
|
children: "Type"
|
|
159
856
|
}), /* @__PURE__ */ jsx("dd", {
|
|
160
|
-
className: "text-xs text-(--clarify-theme-tokens-colors-muted)
|
|
857
|
+
className: "text-xs text-(--clarify-theme-tokens-colors-muted)",
|
|
161
858
|
children: type
|
|
162
859
|
})] }) : null,
|
|
163
860
|
/* @__PURE__ */ jsx("dt", {
|
|
@@ -809,7 +1506,7 @@ function SelectControl(arg0) {
|
|
|
809
1506
|
})]
|
|
810
1507
|
}), /* @__PURE__ */ jsx(ListboxOptions, {
|
|
811
1508
|
anchor: "bottom end",
|
|
812
|
-
className: "clarify-api-select-options z-30 mt-1 max-h-64 w-max min-w-(--button-width) max-w-
|
|
1509
|
+
className: "clarify-api-select-options z-30 mt-1 max-h-64 w-max min-w-(--button-width) max-w-(--clarify-popover-max-width) overflow-auto rounded-xl bg-zinc-900 p-1 text-xs shadow-lg shadow-black/20 ring-1 ring-white/10 [--anchor-gap:--spacing(1)] focus:outline-none",
|
|
813
1510
|
children: normalizedOptions.map((option) => /* @__PURE__ */ jsxs(ListboxOption, {
|
|
814
1511
|
value: option.value,
|
|
815
1512
|
className: "clarify-api-select-option group flex cursor-default items-center justify-between gap-3 rounded-lg px-2.5 py-2 text-xs whitespace-nowrap text-zinc-300 select-none data-focus:bg-white/10 data-focus:text-white data-selected:text-emerald-300",
|
|
@@ -960,7 +1657,7 @@ function ApiExampleCodeGroup(arg0) {
|
|
|
960
1657
|
className: "not-prose",
|
|
961
1658
|
children: [
|
|
962
1659
|
/* @__PURE__ */ jsxs("div", {
|
|
963
|
-
className: "clarify-api-example-header flex min-h-
|
|
1660
|
+
className: "clarify-api-example-header flex min-h-(--clarify-code-header-min-height) items-center gap-3 border-b border-zinc-700 bg-zinc-800 px-4 py-2 dark:border-zinc-800 dark:bg-transparent",
|
|
964
1661
|
children: [/* @__PURE__ */ jsx("h3", {
|
|
965
1662
|
className: "mr-auto min-w-16 truncate py-1 text-xs font-semibold text-white",
|
|
966
1663
|
children: title
|
|
@@ -1015,7 +1712,7 @@ function ApiExampleCodeGroup(arg0) {
|
|
|
1015
1712
|
selectedClientKey,
|
|
1016
1713
|
onSelectClient
|
|
1017
1714
|
}), /* @__PURE__ */ jsx("pre", {
|
|
1018
|
-
className: `overflow-
|
|
1715
|
+
className: `max-h-128 overflow-auto overscroll-contain p-4 text-xs text-white ${languageOptions && languageOptions.length > 1 ? "pt-14" : ""}`,
|
|
1019
1716
|
children: /* @__PURE__ */ jsx("code", {
|
|
1020
1717
|
className: `language-${language}`,
|
|
1021
1718
|
children: code
|
|
@@ -1283,27 +1980,27 @@ function SchemaNode(arg0) {
|
|
|
1283
1980
|
const hasChildren = node.children.length > 0;
|
|
1284
1981
|
const type = [node.type, node.required ? t("openapi.requiredBadge") : void 0].filter(Boolean).join(", ") || void 0;
|
|
1285
1982
|
const fallbackDescription = node.required ? t("openapi.required") : t("openapi.optional");
|
|
1286
|
-
const rowClassName = clsx("flex min-w-0 items-start rounded py-0.5 text-left", depth > 0 ? "-mx-2 w-
|
|
1983
|
+
const rowClassName = clsx("flex min-w-0 items-start rounded py-0.5 text-left", depth > 0 ? "-mx-2 w-(--clarify-schema-row-nested-width) px-2" : "w-full px-1");
|
|
1287
1984
|
const content = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("div", {
|
|
1288
1985
|
className: "min-w-0 flex-1",
|
|
1289
1986
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
1290
1987
|
className: "flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5",
|
|
1291
1988
|
children: [/* @__PURE__ */ jsx("span", {
|
|
1292
|
-
className: "text-sm/5 font-semibold text-
|
|
1989
|
+
className: "text-sm/5 font-semibold text-(--clarify-theme-tokens-colors-foreground)",
|
|
1293
1990
|
children: node.name
|
|
1294
1991
|
}), type ? /* @__PURE__ */ jsx("span", {
|
|
1295
|
-
className: "text-xs text-(--clarify-theme-tokens-colors-muted)
|
|
1992
|
+
className: "text-xs text-(--clarify-theme-tokens-colors-muted)",
|
|
1296
1993
|
children: type
|
|
1297
1994
|
}) : null]
|
|
1298
1995
|
}), /* @__PURE__ */ jsxs("div", {
|
|
1299
|
-
className: "mt-0.5 text-sm/5 text-
|
|
1996
|
+
className: "mt-0.5 text-sm/5 text-(--clarify-ui-text-soft) *:first:mt-0 *:last:mb-0",
|
|
1300
1997
|
children: [node.description ? /* @__PURE__ */ jsx(Markdown, { children: node.description }) : fallbackDescription, node.details ? /* @__PURE__ */ jsx("p", {
|
|
1301
|
-
className: "text-xs text-
|
|
1998
|
+
className: "text-xs text-(--clarify-ui-text-faint)",
|
|
1302
1999
|
children: node.details
|
|
1303
2000
|
}) : null]
|
|
1304
2001
|
})]
|
|
1305
2002
|
}), hasChildren ? /* @__PURE__ */ jsx("span", {
|
|
1306
|
-
className: "ml-2 flex h-5 w-5 flex-none items-center justify-center text-
|
|
2003
|
+
className: "ml-2 flex h-5 w-5 flex-none items-center justify-center text-(--clarify-ui-text-faint)",
|
|
1307
2004
|
"aria-hidden": "true",
|
|
1308
2005
|
children: expanded ? /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" })
|
|
1309
2006
|
}) : null] });
|
|
@@ -1330,7 +2027,7 @@ function SchemaTree(arg0) {
|
|
|
1330
2027
|
if (nodes.length === 0) return null;
|
|
1331
2028
|
return /* @__PURE__ */ jsx("ul", {
|
|
1332
2029
|
role: "list",
|
|
1333
|
-
className: clsx("m-0 list-none divide-y divide-
|
|
2030
|
+
className: clsx("m-0 list-none divide-y divide-(--clarify-theme-tokens-colors-border) p-0", depth > 0 && "mt-2 rounded-lg bg-(--clarify-ui-subtle-background) px-2 py-1"),
|
|
1334
2031
|
children: nodes.map((node) => /* @__PURE__ */ jsx(SchemaNode, {
|
|
1335
2032
|
node,
|
|
1336
2033
|
depth
|
|
@@ -1416,27 +2113,27 @@ function InlineListbox(arg0) {
|
|
|
1416
2113
|
className: "pointer-events-auto relative inline-flex min-w-0",
|
|
1417
2114
|
children: [/* @__PURE__ */ jsxs(ListboxButton, {
|
|
1418
2115
|
"aria-label": label,
|
|
1419
|
-
className: clsx("inline-flex min-w-0 items-center gap-1 rounded-md border border-
|
|
2116
|
+
className: clsx("inline-flex min-w-0 items-center gap-1 rounded-md border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) font-semibold text-(--clarify-theme-tokens-colors-foreground) shadow-xs outline-hidden transition hover:border-(--clarify-ui-text-faint) hover:bg-(--clarify-ui-hover-background) data-open:border-(--clarify-ui-text-faint) data-open:bg-(--clarify-ui-hover-background)", compact ? "max-w-32 px-1.5 py-0.5 text-xs" : "w-full px-2.5 py-1.5 text-xs"),
|
|
1420
2117
|
children: [/* @__PURE__ */ jsx("span", {
|
|
1421
2118
|
className: "truncate",
|
|
1422
2119
|
children: selected?.label ?? value
|
|
1423
2120
|
}), /* @__PURE__ */ jsx(ChevronDownIcon, {
|
|
1424
|
-
className: "h-3.5 w-3.5 shrink-0 text-
|
|
2121
|
+
className: "h-3.5 w-3.5 shrink-0 text-(--clarify-ui-text-faint)",
|
|
1425
2122
|
"aria-hidden": "true"
|
|
1426
2123
|
})]
|
|
1427
2124
|
}), /* @__PURE__ */ jsx(ListboxOptions, {
|
|
1428
2125
|
anchor: "bottom start",
|
|
1429
|
-
className: "z-30 mt-1 max-h-64 w-max min-w-(--button-width) max-w-
|
|
2126
|
+
className: "z-30 mt-1 max-h-64 w-max min-w-(--button-width) max-w-(--clarify-popover-max-width) overflow-auto rounded-xl bg-(--clarify-theme-tokens-colors-surface) p-1 text-xs shadow-lg shadow-black/10 ring-1 ring-(--clarify-theme-tokens-colors-border) [--anchor-gap:--spacing(1)] focus:outline-none",
|
|
1430
2127
|
children: options.map((option) => /* @__PURE__ */ jsxs(ListboxOption, {
|
|
1431
2128
|
value: option.value,
|
|
1432
|
-
className: "group flex cursor-default items-center justify-between gap-3 rounded-lg px-2.5 py-2 text-xs text-
|
|
2129
|
+
className: "group flex cursor-default items-center justify-between gap-3 rounded-lg px-2.5 py-2 text-xs text-(--clarify-ui-text) select-none data-focus:bg-(--clarify-ui-hover-background) data-selected:text-(--clarify-theme-tokens-colors-primary)",
|
|
1433
2130
|
children: [/* @__PURE__ */ jsxs("span", {
|
|
1434
2131
|
className: "min-w-0",
|
|
1435
2132
|
children: [/* @__PURE__ */ jsx("span", {
|
|
1436
2133
|
className: "block truncate",
|
|
1437
2134
|
children: option.label
|
|
1438
2135
|
}), option.description ? /* @__PURE__ */ jsx("span", {
|
|
1439
|
-
className: "mt-0.5 block truncate text-2xs text-
|
|
2136
|
+
className: "mt-0.5 block truncate text-2xs text-(--clarify-ui-text-faint)",
|
|
1440
2137
|
children: option.description
|
|
1441
2138
|
}) : null]
|
|
1442
2139
|
}), /* @__PURE__ */ jsx(CheckIcon, {
|
|
@@ -1459,7 +2156,7 @@ function ServerUrlValue(arg0) {
|
|
|
1459
2156
|
"aria-expanded": open,
|
|
1460
2157
|
"aria-label": "Server",
|
|
1461
2158
|
onClick: onToggle,
|
|
1462
|
-
className: clsx("flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-
|
|
2159
|
+
className: clsx("flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-(--clarify-ui-subtle-background) text-(--clarify-ui-text-soft) transition hover:bg-(--clarify-ui-hover-background) hover:text-(--clarify-theme-tokens-colors-foreground) sm:w-auto sm:min-w-16 sm:max-w-(--clarify-server-url-max-width) sm:px-1.5", open ? "bg-(--clarify-ui-active-background) text-(--clarify-theme-tokens-colors-foreground)" : null),
|
|
1463
2160
|
children: [/* @__PURE__ */ jsx("span", {
|
|
1464
2161
|
className: "sm:hidden",
|
|
1465
2162
|
children: /* @__PURE__ */ jsx(ServerIcon, {
|
|
@@ -1495,20 +2192,20 @@ function ServerVariableControl(arg0) {
|
|
|
1495
2192
|
value,
|
|
1496
2193
|
placeholder: variable?.default ?? name,
|
|
1497
2194
|
onChange: (event) => onChange(event.target.value),
|
|
1498
|
-
className: clsx("pointer-events-auto rounded-md border border-
|
|
2195
|
+
className: clsx("pointer-events-auto rounded-md border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) text-xs font-semibold text-(--clarify-theme-tokens-colors-foreground) shadow-xs outline-hidden transition placeholder:text-(--clarify-ui-text-faint) hover:border-(--clarify-ui-text-faint) hover:bg-(--clarify-ui-hover-background) focus:border-(--clarify-theme-tokens-colors-primary) focus:bg-(--clarify-theme-tokens-colors-surface)", compact ? "mx-0.5 w-24 px-1.5 py-0.5" : "w-full px-2.5 py-1.5")
|
|
1499
2196
|
});
|
|
1500
2197
|
}
|
|
1501
2198
|
function ServerPanel(arg0) {
|
|
1502
2199
|
const { servers, selectedKey, selectedServer, variables, onSelectServer, onChangeVariable } = arg0;
|
|
1503
2200
|
const variableEntries = Object.entries(selectedServer.variables ?? {});
|
|
1504
2201
|
return /* @__PURE__ */ jsx("div", {
|
|
1505
|
-
className: "border-t border-
|
|
2202
|
+
className: "border-t border-(--clarify-theme-tokens-colors-border) bg-(--clarify-ui-subtle-background) p-3",
|
|
1506
2203
|
children: /* @__PURE__ */ jsxs("div", {
|
|
1507
|
-
className: "grid gap-3 sm:grid-cols-
|
|
2204
|
+
className: "grid gap-3 sm:grid-cols-(--clarify-openapi-control-grid)",
|
|
1508
2205
|
children: [servers.length > 1 ? /* @__PURE__ */ jsxs("label", {
|
|
1509
2206
|
className: "flex min-w-0 flex-col gap-1.5",
|
|
1510
2207
|
children: [/* @__PURE__ */ jsx("span", {
|
|
1511
|
-
className: "text-2xs font-semibold text-
|
|
2208
|
+
className: "text-2xs font-semibold text-(--clarify-ui-text-soft)",
|
|
1512
2209
|
children: "Server"
|
|
1513
2210
|
}), /* @__PURE__ */ jsx(InlineListbox, {
|
|
1514
2211
|
label: "Server",
|
|
@@ -1523,7 +2220,7 @@ function ServerPanel(arg0) {
|
|
|
1523
2220
|
}) : null, variableEntries.map(([name, variable]) => /* @__PURE__ */ jsxs("label", {
|
|
1524
2221
|
className: "flex min-w-0 flex-col gap-1.5",
|
|
1525
2222
|
children: [/* @__PURE__ */ jsx("span", {
|
|
1526
|
-
className: "text-2xs font-semibold text-
|
|
2223
|
+
className: "text-2xs font-semibold text-(--clarify-ui-text-soft)",
|
|
1527
2224
|
children: name
|
|
1528
2225
|
}), /* @__PURE__ */ jsx(ServerVariableControl, {
|
|
1529
2226
|
name,
|
|
@@ -1539,13 +2236,13 @@ function AuthPanel(arg0) {
|
|
|
1539
2236
|
const { authOptions, selectedAuthName, selectedAuth, authValues, onSelectAuth, onChangeAuthValue } = arg0;
|
|
1540
2237
|
if (authOptions.length === 0) return null;
|
|
1541
2238
|
return /* @__PURE__ */ jsx("div", {
|
|
1542
|
-
className: "border-t border-
|
|
2239
|
+
className: "border-t border-(--clarify-theme-tokens-colors-border) bg-(--clarify-ui-subtle-background) p-3",
|
|
1543
2240
|
children: /* @__PURE__ */ jsxs("div", {
|
|
1544
|
-
className: "grid gap-3 sm:grid-cols-
|
|
2241
|
+
className: "grid gap-3 sm:grid-cols-(--clarify-openapi-control-grid)",
|
|
1545
2242
|
children: [/* @__PURE__ */ jsxs("label", {
|
|
1546
2243
|
className: "flex min-w-0 flex-col gap-1.5",
|
|
1547
2244
|
children: [/* @__PURE__ */ jsx("span", {
|
|
1548
|
-
className: "text-2xs font-semibold text-
|
|
2245
|
+
className: "text-2xs font-semibold text-(--clarify-ui-text-soft)",
|
|
1549
2246
|
children: "Auth"
|
|
1550
2247
|
}), /* @__PURE__ */ jsx(InlineListbox, {
|
|
1551
2248
|
label: "Auth",
|
|
@@ -1560,17 +2257,17 @@ function AuthPanel(arg0) {
|
|
|
1560
2257
|
}), selectedAuth ? /* @__PURE__ */ jsxs("label", {
|
|
1561
2258
|
className: "flex min-w-0 flex-col gap-1.5",
|
|
1562
2259
|
children: [/* @__PURE__ */ jsx("span", {
|
|
1563
|
-
className: "text-2xs font-semibold text-
|
|
2260
|
+
className: "text-2xs font-semibold text-(--clarify-ui-text-soft)",
|
|
1564
2261
|
children: "Credential"
|
|
1565
2262
|
}), /* @__PURE__ */ jsxs("div", {
|
|
1566
|
-
className: "flex min-w-0 items-center rounded-md border border-
|
|
2263
|
+
className: "flex min-w-0 items-center rounded-md border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) px-2.5 py-1.5 shadow-xs",
|
|
1567
2264
|
children: [/* @__PURE__ */ jsx("span", {
|
|
1568
|
-
className: "mr-2 shrink-0 text-2xs font-semibold text-
|
|
2265
|
+
className: "mr-2 shrink-0 text-2xs font-semibold text-(--clarify-ui-text-soft)",
|
|
1569
2266
|
children: selectedAuth.scheme.type === "apiKey" ? selectedAuth.scheme.in ?? "apiKey" : selectedAuth.scheme.scheme ?? selectedAuth.scheme.type ?? "token"
|
|
1570
2267
|
}), /* @__PURE__ */ jsx("input", {
|
|
1571
2268
|
value: authValues[selectedAuth.name] ?? authPlaceholder(selectedAuth),
|
|
1572
2269
|
onChange: (event) => onChangeAuthValue(selectedAuth.name, event.target.value),
|
|
1573
|
-
className: "min-w-0 flex-1 border-0 bg-transparent px-0 py-0 text-xs font-semibold text-
|
|
2270
|
+
className: "min-w-0 flex-1 border-0 bg-transparent px-0 py-0 text-xs font-semibold text-(--clarify-theme-tokens-colors-foreground) outline-hidden placeholder:text-(--clarify-ui-text-faint)"
|
|
1574
2271
|
})]
|
|
1575
2272
|
})]
|
|
1576
2273
|
}) : null]
|
|
@@ -1581,7 +2278,7 @@ function EndpointIdentity(arg0) {
|
|
|
1581
2278
|
const { method, path, servers, selectedServerKey, selectedServer, serverVariables, serverOpen, authOptions, selectedAuthName, selectedAuth, authValues, authOpen, onSelectServer, onChangeServerVariable, onToggleServer, onToggleAuth, onSelectAuth, onChangeAuthValue } = arg0;
|
|
1582
2279
|
const segments = path.split("/").filter(Boolean);
|
|
1583
2280
|
return /* @__PURE__ */ jsxs("div", {
|
|
1584
|
-
className: "not-prose flex w-full flex-col overflow-hidden rounded-xl border border-
|
|
2281
|
+
className: "not-prose flex w-full flex-col overflow-hidden rounded-xl border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) shadow-xs",
|
|
1585
2282
|
children: [
|
|
1586
2283
|
/* @__PURE__ */ jsxs("div", {
|
|
1587
2284
|
className: "flex min-w-0 items-center gap-1.5 overflow-hidden px-2.5 py-2",
|
|
@@ -1596,19 +2293,19 @@ function EndpointIdentity(arg0) {
|
|
|
1596
2293
|
/* @__PURE__ */ jsx("div", {
|
|
1597
2294
|
className: "flex min-w-0 flex-1 items-center overflow-x-auto text-sm font-bold leading-6 whitespace-nowrap",
|
|
1598
2295
|
children: segments.length > 0 ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
|
|
1599
|
-
className: "text-
|
|
2296
|
+
className: "text-(--clarify-ui-text-faint)",
|
|
1600
2297
|
children: "/"
|
|
1601
2298
|
}), segments.map((segment, index) => /* @__PURE__ */ jsxs("span", {
|
|
1602
2299
|
className: "flex items-center",
|
|
1603
2300
|
children: [index > 0 ? /* @__PURE__ */ jsx("span", {
|
|
1604
|
-
className: "text-
|
|
2301
|
+
className: "text-(--clarify-ui-text-faint)",
|
|
1605
2302
|
children: "/"
|
|
1606
2303
|
}) : null, /* @__PURE__ */ jsx("span", {
|
|
1607
|
-
className: "font-bold text-
|
|
2304
|
+
className: "font-bold text-(--clarify-theme-tokens-colors-foreground)",
|
|
1608
2305
|
children: segment
|
|
1609
2306
|
})]
|
|
1610
2307
|
}, `${segment}-${index}`))] }) : /* @__PURE__ */ jsx("span", {
|
|
1611
|
-
className: "font-bold text-
|
|
2308
|
+
className: "font-bold text-(--clarify-theme-tokens-colors-foreground)",
|
|
1612
2309
|
children: "/"
|
|
1613
2310
|
})
|
|
1614
2311
|
}),
|
|
@@ -1617,7 +2314,7 @@ function EndpointIdentity(arg0) {
|
|
|
1617
2314
|
"aria-expanded": authOpen,
|
|
1618
2315
|
"aria-label": "Auth",
|
|
1619
2316
|
onClick: onToggleAuth,
|
|
1620
|
-
className: clsx("ml-auto flex h-8 w-8 shrink-0 items-center justify-center rounded-lg text-
|
|
2317
|
+
className: clsx("ml-auto flex h-8 w-8 shrink-0 items-center justify-center rounded-lg text-(--clarify-ui-text-soft) transition hover:bg-(--clarify-ui-hover-background) hover:text-emerald-700 dark:hover:text-emerald-200", authOpen ? "bg-emerald-100 text-emerald-800 dark:bg-emerald-400/15 dark:text-emerald-100" : "bg-(--clarify-ui-subtle-background)"),
|
|
1621
2318
|
children: authOpen ? /* @__PURE__ */ jsx(UnlockKeyholeIcon, {
|
|
1622
2319
|
className: "h-4 w-4",
|
|
1623
2320
|
"aria-hidden": "true"
|
|
@@ -1774,6 +2471,6 @@ function OpenApiOperation(arg0) {
|
|
|
1774
2471
|
});
|
|
1775
2472
|
}
|
|
1776
2473
|
//#endregion
|
|
1777
|
-
export { authPlaceholder as a, getServerKey as c, getRequestBody$1 as d, Markdown as f, ResponseExamplesPanel as i, getServers as l, OpenApiOperation as n, defaultServerVariables as o, primitives_exports as p, RequestExamplesPanel as r, getAuthOptions as s, EndpointIdentity as t, getMediaTypeEntries as u };
|
|
2474
|
+
export { CodeGroup as C, Callout as D, CardGroup as E, Button as O, Code as S, Card as T, Logo as _, authPlaceholder as a, Feedback as b, getServerKey as c, getRequestBody$1 as d, Markdown as f, HeroPattern as g, GridPattern as h, ResponseExamplesPanel as i, getServers as l, Prose as m, OpenApiOperation as n, defaultServerVariables as o, primitives_exports as p, RequestExamplesPanel as r, getAuthOptions as s, EndpointIdentity as t, getMediaTypeEntries as u, Heading as v, Pre as w, Collapse as x, Tag as y };
|
|
1778
2475
|
|
|
1779
|
-
//# sourceMappingURL=OpenApiOperation-
|
|
2476
|
+
//# sourceMappingURL=OpenApiOperation-WntXLbai.js.map
|