@clarify-labs/renderer 0.6.3 → 0.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/output/{OpenApiOperation-mhoi-s4N.cjs → OpenApiOperation-CsDX1s-6.cjs} +875 -81
  2. package/output/OpenApiOperation-CsDX1s-6.cjs.map +1 -0
  3. package/output/{OpenApiOperation-DYXG-6Rw.js → OpenApiOperation-WntXLbai.js} +778 -74
  4. package/output/OpenApiOperation-WntXLbai.js.map +1 -0
  5. package/output/ThemeRoot-DXoVzHSZ.cjs +1800 -0
  6. package/output/ThemeRoot-DXoVzHSZ.cjs.map +1 -0
  7. package/output/ThemeRoot-Dr8JC8Yc.js +1757 -0
  8. package/output/ThemeRoot-Dr8JC8Yc.js.map +1 -0
  9. package/output/app/ErrorBoundary.d.ts +29 -0
  10. package/output/client.cjs +5 -1
  11. package/output/client.d.ts +2 -0
  12. package/output/client.js +3 -2
  13. package/output/core/i18n.d.ts +1 -1
  14. package/output/core/types.d.ts +30 -9
  15. package/output/index.cjs +41 -31
  16. package/output/index.cjs.map +1 -1
  17. package/output/index.d.ts +3 -1
  18. package/output/index.js +18 -11
  19. package/output/index.js.map +1 -1
  20. package/output/openapi/entry.d.ts +1 -0
  21. package/output/preview.cjs +4 -3
  22. package/output/preview.cjs.map +1 -1
  23. package/output/preview.js +4 -3
  24. package/output/preview.js.map +1 -1
  25. package/output/{render-CjZt3edL.cjs → render-BfNmzJeJ.cjs} +12 -8
  26. package/output/render-BfNmzJeJ.cjs.map +1 -0
  27. package/output/{render-BpavVnAe.js → render-DS2wcTZJ.js} +12 -8
  28. package/output/render-DS2wcTZJ.js.map +1 -0
  29. package/output/renderer.css +450 -565
  30. package/output/server.cjs +11 -7
  31. package/output/server.cjs.map +1 -1
  32. package/output/server.js +11 -7
  33. package/output/server.js.map +1 -1
  34. package/output/{shell-_MyLsMUI.cjs → shell-D4tS8Jts.cjs} +112 -1016
  35. package/output/shell-D4tS8Jts.cjs.map +1 -0
  36. package/output/{shell-BlMMdTpZ.js → shell-DvTfFx6M.js} +107 -933
  37. package/output/shell-DvTfFx6M.js.map +1 -0
  38. package/output/theme/ThemeEditor.d.ts +67 -0
  39. package/output/theme/ThemeProvider.d.ts +1 -1
  40. package/output/theme/ThemeRoot.d.ts +9 -0
  41. package/output/theme/randomTheme.d.ts +2 -0
  42. package/output/theme/variables.d.ts +62 -0
  43. package/package.json +1 -1
  44. package/output/AppShell-D3FsVHQK.js +0 -390
  45. package/output/AppShell-D3FsVHQK.js.map +0 -1
  46. package/output/AppShell-DeaJ-rgo.cjs +0 -409
  47. package/output/AppShell-DeaJ-rgo.cjs.map +0 -1
  48. package/output/OpenApiOperation-DYXG-6Rw.js.map +0 -1
  49. package/output/OpenApiOperation-mhoi-s4N.cjs.map +0 -1
  50. package/output/render-BpavVnAe.js.map +0 -1
  51. package/output/render-CjZt3edL.cjs.map +0 -1
  52. package/output/shell-BlMMdTpZ.js.map +0 -1
  53. package/output/shell-_MyLsMUI.cjs.map +0 -1
@@ -1,11 +1,11 @@
1
1
  import clsx from "clsx";
2
- import { Children, Fragment, Suspense, createContext, forwardRef, isValidElement, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
2
+ import { Fragment, Suspense, createContext, forwardRef, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
3
3
  import { Link, useLocation, useNavigate } from "react-router-dom";
4
- import { CloseButton, Dialog, DialogBackdrop, DialogPanel, Menu, MenuButton, MenuItem, MenuItems, Tab, TabGroup, TabList, TabPanel, TabPanels, Transition, TransitionChild } from "@headlessui/react";
4
+ import { CloseButton, Dialog, DialogBackdrop, DialogPanel, Menu, MenuButton, MenuItem, MenuItems, TransitionChild } from "@headlessui/react";
5
5
  import * as LucideIcons from "lucide-react";
6
- import { AlertTriangle, Check, CheckCircle2, ChevronDown, Copy, ExternalLink, FileText, Info, Lightbulb, Link2, MoreHorizontal, XCircle } from "lucide-react";
6
+ import { Check, ChevronDown, Copy, ExternalLink, FileText, Globe2, Link2, Menu as Menu$1, Moon, MoreHorizontal, PencilLine, Search, SearchX, Sun, X } from "lucide-react";
7
7
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
8
- import { AnimatePresence, motion, useInView, useIsPresent, useScroll, useTransform } from "framer-motion";
8
+ import { AnimatePresence, motion, useIsPresent, useScroll, useTransform } from "framer-motion";
9
9
  import { create, createStore, useStore } from "zustand";
10
10
  //#region source/core/context.tsx
11
11
  var ClarifyConfigContext = createContext(null);
@@ -41,6 +41,8 @@ var builtInText = {
41
41
  "contentActions.copyLlms": "Copy llms.txt",
42
42
  "contentActions.copyLlmsDescription": "Copy the llms.txt link for this site",
43
43
  "contentActions.copiedLlms": "Copied llms.txt",
44
+ "contentActions.editPage": "Edit this page",
45
+ "contentActions.editPageDescription": "Open the source file for this page",
44
46
  "contentActions.copyOptions": "Choose copy option",
45
47
  "contentActions.copiedContent": "Copied page",
46
48
  "contentActions.copiedLink": "Copied link",
@@ -60,6 +62,10 @@ var builtInText = {
60
62
  "navbar.home": "Home",
61
63
  "navbar.openLinks": "Open navigation links",
62
64
  "navbar.sections": "Documentation sections",
65
+ "notFound.description": "The page may have moved, been renamed, or never existed. Check the address or return to the homepage.",
66
+ "notFound.home": "Back to homepage",
67
+ "notFound.label": "404",
68
+ "notFound.title": "Page not found",
63
69
  "openapi.apiDocumentation": "API Documentation",
64
70
  "openapi.bodyProperties": "Body properties",
65
71
  "openapi.collapse": "Collapse",
@@ -93,6 +99,16 @@ var builtInText = {
93
99
  "search.noResults": "Nothing found for {query}.",
94
100
  "search.placeholder": "Find something...",
95
101
  "search.shortcutCtrl": "Ctrl ",
102
+ "renderError.componentStack": "React component stack",
103
+ "renderError.description": "Clarify stopped rendering this route to keep the rest of the shell responsive. Review the diagnostics below, fix the page source, then reload the route.",
104
+ "renderError.details": "Runtime diagnostics",
105
+ "renderError.message": "Message",
106
+ "renderError.path": "Route",
107
+ "renderError.reload": "Reload route",
108
+ "renderError.stack": "JavaScript stack trace",
109
+ "renderError.timestamp": "Captured at",
110
+ "renderError.title": "Route render failed",
111
+ "renderError.type": "Error type",
96
112
  "theme.switchToDark": "Switch to dark theme",
97
113
  "theme.switchToLight": "Switch to light theme",
98
114
  "language.switch": "Switch language"
@@ -116,6 +132,8 @@ var builtInText = {
116
132
  "contentActions.copyLlms": "复制 llms.txt",
117
133
  "contentActions.copyLlmsDescription": "复制此站点的 llms.txt 链接",
118
134
  "contentActions.copiedLlms": "已复制 llms.txt",
135
+ "contentActions.editPage": "编辑此页面",
136
+ "contentActions.editPageDescription": "打开当前页面的源文件",
119
137
  "contentActions.copyOptions": "选择复制选项",
120
138
  "contentActions.copiedContent": "已复制页面",
121
139
  "contentActions.copiedLink": "已复制链接",
@@ -135,6 +153,10 @@ var builtInText = {
135
153
  "navbar.home": "首页",
136
154
  "navbar.openLinks": "打开导航链接",
137
155
  "navbar.sections": "文档栏目",
156
+ "notFound.description": "页面可能已移动、重命名或不存在。请检查地址,或返回首页继续浏览。",
157
+ "notFound.home": "返回首页",
158
+ "notFound.label": "404",
159
+ "notFound.title": "页面未找到",
138
160
  "openapi.apiDocumentation": "API 文档",
139
161
  "openapi.bodyProperties": "请求体属性",
140
162
  "openapi.collapse": "收起",
@@ -168,6 +190,16 @@ var builtInText = {
168
190
  "search.noResults": "没有找到与 {query} 相关的结果。",
169
191
  "search.placeholder": "搜索内容...",
170
192
  "search.shortcutCtrl": "Ctrl ",
193
+ "renderError.componentStack": "React 组件栈",
194
+ "renderError.description": "Clarify 已停止渲染此路由,以保证文档 Shell 仍可响应。请查看下方诊断信息,修复页面源码后重新加载路由。",
195
+ "renderError.details": "运行时诊断",
196
+ "renderError.message": "错误消息",
197
+ "renderError.path": "路由",
198
+ "renderError.reload": "重新加载路由",
199
+ "renderError.stack": "JavaScript 堆栈",
200
+ "renderError.timestamp": "捕获时间",
201
+ "renderError.title": "路由渲染失败",
202
+ "renderError.type": "错误类型",
171
203
  "theme.switchToDark": "切换到深色主题",
172
204
  "theme.switchToLight": "切换到浅色主题",
173
205
  "language.switch": "切换语言"
@@ -248,8 +280,8 @@ function ContentActions(arg0) {
248
280
  const { hasTabs = false, route, routePrefix } = arg0;
249
281
  const t = useBuiltInText();
250
282
  const [copied, setCopied] = useState("idle");
251
- if (!route?.contentArtifactUrl) return null;
252
- const contentArtifactUrl = resolveContentArtifactUrl(route.contentArtifactUrl, routePrefix);
283
+ if (!route?.contentArtifactUrl && !route?.sourceUrl) return null;
284
+ const contentArtifactUrl = route.contentArtifactUrl ? resolveContentArtifactUrl(route.contentArtifactUrl, routePrefix) : void 0;
253
285
  const isOpenApi = route.kind === "openapi";
254
286
  const replacements = { contentType: isOpenApi ? "OpenAPI" : "Markdown" };
255
287
  const viewLabel = isOpenApi ? t("contentActions.viewOpenApi") : t("contentActions.viewMarkdown");
@@ -259,16 +291,18 @@ function ContentActions(arg0) {
259
291
  window.setTimeout(() => setCopied("idle"), 1600);
260
292
  }
261
293
  async function handleCopyContent() {
294
+ if (!contentArtifactUrl) return;
262
295
  if (await copyTextToClipboard(await (await fetch(contentArtifactUrl)).text())) markCopied("content");
263
296
  }
264
297
  const llmsArtifactUrl = resolveContentArtifactUrl("/llms.txt", routePrefix);
265
298
  async function handleCopyLink() {
299
+ if (!contentArtifactUrl) return;
266
300
  if (await copyTextToClipboard(getAbsoluteUrl(contentArtifactUrl))) markCopied("link");
267
301
  }
268
302
  async function handleCopyLlms() {
269
303
  if (await copyTextToClipboard(getAbsoluteUrl(llmsArtifactUrl))) markCopied("llms");
270
304
  }
271
- const actions = [{
305
+ const actions = contentArtifactUrl ? [{
272
306
  key: "content",
273
307
  label: t("contentActions.copyContent"),
274
308
  description: t("contentActions.copyContentDescription", replacements),
@@ -282,7 +316,7 @@ function ContentActions(arg0) {
282
316
  icon: Link2,
283
317
  run: handleCopyLink,
284
318
  copiedLabel: t("contentActions.copiedLink")
285
- }];
319
+ }] : [];
286
320
  const llmsAction = {
287
321
  key: "llms",
288
322
  label: t("contentActions.copyLlms"),
@@ -292,28 +326,57 @@ function ContentActions(arg0) {
292
326
  copiedLabel: t("contentActions.copiedLlms")
293
327
  };
294
328
  const primaryAction = actions[0];
295
- const PrimaryIcon = copied === primaryAction.key ? Check : primaryAction.icon;
329
+ const PrimaryIcon = primaryAction && copied === primaryAction.key ? Check : primaryAction?.icon ?? PencilLine;
296
330
  return /* @__PURE__ */ jsx("div", {
297
331
  className: `clarify-content-actions sticky z-20 flex justify-end py-4 ${hasTabs ? "top-16 lg:top-30" : "top-16"}`,
298
332
  children: /* @__PURE__ */ jsxs(Menu, {
299
333
  as: "div",
300
334
  className: "clarify-content-actions-menu relative inline-flex text-sm font-medium",
301
335
  children: [/* @__PURE__ */ jsxs("div", {
302
- className: "clarify-content-actions-group inline-flex overflow-hidden rounded-full border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface)/90 shadow-sm shadow-zinc-900/5 backdrop-blur dark:border-white/10 dark:bg-zinc-900/80 dark:shadow-none",
303
- children: [/* @__PURE__ */ jsxs("button", {
336
+ className: "clarify-content-actions-group inline-flex overflow-hidden rounded-full border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface)/90 shadow-sm shadow-zinc-900/5 backdrop-blur",
337
+ children: [primaryAction ? /* @__PURE__ */ jsxs("button", {
304
338
  type: "button",
305
339
  onClick: primaryAction.run,
306
340
  className: "clarify-content-actions-primary clarify-ui-control inline-flex h-8 items-center gap-1.5 px-3 transition",
307
341
  children: [/* @__PURE__ */ jsx(PrimaryIcon, { className: "h-3.5 w-3.5" }), copied === primaryAction.key ? t("actions.copied") : primaryAction.label]
342
+ }) : /* @__PURE__ */ jsxs("a", {
343
+ href: route.sourceUrl,
344
+ target: "_blank",
345
+ rel: "noreferrer",
346
+ className: "clarify-content-actions-primary clarify-ui-control inline-flex h-8 items-center gap-1.5 px-3 no-underline transition",
347
+ children: [/* @__PURE__ */ jsx(PrimaryIcon, { className: "h-3.5 w-3.5" }), t("contentActions.editPage")]
308
348
  }), /* @__PURE__ */ jsx(MenuButton, {
309
- className: "clarify-content-actions-trigger clarify-ui-control inline-flex h-8 w-8 items-center justify-center border-l border-(--clarify-theme-tokens-colors-border) transition dark:border-white/10",
349
+ className: "clarify-content-actions-trigger clarify-ui-control inline-flex h-8 w-8 items-center justify-center border-l border-(--clarify-theme-tokens-colors-border) transition",
310
350
  "aria-label": t("contentActions.copyOptions"),
311
351
  children: /* @__PURE__ */ jsx(ChevronDown, { className: "h-3.5 w-3.5" })
312
352
  })]
313
353
  }), /* @__PURE__ */ jsxs(MenuItems, {
314
354
  anchor: "bottom end",
315
- className: "clarify-content-actions-list clarify-ui-menu z-30 mt-2 w-(--clarify-ui-action-menu-width) origin-top-right rounded-(--clarify-theme-tokens-radius-xl) border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) p-1.5 shadow-xl shadow-zinc-900/5 transition [--anchor-gap:--spacing(2)] focus:outline-none data-closed:scale-95 data-closed:opacity-0 dark:border-white/10 dark:bg-zinc-900 dark:shadow-none",
355
+ className: "clarify-content-actions-list clarify-ui-menu z-30 mt-2 w-(--clarify-ui-action-menu-width) origin-top-right rounded-(--clarify-theme-tokens-radius-xl) border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) p-1.5 shadow-xl shadow-zinc-900/5 transition [--anchor-gap:--spacing(2)] focus:outline-none data-closed:scale-95 data-closed:opacity-0",
316
356
  children: [
357
+ route.sourceUrl ? /* @__PURE__ */ jsx(MenuItem, { children: /* @__PURE__ */ jsxs("a", {
358
+ href: route.sourceUrl,
359
+ target: "_blank",
360
+ rel: "noreferrer",
361
+ className: "clarify-content-actions-item clarify-ui-menu-item group flex w-full items-center gap-2 rounded-(--clarify-theme-tokens-radius-lg) px-1.5 py-1.5 text-left no-underline transition",
362
+ children: [
363
+ /* @__PURE__ */ jsx("span", {
364
+ className: "clarify-ui-menu-icon flex shrink-0 rounded-(--clarify-theme-tokens-radius-md) border border-(--clarify-theme-tokens-colors-border) p-1.5",
365
+ children: /* @__PURE__ */ jsx(PencilLine, { className: "h-4 w-4" })
366
+ }),
367
+ /* @__PURE__ */ jsxs("span", {
368
+ className: "flex min-w-0 flex-1 flex-col px-1",
369
+ children: [/* @__PURE__ */ jsxs("span", {
370
+ className: "clarify-ui-menu-title flex items-center gap-1",
371
+ children: [t("contentActions.editPage"), /* @__PURE__ */ jsx(ExternalLink, { className: "clarify-ui-menu-icon h-3 w-3" })]
372
+ }), /* @__PURE__ */ jsx("span", {
373
+ className: "clarify-ui-menu-description truncate",
374
+ children: t("contentActions.editPageDescription")
375
+ })]
376
+ }),
377
+ /* @__PURE__ */ jsx(Check, { className: "h-3.5 w-3.5 shrink-0 text-(--clarify-theme-tokens-colors-primary) opacity-0" })
378
+ ]
379
+ }) }) : null,
317
380
  actions.slice(0, 1).map((action) => {
318
381
  const Icon = action.icon;
319
382
  const isCopied = copied === action.key;
@@ -323,7 +386,7 @@ function ContentActions(arg0) {
323
386
  className: "clarify-content-actions-item clarify-ui-menu-item group flex w-full items-center gap-2 rounded-(--clarify-theme-tokens-radius-lg) px-1.5 py-1.5 text-left transition",
324
387
  children: [
325
388
  /* @__PURE__ */ jsx("span", {
326
- className: "clarify-ui-menu-icon flex shrink-0 rounded-(--clarify-theme-tokens-radius-md) border border-(--clarify-theme-tokens-colors-border) p-1.5 dark:border-white/10",
389
+ className: "clarify-ui-menu-icon flex shrink-0 rounded-(--clarify-theme-tokens-radius-md) border border-(--clarify-theme-tokens-colors-border) p-1.5",
327
390
  children: /* @__PURE__ */ jsx(Icon, { className: "h-4 w-4" })
328
391
  }),
329
392
  /* @__PURE__ */ jsxs("span", {
@@ -340,14 +403,14 @@ function ContentActions(arg0) {
340
403
  ]
341
404
  }) }, action.key);
342
405
  }),
343
- /* @__PURE__ */ jsx(MenuItem, { children: /* @__PURE__ */ jsxs("a", {
406
+ contentArtifactUrl ? /* @__PURE__ */ jsx(MenuItem, { children: /* @__PURE__ */ jsxs("a", {
344
407
  href: contentArtifactUrl,
345
408
  target: "_blank",
346
409
  rel: "noreferrer",
347
410
  className: "clarify-content-actions-item clarify-ui-menu-item group flex w-full items-center gap-2 rounded-(--clarify-theme-tokens-radius-lg) px-1.5 py-1.5 text-left no-underline transition",
348
411
  children: [
349
412
  /* @__PURE__ */ jsx("span", {
350
- className: "clarify-ui-menu-icon flex shrink-0 rounded-(--clarify-theme-tokens-radius-md) border border-(--clarify-theme-tokens-colors-border) p-1.5 dark:border-white/10",
413
+ className: "clarify-ui-menu-icon flex shrink-0 rounded-(--clarify-theme-tokens-radius-md) border border-(--clarify-theme-tokens-colors-border) p-1.5",
351
414
  children: /* @__PURE__ */ jsx(FileText, { className: "h-4 w-4" })
352
415
  }),
353
416
  /* @__PURE__ */ jsxs("span", {
@@ -362,7 +425,7 @@ function ContentActions(arg0) {
362
425
  }),
363
426
  /* @__PURE__ */ jsx(Check, { className: "h-3.5 w-3.5 shrink-0 text-(--clarify-theme-tokens-colors-primary) opacity-0" })
364
427
  ]
365
- }) }),
428
+ }) }) : null,
366
429
  actions.slice(1).map((action) => {
367
430
  const Icon = action.icon;
368
431
  const isCopied = copied === action.key;
@@ -372,7 +435,7 @@ function ContentActions(arg0) {
372
435
  className: "clarify-content-actions-item clarify-ui-menu-item group flex w-full items-center gap-2 rounded-(--clarify-theme-tokens-radius-lg) px-1.5 py-1.5 text-left transition",
373
436
  children: [
374
437
  /* @__PURE__ */ jsx("span", {
375
- className: "clarify-ui-menu-icon flex shrink-0 rounded-(--clarify-theme-tokens-radius-md) border border-(--clarify-theme-tokens-colors-border) p-1.5 dark:border-white/10",
438
+ className: "clarify-ui-menu-icon flex shrink-0 rounded-(--clarify-theme-tokens-radius-md) border border-(--clarify-theme-tokens-colors-border) p-1.5",
376
439
  children: /* @__PURE__ */ jsx(Icon, { className: "h-4 w-4" })
377
440
  }),
378
441
  /* @__PURE__ */ jsxs("span", {
@@ -395,7 +458,7 @@ function ContentActions(arg0) {
395
458
  className: "clarify-content-actions-item clarify-ui-menu-item group flex w-full items-center gap-2 rounded-(--clarify-theme-tokens-radius-lg) px-1.5 py-1.5 text-left transition",
396
459
  children: [
397
460
  /* @__PURE__ */ jsx("span", {
398
- className: "clarify-ui-menu-icon flex shrink-0 rounded-(--clarify-theme-tokens-radius-md) border border-(--clarify-theme-tokens-colors-border) p-1.5 dark:border-white/10",
461
+ className: "clarify-ui-menu-icon flex shrink-0 rounded-(--clarify-theme-tokens-radius-md) border border-(--clarify-theme-tokens-colors-border) p-1.5",
399
462
  children: /* @__PURE__ */ jsx(FileText, { className: "h-4 w-4" })
400
463
  }),
401
464
  /* @__PURE__ */ jsxs("span", {
@@ -444,8 +507,8 @@ function applyTheme(resolvedTheme) {
444
507
  document.documentElement.classList.toggle("dark", resolvedTheme === "dark");
445
508
  document.documentElement.style.colorScheme = resolvedTheme;
446
509
  }
447
- function ThemeProvider(arg0) {
448
- const { children } = arg0;
510
+ function ThemeProvider(props) {
511
+ const { children } = props;
449
512
  const [theme, setThemeState] = useState(() => getStoredTheme());
450
513
  const [systemTheme, setSystemTheme] = useState(() => getSystemTheme());
451
514
  const resolvedTheme = theme === "system" ? systemTheme : theme;
@@ -482,40 +545,19 @@ function useTheme() {
482
545
  }
483
546
  //#endregion
484
547
  //#region source/theme/ThemeToggle.tsx
485
- function SunIcon(props) {
486
- return /* @__PURE__ */ jsxs("svg", {
487
- viewBox: "0 0 20 20",
488
- fill: "none",
489
- "aria-hidden": "true",
490
- ...props,
491
- children: [/* @__PURE__ */ jsx("path", { d: "M12.5 10a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0Z" }), /* @__PURE__ */ jsx("path", {
492
- strokeLinecap: "round",
493
- d: "M10 5.5v-1M13.182 6.818l.707-.707M14.5 10h1M13.182 13.182l.707.707M10 15.5v-1M6.11 13.889l.708-.707M4.5 10h1M6.11 6.111l.708.707"
494
- })]
495
- });
496
- }
497
- function MoonIcon(props) {
498
- return /* @__PURE__ */ jsx("svg", {
499
- viewBox: "0 0 20 20",
500
- fill: "none",
501
- "aria-hidden": "true",
502
- ...props,
503
- children: /* @__PURE__ */ jsx("path", { d: "M15.224 11.724a5.5 5.5 0 0 1-6.949-6.949 5.5 5.5 0 1 0 6.949 6.949Z" })
504
- });
505
- }
506
548
  function ThemeToggle() {
507
549
  const { resolvedTheme, setTheme } = useTheme();
508
550
  const t = useBuiltInText();
509
551
  const otherTheme = resolvedTheme === "dark" ? "light" : "dark";
510
552
  return /* @__PURE__ */ jsxs("button", {
511
553
  type: "button",
512
- className: "clarify-theme-toggle relative flex size-8 items-center justify-center rounded-(--clarify-theme-tokens-radius-md) transition hover:bg-[color-mix(in_srgb,var(--clarify-theme-tokens-colors-foreground)_5%,transparent)] dark:hover:bg-white/5",
554
+ className: "clarify-theme-toggle relative flex size-8 items-center justify-center rounded-(--clarify-theme-tokens-radius-md) transition hover:bg-(--clarify-ui-hover-background)",
513
555
  "aria-label": otherTheme === "dark" ? t("theme.switchToDark") : t("theme.switchToLight"),
514
556
  onClick: () => setTheme(otherTheme),
515
557
  children: [
516
558
  /* @__PURE__ */ jsx("span", { className: "absolute size-12 pointer-fine:hidden" }),
517
- /* @__PURE__ */ jsx(SunIcon, { className: "h-5 w-5 stroke-(--clarify-theme-tokens-colors-foreground) dark:hidden" }),
518
- /* @__PURE__ */ jsx(MoonIcon, { className: "hidden h-5 w-5 stroke-white dark:block" })
559
+ /* @__PURE__ */ jsx(Sun, { className: "h-5 w-5 stroke-(--clarify-theme-tokens-colors-foreground) dark:hidden" }),
560
+ /* @__PURE__ */ jsx(Moon, { className: "hidden h-5 w-5 stroke-white dark:block" })
519
561
  ]
520
562
  });
521
563
  }
@@ -646,787 +688,6 @@ function useSectionStore(selector) {
646
688
  return useStore(store, selector);
647
689
  }
648
690
  //#endregion
649
- //#region source/components/Button.tsx
650
- function ArrowIcon(props) {
651
- return /* @__PURE__ */ jsx("svg", {
652
- viewBox: "0 0 20 20",
653
- fill: "none",
654
- "aria-hidden": "true",
655
- ...props,
656
- children: /* @__PURE__ */ jsx("path", {
657
- stroke: "currentColor",
658
- strokeLinecap: "round",
659
- strokeLinejoin: "round",
660
- d: "m11.5 6.5 3 3.5m0 0-3 3.5m3-3.5h-9"
661
- })
662
- });
663
- }
664
- var buttonVariantStyles = {
665
- primary: "rounded-full bg-(--clarify-theme-tokens-colors-foreground) px-3 py-1 text-white 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",
666
- secondary: "rounded-full bg-(--clarify-theme-tokens-colors-code-background) px-3 py-1 text-(--clarify-theme-tokens-colors-foreground) hover:opacity-80 dark:bg-zinc-800/40 dark:text-zinc-400 dark:ring-1 dark:ring-inset dark:ring-zinc-800 dark:hover:bg-zinc-800 dark:hover:text-zinc-300",
667
- filled: "rounded-full bg-(--clarify-theme-tokens-colors-foreground) px-3 py-1 text-white hover:opacity-80 dark:bg-(--clarify-theme-tokens-colors-primary) dark:hover:opacity-80",
668
- outline: "rounded-full px-3 py-1 text-(--clarify-theme-tokens-colors-muted) ring-1 ring-inset ring-(--clarify-theme-tokens-colors-border) hover:bg-[color-mix(in_srgb,var(--clarify-theme-tokens-colors-foreground)_2.5%,transparent)] hover:text-(--clarify-theme-tokens-colors-foreground) dark:text-zinc-400 dark:ring-white/10 dark:hover:bg-white/5 dark:hover:text-white",
669
- text: "text-(--clarify-theme-tokens-colors-primary) hover:opacity-80 dark:text-(--clarify-theme-tokens-colors-primary) dark:hover:opacity-80"
670
- };
671
- function Button(arg0) {
672
- const { variant = "primary", className, children, arrow, ...props } = arg0;
673
- const classes = clsx("clarify-button inline-flex justify-center gap-0.5 overflow-hidden text-sm font-medium transition", buttonVariantStyles[variant], className);
674
- const arrowIcon = /* @__PURE__ */ jsx(ArrowIcon, { className: clsx("mt-0.5 h-5 w-5", variant === "text" && "relative top-px", arrow === "left" && "-ml-1 rotate-180", arrow === "right" && "-mr-1") });
675
- const inner = /* @__PURE__ */ jsxs(Fragment$1, { children: [
676
- arrow === "left" ? arrowIcon : null,
677
- children,
678
- arrow === "right" ? arrowIcon : null
679
- ] });
680
- if (typeof props.href === "undefined") return /* @__PURE__ */ jsx("button", {
681
- className: classes,
682
- ...props,
683
- children: inner
684
- });
685
- return /* @__PURE__ */ jsx("a", {
686
- className: classes,
687
- ...props,
688
- children: inner
689
- });
690
- }
691
- //#endregion
692
- //#region source/components/Callout.tsx
693
- var calloutStyles = {
694
- info: {
695
- 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",
696
- icon: "text-sky-600 dark:text-sky-400",
697
- title: "text-sky-900 dark:text-sky-100",
698
- Icon: Info
699
- },
700
- note: {
701
- container: "border-zinc-500/20 bg-zinc-50 text-zinc-900 dark:border-white/10 dark:bg-white/5 dark:text-zinc-200",
702
- icon: "text-zinc-500 dark:text-zinc-400",
703
- title: "text-zinc-900 dark:text-white",
704
- Icon: Info
705
- },
706
- tip: {
707
- 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",
708
- icon: "text-emerald-600 dark:text-emerald-400",
709
- title: "text-emerald-900 dark:text-emerald-100",
710
- Icon: Lightbulb
711
- },
712
- warning: {
713
- 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",
714
- icon: "text-amber-600 dark:text-amber-400",
715
- title: "text-amber-900 dark:text-amber-100",
716
- Icon: AlertTriangle
717
- },
718
- danger: {
719
- 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",
720
- icon: "text-rose-600 dark:text-rose-400",
721
- title: "text-rose-900 dark:text-rose-100",
722
- Icon: XCircle
723
- },
724
- success: {
725
- 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",
726
- icon: "text-emerald-600 dark:text-emerald-400",
727
- title: "text-emerald-900 dark:text-emerald-100",
728
- Icon: CheckCircle2
729
- }
730
- };
731
- var defaultTitleKeys = {
732
- info: "callout.info",
733
- note: "callout.note",
734
- tip: "callout.tip",
735
- warning: "callout.warning",
736
- danger: "callout.danger",
737
- success: "callout.success"
738
- };
739
- function Callout(arg0) {
740
- const { children, type = "info", title, icon = true, className, ...props } = arg0;
741
- const t = useBuiltInText();
742
- const style = calloutStyles[type];
743
- const Icon = style.Icon;
744
- const resolvedTitle = title === void 0 ? t(defaultTitleKeys[type]) : title;
745
- return /* @__PURE__ */ jsxs("div", {
746
- className: clsx("clarify-callout my-6 flex gap-3 rounded-(--clarify-theme-tokens-radius-xl) border p-4 text-sm/6", style.container, className),
747
- ...props,
748
- children: [icon ? /* @__PURE__ */ jsx(Icon, {
749
- className: clsx("mt-1 size-4 flex-none", style.icon),
750
- "aria-hidden": "true"
751
- }) : null, /* @__PURE__ */ jsxs("div", {
752
- className: "min-w-0 flex-1 *:first:mt-0 *:last:mb-0",
753
- children: [resolvedTitle ? /* @__PURE__ */ jsx("p", {
754
- className: clsx("mb-1 font-semibold", style.title),
755
- children: resolvedTitle
756
- }) : null, /* @__PURE__ */ jsx("div", {
757
- className: "*:first:mt-0 *:last:mb-0",
758
- children
759
- })]
760
- })]
761
- });
762
- }
763
- //#endregion
764
- //#region source/components/Card.tsx
765
- function CardIcon(arg0) {
766
- const { name } = arg0;
767
- if (!name) return null;
768
- const iconName = resolveLucideIconName(name);
769
- if (!iconName) return null;
770
- const Icon = lucideIconRegistry[iconName];
771
- if (!Icon) return null;
772
- return /* @__PURE__ */ jsx("span", {
773
- 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)",
774
- children: /* @__PURE__ */ jsx(Icon, {
775
- className: "size-5",
776
- "aria-hidden": "true"
777
- })
778
- });
779
- }
780
- var cardGroupColumnStyles = {
781
- 1: "grid-cols-1",
782
- 2: "grid-cols-1 sm:grid-cols-2",
783
- 3: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",
784
- 4: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4"
785
- };
786
- function CardGroup(arg0) {
787
- const { children, cols = 2, className } = arg0;
788
- return /* @__PURE__ */ jsx("div", {
789
- className: clsx("not-prose my-10 grid gap-4", cardGroupColumnStyles[cols], className),
790
- children
791
- });
792
- }
793
- function Card(arg0) {
794
- const { title, icon, href, children, className, ...props } = arg0;
795
- const content = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("div", {
796
- className: "flex items-start gap-4",
797
- children: [/* @__PURE__ */ jsx(CardIcon, { name: icon }), /* @__PURE__ */ jsxs("div", {
798
- className: "min-w-0 flex-1",
799
- children: [/* @__PURE__ */ jsx("h3", {
800
- className: "m-0 text-base font-semibold text-(--clarify-theme-tokens-colors-foreground) dark:text-white",
801
- children: title
802
- }), children ? /* @__PURE__ */ jsx("div", {
803
- className: "mt-2 text-sm/6 text-(--clarify-theme-tokens-colors-muted) dark:text-zinc-400 *:m-0",
804
- children
805
- }) : null]
806
- })]
807
- }), href ? /* @__PURE__ */ jsx("span", {
808
- className: "absolute inset-0 rounded-(--clarify-theme-tokens-radius-xl)",
809
- "aria-hidden": "true"
810
- }) : null] });
811
- 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:border-(--clarify-ui-accent-border) hover:shadow-md dark:bg-zinc-900/50", className);
812
- if (!href) return /* @__PURE__ */ jsx("div", {
813
- className: classes,
814
- children: content
815
- });
816
- if (href.startsWith("/") && !href.startsWith("//")) return /* @__PURE__ */ jsx(Link, {
817
- to: href,
818
- className: classes,
819
- ...props,
820
- children: content
821
- });
822
- return /* @__PURE__ */ jsx("a", {
823
- href,
824
- className: classes,
825
- ...props,
826
- children: content
827
- });
828
- }
829
- //#endregion
830
- //#region source/components/Code.tsx
831
- var languageNames = {
832
- js: "JavaScript",
833
- ts: "TypeScript",
834
- jsx: "React JSX",
835
- tsx: "React TSX",
836
- javascript: "JavaScript",
837
- typescript: "TypeScript",
838
- php: "PHP",
839
- python: "Python",
840
- ruby: "Ruby",
841
- go: "Go",
842
- bash: "Shell",
843
- sh: "Shell",
844
- shell: "Shell",
845
- json: "JSON"
846
- };
847
- function getPanelTitle(arg0) {
848
- const { title, language, fallbackTitle = "Code" } = arg0;
849
- if (title) return title;
850
- if (language && language in languageNames) return languageNames[language];
851
- return fallbackTitle;
852
- }
853
- function getNodeText(node) {
854
- if (typeof node === "string" || typeof node === "number") return String(node);
855
- if (Array.isArray(node)) return node.map(getNodeText).join("");
856
- if (isValidElement(node)) return getNodeText(node.props.children);
857
- return "";
858
- }
859
- function ClipboardIcon$1(props) {
860
- return /* @__PURE__ */ jsxs("svg", {
861
- viewBox: "0 0 20 20",
862
- "aria-hidden": "true",
863
- ...props,
864
- children: [/* @__PURE__ */ jsx("path", {
865
- strokeWidth: "0",
866
- d: "M5.5 13.5v-5a2 2 0 0 1 2-2l.447-.894A2 2 0 0 1 9.737 4.5h.527a2 2 0 0 1 1.789 1.106l.447.894a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-5a2 2 0 0 1-2-2Z"
867
- }), /* @__PURE__ */ jsx("path", {
868
- fill: "none",
869
- strokeLinejoin: "round",
870
- d: "M12.5 6.5a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-5a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2m5 0-.447-.894a2 2 0 0 0-1.79-1.106h-.527a2 2 0 0 0-1.789 1.106L7.5 6.5m5 0-1 1h-3l-1-1"
871
- })]
872
- });
873
- }
874
- function CopyButton(arg0) {
875
- const { code } = arg0;
876
- const t = useBuiltInText();
877
- const [copyCount, setCopyCount] = useState(0);
878
- const copied = copyCount > 0;
879
- useEffect(() => {
880
- if (copyCount === 0) return void 0;
881
- const timeout = window.setTimeout(() => setCopyCount(0), 1e3);
882
- return () => window.clearTimeout(timeout);
883
- }, [copyCount]);
884
- if (!code) return null;
885
- return /* @__PURE__ */ jsxs("button", {
886
- type: "button",
887
- className: clsx("clarify-code-copy group/button absolute top-3.5 right-4 overflow-hidden rounded-full py-1 pr-3 pl-2 text-2xs font-medium opacity-0 backdrop-blur-sm transition group-hover:opacity-100 focus:opacity-100", copied ? "bg-[color-mix(in_srgb,var(--clarify-theme-tokens-colors-primary)_12%,transparent)] ring-1 ring-[color-mix(in_srgb,var(--clarify-theme-tokens-colors-primary)_24%,transparent)] ring-inset" : "bg-white/5 hover:bg-white/7.5 dark:bg-white/2.5 dark:hover:bg-white/5"),
888
- onClick: () => {
889
- copyTextToClipboard(code).then((ok) => {
890
- if (ok) setCopyCount((count) => count + 1);
891
- });
892
- },
893
- children: [/* @__PURE__ */ jsxs("span", {
894
- "aria-hidden": copied,
895
- className: clsx("pointer-events-none flex items-center gap-0.5 text-zinc-400 transition duration-300", copied && "-translate-y-1.5 opacity-0"),
896
- children: [/* @__PURE__ */ jsx(ClipboardIcon$1, { className: "h-5 w-5 fill-zinc-500/20 stroke-zinc-500 transition-colors group-hover/button:stroke-zinc-400" }), t("actions.copy")]
897
- }), /* @__PURE__ */ jsx("span", {
898
- "aria-hidden": !copied,
899
- className: clsx("pointer-events-none absolute inset-0 flex items-center justify-center text-(--clarify-theme-tokens-colors-primary) transition duration-300", !copied && "translate-y-1.5 opacity-0"),
900
- children: t("actions.copied")
901
- })]
902
- });
903
- }
904
- function CodePanelHeader(arg0) {
905
- const { tag, label } = arg0;
906
- if (!tag && !label) return null;
907
- return /* @__PURE__ */ jsxs("div", {
908
- className: "clarify-code-panel-header flex h-9 items-center gap-2 border-y border-t-transparent border-b-white/7.5 bg-zinc-900 px-4 dark:border-b-white/5 dark:bg-white/1",
909
- children: [
910
- tag ? /* @__PURE__ */ jsx("span", {
911
- className: "clarify-code-panel-tag font-semibold text-(--clarify-theme-tokens-colors-primary)",
912
- children: tag
913
- }) : null,
914
- tag && label ? /* @__PURE__ */ jsx("span", { className: "h-0.5 w-0.5 rounded-full bg-zinc-500" }) : null,
915
- label ? /* @__PURE__ */ jsx("span", {
916
- className: "text-xs text-zinc-400",
917
- children: label
918
- }) : null
919
- ]
920
- });
921
- }
922
- function CodePanel(arg0) {
923
- const { children } = arg0;
924
- let { tag, label, code } = arg0;
925
- const child = Children.only(children);
926
- if (isValidElement(child)) {
927
- const props = child.props;
928
- tag = props.tag ?? tag;
929
- label = props.label ?? label;
930
- code = props.code ?? code ?? getNodeText(props.children);
931
- }
932
- const copyText = code ?? getNodeText(children);
933
- return /* @__PURE__ */ jsxs("div", {
934
- className: "clarify-code-panel group dark:bg-white/2.5",
935
- children: [/* @__PURE__ */ jsx(CodePanelHeader, {
936
- tag,
937
- label
938
- }), /* @__PURE__ */ jsxs("div", {
939
- className: "relative",
940
- children: [/* @__PURE__ */ jsx("pre", {
941
- className: "clarify-code-pre overflow-x-auto p-4 text-xs text-white",
942
- children
943
- }), /* @__PURE__ */ jsx(CopyButton, { code: copyText })]
944
- })]
945
- });
946
- }
947
- function CodeGroupHeader(arg0) {
948
- const { title, children, selectedIndex } = arg0;
949
- const t = useBuiltInText();
950
- const hasTabs = Children.count(children) > 1;
951
- if (!title && !hasTabs) return null;
952
- return /* @__PURE__ */ jsxs("div", {
953
- className: "clarify-code-group-header flex min-h-[calc(--spacing(12)+1px)] flex-wrap items-start gap-x-4 border-b border-zinc-700 bg-zinc-800 px-4 dark:border-zinc-800 dark:bg-transparent",
954
- children: [title ? /* @__PURE__ */ jsx("h3", {
955
- className: "mr-auto pt-3 text-xs font-semibold text-white",
956
- children: title
957
- }) : null, hasTabs ? /* @__PURE__ */ jsx(TabList, {
958
- className: "clarify-code-tabs -mb-px flex gap-4 text-xs font-medium",
959
- children: Children.map(children, (child, childIndex) => /* @__PURE__ */ jsx(Tab, {
960
- className: clsx("clarify-code-tab border-b py-3 transition data-selected:not-data-focus:outline-hidden", childIndex === selectedIndex ? "border-(--clarify-theme-tokens-colors-primary) text-(--clarify-theme-tokens-colors-primary)" : "border-transparent text-zinc-400 hover:text-zinc-300"),
961
- children: getPanelTitle({
962
- ...isValidElement(child) ? child.props : {},
963
- fallbackTitle: t("actions.code")
964
- })
965
- }))
966
- }) : null]
967
- });
968
- }
969
- function CodeGroupPanels(arg0) {
970
- const { children, ...props } = arg0;
971
- if (Children.count(children) > 1) return /* @__PURE__ */ jsx(TabPanels, { children: Children.map(children, (child) => /* @__PURE__ */ jsx(TabPanel, { children: /* @__PURE__ */ jsx(CodePanel, {
972
- ...props,
973
- children: child
974
- }) })) });
975
- return /* @__PURE__ */ jsx(CodePanel, {
976
- ...props,
977
- children
978
- });
979
- }
980
- function usePreventLayoutShift() {
981
- const positionRef = useRef(null);
982
- const rafRef = useRef(void 0);
983
- useEffect(() => {
984
- return () => {
985
- if (typeof rafRef.current !== "undefined") window.cancelAnimationFrame(rafRef.current);
986
- };
987
- }, []);
988
- return {
989
- positionRef,
990
- preventLayoutShift(callback) {
991
- if (!positionRef.current) return;
992
- const initialTop = positionRef.current.getBoundingClientRect().top;
993
- callback();
994
- rafRef.current = window.requestAnimationFrame(() => {
995
- const newTop = positionRef.current?.getBoundingClientRect().top ?? initialTop;
996
- window.scrollBy(0, newTop - initialTop);
997
- });
998
- }
999
- };
1000
- }
1001
- var usePreferredLanguageStore = create()((set) => ({
1002
- preferredLanguages: [],
1003
- addPreferredLanguage: (language) => set((state) => ({ preferredLanguages: [...state.preferredLanguages.filter((preferredLanguage) => preferredLanguage !== language), language] }))
1004
- }));
1005
- function useTabGroupProps(availableLanguages) {
1006
- const { preferredLanguages, addPreferredLanguage } = usePreferredLanguageStore();
1007
- const [selectedIndex, setSelectedIndex] = useState(0);
1008
- if (new Set(availableLanguages).size === availableLanguages.length) {
1009
- const activeLanguage = [...availableLanguages].sort((a, z) => preferredLanguages.indexOf(z) - preferredLanguages.indexOf(a))[0];
1010
- const languageIndex = availableLanguages.indexOf(activeLanguage);
1011
- const newSelectedIndex = languageIndex === -1 ? selectedIndex : languageIndex;
1012
- if (newSelectedIndex !== selectedIndex) setSelectedIndex(newSelectedIndex);
1013
- }
1014
- const { positionRef, preventLayoutShift } = usePreventLayoutShift();
1015
- return {
1016
- as: "div",
1017
- ref: positionRef,
1018
- selectedIndex,
1019
- onChange: (nextSelectedIndex) => {
1020
- setSelectedIndex(nextSelectedIndex);
1021
- preventLayoutShift(() => addPreferredLanguage(availableLanguages[nextSelectedIndex]));
1022
- }
1023
- };
1024
- }
1025
- var CodeGroupContext = createContext(false);
1026
- function CodeGroup(arg0) {
1027
- const { children, title, ...props } = arg0;
1028
- const t = useBuiltInText();
1029
- const tabGroupProps = useTabGroupProps(Children.map(children, (child) => getPanelTitle({
1030
- ...isValidElement(child) ? child.props : {},
1031
- fallbackTitle: t("actions.code")
1032
- })) ?? []);
1033
- const hasTabs = Children.count(children) > 1;
1034
- const containerClassName = "clarify-code-group my-6 overflow-hidden rounded-2xl bg-zinc-900 shadow-md dark:ring-1 dark:ring-white/10";
1035
- const header = /* @__PURE__ */ jsx(CodeGroupHeader, {
1036
- title,
1037
- selectedIndex: tabGroupProps.selectedIndex,
1038
- children
1039
- });
1040
- const panels = /* @__PURE__ */ jsx(CodeGroupPanels, {
1041
- ...props,
1042
- children
1043
- });
1044
- return /* @__PURE__ */ jsx(CodeGroupContext.Provider, {
1045
- value: true,
1046
- children: hasTabs ? /* @__PURE__ */ jsx(TabGroup, {
1047
- ...tabGroupProps,
1048
- className: containerClassName,
1049
- children: /* @__PURE__ */ jsxs("div", {
1050
- className: "not-prose",
1051
- children: [header, panels]
1052
- })
1053
- }) : /* @__PURE__ */ jsx("div", {
1054
- className: containerClassName,
1055
- children: /* @__PURE__ */ jsxs("div", {
1056
- className: "not-prose",
1057
- children: [header, panels]
1058
- })
1059
- })
1060
- });
1061
- }
1062
- function Code(arg0) {
1063
- const { children, ...props } = arg0;
1064
- if (useContext(CodeGroupContext) && typeof children === "string") return /* @__PURE__ */ jsx("code", {
1065
- ...props,
1066
- dangerouslySetInnerHTML: { __html: children }
1067
- });
1068
- return /* @__PURE__ */ jsx("code", {
1069
- ...props,
1070
- children
1071
- });
1072
- }
1073
- function Pre(arg0) {
1074
- const { children, ...props } = arg0;
1075
- if (useContext(CodeGroupContext)) return children;
1076
- return /* @__PURE__ */ jsx(CodeGroup, {
1077
- ...props,
1078
- children
1079
- });
1080
- }
1081
- //#endregion
1082
- //#region source/components/Collapse.tsx
1083
- function Collapse(arg0) {
1084
- const { children, title, summary, defaultOpen = false, className, ...props } = arg0;
1085
- const [open, setOpen] = useState(defaultOpen);
1086
- const contentRef = useRef(null);
1087
- const [maxHeight, setMaxHeight] = useState("0px");
1088
- const summaryLabel = title ?? summary ?? "Details";
1089
- const contentId = useId();
1090
- useLayoutEffect(() => {
1091
- if (!contentRef.current) return;
1092
- setMaxHeight(open ? `${contentRef.current.scrollHeight}px` : "0px");
1093
- }, [open, children]);
1094
- return /* @__PURE__ */ jsxs("div", {
1095
- className: clsx("clarify-collapse my-6 overflow-hidden rounded-(--clarify-theme-tokens-radius-xl) border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) shadow-sm dark:border-white/10 dark:bg-zinc-950", className),
1096
- ...props,
1097
- children: [/* @__PURE__ */ jsxs("button", {
1098
- type: "button",
1099
- 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) dark:text-white dark:hover:bg-white/5 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) dark:focus-visible:ring-offset-zinc-950",
1100
- "aria-expanded": open,
1101
- "aria-controls": contentId,
1102
- onClick: () => setOpen((value) => !value),
1103
- children: [/* @__PURE__ */ jsx("span", { children: summaryLabel }), /* @__PURE__ */ jsx(ChevronDown, {
1104
- className: clsx("h-4 w-4 text-(--clarify-theme-tokens-colors-muted) transition-transform duration-200", open && "rotate-180"),
1105
- "aria-hidden": "true"
1106
- })]
1107
- }), /* @__PURE__ */ jsx("div", {
1108
- id: contentId,
1109
- className: "overflow-hidden border-t border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-background) transition-[max-height,opacity,transform] duration-200 ease-out dark:border-white/10 dark:bg-zinc-950/95",
1110
- style: {
1111
- maxHeight,
1112
- willChange: "max-height, opacity, transform"
1113
- },
1114
- children: /* @__PURE__ */ jsx("div", {
1115
- ref: contentRef,
1116
- 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"),
1117
- children
1118
- })
1119
- })]
1120
- });
1121
- }
1122
- //#endregion
1123
- //#region source/components/Feedback.tsx
1124
- function CheckIcon$1(props) {
1125
- return /* @__PURE__ */ jsxs("svg", {
1126
- viewBox: "0 0 20 20",
1127
- "aria-hidden": "true",
1128
- ...props,
1129
- children: [/* @__PURE__ */ jsx("circle", {
1130
- cx: "10",
1131
- cy: "10",
1132
- r: "10",
1133
- strokeWidth: "0"
1134
- }), /* @__PURE__ */ jsx("path", {
1135
- fill: "none",
1136
- strokeLinecap: "round",
1137
- strokeLinejoin: "round",
1138
- strokeWidth: "1.5",
1139
- d: "m6.75 10.813 2.438 2.437c1.218-4.469 4.062-6.5 4.062-6.5"
1140
- })]
1141
- });
1142
- }
1143
- function FeedbackButton(props) {
1144
- return /* @__PURE__ */ jsx("button", {
1145
- type: "submit",
1146
- className: "clarify-feedback-button px-3 text-sm font-medium text-zinc-600 transition hover:bg-zinc-900/2.5 hover:text-zinc-900 dark:text-zinc-400 dark:hover:bg-white/5 dark:hover:text-white",
1147
- ...props
1148
- });
1149
- }
1150
- var FeedbackForm = forwardRef(function FeedbackForm(arg0, ref) {
1151
- const { onSubmit, className, ...props } = arg0;
1152
- const t = useBuiltInText();
1153
- return /* @__PURE__ */ jsxs("form", {
1154
- ...props,
1155
- ref,
1156
- onSubmit,
1157
- className: clsx(className, "clarify-feedback-form absolute inset-0 flex items-center justify-center gap-6 md:justify-start"),
1158
- children: [/* @__PURE__ */ jsx("p", {
1159
- className: "text-sm text-zinc-600 dark:text-zinc-400",
1160
- children: t("feedback.prompt")
1161
- }), /* @__PURE__ */ jsxs("div", {
1162
- className: "clarify-feedback-actions group grid h-8 grid-cols-[1fr_1px_1fr] overflow-hidden rounded-full border border-zinc-900/10 dark:border-white/10",
1163
- children: [
1164
- /* @__PURE__ */ jsx(FeedbackButton, {
1165
- "data-response": "yes",
1166
- children: t("feedback.yes")
1167
- }),
1168
- /* @__PURE__ */ jsx("div", { className: "bg-zinc-900/10 dark:bg-white/10" }),
1169
- /* @__PURE__ */ jsx(FeedbackButton, {
1170
- "data-response": "no",
1171
- children: t("feedback.no")
1172
- })
1173
- ]
1174
- })]
1175
- });
1176
- });
1177
- var FeedbackThanks = forwardRef(function FeedbackThanks(arg0, ref) {
1178
- const { className, ...props } = arg0;
1179
- const t = useBuiltInText();
1180
- return /* @__PURE__ */ jsx("div", {
1181
- ...props,
1182
- ref,
1183
- className: clsx(className, "clarify-feedback-thanks absolute inset-0 flex justify-center md:justify-start"),
1184
- children: /* @__PURE__ */ jsxs("div", {
1185
- className: "flex items-center gap-3 rounded-full bg-(--clarify-ui-accent-background) py-1 pr-3 pl-1.5 text-sm text-(--clarify-ui-accent-text) ring-1 ring-(--clarify-ui-accent-border) ring-inset",
1186
- children: [/* @__PURE__ */ jsx(CheckIcon$1, { className: "h-5 w-5 flex-none fill-(--clarify-ui-accent-text) stroke-white dark:fill-(--clarify-ui-accent-background) dark:stroke-(--clarify-ui-accent-text)" }), t("feedback.thanks")]
1187
- })
1188
- });
1189
- });
1190
- function Feedback() {
1191
- const [submitted, setSubmitted] = useState(false);
1192
- function onSubmit(event) {
1193
- event.preventDefault();
1194
- setSubmitted(true);
1195
- }
1196
- return /* @__PURE__ */ jsxs("div", {
1197
- className: "clarify-feedback relative h-8",
1198
- children: [/* @__PURE__ */ jsx(Transition, {
1199
- show: !submitted,
1200
- children: /* @__PURE__ */ jsx(FeedbackForm, {
1201
- className: "duration-300 data-closed:opacity-0 data-leave:pointer-events-none",
1202
- onSubmit
1203
- })
1204
- }), /* @__PURE__ */ jsx(Transition, {
1205
- show: submitted,
1206
- children: /* @__PURE__ */ jsx(FeedbackThanks, { className: "delay-150 duration-300 data-closed:opacity-0" })
1207
- })]
1208
- });
1209
- }
1210
- //#endregion
1211
- //#region source/components/Tag.tsx
1212
- var tagVariantStyles = {
1213
- small: "",
1214
- medium: "rounded-lg px-1.5 ring-1 ring-inset"
1215
- };
1216
- var tagColorStyles = {
1217
- emerald: {
1218
- small: "text-emerald-500 dark:text-emerald-400",
1219
- medium: "bg-emerald-400/10 text-emerald-500 ring-emerald-300 dark:text-emerald-400 dark:ring-emerald-400/30"
1220
- },
1221
- sky: {
1222
- small: "text-sky-500 dark:text-sky-400",
1223
- medium: "bg-sky-400/10 text-sky-500 ring-sky-300 dark:text-sky-400 dark:ring-sky-400/30"
1224
- },
1225
- amber: {
1226
- small: "text-amber-500 dark:text-amber-400",
1227
- medium: "bg-amber-400/10 text-amber-500 ring-amber-300 dark:text-amber-400 dark:ring-amber-400/30"
1228
- },
1229
- rose: {
1230
- small: "text-red-500 dark:text-rose-500",
1231
- medium: "bg-rose-50 text-red-500 ring-rose-200 dark:bg-rose-400/10 dark:text-rose-400 dark:ring-rose-500/20"
1232
- },
1233
- zinc: {
1234
- small: "text-(--clarify-theme-tokens-colors-muted) dark:text-zinc-500",
1235
- medium: "bg-(--clarify-theme-tokens-colors-code-background) text-(--clarify-theme-tokens-colors-muted) ring-(--clarify-theme-tokens-colors-border) dark:bg-zinc-400/10 dark:text-zinc-400 dark:ring-zinc-500/20"
1236
- }
1237
- };
1238
- var tagValueColorMap = {
1239
- GET: "emerald",
1240
- POST: "sky",
1241
- PUT: "amber",
1242
- PATCH: "amber",
1243
- DELETE: "rose"
1244
- };
1245
- function Tag(arg0) {
1246
- const { children, variant = "medium", color } = arg0;
1247
- const value = typeof children === "string" ? children.toUpperCase() : "";
1248
- const resolvedColor = color ?? tagValueColorMap[value] ?? "emerald";
1249
- return /* @__PURE__ */ jsx("span", {
1250
- className: clsx("clarify-tag font-bold", tagVariantStyles[variant], tagColorStyles[resolvedColor][variant]),
1251
- children
1252
- });
1253
- }
1254
- //#endregion
1255
- //#region source/components/Heading.tsx
1256
- function AnchorIcon(props) {
1257
- return /* @__PURE__ */ jsx("svg", {
1258
- viewBox: "0 0 20 20",
1259
- fill: "none",
1260
- strokeLinecap: "round",
1261
- "aria-hidden": "true",
1262
- ...props,
1263
- children: /* @__PURE__ */ jsx("path", { d: "m6.5 11.5-.964-.964a3.535 3.535 0 1 1 5-5l.964.964m2 2 .964.964a3.536 3.536 0 0 1-5 5L8.5 13.5m0-5 3 3" })
1264
- });
1265
- }
1266
- function Eyebrow(arg0) {
1267
- const { tag, label } = arg0;
1268
- if (!tag && !label) return null;
1269
- return /* @__PURE__ */ jsxs("div", {
1270
- className: "flex items-center gap-x-3",
1271
- children: [
1272
- tag ? /* @__PURE__ */ jsx(Tag, { children: tag }) : null,
1273
- tag && label ? /* @__PURE__ */ jsx("span", { className: "h-0.5 w-0.5 rounded-full bg-zinc-300 dark:bg-zinc-600" }) : null,
1274
- label ? /* @__PURE__ */ jsx("span", {
1275
- className: "text-xs text-zinc-400",
1276
- children: label
1277
- }) : null
1278
- ]
1279
- });
1280
- }
1281
- function Anchor(arg0) {
1282
- const { id, inView, children } = arg0;
1283
- return /* @__PURE__ */ jsxs("a", {
1284
- href: `#${id}`,
1285
- className: "clarify-anchor group text-inherit no-underline hover:text-inherit",
1286
- children: [inView ? /* @__PURE__ */ jsx("div", {
1287
- className: "absolute mt-1 -ml-(--width) hidden w-(--width) opacity-0 transition [--width:calc(2.625rem+0.5px+50%-min(50%,calc(var(--container-lg)+(--spacing(8)))))] group-hover:opacity-100 group-focus:opacity-100 md:block lg:z-50 2xl:[--width:--spacing(10)]",
1288
- children: /* @__PURE__ */ jsx("div", {
1289
- className: "group/anchor block h-5 w-5 rounded-lg bg-zinc-50 ring-1 ring-inset ring-zinc-300 transition hover:ring-zinc-500 dark:bg-zinc-800 dark:ring-zinc-700 dark:hover:bg-zinc-700 dark:hover:ring-zinc-600",
1290
- children: /* @__PURE__ */ jsx(AnchorIcon, { className: "h-5 w-5 stroke-zinc-500 transition dark:stroke-zinc-400 dark:group-hover/anchor:stroke-white" })
1291
- })
1292
- }) : null, children]
1293
- });
1294
- }
1295
- function Heading(arg0) {
1296
- const { children, className, tag, label, level, anchor = true, ...props } = arg0;
1297
- const resolvedLevel = level ?? 2;
1298
- const Component = `h${resolvedLevel}`;
1299
- const ref = useRef(null);
1300
- const registerHeading = useSectionStore((state) => state.registerHeading);
1301
- const inView = useInView(ref, {
1302
- margin: `${remToPx(-3.5)}px 0px 0px 0px`,
1303
- amount: "all"
1304
- });
1305
- useEffect(() => {
1306
- if (resolvedLevel === 2) registerHeading({
1307
- id: props.id,
1308
- ref,
1309
- offsetRem: tag || label ? 8 : 6
1310
- });
1311
- }, [
1312
- label,
1313
- props.id,
1314
- registerHeading,
1315
- resolvedLevel,
1316
- tag
1317
- ]);
1318
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Eyebrow, {
1319
- tag,
1320
- label
1321
- }), /* @__PURE__ */ jsx(Component, {
1322
- ref,
1323
- className: clsx("clarify-heading", tag || label ? "mt-2 scroll-mt-32" : "scroll-mt-24", className),
1324
- ...props,
1325
- children: anchor ? /* @__PURE__ */ jsx(Anchor, {
1326
- id: props.id,
1327
- inView,
1328
- children
1329
- }) : children
1330
- })] });
1331
- }
1332
- //#endregion
1333
- //#region source/components/Logo.tsx
1334
- function Logo(props) {
1335
- return /* @__PURE__ */ jsxs("svg", {
1336
- viewBox: "0 0 99 24",
1337
- "aria-hidden": "true",
1338
- ...props,
1339
- className: clsx("clarify-logo", props.className),
1340
- children: [/* @__PURE__ */ jsx("path", {
1341
- className: "fill-(--clarify-theme-tokens-colors-primary)",
1342
- d: "M16 8a5 5 0 0 0-5-5H5a5 5 0 0 0-5 5v13.927a1 1 0 0 0 1.623.782l3.684-2.93a4 4 0 0 1 2.49-.87H11a5 5 0 0 0 5-5V8Z"
1343
- }), /* @__PURE__ */ jsx("path", {
1344
- className: "fill-(--clarify-theme-tokens-colors-foreground) dark:fill-white",
1345
- d: "M26.538 18h2.654v-3.999h2.576c2.672 0 4.456-1.723 4.456-4.333V9.65c0-2.61-1.784-4.333-4.456-4.333h-5.23V18Zm4.58-10.582c1.52 0 2.416.8 2.416 2.241v.018c0 1.441-.896 2.25-2.417 2.25h-1.925V7.418h1.925ZM38.051 18h2.566v-5.414c0-1.371.923-2.206 2.382-2.206.396 0 .791.061 1.178.15V8.287a3.843 3.843 0 0 0-.958-.123c-1.257 0-2.136.615-2.443 1.661h-.159V8.323h-2.566V18Zm11.55.202c2.979 0 4.772-1.88 4.772-5.036v-.018c0-3.128-1.82-5.036-4.773-5.036-2.953 0-4.772 1.916-4.772 5.036v.018c0 3.146 1.793 5.036 4.772 5.036Zm0-2.013c-1.372 0-2.145-1.116-2.145-3.023v-.018c0-1.89.782-3.023 2.144-3.023 1.354 0 2.145 1.134 2.145 3.023v.018c0 1.907-.782 3.023-2.145 3.023Zm10.52 1.846c.492 0 .967-.053 1.283-.114v-1.907a6.057 6.057 0 0 1-.755.044c-.87 0-1.24-.387-1.24-1.257v-4.544h1.995V8.323H59.41V6.012h-2.592v2.311h-1.495v1.934h1.495v5.133c0 1.88.949 2.645 3.304 2.645Zm7.287.167c2.98 0 4.772-1.88 4.772-5.036v-.018c0-3.128-1.82-5.036-4.772-5.036-2.954 0-4.773 1.916-4.773 5.036v.018c0 3.146 1.793 5.036 4.773 5.036Zm0-2.013c-1.372 0-2.145-1.116-2.145-3.023v-.018c0-1.89.782-3.023 2.145-3.023 1.353 0 2.144 1.134 2.144 3.023v.018c0 1.907-.782 3.023-2.144 3.023Zm10.767 2.013c2.522 0 4.034-1.353 4.297-3.463l.01-.053h-2.374l-.017.036c-.229.966-.853 1.467-1.908 1.467-1.37 0-2.135-1.08-2.135-3.04v-.018c0-1.934.755-3.006 2.135-3.006 1.099 0 1.74.615 1.908 1.556l.008.017h2.391v-.026c-.228-2.162-1.749-3.56-4.315-3.56-3.033 0-4.738 1.837-4.738 5.019v.017c0 3.217 1.714 5.054 4.738 5.054Zm10.257 0c2.98 0 4.772-1.88 4.772-5.036v-.018c0-3.128-1.82-5.036-4.772-5.036-2.953 0-4.773 1.916-4.773 5.036v.018c0 3.146 1.793 5.036 4.773 5.036Zm0-2.013c-1.371 0-2.145-1.116-2.145-3.023v-.018c0-1.89.782-3.023 2.145-3.023 1.353 0 2.144 1.134 2.144 3.023v.018c0 1.907-.782 3.023-2.144 3.023ZM95.025 18h2.566V4.623h-2.566V18Z"
1346
- })]
1347
- });
1348
- }
1349
- //#endregion
1350
- //#region source/components/patterns.tsx
1351
- function GridPattern(arg0) {
1352
- const { width, height, x, y, squares, ...props } = arg0;
1353
- const patternId = useId();
1354
- return /* @__PURE__ */ jsxs("svg", {
1355
- "aria-hidden": "true",
1356
- ...props,
1357
- children: [
1358
- /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("pattern", {
1359
- id: patternId,
1360
- width,
1361
- height,
1362
- patternUnits: "userSpaceOnUse",
1363
- x,
1364
- y,
1365
- children: /* @__PURE__ */ jsx("path", {
1366
- d: `M.5 ${height}V.5H${width}`,
1367
- fill: "none"
1368
- })
1369
- }) }),
1370
- /* @__PURE__ */ jsx("rect", {
1371
- width: "100%",
1372
- height: "100%",
1373
- strokeWidth: 0,
1374
- fill: `url(#${patternId})`
1375
- }),
1376
- squares ? /* @__PURE__ */ jsx("svg", {
1377
- x,
1378
- y,
1379
- className: "overflow-visible",
1380
- children: squares.map(([squareX, squareY]) => /* @__PURE__ */ jsx("rect", {
1381
- width: width + 1,
1382
- height: height + 1,
1383
- x: squareX * width,
1384
- y: squareY * height,
1385
- strokeWidth: "0"
1386
- }, `${squareX}-${squareY}`))
1387
- }) : null
1388
- ]
1389
- });
1390
- }
1391
- function HeroPattern() {
1392
- return /* @__PURE__ */ jsx("div", {
1393
- className: "absolute inset-0 -z-10 mx-0 max-w-none overflow-hidden",
1394
- children: /* @__PURE__ */ jsxs("div", {
1395
- className: "absolute top-0 left-1/2 -ml-152 h-100 w-325 dark:mask-[linear-gradient(white,transparent)]",
1396
- children: [/* @__PURE__ */ jsx("div", {
1397
- className: "absolute inset-0 bg-[linear-gradient(to_right,var(--clarify-theme-tokens-colors-primary),var(--clarify-theme-tokens-colors-accent))] opacity-35 mask-[radial-gradient(farthest-side_at_top,white,transparent)] dark:opacity-55",
1398
- children: /* @__PURE__ */ jsx(GridPattern, {
1399
- width: 72,
1400
- height: 56,
1401
- x: -12,
1402
- y: 4,
1403
- squares: [
1404
- [4, 3],
1405
- [2, 1],
1406
- [7, 3],
1407
- [10, 6]
1408
- ],
1409
- className: "absolute inset-x-0 inset-y-[-50%] h-[200%] w-full -skew-y-18 fill-black/40 stroke-black/50 mix-blend-overlay dark:fill-white/2.5 dark:stroke-white/5"
1410
- })
1411
- }), /* @__PURE__ */ jsx("svg", {
1412
- viewBox: "0 0 1113 440",
1413
- "aria-hidden": "true",
1414
- className: "absolute top-0 left-1/2 -ml-76 w-278.25 fill-white blur-[26px] dark:hidden",
1415
- children: /* @__PURE__ */ jsx("path", { d: "M.016 439.5s-9.5-300 434-300S882.516 20 882.516 20V0h230.004v439.5H.016Z" })
1416
- })]
1417
- })
1418
- });
1419
- }
1420
- //#endregion
1421
- //#region source/components/Prose.tsx
1422
- function Prose(arg0) {
1423
- const { as, className, ...props } = arg0;
1424
- return /* @__PURE__ */ jsx(as ?? "div", {
1425
- className: clsx(className, "clarify-prose prose max-w-none dark:prose-invert", "[html_:where(&>*)]:w-full [html_:where(&>*)]:min-w-0 [html_:where(&>*)]:max-w-full"),
1426
- ...props
1427
- });
1428
- }
1429
- //#endregion
1430
691
  //#region source/utils/hash.ts
1431
692
  function safeDecodeURIComponent(value) {
1432
693
  try {
@@ -1476,7 +737,7 @@ function SectionBadge(arg0) {
1476
737
  });
1477
738
  }
1478
739
  function NavLink(arg0) {
1479
- const { href, children, badge, icon, tags, active = false, isAnchorLink = false } = arg0;
740
+ const { href, children, badge, icon, active = false, isAnchorLink = false } = arg0;
1480
741
  function handleClick() {
1481
742
  if (!isAnchorLink) return;
1482
743
  const hashIndex = href.indexOf("#");
@@ -1489,13 +750,13 @@ function NavLink(arg0) {
1489
750
  });
1490
751
  });
1491
752
  }
1492
- return /* @__PURE__ */ jsxs(CloseButton, {
753
+ return /* @__PURE__ */ jsx(CloseButton, {
1493
754
  as: Link,
1494
755
  to: href,
1495
756
  "aria-current": active ? "page" : void 0,
1496
757
  onClick: handleClick,
1497
758
  className: clsx("clarify-navigation-link flex h-8 items-center justify-between gap-2 pr-3 transition", isAnchorLink ? "clarify-navigation-anchor-link pl-7" : "pl-4"),
1498
- children: [/* @__PURE__ */ jsxs("span", {
759
+ children: /* @__PURE__ */ jsxs("span", {
1499
760
  className: "flex min-w-0 flex-1 items-center gap-2",
1500
761
  children: [
1501
762
  icon ? /* @__PURE__ */ jsx(NavigationIcon, {
@@ -1508,14 +769,7 @@ function NavLink(arg0) {
1508
769
  children
1509
770
  })
1510
771
  ]
1511
- }), tags?.length ? /* @__PURE__ */ jsx("span", {
1512
- className: "flex shrink-0 gap-1",
1513
- children: tags.map((tag) => /* @__PURE__ */ jsx(Tag, {
1514
- variant: "small",
1515
- color: "zinc",
1516
- children: tag
1517
- }, tag))
1518
- }) : null]
772
+ })
1519
773
  });
1520
774
  }
1521
775
  function VisibleSectionHighlight(arg0) {
@@ -1673,26 +927,6 @@ function Navigation(arg0) {
1673
927
  }
1674
928
  //#endregion
1675
929
  //#region source/shell/mobile.tsx
1676
- function MenuIcon(props) {
1677
- return /* @__PURE__ */ jsx("svg", {
1678
- viewBox: "0 0 10 9",
1679
- fill: "none",
1680
- strokeLinecap: "round",
1681
- "aria-hidden": "true",
1682
- ...props,
1683
- children: /* @__PURE__ */ jsx("path", { d: "M.5 1h9M.5 8h9M.5 4.5h9" })
1684
- });
1685
- }
1686
- function XIcon(props) {
1687
- return /* @__PURE__ */ jsx("svg", {
1688
- viewBox: "0 0 10 9",
1689
- fill: "none",
1690
- strokeLinecap: "round",
1691
- "aria-hidden": "true",
1692
- ...props,
1693
- children: /* @__PURE__ */ jsx("path", { d: "m1.5 1 7 7M8.5 1l-7 7" })
1694
- });
1695
- }
1696
930
  var IsInsideMobileNavigationContext = createContext(false);
1697
931
  function hasPath$1(nodes, pathname) {
1698
932
  return nodes.some((node) => isSameRoutePath(node.path, pathname) || hasPath$1(node.children ?? [], pathname));
@@ -1720,20 +954,7 @@ function MobileTabsSelect(arg0) {
1720
954
  className: "truncate",
1721
955
  children: activeTab.title
1722
956
  })]
1723
- }), /* @__PURE__ */ jsx("svg", {
1724
- width: "8",
1725
- height: "24",
1726
- viewBox: "0 -9 3 24",
1727
- "aria-hidden": "true",
1728
- className: "shrink-0 overflow-visible text-(--clarify-theme-tokens-colors-muted) transition-transform group-aria-expanded:rotate-180",
1729
- children: /* @__PURE__ */ jsx("path", {
1730
- d: "M0 0L3 3L0 6",
1731
- fill: "none",
1732
- stroke: "currentColor",
1733
- strokeWidth: "1.5",
1734
- strokeLinecap: "round"
1735
- })
1736
- })]
957
+ }), /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4 shrink-0 text-(--clarify-theme-tokens-colors-muted) transition-transform group-aria-expanded:rotate-180" })]
1737
958
  }), /* @__PURE__ */ jsx(MenuItems, {
1738
959
  className: "clarify-mobile-tabs-select-list clarify-ui-menu mt-2 flex flex-col gap-1 rounded-(--clarify-theme-tokens-radius-xl) border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) p-1 shadow-lg shadow-zinc-900/5 focus:outline-none dark:border-white/10 dark:bg-zinc-900 dark:shadow-none",
1739
960
  children: tabs.map((tab) => {
@@ -1752,19 +973,7 @@ function MobileTabsSelect(arg0) {
1752
973
  className: "min-w-0 whitespace-normal wrap-anywhere font-medium leading-5",
1753
974
  children: tab.title
1754
975
  })]
1755
- }), active ? /* @__PURE__ */ jsx("svg", {
1756
- viewBox: "0 0 20 20",
1757
- fill: "none",
1758
- "aria-hidden": "true",
1759
- className: "mt-0.5 h-4 w-4 shrink-0",
1760
- children: /* @__PURE__ */ jsx("path", {
1761
- d: "m5 10 3 3 7-7",
1762
- stroke: "currentColor",
1763
- strokeWidth: "1.8",
1764
- strokeLinecap: "round",
1765
- strokeLinejoin: "round"
1766
- })
1767
- }) : null]
976
+ }), active ? /* @__PURE__ */ jsx(Check, { className: "mt-0.5 h-4 w-4 shrink-0" }) : null]
1768
977
  }) }, `${tab.title}-${tab.path}`);
1769
978
  })
1770
979
  })]
@@ -1790,7 +999,7 @@ function MobileNavigationDialog(arg0) {
1790
999
  className: "data-closed:opacity-0 data-enter:duration-300 data-enter:ease-out data-leave:duration-200 data-leave:ease-in"
1791
1000
  }) }), /* @__PURE__ */ jsx(TransitionChild, { children: /* @__PURE__ */ jsxs(motion.div, {
1792
1001
  layoutScroll: true,
1793
- className: "clarify-mobile-navigation-panel fixed top-14 bottom-0 left-0 w-full overflow-y-auto bg-(--clarify-theme-tokens-colors-background) px-4 pt-6 pb-4 shadow-lg ring-1 shadow-zinc-900/10 ring-(--clarify-theme-tokens-colors-border) duration-500 ease-in-out data-closed:-translate-x-full min-[416px]:max-w-sm sm:px-6 sm:pb-10 dark:bg-zinc-950 dark:ring-zinc-800",
1002
+ className: "clarify-mobile-navigation-panel fixed top-14 bottom-0 left-0 w-full max-w-sm overflow-y-auto bg-(--clarify-theme-tokens-colors-background) px-4 pt-6 pb-4 shadow-lg ring-1 shadow-zinc-900/10 ring-(--clarify-theme-tokens-colors-border) duration-500 ease-in-out data-closed:-translate-x-full sm:px-6 sm:pb-10 dark:bg-zinc-950 dark:ring-zinc-800",
1794
1003
  children: [/* @__PURE__ */ jsx(MobileTabsSelect, { tabs }), /* @__PURE__ */ jsx(Navigation, { navigation })]
1795
1004
  }) })] })]
1796
1005
  });
@@ -1809,7 +1018,7 @@ function MobileNavigation(arg0) {
1809
1018
  const isInsideMobileNavigation = useIsInsideMobileNavigation();
1810
1019
  const { isOpen, toggle, close } = useMobileNavigationStore();
1811
1020
  const t = useBuiltInText();
1812
- const ToggleIcon = isOpen ? XIcon : MenuIcon;
1021
+ const ToggleIcon = isOpen ? X : Menu$1;
1813
1022
  return /* @__PURE__ */ jsxs(IsInsideMobileNavigationContext.Provider, {
1814
1023
  value: true,
1815
1024
  children: [/* @__PURE__ */ jsxs("button", {
@@ -1817,7 +1026,7 @@ function MobileNavigation(arg0) {
1817
1026
  className: "clarify-mobile-navigation-button clarify-ui-icon-button relative flex size-6 items-center justify-center rounded-(--clarify-theme-tokens-radius-md) transition",
1818
1027
  "aria-label": t("navigation.toggle"),
1819
1028
  onClick: toggle,
1820
- children: [/* @__PURE__ */ jsx("span", { className: "absolute size-12 pointer-fine:hidden" }), /* @__PURE__ */ jsx(ToggleIcon, { className: "w-2.5 stroke-(--clarify-theme-tokens-colors-foreground) dark:stroke-white" })]
1029
+ children: [/* @__PURE__ */ jsx("span", { className: "absolute size-12 pointer-fine:hidden" }), /* @__PURE__ */ jsx(ToggleIcon, { className: "h-4 w-4 stroke-(--clarify-theme-tokens-colors-foreground) dark:stroke-white" })]
1821
1030
  }), !isInsideMobileNavigation ? /* @__PURE__ */ jsx(Suspense, {
1822
1031
  fallback: null,
1823
1032
  children: /* @__PURE__ */ jsx(MobileNavigationDialog, {
@@ -1835,32 +1044,6 @@ function MobileNavigation(arg0) {
1835
1044
  }
1836
1045
  //#endregion
1837
1046
  //#region source/shell/Search.tsx
1838
- function SearchIcon(props) {
1839
- return /* @__PURE__ */ jsx("svg", {
1840
- viewBox: "0 0 20 20",
1841
- fill: "none",
1842
- "aria-hidden": "true",
1843
- ...props,
1844
- children: /* @__PURE__ */ jsx("path", {
1845
- strokeLinecap: "round",
1846
- strokeLinejoin: "round",
1847
- d: "M12.01 12a4.25 4.25 0 1 0-6.02-6 4.25 4.25 0 0 0 6.02 6Zm0 0 3.24 3.25"
1848
- })
1849
- });
1850
- }
1851
- function NoResultsIcon(props) {
1852
- return /* @__PURE__ */ jsx("svg", {
1853
- viewBox: "0 0 20 20",
1854
- fill: "none",
1855
- "aria-hidden": "true",
1856
- ...props,
1857
- children: /* @__PURE__ */ jsx("path", {
1858
- strokeLinecap: "round",
1859
- strokeLinejoin: "round",
1860
- d: "M12.01 12a4.237 4.237 0 0 0 1.24-3c0-.62-.132-1.207-.37-1.738M12.01 12A4.237 4.237 0 0 1 9 13.25c-.635 0-1.237-.14-1.777-.388M12.01 12l3.24 3.25m-3.715-9.661a4.25 4.25 0 0 0-5.975 5.908M4.5 15.5l11-11"
1861
- })
1862
- });
1863
- }
1864
1047
  function routeGroupTitles(navigation) {
1865
1048
  const titles = /* @__PURE__ */ new Map();
1866
1049
  for (const node of navigation) if (node.children?.length) for (const child of node.children) titles.set(child.path, node.title);
@@ -1943,7 +1126,7 @@ var SearchInput = forwardRef(function SearchInput(arg0, inputRef) {
1943
1126
  const t = useBuiltInText();
1944
1127
  return /* @__PURE__ */ jsxs("div", {
1945
1128
  className: "clarify-search-input group relative flex h-12",
1946
- children: [/* @__PURE__ */ jsx(SearchIcon, { className: "pointer-events-none absolute top-0 left-3 h-full w-5 stroke-(--clarify-theme-tokens-colors-muted)" }), /* @__PURE__ */ jsx("input", {
1129
+ children: [/* @__PURE__ */ jsx(Search, { className: "pointer-events-none absolute top-0 left-3 h-full w-5 stroke-(--clarify-theme-tokens-colors-muted)" }), /* @__PURE__ */ jsx("input", {
1947
1130
  ref: inputRef,
1948
1131
  "data-autofocus": true,
1949
1132
  role: "combobox",
@@ -2020,7 +1203,7 @@ function SearchDialog(arg0) {
2020
1203
  transition: true,
2021
1204
  className: "clarify-search-backdrop clarify-ui-backdrop fixed inset-0 backdrop-blur-xs data-closed:opacity-0 data-enter:duration-300 data-enter:ease-out data-leave:duration-200 data-leave:ease-in"
2022
1205
  }), /* @__PURE__ */ jsx("div", {
2023
- className: "fixed inset-0 overflow-y-auto px-4 py-4 sm:px-6 sm:py-20 md:py-32 lg:px-8 lg:py-[15vh]",
1206
+ className: "fixed inset-0 overflow-y-auto px-4 py-4 sm:px-6 sm:py-20 md:py-32 lg:px-8 lg:py-(--clarify-search-dialog-padding-block-lg)",
2024
1207
  children: /* @__PURE__ */ jsxs(DialogPanel, {
2025
1208
  transition: true,
2026
1209
  className: "clarify-search-panel mx-auto transform-gpu overflow-hidden rounded-(--clarify-theme-tokens-radius-lg) bg-(--clarify-theme-tokens-colors-surface) shadow-xl ring-1 ring-(--clarify-theme-tokens-colors-border) data-closed:scale-95 data-closed:opacity-0 data-enter:duration-300 data-enter:ease-out data-leave:duration-200 data-leave:ease-in sm:max-w-xl dark:bg-zinc-900 dark:ring-zinc-800",
@@ -2044,7 +1227,7 @@ function SearchDialog(arg0) {
2044
1227
  className: "border-t border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-background) empty:hidden dark:border-zinc-100/5 dark:bg-white/2.5",
2045
1228
  children: [query && results.length === 0 ? /* @__PURE__ */ jsxs("div", {
2046
1229
  className: "p-6 text-center",
2047
- children: [/* @__PURE__ */ jsx(NoResultsIcon, { className: "mx-auto h-5 w-5 stroke-(--clarify-theme-tokens-colors-foreground) dark:stroke-zinc-600" }), /* @__PURE__ */ jsx("p", {
1230
+ children: [/* @__PURE__ */ jsx(SearchX, { className: "mx-auto h-5 w-5 stroke-(--clarify-theme-tokens-colors-foreground) dark:stroke-zinc-600" }), /* @__PURE__ */ jsx("p", {
2048
1231
  className: "mt-2 text-xs text-(--clarify-theme-tokens-colors-muted) dark:text-zinc-400",
2049
1232
  children: t("search.noResults", { query })
2050
1233
  })]
@@ -2084,19 +1267,19 @@ function getModifierKey() {
2084
1267
  if (typeof navigator === "undefined") return "Ctrl ";
2085
1268
  return /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform) ? "⌘" : "Ctrl ";
2086
1269
  }
2087
- function Search(arg0) {
1270
+ function Search$1(arg0) {
2088
1271
  const { routes, navigation } = arg0;
2089
1272
  const t = useBuiltInText();
2090
1273
  const modifierKey = getModifierKey();
2091
1274
  const { buttonProps, dialogProps } = useSearchProps();
2092
1275
  return /* @__PURE__ */ jsxs("div", {
2093
- className: "clarify-search hidden w-80 max-w-[36vw] lg:block",
1276
+ className: "clarify-search hidden w-80 max-w-(--clarify-search-max-width) lg:block",
2094
1277
  children: [/* @__PURE__ */ jsxs("button", {
2095
1278
  type: "button",
2096
1279
  className: "clarify-search-button hidden h-9 w-full items-center gap-2 rounded-(--clarify-theme-tokens-radius-lg) bg-(--clarify-theme-tokens-colors-surface) pr-3 pl-2.5 font-medium ring-1 ring-(--clarify-theme-tokens-colors-border) transition hover:bg-(--clarify-theme-tokens-colors-background) lg:flex dark:bg-white/5 dark:ring-white/10 dark:ring-inset dark:hover:bg-white/10",
2097
1280
  ...buttonProps,
2098
1281
  children: [
2099
- /* @__PURE__ */ jsx(SearchIcon, { className: "h-5 w-5 stroke-current" }),
1282
+ /* @__PURE__ */ jsx(Search, { className: "h-5 w-5 stroke-current" }),
2100
1283
  t("search.button"),
2101
1284
  /* @__PURE__ */ jsxs("kbd", {
2102
1285
  className: "clarify-search-shortcut ml-auto rounded-(--clarify-theme-tokens-radius-sm) bg-(--clarify-theme-tokens-colors-background) px-1.5 py-0.5 ring-1 ring-(--clarify-theme-tokens-colors-border) dark:bg-white/5 dark:ring-white/10",
@@ -2131,7 +1314,7 @@ function MobileSearch(arg0) {
2131
1314
  className: "clarify-mobile-search-button clarify-ui-control relative flex size-6 items-center justify-center rounded-(--clarify-theme-tokens-radius-md) transition lg:hidden",
2132
1315
  "aria-label": t("search.placeholder"),
2133
1316
  ...buttonProps,
2134
- children: [/* @__PURE__ */ jsx("span", { className: "absolute size-12 pointer-fine:hidden" }), /* @__PURE__ */ jsx(SearchIcon, { className: "h-5 w-5 stroke-(--clarify-theme-tokens-colors-foreground) dark:stroke-white" })]
1317
+ children: [/* @__PURE__ */ jsx("span", { className: "absolute size-12 pointer-fine:hidden" }), /* @__PURE__ */ jsx(Search, { className: "h-5 w-5 stroke-(--clarify-theme-tokens-colors-foreground) dark:stroke-white" })]
2135
1318
  }), /* @__PURE__ */ jsx(Suspense, {
2136
1319
  fallback: null,
2137
1320
  children: /* @__PURE__ */ jsx(SearchDialog, {
@@ -2184,15 +1367,6 @@ function localizedRoutePath(config, locale, route) {
2184
1367
  if (route?.alternates) return void 0;
2185
1368
  return localizeHref(route?.basePath ?? route?.path ?? "/", config, locale);
2186
1369
  }
2187
- function LanguageIcon(props) {
2188
- return /* @__PURE__ */ jsxs("svg", {
2189
- viewBox: "0 0 20 20",
2190
- fill: "none",
2191
- "aria-hidden": "true",
2192
- ...props,
2193
- children: [/* @__PURE__ */ jsx("path", { d: "M10 17.5a7.5 7.5 0 1 0 0-15 7.5 7.5 0 0 0 0 15Z" }), /* @__PURE__ */ jsx("path", { d: "M2.5 10h15M10 2.5c2 2.05 3 4.55 3 7.5s-1 5.45-3 7.5c-2-2.05-3-4.55-3-7.5s1-5.45 3-7.5Z" })]
2194
- });
2195
- }
2196
1370
  function LanguageSwitcher(arg0) {
2197
1371
  const { config, currentLocale, currentRoute } = arg0;
2198
1372
  const t = useBuiltInText();
@@ -2210,7 +1384,7 @@ function LanguageSwitcher(arg0) {
2210
1384
  "aria-label": t("language.switch"),
2211
1385
  children: [
2212
1386
  /* @__PURE__ */ jsx("span", { className: "absolute size-12 pointer-fine:hidden" }),
2213
- /* @__PURE__ */ jsx(LanguageIcon, { className: "h-5 w-5 stroke-current" }),
1387
+ /* @__PURE__ */ jsx(Globe2, { className: "h-5 w-5 stroke-current" }),
2214
1388
  /* @__PURE__ */ jsx("span", {
2215
1389
  className: "hidden sm:inline",
2216
1390
  children: selectedLocaleConfig?.label ?? selectedLocale
@@ -2380,7 +1554,7 @@ var Header = forwardRef(function Header(arg0, ref) {
2380
1554
  }),
2381
1555
  /* @__PURE__ */ jsx("div", {
2382
1556
  className: "clarify-header-center absolute left-1/2 hidden -translate-x-1/2 lg:block",
2383
- children: /* @__PURE__ */ jsx(Search, {
1557
+ children: /* @__PURE__ */ jsx(Search$1, {
2384
1558
  routes,
2385
1559
  navigation
2386
1560
  })
@@ -2422,6 +1596,6 @@ var Header = forwardRef(function Header(arg0, ref) {
2422
1596
  });
2423
1597
  });
2424
1598
  //#endregion
2425
- export { prefixHref as A, normalizeRoutePath as C, ContentActions as D, useTheme as E, OpenApisContext as F, useClarifyConfig as I, useOpenApis as L, useBuiltInText as M, ClarifyConfigContext as N, isExternalHref as O, ClarifyLocaleContext as P, isSameRoutePath as S, ThemeProvider as T, Callout as _, GridPattern as a, useSectionStore as b, Heading as c, Collapse as d, Code as f, CardGroup as g, Card as h, Prose as i, copyTextToClipboard as j, localizeHref as k, Tag as l, Pre as m, Navigation as n, HeroPattern as o, CodeGroup as p, safeDecodeURIComponent as r, Logo as s, Header as t, Feedback as u, Button as v, ThemeToggle as w, remToPx as x, SectionProvider as y };
1599
+ export { useClarifyConfig as C, OpenApisContext as S, prefixHref as _, useSectionStore as a, ClarifyConfigContext as b, resolveLucideIconName as c, ThemeToggle as d, ThemeProvider as f, localizeHref as g, isExternalHref as h, SectionProvider as i, isSameRoutePath as l, ContentActions as m, Navigation as n, remToPx as o, useTheme as p, safeDecodeURIComponent as r, lucideIconRegistry as s, Header as t, normalizeRoutePath as u, copyTextToClipboard as v, useOpenApis as w, ClarifyLocaleContext as x, useBuiltInText as y };
2426
1600
 
2427
- //# sourceMappingURL=shell-BlMMdTpZ.js.map
1601
+ //# sourceMappingURL=shell-DvTfFx6M.js.map