@alfadocs/ui-kit-debug 0.16.0 → 0.17.1

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 (55) hide show
  1. package/dist/_chunks/benefit-card-DXmrAyfn.js +219 -0
  2. package/dist/_chunks/benefit-card-DXmrAyfn.js.map +1 -0
  3. package/dist/_chunks/{carousel.agent-OTn-kMQg.js → carousel.agent-Xuw9LPZN.js} +14 -7
  4. package/dist/_chunks/{carousel.agent-OTn-kMQg.js.map → carousel.agent-Xuw9LPZN.js.map} +1 -1
  5. package/dist/_chunks/copy-field-BCHAZ8QV.js +298 -0
  6. package/dist/_chunks/copy-field-BCHAZ8QV.js.map +1 -0
  7. package/dist/_chunks/{navigation-menu-Bav1d_wA.js → navigation-menu-DdufF-_4.js} +18 -18
  8. package/dist/_chunks/{navigation-menu-Bav1d_wA.js.map → navigation-menu-DdufF-_4.js.map} +1 -1
  9. package/dist/_chunks/{pagination-OQBlnb1H.js → pagination-F1ei4khE.js} +180 -158
  10. package/dist/_chunks/pagination-F1ei4khE.js.map +1 -0
  11. package/dist/_chunks/public-header.agent-BIBQzkeV.js +557 -0
  12. package/dist/_chunks/public-header.agent-BIBQzkeV.js.map +1 -0
  13. package/dist/agent-catalog.json +37 -1
  14. package/dist/components/benefit-card/benefit-card.d.ts.map +1 -1
  15. package/dist/components/benefit-card/index.js +1 -1
  16. package/dist/components/carousel/carousel.d.ts.map +1 -1
  17. package/dist/components/carousel/index.js +1 -1
  18. package/dist/components/copy-field/copy-field.agent.d.ts +16 -0
  19. package/dist/components/copy-field/copy-field.agent.d.ts.map +1 -0
  20. package/dist/components/copy-field/copy-field.d.ts +50 -0
  21. package/dist/components/copy-field/copy-field.d.ts.map +1 -0
  22. package/dist/components/copy-field/index.d.ts +5 -0
  23. package/dist/components/copy-field/index.d.ts.map +1 -0
  24. package/dist/components/copy-field/index.js +6 -0
  25. package/dist/components/copy-field/index.js.map +1 -0
  26. package/dist/components/index.d.ts +1 -0
  27. package/dist/components/index.d.ts.map +1 -1
  28. package/dist/components/navigation-menu/index.js +1 -1
  29. package/dist/components/pagination/index.js +1 -1
  30. package/dist/components/pagination/pagination.d.ts.map +1 -1
  31. package/dist/components/public-header/index.d.ts +1 -1
  32. package/dist/components/public-header/index.d.ts.map +1 -1
  33. package/dist/components/public-header/index.js +1 -1
  34. package/dist/components/public-header/public-header.d.ts +36 -1
  35. package/dist/components/public-header/public-header.d.ts.map +1 -1
  36. package/dist/hooks/use-controllable-state.d.ts +10 -0
  37. package/dist/hooks/use-controllable-state.d.ts.map +1 -0
  38. package/dist/hooks/use-copy-to-clipboard.d.ts +45 -0
  39. package/dist/hooks/use-copy-to-clipboard.d.ts.map +1 -0
  40. package/dist/i18n/config.js +21 -0
  41. package/dist/i18n/config.js.map +1 -1
  42. package/dist/i18n/resources.d.ts +21 -0
  43. package/dist/i18n/resources.d.ts.map +1 -1
  44. package/dist/index.js +458 -455
  45. package/dist/index.js.map +1 -1
  46. package/dist/locales/de.json +7 -0
  47. package/dist/locales/en.json +7 -0
  48. package/dist/locales/it.json +7 -0
  49. package/dist/tokens.css +1 -1
  50. package/package.json +5 -1
  51. package/dist/_chunks/benefit-card-Czs0oXdi.js +0 -161
  52. package/dist/_chunks/benefit-card-Czs0oXdi.js.map +0 -1
  53. package/dist/_chunks/pagination-OQBlnb1H.js.map +0 -1
  54. package/dist/_chunks/public-header.agent-ZLBAQ30j.js +0 -242
  55. package/dist/_chunks/public-header.agent-ZLBAQ30j.js.map +0 -1
@@ -0,0 +1,298 @@
1
+ import { jsxs as P, jsx as p } from "react/jsx-runtime";
2
+ import { useRef as m, useEffect as V, useState as A, useCallback as y, forwardRef as _, useMemo as H } from "react";
3
+ import { c as x } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as O } from "react-i18next";
5
+ import { B as W } from "./button-DD_0Xdmr.js";
6
+ import { u as q } from "./registry-C9nwlNyL.js";
7
+ import { C as D } from "./check-DPdL_Sm7.js";
8
+ import { C as G } from "./copy-B00HK7tj.js";
9
+ const J = typeof navigator < "u" && typeof navigator.clipboard < "u" && typeof navigator.clipboard.writeText == "function";
10
+ function Q(t = {}) {
11
+ const { resetAfterMs: e = 2e3, writer: s } = t, o = m(s);
12
+ V(() => {
13
+ o.current = s;
14
+ }, [s]);
15
+ const [C, i] = A("idle"), [T, u] = A(null), n = m(null), a = y(() => {
16
+ n.current !== null && (clearTimeout(n.current), n.current = null);
17
+ }, []), d = y(() => {
18
+ a(), i("idle"), u(null);
19
+ }, [a]), z = y(
20
+ async (c) => {
21
+ a();
22
+ const h = o.current;
23
+ let l = !1;
24
+ if (h)
25
+ try {
26
+ l = await h(c);
27
+ } catch {
28
+ l = !1;
29
+ }
30
+ else {
31
+ if (!(J || typeof navigator < "u" && typeof navigator.clipboard < "u" && typeof navigator.clipboard.writeText == "function"))
32
+ return i("error"), u(null), !1;
33
+ try {
34
+ await navigator.clipboard.writeText(c), l = !0;
35
+ } catch {
36
+ l = !1;
37
+ }
38
+ }
39
+ return l ? (i("copied"), u(c), e > 0 && (n.current = setTimeout(() => {
40
+ n.current = null, i("idle");
41
+ }, e)), !0) : (i("error"), u(null), !1);
42
+ },
43
+ [a, e]
44
+ );
45
+ return V(() => a, [a]), { status: C, copiedValue: T, copy: z, reset: d };
46
+ }
47
+ const U = {
48
+ id: "copy-field",
49
+ capabilities: [],
50
+ state: {
51
+ value: {
52
+ type: "string",
53
+ descriptionKey: "ui.agent.copyField.state.value",
54
+ description: "The value displayed in the read-only field.",
55
+ read: (t) => t.getValue()
56
+ },
57
+ copied: {
58
+ type: "boolean",
59
+ descriptionKey: "ui.agent.copyField.state.copied",
60
+ description: "True for the brief window after a successful copy.",
61
+ read: (t) => t.isCopied()
62
+ }
63
+ },
64
+ actions: {
65
+ copy: {
66
+ safety: "write",
67
+ descriptionKey: "ui.agent.copyField.actions.copy",
68
+ description: "Programmatically trigger the clipboard write.",
69
+ invoke: (t) => t.copy()
70
+ }
71
+ },
72
+ domHooks: {
73
+ root: {
74
+ attr: "data-component",
75
+ value: "copy-field",
76
+ description: "Marks the CopyField root. The trailing button uses `aria-label` keyed off the copy / copied state."
77
+ },
78
+ instanceId: {
79
+ attr: "data-component-id",
80
+ sourceProp: "id",
81
+ description: "Sourced from the id prop, when provided."
82
+ }
83
+ }
84
+ };
85
+ async function X(t) {
86
+ var o;
87
+ if (typeof navigator < "u" && ((o = navigator.clipboard) != null && o.writeText))
88
+ try {
89
+ return await navigator.clipboard.writeText(t), !0;
90
+ } catch {
91
+ }
92
+ if (typeof document > "u") return !1;
93
+ const e = document.createElement("textarea");
94
+ e.value = t, e.setAttribute("readonly", ""), e.style.position = "absolute", e.style.setProperty("inset-inline-start", "-9999px"), document.body.appendChild(e), e.select();
95
+ let s = !1;
96
+ try {
97
+ s = document.execCommand("copy");
98
+ } catch {
99
+ s = !1;
100
+ }
101
+ return document.body.removeChild(e), s;
102
+ }
103
+ const Y = x(
104
+ [
105
+ "ds:inline-flex ds:items-stretch ds:w-full",
106
+ "ds:rounded-[var(--radius-sm)] ds:bg-input ds:text-foreground",
107
+ "ds:border ds:border-border",
108
+ "ds:shadow-[var(--shadow-input)]",
109
+ "ds:focus-within:outline-[length:var(--focus-ring-width)] ds:focus-within:outline-solid",
110
+ "ds:focus-within:outline-ring ds:focus-within:outline-offset-[length:var(--focus-ring-offset)]",
111
+ "ds:forced-colors:focus-within:outline-[CanvasText]",
112
+ "ds:transition-[colors,box-shadow] ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
113
+ "ds:overflow-hidden"
114
+ ].join(" "),
115
+ {
116
+ variants: {
117
+ size: {
118
+ sm: "ds:h-8 ds:text-[var(--font-size-sm)]",
119
+ md: "ds:h-[var(--min-target-size)] ds:text-[var(--font-size-base)]",
120
+ lg: "ds:h-12 ds:text-[var(--font-size-lg)]"
121
+ },
122
+ disabled: {
123
+ true: "ds:opacity-50 ds:cursor-not-allowed",
124
+ false: ""
125
+ }
126
+ },
127
+ defaultVariants: { size: "md", disabled: !1 }
128
+ }
129
+ ), Z = x(
130
+ [
131
+ "ds:flex-1 ds:min-w-0 ds:bg-transparent ds:border-0 ds:outline-none",
132
+ "ds:text-foreground",
133
+ "ds:disabled:cursor-not-allowed"
134
+ ].join(" "),
135
+ {
136
+ variants: {
137
+ intent: {
138
+ default: "",
139
+ // `--primary` is calibrated for foreground use (violet-500 light,
140
+ // magenta-500 dark) — both pass AA against their input backgrounds.
141
+ primary: "ds:text-primary ds:font-medium"
142
+ },
143
+ size: {
144
+ sm: "ds:text-[var(--font-size-sm)]",
145
+ md: "ds:text-[var(--font-size-base)]",
146
+ lg: "ds:text-[var(--font-size-lg)]"
147
+ },
148
+ wrap: {
149
+ true: "ds:[overflow-wrap:anywhere] ds:whitespace-normal",
150
+ false: "ds:overflow-hidden ds:text-ellipsis ds:whitespace-nowrap"
151
+ },
152
+ hasStartIcon: {
153
+ true: "",
154
+ false: ""
155
+ }
156
+ },
157
+ // Explicit pairs decide the leading padding — single ps-* per cell, so
158
+ // there's no fight between size + hasStartIcon under Tailwind's flat
159
+ // utility precedence.
160
+ compoundVariants: [
161
+ { size: "sm", hasStartIcon: !1, class: "ds:ps-[var(--spacing-sm)]" },
162
+ { size: "md", hasStartIcon: !1, class: "ds:ps-[var(--spacing-sm)]" },
163
+ { size: "lg", hasStartIcon: !1, class: "ds:ps-[var(--spacing-md)]" },
164
+ { size: "sm", hasStartIcon: !0, class: "ds:ps-[var(--spacing-xs)]" },
165
+ { size: "md", hasStartIcon: !0, class: "ds:ps-[var(--spacing-xs)]" },
166
+ { size: "lg", hasStartIcon: !0, class: "ds:ps-[var(--spacing-sm)]" }
167
+ ],
168
+ defaultVariants: {
169
+ intent: "default",
170
+ size: "md",
171
+ wrap: !1,
172
+ hasStartIcon: !1
173
+ }
174
+ }
175
+ ), $ = x(
176
+ [
177
+ "ds:inline-flex ds:items-center ds:justify-center ds:shrink-0",
178
+ "ds:text-muted-foreground",
179
+ "ds:[&_svg]:size-4"
180
+ ].join(" "),
181
+ {
182
+ variants: {
183
+ size: {
184
+ sm: "ds:ps-[var(--spacing-sm)]",
185
+ md: "ds:ps-[var(--spacing-sm)]",
186
+ lg: "ds:ps-[var(--spacing-md)]"
187
+ }
188
+ },
189
+ defaultVariants: { size: "md" }
190
+ }
191
+ ), ee = x(
192
+ [
193
+ "ds:shrink-0 ds:rounded-none",
194
+ "ds:focus-visible:outline-none",
195
+ "ds:h-full",
196
+ "ds:gap-[var(--spacing-xs)]"
197
+ ].join(" ")
198
+ ), te = _(
199
+ ({
200
+ value: t,
201
+ size: e = "md",
202
+ intent: s = "default",
203
+ startIcon: o,
204
+ wrap: C = !1,
205
+ copyLabel: i,
206
+ copiedLabel: T,
207
+ copiedDuration: u = 2e3,
208
+ ariaLabel: n,
209
+ onCopy: a,
210
+ disabled: d = !1,
211
+ className: z,
212
+ id: c,
213
+ ...h
214
+ }, l) => {
215
+ const { t: r } = O(), g = m(t);
216
+ g.current = t;
217
+ const v = m(a);
218
+ v.current = a;
219
+ const { status: w, copy: I } = Q({
220
+ resetAfterMs: u,
221
+ writer: X
222
+ }), f = w === "copied", R = m(!1);
223
+ R.current = f;
224
+ const [B, F] = A("");
225
+ V(() => {
226
+ F(w === "copied" ? r("copyField.copySuccess") : w === "error" ? r("copyField.copyFailed") : "");
227
+ }, [w, r]);
228
+ const b = y(async () => {
229
+ var j;
230
+ if (d) return !1;
231
+ const L = await I(g.current);
232
+ return L && ((j = v.current) == null || j.call(v, g.current)), L;
233
+ }, [d, I]), N = y(() => {
234
+ b();
235
+ }, [b]), K = H(
236
+ () => ({
237
+ getValue: () => g.current,
238
+ copy: () => b(),
239
+ isCopied: () => R.current
240
+ }),
241
+ [b]
242
+ );
243
+ q(U, K, c);
244
+ const M = n ?? r("copyField.valueLabel"), S = i ?? r("copyField.copy"), k = T ?? r("copyField.copied"), E = f ? typeof k == "string" ? k : r("copyField.copied") : typeof S == "string" ? S : r("copyField.copy");
245
+ return /* @__PURE__ */ P(
246
+ "div",
247
+ {
248
+ ref: l,
249
+ className: Y({ size: e, disabled: d, className: z }),
250
+ "data-component": "copy-field",
251
+ "data-component-id": c,
252
+ "data-copied": f ? "true" : void 0,
253
+ ...h,
254
+ children: [
255
+ o ? /* @__PURE__ */ p("span", { "aria-hidden": "true", className: $({ size: e }), children: o }) : null,
256
+ /* @__PURE__ */ p(
257
+ "input",
258
+ {
259
+ id: c,
260
+ type: "text",
261
+ readOnly: !0,
262
+ value: t,
263
+ disabled: d,
264
+ "aria-label": M,
265
+ className: Z({
266
+ intent: s,
267
+ size: e,
268
+ wrap: C,
269
+ hasStartIcon: !!o
270
+ })
271
+ }
272
+ ),
273
+ /* @__PURE__ */ p(
274
+ W,
275
+ {
276
+ type: "button",
277
+ intent: "ghost",
278
+ size: e,
279
+ onClick: N,
280
+ disabled: d,
281
+ "aria-label": E,
282
+ className: ee(),
283
+ startIcon: f ? /* @__PURE__ */ p(D, { "aria-hidden": "true" }) : /* @__PURE__ */ p(G, { "aria-hidden": "true" }),
284
+ children: /* @__PURE__ */ p("span", { className: "type-label", children: f ? k : S })
285
+ }
286
+ ),
287
+ /* @__PURE__ */ p("span", { role: "status", "aria-live": "polite", className: "ds:sr-only", children: B })
288
+ ]
289
+ }
290
+ );
291
+ }
292
+ );
293
+ te.displayName = "CopyField";
294
+ export {
295
+ te as C,
296
+ U as c
297
+ };
298
+ //# sourceMappingURL=copy-field-BCHAZ8QV.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy-field-BCHAZ8QV.js","sources":["../../src/hooks/use-copy-to-clipboard.ts","../../src/components/copy-field/copy-field.agent.ts","../../src/components/copy-field/copy-field.tsx"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\n\nexport type CopyStatus = 'idle' | 'copied' | 'error';\n\nexport interface UseCopyToClipboardOptions {\n /**\n * Auto-reset to `'idle'` this many ms after a successful copy. Pass\n * `0` to disable auto-reset (caller drives the lifecycle). @default 2000\n */\n resetAfterMs?: number;\n /**\n * Override the underlying clipboard writer. When omitted the hook\n * uses `navigator.clipboard.writeText`. Pass your own writer to add\n * a legacy `document.execCommand('copy')` fallback for non-HTTPS\n * contexts, or to instrument the call for telemetry. Must resolve\n * `true` on success, `false` on failure (do not throw).\n */\n writer?: (value: string) => Promise<boolean>;\n}\n\nexport interface UseCopyToClipboardReturn {\n /** Current status. `'idle'` until the first `copy()` call. */\n status: CopyStatus;\n /** Last value successfully copied, or `null`. */\n copiedValue: string | null;\n /** Copy `value` to the clipboard. Returns `true` on success. */\n copy: (value: string) => Promise<boolean>;\n /** Reset to `'idle'` immediately. */\n reset: () => void;\n}\n\nconst SSR_FALLBACK_AVAILABLE =\n typeof navigator !== 'undefined' &&\n typeof navigator.clipboard !== 'undefined' &&\n typeof navigator.clipboard.writeText === 'function';\n\n/**\n * Copy a string to the system clipboard with status tracking.\n *\n * Uses `navigator.clipboard.writeText` (https-only / focus-required, but\n * universally available in modern browsers). Falls back gracefully —\n * `copy()` returns `false` and sets `status: 'error'` when the Clipboard\n * API is unavailable or the call rejects.\n *\n * Status auto-resets to `'idle'` after `resetAfterMs` ms by default so\n * the common \"show ✓ for 2s after click\" UX has zero glue code.\n *\n * @example\n * const { status, copy } = useCopyToClipboard();\n * <Button onClick={() => copy(value)}>\n * {status === 'copied' ? 'Copied!' : 'Copy'}\n * </Button>\n */\nexport function useCopyToClipboard(\n options: UseCopyToClipboardOptions = {},\n): UseCopyToClipboardReturn {\n const { resetAfterMs = 2000, writer } = options;\n\n // Mirror the writer in a ref so callers passing a fresh closure each\n // render don't churn the `copy` identity.\n const writerRef = useRef(writer);\n useEffect(() => {\n writerRef.current = writer;\n }, [writer]);\n\n const [status, setStatus] = useState<CopyStatus>('idle');\n const [copiedValue, setCopiedValue] = useState<string | null>(null);\n const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n const clearTimer = useCallback(() => {\n if (timerRef.current !== null) {\n clearTimeout(timerRef.current);\n timerRef.current = null;\n }\n }, []);\n\n const reset = useCallback(() => {\n clearTimer();\n setStatus('idle');\n setCopiedValue(null);\n }, [clearTimer]);\n\n const copy = useCallback(\n async (value: string): Promise<boolean> => {\n clearTimer();\n\n const customWriter = writerRef.current;\n let ok = false;\n\n if (customWriter) {\n try {\n ok = await customWriter(value);\n } catch {\n ok = false;\n }\n } else {\n // Re-read availability at call time so a hook instantiated during\n // SSR still works on the client.\n const hasClipboard =\n SSR_FALLBACK_AVAILABLE ||\n (typeof navigator !== 'undefined' &&\n typeof navigator.clipboard !== 'undefined' &&\n typeof navigator.clipboard.writeText === 'function');\n\n if (!hasClipboard) {\n setStatus('error');\n setCopiedValue(null);\n return false;\n }\n\n try {\n await navigator.clipboard.writeText(value);\n ok = true;\n } catch {\n ok = false;\n }\n }\n\n if (!ok) {\n setStatus('error');\n setCopiedValue(null);\n return false;\n }\n\n setStatus('copied');\n setCopiedValue(value);\n\n if (resetAfterMs > 0) {\n timerRef.current = setTimeout(() => {\n timerRef.current = null;\n setStatus('idle');\n }, resetAfterMs);\n }\n return true;\n },\n [clearTimer, resetAfterMs],\n );\n\n useEffect(() => clearTimer, [clearTimer]);\n\n return { status, copiedValue, copy, reset };\n}\n","/* -------------------------------------------------------------------- */\n/* Agent adapter — CopyField. */\n/* */\n/* See `src/docs/26-agent-readiness.mdx` for the contract. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\n\n/**\n * Imperative handle for CopyField — agents can read the value and trigger a\n * programmatic copy. State stays scoped to identifiers + transient UI state;\n * never PHI (per PRS §Security).\n */\nexport interface CopyFieldHandle {\n /** Returns the read-only value currently displayed. */\n getValue: () => string;\n /** Triggers the clipboard write side-effect. */\n copy: () => Promise<boolean>;\n /** Returns true for the brief window after a successful copy. */\n isCopied: () => boolean;\n}\n\nexport const copyFieldAgent: AgentAdapter<CopyFieldHandle> = {\n id: 'copy-field',\n capabilities: [],\n state: {\n value: {\n type: 'string',\n descriptionKey: 'ui.agent.copyField.state.value',\n description: 'The value displayed in the read-only field.',\n read: (handle) => handle.getValue(),\n },\n copied: {\n type: 'boolean',\n descriptionKey: 'ui.agent.copyField.state.copied',\n description: 'True for the brief window after a successful copy.',\n read: (handle) => handle.isCopied(),\n },\n },\n actions: {\n copy: {\n safety: 'write',\n descriptionKey: 'ui.agent.copyField.actions.copy',\n description: 'Programmatically trigger the clipboard write.',\n invoke: (handle) => handle.copy(),\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'copy-field',\n description:\n 'Marks the CopyField root. The trailing button uses `aria-label` keyed off the copy / copied state.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop, when provided.',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Check, Copy } from 'lucide-react';\nimport { Button } from '../button/button';\nimport { useAgentRegistration } from '../../agent';\nimport { useCopyToClipboard } from '../../hooks/use-copy-to-clipboard';\nimport { copyFieldAgent, type CopyFieldHandle } from './copy-field.agent';\n\n/* ------------------------------------------------------------------ */\n/* Clipboard helper */\n/* */\n/* `navigator.clipboard.writeText` is the modern path. The fallback */\n/* covers older browsers and insecure contexts via a synthesised */\n/* textarea + `document.execCommand('copy')`. The off-screen position */\n/* uses imperative DOM `.style` assignments — those are NOT JSX inline */\n/* styles and don't violate constraint §3. */\n/* ------------------------------------------------------------------ */\n\nasync function copyToClipboard(text: string): Promise<boolean> {\n if (typeof navigator !== 'undefined' && navigator.clipboard?.writeText) {\n try {\n await navigator.clipboard.writeText(text);\n return true;\n } catch {\n // fall through to legacy path\n }\n }\n if (typeof document === 'undefined') return false;\n const textarea = document.createElement('textarea');\n textarea.value = text;\n textarea.setAttribute('readonly', '');\n // Imperative DOM style — not a JSX inline-style violation. We use\n // `setProperty('inset-inline-start', …)` so the hidden textarea stays\n // logically off-screen in both LTR and RTL contexts.\n textarea.style.position = 'absolute';\n textarea.style.setProperty('inset-inline-start', '-9999px');\n document.body.appendChild(textarea);\n textarea.select();\n let ok = false;\n try {\n ok = document.execCommand('copy');\n } catch {\n ok = false;\n }\n document.body.removeChild(textarea);\n return ok;\n}\n\n/* ------------------------------------------------------------------ */\n/* CVA — outer wrapper */\n/* */\n/* Mirrors the shared input-surface chrome (border + halo shadow) so */\n/* CopyField sits inline next to TextInput / Combobox in forms without */\n/* visual drift. Logical paddings only. `ds:focus-within` paints the */\n/* ring when the trailing button or the embedded input receives focus. */\n/* ------------------------------------------------------------------ */\n\nconst fieldVariants = cva(\n [\n 'ds:inline-flex ds:items-stretch ds:w-full',\n 'ds:rounded-[var(--radius-sm)] ds:bg-input ds:text-foreground',\n 'ds:border ds:border-border',\n 'ds:shadow-[var(--shadow-input)]',\n 'ds:focus-within:outline-[length:var(--focus-ring-width)] ds:focus-within:outline-solid',\n 'ds:focus-within:outline-ring ds:focus-within:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:forced-colors:focus-within:outline-[CanvasText]',\n 'ds:transition-[colors,box-shadow] ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:overflow-hidden',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:h-8 ds:text-[var(--font-size-sm)]',\n md: 'ds:h-[var(--min-target-size)] ds:text-[var(--font-size-base)]',\n lg: 'ds:h-12 ds:text-[var(--font-size-lg)]',\n },\n disabled: {\n true: 'ds:opacity-50 ds:cursor-not-allowed',\n false: '',\n },\n },\n defaultVariants: { size: 'md', disabled: false },\n },\n);\n\n/* ------------------------------------------------------------------ */\n/* CVA — value <input> styling */\n/* ------------------------------------------------------------------ */\n\nconst valueVariants = cva(\n [\n 'ds:flex-1 ds:min-w-0 ds:bg-transparent ds:border-0 ds:outline-none',\n 'ds:text-foreground',\n 'ds:disabled:cursor-not-allowed',\n ].join(' '),\n {\n variants: {\n intent: {\n default: '',\n // `--primary` is calibrated for foreground use (violet-500 light,\n // magenta-500 dark) — both pass AA against their input backgrounds.\n primary: 'ds:text-primary ds:font-medium',\n },\n size: {\n sm: 'ds:text-[var(--font-size-sm)]',\n md: 'ds:text-[var(--font-size-base)]',\n lg: 'ds:text-[var(--font-size-lg)]',\n },\n wrap: {\n true: 'ds:[overflow-wrap:anywhere] ds:whitespace-normal',\n false: 'ds:overflow-hidden ds:text-ellipsis ds:whitespace-nowrap',\n },\n hasStartIcon: {\n true: '',\n false: '',\n },\n },\n // Explicit pairs decide the leading padding — single ps-* per cell, so\n // there's no fight between size + hasStartIcon under Tailwind's flat\n // utility precedence.\n compoundVariants: [\n { size: 'sm', hasStartIcon: false, class: 'ds:ps-[var(--spacing-sm)]' },\n { size: 'md', hasStartIcon: false, class: 'ds:ps-[var(--spacing-sm)]' },\n { size: 'lg', hasStartIcon: false, class: 'ds:ps-[var(--spacing-md)]' },\n { size: 'sm', hasStartIcon: true, class: 'ds:ps-[var(--spacing-xs)]' },\n { size: 'md', hasStartIcon: true, class: 'ds:ps-[var(--spacing-xs)]' },\n { size: 'lg', hasStartIcon: true, class: 'ds:ps-[var(--spacing-sm)]' },\n ],\n defaultVariants: {\n intent: 'default',\n size: 'md',\n wrap: false,\n hasStartIcon: false,\n },\n },\n);\n\n/* ------------------------------------------------------------------ */\n/* Leading icon slot */\n/* ------------------------------------------------------------------ */\n\nconst startIconVariants = cva(\n [\n 'ds:inline-flex ds:items-center ds:justify-center ds:shrink-0',\n 'ds:text-muted-foreground',\n 'ds:[&_svg]:size-4',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:ps-[var(--spacing-sm)]',\n md: 'ds:ps-[var(--spacing-sm)]',\n lg: 'ds:ps-[var(--spacing-md)]',\n },\n },\n defaultVariants: { size: 'md' },\n },\n);\n\n/* ------------------------------------------------------------------ */\n/* Trailing button wrapper */\n/* */\n/* The button visually attaches to the field by removing its own focus */\n/* ring (the wrapper paints `focus-within`) and rounding only the */\n/* trailing inline-end corners. */\n/* ------------------------------------------------------------------ */\n\nconst copyButtonVariants = cva(\n [\n 'ds:shrink-0 ds:rounded-none',\n 'ds:focus-visible:outline-none',\n 'ds:h-full',\n 'ds:gap-[var(--spacing-xs)]',\n ].join(' '),\n);\n\n/* ------------------------------------------------------------------ */\n/* Props */\n/* ------------------------------------------------------------------ */\n\ntype FieldSize = NonNullable<VariantProps<typeof fieldVariants>['size']>;\ntype ValueIntent = NonNullable<VariantProps<typeof valueVariants>['intent']>;\n\nexport interface CopyFieldProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'children' | 'onCopy'\n> {\n /** The value displayed in the read-only field and copied on click. */\n value: string;\n /** Field height + padding. Mirrors TextInput sizes. */\n size?: FieldSize;\n /**\n * `primary` tints the value text with `--primary` — matches the\n * link-style emphasis used by the telehealth showSession page.\n */\n intent?: ValueIntent;\n /**\n * Leading icon slot, decorative. Use `lucide-react` icons like\n * `<Link2 />` for a URL, `<KeyRound />` for a token.\n */\n startIcon?: ReactNode;\n /**\n * `false` (default) truncates long values with ellipsis on a single\n * line. `true` allows wrap with `overflow-wrap: anywhere`.\n */\n wrap?: boolean;\n /** Override the default 'Copy' button label. */\n copyLabel?: ReactNode;\n /** Override the default 'Copied' success-state label. */\n copiedLabel?: ReactNode;\n /** Milliseconds before the button reverts to its default state. Default 2000. */\n copiedDuration?: number;\n /** ARIA label for the read-only textbox. Defaults to the i18n key. */\n ariaLabel?: string;\n /** Fires once after a successful clipboard write. */\n onCopy?: (value: string) => void;\n /** Greys both the field and the button; the button doesn't fire onCopy. */\n disabled?: boolean;\n}\n\n/* ------------------------------------------------------------------ */\n/* CopyField */\n/* ------------------------------------------------------------------ */\n\nexport const CopyField = forwardRef<HTMLDivElement, CopyFieldProps>(\n (\n {\n value,\n size = 'md',\n intent = 'default',\n startIcon,\n wrap = false,\n copyLabel,\n copiedLabel,\n copiedDuration = 2000,\n ariaLabel,\n onCopy,\n disabled = false,\n className,\n id,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation();\n\n const valueRef = useRef(value);\n valueRef.current = value;\n const onCopyRef = useRef(onCopy);\n onCopyRef.current = onCopy;\n\n // Drive status + auto-reset from the shared hook. The custom `writer`\n // preserves CopyField's legacy `document.execCommand('copy')` fallback\n // for non-HTTPS / older-browser contexts.\n const { status, copy } = useCopyToClipboard({\n resetAfterMs: copiedDuration,\n writer: copyToClipboard,\n });\n const copied = status === 'copied';\n const copiedRef = useRef(false);\n copiedRef.current = copied;\n\n // i18n-aware live-region text mirrors the hook status — `copied` →\n // success message, `error` → failure message, `idle` → clear.\n const [liveRegionText, setLiveRegionText] = useState('');\n useEffect(() => {\n if (status === 'copied') {\n setLiveRegionText(t('copyField.copySuccess'));\n } else if (status === 'error') {\n setLiveRegionText(t('copyField.copyFailed'));\n } else {\n setLiveRegionText('');\n }\n }, [status, t]);\n\n const handleCopy = useCallback(async (): Promise<boolean> => {\n if (disabled) return false;\n const ok = await copy(valueRef.current);\n if (ok) onCopyRef.current?.(valueRef.current);\n return ok;\n }, [disabled, copy]);\n\n const handleButtonClick = useCallback(() => {\n void handleCopy();\n }, [handleCopy]);\n\n /* -------------------------------------------------------------- */\n /* Agent handle — read value + trigger copy + check transient state */\n /* -------------------------------------------------------------- */\n\n const agentHandle = useMemo<CopyFieldHandle>(\n () => ({\n getValue: () => valueRef.current,\n copy: () => handleCopy(),\n isCopied: () => copiedRef.current,\n }),\n [handleCopy],\n );\n useAgentRegistration(copyFieldAgent, agentHandle, id);\n\n const resolvedAriaLabel = ariaLabel ?? t('copyField.valueLabel');\n const resolvedCopyText = copyLabel ?? t('copyField.copy');\n const resolvedCopiedText = copiedLabel ?? t('copyField.copied');\n // `aria-label` must be a string; when the consumer passes a non-string\n // ReactNode for copyLabel / copiedLabel we fall back to the translated\n // default so AT users still hear a coherent name.\n const buttonAccessibleLabel = copied\n ? typeof resolvedCopiedText === 'string'\n ? resolvedCopiedText\n : t('copyField.copied')\n : typeof resolvedCopyText === 'string'\n ? resolvedCopyText\n : t('copyField.copy');\n\n return (\n <div\n ref={ref}\n className={fieldVariants({ size, disabled, className })}\n data-component=\"copy-field\"\n data-component-id={id}\n data-copied={copied ? 'true' : undefined}\n {...rest}\n >\n {startIcon ? (\n <span aria-hidden=\"true\" className={startIconVariants({ size })}>\n {startIcon}\n </span>\n ) : null}\n <input\n id={id}\n type=\"text\"\n readOnly\n value={value}\n disabled={disabled}\n aria-label={resolvedAriaLabel}\n className={valueVariants({\n intent,\n size,\n wrap,\n hasStartIcon: Boolean(startIcon),\n })}\n />\n <Button\n type=\"button\"\n intent=\"ghost\"\n size={size}\n onClick={handleButtonClick}\n disabled={disabled}\n aria-label={buttonAccessibleLabel}\n className={copyButtonVariants()}\n startIcon={\n copied ? <Check aria-hidden=\"true\" /> : <Copy aria-hidden=\"true\" />\n }\n >\n <span className=\"type-label\">\n {copied ? resolvedCopiedText : resolvedCopyText}\n </span>\n </Button>\n <span role=\"status\" aria-live=\"polite\" className=\"ds:sr-only\">\n {liveRegionText}\n </span>\n </div>\n );\n },\n);\n\nCopyField.displayName = 'CopyField';\n"],"names":["SSR_FALLBACK_AVAILABLE","useCopyToClipboard","options","resetAfterMs","writer","writerRef","useRef","useEffect","status","setStatus","useState","copiedValue","setCopiedValue","timerRef","clearTimer","useCallback","reset","copy","value","customWriter","ok","copyFieldAgent","handle","copyToClipboard","text","_a","textarea","fieldVariants","cva","valueVariants","startIconVariants","copyButtonVariants","CopyField","forwardRef","size","intent","startIcon","wrap","copyLabel","copiedLabel","copiedDuration","ariaLabel","onCopy","disabled","className","id","rest","ref","t","useTranslation","valueRef","onCopyRef","copied","copiedRef","liveRegionText","setLiveRegionText","handleCopy","handleButtonClick","agentHandle","useMemo","useAgentRegistration","resolvedAriaLabel","resolvedCopyText","resolvedCopiedText","buttonAccessibleLabel","jsxs","jsx","Button","Check","Copy"],"mappings":";;;;;;;;AA+BA,MAAMA,IACJ,OAAO,YAAc,OACrB,OAAO,UAAU,YAAc,OAC/B,OAAO,UAAU,UAAU,aAAc;AAmBpC,SAASC,EACdC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A;AAAA,EAGN;AACF;AAEAtB,GAAU,cAAc;"}
@@ -1,8 +1,8 @@
1
1
  import { jsxs as p, jsx as s } from "react/jsx-runtime";
2
2
  import { forwardRef as n, useRef as I, useState as k, useCallback as z, useMemo as C, useImperativeHandle as B } from "react";
3
3
  import * as o from "@radix-ui/react-navigation-menu";
4
- import { Slot as R } from "@radix-ui/react-slot";
5
- import { c as L } from "./index-D2ZczOXr.js";
4
+ import { Slot as L } from "@radix-ui/react-slot";
5
+ import { c as R } from "./index-D2ZczOXr.js";
6
6
  import { useTranslation as T } from "react-i18next";
7
7
  import { u as A } from "./use-direction-D6rvvG9G.js";
8
8
  import { u as K } from "./registry-C9nwlNyL.js";
@@ -77,18 +77,18 @@ const S = {
77
77
  className: t,
78
78
  children: a,
79
79
  id: i,
80
- value: c,
80
+ value: m,
81
81
  defaultValue: h,
82
- onValueChange: m,
82
+ onValueChange: c,
83
83
  ...b
84
84
  }, N) => {
85
- const { t: w } = T(), u = I(null), y = A(u), v = c !== void 0, [x, M] = k(
85
+ const { t: w } = T(), u = I(null), y = A(u), v = m !== void 0, [M, x] = k(
86
86
  h ?? ""
87
- ), r = v ? c : x, l = z(
87
+ ), r = v ? m : M, l = z(
88
88
  (d) => {
89
- v || M(d), m == null || m(d);
89
+ v || x(d), c == null || c(d);
90
90
  },
91
- [v, m]
91
+ [v, c]
92
92
  ), j = C(
93
93
  () => ({
94
94
  getActiveItem: () => r || null,
@@ -139,9 +139,9 @@ const D = [
139
139
  }
140
140
  ));
141
141
  H.displayName = "NavigationMenuList";
142
- const _ = n(({ navId: e, ...t }, a) => /* @__PURE__ */ s(o.Item, { ref: a, "data-nav-id": e, ...t }));
143
- _.displayName = "NavigationMenuItem";
144
- const P = [
142
+ const P = n(({ navId: e, ...t }, a) => /* @__PURE__ */ s(o.Item, { ref: a, "data-nav-id": e, ...t }));
143
+ P.displayName = "NavigationMenuItem";
144
+ const _ = [
145
145
  "ds:group ds:inline-flex ds:items-center ds:justify-center",
146
146
  "ds:min-h-[var(--min-target-size)]",
147
147
  "ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-sm)]",
@@ -163,7 +163,7 @@ const P = [
163
163
  o.Trigger,
164
164
  {
165
165
  ref: i,
166
- className: [P, e].filter(Boolean).join(" "),
166
+ className: [_, e].filter(Boolean).join(" "),
167
167
  ...a,
168
168
  children: [
169
169
  t,
@@ -188,7 +188,7 @@ const F = [
188
188
  "ds:data-[motion=to-start]:slide-out-to-left-52 ds:rtl:data-[motion=to-start]:slide-out-to-right-52",
189
189
  "ds:data-[motion=to-end]:slide-out-to-right-52 ds:rtl:data-[motion=to-end]:slide-out-to-left-52",
190
190
  "ds:motion-reduce:animate-none"
191
- ].join(" "), G = L(F, {
191
+ ].join(" "), G = R(F, {
192
192
  variants: {
193
193
  layout: {
194
194
  simple: "ds:min-w-[16rem]",
@@ -220,14 +220,14 @@ const g = [
220
220
  "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
221
221
  "ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
222
222
  "ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none"
223
- ].join(" "), Q = n(({ asChild: e = !1, className: t, children: a, ...i }, c) => /* @__PURE__ */ s(
223
+ ].join(" "), Q = n(({ asChild: e = !1, className: t, children: a, ...i }, m) => /* @__PURE__ */ s(
224
224
  o.Link,
225
225
  {
226
- ref: c,
226
+ ref: m,
227
227
  asChild: e,
228
228
  className: e ? void 0 : [g, t].filter(Boolean).join(" "),
229
229
  ...i,
230
- children: e ? /* @__PURE__ */ s(R, { className: [g, t].filter(Boolean).join(" "), children: a }) : a
230
+ children: e ? /* @__PURE__ */ s(L, { className: [g, t].filter(Boolean).join(" "), children: a }) : a
231
231
  }
232
232
  ));
233
233
  Q.displayName = "NavigationMenuLink";
@@ -269,11 +269,11 @@ export {
269
269
  q as N,
270
270
  J as a,
271
271
  X as b,
272
- _ as c,
272
+ P as c,
273
273
  Q as d,
274
274
  H as e,
275
275
  E as f,
276
276
  f as g,
277
277
  S as n
278
278
  };
279
- //# sourceMappingURL=navigation-menu-Bav1d_wA.js.map
279
+ //# sourceMappingURL=navigation-menu-DdufF-_4.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"navigation-menu-Bav1d_wA.js","sources":["../../src/components/navigation-menu/navigation-menu.agent.ts","../../src/components/navigation-menu/navigation-menu.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — NavigationMenu. */\n/* */\n/* NavigationMenu is the primary top-bar navigation. It exposes the */\n/* currently-active item id (when the consumer routes through the kit), */\n/* the open/closed state of its dropdown, and lets an agent open, close, */\n/* or select a top-level item by id. */\n/* */\n/* See `src/docs/26-agent-readiness.mdx` for the full contract. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { NavigationMenuHandle } from './navigation-menu';\n\nexport const navigationMenuAgent: AgentAdapter<NavigationMenuHandle> = {\n id: 'navigation-menu',\n capabilities: ['select_single', 'navigate', 'open', 'close'],\n state: {\n activeItem: {\n type: 'string | null',\n descriptionKey: 'ui.agent.navigationMenu.state.activeItem',\n description:\n 'Id of the currently-active top-level navigation item, or null when none is active.',\n read: (handle) => handle.getActiveItem() ?? null,\n },\n isOpen: {\n type: 'boolean',\n descriptionKey: 'ui.agent.navigationMenu.state.isOpen',\n description: 'Whether a dropdown / mega-menu panel is currently open.',\n read: (handle) => handle.getIsOpen(),\n },\n },\n actions: {\n select_item: {\n safety: 'read',\n argsType: '{ id: string }',\n descriptionKey: 'ui.agent.navigationMenu.actions.selectItem',\n description: 'Activate (open) the top-level item with the given id.',\n invoke: (handle, args: { id: string }) => {\n handle.selectItem(args.id);\n },\n },\n open: {\n safety: 'read',\n argsType: '{ id: string }',\n descriptionKey: 'ui.agent.navigationMenu.actions.open',\n description:\n 'Open the dropdown / mega-menu panel for the given top-level item id.',\n invoke: (handle, args: { id: string }) => {\n handle.open(args.id);\n },\n },\n close: {\n safety: 'read',\n descriptionKey: 'ui.agent.navigationMenu.actions.close',\n description: 'Close any open dropdown / mega-menu panel.',\n invoke: (handle) => {\n handle.close();\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'navigation-menu',\n description: 'Marks the NavigationMenu root.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description:\n 'Sourced from the id prop. Required to address a specific menu from the agent.',\n },\n item: {\n attr: 'data-nav-id',\n description:\n 'Stable opaque id of a top-level navigation item. Selection / open targets this attribute.',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type ComponentPropsWithoutRef,\n type ElementRef,\n} from 'react';\nimport * as RadixNavigationMenu from '@radix-ui/react-navigation-menu';\nimport { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { ChevronDown } from 'lucide-react';\nimport { useDirection } from '../_shared/use-direction';\n// SkipLink moved to its own module — re-imported for the navigation-menu\n// barrel's backwards-compat re-export. New consumers should import it\n// directly from `@alfadocs/ui-kit`.\nimport { SkipLink } from '../skip-link';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { navigationMenuAgent } from './navigation-menu.agent';\n\n/* -------------------------------------------------------------------- */\n/* Root */\n/* -------------------------------------------------------------------- */\n\nconst rootClasses = [\n 'ds:relative ds:z-[var(--z-dropdown)]',\n 'ds:flex ds:max-w-max ds:items-center ds:justify-center',\n].join(' ');\n\nexport interface NavigationMenuProps extends ComponentPropsWithoutRef<\n typeof RadixNavigationMenu.Root\n> {\n 'aria-label'?: string;\n /**\n * Consumer-supplied instance id, surfaced as `data-component-id` so an\n * agent / UI bridge can address this instance.\n */\n id?: string;\n}\n\n/**\n * Imperative handle for agent-readiness. Exposes the active top-level\n * item id + open/closed state, and lets external drivers select / open /\n * close panels by item id.\n */\nexport interface NavigationMenuHandle {\n getActiveItem: () => string | null;\n getIsOpen: () => boolean;\n selectItem: (id: string) => void;\n open: (id: string) => void;\n close: () => void;\n}\n\ntype NavigationMenuRootElement = ElementRef<typeof RadixNavigationMenu.Root>;\n\nconst NavigationMenu = forwardRef<\n NavigationMenuRootElement,\n NavigationMenuProps\n>(\n (\n {\n 'aria-label': ariaLabel,\n className,\n children,\n id,\n value,\n defaultValue,\n onValueChange,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation();\n const rootRef = useRef<ElementRef<typeof RadixNavigationMenu.Root>>(null);\n const dir = useDirection(rootRef);\n\n const isControlled = value !== undefined;\n const [internalValue, setInternalValue] = useState<string>(\n defaultValue ?? '',\n );\n const activeValue = isControlled ? value : internalValue;\n\n const handleValueChange = useCallback(\n (next: string) => {\n if (!isControlled) setInternalValue(next);\n onValueChange?.(next);\n },\n [isControlled, onValueChange],\n );\n\n const handle = useMemo<NavigationMenuHandle>(\n () => ({\n getActiveItem: () => (activeValue ? activeValue : null),\n getIsOpen: () => Boolean(activeValue),\n selectItem: (nextId: string) => handleValueChange(nextId),\n open: (nextId: string) => handleValueChange(nextId),\n close: () => handleValueChange(''),\n }),\n [activeValue, handleValueChange],\n );\n useImperativeHandle(\n ref,\n () => rootRef.current as NavigationMenuRootElement,\n [],\n );\n useAgentRegistration(navigationMenuAgent, handle, id);\n\n return (\n <RadixNavigationMenu.Root\n ref={rootRef}\n dir={dir}\n aria-label={ariaLabel ?? t('navigation.nav.label')}\n className={[rootClasses, className].filter(Boolean).join(' ')}\n id={id}\n data-component=\"navigation-menu\"\n data-component-id={id}\n value={activeValue}\n onValueChange={handleValueChange}\n {...rest}\n >\n {children}\n <NavigationMenuViewport />\n </RadixNavigationMenu.Root>\n );\n },\n);\nNavigationMenu.displayName = 'NavigationMenu';\n\n/* -------------------------------------------------------------------- */\n/* List + Item */\n/* -------------------------------------------------------------------- */\n\nconst listClasses = [\n 'ds:group ds:flex ds:flex-1',\n 'ds:list-none ds:items-center ds:justify-center',\n 'ds:gap-[var(--spacing-xs)]',\n 'ds:m-0 ds:ps-0',\n].join(' ');\n\nconst NavigationMenuList = forwardRef<\n ElementRef<typeof RadixNavigationMenu.List>,\n ComponentPropsWithoutRef<typeof RadixNavigationMenu.List>\n>(({ className, ...rest }, ref) => (\n <RadixNavigationMenu.List\n ref={ref}\n className={[listClasses, className].filter(Boolean).join(' ')}\n {...rest}\n />\n));\nNavigationMenuList.displayName = 'NavigationMenuList';\n\nexport interface NavigationMenuItemProps extends ComponentPropsWithoutRef<\n typeof RadixNavigationMenu.Item\n> {\n /**\n * Stable opaque id of this top-level item. When provided, emitted as\n * `data-nav-id` so an agent / UI bridge can target the item. Distinct\n * from Radix's internal `value`, which controls open-state matching;\n * pass the same string to both if you want them aligned.\n */\n navId?: string;\n}\n\nconst NavigationMenuItem = forwardRef<\n ElementRef<typeof RadixNavigationMenu.Item>,\n NavigationMenuItemProps\n>(({ navId, ...rest }, ref) => (\n <RadixNavigationMenu.Item ref={ref} data-nav-id={navId} {...rest} />\n));\nNavigationMenuItem.displayName = 'NavigationMenuItem';\n\n/* -------------------------------------------------------------------- */\n/* Trigger */\n/* -------------------------------------------------------------------- */\n\nconst triggerClasses = [\n 'ds:group ds:inline-flex ds:items-center ds:justify-center',\n 'ds:min-h-[var(--min-target-size)]',\n 'ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-sm)]',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:text-[var(--font-size-sm)] ds:font-[var(--font-weight-medium)]',\n 'ds:text-[var(--foreground)]',\n 'ds:hover:bg-[var(--muted)]/20',\n 'ds:data-[state=open]:bg-[var(--muted)]/20',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:disabled:cursor-not-allowed ds:disabled:opacity-50',\n 'ds:gap-[var(--spacing-xs)]',\n].join(' ');\n\nconst chevronClasses = [\n 'ds:size-3 ds:transition-transform ds:duration-[var(--animation-duration)]',\n 'ds:group-data-[state=open]:rotate-180',\n 'ds:rtl:-scale-x-100 ds:motion-reduce:transition-none',\n].join(' ');\n\nconst NavigationMenuTrigger = forwardRef<\n ElementRef<typeof RadixNavigationMenu.Trigger>,\n ComponentPropsWithoutRef<typeof RadixNavigationMenu.Trigger>\n>(({ className, children, ...rest }, ref) => (\n <RadixNavigationMenu.Trigger\n ref={ref}\n className={[triggerClasses, className].filter(Boolean).join(' ')}\n {...rest}\n >\n {children}\n <ChevronDown aria-hidden=\"true\" className={chevronClasses} />\n </RadixNavigationMenu.Trigger>\n));\nNavigationMenuTrigger.displayName = 'NavigationMenuTrigger';\n\n/* -------------------------------------------------------------------- */\n/* Content */\n/* -------------------------------------------------------------------- */\n\nconst contentBase = [\n 'ds:absolute ds:start-0 ds:top-0 ds:w-full',\n 'ds:md:w-auto',\n 'ds:bg-[var(--background)] ds:text-[var(--foreground)]',\n 'ds:rounded-[var(--radius-md)] ds:border ds:border-[var(--border)]',\n 'ds:shadow-[var(--shadow-lg)]',\n 'ds:p-[var(--spacing-md)]',\n 'ds:data-[motion^=from-]:animate-in ds:data-[motion^=to-]:animate-out',\n // Logical start/end motion mapped onto physical Tailwind animation utilities.\n // The `rtl:` variants mirror the slide direction so `from-start` enters from\n // the inline-start edge in both LTR and RTL.\n 'ds:data-[motion=from-start]:slide-in-from-left-52 ds:rtl:data-[motion=from-start]:slide-in-from-right-52',\n 'ds:data-[motion=from-end]:slide-in-from-right-52 ds:rtl:data-[motion=from-end]:slide-in-from-left-52',\n 'ds:data-[motion=to-start]:slide-out-to-left-52 ds:rtl:data-[motion=to-start]:slide-out-to-right-52',\n 'ds:data-[motion=to-end]:slide-out-to-right-52 ds:rtl:data-[motion=to-end]:slide-out-to-left-52',\n 'ds:motion-reduce:animate-none',\n].join(' ');\n\nconst contentVariants = cva(contentBase, {\n variants: {\n layout: {\n simple: 'ds:min-w-[16rem]',\n mega: 'ds:grid ds:grid-cols-[repeat(auto-fit,minmax(12rem,1fr))] ds:gap-[var(--spacing-md)] ds:min-w-[32rem]',\n },\n },\n defaultVariants: { layout: 'simple' },\n});\n\nexport interface NavigationMenuContentProps\n extends\n ComponentPropsWithoutRef<typeof RadixNavigationMenu.Content>,\n VariantProps<typeof contentVariants> {}\n\nconst NavigationMenuContent = forwardRef<\n ElementRef<typeof RadixNavigationMenu.Content>,\n NavigationMenuContentProps\n>(({ layout, className, ...rest }, ref) => (\n <RadixNavigationMenu.Content\n ref={ref}\n className={contentVariants({ layout, className })}\n {...rest}\n />\n));\nNavigationMenuContent.displayName = 'NavigationMenuContent';\n\n/* -------------------------------------------------------------------- */\n/* Link */\n/* -------------------------------------------------------------------- */\n\nconst linkClasses = [\n 'ds:block ds:rounded-[var(--radius-sm)]',\n 'ds:min-h-[var(--min-target-size)]',\n 'ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)]',\n 'ds:py-[var(--spacing-xs)]',\n 'ds:text-[var(--font-size-sm)] ds:font-[var(--font-weight-medium)]',\n 'ds:text-[var(--foreground)]',\n 'ds:no-underline',\n 'ds:hover:bg-[var(--muted)]/20',\n 'ds:data-[active]:underline ds:data-[active]:underline-offset-[var(--spacing-xs)]',\n 'ds:aria-[current=page]:underline ds:aria-[current=page]:underline-offset-[var(--spacing-xs)]',\n 'ds:aria-[current=page]:font-[var(--font-weight-semibold)]',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n].join(' ');\n\nexport interface NavigationMenuLinkProps extends ComponentPropsWithoutRef<\n typeof RadixNavigationMenu.Link\n> {\n /** Render through Radix Slot so routers can inject their own link element. */\n asChild?: boolean;\n}\n\nconst NavigationMenuLink = forwardRef<\n ElementRef<typeof RadixNavigationMenu.Link>,\n NavigationMenuLinkProps\n>(({ asChild = false, className, children, ...rest }, ref) => (\n <RadixNavigationMenu.Link\n ref={ref}\n asChild={asChild}\n className={\n asChild ? undefined : [linkClasses, className].filter(Boolean).join(' ')\n }\n {...rest}\n >\n {asChild ? (\n <Slot className={[linkClasses, className].filter(Boolean).join(' ')}>\n {children}\n </Slot>\n ) : (\n children\n )}\n </RadixNavigationMenu.Link>\n));\nNavigationMenuLink.displayName = 'NavigationMenuLink';\n\n/* -------------------------------------------------------------------- */\n/* Indicator + Viewport */\n/* -------------------------------------------------------------------- */\n\nconst indicatorClasses = [\n 'ds:top-full ds:z-[1] ds:flex ds:h-2 ds:items-end ds:justify-center ds:overflow-hidden',\n 'ds:data-[state=visible]:animate-in ds:data-[state=hidden]:animate-out',\n 'ds:data-[state=visible]:fade-in ds:data-[state=hidden]:fade-out',\n 'ds:motion-reduce:animate-none',\n].join(' ');\n\nconst NavigationMenuIndicator = forwardRef<\n ElementRef<typeof RadixNavigationMenu.Indicator>,\n ComponentPropsWithoutRef<typeof RadixNavigationMenu.Indicator>\n>(({ className, ...rest }, ref) => (\n <RadixNavigationMenu.Indicator\n ref={ref}\n className={[indicatorClasses, className].filter(Boolean).join(' ')}\n {...rest}\n >\n <span className=\"ds:relative ds:top-[60%] ds:h-2 ds:w-2 ds:rotate-45 ds:rounded-tl-sm ds:bg-[var(--border)]\" />\n </RadixNavigationMenu.Indicator>\n));\nNavigationMenuIndicator.displayName = 'NavigationMenuIndicator';\n\nconst viewportClasses = [\n 'ds:origin-top-center ds:relative ds:mt-[var(--spacing-xs)]',\n 'ds:h-[var(--radix-navigation-menu-viewport-height)]',\n 'ds:w-full ds:overflow-hidden',\n 'ds:rounded-[var(--radius-md)] ds:border ds:border-[var(--border)]',\n 'ds:bg-[var(--background)] ds:text-[var(--foreground)]',\n 'ds:shadow-[var(--shadow-lg)]',\n 'ds:data-[state=open]:animate-in ds:data-[state=closed]:animate-out',\n 'ds:data-[state=open]:zoom-in-90 ds:data-[state=closed]:zoom-out-95',\n 'ds:motion-reduce:animate-none',\n].join(' ');\n\nconst NavigationMenuViewport = forwardRef<\n ElementRef<typeof RadixNavigationMenu.Viewport>,\n ComponentPropsWithoutRef<typeof RadixNavigationMenu.Viewport>\n>(({ className, ...rest }, ref) => (\n <div className=\"ds:absolute ds:start-0 ds:top-full ds:flex ds:justify-center\">\n <RadixNavigationMenu.Viewport\n ref={ref}\n className={[viewportClasses, className].filter(Boolean).join(' ')}\n {...rest}\n />\n </div>\n));\nNavigationMenuViewport.displayName = 'NavigationMenuViewport';\n\n/* -------------------------------------------------------------------- */\n/* Exports */\n/* -------------------------------------------------------------------- */\n\nexport {\n NavigationMenu,\n NavigationMenuList,\n NavigationMenuItem,\n NavigationMenuTrigger,\n NavigationMenuContent,\n NavigationMenuLink,\n NavigationMenuIndicator,\n NavigationMenuViewport,\n SkipLink,\n};\n"],"names":["navigationMenuAgent","handle","args","rootClasses","NavigationMenu","forwardRef","ariaLabel","className","children","id","value","defaultValue","onValueChange","rest","ref","t","useTranslation","rootRef","useRef","dir","useDirection","isControlled","internalValue","setInternalValue","useState","activeValue","handleValueChange","useCallback","next","useMemo","nextId","useImperativeHandle","useAgentRegistration","jsxs","RadixNavigationMenu","NavigationMenuViewport","listClasses","NavigationMenuList","jsx","NavigationMenuItem","navId","triggerClasses","chevronClasses","NavigationMenuTrigger","ChevronDown","contentBase","contentVariants","cva","NavigationMenuContent","layout","linkClasses","NavigationMenuLink","asChild","Slot","indicatorClasses","NavigationMenuIndicator","viewportClasses"],"mappings":";;;;;;;;;AAcO,MAAMA,IAA0D;AAAA,EACrE,IAAI;AAAA,EACJ,cAAc,CAAC,iBAAiB,YAAY,QAAQ,OAAO;AAAA,EAC3D,OAAO;AAAA,IACL,YAAY;AAAA,MACV,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,mBAAmB;AAAA,IAA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UAAAC,GACH,IAEAA;AAAA,EAAA;AAEJ,CACD;AACD2C,EAAmB,cAAc;AAMjC,MAAMG,IAAmB;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EAAE,KAAK,GAAG,GAEJC,IAA0BlD,EAG9B,CAAC,EAAE,WAAAE,GAAW,GAAGM,EAAA,GAAQC,MACzB,gBAAAwB;AAAA,EAACJ,EAAoB;AAAA,EAApB;AAAA,IACC,KAAApB;AAAA,IACA,WAAW,CAACwC,GAAkB/C,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,IAChE,GAAGM;AAAA,IAEJ,UAAA,gBAAAyB,EAAC,QAAA,EAAK,WAAU,6FAAA,CAA6F;AAAA,EAAA;AAC/G,CACD;AACDiB,EAAwB,cAAc;AAEtC,MAAMC,IAAkB;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EAAE,KAAK,GAAG,GAEJrB,IAAyB9B,EAG7B,CAAC,EAAE,WAAAE,GAAW,GAAGM,EAAA,GAAQC,MACzB,gBAAAwB,EAAC,OAAA,EAAI,WAAU,gEACb,UAAA,gBAAAA;AAAA,EAACJ,EAAoB;AAAA,EAApB;AAAA,IACC,KAAApB;AAAA,IACA,WAAW,CAAC0C,GAAiBjD,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,IAC/D,GAAGM;AAAA,EAAA;AACN,GACF,CACD;AACDsB,EAAuB,cAAc;"}
1
+ {"version":3,"file":"navigation-menu-DdufF-_4.js","sources":["../../src/components/navigation-menu/navigation-menu.agent.ts","../../src/components/navigation-menu/navigation-menu.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — NavigationMenu. */\n/* */\n/* NavigationMenu is the primary top-bar navigation. It exposes the */\n/* currently-active item id (when the consumer routes through the kit), */\n/* the open/closed state of its dropdown, and lets an agent open, close, */\n/* or select a top-level item by id. */\n/* */\n/* See `src/docs/26-agent-readiness.mdx` for the full contract. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { NavigationMenuHandle } from './navigation-menu';\n\nexport const navigationMenuAgent: AgentAdapter<NavigationMenuHandle> = {\n id: 'navigation-menu',\n capabilities: ['select_single', 'navigate', 'open', 'close'],\n state: {\n activeItem: {\n type: 'string | null',\n descriptionKey: 'ui.agent.navigationMenu.state.activeItem',\n description:\n 'Id of the currently-active top-level navigation item, or null when none is active.',\n read: (handle) => handle.getActiveItem() ?? null,\n },\n isOpen: {\n type: 'boolean',\n descriptionKey: 'ui.agent.navigationMenu.state.isOpen',\n description: 'Whether a dropdown / mega-menu panel is currently open.',\n read: (handle) => handle.getIsOpen(),\n },\n },\n actions: {\n select_item: {\n safety: 'read',\n argsType: '{ id: string }',\n descriptionKey: 'ui.agent.navigationMenu.actions.selectItem',\n description: 'Activate (open) the top-level item with the given id.',\n invoke: (handle, args: { id: string }) => {\n handle.selectItem(args.id);\n },\n },\n open: {\n safety: 'read',\n argsType: '{ id: string }',\n descriptionKey: 'ui.agent.navigationMenu.actions.open',\n description:\n 'Open the dropdown / mega-menu panel for the given top-level item id.',\n invoke: (handle, args: { id: string }) => {\n handle.open(args.id);\n },\n },\n close: {\n safety: 'read',\n descriptionKey: 'ui.agent.navigationMenu.actions.close',\n description: 'Close any open dropdown / mega-menu panel.',\n invoke: (handle) => {\n handle.close();\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'navigation-menu',\n description: 'Marks the NavigationMenu root.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description:\n 'Sourced from the id prop. Required to address a specific menu from the agent.',\n },\n item: {\n attr: 'data-nav-id',\n description:\n 'Stable opaque id of a top-level navigation item. Selection / open targets this attribute.',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type ComponentPropsWithoutRef,\n type ElementRef,\n} from 'react';\nimport * as RadixNavigationMenu from '@radix-ui/react-navigation-menu';\nimport { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { ChevronDown } from 'lucide-react';\nimport { useDirection } from '../_shared/use-direction';\n// SkipLink moved to its own module — re-imported for the navigation-menu\n// barrel's backwards-compat re-export. New consumers should import it\n// directly from `@alfadocs/ui-kit`.\nimport { SkipLink } from '../skip-link';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { navigationMenuAgent } from './navigation-menu.agent';\n\n/* -------------------------------------------------------------------- */\n/* Root */\n/* -------------------------------------------------------------------- */\n\nconst rootClasses = [\n 'ds:relative ds:z-[var(--z-dropdown)]',\n 'ds:flex ds:max-w-max ds:items-center ds:justify-center',\n].join(' ');\n\nexport interface NavigationMenuProps extends ComponentPropsWithoutRef<\n typeof RadixNavigationMenu.Root\n> {\n 'aria-label'?: string;\n /**\n * Consumer-supplied instance id, surfaced as `data-component-id` so an\n * agent / UI bridge can address this instance.\n */\n id?: string;\n}\n\n/**\n * Imperative handle for agent-readiness. Exposes the active top-level\n * item id + open/closed state, and lets external drivers select / open /\n * close panels by item id.\n */\nexport interface NavigationMenuHandle {\n getActiveItem: () => string | null;\n getIsOpen: () => boolean;\n selectItem: (id: string) => void;\n open: (id: string) => void;\n close: () => void;\n}\n\ntype NavigationMenuRootElement = ElementRef<typeof RadixNavigationMenu.Root>;\n\nconst NavigationMenu = forwardRef<\n NavigationMenuRootElement,\n NavigationMenuProps\n>(\n (\n {\n 'aria-label': ariaLabel,\n className,\n children,\n id,\n value,\n defaultValue,\n onValueChange,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation();\n const rootRef = useRef<ElementRef<typeof RadixNavigationMenu.Root>>(null);\n const dir = useDirection(rootRef);\n\n const isControlled = value !== undefined;\n const [internalValue, setInternalValue] = useState<string>(\n defaultValue ?? '',\n );\n const activeValue = isControlled ? value : internalValue;\n\n const handleValueChange = useCallback(\n (next: string) => {\n if (!isControlled) setInternalValue(next);\n onValueChange?.(next);\n },\n [isControlled, onValueChange],\n );\n\n const handle = useMemo<NavigationMenuHandle>(\n () => ({\n getActiveItem: () => (activeValue ? activeValue : null),\n getIsOpen: () => Boolean(activeValue),\n selectItem: (nextId: string) => handleValueChange(nextId),\n open: (nextId: string) => handleValueChange(nextId),\n close: () => handleValueChange(''),\n }),\n [activeValue, handleValueChange],\n );\n useImperativeHandle(\n ref,\n () => rootRef.current as NavigationMenuRootElement,\n [],\n );\n useAgentRegistration(navigationMenuAgent, handle, id);\n\n return (\n <RadixNavigationMenu.Root\n ref={rootRef}\n dir={dir}\n aria-label={ariaLabel ?? t('navigation.nav.label')}\n className={[rootClasses, className].filter(Boolean).join(' ')}\n id={id}\n data-component=\"navigation-menu\"\n data-component-id={id}\n value={activeValue}\n onValueChange={handleValueChange}\n {...rest}\n >\n {children}\n <NavigationMenuViewport />\n </RadixNavigationMenu.Root>\n );\n },\n);\nNavigationMenu.displayName = 'NavigationMenu';\n\n/* -------------------------------------------------------------------- */\n/* List + Item */\n/* -------------------------------------------------------------------- */\n\nconst listClasses = [\n 'ds:group ds:flex ds:flex-1',\n 'ds:list-none ds:items-center ds:justify-center',\n 'ds:gap-[var(--spacing-xs)]',\n 'ds:m-0 ds:ps-0',\n].join(' ');\n\nconst NavigationMenuList = forwardRef<\n ElementRef<typeof RadixNavigationMenu.List>,\n ComponentPropsWithoutRef<typeof RadixNavigationMenu.List>\n>(({ className, ...rest }, ref) => (\n <RadixNavigationMenu.List\n ref={ref}\n className={[listClasses, className].filter(Boolean).join(' ')}\n {...rest}\n />\n));\nNavigationMenuList.displayName = 'NavigationMenuList';\n\nexport interface NavigationMenuItemProps extends ComponentPropsWithoutRef<\n typeof RadixNavigationMenu.Item\n> {\n /**\n * Stable opaque id of this top-level item. When provided, emitted as\n * `data-nav-id` so an agent / UI bridge can target the item. Distinct\n * from Radix's internal `value`, which controls open-state matching;\n * pass the same string to both if you want them aligned.\n */\n navId?: string;\n}\n\nconst NavigationMenuItem = forwardRef<\n ElementRef<typeof RadixNavigationMenu.Item>,\n NavigationMenuItemProps\n>(({ navId, ...rest }, ref) => (\n <RadixNavigationMenu.Item ref={ref} data-nav-id={navId} {...rest} />\n));\nNavigationMenuItem.displayName = 'NavigationMenuItem';\n\n/* -------------------------------------------------------------------- */\n/* Trigger */\n/* -------------------------------------------------------------------- */\n\nconst triggerClasses = [\n 'ds:group ds:inline-flex ds:items-center ds:justify-center',\n 'ds:min-h-[var(--min-target-size)]',\n 'ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-sm)]',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:text-[var(--font-size-sm)] ds:font-[var(--font-weight-medium)]',\n 'ds:text-[var(--foreground)]',\n 'ds:hover:bg-[var(--muted)]/20',\n 'ds:data-[state=open]:bg-[var(--muted)]/20',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:disabled:cursor-not-allowed ds:disabled:opacity-50',\n 'ds:gap-[var(--spacing-xs)]',\n].join(' ');\n\nconst chevronClasses = [\n 'ds:size-3 ds:transition-transform ds:duration-[var(--animation-duration)]',\n 'ds:group-data-[state=open]:rotate-180',\n 'ds:rtl:-scale-x-100 ds:motion-reduce:transition-none',\n].join(' ');\n\nconst NavigationMenuTrigger = forwardRef<\n ElementRef<typeof RadixNavigationMenu.Trigger>,\n ComponentPropsWithoutRef<typeof RadixNavigationMenu.Trigger>\n>(({ className, children, ...rest }, ref) => (\n <RadixNavigationMenu.Trigger\n ref={ref}\n className={[triggerClasses, className].filter(Boolean).join(' ')}\n {...rest}\n >\n {children}\n <ChevronDown aria-hidden=\"true\" className={chevronClasses} />\n </RadixNavigationMenu.Trigger>\n));\nNavigationMenuTrigger.displayName = 'NavigationMenuTrigger';\n\n/* -------------------------------------------------------------------- */\n/* Content */\n/* -------------------------------------------------------------------- */\n\nconst contentBase = [\n 'ds:absolute ds:start-0 ds:top-0 ds:w-full',\n 'ds:md:w-auto',\n 'ds:bg-[var(--background)] ds:text-[var(--foreground)]',\n 'ds:rounded-[var(--radius-md)] ds:border ds:border-[var(--border)]',\n 'ds:shadow-[var(--shadow-lg)]',\n 'ds:p-[var(--spacing-md)]',\n 'ds:data-[motion^=from-]:animate-in ds:data-[motion^=to-]:animate-out',\n // Logical start/end motion mapped onto physical Tailwind animation utilities.\n // The `rtl:` variants mirror the slide direction so `from-start` enters from\n // the inline-start edge in both LTR and RTL.\n 'ds:data-[motion=from-start]:slide-in-from-left-52 ds:rtl:data-[motion=from-start]:slide-in-from-right-52',\n 'ds:data-[motion=from-end]:slide-in-from-right-52 ds:rtl:data-[motion=from-end]:slide-in-from-left-52',\n 'ds:data-[motion=to-start]:slide-out-to-left-52 ds:rtl:data-[motion=to-start]:slide-out-to-right-52',\n 'ds:data-[motion=to-end]:slide-out-to-right-52 ds:rtl:data-[motion=to-end]:slide-out-to-left-52',\n 'ds:motion-reduce:animate-none',\n].join(' ');\n\nconst contentVariants = cva(contentBase, {\n variants: {\n layout: {\n simple: 'ds:min-w-[16rem]',\n mega: 'ds:grid ds:grid-cols-[repeat(auto-fit,minmax(12rem,1fr))] ds:gap-[var(--spacing-md)] ds:min-w-[32rem]',\n },\n },\n defaultVariants: { layout: 'simple' },\n});\n\nexport interface NavigationMenuContentProps\n extends\n ComponentPropsWithoutRef<typeof RadixNavigationMenu.Content>,\n VariantProps<typeof contentVariants> {}\n\nconst NavigationMenuContent = forwardRef<\n ElementRef<typeof RadixNavigationMenu.Content>,\n NavigationMenuContentProps\n>(({ layout, className, ...rest }, ref) => (\n <RadixNavigationMenu.Content\n ref={ref}\n className={contentVariants({ layout, className })}\n {...rest}\n />\n));\nNavigationMenuContent.displayName = 'NavigationMenuContent';\n\n/* -------------------------------------------------------------------- */\n/* Link */\n/* -------------------------------------------------------------------- */\n\nconst linkClasses = [\n 'ds:block ds:rounded-[var(--radius-sm)]',\n 'ds:min-h-[var(--min-target-size)]',\n 'ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)]',\n 'ds:py-[var(--spacing-xs)]',\n 'ds:text-[var(--font-size-sm)] ds:font-[var(--font-weight-medium)]',\n 'ds:text-[var(--foreground)]',\n 'ds:no-underline',\n 'ds:hover:bg-[var(--muted)]/20',\n 'ds:data-[active]:underline ds:data-[active]:underline-offset-[var(--spacing-xs)]',\n 'ds:aria-[current=page]:underline ds:aria-[current=page]:underline-offset-[var(--spacing-xs)]',\n 'ds:aria-[current=page]:font-[var(--font-weight-semibold)]',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n].join(' ');\n\nexport interface NavigationMenuLinkProps extends ComponentPropsWithoutRef<\n typeof RadixNavigationMenu.Link\n> {\n /** Render through Radix Slot so routers can inject their own link element. */\n asChild?: boolean;\n}\n\nconst NavigationMenuLink = forwardRef<\n ElementRef<typeof RadixNavigationMenu.Link>,\n NavigationMenuLinkProps\n>(({ asChild = false, className, children, ...rest }, ref) => (\n <RadixNavigationMenu.Link\n ref={ref}\n asChild={asChild}\n className={\n asChild ? undefined : [linkClasses, className].filter(Boolean).join(' ')\n }\n {...rest}\n >\n {asChild ? (\n <Slot className={[linkClasses, className].filter(Boolean).join(' ')}>\n {children}\n </Slot>\n ) : (\n children\n )}\n </RadixNavigationMenu.Link>\n));\nNavigationMenuLink.displayName = 'NavigationMenuLink';\n\n/* -------------------------------------------------------------------- */\n/* Indicator + Viewport */\n/* -------------------------------------------------------------------- */\n\nconst indicatorClasses = [\n 'ds:top-full ds:z-[1] ds:flex ds:h-2 ds:items-end ds:justify-center ds:overflow-hidden',\n 'ds:data-[state=visible]:animate-in ds:data-[state=hidden]:animate-out',\n 'ds:data-[state=visible]:fade-in ds:data-[state=hidden]:fade-out',\n 'ds:motion-reduce:animate-none',\n].join(' ');\n\nconst NavigationMenuIndicator = forwardRef<\n ElementRef<typeof RadixNavigationMenu.Indicator>,\n ComponentPropsWithoutRef<typeof RadixNavigationMenu.Indicator>\n>(({ className, ...rest }, ref) => (\n <RadixNavigationMenu.Indicator\n ref={ref}\n className={[indicatorClasses, className].filter(Boolean).join(' ')}\n {...rest}\n >\n <span className=\"ds:relative ds:top-[60%] ds:h-2 ds:w-2 ds:rotate-45 ds:rounded-tl-sm ds:bg-[var(--border)]\" />\n </RadixNavigationMenu.Indicator>\n));\nNavigationMenuIndicator.displayName = 'NavigationMenuIndicator';\n\nconst viewportClasses = [\n 'ds:origin-top-center ds:relative ds:mt-[var(--spacing-xs)]',\n 'ds:h-[var(--radix-navigation-menu-viewport-height)]',\n 'ds:w-full ds:overflow-hidden',\n 'ds:rounded-[var(--radius-md)] ds:border ds:border-[var(--border)]',\n 'ds:bg-[var(--background)] ds:text-[var(--foreground)]',\n 'ds:shadow-[var(--shadow-lg)]',\n 'ds:data-[state=open]:animate-in ds:data-[state=closed]:animate-out',\n 'ds:data-[state=open]:zoom-in-90 ds:data-[state=closed]:zoom-out-95',\n 'ds:motion-reduce:animate-none',\n].join(' ');\n\nconst NavigationMenuViewport = forwardRef<\n ElementRef<typeof RadixNavigationMenu.Viewport>,\n ComponentPropsWithoutRef<typeof RadixNavigationMenu.Viewport>\n>(({ className, ...rest }, ref) => (\n <div className=\"ds:absolute ds:start-0 ds:top-full ds:flex ds:justify-center\">\n <RadixNavigationMenu.Viewport\n ref={ref}\n className={[viewportClasses, className].filter(Boolean).join(' ')}\n {...rest}\n />\n </div>\n));\nNavigationMenuViewport.displayName = 'NavigationMenuViewport';\n\n/* -------------------------------------------------------------------- */\n/* Exports */\n/* -------------------------------------------------------------------- */\n\nexport {\n NavigationMenu,\n NavigationMenuList,\n NavigationMenuItem,\n NavigationMenuTrigger,\n NavigationMenuContent,\n NavigationMenuLink,\n NavigationMenuIndicator,\n NavigationMenuViewport,\n SkipLink,\n};\n"],"names":["navigationMenuAgent","handle","args","rootClasses","NavigationMenu","forwardRef","ariaLabel","className","children","id","value","defaultValue","onValueChange","rest","ref","t","useTranslation","rootRef","useRef","dir","useDirection","isControlled","internalValue","setInternalValue","useState","activeValue","handleValueChange","useCallback","next","useMemo","nextId","useImperativeHandle","useAgentRegistration","jsxs","RadixNavigationMenu","NavigationMenuViewport","listClasses","NavigationMenuList","jsx","NavigationMenuItem","navId","triggerClasses","chevronClasses","NavigationMenuTrigger","ChevronDown","contentBase","contentVariants","cva","NavigationMenuContent","layout","linkClasses","NavigationMenuLink","asChild","Slot","indicatorClasses","NavigationMenuIndicator","viewportClasses"],"mappings":";;;;;;;;;AAcO,MAAMA,IAA0D;AAAA,EACrE,IAAI;AAAA,EACJ,cAAc,CAAC,iBAAiB,YAAY,QAAQ,OAAO;AAAA,EAC3D,OAAO;AAAA,IACL,YAAY;AAAA,MACV,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,mBAAmB;AAAA,IAAA;AAAA,IAE9C,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACA,MAAWA,EAAO,UAAA;AAAA,IAAU;AAAA,EACrC;AAAA,EAEF,SAAS;AAAA,IACP,aAAa;AAAA,MACX,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,QAAQ,CAACA,GAAQC,MAAyB;AACxC,QAAAD,EAAO,WAAWC,EAAK,EAAE;AAAA,MAC3B;AAAA,IAAA;AAAA,IAEF,MAAM;AAAA,MACJ,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,gBAAgB;AAAA,MAChB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