@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.
- package/output/{ClarifyShell-1LuBliwt.js → ClarifyShell-Cq5Af46F.js} +32 -12
- package/output/ClarifyShell-Cq5Af46F.js.map +1 -0
- package/output/{ClarifyShell-C6li72Ce.cjs → ClarifyShell-UsefuuLS.cjs} +31 -11
- package/output/ClarifyShell-UsefuuLS.cjs.map +1 -0
- package/output/{MermaidViewer-dXsomvM7.js → MermaidViewer-Bc9H25yK.js} +2 -2
- package/output/{MermaidViewer-dXsomvM7.js.map → MermaidViewer-Bc9H25yK.js.map} +1 -1
- package/output/{MermaidViewer-B6-BMCJG.cjs → MermaidViewer-Db7qsyVk.cjs} +2 -2
- package/output/{MermaidViewer-B6-BMCJG.cjs.map → MermaidViewer-Db7qsyVk.cjs.map} +1 -1
- package/output/{OpenApiOperation-DgrqzeiS.js → OpenApiOperation-BZWeCbvy.js} +471 -178
- package/output/OpenApiOperation-BZWeCbvy.js.map +1 -0
- package/output/{OpenApiOperation-B52IWlKb.cjs → OpenApiOperation-DbZjxIuj.cjs} +491 -174
- package/output/OpenApiOperation-DbZjxIuj.cjs.map +1 -0
- package/output/{PageActions-D7K9LDGf.js → PageActions-BQeEmXbT.js} +524 -350
- package/output/PageActions-BQeEmXbT.js.map +1 -0
- package/output/{PageActions-BjB6PYmL.cjs → PageActions-Dg1l9KB1.cjs} +521 -347
- package/output/PageActions-Dg1l9KB1.cjs.map +1 -0
- package/output/{SearchDialog-CxYLjRi5.js → SearchDialog-B67VA0Ut.js} +3 -3
- package/output/{SearchDialog-CxYLjRi5.js.map → SearchDialog-B67VA0Ut.js.map} +1 -1
- package/output/{SearchDialog-CIPvXMT3.cjs → SearchDialog-DjKvqN7p.cjs} +3 -3
- package/output/{SearchDialog-CIPvXMT3.cjs.map → SearchDialog-DjKvqN7p.cjs.map} +1 -1
- package/output/app/ContentDiagnostic.d.ts +2 -1
- package/output/client.cjs +3 -3
- package/output/client.js +3 -3
- package/output/components/AccordionGroup.d.ts +7 -0
- package/output/components/Collapse.d.ts +2 -0
- package/output/components/FileTree.d.ts +10 -0
- package/output/components/Image.d.ts +6 -0
- package/output/components/Steps.d.ts +12 -0
- package/output/components/Tabs.d.ts +12 -5
- package/output/components/Tooltip.d.ts +7 -0
- package/output/components/index.d.ts +10 -1
- package/output/core/i18n.d.ts +1 -1
- package/output/{i18n-DnqZHFT7.js → i18n-Bqth9d6Q.js} +5 -1
- package/output/i18n-Bqth9d6Q.js.map +1 -0
- package/output/{i18n-b4iTLeia.cjs → i18n-C-fReCj-.cjs} +5 -1
- package/output/i18n-C-fReCj-.cjs.map +1 -0
- package/output/index.cjs +17 -8
- package/output/index.cjs.map +1 -1
- package/output/index.d.ts +5 -4
- package/output/index.js +14 -9
- package/output/index.js.map +1 -1
- package/output/mdx/components.d.ts +9 -0
- package/output/mdx/primitives.d.ts +4 -2
- package/output/openapi/components/CodeDisplay.d.ts +1 -0
- package/output/openapi/components/InlineListbox.d.ts +18 -0
- package/output/preview.cjs +3 -3
- package/output/preview.js +3 -3
- package/output/{render-Di5B6Zc0.cjs → render-Dc9wxg_r.cjs} +2 -2
- package/output/{render-Di5B6Zc0.cjs.map → render-Dc9wxg_r.cjs.map} +1 -1
- package/output/{render-DKj24Jqw.js → render-aS-w4fK4.js} +2 -2
- package/output/{render-DKj24Jqw.js.map → render-aS-w4fK4.js.map} +1 -1
- package/output/renderer.css +766 -171
- package/output/server.cjs +2 -2
- package/output/server.js +2 -2
- package/package.json +1 -1
- package/output/ClarifyShell-1LuBliwt.js.map +0 -1
- package/output/ClarifyShell-C6li72Ce.cjs.map +0 -1
- package/output/OpenApiOperation-B52IWlKb.cjs.map +0 -1
- package/output/OpenApiOperation-DgrqzeiS.js.map +0 -1
- package/output/PageActions-BjB6PYmL.cjs.map +0 -1
- package/output/PageActions-D7K9LDGf.js.map +0 -1
- package/output/i18n-DnqZHFT7.js.map +0 -1
- package/output/i18n-b4iTLeia.cjs.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { t as useBuiltInText } from "./i18n-
|
|
1
|
+
import { t as useBuiltInText } from "./i18n-Bqth9d6Q.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,
|
|
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) {
|
|
@@ -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
|
|
87
|
+
async function runCopy(state, getText) {
|
|
79
88
|
setCopied(state);
|
|
80
|
-
|
|
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
|
-
|
|
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
|
-
|
|
108
|
+
await runCopy("link", () => getAbsoluteUrl(contentArtifactUrl));
|
|
90
109
|
}
|
|
91
110
|
async function handleCopyLlms() {
|
|
92
|
-
|
|
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
|
|
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: [
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
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-
|
|
158
|
-
children: [
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
actions
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
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(
|
|
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__ */
|
|
191
|
-
className: "clarify-ui-menu-title",
|
|
192
|
-
children:
|
|
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:
|
|
201
|
+
children: t("contentActions.editPageDescription")
|
|
196
202
|
})]
|
|
197
203
|
}),
|
|
198
|
-
/* @__PURE__ */ jsx(Check, { className:
|
|
204
|
+
/* @__PURE__ */ jsx(Check, { className: "h-3.5 w-3.5 shrink-0 text-(--clarify-theme-tokens-colors-primary) opacity-0" })
|
|
199
205
|
]
|
|
200
|
-
}) },
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
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:
|
|
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(
|
|
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:
|
|
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:
|
|
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 ${
|
|
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
|
-
}) },
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
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-
|
|
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-
|
|
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
|
-
|
|
623
|
+
useIsomorphicLayoutEffect(() => {
|
|
592
624
|
if (typeof window === "undefined") return void 0;
|
|
593
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
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
|
|
709
|
-
const
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
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 {
|
|
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
|
-
|
|
742
|
-
|
|
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
|
-
|
|
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
|
|
771
|
-
const {
|
|
772
|
-
const
|
|
773
|
-
const
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
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
|
|
799
|
-
const {
|
|
800
|
-
const
|
|
801
|
-
const
|
|
802
|
-
const
|
|
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:
|
|
805
|
-
children: [/* @__PURE__ */ jsxs("
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
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(
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
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(
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
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
|
-
|
|
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
|
|
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-
|
|
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-
|
|
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-
|
|
1116
|
+
var SearchDialog = lazy(() => import("./SearchDialog-B67VA0Ut.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-
|
|
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-
|
|
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, {
|
|
@@ -1145,10 +1231,10 @@ function LanguageSwitcher(arg0) {
|
|
|
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-
|
|
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-
|
|
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,6 +1243,7 @@ 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
1248
|
children: i18n.locales.flatMap((locale) => {
|
|
1162
1249
|
const localizedPath = localizedRoutePath(config, locale.code, currentRoute);
|
|
@@ -1179,17 +1266,20 @@ function LanguageSwitcher(arg0) {
|
|
|
1179
1266
|
});
|
|
1180
1267
|
}
|
|
1181
1268
|
function TopLevelNavItem(arg0) {
|
|
1182
|
-
const { href, children } = arg0;
|
|
1183
|
-
|
|
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
|
|
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
|
|
1281
|
+
className,
|
|
1282
|
+
"aria-current": active ? "page" : void 0,
|
|
1193
1283
|
children
|
|
1194
1284
|
}) });
|
|
1195
1285
|
}
|
|
@@ -1205,9 +1295,9 @@ 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-
|
|
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-
|
|
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",
|
|
@@ -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__ */
|
|
1252
|
-
className: "clarify-product-tabs-
|
|
1253
|
-
"
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
"
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
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);
|
|
@@ -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-
|
|
1327
|
-
children: config.navbar?.links?.map((link) =>
|
|
1328
|
-
href
|
|
1329
|
-
|
|
1330
|
-
|
|
1496
|
+
className: "flex items-center gap-0.5",
|
|
1497
|
+
children: config.navbar?.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.i18n?.defaultLocale)
|
|
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-
|
|
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
|
|
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,
|
|
@@ -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-
|
|
1617
|
+
//# sourceMappingURL=PageActions-BQeEmXbT.js.map
|