@clarify-labs/renderer 0.10.2 → 0.10.3

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