@clarify-labs/renderer 0.10.2 → 0.11.0

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 (90) hide show
  1. package/output/{ClarifyShell-C6li72Ce.cjs → ClarifyShell-BAjq876Z.cjs} +113 -90
  2. package/output/ClarifyShell-BAjq876Z.cjs.map +1 -0
  3. package/output/{ClarifyShell-1LuBliwt.js → ClarifyShell-GoSXvgMg.js} +114 -91
  4. package/output/ClarifyShell-GoSXvgMg.js.map +1 -0
  5. package/output/{MermaidViewer-B6-BMCJG.cjs → MermaidViewer-BZ8ghcFP.cjs} +2 -2
  6. package/output/{MermaidViewer-B6-BMCJG.cjs.map → MermaidViewer-BZ8ghcFP.cjs.map} +1 -1
  7. package/output/{MermaidViewer-dXsomvM7.js → MermaidViewer-CkIxyqtf.js} +2 -2
  8. package/output/{MermaidViewer-dXsomvM7.js.map → MermaidViewer-CkIxyqtf.js.map} +1 -1
  9. package/output/{OpenApiOperation-DgrqzeiS.js → OpenApiOperation-C2vJztWZ.js} +1983 -365
  10. package/output/OpenApiOperation-C2vJztWZ.js.map +1 -0
  11. package/output/{OpenApiOperation-B52IWlKb.cjs → OpenApiOperation-D-5uE5v7.cjs} +2009 -361
  12. package/output/OpenApiOperation-D-5uE5v7.cjs.map +1 -0
  13. package/output/{PageActions-BjB6PYmL.cjs → PageActions-DJRXlGhz.cjs} +532 -358
  14. package/output/PageActions-DJRXlGhz.cjs.map +1 -0
  15. package/output/{PageActions-D7K9LDGf.js → PageActions-bugd7GZh.js} +535 -361
  16. package/output/PageActions-bugd7GZh.js.map +1 -0
  17. package/output/{SearchDialog-CIPvXMT3.cjs → SearchDialog-8AdCRp6K.cjs} +3 -3
  18. package/output/{SearchDialog-CIPvXMT3.cjs.map → SearchDialog-8AdCRp6K.cjs.map} +1 -1
  19. package/output/{SearchDialog-CxYLjRi5.js → SearchDialog-CBJjDs_9.js} +3 -3
  20. package/output/{SearchDialog-CxYLjRi5.js.map → SearchDialog-CBJjDs_9.js.map} +1 -1
  21. package/output/app/ContentDiagnostic.d.ts +2 -1
  22. package/output/app/PageFooter.d.ts +1 -1
  23. package/output/client.cjs +3 -3
  24. package/output/client.js +3 -3
  25. package/output/components/AccordionGroup.d.ts +7 -0
  26. package/output/components/Collapse.d.ts +2 -0
  27. package/output/components/FileTree.d.ts +10 -0
  28. package/output/components/Image.d.ts +6 -0
  29. package/output/components/Steps.d.ts +12 -0
  30. package/output/components/Tabs.d.ts +12 -5
  31. package/output/components/Tooltip.d.ts +8 -0
  32. package/output/components/index.d.ts +10 -1
  33. package/output/core/i18n.d.ts +1 -1
  34. package/output/core/types.d.ts +37 -19
  35. package/output/{i18n-DnqZHFT7.js → i18n-BPrC45nD.js} +102 -2
  36. package/output/i18n-BPrC45nD.js.map +1 -0
  37. package/output/{i18n-b4iTLeia.cjs → i18n-wXINKKV0.cjs} +102 -2
  38. package/output/i18n-wXINKKV0.cjs.map +1 -0
  39. package/output/index.cjs +38 -8
  40. package/output/index.cjs.map +1 -1
  41. package/output/index.d.ts +8 -7
  42. package/output/index.js +34 -9
  43. package/output/index.js.map +1 -1
  44. package/output/mdx/components.d.ts +11 -1
  45. package/output/mdx/primitives.d.ts +4 -2
  46. package/output/openapi/components/CodeDisplay.d.ts +1 -0
  47. package/output/openapi/components/EndpointMethodBadge.d.ts +6 -0
  48. package/output/openapi/components/EndpointSections.d.ts +2 -2
  49. package/output/openapi/components/ExamplePanels.d.ts +2 -2
  50. package/output/openapi/components/InlineListbox.d.ts +31 -0
  51. package/output/openapi/components/OpenApiAuthPanel.d.ts +12 -0
  52. package/output/openapi/components/OpenApiOperation.d.ts +1 -9
  53. package/output/openapi/components/OpenApiOperation.state.d.ts +4 -2
  54. package/output/openapi/components/OpenApiRequest.d.ts +18 -0
  55. package/output/openapi/components/OpenApiRequestFields.d.ts +25 -0
  56. package/output/openapi/components/OpenApiResponseViewer.d.ts +8 -0
  57. package/output/openapi/components/SendRequestButton.d.ts +9 -0
  58. package/output/openapi/components/helpers.d.ts +6 -1
  59. package/output/openapi/components/useOpenApiRequestState.d.ts +41 -0
  60. package/output/openapi/entry.d.ts +2 -0
  61. package/output/openapi/index.d.ts +2 -2
  62. package/output/openapi/lib/api-exchange-code.d.ts +8 -0
  63. package/output/openapi/lib/api-exchange.d.ts +30 -0
  64. package/output/openapi/lib/api-request.d.ts +24 -0
  65. package/output/openapi/lib/request-code.d.ts +2 -2
  66. package/output/openapi/lib/request-parameters.d.ts +5 -0
  67. package/output/openapi/store.d.ts +10 -0
  68. package/output/openapi/types.d.ts +4 -0
  69. package/output/preview.cjs +37 -27
  70. package/output/preview.cjs.map +1 -1
  71. package/output/preview.js +37 -27
  72. package/output/preview.js.map +1 -1
  73. package/output/{render-Di5B6Zc0.cjs → render-FICIzeXz.cjs} +2 -2
  74. package/output/{render-Di5B6Zc0.cjs.map → render-FICIzeXz.cjs.map} +1 -1
  75. package/output/{render-DKj24Jqw.js → render-XQiw_48i.js} +2 -2
  76. package/output/{render-DKj24Jqw.js.map → render-XQiw_48i.js.map} +1 -1
  77. package/output/renderer.css +1310 -318
  78. package/output/server.cjs +2 -2
  79. package/output/server.js +2 -2
  80. package/output/theme/ThemeEditor.d.ts +8 -4
  81. package/output/theme/variables.d.ts +8 -4
  82. package/package.json +1 -1
  83. package/output/ClarifyShell-1LuBliwt.js.map +0 -1
  84. package/output/ClarifyShell-C6li72Ce.cjs.map +0 -1
  85. package/output/OpenApiOperation-B52IWlKb.cjs.map +0 -1
  86. package/output/OpenApiOperation-DgrqzeiS.js.map +0 -1
  87. package/output/PageActions-BjB6PYmL.cjs.map +0 -1
  88. package/output/PageActions-D7K9LDGf.js.map +0 -1
  89. package/output/i18n-DnqZHFT7.js.map +0 -1
  90. package/output/i18n-b4iTLeia.cjs.map +0 -1
@@ -1,12 +1,12 @@
1
- import { t as useBuiltInText } from "./i18n-DnqZHFT7.js";
1
+ import { t as useBuiltInText } from "./i18n-BPrC45nD.js";
2
2
  import clsx from "clsx";
3
- import { Suspense, createContext, forwardRef, lazy, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
3
+ import { Suspense, createContext, forwardRef, lazy, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
4
4
  import { Link, useLocation } from "react-router-dom";
5
5
  import { CloseButton, Dialog, DialogBackdrop, DialogPanel, Menu, MenuButton, MenuItem, MenuItems, TransitionChild } from "@headlessui/react";
6
6
  import * as LucideIcons from "lucide-react";
7
- import { Check, ChevronDown, Copy, ExternalLink, FileText, Globe2, Link2, Menu as Menu$1, Monitor, Moon, MoreHorizontal, PencilLine, Search, Sun, X } from "lucide-react";
7
+ import { Check, ChevronDown, ChevronLeft, ChevronRight, Copy, ExternalLink, FileText, Globe2, Link2, LoaderCircle, Menu as Menu$1, Monitor, Moon, MoreHorizontal, PencilLine, Search, Sun, X } from "lucide-react";
8
8
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
9
- import { AnimatePresence, motion, useIsPresent, useScroll, useTransform } from "framer-motion";
9
+ import { AnimatePresence, LayoutGroup, motion, useReducedMotion, useScroll, useTransform } from "framer-motion";
10
10
  import { create, createStore, useStore } from "zustand";
11
11
  //#region source/utils/clipboard.ts
12
12
  async function copyTextToClipboard(text) {
@@ -38,12 +38,12 @@ function isExternalHref(href) {
38
38
  }
39
39
  function hasLocalePrefix(href, config) {
40
40
  const firstSegment = href.replace(/^\/+/, "").split("/")[0];
41
- return Boolean(firstSegment && config.i18n?.locales.some((locale) => locale.code === firstSegment));
41
+ return Boolean(firstSegment && config.locales?.locales.some((locale) => locale.code === firstSegment));
42
42
  }
43
43
  function localizeHref(href, config, locale) {
44
- if (!locale || !config.i18n || isExternalHref(href) || href.startsWith("#")) return href;
44
+ if (!locale || !config.locales || isExternalHref(href) || href.startsWith("#")) return href;
45
45
  if (hasLocalePrefix(href, config)) return href;
46
- if (locale === config.i18n.defaultLocale) return href.startsWith("/") ? href : `/${href}`;
46
+ if (locale === config.locales.default) return href.startsWith("/") ? href : `/${href}`;
47
47
  const cleanHref = href === "/" ? "" : href.replace(/^\/+/, "");
48
48
  return `/${locale}${cleanHref ? `/${cleanHref}` : ""}`;
49
49
  }
@@ -69,27 +69,46 @@ function ContentActions(arg0) {
69
69
  const { route, routePrefix } = arg0;
70
70
  const t = useBuiltInText();
71
71
  const [copied, setCopied] = useState("idle");
72
+ const [copyPhase, setCopyPhase] = useState("idle");
73
+ useEffect(() => {
74
+ if (copyPhase !== "copied" && copyPhase !== "failed") return void 0;
75
+ const timeout = setTimeout(() => {
76
+ setCopied("idle");
77
+ setCopyPhase("idle");
78
+ }, 1600);
79
+ return () => clearTimeout(timeout);
80
+ }, [copyPhase]);
72
81
  if (!route?.contentArtifactUrl && !route?.sourceEditUrl) return null;
73
82
  const contentArtifactUrl = route.contentArtifactUrl ? resolveContentArtifactUrl(route.contentArtifactUrl, routePrefix) : void 0;
74
83
  const isOpenApi = route.kind === "openapi";
75
84
  const replacements = { contentType: isOpenApi ? "OpenAPI" : "Markdown" };
76
85
  const viewLabel = isOpenApi ? t("contentActions.viewOpenApi") : t("contentActions.viewMarkdown");
77
86
  const viewDescription = isOpenApi ? t("contentActions.viewOpenApiDescription") : t("contentActions.viewMarkdownDescription");
78
- function markCopied(state) {
87
+ async function runCopy(state, getText) {
79
88
  setCopied(state);
80
- setTimeout(() => setCopied("idle"), 1600);
89
+ setCopyPhase("copying");
90
+ try {
91
+ const text = await getText();
92
+ setCopyPhase(await copyTextToClipboard(text) ? "copied" : "failed");
93
+ } catch {
94
+ setCopyPhase("failed");
95
+ }
81
96
  }
82
97
  async function handleCopyContent() {
83
98
  if (!contentArtifactUrl) return;
84
- if (await copyTextToClipboard(await (await fetch(contentArtifactUrl)).text())) markCopied("content");
99
+ await runCopy("content", async () => {
100
+ const response = await fetch(contentArtifactUrl);
101
+ if (!response.ok) throw new Error(`Failed to fetch content: ${response.status}`);
102
+ return response.text();
103
+ });
85
104
  }
86
105
  const llmsArtifactUrl = resolveContentArtifactUrl("/llms.txt", routePrefix);
87
106
  async function handleCopyLink() {
88
107
  if (!contentArtifactUrl) return;
89
- if (await copyTextToClipboard(getAbsoluteUrl(contentArtifactUrl))) markCopied("link");
108
+ await runCopy("link", () => getAbsoluteUrl(contentArtifactUrl));
90
109
  }
91
110
  async function handleCopyLlms() {
92
- if (await copyTextToClipboard(getAbsoluteUrl(llmsArtifactUrl))) markCopied("llms");
111
+ await runCopy("llms", () => getAbsoluteUrl(llmsArtifactUrl));
93
112
  }
94
113
  const actions = contentArtifactUrl ? [{
95
114
  key: "content",
@@ -115,163 +134,176 @@ function ContentActions(arg0) {
115
134
  copiedLabel: t("contentActions.copiedLlms")
116
135
  };
117
136
  const primaryAction = actions[0];
118
- const PrimaryIcon = primaryAction && copied === primaryAction.key ? Check : primaryAction?.icon ?? PencilLine;
137
+ const primaryPhase = primaryAction && copied === primaryAction.key ? copyPhase : "idle";
138
+ const PrimaryIcon = primaryPhase === "copying" ? LoaderCircle : primaryPhase === "copied" ? Check : primaryPhase === "failed" ? X : primaryAction?.icon ?? PencilLine;
139
+ const feedbackAction = copied === "content" ? actions[0] : copied === "link" ? actions[1] : copied === "llms" ? llmsAction : void 0;
140
+ const feedbackLabel = copyPhase === "copying" ? t("actions.copying") : copyPhase === "failed" ? t("actions.copyFailed") : feedbackAction?.copiedLabel;
119
141
  return /* @__PURE__ */ jsx("div", {
120
142
  className: "clarify-content-actions not-prose flex shrink-0 justify-start sm:justify-end",
121
143
  children: /* @__PURE__ */ jsxs(Menu, {
122
144
  as: "div",
123
145
  className: "clarify-content-actions-menu relative inline-flex min-w-0 text-sm font-medium",
124
- children: [/* @__PURE__ */ jsxs("div", {
125
- className: "clarify-content-actions-group inline-flex min-w-0 overflow-hidden rounded-full border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) shadow-sm shadow-zinc-900/5",
126
- children: [primaryAction ? /* @__PURE__ */ jsxs("button", {
127
- type: "button",
128
- onClick: primaryAction.run,
129
- className: "clarify-content-actions-primary clarify-ui-control inline-flex h-8 min-w-0 items-center gap-1.5 px-2.5 transition sm:px-3",
130
- children: [/* @__PURE__ */ jsx(PrimaryIcon, { className: "h-3.5 w-3.5 shrink-0" }), /* @__PURE__ */ jsx("span", {
131
- className: "truncate",
132
- children: copied === primaryAction.key ? t("actions.copied") : primaryAction.label
133
- })]
134
- }) : /* @__PURE__ */ jsxs("a", {
135
- href: route.sourceEditUrl,
136
- target: "_blank",
137
- rel: "noreferrer",
138
- className: "clarify-content-actions-primary clarify-ui-control inline-flex h-8 min-w-0 items-center gap-1.5 px-2.5 no-underline transition sm:px-3",
139
- children: [/* @__PURE__ */ jsx(PrimaryIcon, { className: "h-3.5 w-3.5 shrink-0" }), /* @__PURE__ */ jsx("span", {
140
- className: "truncate",
141
- children: t("contentActions.editPage")
142
- })]
143
- }), /* @__PURE__ */ jsx(MenuButton, {
144
- 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",
145
- "aria-label": t("contentActions.copyOptions"),
146
- children: /* @__PURE__ */ jsx(ChevronDown, { className: "h-3.5 w-3.5" })
147
- })]
148
- }), /* @__PURE__ */ jsxs(MenuItems, {
149
- modal: false,
150
- anchor: "bottom end",
151
- 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",
152
- children: [
153
- route.sourceEditUrl ? /* @__PURE__ */ jsx(MenuItem, { children: /* @__PURE__ */ jsxs("a", {
146
+ children: [
147
+ /* @__PURE__ */ jsxs("div", {
148
+ className: "clarify-content-actions-group inline-flex min-w-0 items-center gap-1",
149
+ children: [primaryAction ? /* @__PURE__ */ jsxs("button", {
150
+ type: "button",
151
+ onClick: primaryAction.run,
152
+ disabled: primaryPhase === "copying",
153
+ "aria-live": "polite",
154
+ className: "clarify-content-actions-primary clarify-ui-control inline-flex h-9 min-w-0 items-center gap-2 rounded-md border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) px-3 shadow-xs shadow-zinc-900/5 transition",
155
+ children: [/* @__PURE__ */ jsx(PrimaryIcon, { className: `h-4 w-4 shrink-0 ${primaryPhase === "copying" ? "animate-spin" : ""}` }), /* @__PURE__ */ jsx("span", {
156
+ className: "truncate",
157
+ children: primaryPhase === "idle" ? primaryAction.label : feedbackLabel
158
+ })]
159
+ }) : /* @__PURE__ */ jsxs("a", {
154
160
  href: route.sourceEditUrl,
155
161
  target: "_blank",
156
162
  rel: "noreferrer",
157
- 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",
158
- children: [
159
- /* @__PURE__ */ jsx("span", {
160
- className: "clarify-ui-menu-icon flex shrink-0 rounded-(--clarify-theme-tokens-radius-md) border border-(--clarify-theme-tokens-colors-border) p-1.5",
161
- children: /* @__PURE__ */ jsx(PencilLine, { className: "h-4 w-4" })
162
- }),
163
- /* @__PURE__ */ jsxs("span", {
164
- className: "flex min-w-0 flex-1 flex-col px-1",
165
- children: [/* @__PURE__ */ jsxs("span", {
166
- className: "clarify-ui-menu-title flex items-center gap-1",
167
- children: [t("contentActions.editPage"), /* @__PURE__ */ jsx(ExternalLink, { className: "clarify-ui-menu-icon h-3 w-3" })]
168
- }), /* @__PURE__ */ jsx("span", {
169
- className: "clarify-ui-menu-description truncate",
170
- children: t("contentActions.editPageDescription")
171
- })]
172
- }),
173
- /* @__PURE__ */ jsx(Check, { className: "h-3.5 w-3.5 shrink-0 text-(--clarify-theme-tokens-colors-primary) opacity-0" })
174
- ]
175
- }) }) : null,
176
- actions.slice(0, 1).map((action) => {
177
- const Icon = action.icon;
178
- const isCopied = copied === action.key;
179
- return /* @__PURE__ */ jsx(MenuItem, { children: /* @__PURE__ */ jsxs("button", {
180
- type: "button",
181
- onClick: action.run,
182
- 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",
163
+ className: "clarify-content-actions-primary clarify-ui-control inline-flex h-9 min-w-0 items-center gap-2 rounded-md border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) px-3 no-underline shadow-xs shadow-zinc-900/5 transition",
164
+ children: [/* @__PURE__ */ jsx(PrimaryIcon, { className: "h-4 w-4 shrink-0" }), /* @__PURE__ */ jsx("span", {
165
+ className: "truncate",
166
+ children: t("contentActions.editPage")
167
+ })]
168
+ }), /* @__PURE__ */ jsx(MenuButton, {
169
+ className: "clarify-content-actions-trigger clarify-ui-control inline-flex size-9 items-center justify-center rounded-md border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) shadow-xs shadow-zinc-900/5 transition",
170
+ "aria-label": t("contentActions.copyOptions"),
171
+ children: /* @__PURE__ */ jsx(ChevronDown, { className: "h-3.5 w-3.5" })
172
+ })]
173
+ }),
174
+ feedbackAction && copyPhase !== "idle" && copied !== primaryAction?.key ? /* @__PURE__ */ jsxs("div", {
175
+ role: "status",
176
+ className: "absolute top-full right-0 mt-2 inline-flex items-center gap-1.5 whitespace-nowrap rounded-md border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) px-2.5 py-1.5 text-xs shadow-lg shadow-zinc-900/10",
177
+ children: [copyPhase === "copying" ? /* @__PURE__ */ jsx(LoaderCircle, { className: "h-3.5 w-3.5 animate-spin" }) : copyPhase === "copied" ? /* @__PURE__ */ jsx(Check, { className: "h-3.5 w-3.5 text-(--clarify-theme-tokens-colors-primary)" }) : /* @__PURE__ */ jsx(X, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ jsx("span", { children: feedbackLabel })]
178
+ }) : null,
179
+ /* @__PURE__ */ jsxs(MenuItems, {
180
+ modal: false,
181
+ anchor: "bottom end",
182
+ 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",
183
+ children: [
184
+ route.sourceEditUrl ? /* @__PURE__ */ jsx(MenuItem, { children: /* @__PURE__ */ jsxs("a", {
185
+ href: route.sourceEditUrl,
186
+ target: "_blank",
187
+ rel: "noreferrer",
188
+ 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",
183
189
  children: [
184
190
  /* @__PURE__ */ jsx("span", {
185
191
  className: "clarify-ui-menu-icon flex shrink-0 rounded-(--clarify-theme-tokens-radius-md) border border-(--clarify-theme-tokens-colors-border) p-1.5",
186
- children: /* @__PURE__ */ jsx(Icon, { className: "h-4 w-4" })
192
+ children: /* @__PURE__ */ jsx(PencilLine, { className: "h-4 w-4" })
187
193
  }),
188
194
  /* @__PURE__ */ jsxs("span", {
189
195
  className: "flex min-w-0 flex-1 flex-col px-1",
190
- children: [/* @__PURE__ */ jsx("span", {
191
- className: "clarify-ui-menu-title",
192
- children: isCopied ? t("contentActions.copiedContent") : action.label
196
+ children: [/* @__PURE__ */ jsxs("span", {
197
+ className: "clarify-ui-menu-title flex items-center gap-1",
198
+ children: [t("contentActions.editPage"), /* @__PURE__ */ jsx(ExternalLink, { className: "clarify-ui-menu-icon h-3 w-3" })]
193
199
  }), /* @__PURE__ */ jsx("span", {
194
200
  className: "clarify-ui-menu-description truncate",
195
- children: action.description
201
+ children: t("contentActions.editPageDescription")
196
202
  })]
197
203
  }),
198
- /* @__PURE__ */ jsx(Check, { className: `h-3.5 w-3.5 shrink-0 text-(--clarify-theme-tokens-colors-primary) transition ${isCopied ? "opacity-100" : "opacity-0"}` })
204
+ /* @__PURE__ */ jsx(Check, { className: "h-3.5 w-3.5 shrink-0 text-(--clarify-theme-tokens-colors-primary) opacity-0" })
199
205
  ]
200
- }) }, action.key);
201
- }),
202
- contentArtifactUrl ? /* @__PURE__ */ jsx(MenuItem, { children: /* @__PURE__ */ jsxs("a", {
203
- href: contentArtifactUrl,
204
- target: "_blank",
205
- rel: "noreferrer",
206
- 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",
207
- children: [
208
- /* @__PURE__ */ jsx("span", {
209
- className: "clarify-ui-menu-icon flex shrink-0 rounded-(--clarify-theme-tokens-radius-md) border border-(--clarify-theme-tokens-colors-border) p-1.5",
210
- children: /* @__PURE__ */ jsx(FileText, { className: "h-4 w-4" })
211
- }),
212
- /* @__PURE__ */ jsxs("span", {
213
- className: "flex min-w-0 flex-1 flex-col px-1",
214
- children: [/* @__PURE__ */ jsxs("span", {
215
- className: "clarify-ui-menu-title flex items-center gap-1",
216
- children: [viewLabel, /* @__PURE__ */ jsx(ExternalLink, { className: "clarify-ui-menu-icon h-3 w-3" })]
217
- }), /* @__PURE__ */ jsx("span", {
218
- className: "clarify-ui-menu-description truncate",
219
- children: viewDescription
220
- })]
221
- }),
222
- /* @__PURE__ */ jsx(Check, { className: "h-3.5 w-3.5 shrink-0 text-(--clarify-theme-tokens-colors-primary) opacity-0" })
223
- ]
224
- }) }) : null,
225
- actions.slice(1).map((action) => {
226
- const Icon = action.icon;
227
- const isCopied = copied === action.key;
228
- return /* @__PURE__ */ jsx(MenuItem, { children: /* @__PURE__ */ jsxs("button", {
206
+ }) }) : null,
207
+ actions.slice(0, 1).map((action) => {
208
+ const Icon = action.icon;
209
+ const isCopied = copied === action.key;
210
+ return /* @__PURE__ */ jsx(MenuItem, { children: /* @__PURE__ */ jsxs("button", {
211
+ type: "button",
212
+ onClick: action.run,
213
+ 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",
214
+ children: [
215
+ /* @__PURE__ */ jsx("span", {
216
+ className: "clarify-ui-menu-icon flex shrink-0 rounded-(--clarify-theme-tokens-radius-md) border border-(--clarify-theme-tokens-colors-border) p-1.5",
217
+ children: /* @__PURE__ */ jsx(Icon, { className: "h-4 w-4" })
218
+ }),
219
+ /* @__PURE__ */ jsxs("span", {
220
+ className: "flex min-w-0 flex-1 flex-col px-1",
221
+ children: [/* @__PURE__ */ jsx("span", {
222
+ className: "clarify-ui-menu-title",
223
+ children: isCopied ? t("contentActions.copiedContent") : action.label
224
+ }), /* @__PURE__ */ jsx("span", {
225
+ className: "clarify-ui-menu-description truncate",
226
+ children: action.description
227
+ })]
228
+ }),
229
+ /* @__PURE__ */ jsx(Check, { className: `h-3.5 w-3.5 shrink-0 text-(--clarify-theme-tokens-colors-primary) transition ${isCopied ? "opacity-100" : "opacity-0"}` })
230
+ ]
231
+ }) }, action.key);
232
+ }),
233
+ contentArtifactUrl ? /* @__PURE__ */ jsx(MenuItem, { children: /* @__PURE__ */ jsxs("a", {
234
+ href: contentArtifactUrl,
235
+ target: "_blank",
236
+ rel: "noreferrer",
237
+ 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",
238
+ children: [
239
+ /* @__PURE__ */ jsx("span", {
240
+ className: "clarify-ui-menu-icon flex shrink-0 rounded-(--clarify-theme-tokens-radius-md) border border-(--clarify-theme-tokens-colors-border) p-1.5",
241
+ children: /* @__PURE__ */ jsx(FileText, { className: "h-4 w-4" })
242
+ }),
243
+ /* @__PURE__ */ jsxs("span", {
244
+ className: "flex min-w-0 flex-1 flex-col px-1",
245
+ children: [/* @__PURE__ */ jsxs("span", {
246
+ className: "clarify-ui-menu-title flex items-center gap-1",
247
+ children: [viewLabel, /* @__PURE__ */ jsx(ExternalLink, { className: "clarify-ui-menu-icon h-3 w-3" })]
248
+ }), /* @__PURE__ */ jsx("span", {
249
+ className: "clarify-ui-menu-description truncate",
250
+ children: viewDescription
251
+ })]
252
+ }),
253
+ /* @__PURE__ */ jsx(Check, { className: "h-3.5 w-3.5 shrink-0 text-(--clarify-theme-tokens-colors-primary) opacity-0" })
254
+ ]
255
+ }) }) : null,
256
+ actions.slice(1).map((action) => {
257
+ const Icon = action.icon;
258
+ const isCopied = copied === action.key;
259
+ return /* @__PURE__ */ jsx(MenuItem, { children: /* @__PURE__ */ jsxs("button", {
260
+ type: "button",
261
+ onClick: action.run,
262
+ 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",
263
+ children: [
264
+ /* @__PURE__ */ jsx("span", {
265
+ className: "clarify-ui-menu-icon flex shrink-0 rounded-(--clarify-theme-tokens-radius-md) border border-(--clarify-theme-tokens-colors-border) p-1.5",
266
+ children: /* @__PURE__ */ jsx(Icon, { className: "h-4 w-4" })
267
+ }),
268
+ /* @__PURE__ */ jsxs("span", {
269
+ className: "flex min-w-0 flex-1 flex-col px-1",
270
+ children: [/* @__PURE__ */ jsx("span", {
271
+ className: "clarify-ui-menu-title",
272
+ children: isCopied ? action.copiedLabel ?? action.label : action.label
273
+ }), /* @__PURE__ */ jsx("span", {
274
+ className: "clarify-ui-menu-description truncate",
275
+ children: action.description
276
+ })]
277
+ }),
278
+ /* @__PURE__ */ jsx(Check, { className: `h-3.5 w-3.5 shrink-0 text-(--clarify-theme-tokens-colors-primary) transition ${isCopied ? "opacity-100" : "opacity-0"}` })
279
+ ]
280
+ }) }, action.key);
281
+ }),
282
+ /* @__PURE__ */ jsx(MenuItem, { children: /* @__PURE__ */ jsxs("button", {
229
283
  type: "button",
230
- onClick: action.run,
284
+ onClick: llmsAction.run,
231
285
  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",
232
286
  children: [
233
287
  /* @__PURE__ */ jsx("span", {
234
288
  className: "clarify-ui-menu-icon flex shrink-0 rounded-(--clarify-theme-tokens-radius-md) border border-(--clarify-theme-tokens-colors-border) p-1.5",
235
- children: /* @__PURE__ */ jsx(Icon, { className: "h-4 w-4" })
289
+ children: /* @__PURE__ */ jsx(FileText, { className: "h-4 w-4" })
236
290
  }),
237
291
  /* @__PURE__ */ jsxs("span", {
238
292
  className: "flex min-w-0 flex-1 flex-col px-1",
239
293
  children: [/* @__PURE__ */ jsx("span", {
240
294
  className: "clarify-ui-menu-title",
241
- children: isCopied ? action.copiedLabel ?? action.label : action.label
295
+ children: copied === llmsAction.key ? llmsAction.copiedLabel ?? llmsAction.label : llmsAction.label
242
296
  }), /* @__PURE__ */ jsx("span", {
243
297
  className: "clarify-ui-menu-description truncate",
244
- children: action.description
298
+ children: llmsAction.description
245
299
  })]
246
300
  }),
247
- /* @__PURE__ */ jsx(Check, { className: `h-3.5 w-3.5 shrink-0 text-(--clarify-theme-tokens-colors-primary) transition ${isCopied ? "opacity-100" : "opacity-0"}` })
301
+ /* @__PURE__ */ jsx(Check, { className: `h-3.5 w-3.5 shrink-0 text-(--clarify-theme-tokens-colors-primary) transition ${copied === llmsAction.key ? "opacity-100" : "opacity-0"}` })
248
302
  ]
249
- }) }, action.key);
250
- }),
251
- /* @__PURE__ */ jsx(MenuItem, { children: /* @__PURE__ */ jsxs("button", {
252
- type: "button",
253
- onClick: llmsAction.run,
254
- 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",
255
- children: [
256
- /* @__PURE__ */ jsx("span", {
257
- className: "clarify-ui-menu-icon flex shrink-0 rounded-(--clarify-theme-tokens-radius-md) border border-(--clarify-theme-tokens-colors-border) p-1.5",
258
- children: /* @__PURE__ */ jsx(FileText, { className: "h-4 w-4" })
259
- }),
260
- /* @__PURE__ */ jsxs("span", {
261
- className: "flex min-w-0 flex-1 flex-col px-1",
262
- children: [/* @__PURE__ */ jsx("span", {
263
- className: "clarify-ui-menu-title",
264
- children: copied === llmsAction.key ? llmsAction.copiedLabel ?? llmsAction.label : llmsAction.label
265
- }), /* @__PURE__ */ jsx("span", {
266
- className: "clarify-ui-menu-description truncate",
267
- children: llmsAction.description
268
- })]
269
- }),
270
- /* @__PURE__ */ jsx(Check, { className: `h-3.5 w-3.5 shrink-0 text-(--clarify-theme-tokens-colors-primary) transition ${copied === llmsAction.key ? "opacity-100" : "opacity-0"}` })
271
- ]
272
- }) }, llmsAction.key)
273
- ]
274
- })]
303
+ }) }, llmsAction.key)
304
+ ]
305
+ })
306
+ ]
275
307
  })
276
308
  });
277
309
  }
@@ -437,12 +469,12 @@ function ThemeToggle() {
437
469
  const label = getThemeLabel(nextTheme, t);
438
470
  return /* @__PURE__ */ jsxs("button", {
439
471
  type: "button",
440
- 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)",
472
+ className: "clarify-theme-toggle clarify-ui-control relative flex size-9 items-center justify-center rounded-(--clarify-theme-tokens-radius-md) transition",
441
473
  "aria-label": label,
442
474
  title: label,
443
475
  onClick: () => setTheme(nextTheme),
444
476
  children: [
445
- /* @__PURE__ */ jsx("span", { className: "absolute size-12 pointer-fine:hidden" }),
477
+ /* @__PURE__ */ jsx("span", { className: "absolute size-11 pointer-fine:hidden" }),
446
478
  theme === "system" ? /* @__PURE__ */ jsx(Monitor, { className: "h-5 w-5 stroke-(--clarify-theme-tokens-colors-foreground)" }) : null,
447
479
  theme === "light" ? /* @__PURE__ */ jsx(Sun, { className: "h-5 w-5 stroke-(--clarify-theme-tokens-colors-foreground)" }) : null,
448
480
  theme === "dark" ? /* @__PURE__ */ jsx(Moon, { className: "h-5 w-5 stroke-white" }) : null
@@ -588,9 +620,9 @@ function useSectionVisibilityDebug(_headerTopAreaRef) {
588
620
  };
589
621
  }
590
622
  function useSectionVisibilityObserver(checkVisibleSections, headerTopAreaRef) {
591
- useEffect(() => {
623
+ useIsomorphicLayoutEffect(() => {
592
624
  if (typeof window === "undefined") return void 0;
593
- const raf = window.requestAnimationFrame(() => checkVisibleSections());
625
+ checkVisibleSections();
594
626
  window.addEventListener("scroll", checkVisibleSections, { passive: true });
595
627
  window.addEventListener("resize", checkVisibleSections);
596
628
  const resizeObserver = typeof ResizeObserver === "undefined" ? void 0 : new ResizeObserver(() => {
@@ -598,7 +630,6 @@ function useSectionVisibilityObserver(checkVisibleSections, headerTopAreaRef) {
598
630
  });
599
631
  if (resizeObserver && headerTopAreaRef?.current) resizeObserver.observe(headerTopAreaRef.current);
600
632
  return () => {
601
- window.cancelAnimationFrame(raf);
602
633
  window.removeEventListener("scroll", checkVisibleSections);
603
634
  window.removeEventListener("resize", checkVisibleSections);
604
635
  resizeObserver?.disconnect();
@@ -634,17 +665,21 @@ function useVisibleSections(sectionStore, headerTopAreaRef) {
634
665
  }
635
666
  function useSyncSections(sectionStore, sections) {
636
667
  useIsomorphicLayoutEffect(() => {
637
- sectionStore.setState((state) => ({
638
- sections: sections.map((section) => {
668
+ sectionStore.setState((state) => {
669
+ const nextSections = sections.map((section) => {
639
670
  const registeredSection = state.sections.find((item) => item.id === section.id);
640
671
  return {
641
672
  ...section,
642
673
  headingRef: registeredSection?.headingRef,
643
674
  offsetRem: registeredSection?.offsetRem ?? section.offsetRem
644
675
  };
645
- }),
646
- visibleSections: []
647
- }));
676
+ });
677
+ const nextSectionIds = new Set(nextSections.map((section) => section.id));
678
+ return {
679
+ sections: nextSections,
680
+ visibleSections: state.visibleSections.filter((id) => id === "_top" || nextSectionIds.has(id))
681
+ };
682
+ });
648
683
  }, [sectionStore, sections]);
649
684
  }
650
685
  var SectionStoreContext = createContext(null);
@@ -666,26 +701,18 @@ function useSectionStore(selector) {
666
701
  }
667
702
  //#endregion
668
703
  //#region source/shell/Navigation.tsx
669
- function useInitialValue(value, condition = true) {
670
- const [initialValue] = useState(value);
671
- return condition ? initialValue : value;
672
- }
673
704
  function normalizePath(path) {
674
705
  return path === "" ? "/" : path;
675
706
  }
676
707
  function navigationToGroups(navigation, defaultTitle) {
677
- return navigation.map((node) => {
678
- const children = node.children?.length ? node.children : [node];
679
- return {
680
- title: node.children?.length ? node.title : defaultTitle,
681
- icon: node.icon,
682
- links: children.map((child) => ({
683
- title: child.title,
684
- href: normalizePath(child.path),
685
- icon: child.icon
686
- }))
687
- };
688
- });
708
+ return navigation.map((node) => ({
709
+ title: node.children?.length ? node.title : defaultTitle,
710
+ icon: node.icon,
711
+ nodes: node.children?.length ? node.children : [node]
712
+ }));
713
+ }
714
+ function containsActivePath(node, pathname, currentLocale) {
715
+ return isSameRoutePath(node.path, pathname, currentLocale) || node.children?.some((child) => containsActivePath(child, pathname, currentLocale)) || false;
689
716
  }
690
717
  var sectionBadgeColorStyles = {
691
718
  GET: "text-emerald-500 dark:text-emerald-400",
@@ -705,174 +732,232 @@ function SectionBadge(arg0) {
705
732
  children
706
733
  });
707
734
  }
708
- function NavLink(arg0) {
709
- const { href, children, badge, icon, active = false, isAnchorLink = false, level } = arg0;
710
- return /* @__PURE__ */ jsx(CloseButton, {
711
- as: Link,
712
- to: href,
713
- "aria-current": active ? "page" : void 0,
714
- className: clsx("clarify-navigation-link flex h-8 items-center justify-between gap-2 pr-3 transition", isAnchorLink ? "clarify-navigation-anchor-link" : "pl-4"),
715
- style: isAnchorLink ? { paddingLeft: `${1.75 + Math.max(0, (level ?? 2) - 2) * .75}rem` } : void 0,
716
- children: /* @__PURE__ */ jsxs("span", {
717
- className: "flex min-w-0 flex-1 items-center gap-2",
718
- children: [
719
- icon ? /* @__PURE__ */ jsx(NavigationIcon, {
720
- name: icon,
721
- className: "h-3.5 w-3.5"
722
- }) : null,
723
- badge ? /* @__PURE__ */ jsx(SectionBadge, { children: badge }) : null,
724
- /* @__PURE__ */ jsx("span", {
725
- className: "min-w-0 truncate whitespace-nowrap",
726
- children
727
- })
728
- ]
729
- })
730
- });
735
+ function getVisibleSectionHighlightRange(sectionIds, visibleSectionIds) {
736
+ const validVisibleSectionIds = visibleSectionIds.filter((id) => id === "_top" || sectionIds.includes(id));
737
+ if (!validVisibleSectionIds.length) return void 0;
738
+ const firstVisibleSectionId = validVisibleSectionIds[0];
739
+ const lastVisibleSectionId = validVisibleSectionIds[validVisibleSectionIds.length - 1];
740
+ const pageHeight = remToPx(2.25);
741
+ const sectionOffset = pageHeight + remToPx(.25);
742
+ const sectionHeight = remToPx(2);
743
+ const getSectionTop = (id) => {
744
+ if (id === "_top") return 0;
745
+ return sectionOffset + sectionIds.indexOf(id) * sectionHeight;
746
+ };
747
+ const top = getSectionTop(firstVisibleSectionId);
748
+ return {
749
+ top,
750
+ height: (lastVisibleSectionId === "_top" ? pageHeight : getSectionTop(lastVisibleSectionId) + sectionHeight) - top
751
+ };
731
752
  }
732
753
  function VisibleSectionHighlight(arg0) {
733
- const { group, pathname, currentLocale } = arg0;
734
- const [sections, visibleSections] = useInitialValue([useSectionStore((s) => s.sections), useSectionStore((s) => s.visibleSections)], useIsInsideMobileNavigation());
735
- const isPresent = useIsPresent();
736
- const firstVisibleSectionIndex = Math.max(0, [{ id: "_top" }, ...sections].findIndex((section) => section.id === visibleSections[0]));
737
- const itemHeight = remToPx(2);
738
- const height = isPresent ? Math.max(1, visibleSections.length) * itemHeight : itemHeight;
739
- const top = group.links.findIndex((link) => isSameRoutePath(link.href, pathname, currentLocale)) * itemHeight + firstVisibleSectionIndex * itemHeight;
754
+ const { top, height } = arg0;
740
755
  return /* @__PURE__ */ jsx(motion.div, {
741
- initial: {
742
- opacity: 0,
743
- height: 0
744
- },
756
+ className: "clarify-navigation-section-highlight pointer-events-none absolute inset-x-0 top-0",
757
+ initial: false,
745
758
  animate: {
746
759
  opacity: 1,
747
- top,
748
760
  height,
761
+ top,
749
762
  transition: {
750
763
  duration: .2,
751
764
  ease: "easeOut"
752
765
  }
753
766
  },
754
- exit: {
755
- opacity: 0,
756
- height: 0,
757
- transition: {
758
- duration: .15,
759
- ease: "easeIn"
760
- }
761
- },
762
- className: "clarify-navigation-section-highlight absolute inset-x-0 top-0 will-change-transform",
763
- style: {
764
- borderRadius: "var(--clarify-theme-tokens-radius-sm)",
765
- height,
766
- top
767
- }
767
+ style: { borderRadius: "var(--clarify-theme-tokens-radius-md)" }
768
768
  });
769
769
  }
770
- function ActivePageMarker(arg0) {
771
- const { group, pathname, currentLocale } = arg0;
772
- const itemHeight = remToPx(2);
773
- const top = remToPx(.25) + group.links.findIndex((link) => isSameRoutePath(link.href, pathname, currentLocale)) * itemHeight;
774
- return /* @__PURE__ */ jsx(motion.div, {
775
- className: "absolute left-2 h-6 w-px bg-(--clarify-theme-tokens-colors-primary)",
776
- initial: {
777
- opacity: 0,
778
- top
779
- },
780
- animate: {
781
- opacity: 1,
782
- top,
783
- transition: {
784
- duration: .2,
785
- ease: "easeOut"
786
- }
787
- },
788
- exit: {
789
- opacity: 0,
790
- transition: {
791
- duration: .15,
792
- ease: "easeIn"
793
- }
794
- },
795
- style: { top }
770
+ function NavigationPage(arg0) {
771
+ const { node, pathname, currentLocale, ancestorsExpanded } = arg0;
772
+ const sections = useSectionStore((state) => state.sections);
773
+ const visibleSections = useSectionStore((state) => state.visibleSections);
774
+ const active = isSameRoutePath(node.path, pathname, currentLocale);
775
+ const href = normalizePath(node.path);
776
+ const highlightRange = active && ancestorsExpanded ? getVisibleSectionHighlightRange(sections.map((section) => section.id), visibleSections) : void 0;
777
+ return /* @__PURE__ */ jsxs("li", {
778
+ className: "clarify-navigation-page relative",
779
+ children: [
780
+ highlightRange ? /* @__PURE__ */ jsx(VisibleSectionHighlight, { ...highlightRange }) : null,
781
+ /* @__PURE__ */ jsxs(CloseButton, {
782
+ as: Link,
783
+ to: href,
784
+ "aria-current": active ? "page" : void 0,
785
+ className: "clarify-navigation-link group relative z-10 flex min-h-9 items-center gap-2 rounded-(--clarify-theme-tokens-radius-md) py-1.5 pr-3 pl-2 no-underline transition",
786
+ children: [
787
+ /* @__PURE__ */ jsx("span", { className: "clarify-navigation-active-marker absolute inset-y-1.5 left-0 w-0.5 rounded-full opacity-0 transition-opacity group-aria-current:opacity-100" }),
788
+ node.icon ? /* @__PURE__ */ jsx(NavigationIcon, {
789
+ name: node.icon,
790
+ className: "clarify-navigation-item-icon h-3.5 w-3.5 shrink-0"
791
+ }) : null,
792
+ /* @__PURE__ */ jsx("span", {
793
+ className: "min-w-0 flex-1 truncate whitespace-nowrap",
794
+ children: node.title
795
+ })
796
+ ]
797
+ }),
798
+ /* @__PURE__ */ jsx(AnimatePresence, {
799
+ initial: false,
800
+ children: active && sections.length > 0 ? /* @__PURE__ */ jsx(motion.ul, {
801
+ role: "list",
802
+ className: "clarify-navigation-sections relative py-1",
803
+ initial: {
804
+ height: 0,
805
+ opacity: 0
806
+ },
807
+ animate: {
808
+ height: "auto",
809
+ opacity: 1,
810
+ transition: {
811
+ duration: .18,
812
+ ease: "easeOut"
813
+ }
814
+ },
815
+ exit: {
816
+ height: 0,
817
+ opacity: 0,
818
+ transition: {
819
+ duration: .12,
820
+ ease: "easeIn"
821
+ }
822
+ },
823
+ children: sections.map((section) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(CloseButton, {
824
+ as: Link,
825
+ to: `${href}#${section.id}`,
826
+ className: "clarify-navigation-anchor-link relative z-10 flex min-h-8 items-center pr-3 pl-2 no-underline transition",
827
+ children: [/* @__PURE__ */ jsx("span", {
828
+ className: "clarify-navigation-section-indent flex shrink-0",
829
+ "aria-hidden": "true",
830
+ children: Array.from({ length: Math.max(1, (section.level ?? 2) - 1) }, (_, index) => /* @__PURE__ */ jsx(ChevronRight, { className: "invisible h-3.5 w-3.5" }, index))
831
+ }), /* @__PURE__ */ jsxs("span", {
832
+ className: "flex min-w-0 flex-1 items-center gap-2",
833
+ children: [section.badge ? /* @__PURE__ */ jsx(SectionBadge, { children: section.badge }) : null, /* @__PURE__ */ jsx("span", {
834
+ className: "min-w-0 flex-1 truncate whitespace-nowrap",
835
+ children: section.title
836
+ })]
837
+ })]
838
+ }) }, section.id))
839
+ }) : null
840
+ })
841
+ ]
796
842
  });
797
843
  }
798
- function NavigationGroup(arg0) {
799
- const { group, className, currentLocale } = arg0;
800
- const isInsideMobileNavigation = useIsInsideMobileNavigation();
801
- const [pathname, sections] = useInitialValue([normalizeRoutePath(useLocation().pathname), useSectionStore((s) => s.sections)], isInsideMobileNavigation);
802
- const isActiveGroup = group.links.findIndex((link) => isSameRoutePath(link.href, pathname, currentLocale)) !== -1;
844
+ function NavigationBranch(arg0) {
845
+ const { node, pathname, currentLocale, ancestorsExpanded } = arg0;
846
+ const controlsId = useId();
847
+ const active = containsActivePath(node, pathname, currentLocale);
848
+ const [expansionOverride, setExpansionOverride] = useState();
849
+ const expanded = expansionOverride ?? active;
803
850
  return /* @__PURE__ */ jsxs("li", {
804
- className: clsx("clarify-navigation-group relative mb-6", className),
805
- children: [/* @__PURE__ */ jsxs("h2", {
806
- className: "clarify-navigation-group-title flex items-center gap-2",
807
- children: [/* @__PURE__ */ jsx(NavigationIcon, {
808
- name: group.icon,
809
- className: "clarify-navigation-group-title-icon h-3.5 w-3.5"
810
- }), /* @__PURE__ */ jsx("span", { children: group.title })]
811
- }), /* @__PURE__ */ jsxs("div", {
812
- className: "relative mt-3 pl-2",
851
+ className: "clarify-navigation-branch relative",
852
+ children: [/* @__PURE__ */ jsxs("button", {
853
+ type: "button",
854
+ "aria-expanded": expanded,
855
+ "aria-controls": controlsId,
856
+ "data-active": active || void 0,
857
+ onClick: () => setExpansionOverride(!expanded),
858
+ className: "clarify-navigation-branch-trigger group flex min-h-9 w-full items-center rounded-(--clarify-theme-tokens-radius-md) py-1.5 pr-3 pl-2 text-left transition",
813
859
  children: [
814
- /* @__PURE__ */ jsx(AnimatePresence, {
815
- initial: !isInsideMobileNavigation,
816
- children: isActiveGroup ? /* @__PURE__ */ jsx(VisibleSectionHighlight, {
817
- group,
818
- pathname,
819
- currentLocale
820
- }) : null
860
+ node.icon ? /* @__PURE__ */ jsx(NavigationIcon, {
861
+ name: node.icon,
862
+ className: "clarify-navigation-item-icon h-3.5 w-3.5 shrink-0"
863
+ }) : null,
864
+ /* @__PURE__ */ jsx("span", {
865
+ className: "min-w-0 flex-1 truncate pl-2 whitespace-nowrap",
866
+ children: node.title
821
867
  }),
822
- /* @__PURE__ */ jsx("div", { className: "absolute inset-y-0 left-2 w-px bg-(--clarify-theme-tokens-colors-border) dark:bg-white/5" }),
823
- /* @__PURE__ */ jsx(AnimatePresence, {
824
- initial: false,
825
- children: isActiveGroup ? /* @__PURE__ */ jsx(ActivePageMarker, {
826
- group,
868
+ /* @__PURE__ */ jsx(ChevronRight, { className: "clarify-navigation-chevron ml-2 h-3.5 w-3.5 shrink-0 transition-transform duration-150 group-aria-expanded:rotate-90" })
869
+ ]
870
+ }), /* @__PURE__ */ jsx(AnimatePresence, {
871
+ initial: false,
872
+ children: expanded ? /* @__PURE__ */ jsxs(motion.div, {
873
+ id: controlsId,
874
+ className: "clarify-navigation-branch-content grid grid-cols-[auto_minmax(0,1fr)] overflow-hidden",
875
+ initial: {
876
+ height: 0,
877
+ opacity: 0
878
+ },
879
+ animate: {
880
+ height: "auto",
881
+ opacity: 1,
882
+ transition: {
883
+ duration: .18,
884
+ ease: "easeOut"
885
+ }
886
+ },
887
+ exit: {
888
+ height: 0,
889
+ opacity: 0,
890
+ transition: {
891
+ duration: .12,
892
+ ease: "easeIn"
893
+ }
894
+ },
895
+ children: [/* @__PURE__ */ jsx("div", {
896
+ className: "grid",
897
+ children: /* @__PURE__ */ jsx(ChevronRight, {
898
+ "aria-hidden": "true",
899
+ className: "invisible col-start-1 row-start-1 h-3.5 w-3.5"
900
+ })
901
+ }), /* @__PURE__ */ jsx("div", {
902
+ className: "col-start-2",
903
+ children: /* @__PURE__ */ jsx(NavigationNodes, {
904
+ nodes: node.children ?? [],
827
905
  pathname,
828
- currentLocale
829
- }) : null
830
- }),
831
- /* @__PURE__ */ jsx("ul", {
832
- role: "list",
833
- className: "border-l border-transparent",
834
- children: group.links.map((link) => {
835
- const active = isSameRoutePath(link.href, pathname, currentLocale);
836
- return /* @__PURE__ */ jsxs("li", {
837
- className: "relative",
838
- children: [/* @__PURE__ */ jsx(NavLink, {
839
- href: link.href,
840
- icon: link.icon,
841
- active,
842
- children: link.title
843
- }), /* @__PURE__ */ jsx(AnimatePresence, {
844
- initial: false,
845
- children: active && sections.length > 0 ? /* @__PURE__ */ jsx(motion.ul, {
846
- role: "list",
847
- initial: { opacity: 0 },
848
- animate: {
849
- opacity: 1,
850
- transition: { delay: .1 }
851
- },
852
- exit: {
853
- opacity: 0,
854
- transition: { duration: .15 }
855
- },
856
- children: sections.map((section) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(NavLink, {
857
- href: `${link.href}#${section.id}`,
858
- badge: section.badge,
859
- tags: section.tags,
860
- isAnchorLink: true,
861
- level: section.level,
862
- children: section.title
863
- }) }, section.id))
864
- }) : null
865
- })]
866
- }, link.href);
906
+ currentLocale,
907
+ ancestorsExpanded: ancestorsExpanded && expanded
867
908
  })
868
- })
869
- ]
909
+ })]
910
+ }) : null
911
+ })]
912
+ });
913
+ }
914
+ function NavigationNodes(arg0) {
915
+ const { nodes, pathname, currentLocale, ancestorsExpanded } = arg0;
916
+ return /* @__PURE__ */ jsx("ul", {
917
+ role: "list",
918
+ className: "clarify-navigation-tree py-0.5",
919
+ children: nodes.map((node, index) => node.children?.length ? /* @__PURE__ */ jsx(NavigationBranch, {
920
+ node,
921
+ pathname,
922
+ currentLocale,
923
+ ancestorsExpanded
924
+ }, `${node.path}-${node.title}-${index}`) : /* @__PURE__ */ jsx(NavigationPage, {
925
+ node,
926
+ pathname,
927
+ currentLocale,
928
+ ancestorsExpanded
929
+ }, `${node.path}-${node.title}-${index}`))
930
+ });
931
+ }
932
+ function NavigationGroup(arg0) {
933
+ const { group, pathname, className, currentLocale } = arg0;
934
+ return /* @__PURE__ */ jsxs("li", {
935
+ className: clsx("clarify-navigation-group relative mb-7", className),
936
+ children: [/* @__PURE__ */ jsxs("h2", {
937
+ className: "clarify-navigation-group-title flex items-center gap-2 px-2",
938
+ children: [/* @__PURE__ */ jsx(NavigationIcon, {
939
+ name: group.icon,
940
+ className: "clarify-navigation-group-title-icon h-3.5 w-3.5 shrink-0"
941
+ }), /* @__PURE__ */ jsx("span", {
942
+ className: "min-w-0 truncate",
943
+ children: group.title
944
+ })]
945
+ }), /* @__PURE__ */ jsx("div", {
946
+ className: "mt-2 px-2",
947
+ children: /* @__PURE__ */ jsx(NavigationNodes, {
948
+ nodes: group.nodes,
949
+ pathname,
950
+ currentLocale,
951
+ ancestorsExpanded: true
952
+ })
870
953
  })]
871
954
  });
872
955
  }
873
956
  function Navigation(arg0) {
874
957
  const { navigation, className, currentLocale } = arg0;
875
- const groups = navigationToGroups(navigation, useBuiltInText()("navigation.documentation"));
958
+ const t = useBuiltInText();
959
+ const pathname = normalizeRoutePath(useLocation().pathname);
960
+ const groups = navigationToGroups(navigation, t("navigation.documentation"));
876
961
  return /* @__PURE__ */ jsx("nav", {
877
962
  className: clsx("clarify-navigation", className),
878
963
  children: /* @__PURE__ */ jsx("ul", {
@@ -880,9 +965,10 @@ function Navigation(arg0) {
880
965
  className: "clarify-navigation-list",
881
966
  children: groups.map((group, groupIndex) => /* @__PURE__ */ jsx(NavigationGroup, {
882
967
  group,
968
+ pathname,
883
969
  className: groupIndex === 0 ? "mt-0" : "",
884
970
  currentLocale
885
- }, group.title))
971
+ }, `${group.title}-${groupIndex}`))
886
972
  })
887
973
  });
888
974
  }
@@ -988,10 +1074,10 @@ function MobileNavigation(arg0) {
988
1074
  value: true,
989
1075
  children: [/* @__PURE__ */ jsxs("button", {
990
1076
  type: "button",
991
- className: "clarify-mobile-navigation-button clarify-ui-icon-button relative flex size-8 items-center justify-center rounded-(--clarify-theme-tokens-radius-md) transition",
1077
+ className: "clarify-mobile-navigation-button clarify-ui-icon-button relative flex size-9 items-center justify-center rounded-(--clarify-theme-tokens-radius-md) transition",
992
1078
  "aria-label": t("navigation.toggle"),
993
1079
  onClick: toggle,
994
- 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" })]
1080
+ children: [/* @__PURE__ */ jsx("span", { className: "absolute size-11 pointer-fine:hidden" }), /* @__PURE__ */ jsx(ToggleIcon, { className: "h-4 w-4 stroke-(--clarify-theme-tokens-colors-foreground) dark:stroke-white" })]
995
1081
  }), !isInsideMobileNavigation ? /* @__PURE__ */ jsx(Suspense, {
996
1082
  fallback: null,
997
1083
  children: /* @__PURE__ */ jsx(MobileNavigationDialog, {
@@ -1027,7 +1113,7 @@ function useSearchProps() {
1027
1113
  }
1028
1114
  //#endregion
1029
1115
  //#region source/shell/Search.tsx
1030
- var SearchDialog = lazy(() => import("./SearchDialog-CxYLjRi5.js"));
1116
+ var SearchDialog = lazy(() => import("./SearchDialog-CBJjDs_9.js"));
1031
1117
  function getModifierKey() {
1032
1118
  if (typeof navigator === "undefined") return "Ctrl ";
1033
1119
  return /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform) ? "⌘" : "Ctrl ";
@@ -1078,10 +1164,10 @@ function MobileSearch(arg0) {
1078
1164
  className: "clarify-mobile-search contents lg:hidden",
1079
1165
  children: [/* @__PURE__ */ jsxs("button", {
1080
1166
  type: "button",
1081
- className: "clarify-mobile-search-button clarify-ui-control relative flex size-8 items-center justify-center rounded-(--clarify-theme-tokens-radius-md) transition lg:hidden",
1167
+ className: "clarify-mobile-search-button clarify-ui-control relative flex size-9 items-center justify-center rounded-(--clarify-theme-tokens-radius-md) transition lg:hidden",
1082
1168
  "aria-label": t("search.placeholder"),
1083
1169
  ...buttonProps,
1084
- 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" })]
1170
+ children: [/* @__PURE__ */ jsx("span", { className: "absolute size-11 pointer-fine:hidden" }), /* @__PURE__ */ jsx(Search, { className: "h-5 w-5 stroke-(--clarify-theme-tokens-colors-foreground) dark:stroke-white" })]
1085
1171
  }), /* @__PURE__ */ jsx(Suspense, {
1086
1172
  fallback: null,
1087
1173
  children: /* @__PURE__ */ jsx(SearchDialog, {
@@ -1136,19 +1222,19 @@ function LanguageSwitcher(arg0) {
1136
1222
  const { config, currentLocale, currentRoute } = arg0;
1137
1223
  const t = useBuiltInText();
1138
1224
  const location = useLocation();
1139
- const i18n = config.i18n;
1140
- if (!i18n || i18n.locales.length < 2) return null;
1141
- const selectedLocale = currentLocale ?? i18n.defaultLocale;
1142
- const selectedLocaleConfig = i18n.locales.find((locale) => locale.code === selectedLocale) ?? i18n.locales[0];
1225
+ const locales = config.locales;
1226
+ if (!locales || locales.locales.length < 2) return null;
1227
+ const selectedLocale = currentLocale ?? locales.default;
1228
+ const selectedLocaleConfig = locales.locales.find((locale) => locale.code === selectedLocale) ?? locales.locales[0];
1143
1229
  const suffix = `${location.search}${location.hash}`;
1144
1230
  return /* @__PURE__ */ jsxs(Menu, {
1145
1231
  as: "div",
1146
1232
  className: "clarify-language-switcher relative",
1147
1233
  children: [/* @__PURE__ */ jsxs(MenuButton, {
1148
- className: "clarify-language-switcher-button clarify-ui-control flex h-8 items-center gap-1.5 rounded-(--clarify-theme-tokens-radius-md) px-1.5 transition",
1234
+ className: "clarify-language-switcher-button clarify-ui-control flex h-9 items-center gap-1.5 rounded-(--clarify-theme-tokens-radius-md) px-2 transition",
1149
1235
  "aria-label": t("language.switch"),
1150
1236
  children: [
1151
- /* @__PURE__ */ jsx("span", { className: "absolute size-12 pointer-fine:hidden" }),
1237
+ /* @__PURE__ */ jsx("span", { className: "absolute size-11 pointer-fine:hidden" }),
1152
1238
  /* @__PURE__ */ jsx(Globe2, { className: "h-5 w-5 stroke-current" }),
1153
1239
  /* @__PURE__ */ jsx("span", {
1154
1240
  className: "hidden sm:inline",
@@ -1157,8 +1243,9 @@ function LanguageSwitcher(arg0) {
1157
1243
  ]
1158
1244
  }), /* @__PURE__ */ jsx(MenuItems, {
1159
1245
  transition: true,
1246
+ modal: false,
1160
1247
  className: "clarify-language-switcher-menu clarify-ui-menu absolute right-0 z-50 mt-2 w-(--clarify-ui-menu-width) rounded-(--clarify-theme-tokens-radius-xl) bg-(--clarify-theme-tokens-colors-surface) p-1 shadow-lg ring-1 shadow-zinc-900/5 ring-(--clarify-theme-tokens-colors-border) transition data-closed:scale-95 data-closed:opacity-0 data-enter:duration-100 data-enter:ease-out data-leave:duration-75 data-leave:ease-in dark:bg-zinc-900 dark:ring-white/10",
1161
- children: i18n.locales.flatMap((locale) => {
1248
+ children: locales.locales.flatMap((locale) => {
1162
1249
  const localizedPath = localizedRoutePath(config, locale.code, currentRoute);
1163
1250
  if (!localizedPath) return [];
1164
1251
  const selected = locale.code === selectedLocale;
@@ -1179,17 +1266,20 @@ function LanguageSwitcher(arg0) {
1179
1266
  });
1180
1267
  }
1181
1268
  function TopLevelNavItem(arg0) {
1182
- const { href, children } = arg0;
1183
- if (isExternalHref(href)) return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx("a", {
1269
+ const { href, active = false, children } = arg0;
1270
+ const external = isExternalHref(href);
1271
+ const className = clsx("clarify-ui-top-link inline-flex h-9 items-center rounded-(--clarify-theme-tokens-radius-md) px-3 no-underline transition focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--clarify-theme-tokens-colors-primary)", active && "clarify-ui-top-link-active");
1272
+ if (external) return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx("a", {
1184
1273
  href,
1185
- className: "clarify-ui-top-link transition",
1274
+ className,
1186
1275
  target: "_blank",
1187
1276
  rel: "noreferrer",
1188
1277
  children
1189
1278
  }) });
1190
1279
  return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, {
1191
1280
  to: href,
1192
- className: "clarify-ui-top-link transition",
1281
+ className,
1282
+ "aria-current": active ? "page" : void 0,
1193
1283
  children
1194
1284
  }) });
1195
1285
  }
@@ -1205,15 +1295,15 @@ function MobileNavbarMenu(arg0) {
1205
1295
  as: "div",
1206
1296
  className: "clarify-mobile-navbar-menu relative md:hidden",
1207
1297
  children: [/* @__PURE__ */ jsxs(MenuButton, {
1208
- className: "clarify-mobile-navbar-menu-button clarify-ui-control relative flex size-8 items-center justify-center rounded-(--clarify-theme-tokens-radius-md) transition",
1298
+ className: "clarify-mobile-navbar-menu-button clarify-ui-control relative flex size-9 items-center justify-center rounded-(--clarify-theme-tokens-radius-md) transition",
1209
1299
  "aria-label": t("navbar.openLinks"),
1210
- children: [/* @__PURE__ */ jsx("span", { className: "absolute size-12 pointer-fine:hidden" }), /* @__PURE__ */ jsx(MoreHorizontal, { className: "h-5 w-5" })]
1300
+ children: [/* @__PURE__ */ jsx("span", { className: "absolute size-11 pointer-fine:hidden" }), /* @__PURE__ */ jsx(MoreHorizontal, { className: "h-5 w-5" })]
1211
1301
  }), /* @__PURE__ */ jsx(MenuItems, {
1212
1302
  transition: true,
1213
1303
  anchor: "bottom end",
1214
1304
  className: "clarify-mobile-navbar-menu-list clarify-ui-menu z-50 mt-2 w-(--clarify-ui-menu-width) rounded-(--clarify-theme-tokens-radius-xl) border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) p-1 shadow-lg transition [--anchor-gap:--spacing(2)] focus:outline-none data-closed:scale-95 data-closed:opacity-0 dark:border-white/10 dark:bg-zinc-900",
1215
1305
  children: links.map((link) => {
1216
- const label = resolveLocalizedText(link.label, currentLocale, config.i18n?.defaultLocale);
1306
+ const label = resolveLocalizedText(link.label, currentLocale, config.locales?.default);
1217
1307
  const href = localizeHref(link.href, config, currentLocale);
1218
1308
  const external = isExternalHref(href);
1219
1309
  return /* @__PURE__ */ jsx(MenuItem, { children: ({ focus }) => {
@@ -1244,43 +1334,122 @@ function ProductTabs(arg0) {
1244
1334
  const { tabs, currentLocale } = arg0;
1245
1335
  const t = useBuiltInText();
1246
1336
  const pathname = normalizeRoutePath(useLocation().pathname);
1337
+ const prefersReducedMotion = useReducedMotion();
1338
+ const indicatorGroupId = useId();
1339
+ const navRef = useRef(null);
1340
+ const activeTabRef = useRef(null);
1341
+ const [scrollState, setScrollState] = useState({
1342
+ start: true,
1343
+ end: true
1344
+ });
1345
+ const updateScrollState = useCallback(() => {
1346
+ const nav = navRef.current;
1347
+ if (!nav) return;
1348
+ const maxScrollLeft = nav.scrollWidth - nav.clientWidth;
1349
+ setScrollState({
1350
+ start: nav.scrollLeft <= 1,
1351
+ end: nav.scrollLeft >= maxScrollLeft - 1
1352
+ });
1353
+ }, []);
1354
+ useEffect(() => {
1355
+ const nav = navRef.current;
1356
+ if (!nav) return;
1357
+ updateScrollState();
1358
+ const resizeObserver = new ResizeObserver(updateScrollState);
1359
+ resizeObserver.observe(nav);
1360
+ return () => resizeObserver.disconnect();
1361
+ }, [tabs, updateScrollState]);
1362
+ useEffect(() => {
1363
+ activeTabRef.current?.scrollIntoView({
1364
+ behavior: prefersReducedMotion ? "instant" : "smooth",
1365
+ block: "nearest",
1366
+ inline: "nearest"
1367
+ });
1368
+ }, [pathname, prefersReducedMotion]);
1369
+ const scrollTabs = (direction) => {
1370
+ const nav = navRef.current;
1371
+ if (!nav) return;
1372
+ nav.scrollBy({
1373
+ left: direction * Math.max(nav.clientWidth * .6, 240),
1374
+ behavior: prefersReducedMotion ? "instant" : "smooth"
1375
+ });
1376
+ };
1247
1377
  if (!tabs?.length) return null;
1248
1378
  return /* @__PURE__ */ jsx("div", {
1249
1379
  "data-clarify-header-tabs": true,
1250
1380
  className: "clarify-product-tabs hidden h-14 border-t border-(--clarify-theme-tokens-colors-border) lg:block dark:border-white/10",
1251
- children: /* @__PURE__ */ jsx("nav", {
1252
- className: "clarify-product-tabs-nav mx-auto flex h-full w-full max-w-(--clarify-theme-layout-max-width) items-stretch gap-6 overflow-x-auto px-5",
1253
- "aria-label": t("navbar.sections"),
1254
- children: tabs.map((tab) => {
1255
- const active = isActiveTab(tab, pathname, currentLocale);
1256
- return /* @__PURE__ */ jsxs(Link, {
1257
- to: tab.path,
1258
- "aria-current": active ? "page" : void 0,
1259
- className: clsx("clarify-product-tab clarify-ui-tab relative inline-flex h-full shrink-0 items-center gap-2 px-0 transition", active && "clarify-ui-tab-active"),
1260
- children: [
1261
- /* @__PURE__ */ jsx(NavigationIcon, {
1262
- name: tab.icon,
1263
- className: "h-4 w-4"
1264
- }),
1265
- /* @__PURE__ */ jsx("span", { children: tab.title }),
1266
- active ? /* @__PURE__ */ jsx(motion.span, {
1267
- layoutId: "clarify-product-tab-indicator",
1268
- className: "absolute inset-x-0 bottom-0 h-0.5 rounded-full bg-(--clarify-theme-tokens-colors-foreground) dark:bg-white",
1269
- transition: {
1270
- type: "tween",
1271
- duration: .16,
1272
- ease: "easeOut"
1273
- }
1274
- }) : null
1275
- ]
1276
- }, `${tab.title}-${tab.path}`);
1277
- })
1381
+ children: /* @__PURE__ */ jsxs("div", {
1382
+ className: "clarify-product-tabs-frame relative mx-auto h-full w-full max-w-(--clarify-theme-layout-max-width)",
1383
+ "data-at-start": scrollState.start || void 0,
1384
+ "data-at-end": scrollState.end || void 0,
1385
+ children: [
1386
+ /* @__PURE__ */ jsx("button", {
1387
+ type: "button",
1388
+ className: "clarify-product-tabs-scroll clarify-product-tabs-scroll-start",
1389
+ onClick: () => scrollTabs(-1),
1390
+ "aria-label": "Scroll sections left",
1391
+ tabIndex: scrollState.start ? -1 : 0,
1392
+ "aria-hidden": scrollState.start,
1393
+ children: /* @__PURE__ */ jsx(ChevronLeft, {
1394
+ className: "size-4",
1395
+ "aria-hidden": "true"
1396
+ })
1397
+ }),
1398
+ /* @__PURE__ */ jsx(LayoutGroup, {
1399
+ id: indicatorGroupId,
1400
+ children: /* @__PURE__ */ jsx("nav", {
1401
+ ref: navRef,
1402
+ className: "clarify-product-tabs-nav flex h-full w-full items-stretch gap-2 overflow-x-auto px-5",
1403
+ "aria-label": t("navbar.sections"),
1404
+ onScroll: updateScrollState,
1405
+ children: tabs.map((tab) => {
1406
+ const active = isActiveTab(tab, pathname, currentLocale);
1407
+ return /* @__PURE__ */ jsxs(Link, {
1408
+ ref: active ? activeTabRef : void 0,
1409
+ to: tab.path,
1410
+ "aria-current": active ? "page" : void 0,
1411
+ className: clsx("clarify-product-tab clarify-ui-tab relative inline-flex h-full shrink-0 items-center gap-2 px-3 no-underline transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-(--clarify-theme-tokens-colors-primary)", active && "clarify-ui-tab-active"),
1412
+ children: [
1413
+ /* @__PURE__ */ jsx(NavigationIcon, {
1414
+ name: tab.icon,
1415
+ className: "h-4 w-4"
1416
+ }),
1417
+ /* @__PURE__ */ jsx("span", { children: tab.title }),
1418
+ active ? /* @__PURE__ */ jsx(motion.span, {
1419
+ layoutId: "active-indicator",
1420
+ className: "absolute inset-x-3 bottom-0 h-0.5 rounded-full bg-(--clarify-ui-tab-indicator)",
1421
+ transition: prefersReducedMotion ? { duration: 0 } : {
1422
+ type: "spring",
1423
+ stiffness: 420,
1424
+ damping: 38,
1425
+ mass: .7
1426
+ }
1427
+ }) : null
1428
+ ]
1429
+ }, `${tab.title}-${tab.path}`);
1430
+ })
1431
+ })
1432
+ }),
1433
+ /* @__PURE__ */ jsx("button", {
1434
+ type: "button",
1435
+ className: "clarify-product-tabs-scroll clarify-product-tabs-scroll-end",
1436
+ onClick: () => scrollTabs(1),
1437
+ "aria-label": "Scroll sections right",
1438
+ tabIndex: scrollState.end ? -1 : 0,
1439
+ "aria-hidden": scrollState.end,
1440
+ children: /* @__PURE__ */ jsx(ChevronRight, {
1441
+ className: "size-4",
1442
+ "aria-hidden": "true"
1443
+ })
1444
+ })
1445
+ ]
1278
1446
  })
1279
1447
  });
1280
1448
  }
1281
1449
  var Header = forwardRef(function Header(arg0, ref) {
1282
1450
  const { config, navigation, tabs, routes, currentLocale, currentRoute, banner, topAreaRef, className, ...props } = arg0;
1283
1451
  const t = useBuiltInText();
1452
+ const pathname = normalizeRoutePath(useLocation().pathname);
1284
1453
  const { isOpen: mobileNavIsOpen } = useMobileNavigationStore();
1285
1454
  const isInsideMobileNavigation = useIsInsideMobileNavigation();
1286
1455
  const homeHref = resolveHomeHref(config, currentLocale);
@@ -1288,7 +1457,7 @@ var Header = forwardRef(function Header(arg0, ref) {
1288
1457
  const { scrollY } = useScroll();
1289
1458
  const bgOpacityLight = useTransform(scrollY, [0, 72], ["70%", "95%"]);
1290
1459
  const bgOpacityDark = useTransform(scrollY, [0, 72], ["60%", "92%"]);
1291
- const hasNavbarLinks = Boolean(config.navbar?.links?.length);
1460
+ const hasNavbarLinks = Boolean(config.navigation?.links?.length);
1292
1461
  function renderBrand() {
1293
1462
  if (homeExternal) return /* @__PURE__ */ jsxs(CloseButton, {
1294
1463
  as: "a",
@@ -1321,22 +1490,27 @@ var Header = forwardRef(function Header(arg0, ref) {
1321
1490
  if (!hasNavbarLinks) return null;
1322
1491
  return /* @__PURE__ */ jsx("nav", {
1323
1492
  className: "clarify-top-nav hidden md:block",
1493
+ "aria-label": t("navbar.sections"),
1324
1494
  children: /* @__PURE__ */ jsx("ul", {
1325
1495
  role: "list",
1326
- className: "flex items-center gap-8",
1327
- children: config.navbar?.links?.map((link) => /* @__PURE__ */ jsx(TopLevelNavItem, {
1328
- href: localizeHref(link.href, config, currentLocale),
1329
- children: resolveLocalizedText(link.label, currentLocale, config.i18n?.defaultLocale)
1330
- }, link.href))
1496
+ className: "flex items-center gap-0.5",
1497
+ children: config.navigation?.links?.map((link) => {
1498
+ const href = localizeHref(link.href, config, currentLocale);
1499
+ return /* @__PURE__ */ jsx(TopLevelNavItem, {
1500
+ href,
1501
+ active: !isExternalHref(href) && isSameRoutePath(href, pathname, currentLocale),
1502
+ children: resolveLocalizedText(link.label, currentLocale, config.locales?.default)
1503
+ }, link.href);
1504
+ })
1331
1505
  })
1332
1506
  });
1333
1507
  }
1334
1508
  function renderHeaderActions() {
1335
1509
  return /* @__PURE__ */ jsxs("div", {
1336
- className: "clarify-header-actions flex shrink-0 items-center gap-5",
1510
+ className: "clarify-header-actions flex shrink-0 items-center gap-1",
1337
1511
  children: [
1338
1512
  renderTopLinks(),
1339
- hasNavbarLinks ? /* @__PURE__ */ jsx("div", { className: "hidden md:block md:h-5 md:w-px md:bg-(--clarify-theme-tokens-colors-border) md:dark:bg-white/15" }) : null,
1513
+ hasNavbarLinks ? /* @__PURE__ */ jsx("div", { className: "mx-2 hidden h-5 w-px bg-(--clarify-theme-tokens-colors-border) md:block md:dark:bg-white/15" }) : null,
1340
1514
  /* @__PURE__ */ jsx(MobileSearch, {
1341
1515
  routes,
1342
1516
  navigation,
@@ -1350,7 +1524,7 @@ var Header = forwardRef(function Header(arg0, ref) {
1350
1524
  }),
1351
1525
  /* @__PURE__ */ jsx(ThemeToggle, {}),
1352
1526
  /* @__PURE__ */ jsx(MobileNavbarMenu, {
1353
- links: config.navbar?.links,
1527
+ links: config.navigation?.links,
1354
1528
  config,
1355
1529
  currentLocale
1356
1530
  })
@@ -1440,4 +1614,4 @@ function PageTitleActions() {
1440
1614
  //#endregion
1441
1615
  export { isExternalHref as C, copyTextToClipboard as E, themeCookieName as S, prefixHref as T, getStoredThemePreference as _, SectionProvider as a, storeLocalePreference as b, lucideIconRegistry as c, normalizeRoutePath as d, resolveLocalizedText as f, getStoredLocalePreference as g, useTheme as h, Navigation as i, resolveLucideIconName as l, ThemeProvider as m, PageTitleActions as n, useSectionStore as o, ThemeToggle as p, Header as r, remToPx as s, PageActionsProvider as t, isSameRoutePath as u, localeCookieName as v, localizeHref as w, storeThemePreference as x, readLocaleCookie as y };
1442
1616
 
1443
- //# sourceMappingURL=PageActions-D7K9LDGf.js.map
1617
+ //# sourceMappingURL=PageActions-bugd7GZh.js.map