@clarify-labs/renderer 0.10.2 → 0.10.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/output/{ClarifyShell-1LuBliwt.js → ClarifyShell-Cq5Af46F.js} +32 -12
  2. package/output/ClarifyShell-Cq5Af46F.js.map +1 -0
  3. package/output/{ClarifyShell-C6li72Ce.cjs → ClarifyShell-UsefuuLS.cjs} +31 -11
  4. package/output/ClarifyShell-UsefuuLS.cjs.map +1 -0
  5. package/output/{MermaidViewer-dXsomvM7.js → MermaidViewer-Bc9H25yK.js} +2 -2
  6. package/output/{MermaidViewer-dXsomvM7.js.map → MermaidViewer-Bc9H25yK.js.map} +1 -1
  7. package/output/{MermaidViewer-B6-BMCJG.cjs → MermaidViewer-Db7qsyVk.cjs} +2 -2
  8. package/output/{MermaidViewer-B6-BMCJG.cjs.map → MermaidViewer-Db7qsyVk.cjs.map} +1 -1
  9. package/output/{OpenApiOperation-DgrqzeiS.js → OpenApiOperation-BZWeCbvy.js} +471 -178
  10. package/output/OpenApiOperation-BZWeCbvy.js.map +1 -0
  11. package/output/{OpenApiOperation-B52IWlKb.cjs → OpenApiOperation-DbZjxIuj.cjs} +491 -174
  12. package/output/OpenApiOperation-DbZjxIuj.cjs.map +1 -0
  13. package/output/{PageActions-D7K9LDGf.js → PageActions-BQeEmXbT.js} +524 -350
  14. package/output/PageActions-BQeEmXbT.js.map +1 -0
  15. package/output/{PageActions-BjB6PYmL.cjs → PageActions-Dg1l9KB1.cjs} +521 -347
  16. package/output/PageActions-Dg1l9KB1.cjs.map +1 -0
  17. package/output/{SearchDialog-CxYLjRi5.js → SearchDialog-B67VA0Ut.js} +3 -3
  18. package/output/{SearchDialog-CxYLjRi5.js.map → SearchDialog-B67VA0Ut.js.map} +1 -1
  19. package/output/{SearchDialog-CIPvXMT3.cjs → SearchDialog-DjKvqN7p.cjs} +3 -3
  20. package/output/{SearchDialog-CIPvXMT3.cjs.map → SearchDialog-DjKvqN7p.cjs.map} +1 -1
  21. package/output/app/ContentDiagnostic.d.ts +2 -1
  22. package/output/client.cjs +3 -3
  23. package/output/client.js +3 -3
  24. package/output/components/AccordionGroup.d.ts +7 -0
  25. package/output/components/Collapse.d.ts +2 -0
  26. package/output/components/FileTree.d.ts +10 -0
  27. package/output/components/Image.d.ts +6 -0
  28. package/output/components/Steps.d.ts +12 -0
  29. package/output/components/Tabs.d.ts +12 -5
  30. package/output/components/Tooltip.d.ts +7 -0
  31. package/output/components/index.d.ts +10 -1
  32. package/output/core/i18n.d.ts +1 -1
  33. package/output/{i18n-DnqZHFT7.js → i18n-Bqth9d6Q.js} +5 -1
  34. package/output/i18n-Bqth9d6Q.js.map +1 -0
  35. package/output/{i18n-b4iTLeia.cjs → i18n-C-fReCj-.cjs} +5 -1
  36. package/output/i18n-C-fReCj-.cjs.map +1 -0
  37. package/output/index.cjs +17 -8
  38. package/output/index.cjs.map +1 -1
  39. package/output/index.d.ts +5 -4
  40. package/output/index.js +14 -9
  41. package/output/index.js.map +1 -1
  42. package/output/mdx/components.d.ts +9 -0
  43. package/output/mdx/primitives.d.ts +4 -2
  44. package/output/openapi/components/CodeDisplay.d.ts +1 -0
  45. package/output/openapi/components/InlineListbox.d.ts +18 -0
  46. package/output/preview.cjs +3 -3
  47. package/output/preview.js +3 -3
  48. package/output/{render-Di5B6Zc0.cjs → render-Dc9wxg_r.cjs} +2 -2
  49. package/output/{render-Di5B6Zc0.cjs.map → render-Dc9wxg_r.cjs.map} +1 -1
  50. package/output/{render-DKj24Jqw.js → render-aS-w4fK4.js} +2 -2
  51. package/output/{render-DKj24Jqw.js.map → render-aS-w4fK4.js.map} +1 -1
  52. package/output/renderer.css +766 -171
  53. package/output/server.cjs +2 -2
  54. package/output/server.js +2 -2
  55. package/package.json +1 -1
  56. package/output/ClarifyShell-1LuBliwt.js.map +0 -1
  57. package/output/ClarifyShell-C6li72Ce.cjs.map +0 -1
  58. package/output/OpenApiOperation-B52IWlKb.cjs.map +0 -1
  59. package/output/OpenApiOperation-DgrqzeiS.js.map +0 -1
  60. package/output/PageActions-BjB6PYmL.cjs.map +0 -1
  61. package/output/PageActions-D7K9LDGf.js.map +0 -1
  62. package/output/i18n-DnqZHFT7.js.map +0 -1
  63. package/output/i18n-b4iTLeia.cjs.map +0 -1
@@ -1,11 +1,11 @@
1
- import { a as useConfig, s as useLocale, t as useBuiltInText } from "./i18n-DnqZHFT7.js";
2
- import { C as isExternalHref, E as copyTextToClipboard, c as lucideIconRegistry, h as useTheme, l as resolveLucideIconName, n as PageTitleActions, o as useSectionStore, s as remToPx, w as localizeHref } from "./PageActions-D7K9LDGf.js";
1
+ import { a as useConfig, s as useLocale, t as useBuiltInText } from "./i18n-Bqth9d6Q.js";
2
+ import { C as isExternalHref, E as copyTextToClipboard, c as lucideIconRegistry, h as useTheme, l as resolveLucideIconName, n as PageTitleActions, o as useSectionStore, s as remToPx, w as localizeHref } from "./PageActions-BQeEmXbT.js";
3
3
  import { t as markdownRemarkPlugins } from "./remark-C9iRQM0R.js";
4
4
  import clsx from "clsx";
5
- import { Children, Suspense, createContext, createElement, forwardRef, isValidElement, lazy, useContext, useEffect, useId, useLayoutEffect, useRef, useState } from "react";
5
+ import { Children, Suspense, cloneElement, createContext, createElement, forwardRef, isValidElement, lazy, useContext, useEffect, useId, useLayoutEffect, useRef, useState } from "react";
6
6
  import { Link } from "react-router-dom";
7
- import { Listbox, ListboxButton, ListboxOption, ListboxOptions, Tab, TabGroup, TabList, TabPanel, TabPanels, Transition } from "@headlessui/react";
8
- import { AlertTriangle, ArrowRight, Check, CheckCircle2, CheckIcon, ChevronDown, ChevronDownIcon, ChevronRight, ChevronsUpDownIcon, CircleCheck, Clipboard, ClipboardIcon, CodeIcon, CopyIcon, Info, Lightbulb, LinkIcon, LockKeyholeIcon, PackageIcon, ServerIcon, UnlockKeyholeIcon, XCircle } from "lucide-react";
7
+ import { Dialog, DialogBackdrop, DialogPanel, Listbox, ListboxButton, ListboxOption, ListboxOptions, Tab, TabGroup, TabList, TabPanel, TabPanels, Transition } from "@headlessui/react";
8
+ import { AlertTriangle, ArrowRight, ArrowUpRight, Check, CheckCircle2, CheckIcon, ChevronDown, ChevronDownIcon, ChevronRight, ChevronsUpDownIcon, CircleCheck, Clipboard, ClipboardIcon, CodeIcon, CopyIcon, File, Folder, FolderOpen, Info, Lightbulb, LinkIcon, LockKeyholeIcon, Maximize2, PackageIcon, ServerIcon, UnlockKeyholeIcon, X, XCircle } from "lucide-react";
9
9
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
10
10
  import { motion, useInView } from "framer-motion";
11
11
  import { create } from "zustand";
@@ -26,6 +26,32 @@ var __exportAll = (all, no_symbols) => {
26
26
  return target;
27
27
  };
28
28
  //#endregion
29
+ //#region source/components/AccordionGroup.tsx
30
+ function AccordionGroup(arg0) {
31
+ const { children, multiple = false, className, ...props } = arg0;
32
+ const childArray = Children.toArray(children);
33
+ const [openIndex, setOpenIndex] = useState(() => {
34
+ const defaultIndex = childArray.findIndex((child) => isValidElement(child) && child.props.defaultOpen);
35
+ return defaultIndex === -1 ? null : defaultIndex;
36
+ });
37
+ const items = childArray.map((child, index) => {
38
+ if (!isValidElement(child)) return child;
39
+ if (multiple) return child;
40
+ return cloneElement(child, {
41
+ open: openIndex === index,
42
+ onOpenChange: (open) => {
43
+ child.props.onOpenChange?.(open);
44
+ setOpenIndex(open ? index : null);
45
+ }
46
+ });
47
+ });
48
+ return /* @__PURE__ */ jsx("div", {
49
+ className: clsx("clarify-accordion-group my-6 divide-y divide-(--clarify-theme-tokens-colors-border) overflow-hidden rounded-(--clarify-theme-tokens-radius-lg) border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) [&_.clarify-collapse]:my-0 [&_.clarify-collapse]:rounded-none [&_.clarify-collapse]:border-0", className),
50
+ ...props,
51
+ children: items
52
+ });
53
+ }
54
+ //#endregion
29
55
  //#region source/components/LocalizedLink.tsx
30
56
  function useLocalizedHref(href) {
31
57
  return localizeHref(href, useConfig(), useLocale());
@@ -45,15 +71,15 @@ function LocalizedLink(arg0) {
45
71
  //#endregion
46
72
  //#region source/components/Button.tsx
47
73
  var buttonVariantStyles = {
48
- 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",
49
- 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)",
50
- 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",
51
- 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)",
74
+ primary: "bg-(--clarify-theme-tokens-colors-foreground) px-4 text-(--clarify-theme-tokens-colors-background) shadow-sm hover:-translate-y-px hover:shadow-md active:translate-y-0 active:shadow-sm dark:bg-(--clarify-theme-tokens-colors-primary) dark:text-zinc-950",
75
+ secondary: "bg-(--clarify-theme-tokens-colors-code-background) px-4 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)",
76
+ filled: "bg-(--clarify-theme-tokens-colors-primary) px-4 text-white shadow-sm hover:-translate-y-px hover:shadow-md active:translate-y-0 dark:text-zinc-950",
77
+ outline: "px-4 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)",
52
78
  text: "text-(--clarify-theme-tokens-colors-primary) hover:opacity-80 dark:text-(--clarify-theme-tokens-colors-primary) dark:hover:opacity-80"
53
79
  };
54
80
  function Button(arg0) {
55
81
  const { variant = "primary", className, children, arrow, ...props } = arg0;
56
- const classes = clsx("clarify-button not-prose inline-flex w-fit max-w-full items-center justify-center gap-1 overflow-hidden align-middle text-sm leading-6 font-medium whitespace-nowrap no-underline transition", buttonVariantStyles[variant], className);
82
+ const classes = clsx("clarify-button not-prose inline-flex w-fit max-w-full items-center justify-center gap-1.5 overflow-hidden align-middle text-sm font-semibold whitespace-nowrap no-underline transition duration-200 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)", variant === "text" ? "h-auto rounded-sm" : "h-9 rounded-(--clarify-theme-tokens-radius-lg)", buttonVariantStyles[variant], className);
57
83
  const arrowIcon = /* @__PURE__ */ jsx(ArrowRight, {
58
84
  "aria-hidden": "true",
59
85
  className: clsx("h-4 w-4 shrink-0", variant === "text" && "relative top-px", arrow === "left" && "-ml-0.5 rotate-180", arrow === "right" && "-mr-0.5")
@@ -81,37 +107,43 @@ function Button(arg0) {
81
107
  //#region source/components/Callout.tsx
82
108
  var calloutStyles = {
83
109
  info: {
84
- 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",
110
+ container: "border-sky-500/20 bg-sky-50/30 dark:border-sky-400/20 dark:bg-sky-400/5",
111
+ iconContainer: "bg-sky-100 ring-sky-500/15 dark:bg-sky-400/10 dark:ring-sky-400/20",
85
112
  icon: "text-sky-600 dark:text-sky-400",
86
113
  title: "text-sky-900 dark:text-sky-100",
87
114
  Icon: Info
88
115
  },
89
116
  note: {
90
- container: "border-zinc-500/20 bg-zinc-50 text-zinc-900 dark:border-white/10 dark:bg-white/5 dark:text-zinc-200",
117
+ container: "border-zinc-500/20 bg-zinc-50/50 dark:border-white/10 dark:bg-white/5",
118
+ iconContainer: "bg-zinc-200/70 ring-zinc-500/15 dark:bg-white/10 dark:ring-white/10",
91
119
  icon: "text-zinc-500 dark:text-zinc-400",
92
120
  title: "text-zinc-900 dark:text-white",
93
121
  Icon: Info
94
122
  },
95
123
  tip: {
96
- 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",
124
+ container: "border-emerald-500/20 bg-emerald-50/30 dark:border-emerald-400/20 dark:bg-emerald-400/5",
125
+ iconContainer: "bg-emerald-100 ring-emerald-500/15 dark:bg-emerald-400/10 dark:ring-emerald-400/20",
97
126
  icon: "text-emerald-600 dark:text-emerald-400",
98
127
  title: "text-emerald-900 dark:text-emerald-100",
99
128
  Icon: Lightbulb
100
129
  },
101
130
  warning: {
102
- 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",
131
+ container: "border-amber-500/20 bg-amber-50/40 dark:border-amber-400/20 dark:bg-amber-400/5",
132
+ iconContainer: "bg-amber-100 ring-amber-500/15 dark:bg-amber-400/10 dark:ring-amber-400/20",
103
133
  icon: "text-amber-600 dark:text-amber-400",
104
134
  title: "text-amber-900 dark:text-amber-100",
105
135
  Icon: AlertTriangle
106
136
  },
107
137
  danger: {
108
- 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",
138
+ container: "border-rose-500/20 bg-rose-50/40 dark:border-rose-400/20 dark:bg-rose-400/5",
139
+ iconContainer: "bg-rose-100 ring-rose-500/15 dark:bg-rose-400/10 dark:ring-rose-400/20",
109
140
  icon: "text-rose-600 dark:text-rose-400",
110
141
  title: "text-rose-900 dark:text-rose-100",
111
142
  Icon: XCircle
112
143
  },
113
144
  success: {
114
- 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",
145
+ container: "border-emerald-500/20 bg-emerald-50/30 dark:border-emerald-400/20 dark:bg-emerald-400/5",
146
+ iconContainer: "bg-emerald-100 ring-emerald-500/15 dark:bg-emerald-400/10 dark:ring-emerald-400/20",
115
147
  icon: "text-emerald-600 dark:text-emerald-400",
116
148
  title: "text-emerald-900 dark:text-emerald-100",
117
149
  Icon: CheckCircle2
@@ -132,15 +164,18 @@ function Callout(arg0) {
132
164
  const Icon = style.Icon;
133
165
  const resolvedTitle = title === void 0 ? t(defaultTitleKeys[type]) : title;
134
166
  return /* @__PURE__ */ jsxs("div", {
135
- className: clsx("clarify-callout my-6 flex gap-3 rounded-(--clarify-theme-tokens-radius-xl) border p-4 text-sm/6", style.container, className),
167
+ className: clsx("clarify-callout my-6 flex gap-3.5 rounded-(--clarify-theme-tokens-radius-lg) border p-4 text-sm/6 text-(--clarify-ui-text-soft)", style.container, className),
136
168
  ...props,
137
- children: [icon ? /* @__PURE__ */ jsx(Icon, {
138
- className: clsx("mt-1 size-4 flex-none", style.icon),
139
- "aria-hidden": "true"
169
+ children: [icon ? /* @__PURE__ */ jsx("span", {
170
+ className: clsx("flex size-7 flex-none items-center justify-center rounded-(--clarify-theme-tokens-radius-md) ring-1 ring-inset", style.iconContainer),
171
+ children: /* @__PURE__ */ jsx(Icon, {
172
+ className: clsx("size-4", style.icon),
173
+ "aria-hidden": "true"
174
+ })
140
175
  }) : null, /* @__PURE__ */ jsxs("div", {
141
176
  className: "min-w-0 flex-1 *:first:mt-0 *:last:mb-0",
142
177
  children: [resolvedTitle ? /* @__PURE__ */ jsx("p", {
143
- className: clsx("mb-1 font-semibold", style.title),
178
+ className: clsx("mb-1.5 font-semibold", style.title),
144
179
  children: resolvedTitle
145
180
  }) : null, /* @__PURE__ */ jsx("div", {
146
181
  className: "*:first:mt-0 *:last:mb-0",
@@ -159,9 +194,9 @@ function CardIcon(arg0) {
159
194
  const Icon = lucideIconRegistry[iconName];
160
195
  if (!Icon) return null;
161
196
  return /* @__PURE__ */ jsx("span", {
162
- 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)",
197
+ className: "flex size-8 flex-none items-center justify-center rounded-(--clarify-theme-tokens-radius-md) bg-(--clarify-ui-accent-background) text-(--clarify-ui-accent-text) ring-1 ring-inset ring-(--clarify-ui-accent-border) transition-colors group-hover:bg-(--clarify-theme-tokens-colors-primary) group-hover:text-white dark:group-hover:text-zinc-950",
163
198
  children: /* @__PURE__ */ jsx(Icon, {
164
- className: "size-5",
199
+ className: "size-4",
165
200
  "aria-hidden": "true"
166
201
  })
167
202
  });
@@ -175,7 +210,7 @@ var cardGroupColumnStyles = {
175
210
  function CardGroup(arg0) {
176
211
  const { children, cols = 2, className } = arg0;
177
212
  return /* @__PURE__ */ jsx("div", {
178
- className: clsx("not-prose my-10 grid gap-4", cardGroupColumnStyles[cols], className),
213
+ className: clsx("not-prose my-8 grid gap-3", cardGroupColumnStyles[cols], className),
179
214
  children
180
215
  });
181
216
  }
@@ -185,11 +220,17 @@ function Card(arg0) {
185
220
  className: "flex items-start gap-4",
186
221
  children: [/* @__PURE__ */ jsx(CardIcon, { name: icon }), /* @__PURE__ */ jsxs("div", {
187
222
  className: "min-w-0 flex-1",
188
- children: [/* @__PURE__ */ jsx("h3", {
189
- className: "m-0 text-base font-semibold text-(--clarify-theme-tokens-colors-foreground)",
190
- children: title
223
+ children: [/* @__PURE__ */ jsxs("div", {
224
+ className: "flex items-start justify-between gap-3",
225
+ children: [/* @__PURE__ */ jsx("h3", {
226
+ className: "m-0 text-sm/6 font-semibold text-(--clarify-theme-tokens-colors-foreground)",
227
+ children: title
228
+ }), href ? /* @__PURE__ */ jsx(ArrowUpRight, {
229
+ className: "mt-1 size-3.5 shrink-0 text-(--clarify-ui-text-faint) transition group-hover:-translate-y-0.5 group-hover:translate-x-0.5 group-hover:text-(--clarify-ui-accent-text)",
230
+ "aria-hidden": "true"
231
+ }) : null]
191
232
  }), children ? /* @__PURE__ */ jsx("div", {
192
- className: "mt-2 text-sm/6 text-(--clarify-ui-text-soft) *:m-0",
233
+ className: "mt-1.5 text-sm/6 text-(--clarify-ui-text-soft) *:m-0",
193
234
  children
194
235
  }) : null]
195
236
  })]
@@ -197,7 +238,7 @@ function Card(arg0) {
197
238
  className: "absolute inset-0 rounded-(--clarify-theme-tokens-radius-xl)",
198
239
  "aria-hidden": "true"
199
240
  }) : null] });
200
- 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);
241
+ const classes = clsx("group relative block rounded-(--clarify-theme-tokens-radius-lg) border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) p-4 transition duration-200", href && "hover:-translate-y-0.5 hover:border-(--clarify-ui-accent-border) hover:shadow-md hover:shadow-zinc-900/5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--clarify-theme-tokens-colors-primary) focus-visible:ring-offset-2 dark:hover:shadow-none", className);
201
242
  if (!href) return /* @__PURE__ */ jsx("div", {
202
243
  className: classes,
203
244
  children: content
@@ -211,7 +252,7 @@ function Card(arg0) {
211
252
  }
212
253
  //#endregion
213
254
  //#region source/components/Mermaid.tsx
214
- var MermaidViewer = lazy(() => import("./MermaidViewer-dXsomvM7.js"));
255
+ var MermaidViewer = lazy(() => import("./MermaidViewer-Bc9H25yK.js"));
215
256
  var mermaidModulePromise;
216
257
  async function loadMermaid() {
217
258
  mermaidModulePromise = mermaidModulePromise ?? import("mermaid").then((module) => module.default);
@@ -337,6 +378,12 @@ function getNodeText(node) {
337
378
  if (isValidElement(node)) return getNodeText(node.props.children);
338
379
  return "";
339
380
  }
381
+ function getCodeTitle(node) {
382
+ if (!isValidElement(node)) return void 0;
383
+ const { title, children } = node.props;
384
+ if (title) return title;
385
+ return Children.toArray(children).map(getCodeTitle).find(Boolean);
386
+ }
340
387
  function getCodeLanguage(node) {
341
388
  if (!isValidElement(node)) return void 0;
342
389
  const { className, language, children } = node.props;
@@ -345,6 +392,13 @@ function getCodeLanguage(node) {
345
392
  if (languageClass) return languageClass.slice(9);
346
393
  return Children.toArray(children).map(getCodeLanguage).find(Boolean);
347
394
  }
395
+ function getCodePanelTitle(node, fallbackTitle) {
396
+ return getPanelTitle({
397
+ title: getCodeTitle(node),
398
+ language: getCodeLanguage(node),
399
+ fallbackTitle
400
+ });
401
+ }
348
402
  function CopyButton(arg0) {
349
403
  const { code } = arg0;
350
404
  const t = useBuiltInText();
@@ -425,10 +479,7 @@ function CodeGroupHeader(arg0) {
425
479
  className: "clarify-code-tabs -mr-2 -mb-px flex gap-0 text-xs font-medium",
426
480
  children: Children.map(children, (child, childIndex) => /* @__PURE__ */ jsxs(Tab, {
427
481
  className: clsx("clarify-code-tab relative border-b border-transparent px-2 py-3 transition-colors hover:bg-(--clarify-code-control-background-hover) data-selected:not-data-focus:outline-hidden", childIndex === selectedIndex ? "text-(--clarify-code-accent-text)" : "text-(--clarify-code-control-text) hover:text-(--clarify-code-text)"),
428
- children: [getPanelTitle({
429
- ...isValidElement(child) ? child.props : {},
430
- fallbackTitle: t("actions.code")
431
- }), childIndex === selectedIndex ? /* @__PURE__ */ jsx(motion.span, {
482
+ children: [getCodePanelTitle(child, t("actions.code")), childIndex === selectedIndex ? /* @__PURE__ */ jsx(motion.span, {
432
483
  layoutId: indicatorLayoutId,
433
484
  className: "absolute inset-x-2 bottom-0 h-0.5 rounded-full bg-(--clarify-code-accent-text)",
434
485
  transition: {
@@ -502,10 +553,7 @@ var CodeGroupContext = createContext(false);
502
553
  function CodeGroup(arg0) {
503
554
  const { children, title, ...props } = arg0;
504
555
  const t = useBuiltInText();
505
- const tabGroupProps = useTabGroupProps(Children.map(children, (child) => getPanelTitle({
506
- ...isValidElement(child) ? child.props : {},
507
- fallbackTitle: t("actions.code")
508
- })) ?? []);
556
+ const tabGroupProps = useTabGroupProps(Children.map(children, (child) => getCodePanelTitle(child, t("actions.code"))) ?? []);
509
557
  const hasTabs = Children.count(children) > 1;
510
558
  const containerClassName = "clarify-code-group my-6 overflow-hidden rounded-2xl bg-(--clarify-code-background) shadow-md ring-1 ring-(--clarify-code-border)";
511
559
  const header = /* @__PURE__ */ jsx(CodeGroupHeader, {
@@ -561,8 +609,9 @@ function Pre(arg0) {
561
609
  //#endregion
562
610
  //#region source/components/Collapse.tsx
563
611
  function Collapse(arg0) {
564
- const { children, title, summary, defaultOpen = false, className, ...props } = arg0;
565
- const [open, setOpen] = useState(defaultOpen);
612
+ const { children, title, summary, defaultOpen = false, open: controlledOpen, onOpenChange, className, ...props } = arg0;
613
+ const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);
614
+ const open = controlledOpen ?? uncontrolledOpen;
566
615
  const contentRef = useRef(null);
567
616
  const [maxHeight, setMaxHeight] = useState("0px");
568
617
  const summaryLabel = title ?? summary ?? "Details";
@@ -572,16 +621,20 @@ function Collapse(arg0) {
572
621
  setMaxHeight(open ? `${contentRef.current.scrollHeight}px` : "0px");
573
622
  }, [open, children]);
574
623
  return /* @__PURE__ */ jsxs("div", {
575
- 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)", className),
624
+ className: clsx("clarify-collapse my-6 overflow-hidden rounded-(--clarify-theme-tokens-radius-lg) border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) transition-colors", open && "border-(--clarify-ui-accent-border)", className),
576
625
  ...props,
577
626
  children: [/* @__PURE__ */ jsxs("button", {
578
627
  type: "button",
579
- 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)",
628
+ className: "flex min-h-11 w-full cursor-pointer items-center justify-between gap-3 px-4 py-2.5 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-inset focus-visible:ring-(--clarify-theme-tokens-colors-primary)",
580
629
  "aria-expanded": open,
581
630
  "aria-controls": contentId,
582
- onClick: () => setOpen((value) => !value),
631
+ onClick: () => {
632
+ const nextOpen = !open;
633
+ if (controlledOpen === void 0) setUncontrolledOpen(nextOpen);
634
+ onOpenChange?.(nextOpen);
635
+ },
583
636
  children: [/* @__PURE__ */ jsx("span", { children: summaryLabel }), /* @__PURE__ */ jsx(ChevronDown, {
584
- className: clsx("h-4 w-4 text-(--clarify-theme-tokens-colors-muted) transition-transform duration-200", open && "rotate-180"),
637
+ className: clsx("size-4 rounded-full text-(--clarify-ui-text-faint) transition duration-200", open && "rotate-180"),
585
638
  "aria-hidden": "true"
586
639
  })]
587
640
  }), /* @__PURE__ */ jsx("div", {
@@ -593,7 +646,7 @@ function Collapse(arg0) {
593
646
  },
594
647
  children: /* @__PURE__ */ jsx("div", {
595
648
  ref: contentRef,
596
- 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"),
649
+ className: clsx("px-4 py-4 text-sm/6 text-(--clarify-ui-text-soft) transition-opacity duration-200 ease-out *:first:mt-0 *:last:mb-0", open ? "opacity-100 translate-y-0" : "opacity-0 -translate-y-1"),
597
650
  children
598
651
  })
599
652
  })]
@@ -669,6 +722,55 @@ function Feedback() {
669
722
  });
670
723
  }
671
724
  //#endregion
725
+ //#region source/components/FileTree.tsx
726
+ function FileTree(arg0) {
727
+ const { children, className, ...props } = arg0;
728
+ return /* @__PURE__ */ jsx("div", {
729
+ className: clsx("clarify-file-tree not-prose my-6 overflow-x-auto rounded-(--clarify-theme-tokens-radius-lg) border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) px-4 py-3 font-mono text-[13px]/6 text-(--clarify-ui-text-soft)", className),
730
+ ...props,
731
+ children: /* @__PURE__ */ jsx("ul", {
732
+ role: "tree",
733
+ className: "m-0 min-w-max list-none p-0",
734
+ children
735
+ })
736
+ });
737
+ }
738
+ function FileTreeItem(arg0) {
739
+ const { name, description, type, children, className, ...props } = arg0;
740
+ const isFolder = type === "folder" || children != null;
741
+ const FolderIcon = children ? FolderOpen : Folder;
742
+ return /* @__PURE__ */ jsxs("li", {
743
+ role: "treeitem",
744
+ "aria-expanded": isFolder ? children != null : void 0,
745
+ className: clsx("clarify-file-tree-item m-0 p-0", className),
746
+ ...props,
747
+ children: [/* @__PURE__ */ jsxs("div", {
748
+ className: "flex min-h-6 items-center gap-2 whitespace-nowrap",
749
+ children: [
750
+ isFolder ? /* @__PURE__ */ jsx(FolderIcon, {
751
+ className: "size-4 flex-none text-(--clarify-ui-accent-text)",
752
+ "aria-hidden": "true"
753
+ }) : /* @__PURE__ */ jsx(File, {
754
+ className: "size-4 flex-none text-(--clarify-ui-text-faint)",
755
+ "aria-hidden": "true"
756
+ }),
757
+ /* @__PURE__ */ jsx("span", {
758
+ className: "font-medium text-(--clarify-theme-tokens-colors-foreground)",
759
+ children: name
760
+ }),
761
+ description ? /* @__PURE__ */ jsx("span", {
762
+ className: "font-sans text-xs text-(--clarify-ui-text-faint)",
763
+ children: description
764
+ }) : null
765
+ ]
766
+ }), children ? /* @__PURE__ */ jsx("ul", {
767
+ role: "group",
768
+ className: "m-0 ml-2.5 list-none border-l border-(--clarify-theme-tokens-colors-border) pl-4",
769
+ children
770
+ }) : null]
771
+ });
772
+ }
773
+ //#endregion
672
774
  //#region source/components/Tag.tsx
673
775
  var tagVariantStyles = {
674
776
  small: "",
@@ -875,10 +977,50 @@ function Prose(arg0) {
875
977
  });
876
978
  }
877
979
  //#endregion
980
+ //#region source/components/Steps.tsx
981
+ function Steps(arg0) {
982
+ const { children, className, ...props } = arg0;
983
+ return /* @__PURE__ */ jsx("ol", {
984
+ className: clsx("clarify-steps my-8 ml-3 list-none border-l-2 border-(--clarify-theme-tokens-colors-border) p-0", className),
985
+ ...props,
986
+ children
987
+ });
988
+ }
989
+ function Step(arg0) {
990
+ const { children, title, className, ...props } = arg0;
991
+ return /* @__PURE__ */ jsxs("li", {
992
+ className: clsx("clarify-step relative m-0 pb-10 pl-9 last:pb-0", className),
993
+ ...props,
994
+ children: [
995
+ /* @__PURE__ */ jsx("span", {
996
+ className: "absolute top-0 -left-3.5 flex size-7 items-center justify-center rounded-full bg-(--clarify-theme-tokens-colors-primary) text-xs font-semibold text-white shadow-[0_0_0_4px_var(--clarify-theme-tokens-colors-background)] before:content-[counter(list-item)] dark:text-zinc-950",
997
+ "aria-hidden": "true"
998
+ }),
999
+ title ? /* @__PURE__ */ jsx("h3", {
1000
+ className: "m-0 pt-0.5 text-base font-semibold text-(--clarify-theme-tokens-colors-foreground)",
1001
+ children: title
1002
+ }) : null,
1003
+ /* @__PURE__ */ jsx("div", {
1004
+ className: clsx("text-sm/6 text-(--clarify-ui-text-soft) *:last:mb-0", title && "mt-2.5", !title && "*:first:mt-0"),
1005
+ children
1006
+ })
1007
+ ]
1008
+ });
1009
+ }
1010
+ //#endregion
878
1011
  //#region source/components/Tabs.tsx
1012
+ function TabItem(_props) {
1013
+ return null;
1014
+ }
879
1015
  function Tabs(arg0) {
880
- const { items, selectedIndex, onChange, className, listClassName, panelsClassName } = arg0;
881
- const [internalIndex, setInternalIndex] = useState(0);
1016
+ const { items, children, defaultValue, selectedIndex, onChange, className, listClassName, panelsClassName } = arg0;
1017
+ const childItems = Children.toArray(children).filter((child) => isValidElement(child) && child.type === TabItem).map((child, index) => ({
1018
+ id: child.props.value ?? `tab-${index}`,
1019
+ label: child.props.title,
1020
+ panel: child.props.children
1021
+ }));
1022
+ const resolvedItems = items ?? childItems;
1023
+ const [internalIndex, setInternalIndex] = useState(defaultValue ? Math.max(0, resolvedItems.findIndex((item) => item.id === defaultValue)) : 0);
882
1024
  const resolvedIndex = typeof selectedIndex === "number" ? selectedIndex : internalIndex;
883
1025
  const indicatorLayoutId = useId();
884
1026
  const handleChange = (index) => {
@@ -888,32 +1030,60 @@ function Tabs(arg0) {
888
1030
  return /* @__PURE__ */ jsxs(TabGroup, {
889
1031
  selectedIndex: resolvedIndex,
890
1032
  onChange: handleChange,
891
- className,
1033
+ className: clsx("clarify-tabs my-6", className),
892
1034
  children: [/* @__PURE__ */ jsx(TabList, {
893
- className: clsx("-mx-2 flex flex-wrap items-center gap-2 border-b border-(--clarify-theme-tokens-colors-border) px-2 pb-0", listClassName),
894
- children: items.map((item) => /* @__PURE__ */ jsx(Tab, {
895
- className: ({ selected }) => clsx("clarify-content-tab clarify-ui-tab relative inline-flex h-10 shrink-0 items-center rounded-t-md px-2 py-0 text-sm font-medium transition-colors focus:outline-none", selected && "clarify-ui-tab-active"),
1035
+ className: clsx("flex max-w-full items-stretch gap-1 overflow-x-auto border-b border-(--clarify-theme-tokens-colors-border)", listClassName),
1036
+ children: resolvedItems.map((item) => /* @__PURE__ */ jsx(Tab, {
1037
+ className: ({ selected }) => clsx("clarify-content-tab clarify-ui-tab relative my-1 inline-flex h-9 shrink-0 items-center rounded-(--clarify-theme-tokens-radius-md) px-2.5 transition focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-(--clarify-theme-tokens-colors-primary)", selected && "clarify-ui-tab-active"),
896
1038
  children: ({ selected }) => /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", { children: item.label }), selected ? /* @__PURE__ */ jsx(motion.span, {
897
1039
  layoutId: indicatorLayoutId,
898
- className: "absolute inset-x-2 bottom-0 h-0.5 rounded-full bg-(--clarify-ui-tab-indicator) shadow-[0_0_0.5rem_var(--clarify-ui-accent-glow)]",
1040
+ className: "absolute inset-x-2.5 -bottom-1 h-0.5 rounded-full bg-(--clarify-ui-tab-indicator)",
899
1041
  transition: {
900
- type: "spring",
901
- stiffness: 460,
902
- damping: 34,
903
- mass: .7
1042
+ type: "tween",
1043
+ duration: .16,
1044
+ ease: "easeOut"
904
1045
  }
905
1046
  }) : null] })
906
1047
  }, item.id))
907
1048
  }), /* @__PURE__ */ jsx(TabPanels, {
908
- className: clsx("mt-4", panelsClassName),
909
- children: items.map((item) => /* @__PURE__ */ jsx(TabPanel, {
910
- className: "focus:outline-none",
1049
+ className: clsx("mt-5", panelsClassName),
1050
+ children: resolvedItems.map((item) => /* @__PURE__ */ jsx(TabPanel, {
1051
+ className: "focus:outline-none focus-visible:ring-2 focus-visible:ring-(--clarify-theme-tokens-colors-primary)",
911
1052
  children: item.panel
912
1053
  }, item.id))
913
1054
  })]
914
1055
  });
915
1056
  }
916
1057
  //#endregion
1058
+ //#region source/components/Tooltip.tsx
1059
+ function Tooltip(arg0) {
1060
+ const { content, children, side = "top", className, ...props } = arg0;
1061
+ const contentId = useId();
1062
+ const [open, setOpen] = useState(false);
1063
+ return /* @__PURE__ */ jsxs("span", {
1064
+ className: clsx("clarify-tooltip group relative inline-flex align-baseline", className),
1065
+ onMouseEnter: () => setOpen(true),
1066
+ onMouseLeave: () => setOpen(false),
1067
+ ...props,
1068
+ children: [/* @__PURE__ */ jsx("span", {
1069
+ tabIndex: 0,
1070
+ "aria-describedby": contentId,
1071
+ className: "cursor-help rounded-sm border-b border-dotted border-current focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--clarify-theme-tokens-colors-primary)",
1072
+ onFocus: () => setOpen(true),
1073
+ onBlur: () => setOpen(false),
1074
+ onKeyDown: (event) => {
1075
+ if (event.key === "Escape") setOpen(false);
1076
+ },
1077
+ children
1078
+ }), /* @__PURE__ */ jsx("span", {
1079
+ id: contentId,
1080
+ role: "tooltip",
1081
+ className: clsx("pointer-events-none absolute left-1/2 z-30 w-max max-w-64 -translate-x-1/2 rounded-md bg-(--clarify-theme-tokens-colors-foreground) px-2.5 py-1.5 text-center text-xs/5 font-normal text-(--clarify-theme-tokens-colors-background) shadow-lg transition duration-150", open ? "opacity-100" : "opacity-0", side === "top" ? "bottom-[calc(100%+0.5rem)]" : "top-[calc(100%+0.5rem)]"),
1082
+ children: content
1083
+ })]
1084
+ });
1085
+ }
1086
+ //#endregion
917
1087
  //#region source/components/WebFrame.tsx
918
1088
  function WebFrame(arg0) {
919
1089
  const { src, title = "Embedded content", children, showWindow = true, className, iframeClassName, height = 420, style, ...props } = arg0;
@@ -936,53 +1106,122 @@ function WebFrame(arg0) {
936
1106
  children
937
1107
  });
938
1108
  if (!showWindow) return /* @__PURE__ */ jsx("div", {
939
- className: clsx("clarify-web-frame not-prose my-10 overflow-hidden rounded-(--clarify-theme-tokens-radius-xl) border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) shadow-(--clarify-ui-accent-glow)", className),
1109
+ className: clsx("clarify-web-frame not-prose my-10 overflow-hidden rounded-(--clarify-theme-tokens-radius-lg) border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) shadow-lg shadow-zinc-900/5 dark:shadow-none", className),
940
1110
  children: frame
941
1111
  });
942
1112
  return /* @__PURE__ */ jsxs("div", {
943
- className: clsx("clarify-web-frame not-prose my-10 overflow-hidden rounded-(--clarify-theme-tokens-radius-xl) border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) shadow-(--clarify-ui-accent-glow)", className),
1113
+ className: clsx("clarify-web-frame not-prose my-10 overflow-hidden rounded-(--clarify-theme-tokens-radius-lg) border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) shadow-lg shadow-zinc-900/5 dark:shadow-none", className),
944
1114
  children: [/* @__PURE__ */ jsxs("div", {
945
- className: "flex h-10 items-center gap-2 border-b border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-code-background) px-4",
1115
+ className: "grid h-10 grid-cols-[1fr_minmax(0,2fr)_1fr] items-center gap-3 border-b border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-code-background) px-3",
946
1116
  children: [
947
- /* @__PURE__ */ jsx("span", {
948
- className: "size-3 rounded-full bg-red-400",
949
- "aria-hidden": "true"
950
- }),
951
- /* @__PURE__ */ jsx("span", {
952
- className: "size-3 rounded-full bg-yellow-400",
953
- "aria-hidden": "true"
954
- }),
955
- /* @__PURE__ */ jsx("span", {
956
- className: "size-3 rounded-full bg-green-400",
957
- "aria-hidden": "true"
1117
+ /* @__PURE__ */ jsxs("div", {
1118
+ className: "flex items-center gap-1.5",
1119
+ "aria-hidden": "true",
1120
+ children: [
1121
+ /* @__PURE__ */ jsx("span", { className: "size-2.5 rounded-full bg-red-400/80" }),
1122
+ /* @__PURE__ */ jsx("span", { className: "size-2.5 rounded-full bg-amber-400/80" }),
1123
+ /* @__PURE__ */ jsx("span", { className: "size-2.5 rounded-full bg-emerald-400/80" })
1124
+ ]
958
1125
  }),
959
- /* @__PURE__ */ jsx("span", {
960
- className: "sr-only",
1126
+ /* @__PURE__ */ jsx("div", {
1127
+ className: "truncate rounded-(--clarify-theme-tokens-radius-md) border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) px-3 py-1 text-center text-xs text-(--clarify-ui-text-faint)",
961
1128
  children: title
962
- })
1129
+ }),
1130
+ /* @__PURE__ */ jsx("span", { "aria-hidden": "true" })
963
1131
  ]
964
1132
  }), frame]
965
1133
  });
966
1134
  }
967
1135
  //#endregion
1136
+ //#region source/components/Image.tsx
1137
+ function Image(arg0) {
1138
+ const { src, alt = "", caption, zoom = false, className, ...props } = arg0;
1139
+ const [open, setOpen] = useState(false);
1140
+ const image = /* @__PURE__ */ jsx("img", {
1141
+ ...props,
1142
+ src,
1143
+ alt,
1144
+ className: clsx("block h-auto max-w-full object-contain", className)
1145
+ });
1146
+ return /* @__PURE__ */ jsxs("figure", {
1147
+ className: "clarify-figure not-prose mx-auto my-8 w-fit max-w-full",
1148
+ children: [
1149
+ /* @__PURE__ */ jsx("div", {
1150
+ className: "group relative w-fit max-w-full overflow-hidden rounded-(--clarify-theme-tokens-radius-lg) border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-ui-subtle-background)",
1151
+ children: zoom ? /* @__PURE__ */ jsxs("button", {
1152
+ type: "button",
1153
+ className: "block max-w-full cursor-zoom-in focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-(--clarify-theme-tokens-colors-primary)",
1154
+ "aria-label": `Enlarge image: ${alt}`,
1155
+ onClick: () => setOpen(true),
1156
+ children: [image, /* @__PURE__ */ jsx("span", {
1157
+ className: "absolute right-3 bottom-3 grid size-8 place-items-center rounded-md border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-background)/90 text-(--clarify-ui-text-soft) opacity-0 shadow-sm transition group-hover:opacity-100 group-focus-within:opacity-100",
1158
+ children: /* @__PURE__ */ jsx(Maximize2, {
1159
+ className: "size-4",
1160
+ "aria-hidden": "true"
1161
+ })
1162
+ })]
1163
+ }) : image
1164
+ }),
1165
+ caption ? /* @__PURE__ */ jsx("figcaption", {
1166
+ className: "mt-2 text-center text-xs/5 text-(--clarify-ui-text-faint)",
1167
+ children: caption
1168
+ }) : null,
1169
+ zoom ? /* @__PURE__ */ jsxs(Dialog, {
1170
+ open,
1171
+ onClose: setOpen,
1172
+ className: "relative z-50",
1173
+ children: [/* @__PURE__ */ jsx(DialogBackdrop, { className: "fixed inset-0 bg-black/75 backdrop-blur-sm" }), /* @__PURE__ */ jsx("div", {
1174
+ className: "fixed inset-0 flex items-center justify-center p-4 sm:p-8",
1175
+ children: /* @__PURE__ */ jsxs(DialogPanel, {
1176
+ className: "relative max-h-full max-w-full overflow-auto rounded-(--clarify-theme-tokens-radius-lg) bg-(--clarify-theme-tokens-colors-background) p-2 shadow-2xl",
1177
+ children: [/* @__PURE__ */ jsx("img", {
1178
+ src,
1179
+ alt,
1180
+ className: "max-h-[calc(100dvh-5rem)] max-w-[calc(100vw-5rem)] object-contain"
1181
+ }), /* @__PURE__ */ jsx("button", {
1182
+ type: "button",
1183
+ className: "absolute top-4 right-4 grid size-9 place-items-center rounded-md border border-white/20 bg-black/65 text-white transition hover:bg-black/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white",
1184
+ "aria-label": "Close image preview",
1185
+ onClick: () => setOpen(false),
1186
+ children: /* @__PURE__ */ jsx(X, {
1187
+ className: "size-4",
1188
+ "aria-hidden": "true"
1189
+ })
1190
+ })]
1191
+ })
1192
+ })]
1193
+ }) : null
1194
+ ]
1195
+ });
1196
+ }
1197
+ //#endregion
968
1198
  //#region source/mdx/primitives.tsx
969
1199
  var primitives_exports = /* @__PURE__ */ __exportAll({
1200
+ AccordionGroup: () => AccordionGroup,
970
1201
  Button: () => Button,
971
1202
  Callout: () => Callout,
972
1203
  Card: () => Card,
973
1204
  CardGroup: () => CardGroup,
974
1205
  CodeGroup: () => CodeGroup,
975
1206
  Col: () => Col,
1207
+ FileTree: () => FileTree,
1208
+ FileTreeItem: () => FileTreeItem,
976
1209
  Note: () => Note,
977
1210
  Properties: () => Properties,
978
1211
  Property: () => Property,
979
1212
  Row: () => Row,
1213
+ Step: () => Step,
1214
+ Steps: () => Steps,
1215
+ Tab: () => TabItem,
1216
+ Tabs: () => Tabs,
1217
+ Tooltip: () => Tooltip,
980
1218
  WebFrame: () => WebFrame,
981
1219
  a: () => a,
982
1220
  code: () => code,
983
1221
  h1: () => h1,
984
1222
  h2: () => h2,
985
1223
  h3: () => h3,
1224
+ img: () => img,
986
1225
  pre: () => pre,
987
1226
  table: () => table,
988
1227
  wrapper: () => wrapper
@@ -1027,6 +1266,7 @@ function h1(arg0) {
1027
1266
  }
1028
1267
  var code = Code;
1029
1268
  var pre = Pre;
1269
+ var img = Image;
1030
1270
  function h2(props) {
1031
1271
  return createElement(Heading, {
1032
1272
  level: 2,
@@ -1042,8 +1282,8 @@ function h3(props) {
1042
1282
  function Note(arg0) {
1043
1283
  const { children } = arg0;
1044
1284
  return /* @__PURE__ */ jsxs("div", {
1045
- 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)]",
1046
- children: [/* @__PURE__ */ jsx(Info, { className: "mt-1 h-4 w-4 flex-none stroke-(--clarify-ui-accent-text)" }), /* @__PURE__ */ jsx("div", {
1285
+ className: "clarify-note my-6 flex gap-3 rounded-r-(--clarify-theme-tokens-radius-lg) border-l-2 border-(--clarify-theme-tokens-colors-primary) bg-(--clarify-ui-subtle-background) px-4 py-3 text-sm/6 text-(--clarify-ui-text-soft) [--tw-prose-links-hover:var(--clarify-ui-accent-text)] [--tw-prose-links:var(--clarify-theme-tokens-colors-foreground)]",
1286
+ children: [/* @__PURE__ */ jsx(Info, { className: "mt-1 size-4 flex-none stroke-(--clarify-ui-accent-text)" }), /* @__PURE__ */ jsx("div", {
1047
1287
  className: "*:first:mt-0 *:last:mb-0",
1048
1288
  children
1049
1289
  })]
@@ -1902,7 +2142,7 @@ function SelectControl(arg0) {
1902
2142
  label: option
1903
2143
  } : option);
1904
2144
  const selectedOption = normalizedOptions.find((option) => option.value === value) ?? normalizedOptions[0];
1905
- const wrapperClassName = compact ? "clarify-api-select relative min-w-0 text-xs" : "clarify-api-select relative shrink-0 text-xs";
2145
+ const wrapperClassName = compact ? "clarify-openai-select relative min-w-0 text-xs" : "clarify-openai-select relative shrink-0 text-xs";
1906
2146
  const buttonSizeClassName = compact ? "w-full min-w-0 max-w-32" : "min-w-28 max-w-48";
1907
2147
  if (normalizedOptions.length <= 1) return null;
1908
2148
  return /* @__PURE__ */ jsx(Listbox, {
@@ -1912,7 +2152,7 @@ function SelectControl(arg0) {
1912
2152
  className: wrapperClassName,
1913
2153
  children: [/* @__PURE__ */ jsxs(ListboxButton, {
1914
2154
  "aria-label": label,
1915
- className: `clarify-api-select-button flex min-h-8 ${buttonSizeClassName} items-center justify-between gap-2 rounded-lg border border-(--clarify-code-border) bg-(--clarify-code-control-background) px-2.5 py-1 text-xs font-medium whitespace-nowrap text-(--clarify-code-text) outline-hidden transition hover:border-white/20 hover:bg-(--clarify-code-control-background-hover) focus:ring-2 focus:ring-(--clarify-ui-accent-border) data-open:border-white/20 data-open:bg-(--clarify-code-control-background-active) data-open:ring-2 data-open:ring-(--clarify-ui-accent-border)`,
2155
+ className: `clarify-openai-select-button flex min-h-8 ${buttonSizeClassName} items-center justify-between gap-2 rounded-lg border border-(--clarify-code-border) bg-(--clarify-code-control-background) px-2.5 py-1 text-xs font-medium whitespace-nowrap text-(--clarify-code-text) outline-hidden transition hover:border-white/20 hover:bg-(--clarify-code-control-background-hover) focus:ring-2 focus:ring-(--clarify-ui-accent-border) data-open:border-white/20 data-open:bg-(--clarify-code-control-background-active) data-open:ring-2 data-open:ring-(--clarify-ui-accent-border)`,
1916
2156
  children: [/* @__PURE__ */ jsxs("span", {
1917
2157
  className: "flex min-w-0 items-center gap-1.5 overflow-hidden",
1918
2158
  children: [icon ? /* @__PURE__ */ jsx("span", {
@@ -1928,10 +2168,10 @@ function SelectControl(arg0) {
1928
2168
  })]
1929
2169
  }), /* @__PURE__ */ jsx(ListboxOptions, {
1930
2170
  anchor: "bottom end",
1931
- 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",
2171
+ className: "clarify-openai-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",
1932
2172
  children: normalizedOptions.map((option) => /* @__PURE__ */ jsxs(ListboxOption, {
1933
2173
  value: option.value,
1934
- className: "clarify-api-select-option group flex min-h-9 cursor-default items-center justify-between gap-3 rounded-lg px-2.5 py-2 text-xs whitespace-nowrap text-(--clarify-code-control-text) select-none data-focus:bg-(--clarify-code-control-background-hover) data-focus:text-(--clarify-code-text) data-selected:bg-(--clarify-code-accent-background) data-selected:text-(--clarify-code-accent-text)",
2174
+ className: "clarify-openai-select-option group flex min-h-9 cursor-default items-center justify-between gap-3 rounded-lg px-2.5 py-2 text-xs whitespace-nowrap text-(--clarify-code-control-text) select-none data-focus:bg-(--clarify-code-control-background-hover) data-focus:text-(--clarify-code-text) data-selected:bg-(--clarify-code-accent-background) data-selected:text-(--clarify-code-accent-text)",
1935
2175
  children: [/* @__PURE__ */ jsx("span", { children: option.label }), /* @__PURE__ */ jsx(CheckIcon, {
1936
2176
  className: "h-3.5 w-3.5 shrink-0 opacity-0 group-data-selected:opacity-100",
1937
2177
  "aria-hidden": "true"
@@ -1980,31 +2220,36 @@ function ExampleMetaValue(arg0) {
1980
2220
  });
1981
2221
  }
1982
2222
  function CodeToolbar(arg0) {
1983
- const { code, languageOptions, selectedLanguageKey, onSelectLanguage, clientOptions, selectedClientKey, onSelectClient } = arg0;
2223
+ const { code, leadingControls, languageOptions, selectedLanguageKey, onSelectLanguage, clientOptions, selectedClientKey, onSelectClient } = arg0;
1984
2224
  const t = useBuiltInText();
2225
+ const inlineControls = Boolean(leadingControls);
1985
2226
  return /* @__PURE__ */ jsxs("div", {
1986
- className: "clarify-api-code-toolbar flex items-center gap-2 px-4 pt-3",
2227
+ className: `clarify-openai-code-toolbar flex items-center gap-2 px-4 pt-3${inlineControls ? " clarify-openai-code-toolbar-inline" : ""}`,
1987
2228
  children: [/* @__PURE__ */ jsxs("div", {
1988
- className: "clarify-api-code-toolbar-controls flex min-w-0 flex-1 flex-wrap items-center gap-2",
1989
- children: [languageOptions && languageOptions.length > 1 && selectedLanguageKey && onSelectLanguage ? /* @__PURE__ */ jsx(SelectControl, {
1990
- label: t("openapi.language"),
1991
- value: selectedLanguageKey,
1992
- options: languageOptions,
1993
- onChange: onSelectLanguage,
1994
- icon: /* @__PURE__ */ jsx(CodeIcon, {
1995
- className: "h-3.5 w-3.5",
1996
- "aria-hidden": "true"
1997
- })
1998
- }) : null, clientOptions && clientOptions.length > 1 && selectedClientKey && onSelectClient ? /* @__PURE__ */ jsx(SelectControl, {
1999
- label: t("openapi.client"),
2000
- value: selectedClientKey,
2001
- options: clientOptions,
2002
- onChange: onSelectClient,
2003
- icon: /* @__PURE__ */ jsx(PackageIcon, {
2004
- className: "h-3.5 w-3.5",
2005
- "aria-hidden": "true"
2006
- })
2007
- }) : null]
2229
+ className: `clarify-openai-code-toolbar-controls flex min-w-0 flex-1 items-center gap-2${inlineControls ? " flex-nowrap overflow-x-auto" : " flex-wrap"}`,
2230
+ children: [
2231
+ leadingControls,
2232
+ languageOptions && languageOptions.length > 1 && selectedLanguageKey && onSelectLanguage ? /* @__PURE__ */ jsx(SelectControl, {
2233
+ label: t("openapi.language"),
2234
+ value: selectedLanguageKey,
2235
+ options: languageOptions,
2236
+ onChange: onSelectLanguage,
2237
+ icon: /* @__PURE__ */ jsx(CodeIcon, {
2238
+ className: "h-3.5 w-3.5",
2239
+ "aria-hidden": "true"
2240
+ })
2241
+ }) : null,
2242
+ clientOptions && clientOptions.length > 1 && selectedClientKey && onSelectClient ? /* @__PURE__ */ jsx(SelectControl, {
2243
+ label: t("openapi.client"),
2244
+ value: selectedClientKey,
2245
+ options: clientOptions,
2246
+ onChange: onSelectClient,
2247
+ icon: /* @__PURE__ */ jsx(PackageIcon, {
2248
+ className: "h-3.5 w-3.5",
2249
+ "aria-hidden": "true"
2250
+ })
2251
+ }) : null
2252
+ ]
2008
2253
  }), /* @__PURE__ */ jsx(CopyCodeButton, { code })]
2009
2254
  });
2010
2255
  }
@@ -2076,21 +2321,38 @@ function getClientOptions(codeOptions, languageKey) {
2076
2321
  //#endregion
2077
2322
  //#region source/openapi/components/ExamplePanels.tsx
2078
2323
  function ApiExampleCodeGroup(arg0) {
2079
- 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;
2324
+ const { title, tag, tagOptions, onSelectTag, label, labelOptions, onSelectLabel, comfortableMeta = false, metaInToolbar = false, code, language, mediaTypes, selectedMediaType, onSelectMediaType, examples, selectedExampleKey, onSelectExample, languageOptions, selectedLanguageKey, onSelectLanguage, clientOptions, selectedClientKey, onSelectClient } = arg0;
2080
2325
  const t = useBuiltInText();
2081
2326
  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";
2327
+ const meta = /* @__PURE__ */ jsxs(Fragment$1, { children: [
2328
+ tag ? /* @__PURE__ */ jsx(ExampleMetaValue, {
2329
+ label: t("openapi.status"),
2330
+ value: tag,
2331
+ options: tagOptions,
2332
+ onChange: onSelectTag,
2333
+ className: "clarify-openai-example-status font-semibold text-emerald-400"
2334
+ }) : null,
2335
+ tag && label ? /* @__PURE__ */ jsx("span", { className: "h-0.5 w-0.5 shrink-0 rounded-full bg-(--clarify-code-faint)" }) : null,
2336
+ label ? /* @__PURE__ */ jsx(ExampleMetaValue, {
2337
+ label: t("openapi.mediaType"),
2338
+ value: label,
2339
+ options: labelOptions,
2340
+ onChange: onSelectLabel,
2341
+ className: "min-w-0 truncate text-xs text-(--clarify-code-muted)"
2342
+ }) : null
2343
+ ] });
2082
2344
  return /* @__PURE__ */ jsx("div", {
2083
- className: "clarify-api-example my-6 overflow-hidden rounded-2xl bg-(--clarify-code-background) shadow-md ring-1 ring-(--clarify-code-border)",
2345
+ className: "clarify-openai-example my-6 overflow-hidden rounded-2xl bg-(--clarify-code-background) shadow-md ring-1 ring-(--clarify-code-border)",
2084
2346
  children: /* @__PURE__ */ jsxs("div", {
2085
2347
  className: "not-prose",
2086
2348
  children: [
2087
2349
  /* @__PURE__ */ jsxs("div", {
2088
- 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",
2350
+ className: "clarify-openai-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",
2089
2351
  children: [/* @__PURE__ */ jsx("h3", {
2090
2352
  className: "mr-auto min-w-16 truncate py-1 text-xs font-semibold text-(--clarify-code-text)",
2091
2353
  children: title
2092
2354
  }), /* @__PURE__ */ jsxs("div", {
2093
- className: "clarify-api-example-header-controls ml-auto flex min-w-0 items-center gap-2 whitespace-nowrap",
2355
+ className: "clarify-openai-example-header-controls ml-auto flex min-w-0 items-center gap-2 whitespace-nowrap",
2094
2356
  children: [mediaTypes && mediaTypes.length > 1 && selectedMediaType && onSelectMediaType ? /* @__PURE__ */ jsx(SelectControl, {
2095
2357
  label: t("openapi.mediaType"),
2096
2358
  value: selectedMediaType,
@@ -2109,30 +2371,15 @@ function ApiExampleCodeGroup(arg0) {
2109
2371
  }) : null]
2110
2372
  })]
2111
2373
  }),
2112
- tag || label ? /* @__PURE__ */ jsxs("div", {
2374
+ (tag || label) && !metaInToolbar ? /* @__PURE__ */ jsx("div", {
2113
2375
  className: metaClassName,
2114
- children: [
2115
- tag ? /* @__PURE__ */ jsx(ExampleMetaValue, {
2116
- label: t("openapi.status"),
2117
- value: tag,
2118
- options: tagOptions,
2119
- onChange: onSelectTag,
2120
- className: "clarify-api-example-status font-semibold text-emerald-400"
2121
- }) : null,
2122
- tag && label ? /* @__PURE__ */ jsx("span", { className: "h-0.5 w-0.5 shrink-0 rounded-full bg-(--clarify-code-faint)" }) : null,
2123
- label ? /* @__PURE__ */ jsx(ExampleMetaValue, {
2124
- label: t("openapi.mediaType"),
2125
- value: label,
2126
- options: labelOptions,
2127
- onChange: onSelectLabel,
2128
- className: "min-w-0 truncate text-xs text-(--clarify-code-muted)"
2129
- }) : null
2130
- ]
2376
+ children: meta
2131
2377
  }) : null,
2132
2378
  /* @__PURE__ */ jsxs("div", {
2133
- className: "clarify-api-example-code group bg-(--clarify-code-background)",
2379
+ className: "clarify-openai-example-code group bg-(--clarify-code-background)",
2134
2380
  children: [/* @__PURE__ */ jsx(CodeToolbar, {
2135
2381
  code,
2382
+ leadingControls: metaInToolbar ? meta : void 0,
2136
2383
  languageOptions,
2137
2384
  selectedLanguageKey,
2138
2385
  onSelectLanguage,
@@ -2328,6 +2575,9 @@ function ResponseExamplesPanel(arg0) {
2328
2575
  if (!state.selectedContent || !state.responseBody) return null;
2329
2576
  return /* @__PURE__ */ jsx(ApiExampleCodeGroup, {
2330
2577
  title: title ?? t("openapi.response"),
2578
+ tag: state.selectedResponse?.status,
2579
+ tagOptions: state.responses.map((response) => response.status),
2580
+ onSelectTag: state.responses.length > 0 ? state.onSelectStatus : void 0,
2331
2581
  label: state.selectedContent?.mediaType,
2332
2582
  labelOptions: state.responseContents.map((content) => content.mediaType),
2333
2583
  onSelectLabel: state.responseContents.length > 0 ? state.onSelectMediaType : void 0,
@@ -2335,7 +2585,8 @@ function ResponseExamplesPanel(arg0) {
2335
2585
  language: codeLanguageForMediaType(state.selectedContent.mediaType),
2336
2586
  examples: state.examples,
2337
2587
  selectedExampleKey: state.selectedExample?.key,
2338
- onSelectExample: state.onSelectExample
2588
+ onSelectExample: state.onSelectExample,
2589
+ metaInToolbar: true
2339
2590
  });
2340
2591
  }
2341
2592
  //#endregion
@@ -2824,6 +3075,50 @@ function EndpointResponse(arg0) {
2824
3075
  });
2825
3076
  }
2826
3077
  //#endregion
3078
+ //#region source/openapi/components/InlineListbox.tsx
3079
+ function InlineListbox(arg0) {
3080
+ const { label, value, options, onChange, compact = false, buttonContent, buttonClassName, className } = arg0;
3081
+ const selected = options.find((option) => option.value === value) ?? options[0];
3082
+ return /* @__PURE__ */ jsx(Listbox, {
3083
+ value: selected?.value ?? value,
3084
+ onChange,
3085
+ children: /* @__PURE__ */ jsxs("div", {
3086
+ className: clsx("pointer-events-auto relative inline-flex min-w-0", className),
3087
+ children: [/* @__PURE__ */ jsx(ListboxButton, {
3088
+ "aria-label": label,
3089
+ className: clsx(buttonClassName ?? "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-ui-text-strong) shadow-xs outline-hidden transition hover:border-(--clarify-ui-text-faint) hover:bg-(--clarify-ui-hover-background) data-open:border-(--clarify-ui-accent-border) data-open:bg-(--clarify-ui-active-background) data-open:ring-2 data-open:ring-(--clarify-ui-accent-border)", buttonClassName ? null : compact ? "min-h-7 max-w-32 px-2 py-0.5 text-xs" : "min-h-8 w-full px-2.5 py-1.5 text-xs"),
3090
+ children: buttonContent ?? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
3091
+ className: "truncate",
3092
+ children: selected?.label ?? value
3093
+ }), /* @__PURE__ */ jsx(ChevronDownIcon, {
3094
+ className: "h-3.5 w-3.5 shrink-0 text-(--clarify-ui-text-faint)",
3095
+ "aria-hidden": "true"
3096
+ })] })
3097
+ }), /* @__PURE__ */ jsx(ListboxOptions, {
3098
+ anchor: "bottom start",
3099
+ 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",
3100
+ children: options.map((option) => /* @__PURE__ */ jsxs(ListboxOption, {
3101
+ value: option.value,
3102
+ className: "group flex min-h-9 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-focus:text-(--clarify-ui-text-strong) data-selected:bg-(--clarify-ui-active-background) data-selected:text-(--clarify-ui-accent-text)",
3103
+ children: [/* @__PURE__ */ jsxs("span", {
3104
+ className: "min-w-0",
3105
+ children: [/* @__PURE__ */ jsx("span", {
3106
+ className: "block truncate",
3107
+ children: option.label
3108
+ }), option.description ? /* @__PURE__ */ jsx("span", {
3109
+ className: "mt-0.5 block truncate text-2xs text-(--clarify-ui-text-faint)",
3110
+ children: option.description
3111
+ }) : null]
3112
+ }), /* @__PURE__ */ jsx(CheckIcon, {
3113
+ className: "h-3.5 w-3.5 shrink-0 opacity-0 group-data-selected:opacity-100",
3114
+ "aria-hidden": "true"
3115
+ })]
3116
+ }, option.value))
3117
+ })]
3118
+ })
3119
+ });
3120
+ }
3121
+ //#endregion
2827
3122
  //#region source/openapi/components/OpenApiOperation.state.ts
2828
3123
  function useOperationRequestState(spec, path, operation, source = "path") {
2829
3124
  const parameters = getOperationParameters(spec, path, operation, source);
@@ -2942,48 +3237,6 @@ function EndpointPath(arg0) {
2942
3237
  }) : null]
2943
3238
  });
2944
3239
  }
2945
- function InlineListbox(arg0) {
2946
- const { label, value, options, onChange, compact = false } = arg0;
2947
- const selected = options.find((option) => option.value === value) ?? options[0];
2948
- return /* @__PURE__ */ jsx(Listbox, {
2949
- value: selected?.value ?? value,
2950
- onChange,
2951
- children: /* @__PURE__ */ jsxs("div", {
2952
- className: "pointer-events-auto relative inline-flex min-w-0",
2953
- children: [/* @__PURE__ */ jsxs(ListboxButton, {
2954
- "aria-label": label,
2955
- 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-ui-text-strong) shadow-xs outline-hidden transition hover:border-(--clarify-ui-text-faint) hover:bg-(--clarify-ui-hover-background) data-open:border-(--clarify-ui-accent-border) data-open:bg-(--clarify-ui-active-background) data-open:ring-2 data-open:ring-(--clarify-ui-accent-border)", compact ? "min-h-7 max-w-32 px-2 py-0.5 text-xs" : "min-h-8 w-full px-2.5 py-1.5 text-xs"),
2956
- children: [/* @__PURE__ */ jsx("span", {
2957
- className: "truncate",
2958
- children: selected?.label ?? value
2959
- }), /* @__PURE__ */ jsx(ChevronDownIcon, {
2960
- className: "h-3.5 w-3.5 shrink-0 text-(--clarify-ui-text-faint)",
2961
- "aria-hidden": "true"
2962
- })]
2963
- }), /* @__PURE__ */ jsx(ListboxOptions, {
2964
- anchor: "bottom start",
2965
- 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",
2966
- children: options.map((option) => /* @__PURE__ */ jsxs(ListboxOption, {
2967
- value: option.value,
2968
- className: "group flex min-h-9 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-focus:text-(--clarify-ui-text-strong) data-selected:bg-(--clarify-ui-active-background) data-selected:text-(--clarify-ui-accent-text)",
2969
- children: [/* @__PURE__ */ jsxs("span", {
2970
- className: "min-w-0",
2971
- children: [/* @__PURE__ */ jsx("span", {
2972
- className: "block truncate",
2973
- children: option.label
2974
- }), option.description ? /* @__PURE__ */ jsx("span", {
2975
- className: "mt-0.5 block truncate text-2xs text-(--clarify-ui-text-faint)",
2976
- children: option.description
2977
- }) : null]
2978
- }), /* @__PURE__ */ jsx(CheckIcon, {
2979
- className: "h-3.5 w-3.5 shrink-0 opacity-0 group-data-selected:opacity-100",
2980
- "aria-hidden": "true"
2981
- })]
2982
- }, option.value))
2983
- })]
2984
- })
2985
- });
2986
- }
2987
3240
  function getServerPreviewUrl(server, variables) {
2988
3241
  return (server.url ?? "").replace(/\{([^}]+)\}/g, (_, name) => variables[name] ?? server.variables?.[name]?.default ?? `{${name}}`);
2989
3242
  }
@@ -3007,7 +3260,7 @@ function getDefaultResponseStatus(operation, spec) {
3007
3260
  return orderedResponses.find(({ status }) => status === "default")?.status ?? orderedResponses.find(({ status }) => status.startsWith("2"))?.status ?? orderedResponses[0]?.status ?? "";
3008
3261
  }
3009
3262
  function ServerUrlValue(arg0) {
3010
- const { server, variables, open, interactive, onToggle } = arg0;
3263
+ const { servers, selectedKey, server, variables, open, interactive, directSelect, onSelect, onToggle } = arg0;
3011
3264
  const url = getServerPreviewUrl(server, variables);
3012
3265
  const protocolLabel = getServerProtocolLabel(server, variables);
3013
3266
  if (!interactive) return /* @__PURE__ */ jsxs("span", {
@@ -3030,12 +3283,47 @@ function ServerUrlValue(arg0) {
3030
3283
  })]
3031
3284
  })]
3032
3285
  });
3286
+ if (directSelect) return /* @__PURE__ */ jsx(InlineListbox, {
3287
+ label: "Server",
3288
+ value: selectedKey,
3289
+ options: servers.map((option, index) => ({
3290
+ value: getServerKey(option, index),
3291
+ label: getServerLabel(option, index),
3292
+ description: option.description
3293
+ })),
3294
+ onChange: onSelect,
3295
+ className: "w-8 shrink-0 sm:w-fit sm:min-w-16 sm:max-w-(--clarify-server-url-max-width)",
3296
+ buttonClassName: "group flex h-8 w-full min-w-0 cursor-pointer items-center justify-center rounded-lg bg-(--clarify-ui-subtle-background) px-0 text-(--clarify-ui-text) transition-colors hover:bg-(--clarify-ui-hover-background) hover:text-(--clarify-theme-tokens-colors-foreground) focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--clarify-theme-tokens-colors-primary) data-open:bg-(--clarify-ui-active-background) data-open:text-(--clarify-theme-tokens-colors-foreground) sm:px-1.5",
3297
+ buttonContent: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
3298
+ className: "sm:hidden",
3299
+ children: /* @__PURE__ */ jsx(ServerIcon, {
3300
+ className: "h-4 w-4",
3301
+ "aria-hidden": "true"
3302
+ })
3303
+ }), /* @__PURE__ */ jsxs("span", {
3304
+ className: "hidden min-w-0 items-center gap-1 overflow-hidden sm:flex",
3305
+ children: [
3306
+ protocolLabel ? /* @__PURE__ */ jsx("span", {
3307
+ className: "shrink-0 rounded bg-sky-100 px-1.5 py-0.5 text-2xs font-black text-sky-700 dark:bg-sky-400/15 dark:text-sky-200",
3308
+ children: protocolLabel
3309
+ }) : null,
3310
+ /* @__PURE__ */ jsx("span", {
3311
+ className: "truncate font-semibold text-xs",
3312
+ children: url
3313
+ }),
3314
+ /* @__PURE__ */ jsx(ChevronDownIcon, {
3315
+ className: "h-3.5 w-3.5 shrink-0 text-zinc-400 transition-transform group-data-open:rotate-180",
3316
+ "aria-hidden": "true"
3317
+ })
3318
+ ]
3319
+ })] })
3320
+ });
3033
3321
  return /* @__PURE__ */ jsxs("button", {
3034
3322
  type: "button",
3035
3323
  "aria-expanded": open,
3036
3324
  "aria-label": "Server",
3037
3325
  onClick: onToggle,
3038
- className: clsx("flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-(--clarify-ui-subtle-background) text-(--clarify-ui-text) transition hover:bg-(--clarify-ui-hover-background) hover:text-(--clarify-theme-tokens-colors-foreground) focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--clarify-theme-tokens-colors-primary) 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),
3326
+ className: clsx("flex h-8 w-8 shrink-0 cursor-pointer items-center justify-center rounded-lg bg-(--clarify-ui-subtle-background) text-(--clarify-ui-text) transition-colors hover:bg-(--clarify-ui-hover-background) hover:text-(--clarify-theme-tokens-colors-foreground) focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--clarify-theme-tokens-colors-primary) 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),
3039
3327
  children: [/* @__PURE__ */ jsx("span", {
3040
3328
  className: "sm:hidden",
3041
3329
  children: /* @__PURE__ */ jsx(ServerIcon, {
@@ -3054,7 +3342,7 @@ function ServerUrlValue(arg0) {
3054
3342
  children: url
3055
3343
  }),
3056
3344
  /* @__PURE__ */ jsx(ChevronDownIcon, {
3057
- className: "h-3.5 w-3.5 shrink-0 text-zinc-400",
3345
+ className: clsx("h-3.5 w-3.5 shrink-0 text-zinc-400 transition-transform", open && "rotate-180"),
3058
3346
  "aria-hidden": "true"
3059
3347
  })
3060
3348
  ]
@@ -3166,6 +3454,7 @@ function AuthPanel(arg0) {
3166
3454
  }
3167
3455
  function EndpointIdentity(arg0) {
3168
3456
  const { method, operationSource, path, servers, selectedServerKey, selectedServer, serverVariables, serverOpen, authOptions, selectedAuthName, selectedAuth, authValues, authOpen, onSelectServer, onChangeServerVariable, onToggleServer, onToggleAuth, onSelectAuth, onChangeAuthValue } = arg0;
3457
+ const directServerSelect = servers.length > 1 && servers.every((server) => Object.keys(server.variables ?? {}).length === 0);
3169
3458
  const serverInteractive = servers.length > 1 || Object.keys(selectedServer.variables ?? {}).length > 0;
3170
3459
  const [copiedUrl, setCopiedUrl] = useState(false);
3171
3460
  const fullUrl = getFullEndpointUrl(selectedServer, serverVariables, path);
@@ -3178,7 +3467,7 @@ function EndpointIdentity(arg0) {
3178
3467
  if (await copyTextToClipboard(fullUrl)) setCopiedUrl(true);
3179
3468
  }
3180
3469
  return /* @__PURE__ */ jsxs("div", {
3181
- 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",
3470
+ className: "clarify-openai-endpoint-identity 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",
3182
3471
  children: [
3183
3472
  /* @__PURE__ */ jsxs("div", {
3184
3473
  className: "flex min-w-0 items-center gap-1.5 overflow-hidden px-2.5 py-2",
@@ -3186,10 +3475,14 @@ function EndpointIdentity(arg0) {
3186
3475
  /* @__PURE__ */ jsx(EndpointMethodBadge, { method }),
3187
3476
  operationSource === "webhook" ? /* @__PURE__ */ jsx(EndpointMethodBadge, { method: "WEBHOOK" }) : null,
3188
3477
  /* @__PURE__ */ jsx(ServerUrlValue, {
3478
+ servers,
3479
+ selectedKey: selectedServerKey,
3189
3480
  server: selectedServer,
3190
3481
  variables: serverVariables,
3191
3482
  open: serverOpen,
3192
3483
  interactive: serverInteractive,
3484
+ directSelect: directServerSelect,
3485
+ onSelect: onSelectServer,
3193
3486
  onToggle: onToggleServer
3194
3487
  }),
3195
3488
  /* @__PURE__ */ jsx(EndpointPath, {
@@ -3213,7 +3506,7 @@ function EndpointIdentity(arg0) {
3213
3506
  }) : null
3214
3507
  ]
3215
3508
  }),
3216
- serverInteractive && serverOpen ? /* @__PURE__ */ jsx(ServerPanel, {
3509
+ serverInteractive && !directServerSelect && serverOpen ? /* @__PURE__ */ jsx(ServerPanel, {
3217
3510
  servers,
3218
3511
  selectedKey: selectedServerKey,
3219
3512
  selectedServer,
@@ -3243,7 +3536,7 @@ function OpenApiOperation(arg0) {
3243
3536
  const [linkedExampleKey, setLinkedExampleKey] = useState("");
3244
3537
  const [selectedResponseStatus, setSelectedResponseStatus] = useState(() => getDefaultResponseStatus(operation, spec));
3245
3538
  return /* @__PURE__ */ jsxs("section", {
3246
- className: "clarify-api-endpoint scroll-mt-24 pb-16 first:pt-0 last:pb-0",
3539
+ className: "clarify-openai-endpoint scroll-mt-24 pb-16 first:pt-0 last:pb-0",
3247
3540
  "aria-labelledby": id,
3248
3541
  children: [
3249
3542
  /* @__PURE__ */ jsx(Heading, {
@@ -3309,6 +3602,6 @@ function OpenApiOperation(arg0) {
3309
3602
  });
3310
3603
  }
3311
3604
  //#endregion
3312
- export { CardGroup as A, Feedback as C, Pre as D, CodeGroup as E, Button as M, Mermaid as O, Tag as S, Code as T, Prose as _, authPlaceholder as a, Logo as b, getServerKey as c, listOpenApiOperations as d, getMediaTypeEntries as f, WebFrame as g, primitives_exports as h, ResponseExamplesPanel as i, Callout as j, Card as k, getServers as l, Markdown as m, OpenApiOperation as n, defaultServerVariables as o, getRequestBody$1 as p, RequestExamplesPanel as r, getAuthOptions as s, EndpointIdentity as t, getOpenApiOperationEntry as u, GridPattern as v, Collapse as w, Heading as x, HeroPattern as y };
3605
+ export { CodeGroup as A, HeroPattern as C, Feedback as D, Tag as E, Callout as F, Button as I, Mermaid as M, Card as N, Collapse as O, CardGroup as P, GridPattern as S, Heading as T, TabItem as _, authPlaceholder as a, Steps as b, getServerKey as c, listOpenApiOperations as d, getMediaTypeEntries as f, WebFrame as g, primitives_exports as h, ResponseExamplesPanel as i, Pre as j, Code as k, getServers as l, Markdown as m, OpenApiOperation as n, defaultServerVariables as o, getRequestBody$1 as p, RequestExamplesPanel as r, getAuthOptions as s, EndpointIdentity as t, getOpenApiOperationEntry as u, Tabs as v, Logo as w, Prose as x, Step as y };
3313
3606
 
3314
- //# sourceMappingURL=OpenApiOperation-DgrqzeiS.js.map
3607
+ //# sourceMappingURL=OpenApiOperation-BZWeCbvy.js.map