@clarify-labs/renderer 0.7.0 → 0.7.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.
- package/output/{OpenApiOperation-ZXToVSFC.cjs → OpenApiOperation-C4xZu4i0.cjs} +69 -65
- package/output/OpenApiOperation-C4xZu4i0.cjs.map +1 -0
- package/output/{OpenApiOperation-CWSOhUVa.js → OpenApiOperation-LIL7bqxW.js} +48 -44
- package/output/OpenApiOperation-LIL7bqxW.js.map +1 -0
- package/output/{shell-xxhV0p7k.cjs → PageActions-1RDCHcUY.cjs} +280 -308
- package/output/PageActions-1RDCHcUY.cjs.map +1 -0
- package/output/{shell-CumiARRe.js → PageActions-yoDRjkq8.js} +235 -263
- package/output/PageActions-yoDRjkq8.js.map +1 -0
- package/output/{ThemeRoot-C_ZdzSMu.js → ThemeRoot-CLa0yvRQ.js} +406 -53
- package/output/ThemeRoot-CLa0yvRQ.js.map +1 -0
- package/output/{ThemeRoot-CEvwrGp5.cjs → ThemeRoot-DYS-lcK-.cjs} +457 -80
- package/output/ThemeRoot-DYS-lcK-.cjs.map +1 -0
- package/output/app/AppShell.d.ts +3 -2
- package/output/app/PageActions.d.ts +12 -0
- package/output/app/PageBanner.d.ts +7 -0
- package/output/app/SectionProvider.d.ts +1 -0
- package/output/client.cjs +14 -7
- package/output/client.d.ts +4 -2
- package/output/client.js +4 -4
- package/output/context.d.ts +1 -1
- package/output/core/context.d.ts +5 -5
- package/output/core/index.d.ts +1 -1
- package/output/core/types.d.ts +70 -61
- package/output/index.cjs +56 -28
- package/output/index.cjs.map +1 -1
- package/output/index.d.ts +7 -5
- package/output/index.js +37 -12
- package/output/index.js.map +1 -1
- package/output/mdx/components.d.ts +1 -0
- package/output/mdx/primitives.d.ts +1 -0
- package/output/preview.cjs +7 -7
- package/output/preview.cjs.map +1 -1
- package/output/preview.js +4 -4
- package/output/preview.js.map +1 -1
- package/output/{render-zHU25Nm9.cjs → render-CRTqZzyY.cjs} +8 -7
- package/output/render-CRTqZzyY.cjs.map +1 -0
- package/output/{render-CnUd0XwZ.js → render-D0ls3d2j.js} +6 -5
- package/output/render-D0ls3d2j.js.map +1 -0
- package/output/renderer.css +365 -261
- package/output/server.cjs +8 -7
- package/output/server.cjs.map +1 -1
- package/output/server.js +5 -4
- package/output/server.js.map +1 -1
- package/output/shell/ContentActions.d.ts +0 -1
- package/output/shell/Header.d.ts +3 -2
- package/output/shell/SiteLogo.d.ts +2 -2
- package/output/shell/mobile.d.ts +2 -2
- package/output/theme/ThemeEditor.d.ts +53 -17
- package/output/theme/ThemeProvider.d.ts +2 -1
- package/output/theme/ThemeRoot.d.ts +2 -2
- package/output/theme/cookies.d.ts +11 -0
- package/output/theme/randomTheme.d.ts +2 -2
- package/output/theme/variables.d.ts +58 -20
- package/output/utils/href.d.ts +3 -3
- package/package.json +1 -1
- package/output/OpenApiOperation-CWSOhUVa.js.map +0 -1
- package/output/OpenApiOperation-ZXToVSFC.cjs.map +0 -1
- package/output/ThemeRoot-CEvwrGp5.cjs.map +0 -1
- package/output/ThemeRoot-C_ZdzSMu.js.map +0 -1
- package/output/render-CnUd0XwZ.js.map +0 -1
- package/output/render-zHU25Nm9.cjs.map +0 -1
- package/output/shell-CumiARRe.js.map +0 -1
- package/output/shell-xxhV0p7k.cjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-DakpK96I.cjs");
|
|
2
|
-
const
|
|
2
|
+
const require_PageActions = require("./PageActions-1RDCHcUY.cjs");
|
|
3
3
|
const require_remark = require("./remark-Dv3owbSH.cjs");
|
|
4
4
|
let clsx = require("clsx");
|
|
5
5
|
clsx = require_chunk.__toESM(clsx, 1);
|
|
@@ -16,12 +16,12 @@ let github_slugger = require("github-slugger");
|
|
|
16
16
|
let _scalar_snippetz = require("@scalar/snippetz");
|
|
17
17
|
//#region source/components/LocalizedLink.tsx
|
|
18
18
|
function useLocalizedHref(href) {
|
|
19
|
-
return
|
|
19
|
+
return require_PageActions.localizeHref(href, require_PageActions.useConfig(), require_PageActions.useLocale());
|
|
20
20
|
}
|
|
21
21
|
function LocalizedLink(arg0) {
|
|
22
22
|
const { href, ...props } = arg0;
|
|
23
23
|
const localizedHref = useLocalizedHref(href);
|
|
24
|
-
if (!
|
|
24
|
+
if (!require_PageActions.isExternalHref(localizedHref) && !localizedHref.startsWith("#")) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_router_dom.Link, {
|
|
25
25
|
to: localizedHref,
|
|
26
26
|
...props
|
|
27
27
|
});
|
|
@@ -115,7 +115,7 @@ var defaultTitleKeys = {
|
|
|
115
115
|
};
|
|
116
116
|
function Callout(arg0) {
|
|
117
117
|
const { children, type = "info", title, icon = true, className, ...props } = arg0;
|
|
118
|
-
const t =
|
|
118
|
+
const t = require_PageActions.useBuiltInText();
|
|
119
119
|
const style = calloutStyles[type];
|
|
120
120
|
const Icon = style.Icon;
|
|
121
121
|
const resolvedTitle = title === void 0 ? t(defaultTitleKeys[type]) : title;
|
|
@@ -142,9 +142,9 @@ function Callout(arg0) {
|
|
|
142
142
|
function CardIcon(arg0) {
|
|
143
143
|
const { name } = arg0;
|
|
144
144
|
if (!name) return null;
|
|
145
|
-
const iconName =
|
|
145
|
+
const iconName = require_PageActions.resolveLucideIconName(name);
|
|
146
146
|
if (!iconName) return null;
|
|
147
|
-
const Icon =
|
|
147
|
+
const Icon = require_PageActions.lucideIconRegistry[iconName];
|
|
148
148
|
if (!Icon) return null;
|
|
149
149
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
150
150
|
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)",
|
|
@@ -229,7 +229,7 @@ function getNodeText(node) {
|
|
|
229
229
|
}
|
|
230
230
|
function CopyButton(arg0) {
|
|
231
231
|
const { code } = arg0;
|
|
232
|
-
const t =
|
|
232
|
+
const t = require_PageActions.useBuiltInText();
|
|
233
233
|
const [copyCount, setCopyCount] = (0, react.useState)(0);
|
|
234
234
|
const copied = copyCount > 0;
|
|
235
235
|
(0, react.useEffect)(() => {
|
|
@@ -238,38 +238,30 @@ function CopyButton(arg0) {
|
|
|
238
238
|
return () => window.clearTimeout(timeout);
|
|
239
239
|
}, [copyCount]);
|
|
240
240
|
if (!code) return null;
|
|
241
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.
|
|
241
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
242
242
|
type: "button",
|
|
243
|
-
className: (0, clsx.default)("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-
|
|
243
|
+
className: (0, clsx.default)("clarify-code-copy group/button absolute top-3.5 right-4 inline-flex items-center gap-1 overflow-hidden rounded-full border border-(--clarify-code-border) py-1 pr-3 pl-2 text-2xs font-medium whitespace-nowrap opacity-100 shadow-sm backdrop-blur-sm transition sm:opacity-0 sm:group-hover:opacity-100 focus:opacity-100", copied ? "clarify-code-copy-copied text-(--clarify-code-text)" : "bg-(--clarify-code-control-background) text-(--clarify-code-text) hover:bg-(--clarify-code-control-background-hover)"),
|
|
244
244
|
onClick: () => {
|
|
245
|
-
|
|
245
|
+
require_PageActions.copyTextToClipboard(code).then((ok) => {
|
|
246
246
|
if (ok) setCopyCount((count) => count + 1);
|
|
247
247
|
});
|
|
248
248
|
},
|
|
249
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("
|
|
250
|
-
"aria-hidden": copied,
|
|
251
|
-
className: (0, clsx.default)("pointer-events-none flex items-center gap-0.5 text-zinc-400 transition duration-300", copied && "-translate-y-1.5 opacity-0"),
|
|
252
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Clipboard, { className: "h-5 w-5 stroke-zinc-500 transition-colors group-hover/button:stroke-zinc-400" }), t("actions.copy")]
|
|
253
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
254
|
-
"aria-hidden": !copied,
|
|
255
|
-
className: (0, clsx.default)("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"),
|
|
256
|
-
children: t("actions.copied")
|
|
257
|
-
})]
|
|
249
|
+
children: copied ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, { className: "h-3.5 w-3.5 stroke-(--clarify-theme-tokens-colors-primary)" }), t("actions.copied")] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Clipboard, { className: "h-3.5 w-3.5 stroke-(--clarify-code-muted) transition-colors group-hover/button:stroke-(--clarify-code-text)" }), t("actions.copy")] })
|
|
258
250
|
});
|
|
259
251
|
}
|
|
260
252
|
function CodePanelHeader(arg0) {
|
|
261
253
|
const { tag, label } = arg0;
|
|
262
254
|
if (!tag && !label) return null;
|
|
263
255
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
264
|
-
className: "clarify-code-panel-header flex h-9 items-center gap-2 border-y border-
|
|
256
|
+
className: "clarify-code-panel-header flex h-9 items-center gap-2 border-y border-(--clarify-code-border) border-t-transparent bg-(--clarify-code-background) px-4",
|
|
265
257
|
children: [
|
|
266
258
|
tag ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
267
259
|
className: "clarify-code-panel-tag font-semibold text-(--clarify-theme-tokens-colors-primary)",
|
|
268
260
|
children: tag
|
|
269
261
|
}) : null,
|
|
270
|
-
tag && label ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "h-0.5 w-0.5 rounded-full bg-
|
|
262
|
+
tag && label ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "h-0.5 w-0.5 rounded-full bg-(--clarify-code-faint)" }) : null,
|
|
271
263
|
label ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
272
|
-
className: "text-xs text-
|
|
264
|
+
className: "truncate text-xs text-(--clarify-code-muted)",
|
|
273
265
|
children: label
|
|
274
266
|
}) : null
|
|
275
267
|
]
|
|
@@ -287,14 +279,14 @@ function CodePanel(arg0) {
|
|
|
287
279
|
}
|
|
288
280
|
const copyText = code ?? getNodeText(children);
|
|
289
281
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
290
|
-
className: "clarify-code-panel group
|
|
282
|
+
className: "clarify-code-panel group bg-(--clarify-code-background)",
|
|
291
283
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(CodePanelHeader, {
|
|
292
284
|
tag,
|
|
293
285
|
label
|
|
294
286
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
295
287
|
className: "relative",
|
|
296
288
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
|
|
297
|
-
className: "clarify-code-pre overflow-x-auto p-4 text-xs text-
|
|
289
|
+
className: "clarify-code-pre overflow-x-auto p-4 text-xs text-(--clarify-code-text)",
|
|
298
290
|
children
|
|
299
291
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CopyButton, { code: copyText })]
|
|
300
292
|
})]
|
|
@@ -302,18 +294,18 @@ function CodePanel(arg0) {
|
|
|
302
294
|
}
|
|
303
295
|
function CodeGroupHeader(arg0) {
|
|
304
296
|
const { title, children, selectedIndex } = arg0;
|
|
305
|
-
const t =
|
|
297
|
+
const t = require_PageActions.useBuiltInText();
|
|
306
298
|
const hasTabs = react.Children.count(children) > 1;
|
|
307
299
|
if (!title && !hasTabs) return null;
|
|
308
300
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
309
|
-
className: "clarify-code-group-header flex min-h-(--clarify-code-header-min-height) flex-wrap items-start gap-x-4 border-b border-
|
|
301
|
+
className: "clarify-code-group-header flex min-h-(--clarify-code-header-min-height) flex-wrap items-start gap-x-4 border-b border-(--clarify-code-border) bg-(--clarify-code-header-background) px-4",
|
|
310
302
|
children: [title ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
|
|
311
|
-
className: "mr-auto pt-3 text-xs font-semibold text-
|
|
303
|
+
className: "mr-auto pt-3 text-xs font-semibold text-(--clarify-code-text)",
|
|
312
304
|
children: title
|
|
313
305
|
}) : null, hasTabs ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_headlessui_react.TabList, {
|
|
314
306
|
className: "clarify-code-tabs -mb-px flex gap-4 text-xs font-medium",
|
|
315
307
|
children: react.Children.map(children, (child, childIndex) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_headlessui_react.Tab, {
|
|
316
|
-
className: (0, clsx.default)("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-
|
|
308
|
+
className: (0, clsx.default)("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-(--clarify-code-muted) hover:text-(--clarify-code-text)"),
|
|
317
309
|
children: getPanelTitle({
|
|
318
310
|
...(0, react.isValidElement)(child) ? child.props : {},
|
|
319
311
|
fallbackTitle: t("actions.code")
|
|
@@ -381,13 +373,13 @@ function useTabGroupProps(availableLanguages) {
|
|
|
381
373
|
var CodeGroupContext = (0, react.createContext)(false);
|
|
382
374
|
function CodeGroup(arg0) {
|
|
383
375
|
const { children, title, ...props } = arg0;
|
|
384
|
-
const t =
|
|
376
|
+
const t = require_PageActions.useBuiltInText();
|
|
385
377
|
const tabGroupProps = useTabGroupProps(react.Children.map(children, (child) => getPanelTitle({
|
|
386
378
|
...(0, react.isValidElement)(child) ? child.props : {},
|
|
387
379
|
fallbackTitle: t("actions.code")
|
|
388
380
|
})) ?? []);
|
|
389
381
|
const hasTabs = react.Children.count(children) > 1;
|
|
390
|
-
const containerClassName = "clarify-code-group my-6 overflow-hidden rounded-2xl bg-
|
|
382
|
+
const containerClassName = "clarify-code-group my-6 overflow-hidden rounded-2xl bg-(--clarify-code-background) shadow-md ring-1 ring-(--clarify-code-border)";
|
|
391
383
|
const header = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CodeGroupHeader, {
|
|
392
384
|
title,
|
|
393
385
|
selectedIndex: tabGroupProps.selectedIndex,
|
|
@@ -448,7 +440,7 @@ function Collapse(arg0) {
|
|
|
448
440
|
setMaxHeight(open ? `${contentRef.current.scrollHeight}px` : "0px");
|
|
449
441
|
}, [open, children]);
|
|
450
442
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
451
|
-
className: (0, clsx.default)("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)
|
|
443
|
+
className: (0, clsx.default)("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)", className),
|
|
452
444
|
...props,
|
|
453
445
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
454
446
|
type: "button",
|
|
@@ -486,7 +478,7 @@ function FeedbackButton(props) {
|
|
|
486
478
|
}
|
|
487
479
|
var FeedbackForm = (0, react.forwardRef)(function FeedbackForm(arg0, ref) {
|
|
488
480
|
const { onSubmit, className, ...props } = arg0;
|
|
489
|
-
const t =
|
|
481
|
+
const t = require_PageActions.useBuiltInText();
|
|
490
482
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("form", {
|
|
491
483
|
...props,
|
|
492
484
|
ref,
|
|
@@ -513,7 +505,7 @@ var FeedbackForm = (0, react.forwardRef)(function FeedbackForm(arg0, ref) {
|
|
|
513
505
|
});
|
|
514
506
|
var FeedbackThanks = (0, react.forwardRef)(function FeedbackThanks(arg0, ref) {
|
|
515
507
|
const { className, ...props } = arg0;
|
|
516
|
-
const t =
|
|
508
|
+
const t = require_PageActions.useBuiltInText();
|
|
517
509
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
518
510
|
...props,
|
|
519
511
|
ref,
|
|
@@ -621,9 +613,9 @@ function Heading(arg0) {
|
|
|
621
613
|
const resolvedLevel = level ?? 2;
|
|
622
614
|
const Component = `h${resolvedLevel}`;
|
|
623
615
|
const ref = (0, react.useRef)(null);
|
|
624
|
-
const registerHeading =
|
|
616
|
+
const registerHeading = require_PageActions.useSectionStore((state) => state.registerHeading);
|
|
625
617
|
const inView = (0, framer_motion.useInView)(ref, {
|
|
626
|
-
margin: `${
|
|
618
|
+
margin: `${require_PageActions.remToPx(-3.5)}px 0px 0px 0px`,
|
|
627
619
|
amount: "all"
|
|
628
620
|
});
|
|
629
621
|
(0, react.useEffect)(() => {
|
|
@@ -817,6 +809,7 @@ var primitives_exports = /* @__PURE__ */ require_chunk.__exportAll({
|
|
|
817
809
|
WebFrame: () => WebFrame,
|
|
818
810
|
a: () => a,
|
|
819
811
|
code: () => code,
|
|
812
|
+
h1: () => h1,
|
|
820
813
|
h2: () => h2,
|
|
821
814
|
h3: () => h3,
|
|
822
815
|
pre: () => pre,
|
|
@@ -825,7 +818,7 @@ var primitives_exports = /* @__PURE__ */ require_chunk.__exportAll({
|
|
|
825
818
|
function wrapper(arg0) {
|
|
826
819
|
const { children } = arg0;
|
|
827
820
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("article", {
|
|
828
|
-
className: "clarify-mdx-page flex h-full flex-col pt-
|
|
821
|
+
className: "clarify-mdx-page flex h-full flex-col pt-14 pb-10",
|
|
829
822
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Prose, {
|
|
830
823
|
className: "flex-auto",
|
|
831
824
|
children
|
|
@@ -839,6 +832,17 @@ function a(arg0) {
|
|
|
839
832
|
...props
|
|
840
833
|
});
|
|
841
834
|
}
|
|
835
|
+
function h1(arg0) {
|
|
836
|
+
const { children, className, ...props } = arg0;
|
|
837
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
838
|
+
className: "clarify-page-title-row flex flex-col gap-4 pb-4 sm:flex-row sm:items-start sm:justify-between",
|
|
839
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h1", {
|
|
840
|
+
className: (0, clsx.default)("clarify-page-title min-w-0 flex-1", className),
|
|
841
|
+
...props,
|
|
842
|
+
children
|
|
843
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_PageActions.PageTitleActions, {})]
|
|
844
|
+
});
|
|
845
|
+
}
|
|
842
846
|
var code = Code;
|
|
843
847
|
var pre = Pre;
|
|
844
848
|
function h2(props) {
|
|
@@ -1543,26 +1547,26 @@ function SelectControl(arg0) {
|
|
|
1543
1547
|
className: wrapperClassName,
|
|
1544
1548
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_headlessui_react.ListboxButton, {
|
|
1545
1549
|
"aria-label": label,
|
|
1546
|
-
className: `clarify-api-select-button flex ${buttonSizeClassName} items-center justify-between gap-2 rounded-lg bg-
|
|
1550
|
+
className: `clarify-api-select-button flex ${buttonSizeClassName} items-center justify-between gap-2 rounded-lg bg-(--clarify-code-control-background) px-2 py-1 text-xs font-medium whitespace-nowrap text-(--clarify-code-text) outline-hidden transition hover:bg-(--clarify-code-control-background-hover) focus:ring-2 focus:ring-(--clarify-ui-accent-border) data-open:bg-(--clarify-code-control-background-hover) data-open:ring-2 data-open:ring-(--clarify-ui-accent-border)`,
|
|
1547
1551
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1548
1552
|
className: "flex min-w-0 items-center gap-1.5 overflow-hidden",
|
|
1549
1553
|
children: [icon ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1550
|
-
className: "shrink-0 text-
|
|
1554
|
+
className: "shrink-0 text-(--clarify-code-faint)",
|
|
1551
1555
|
children: icon
|
|
1552
1556
|
}) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1553
1557
|
className: "truncate",
|
|
1554
1558
|
children: selectedOption?.label ?? value
|
|
1555
1559
|
})]
|
|
1556
1560
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronsUpDownIcon, {
|
|
1557
|
-
className: "h-3.5 w-3.5 shrink-0 text-
|
|
1561
|
+
className: "h-3.5 w-3.5 shrink-0 text-(--clarify-code-faint)",
|
|
1558
1562
|
"aria-hidden": "true"
|
|
1559
1563
|
})]
|
|
1560
1564
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_headlessui_react.ListboxOptions, {
|
|
1561
1565
|
anchor: "bottom end",
|
|
1562
|
-
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-
|
|
1566
|
+
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-(--clarify-code-surface) p-1 text-xs shadow-lg shadow-black/20 ring-1 ring-(--clarify-code-border) [--anchor-gap:--spacing(1)] focus:outline-none",
|
|
1563
1567
|
children: normalizedOptions.map((option) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_headlessui_react.ListboxOption, {
|
|
1564
1568
|
value: option.value,
|
|
1565
|
-
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-
|
|
1569
|
+
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-(--clarify-code-muted) select-none data-focus:bg-(--clarify-code-control-background-hover) data-focus:text-(--clarify-code-text) data-selected:text-(--clarify-theme-tokens-colors-primary)",
|
|
1566
1570
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: option.label }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.CheckIcon, {
|
|
1567
1571
|
className: "h-3.5 w-3.5 shrink-0 opacity-0 group-data-selected:opacity-100",
|
|
1568
1572
|
"aria-hidden": "true"
|
|
@@ -1637,23 +1641,23 @@ function authLabel(name, scheme) {
|
|
|
1637
1641
|
}
|
|
1638
1642
|
function CopyCodeButton(arg0) {
|
|
1639
1643
|
const { code } = arg0;
|
|
1640
|
-
const t =
|
|
1644
|
+
const t = require_PageActions.useBuiltInText();
|
|
1641
1645
|
const [copied, setCopied] = (0, react.useState)(false);
|
|
1642
1646
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
1643
1647
|
type: "button",
|
|
1644
1648
|
onClick: () => {
|
|
1645
|
-
|
|
1649
|
+
require_PageActions.copyTextToClipboard(code).then((ok) => {
|
|
1646
1650
|
if (!ok) return;
|
|
1647
1651
|
setCopied(true);
|
|
1648
1652
|
window.setTimeout(() => setCopied(false), 1e3);
|
|
1649
1653
|
});
|
|
1650
1654
|
},
|
|
1651
|
-
className: "flex items-center gap-1.5 rounded-full bg-
|
|
1655
|
+
className: "flex items-center gap-1.5 rounded-full bg-(--clarify-code-control-background) px-2.5 py-1.5 text-2xs font-medium text-(--clarify-code-muted) transition hover:bg-(--clarify-code-control-background-hover) hover:text-(--clarify-code-text) focus:bg-(--clarify-code-control-background-hover) focus:text-(--clarify-code-text)",
|
|
1652
1656
|
children: [copied ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.CheckIcon, {
|
|
1653
|
-
className: "h-3.5 w-3.5 text-
|
|
1657
|
+
className: "h-3.5 w-3.5 text-(--clarify-theme-tokens-colors-primary)",
|
|
1654
1658
|
"aria-hidden": "true"
|
|
1655
1659
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ClipboardIcon, {
|
|
1656
|
-
className: "h-3.5 w-3.5 text-
|
|
1660
|
+
className: "h-3.5 w-3.5 text-(--clarify-code-faint)",
|
|
1657
1661
|
"aria-hidden": "true"
|
|
1658
1662
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: copied ? t("actions.copied") : t("actions.copy") })]
|
|
1659
1663
|
});
|
|
@@ -1673,7 +1677,7 @@ function ExampleMetaValue(arg0) {
|
|
|
1673
1677
|
}
|
|
1674
1678
|
function CodeToolbar(arg0) {
|
|
1675
1679
|
const { code, languageOptions, selectedLanguageKey, onSelectLanguage, clientOptions, selectedClientKey, onSelectClient } = arg0;
|
|
1676
|
-
const t =
|
|
1680
|
+
const t = require_PageActions.useBuiltInText();
|
|
1677
1681
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1678
1682
|
className: "absolute top-3.5 right-4 left-4 z-10 flex items-center justify-between gap-3",
|
|
1679
1683
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -1702,17 +1706,17 @@ function CodeToolbar(arg0) {
|
|
|
1702
1706
|
}
|
|
1703
1707
|
function ApiExampleCodeGroup(arg0) {
|
|
1704
1708
|
const { title, tag, tagOptions, onSelectTag, label, labelOptions, onSelectLabel, comfortableMeta = false, code, language, mediaTypes, selectedMediaType, onSelectMediaType, examples, selectedExampleKey, onSelectExample, languageOptions, selectedLanguageKey, onSelectLanguage, clientOptions, selectedClientKey, onSelectClient } = arg0;
|
|
1705
|
-
const t =
|
|
1706
|
-
const metaClassName = comfortableMeta ? "flex min-h-11 min-w-0 items-center gap-2 border-y border-
|
|
1709
|
+
const t = require_PageActions.useBuiltInText();
|
|
1710
|
+
const metaClassName = comfortableMeta ? "flex min-h-11 min-w-0 items-center gap-2 border-y border-(--clarify-code-border) border-t-transparent bg-(--clarify-code-background) px-4 py-2" : "flex h-9 min-w-0 items-center gap-2 border-y border-(--clarify-code-border) border-t-transparent bg-(--clarify-code-background) px-4";
|
|
1707
1711
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1708
|
-
className: "clarify-api-example my-6 overflow-hidden rounded-2xl bg-
|
|
1712
|
+
className: "clarify-api-example my-6 overflow-hidden rounded-2xl bg-(--clarify-code-background) shadow-md ring-1 ring-(--clarify-code-border)",
|
|
1709
1713
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1710
1714
|
className: "not-prose",
|
|
1711
1715
|
children: [
|
|
1712
1716
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1713
|
-
className: "clarify-api-example-header flex min-h-(--clarify-code-header-min-height) items-center gap-3 border-b border-
|
|
1717
|
+
className: "clarify-api-example-header flex min-h-(--clarify-code-header-min-height) items-center gap-3 border-b border-(--clarify-code-border) bg-(--clarify-code-header-background) px-4 py-2",
|
|
1714
1718
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
|
|
1715
|
-
className: "mr-auto min-w-16 truncate py-1 text-xs font-semibold text-
|
|
1719
|
+
className: "mr-auto min-w-16 truncate py-1 text-xs font-semibold text-(--clarify-code-text)",
|
|
1716
1720
|
children: title
|
|
1717
1721
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1718
1722
|
className: "ml-auto flex min-w-0 items-center gap-2 whitespace-nowrap",
|
|
@@ -1744,18 +1748,18 @@ function ApiExampleCodeGroup(arg0) {
|
|
|
1744
1748
|
onChange: onSelectTag,
|
|
1745
1749
|
className: "clarify-api-example-status font-semibold text-emerald-400"
|
|
1746
1750
|
}) : null,
|
|
1747
|
-
tag && label ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "h-0.5 w-0.5 shrink-0 rounded-full bg-
|
|
1751
|
+
tag && label ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "h-0.5 w-0.5 shrink-0 rounded-full bg-(--clarify-code-faint)" }) : null,
|
|
1748
1752
|
label ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ExampleMetaValue, {
|
|
1749
1753
|
label: t("openapi.mediaType"),
|
|
1750
1754
|
value: label,
|
|
1751
1755
|
options: labelOptions,
|
|
1752
1756
|
onChange: onSelectLabel,
|
|
1753
|
-
className: "min-w-0 truncate text-xs text-
|
|
1757
|
+
className: "min-w-0 truncate text-xs text-(--clarify-code-muted)"
|
|
1754
1758
|
}) : null
|
|
1755
1759
|
]
|
|
1756
1760
|
}) : null,
|
|
1757
1761
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1758
|
-
className: "clarify-api-example-code group relative",
|
|
1762
|
+
className: "clarify-api-example-code group relative bg-(--clarify-code-background)",
|
|
1759
1763
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(CodeToolbar, {
|
|
1760
1764
|
code,
|
|
1761
1765
|
languageOptions,
|
|
@@ -1765,7 +1769,7 @@ function ApiExampleCodeGroup(arg0) {
|
|
|
1765
1769
|
selectedClientKey,
|
|
1766
1770
|
onSelectClient
|
|
1767
1771
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
|
|
1768
|
-
className: `max-h-128 overflow-auto overscroll-contain p-4 text-xs text-
|
|
1772
|
+
className: `max-h-128 overflow-auto overscroll-contain p-4 text-xs text-(--clarify-code-text) ${languageOptions && languageOptions.length > 1 ? "pt-14" : ""}`,
|
|
1769
1773
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
|
|
1770
1774
|
className: `language-${language}`,
|
|
1771
1775
|
children: code
|
|
@@ -1778,7 +1782,7 @@ function ApiExampleCodeGroup(arg0) {
|
|
|
1778
1782
|
}
|
|
1779
1783
|
function RequestExamplesPanel(arg0) {
|
|
1780
1784
|
const { spec, path, method, parameters, requestContents, selectedMediaType, onSelectMediaType, selectedServer, serverVariables, auth } = arg0;
|
|
1781
|
-
const t =
|
|
1785
|
+
const t = require_PageActions.useBuiltInText();
|
|
1782
1786
|
const selectedContent = requestContents.find((content) => content.mediaType === selectedMediaType) ?? requestContents[0];
|
|
1783
1787
|
const examples = getExampleEntries(selectedContent?.value);
|
|
1784
1788
|
const [selectedExampleKey, setSelectedExampleKey] = (0, react.useState)(examples[0]?.key ?? "");
|
|
@@ -1835,7 +1839,7 @@ function RequestExamplesPanel(arg0) {
|
|
|
1835
1839
|
}
|
|
1836
1840
|
function ResponseExamplesPanel(arg0) {
|
|
1837
1841
|
const { operation, spec } = arg0;
|
|
1838
|
-
const t =
|
|
1842
|
+
const t = require_PageActions.useBuiltInText();
|
|
1839
1843
|
const responses = getResponseEntries(operation, spec).filter(({ response }) => getMediaTypeEntries(response.content, spec).length > 0);
|
|
1840
1844
|
const [selectedStatus, setSelectedStatus] = (0, react.useState)(responses.find(({ status }) => status.startsWith("2"))?.status ?? responses[0]?.status ?? "");
|
|
1841
1845
|
const selectedResponse = responses.find(({ status }) => status === selectedStatus) ?? responses[0];
|
|
@@ -2028,7 +2032,7 @@ function getRootSchemaNode(spec, schema) {
|
|
|
2028
2032
|
}
|
|
2029
2033
|
function SchemaNode(arg0) {
|
|
2030
2034
|
const { node, depth = 0 } = arg0;
|
|
2031
|
-
const t =
|
|
2035
|
+
const t = require_PageActions.useBuiltInText();
|
|
2032
2036
|
const [expanded, setExpanded] = (0, react.useState)(depth < 1);
|
|
2033
2037
|
const hasChildren = node.children.length > 0;
|
|
2034
2038
|
const type = [node.type, node.required ? t("openapi.requiredBadge") : void 0].filter(Boolean).join(", ") || void 0;
|
|
@@ -2098,7 +2102,7 @@ function SchemaProperties(arg0) {
|
|
|
2098
2102
|
}
|
|
2099
2103
|
function ParameterList(arg0) {
|
|
2100
2104
|
const { title, parameters } = arg0;
|
|
2101
|
-
const t =
|
|
2105
|
+
const t = require_PageActions.useBuiltInText();
|
|
2102
2106
|
if (parameters.length === 0) return null;
|
|
2103
2107
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", { children: title }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Properties, { children: parameters.map((parameter) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Property, {
|
|
2104
2108
|
name: parameter.name ?? t("openapi.parameter"),
|
|
@@ -2108,7 +2112,7 @@ function ParameterList(arg0) {
|
|
|
2108
2112
|
}
|
|
2109
2113
|
function ResponseList(arg0) {
|
|
2110
2114
|
const { operation, spec } = arg0;
|
|
2111
|
-
const t =
|
|
2115
|
+
const t = require_PageActions.useBuiltInText();
|
|
2112
2116
|
const responses = getResponseEntries(operation, spec);
|
|
2113
2117
|
if (responses.length === 0) return null;
|
|
2114
2118
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", { children: t("openapi.responses") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Properties, { children: responses.map(({ status, response }) => {
|
|
@@ -2209,7 +2213,7 @@ function ServerUrlValue(arg0) {
|
|
|
2209
2213
|
"aria-expanded": open,
|
|
2210
2214
|
"aria-label": "Server",
|
|
2211
2215
|
onClick: onToggle,
|
|
2212
|
-
className: (0, clsx.default)("flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-(--clarify-ui-subtle-background) text-(--clarify-ui-text-
|
|
2216
|
+
className: (0, clsx.default)("flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-(--clarify-ui-subtle-background) text-(--clarify-ui-text-foreground) 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),
|
|
2213
2217
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2214
2218
|
className: "sm:hidden",
|
|
2215
2219
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ServerIcon, {
|
|
@@ -2219,7 +2223,7 @@ function ServerUrlValue(arg0) {
|
|
|
2219
2223
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
2220
2224
|
className: "hidden min-w-0 items-center gap-1 overflow-hidden sm:flex",
|
|
2221
2225
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2222
|
-
className: "truncate text-xs",
|
|
2226
|
+
className: "truncate font-semibold text-xs",
|
|
2223
2227
|
children: url
|
|
2224
2228
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronDownIcon, {
|
|
2225
2229
|
className: "h-3.5 w-3.5 shrink-0 text-zinc-400",
|
|
@@ -2399,7 +2403,7 @@ function EndpointIdentity(arg0) {
|
|
|
2399
2403
|
}
|
|
2400
2404
|
function OpenApiOperation(arg0) {
|
|
2401
2405
|
const { spec, path, method, operation } = arg0;
|
|
2402
|
-
const t =
|
|
2406
|
+
const t = require_PageActions.useBuiltInText();
|
|
2403
2407
|
const id = (0, github_slugger.slug)(`${method.toLowerCase()} ${path}`);
|
|
2404
2408
|
const summary = operation.summary ?? `${method} ${path}`;
|
|
2405
2409
|
const description = operation.description;
|
|
@@ -2699,4 +2703,4 @@ Object.defineProperty(exports, "primitives_exports", {
|
|
|
2699
2703
|
}
|
|
2700
2704
|
});
|
|
2701
2705
|
|
|
2702
|
-
//# sourceMappingURL=OpenApiOperation-
|
|
2706
|
+
//# sourceMappingURL=OpenApiOperation-C4xZu4i0.cjs.map
|