@alfadocs/ui-kit-debug 1.42.0 → 1.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{calendar-ChJQzRw-.js → calendar-U6N0F99w.js} +383 -359
- package/dist/_chunks/calendar-U6N0F99w.js.map +1 -0
- package/dist/_chunks/calendar-workspace-DBYAtdyd.js +12161 -0
- package/dist/_chunks/calendar-workspace-DBYAtdyd.js.map +1 -0
- package/dist/_chunks/control-room-rail-Cv7GpMqX.js +354 -0
- package/dist/_chunks/control-room-rail-Cv7GpMqX.js.map +1 -0
- package/dist/_chunks/{face-scheme-Dg6ZyLKb.js → face-scheme-Bm6pe7R8.js} +265 -275
- package/dist/_chunks/face-scheme-Bm6pe7R8.js.map +1 -0
- package/dist/_chunks/help-me-write-templates-GUeEn3Ff.js +741 -0
- package/dist/_chunks/help-me-write-templates-GUeEn3Ff.js.map +1 -0
- package/dist/_chunks/{marketplace-app-shell-D_g9BaDI.js → marketplace-app-shell-DdwPj03y.js} +3 -3
- package/dist/_chunks/{marketplace-app-shell-D_g9BaDI.js.map → marketplace-app-shell-DdwPj03y.js.map} +1 -1
- package/dist/_chunks/{notes-panel-CRAovkjx.js → notes-panel-CY4KmDo-.js} +159 -152
- package/dist/_chunks/notes-panel-CY4KmDo-.js.map +1 -0
- package/dist/_chunks/{panel-subview-PMBRPFOa.js → panel-subview-CYnuX-KR.js} +61 -40
- package/dist/_chunks/panel-subview-CYnuX-KR.js.map +1 -0
- package/dist/_chunks/rich-text-editor-BYE6kK4u.js +3839 -0
- package/dist/_chunks/rich-text-editor-BYE6kK4u.js.map +1 -0
- package/dist/_chunks/{sidebar-ClTY9lLI.js → sidebar-DbZXLl8h.js} +2 -2
- package/dist/_chunks/{sidebar-ClTY9lLI.js.map → sidebar-DbZXLl8h.js.map} +1 -1
- package/dist/_chunks/tab-bar-Cw9UK18Z.js +228 -0
- package/dist/_chunks/tab-bar-Cw9UK18Z.js.map +1 -0
- package/dist/_chunks/{tool-rail-D89USYE6.js → tool-rail-CCFqDfAn.js} +282 -276
- package/dist/_chunks/tool-rail-CCFqDfAn.js.map +1 -0
- package/dist/_chunks/undo-2-CYNAzclj.js +26 -0
- package/dist/_chunks/undo-2-CYNAzclj.js.map +1 -0
- package/dist/_chunks/use-edge-resize-BHesP0kg.js +149 -0
- package/dist/_chunks/use-edge-resize-BHesP0kg.js.map +1 -0
- package/dist/_chunks/use-scroll-overflow-UbLrUfBo.js +72 -0
- package/dist/_chunks/use-scroll-overflow-UbLrUfBo.js.map +1 -0
- package/dist/_chunks/variables-menu-vXUaSBj4.js +401 -0
- package/dist/_chunks/variables-menu-vXUaSBj4.js.map +1 -0
- package/dist/agent-catalog.json +84 -3
- package/dist/agent-i18n/en.json +14 -3
- package/dist/components/calendar/calendar.d.ts +6 -0
- package/dist/components/calendar/calendar.d.ts.map +1 -1
- package/dist/components/calendar/index.js +1 -1
- package/dist/components/control-room-rail/control-room-rail.d.ts +9 -0
- package/dist/components/control-room-rail/control-room-rail.d.ts.map +1 -1
- package/dist/components/control-room-rail/index.js +1 -1
- package/dist/components/face-scheme/index.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/notes-panel/notes-panel.d.ts +4 -0
- package/dist/components/notes-panel/notes-panel.d.ts.map +1 -1
- package/dist/components/panel-subview/index.js +1 -1
- package/dist/components/panel-subview/panel-subview.d.ts +6 -0
- package/dist/components/panel-subview/panel-subview.d.ts.map +1 -1
- package/dist/components/rich-text-editor/editor-toolbar.d.ts +35 -3
- package/dist/components/rich-text-editor/editor-toolbar.d.ts.map +1 -1
- package/dist/components/rich-text-editor/index.d.ts +1 -1
- package/dist/components/rich-text-editor/index.d.ts.map +1 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/rich-text-editor/rich-text-editor.agent.d.ts.map +1 -1
- package/dist/components/rich-text-editor/rich-text-editor.d.ts +98 -15
- package/dist/components/rich-text-editor/rich-text-editor.d.ts.map +1 -1
- package/dist/components/sidebar/index.js +1 -1
- package/dist/components/tab-bar/index.js +1 -1
- package/dist/components/tool-rail/index.js +1 -1
- package/dist/components/tool-rail/tool-rail.d.ts +16 -0
- package/dist/components/tool-rail/tool-rail.d.ts.map +1 -1
- package/dist/components/variables-menu/index.d.ts +4 -0
- package/dist/components/variables-menu/index.d.ts.map +1 -0
- package/dist/components/variables-menu/index.js +6 -0
- package/dist/components/variables-menu/index.js.map +1 -0
- package/dist/components/variables-menu/variables-menu.agent.d.ts +10 -0
- package/dist/components/variables-menu/variables-menu.agent.d.ts.map +1 -0
- package/dist/components/variables-menu/variables-menu.d.ts +53 -0
- package/dist/components/variables-menu/variables-menu.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +35 -32
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/use-edge-resize.d.ts +13 -1
- package/dist/hooks/use-edge-resize.d.ts.map +1 -1
- package/dist/host-compat.css +5 -5
- package/dist/i18n/locales/ar.d.ts +77 -6
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +78 -7
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +77 -6
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +78 -7
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +77 -6
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +78 -7
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +77 -6
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +85 -7
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +77 -6
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +78 -7
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +77 -6
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +78 -7
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +77 -6
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +78 -7
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +77 -6
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +78 -7
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +77 -6
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +78 -7
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +77 -6
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +78 -7
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +77 -6
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +78 -7
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +77 -6
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +78 -7
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +77 -6
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +78 -7
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +77 -6
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +78 -7
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +77 -6
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +78 -7
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +77 -6
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +78 -7
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +77 -6
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +78 -7
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +77 -6
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +78 -7
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +916 -913
- package/dist/index.js.map +1 -1
- package/dist/locales/ar.json +78 -7
- package/dist/locales/de.json +78 -7
- package/dist/locales/el.json +78 -7
- package/dist/locales/en.json +78 -7
- package/dist/locales/es.json +78 -7
- package/dist/locales/fr.json +78 -7
- package/dist/locales/hi.json +78 -7
- package/dist/locales/it.json +78 -7
- package/dist/locales/ja.json +78 -7
- package/dist/locales/nl.json +78 -7
- package/dist/locales/pl.json +78 -7
- package/dist/locales/pt.json +78 -7
- package/dist/locales/ro.json +78 -7
- package/dist/locales/ru.json +78 -7
- package/dist/locales/sq.json +78 -7
- package/dist/locales/sv.json +78 -7
- package/dist/locales/tr.json +78 -7
- package/dist/locales/zh.json +78 -7
- package/dist/patterns/calendar/calendar-bookings-panel.d.ts +8 -3
- package/dist/patterns/calendar/calendar-bookings-panel.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar-care-rules.d.ts +49 -0
- package/dist/patterns/calendar/calendar-care-rules.d.ts.map +1 -0
- package/dist/patterns/calendar/calendar-task-editor.d.ts +31 -0
- package/dist/patterns/calendar/calendar-task-editor.d.ts.map +1 -0
- package/dist/patterns/calendar/calendar-waiting-list-panel.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar-workspace.d.ts +8 -1
- package/dist/patterns/calendar/calendar-workspace.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar-workspace.model.d.ts +39 -12
- package/dist/patterns/calendar/calendar-workspace.model.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.data.d.ts +9 -0
- package/dist/patterns/calendar/calendar.data.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.journey.d.ts +35 -3
- package/dist/patterns/calendar/calendar.journey.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.model.d.ts +23 -1
- package/dist/patterns/calendar/calendar.model.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.sheets.d.ts +21 -3
- package/dist/patterns/calendar/calendar.sheets.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.surface.d.ts +6 -1
- package/dist/patterns/calendar/calendar.surface.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.types.d.ts +32 -1
- package/dist/patterns/calendar/calendar.types.d.ts.map +1 -1
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/patterns/help-me-write-templates/help-me-write-templates.d.ts +58 -26
- package/dist/patterns/help-me-write-templates/help-me-write-templates.d.ts.map +1 -1
- package/dist/patterns/help-me-write-templates/index.d.ts +1 -1
- package/dist/patterns/help-me-write-templates/index.d.ts.map +1 -1
- package/dist/patterns/help-me-write-templates/index.js +1 -1
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/tokens.css +6 -6
- package/package.json +5 -1
- package/dist/_chunks/calendar-ChJQzRw-.js.map +0 -1
- package/dist/_chunks/calendar-workspace-qlxrxCqm.js +0 -11392
- package/dist/_chunks/calendar-workspace-qlxrxCqm.js.map +0 -1
- package/dist/_chunks/control-room-rail-CnNZusR5.js +0 -337
- package/dist/_chunks/control-room-rail-CnNZusR5.js.map +0 -1
- package/dist/_chunks/face-scheme-Dg6ZyLKb.js.map +0 -1
- package/dist/_chunks/help-me-write-templates-B-m7zgJa.js +0 -775
- package/dist/_chunks/help-me-write-templates-B-m7zgJa.js.map +0 -1
- package/dist/_chunks/highlighter-DSkckT2Q.js +0 -15
- package/dist/_chunks/highlighter-DSkckT2Q.js.map +0 -1
- package/dist/_chunks/notes-panel-CRAovkjx.js.map +0 -1
- package/dist/_chunks/panel-subview-PMBRPFOa.js.map +0 -1
- package/dist/_chunks/rich-text-editor-DUMeifwc.js +0 -3176
- package/dist/_chunks/rich-text-editor-DUMeifwc.js.map +0 -1
- package/dist/_chunks/tab-bar-rDkLiaA6.js +0 -268
- package/dist/_chunks/tab-bar-rDkLiaA6.js.map +0 -1
- package/dist/_chunks/tool-rail-D89USYE6.js.map +0 -1
- package/dist/_chunks/use-edge-resize-ZnGG7gyO.js +0 -139
- package/dist/_chunks/use-edge-resize-ZnGG7gyO.js.map +0 -1
- package/dist/_chunks/use-overflow-collapse-BIOzKbni.js +0 -32
- package/dist/_chunks/use-overflow-collapse-BIOzKbni.js.map +0 -1
- package/dist/_chunks/wand-sparkles-DAjKyhz7.js +0 -27
- package/dist/_chunks/wand-sparkles-DAjKyhz7.js.map +0 -1
|
@@ -1,268 +0,0 @@
|
|
|
1
|
-
import { jsx as a, jsxs as v, Fragment as S } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as V, useState as F, useCallback as O, forwardRef as D, Fragment as M } from "react";
|
|
3
|
-
import { c as C } from "./index-D2ZczOXr.js";
|
|
4
|
-
import { useTranslation as L } from "react-i18next";
|
|
5
|
-
import { B as W } from "./badge-BudgzTe_.js";
|
|
6
|
-
import { D as b } from "./dropdown-menu-DU-Hrf33.js";
|
|
7
|
-
import { u as P } from "./use-media-query-CcAx5SMM.js";
|
|
8
|
-
import { u as I } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
|
|
9
|
-
import { u as Q } from "./use-overflow-collapse-BIOzKbni.js";
|
|
10
|
-
import { C as q } from "./chevron-down-DWE7GSq9.js";
|
|
11
|
-
import { C as G } from "./check-DrFSN__t.js";
|
|
12
|
-
import { C as H } from "./chevron-left-B8cOyH-V.js";
|
|
13
|
-
import { C as J } from "./chevron-right-I9AeSxH2.js";
|
|
14
|
-
function K(d = !0) {
|
|
15
|
-
const c = V(null), [u, o] = F({ start: !1, end: !1 });
|
|
16
|
-
I(() => {
|
|
17
|
-
const r = c.current;
|
|
18
|
-
if (!r || !d) {
|
|
19
|
-
o(
|
|
20
|
-
(t) => t.start || t.end ? { start: !1, end: !1 } : t
|
|
21
|
-
);
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
const e = () => {
|
|
25
|
-
const t = Math.abs(r.scrollLeft), f = r.scrollWidth - r.clientWidth, i = t > 1, m = f - t > 1;
|
|
26
|
-
o(
|
|
27
|
-
(p) => p.start === i && p.end === m ? p : { start: i, end: m }
|
|
28
|
-
);
|
|
29
|
-
};
|
|
30
|
-
e(), r.addEventListener("scroll", e, { passive: !0 });
|
|
31
|
-
let n;
|
|
32
|
-
return typeof ResizeObserver < "u" && (n = new ResizeObserver(e), n.observe(r), r.firstElementChild && n.observe(r.firstElementChild)), () => {
|
|
33
|
-
r.removeEventListener("scroll", e), n == null || n.disconnect();
|
|
34
|
-
};
|
|
35
|
-
}, [d]);
|
|
36
|
-
const g = O((r) => {
|
|
37
|
-
var i;
|
|
38
|
-
const e = c.current;
|
|
39
|
-
if (!e || typeof window > "u") return;
|
|
40
|
-
const n = window.getComputedStyle(e).direction === "rtl", t = (i = window.matchMedia) == null ? void 0 : i.call(
|
|
41
|
-
window,
|
|
42
|
-
"(prefers-reduced-motion: reduce)"
|
|
43
|
-
).matches, f = e.clientWidth * 0.85 * r * (n ? -1 : 1);
|
|
44
|
-
e.scrollBy({ left: f, behavior: t ? "auto" : "smooth" });
|
|
45
|
-
}, []);
|
|
46
|
-
return {
|
|
47
|
-
ref: c,
|
|
48
|
-
canScrollStart: u.start,
|
|
49
|
-
canScrollEnd: u.end,
|
|
50
|
-
scrollByPage: g
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
function U(d) {
|
|
54
|
-
return d > 99 ? "99+" : String(d);
|
|
55
|
-
}
|
|
56
|
-
const X = C("ds:shrink-0", {
|
|
57
|
-
variants: {
|
|
58
|
-
position: {
|
|
59
|
-
top: "ds:pt-[var(--spacing-md)]",
|
|
60
|
-
bottom: "ds:pb-[var(--spacing-md)]"
|
|
61
|
-
},
|
|
62
|
-
fill: {
|
|
63
|
-
false: "ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]",
|
|
64
|
-
true: ""
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
defaultVariants: { position: "top", fill: !1 }
|
|
68
|
-
}), Y = "ds:rounded-[var(--radius-lg)] ds:border ds:border-[color:var(--card-border)] ds:bg-[var(--card)]/80 ds:backdrop-blur-md ds:shadow-[var(--shadow-md)]", Z = [
|
|
69
|
-
"ds:flex ds:[justify-content:safe_center] ds:overflow-x-auto ds:py-[var(--spacing-xs)]",
|
|
70
|
-
"ds:[--tabbar-mask-start:black] ds:[--tabbar-mask-end:black]",
|
|
71
|
-
"ds:ltr:data-[fade-start=true]:[--tabbar-mask-start:transparent]",
|
|
72
|
-
"ds:ltr:data-[fade-end=true]:[--tabbar-mask-end:transparent]",
|
|
73
|
-
"ds:rtl:data-[fade-start=true]:[--tabbar-mask-end:transparent]",
|
|
74
|
-
"ds:rtl:data-[fade-end=true]:[--tabbar-mask-start:transparent]",
|
|
75
|
-
"ds:[mask-image:linear-gradient(to_right,var(--tabbar-mask-start)_0,black_var(--tabbar-fade-distance,var(--spacing-lg)),black_calc(100%-var(--tabbar-fade-distance,var(--spacing-lg))),var(--tabbar-mask-end)_100%)]",
|
|
76
|
-
"ds:motion-reduce:[mask-image:none]",
|
|
77
|
-
"ds:[.theme-accessible_&]:[mask-image:none]",
|
|
78
|
-
"ds:forced-colors:[mask-image:none]"
|
|
79
|
-
].join(" "), ss = C(
|
|
80
|
-
"ds:flex ds:items-stretch ds:gap-[var(--spacing-xs)] ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]",
|
|
81
|
-
{
|
|
82
|
-
variants: {
|
|
83
|
-
fill: { false: "ds:shrink-0", true: "ds:w-full" }
|
|
84
|
-
},
|
|
85
|
-
defaultVariants: { fill: !1 }
|
|
86
|
-
}
|
|
87
|
-
), R = C(
|
|
88
|
-
"ds:group ds:flex ds:items-center ds:justify-center ds:gap-[var(--spacing-xs)] ds:min-h-[var(--min-target-size)] ds:rounded-[var(--radius-sm)] ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:py-[var(--spacing-xs)] ds:whitespace-nowrap ds:cursor-pointer ds:appearance-none ds:border-0 ds:bg-transparent ds:text-[length:var(--font-size-sm)] ds:font-[var(--font-weight-regular)] ds:text-[color:var(--foreground)] ds:no-underline ds:hover:bg-[var(--muted)]/20 ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)] ds:forced-colors:focus-visible:outline-[CanvasText]",
|
|
89
|
-
{
|
|
90
|
-
variants: {
|
|
91
|
-
fill: {
|
|
92
|
-
// Responsive: label under the icon below `sm`, beside it at `sm`+.
|
|
93
|
-
false: "ds:flex-col ds:sm:flex-row ds:sm:gap-[var(--spacing-sm)]",
|
|
94
|
-
// Fill the bar, always icon-over-label. No `min-w-0`, so a tab never
|
|
95
|
-
// shrinks below its label (labels never overlap); if the full set can't
|
|
96
|
-
// fit, the pill scrolls instead.
|
|
97
|
-
true: "ds:flex-1 ds:basis-0 ds:flex-col"
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
defaultVariants: { fill: !1 }
|
|
101
|
-
}
|
|
102
|
-
), E = "ds:inline-flex ds:items-center ds:text-[color:var(--accent)] ds:[&>svg]:size-4", as = "ds:group-aria-[current=page]:underline ds:group-aria-[current=page]:decoration-2 ds:group-aria-[current=page]:decoration-[color:var(--accent)] ds:group-aria-[current=page]:underline-offset-[var(--spacing-xs)]", rs = "ds:flex ds:w-full ds:items-center ds:gap-[var(--spacing-sm)] ds:min-h-[var(--min-target-size)] ds:rounded-[var(--radius-sm)] ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:py-[var(--spacing-xs)] ds:cursor-pointer ds:appearance-none ds:border-0 ds:bg-transparent ds:text-[length:var(--font-size-sm)] ds:font-[var(--font-weight-regular)] ds:text-[color:var(--foreground)] ds:hover:bg-[var(--muted)]/20 ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)] ds:forced-colors:focus-visible:outline-[CanvasText]", T = "ds:absolute ds:top-px ds:bottom-px ds:z-10 ds:flex ds:min-w-[var(--min-target-size)] ds:items-center ds:cursor-pointer ds:appearance-none ds:border-0 ds:bg-transparent ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)] ds:forced-colors:focus-visible:outline-[CanvasText]", es = "ds:start-px ds:justify-start ds:ps-[var(--spacing-xs)]", ns = "ds:end-px ds:justify-end ds:pe-[var(--spacing-xs)]", $ = "ds:size-4 ds:shrink-0 ds:text-[color:var(--accent)] ds:rtl:-scale-x-100", ts = D(
|
|
103
|
-
({
|
|
104
|
-
items: d,
|
|
105
|
-
id: c,
|
|
106
|
-
ariaLabel: u,
|
|
107
|
-
onSelect: o,
|
|
108
|
-
renderLink: g,
|
|
109
|
-
fill: r = !1,
|
|
110
|
-
position: e = "top",
|
|
111
|
-
collapseToMenu: n = !1,
|
|
112
|
-
className: t
|
|
113
|
-
}, f) => {
|
|
114
|
-
const { t: i } = L(), m = P("(max-width: 640px)"), { containerRef: p, contentRef: j, isOverflowing: A } = Q(n), w = n && (m || A), {
|
|
115
|
-
ref: _,
|
|
116
|
-
canScrollStart: k,
|
|
117
|
-
canScrollEnd: N,
|
|
118
|
-
scrollByPage: y
|
|
119
|
-
} = K(!w), l = d.find((s) => s.isActive) ?? d[0];
|
|
120
|
-
return /* @__PURE__ */ a(
|
|
121
|
-
"div",
|
|
122
|
-
{
|
|
123
|
-
ref: f,
|
|
124
|
-
"data-component": "tab-bar",
|
|
125
|
-
"data-component-id": c,
|
|
126
|
-
className: `${X({ position: e, fill: r })}${t ? ` ${t}` : ""}`,
|
|
127
|
-
children: /* @__PURE__ */ v("div", { className: "ds:relative", children: [
|
|
128
|
-
/* @__PURE__ */ a("div", { ref: p, className: Y, children: w ? /* @__PURE__ */ a("nav", { "aria-label": u, className: "ds:w-full", children: /* @__PURE__ */ v(b.Root, { children: [
|
|
129
|
-
/* @__PURE__ */ v(b.Trigger, { className: rs, children: [
|
|
130
|
-
l != null && l.icon ? /* @__PURE__ */ a("span", { "aria-hidden": "true", className: E, children: l.icon }) : null,
|
|
131
|
-
/* @__PURE__ */ a("span", { className: "ds:flex-1 ds:truncate ds:text-start", children: l == null ? void 0 : l.label }),
|
|
132
|
-
/* @__PURE__ */ a(
|
|
133
|
-
q,
|
|
134
|
-
{
|
|
135
|
-
"aria-hidden": "true",
|
|
136
|
-
className: "ds:size-4 ds:shrink-0 ds:text-[color:var(--muted-foreground)]"
|
|
137
|
-
}
|
|
138
|
-
)
|
|
139
|
-
] }),
|
|
140
|
-
/* @__PURE__ */ a(
|
|
141
|
-
b.Content,
|
|
142
|
-
{
|
|
143
|
-
align: "start",
|
|
144
|
-
className: "ds:min-w-[12rem]",
|
|
145
|
-
children: d.map((s) => /* @__PURE__ */ a(
|
|
146
|
-
b.Item,
|
|
147
|
-
{
|
|
148
|
-
"data-tab-id": s.id,
|
|
149
|
-
startIcon: s.icon,
|
|
150
|
-
endIcon: s.isActive ? /* @__PURE__ */ a(
|
|
151
|
-
G,
|
|
152
|
-
{
|
|
153
|
-
"aria-hidden": "true",
|
|
154
|
-
className: "ds:text-[color:var(--accent)]"
|
|
155
|
-
}
|
|
156
|
-
) : void 0,
|
|
157
|
-
"aria-current": s.isActive ? "page" : void 0,
|
|
158
|
-
onSelect: () => {
|
|
159
|
-
s.href ? window.location.assign(s.href) : o == null || o(s.id);
|
|
160
|
-
},
|
|
161
|
-
children: s.label
|
|
162
|
-
},
|
|
163
|
-
s.id
|
|
164
|
-
))
|
|
165
|
-
}
|
|
166
|
-
)
|
|
167
|
-
] }) }) : /* @__PURE__ */ a(
|
|
168
|
-
"div",
|
|
169
|
-
{
|
|
170
|
-
ref: _,
|
|
171
|
-
"data-fade-start": k ? "true" : void 0,
|
|
172
|
-
"data-fade-end": N ? "true" : void 0,
|
|
173
|
-
className: Z,
|
|
174
|
-
children: /* @__PURE__ */ a(
|
|
175
|
-
"nav",
|
|
176
|
-
{
|
|
177
|
-
ref: j,
|
|
178
|
-
"aria-label": u,
|
|
179
|
-
className: ss({ fill: r }),
|
|
180
|
-
children: d.map((s) => {
|
|
181
|
-
const z = typeof s.badgeCount == "number" && s.badgeCount > 0 ? s.badgeCount : void 0, h = s.isActive ? "page" : void 0, x = /* @__PURE__ */ v(S, { children: [
|
|
182
|
-
s.icon ? /* @__PURE__ */ a("span", { "aria-hidden": "true", className: E, children: s.icon }) : null,
|
|
183
|
-
/* @__PURE__ */ v("span", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
|
|
184
|
-
/* @__PURE__ */ a("span", { className: as, children: s.label }),
|
|
185
|
-
z !== void 0 ? /* @__PURE__ */ a(W, { variant: "neutral", children: U(z) }) : null
|
|
186
|
-
] })
|
|
187
|
-
] });
|
|
188
|
-
if (s.href !== void 0) {
|
|
189
|
-
const B = R({ fill: r });
|
|
190
|
-
return g ? /* @__PURE__ */ a(M, { children: g({
|
|
191
|
-
href: s.href,
|
|
192
|
-
className: B,
|
|
193
|
-
children: x,
|
|
194
|
-
"aria-current": h,
|
|
195
|
-
"data-tab-id": s.id,
|
|
196
|
-
onClick: s.onClick
|
|
197
|
-
}) }, s.id) : /* @__PURE__ */ a(
|
|
198
|
-
"a",
|
|
199
|
-
{
|
|
200
|
-
href: s.href,
|
|
201
|
-
"data-tab-id": s.id,
|
|
202
|
-
"aria-current": h,
|
|
203
|
-
className: B,
|
|
204
|
-
...s.onClick ? { onClick: s.onClick } : {},
|
|
205
|
-
children: x
|
|
206
|
-
},
|
|
207
|
-
s.id
|
|
208
|
-
);
|
|
209
|
-
}
|
|
210
|
-
return /* @__PURE__ */ a(
|
|
211
|
-
"button",
|
|
212
|
-
{
|
|
213
|
-
type: "button",
|
|
214
|
-
"data-tab-id": s.id,
|
|
215
|
-
"aria-current": h,
|
|
216
|
-
className: R({ fill: r }),
|
|
217
|
-
onClick: () => o == null ? void 0 : o(s.id),
|
|
218
|
-
children: x
|
|
219
|
-
},
|
|
220
|
-
s.id
|
|
221
|
-
);
|
|
222
|
-
})
|
|
223
|
-
}
|
|
224
|
-
)
|
|
225
|
-
}
|
|
226
|
-
) }),
|
|
227
|
-
k ? /* @__PURE__ */ a(
|
|
228
|
-
"button",
|
|
229
|
-
{
|
|
230
|
-
type: "button",
|
|
231
|
-
"aria-label": i("navigation.tabBar.scrollBack"),
|
|
232
|
-
onClick: () => y(-1),
|
|
233
|
-
className: `${T} ${es}`,
|
|
234
|
-
children: /* @__PURE__ */ a(
|
|
235
|
-
H,
|
|
236
|
-
{
|
|
237
|
-
"aria-hidden": "true",
|
|
238
|
-
className: $
|
|
239
|
-
}
|
|
240
|
-
)
|
|
241
|
-
}
|
|
242
|
-
) : null,
|
|
243
|
-
N ? /* @__PURE__ */ a(
|
|
244
|
-
"button",
|
|
245
|
-
{
|
|
246
|
-
type: "button",
|
|
247
|
-
"aria-label": i("navigation.tabBar.scrollForward"),
|
|
248
|
-
onClick: () => y(1),
|
|
249
|
-
className: `${T} ${ns}`,
|
|
250
|
-
children: /* @__PURE__ */ a(
|
|
251
|
-
J,
|
|
252
|
-
{
|
|
253
|
-
"aria-hidden": "true",
|
|
254
|
-
className: $
|
|
255
|
-
}
|
|
256
|
-
)
|
|
257
|
-
}
|
|
258
|
-
) : null
|
|
259
|
-
] })
|
|
260
|
-
}
|
|
261
|
-
);
|
|
262
|
-
}
|
|
263
|
-
);
|
|
264
|
-
ts.displayName = "TabBar";
|
|
265
|
-
export {
|
|
266
|
-
ts as T
|
|
267
|
-
};
|
|
268
|
-
//# sourceMappingURL=tab-bar-rDkLiaA6.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tab-bar-rDkLiaA6.js","sources":["../../src/hooks/use-scroll-overflow.ts","../../src/components/tab-bar/tab-bar.tsx"],"sourcesContent":["import { useCallback, useRef, useState, type RefObject } from 'react';\nimport { useIsomorphicLayoutEffect } from './use-isomorphic-layout-effect';\n\nexport interface UseScrollOverflowReturn<T extends HTMLElement> {\n /** Attach to the horizontally-scrollable element (the `overflow-x-auto` box). */\n ref: RefObject<T | null>;\n /** Content is hidden past the inline-START edge (scrolled away from the start). */\n canScrollStart: boolean;\n /** Content is hidden past the inline-END edge (more to reveal toward the end). */\n canScrollEnd: boolean;\n /**\n * Scroll by ~one viewport toward the inline start (`-1`) or end (`+1`),\n * smoothly unless the user prefers reduced motion. Direction-agnostic: works\n * in both LTR and RTL.\n */\n scrollByPage: (direction: -1 | 1) => void;\n}\n\n/**\n * Reports whether a horizontally-scrollable element has hidden content at its\n * inline-start / inline-end edges, and exposes a paged scroll action — the\n * plumbing behind a scroll strip's edge affordances (fade + chevron buttons).\n *\n * Direction-agnostic: distance-from-start is read as `Math.abs(scrollLeft)`,\n * which is correct in both LTR (`0…max`) and modern RTL (`0…-max`), so the two\n * edges are reported on the right logical side without branching. `scrollByPage`\n * flips its physical sign from the element's computed `direction`.\n *\n * Re-measures on element resize AND on content-size change (a tab added past the\n * fold widens the content without changing the container) by observing both the\n * scroll box and its first child. `enabled` switches measurement off — e.g. when\n * the host collapses the strip into a menu and there is nothing to scroll.\n *\n * Because the scrolled content stays in the DOM and is reachable by keyboard\n * (focus scrolls it into view), the affordance this drives is a sighted-pointer\n * convenience; assistive tech is unaffected.\n */\nexport function useScrollOverflow<T extends HTMLElement>(\n enabled = true,\n): UseScrollOverflowReturn<T> {\n const ref = useRef<T>(null);\n const [edges, setEdges] = useState({ start: false, end: false });\n\n useIsomorphicLayoutEffect(() => {\n const el = ref.current;\n if (!el || !enabled) {\n setEdges((prev) =>\n prev.start || prev.end ? { start: false, end: false } : prev,\n );\n return;\n }\n const measure = () => {\n // Math.abs() makes this direction-agnostic: modern RTL reports scrollLeft\n // as 0 at the start and negative toward the end, so |scrollLeft| is the\n // distance scrolled from the start in both writing directions.\n const distanceFromStart = Math.abs(el.scrollLeft);\n const maxScroll = el.scrollWidth - el.clientWidth;\n // +1 tolerates sub-pixel rounding between scroll/client widths.\n const start = distanceFromStart > 1;\n const end = maxScroll - distanceFromStart > 1;\n // Bail to the same reference when nothing changed, so neither the initial\n // no-overflow measure nor an idle scroll event triggers a re-render.\n setEdges((prev) =>\n prev.start === start && prev.end === end ? prev : { start, end },\n );\n };\n measure();\n el.addEventListener('scroll', measure, { passive: true });\n let observer: ResizeObserver | undefined;\n if (typeof ResizeObserver !== 'undefined') {\n observer = new ResizeObserver(measure);\n // The container catches viewport-width changes; its first child (the\n // content row) catches a tab added/removed past the fold, which grows the\n // scroll width without resizing the container.\n observer.observe(el);\n if (el.firstElementChild) observer.observe(el.firstElementChild);\n }\n return () => {\n el.removeEventListener('scroll', measure);\n observer?.disconnect();\n };\n }, [enabled]);\n\n const scrollByPage = useCallback((direction: -1 | 1) => {\n const el = ref.current;\n if (!el || typeof window === 'undefined') return;\n const isRtl = window.getComputedStyle(el).direction === 'rtl';\n const reduceMotion = window.matchMedia?.(\n '(prefers-reduced-motion: reduce)',\n ).matches;\n // ~85% of the viewport so a sliver of context carries across pages. The\n // physical sign flips in RTL (scrollLeft runs toward negative).\n const amount = el.clientWidth * 0.85 * direction * (isRtl ? -1 : 1);\n el.scrollBy({ left: amount, behavior: reduceMotion ? 'auto' : 'smooth' });\n }, []);\n\n return {\n ref,\n canScrollStart: edges.start,\n canScrollEnd: edges.end,\n scrollByPage,\n };\n}\n","/**\n * TabBar — a floating-pill bar of page-level navigation tabs.\n *\n * Each tab is an icon + label (+ optional count badge); the active tab is\n * marked with `aria-current=\"page\"` and an `--accent` underline. The bar is a\n * glassy `--card` pill that floats on whatever canvas the consumer provides\n * (the strip area itself is transparent, so it blends with the surrounding\n * surface).\n *\n * Two layouts:\n * - default (`fill` off): content-width tabs that **centre** when they fit and\n * scroll from the inline-start (`safe center`) when they overflow, with a\n * gutter preserved at both ends. The label stacks under the icon below `sm`.\n * Use this when the tab set is open-ended (e.g. a marketplace app's routes).\n * - `fill`: equal-width tabs that fill the bar and always stack the label under\n * the icon — a fixed, always-visible set that fits any column width without\n * scrolling (e.g. a patient portal's handful of sections).\n *\n * Tabs render as links when given an `href` (real navigation) or as buttons\n * otherwise (in-app view switching via `onSelect`). Use it as a header (top,\n * default) for section navigation; `position=\"bottom\"` floats it from the\n * bottom edge for a footer.\n *\n * With `collapseToMenu`, the strip folds into a single DropdownMenu whenever the\n * tabs don't fit — below the `sm` breakpoint OR when they overflow their\n * container at any width (a narrow column on a wide screen, e.g. a page squeezed\n * between two sidebars, clips the tabs just the same as a small viewport).\n *\n * SPA / consumer-router links: pass `renderLink` and TabBar hands each `href`\n * tab off to your router's `<Link>` instead of rendering its own `<a>` — the\n * embedded MarketplaceAppShell strip uses this so a tab click is a client-side\n * route change, not a full page navigation. The kit forwards the same\n * `className` + `aria-current` so the accent-underline active styling and the\n * `aria-current=\"page\"` marker survive in both modes. With `renderLink`\n * omitted the output is the plain `<a href>` exactly as before.\n */\nimport { forwardRef, Fragment, type MouseEvent, type ReactNode } from 'react';\nimport { cva } from 'class-variance-authority';\nimport { Check, ChevronDown, ChevronLeft, ChevronRight } from 'lucide-react';\nimport { useTranslation } from 'react-i18next';\n\nimport { Badge } from '../badge';\nimport { DropdownMenu } from '../dropdown-menu';\nimport { useMediaQuery } from '../../hooks/use-media-query';\nimport { useScrollOverflow } from '../../hooks/use-scroll-overflow';\nimport { useOverflowCollapse } from '../../hooks/use-overflow-collapse';\n\nexport interface TabBarItem {\n /** Stable id; also the value handed to `onSelect` for button tabs. */\n id: string;\n /** Pre-translated label — consumers localise their own nav copy. */\n label: string;\n /** Optional leading icon (a lucide-react element or equivalent), tinted with `--accent`. */\n icon?: ReactNode;\n /** Optional unseen-item count rendered as a pill badge. */\n badgeCount?: number;\n /** Mark the tab as the current page (`aria-current='page'` + accent underline). */\n isActive?: boolean;\n /** When set, the tab renders as a link to this href; otherwise it's a button. */\n href?: string;\n /**\n * Optional click handler threaded onto the link tab's `<a>` (or, when\n * `renderLink` is supplied, available to the consumer's router element). Use\n * it to intercept a same-origin click and route client-side without a full\n * navigation. Only applies to `href` (link) tabs — button tabs use `onSelect`.\n */\n onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;\n}\n\n/**\n * Props the kit hands to `renderLink` for each `href` tab. The consumer returns\n * their router's `<Link to={href}>` carrying the same `className` (the active\n * accent-underline styling) and `aria-current` (`'page'` on the active tab).\n */\nexport interface TabBarRenderLinkProps {\n /** The tab's destination — feed it to your router's `to` / `href`. */\n href: string;\n /** The kit's tab classes (CVA output) — apply verbatim to the link element. */\n className: string;\n /** Icon + label + badge — render as the link's children. */\n children: ReactNode;\n /** `'page'` on the active tab, otherwise omitted — forward to the link. */\n 'aria-current'?: 'page';\n /**\n * The tab's stable `TabBarItem.id`, as the agent / automation DOM hook.\n * Spread it onto your router link (`{...rest}`) so the tab stays addressable\n * by `[data-tab-id]` the same way the kit's own `<a>` / `<button>` tabs are —\n * see PRS §26 §6.\n */\n 'data-tab-id'?: string;\n /** Optional per-item click handler (the item's `onClick`), if supplied. */\n onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;\n}\n\nexport interface TabBarProps {\n /** The tabs, in order. */\n items: TabBarItem[];\n /**\n * Opaque instance id, emitted on the strip as `data-component-id`. Pass it\n * when more than one TabBar can be on screen so an agent / automation tool\n * can scope its `[data-tab-id]` lookup to one bar (PRS §26 §6).\n */\n id?: string;\n /** Accessible name for the `<nav>` landmark. */\n ariaLabel: string;\n /** Fires with the tab `id` when a button tab (one without `href`) is chosen. */\n onSelect?: (id: string) => void;\n /**\n * Render an `href` tab via the consumer's router instead of the kit's own\n * `<a>`. TabBar calls it for each link tab and renders the returned node; the\n * consumer returns their `<Link to={href}>` carrying the supplied `className`\n * + `aria-current` so the active accent underline and the `aria-current=\"page\"`\n * marker are preserved. Use it for SPA navigation (e.g. the MarketplaceAppShell\n * strip) so a tab click is a client-side route change, not a full page load.\n * Omit it to render the plain `<a href>` exactly as before. Button tabs (no\n * `href`) ignore `renderLink` and continue to use `onSelect`.\n */\n renderLink?: (props: TabBarRenderLinkProps) => ReactNode;\n /**\n * Equal-width tabs that fill the bar and always stack the label under the\n * icon (for a fixed, always-visible set). Off (default) = content-width tabs\n * that centre when they fit and scroll when they overflow.\n */\n fill?: boolean;\n /**\n * Float side. `'top'` (default) gutters from the top edge for a header;\n * `'bottom'` gutters from the bottom edge for a footer.\n */\n position?: 'top' | 'bottom';\n /**\n * Collapse the tab strip into a single DropdownMenu whenever the tabs don't\n * fit — below the `sm` breakpoint (≤640px) OR when they overflow their\n * container at any viewport width (a narrow column between two sidebars clips\n * the tabs the same as a small screen). The trigger shows the active tab; the\n * menu lists them all. Off (default) keeps the content-width / scroll\n * behaviour at every width, so existing consumers are unaffected. Designed for\n * button (`onSelect`) tabs; in the collapsed menu an `href` tab navigates with\n * a full page load, so `renderLink` (SPA routing) and a per-item `onClick`\n * apply only to the expanded strip.\n */\n collapseToMenu?: boolean;\n /** Extra classes merged onto the outer strip (e.g. sticky/fixed positioning). */\n className?: string;\n}\n\nfunction formatBadgeCount(count: number): string {\n return count > 99 ? '99+' : String(count);\n}\n\n/* Transparent strip area — provides the floating gutter on the active side. The\n default layout also insets the pill horizontally so it reads as a floating\n strip; `fill` drops that inset so the pill spans the full width and aligns\n with the consumer's content (e.g. a portal's cards). */\nconst stripVariants = cva('ds:shrink-0', {\n variants: {\n position: {\n top: 'ds:pt-[var(--spacing-md)]',\n bottom: 'ds:pb-[var(--spacing-md)]',\n },\n fill: {\n false: 'ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]',\n true: '',\n },\n },\n defaultVariants: { position: 'top', fill: false },\n});\n\n/* The pill is the glass chrome — the bordered, blurred, rounded surface. The\n scrollable tab row is a separate inner element (`pillScrollClasses`) so the\n edge-fade mask touches only the tabs, never the pill's border. It is also the\n overflow-collapse MEASUREMENT container: it stays mounted in both the scroll\n and the dropdown render, and (carrying no padding) its `clientWidth` is\n exactly the width the tab row has to fit. */\nconst pillClasses =\n 'ds:rounded-[var(--radius-lg)] ds:border ds:border-[color:var(--card-border)] ds:bg-[var(--card)]/80 ds:backdrop-blur-md ds:shadow-[var(--shadow-md)]';\n\n/* The inner scroll container. `safe center` centres the tabs when they fit but\n falls back to start-alignment the moment they overflow, so the row stays fully\n scrollable end to end. Inline-edge MASK: the leading / trailing edge fades only\n when tabs are hidden past it (`data-fade-start` / `data-fade-end`), so a clipped\n tab dissolves into the glass under the accent chevron — alpha-based, so no seam\n with the translucent pill. Logical via `--tabbar-mask-*` (RTL-mapped); `black`\n is the mask-opaque sentinel, not a colour. Disabled under reduced motion, the\n accessible theme, and forced-colors so content is never hidden from those\n users. `--tabbar-fade-distance` (default `--spacing-lg`) is per-instance. */\nconst pillScrollClasses = [\n 'ds:flex ds:[justify-content:safe_center] ds:overflow-x-auto ds:py-[var(--spacing-xs)]',\n 'ds:[--tabbar-mask-start:black] ds:[--tabbar-mask-end:black]',\n 'ds:ltr:data-[fade-start=true]:[--tabbar-mask-start:transparent]',\n 'ds:ltr:data-[fade-end=true]:[--tabbar-mask-end:transparent]',\n 'ds:rtl:data-[fade-start=true]:[--tabbar-mask-end:transparent]',\n 'ds:rtl:data-[fade-end=true]:[--tabbar-mask-start:transparent]',\n 'ds:[mask-image:linear-gradient(to_right,var(--tabbar-mask-start)_0,black_var(--tabbar-fade-distance,var(--spacing-lg)),black_calc(100%-var(--tabbar-fade-distance,var(--spacing-lg))),var(--tabbar-mask-end)_100%)]',\n 'ds:motion-reduce:[mask-image:none]',\n 'ds:[.theme-accessible_&]:[mask-image:none]',\n 'ds:forced-colors:[mask-image:none]',\n].join(' ');\n\n/* The nav's inline padding is the start/end gutter — it scrolls WITH the tabs,\n so the gutter survives a full scroll. Content width (`shrink-0`) by default so\n it overflows and scrolls; `w-full` in fill mode so the tabs spread to fit. */\nconst navVariants = cva(\n 'ds:flex ds:items-stretch ds:gap-[var(--spacing-xs)] ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]',\n {\n variants: {\n fill: { false: 'ds:shrink-0', true: 'ds:w-full' },\n },\n defaultVariants: { fill: false },\n },\n);\n\n/* Each tab is a centred flex box so the icon + label sit centred on both axes.\n Regular weight; the active state is carried by the accent underline + accent\n icon, not a heavier weight. */\nconst tabVariants = cva(\n 'ds:group ds:flex ds:items-center ds:justify-center ds:gap-[var(--spacing-xs)] ds:min-h-[var(--min-target-size)] ds:rounded-[var(--radius-sm)] ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:py-[var(--spacing-xs)] ds:whitespace-nowrap ds:cursor-pointer ds:appearance-none ds:border-0 ds:bg-transparent ds:text-[length:var(--font-size-sm)] ds:font-[var(--font-weight-regular)] ds:text-[color:var(--foreground)] ds:no-underline ds:hover:bg-[var(--muted)]/20 ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)] ds:forced-colors:focus-visible:outline-[CanvasText]',\n {\n variants: {\n fill: {\n // Responsive: label under the icon below `sm`, beside it at `sm`+.\n false: 'ds:flex-col ds:sm:flex-row ds:sm:gap-[var(--spacing-sm)]',\n // Fill the bar, always icon-over-label. No `min-w-0`, so a tab never\n // shrinks below its label (labels never overlap); if the full set can't\n // fit, the pill scrolls instead.\n true: 'ds:flex-1 ds:basis-0 ds:flex-col',\n },\n },\n defaultVariants: { fill: false },\n },\n);\n\nconst iconClasses =\n 'ds:inline-flex ds:items-center ds:text-[color:var(--accent)] ds:[&>svg]:size-4';\n\n/* The accent underline rides the label text itself (not the whole tab), so it\n never reaches the icon or badge and never has to propagate through flex. */\nconst labelClasses =\n 'ds:group-aria-[current=page]:underline ds:group-aria-[current=page]:decoration-2 ds:group-aria-[current=page]:decoration-[color:var(--accent)] ds:group-aria-[current=page]:underline-offset-[var(--spacing-xs)]';\n\n/* The mobile collapse trigger — a full-width button styled like a tab, showing\n the active tab's icon + label with a trailing chevron. */\nconst menuTriggerClasses =\n 'ds:flex ds:w-full ds:items-center ds:gap-[var(--spacing-sm)] ds:min-h-[var(--min-target-size)] ds:rounded-[var(--radius-sm)] ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:py-[var(--spacing-xs)] ds:cursor-pointer ds:appearance-none ds:border-0 ds:bg-transparent ds:text-[length:var(--font-size-sm)] ds:font-[var(--font-weight-regular)] ds:text-[color:var(--foreground)] ds:hover:bg-[var(--muted)]/20 ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)] ds:forced-colors:focus-visible:outline-[CanvasText]';\n\n/* Scroll affordance — an accent chevron pinned to a scrollable edge of the pill,\n shown only when there are tabs hidden past that edge. No button chrome: the\n edge tab fades into the glass via the inner scroll's mask (above); the chevron\n just points the way and pages the strip on click. A `--min-target-size` hit\n area keeps it tappable. Block axis spans the pill (`top`/`bottom` px-inset past\n the border); the inline edge (`start`/`end`) and the chevron flip mirror RTL. */\nconst scrollAffordanceClasses =\n 'ds:absolute ds:top-px ds:bottom-px ds:z-10 ds:flex ds:min-w-[var(--min-target-size)] ds:items-center ds:cursor-pointer ds:appearance-none ds:border-0 ds:bg-transparent ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)] ds:forced-colors:focus-visible:outline-[CanvasText]';\n\n/* Pin the chevron to its inline edge, over the faded tab. */\nconst scrollAffordanceStartClasses =\n 'ds:start-px ds:justify-start ds:ps-[var(--spacing-xs)]';\n\nconst scrollAffordanceEndClasses =\n 'ds:end-px ds:justify-end ds:pe-[var(--spacing-xs)]';\n\n/* The chevron is the only visible mark — accent-tinted (matching the tab icons),\n mirrored under RTL. Decorative (`aria-hidden`); the button carries the label. */\nconst scrollChevronClasses =\n 'ds:size-4 ds:shrink-0 ds:text-[color:var(--accent)] ds:rtl:-scale-x-100';\n\nexport const TabBar = forwardRef<HTMLDivElement, TabBarProps>(\n (\n {\n items,\n id,\n ariaLabel,\n onSelect,\n renderLink,\n fill = false,\n position = 'top',\n collapseToMenu = false,\n className,\n },\n ref,\n ) => {\n const { t } = useTranslation();\n\n // Collapse is twofold, OR'd: the documented mobile floor (≤sm) AND actual\n // container overflow (a narrow column on a wide screen clips the tabs just\n // the same). Both hooks run every render (hook order); only consulted when\n // collapseToMenu is on. The pill (containerRef) stays mounted across the\n // collapse so the overflow hook can still tell when the column has grown\n // back; the tab row (contentRef) carries the natural width.\n const isNarrow = useMediaQuery('(max-width: 640px)');\n const { containerRef, contentRef, isOverflowing } = useOverflowCollapse<\n HTMLDivElement,\n HTMLElement\n >(collapseToMenu);\n const isDropdown = collapseToMenu && (isNarrow || isOverflowing);\n\n // Edge scroll affordances for the scroll layout. Disabled in dropdown mode\n // (no scroll box), so the observer tears down / re-attaches across the flip.\n const {\n ref: pillRef,\n canScrollStart,\n canScrollEnd,\n scrollByPage,\n } = useScrollOverflow<HTMLDivElement>(!isDropdown);\n\n const activeItem = items.find((item) => item.isActive) ?? items[0];\n\n return (\n <div\n ref={ref}\n data-component=\"tab-bar\"\n data-component-id={id}\n className={`${stripVariants({ position, fill })}${className ? ` ${className}` : ''}`}\n >\n {/* Relative wrapper: the scroll affordances are absolutely positioned\n against it, NOT inside the scroll box (absolute children of a scroller\n scroll away with the content). */}\n <div className=\"ds:relative\">\n {/* The pill doubles as the overflow-collapse measurement container —\n rendered in BOTH branches (same element, same width) so the hook\n can keep measuring after the tab row is swapped for the menu. */}\n <div ref={containerRef} className={pillClasses}>\n {isDropdown ? (\n <nav aria-label={ariaLabel} className=\"ds:w-full\">\n <DropdownMenu.Root>\n <DropdownMenu.Trigger className={menuTriggerClasses}>\n {activeItem?.icon ? (\n <span aria-hidden=\"true\" className={iconClasses}>\n {activeItem.icon}\n </span>\n ) : null}\n <span className=\"ds:flex-1 ds:truncate ds:text-start\">\n {activeItem?.label}\n </span>\n <ChevronDown\n aria-hidden=\"true\"\n className=\"ds:size-4 ds:shrink-0 ds:text-[color:var(--muted-foreground)]\"\n />\n </DropdownMenu.Trigger>\n <DropdownMenu.Content\n align=\"start\"\n className=\"ds:min-w-[12rem]\"\n >\n {items.map((item) => (\n <DropdownMenu.Item\n key={item.id}\n data-tab-id={item.id}\n startIcon={item.icon}\n endIcon={\n item.isActive ? (\n <Check\n aria-hidden=\"true\"\n className=\"ds:text-[color:var(--accent)]\"\n />\n ) : undefined\n }\n aria-current={item.isActive ? 'page' : undefined}\n onSelect={() => {\n if (item.href) {\n window.location.assign(item.href);\n } else {\n onSelect?.(item.id);\n }\n }}\n >\n {item.label}\n </DropdownMenu.Item>\n ))}\n </DropdownMenu.Content>\n </DropdownMenu.Root>\n </nav>\n ) : (\n <div\n ref={pillRef}\n data-fade-start={canScrollStart ? 'true' : undefined}\n data-fade-end={canScrollEnd ? 'true' : undefined}\n className={pillScrollClasses}\n >\n <nav\n ref={contentRef}\n aria-label={ariaLabel}\n className={navVariants({ fill })}\n >\n {items.map((item) => {\n const badge =\n typeof item.badgeCount === 'number' && item.badgeCount > 0\n ? item.badgeCount\n : undefined;\n const ariaCurrent = item.isActive ? 'page' : undefined;\n const inner = (\n <>\n {item.icon ? (\n <span aria-hidden=\"true\" className={iconClasses}>\n {item.icon}\n </span>\n ) : null}\n {/* Label + badge stay paired; they sit under the icon when\n the tab stacks to a column. */}\n <span className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n <span className={labelClasses}>{item.label}</span>\n {badge !== undefined ? (\n <Badge variant=\"neutral\">\n {formatBadgeCount(badge)}\n </Badge>\n ) : null}\n </span>\n </>\n );\n if (item.href !== undefined) {\n const tabClassName = tabVariants({ fill });\n // Consumer-router mode: hand the tab to the consumer's <Link>,\n // forwarding the same className + aria-current (+ the item's\n // onClick) so the active styling and `aria-current=\"page\"`\n // marker carry over and clicking routes client-side.\n if (renderLink) {\n return (\n <Fragment key={item.id}>\n {renderLink({\n href: item.href,\n className: tabClassName,\n children: inner,\n 'aria-current': ariaCurrent,\n 'data-tab-id': item.id,\n onClick: item.onClick,\n })}\n </Fragment>\n );\n }\n // Default: plain anchor — byte-identical to before when no\n // per-item onClick is supplied (onClick is omitted entirely,\n // not passed as undefined, so the rendered <a> is unchanged).\n return (\n <a\n key={item.id}\n href={item.href}\n data-tab-id={item.id}\n aria-current={ariaCurrent}\n className={tabClassName}\n {...(item.onClick ? { onClick: item.onClick } : {})}\n >\n {inner}\n </a>\n );\n }\n return (\n <button\n key={item.id}\n type=\"button\"\n data-tab-id={item.id}\n aria-current={ariaCurrent}\n className={tabVariants({ fill })}\n onClick={() => onSelect?.(item.id)}\n >\n {inner}\n </button>\n );\n })}\n </nav>\n </div>\n )}\n </div>\n {canScrollStart ? (\n <button\n type=\"button\"\n aria-label={t('navigation.tabBar.scrollBack')}\n onClick={() => scrollByPage(-1)}\n className={`${scrollAffordanceClasses} ${scrollAffordanceStartClasses}`}\n >\n <ChevronLeft\n aria-hidden=\"true\"\n className={scrollChevronClasses}\n />\n </button>\n ) : null}\n {canScrollEnd ? (\n <button\n type=\"button\"\n aria-label={t('navigation.tabBar.scrollForward')}\n onClick={() => scrollByPage(1)}\n className={`${scrollAffordanceClasses} ${scrollAffordanceEndClasses}`}\n >\n <ChevronRight\n aria-hidden=\"true\"\n className={scrollChevronClasses}\n />\n </button>\n ) : null}\n </div>\n </div>\n );\n },\n);\nTabBar.displayName = 'TabBar';\n"],"names":["useScrollOverflow","enabled","ref","useRef","edges","setEdges","useState","useIsomorphicLayoutEffect","el","prev","measure","distanceFromStart","maxScroll","start","end","observer","scrollByPage","useCallback","direction","isRtl","reduceMotion","_a","amount","formatBadgeCount","count","stripVariants","cva","pillClasses","pillScrollClasses","navVariants","tabVariants","iconClasses","labelClasses","menuTriggerClasses","scrollAffordanceClasses","scrollAffordanceStartClasses","scrollAffordanceEndClasses","scrollChevronClasses","TabBar","forwardRef","items","id","ariaLabel","onSelect","renderLink","fill","position","collapseToMenu","className","t","useTranslation","isNarrow","useMediaQuery","containerRef","contentRef","isOverflowing","useOverflowCollapse","isDropdown","pillRef","canScrollStart","canScrollEnd","activeItem","item","jsx","jsxs","DropdownMenu","ChevronDown","Check","badge","ariaCurrent","inner","Fragment","Badge","tabClassName","ChevronLeft","ChevronRight"],"mappings":";;;;;;;;;;;;;AAqCO,SAASA,EACdC,IAAU,IACkB;AAC5B,QAAMC,IAAMC,EAAU,IAAI,GACpB,CAACC,GAAOC,CAAQ,IAAIC,EAAS,EAAE,OAAO,IAAO,KAAK,IAAO;AAE/D,EAAAC,EAA0B,MAAM;AAC9B,UAAMC,IAAKN,EAAI;AACf,QAAI,CAACM,KAAM,CAACP,GAAS;AACnB,MAAAI;AAAA,QAAS,CAACI,MACRA,EAAK,SAASA,EAAK,MAAM,EAAE,OAAO,IAAO,KAAK,OAAUA;AAAA,MAAA;AAE1D;AAAA,IACF;AACA,UAAMC,IAAU,MAAM;AAIpB,YAAMC,IAAoB,KAAK,IAAIH,EAAG,UAAU,GAC1CI,IAAYJ,EAAG,cAAcA,EAAG,aAEhCK,IAAQF,IAAoB,GAC5BG,IAAMF,IAAYD,IAAoB;AAG5C,MAAAN;AAAA,QAAS,CAACI,MACRA,EAAK,U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AWrC;AAAA,gBAAA;AAAA,cAAA;AAAA,YACb;AAAA,UAAA,IAEA;AAAA,UACHuB,IACC,gBAAAG;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,cAAYd,EAAE,iCAAiC;AAAA,cAC/C,SAAS,MAAMjC,EAAa,CAAC;AAAA,cAC7B,WAAW,GAAGkB,CAAuB,IAAIE,EAA0B;AAAA,cAEnE,UAAA,gBAAA2B;AAAA,gBAACY;AAAA,gBAAA;AAAA,kBACC,eAAY;AAAA,kBACZ,WAAWtC;AAAA,gBAAA;AAAA,cAAA;AAAA,YACb;AAAA,UAAA,IAEA;AAAA,QAAA,EAAA,CACN;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AACAC,GAAO,cAAc;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tool-rail-D89USYE6.js","sources":["../../src/components/tool-rail/tool-rail.agent.ts","../../src/components/tool-rail/tool-rail.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — ToolRail. */\n/* */\n/* Rail-level surface: open / close a tool's panel and read which tool */\n/* is active. State is strictly the active tool id — never any tool's */\n/* panel CONTENT (which may carry PHI). Tool ids + badge counts are */\n/* supplied by the host via props, not derived from panel bodies. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { ToolRailHandle } from './tool-rail';\n\nexport const toolRailAgent: AgentAdapter<ToolRailHandle> = {\n id: 'tool-rail',\n capabilities: ['open', 'close', 'select_single'],\n state: {\n activeToolId: {\n type: 'string | null',\n descriptionKey: 'ui.toolRail.agent.state.activeToolId',\n description:\n 'Id of the tool whose panel is currently open, or null when the rail is collapsed to its strip. No panel content is ever exposed.',\n read: (handle) => handle.getActiveToolId(),\n },\n },\n actions: {\n open: {\n // Pure ephemeral panel state (open) — no data loss, no external effect.\n safety: 'read',\n argsType: '{ id: string }',\n argsSchema: {\n type: 'object',\n properties: { id: { type: 'string' } },\n required: ['id'],\n },\n idempotent: true,\n // descriptionKey shape is intentionally pre-existing — already resolves to\n // real multi-locale translations; do not canonicalise.\n descriptionKey: 'ui.toolRail.agent.actions.open',\n description: \"Open the given tool's panel.\",\n examples: [{ args: { id: 'inbox' }, note: 'Open the inbox tool panel.' }],\n invoke: (handle, args: { id: string }) => {\n handle.open(args.id);\n },\n },\n close: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.toolRail.agent.actions.close',\n description: 'Collapse the rail to its strip (no active tool).',\n invoke: (handle) => {\n handle.close();\n },\n },\n select_tool: {\n safety: 'read',\n argsType: '{ id: string | null }',\n argsSchema: {\n type: 'object',\n properties: { id: { type: ['string', 'null'] } },\n required: ['id'],\n },\n idempotent: true,\n descriptionKey: 'ui.toolRail.agent.actions.selectTool',\n description:\n 'Set the active tool by id (opens its panel), or pass null to collapse.',\n invoke: (handle, args: { id: string | null }) => {\n handle.setActiveTool(args.id);\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'tool-rail',\n description: 'Marks the ToolRail wrapper.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description:\n 'Sourced from the id prop. Required to address a specific rail from the agent.',\n },\n item: {\n attr: 'data-tool-id',\n description:\n 'Stable tool id emitted on each strip IconButton. The active icon also carries data-active set to its id.',\n },\n },\n};\n","import {\n forwardRef,\n Fragment,\n useCallback,\n useEffect,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type KeyboardEvent as ReactKeyboardEvent,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { IconButton } from '../button/icon-button';\nimport { ScrollArea } from '../scroll-area/scroll-area';\nimport { TooltipProvider } from '../tooltip/tooltip';\nimport { useControllableState } from '../../hooks/use-controllable-state';\nimport { useEdgeResize } from '../../hooks/use-edge-resize';\nimport { useIsomorphicLayoutEffect } from '../../hooks/use-isomorphic-layout-effect';\nimport { REFLOW_ROW_CLASS, useListReflow } from '../../hooks/use-list-reflow';\nimport { useExitTransition } from '../../hooks/use-exit-transition';\nimport { usePrefersReducedMotion } from '../../hooks/use-prefers-reduced-motion';\nimport { usePresenceTransition } from '../../hooks/use-presence-transition';\nimport { useTheme } from '../../hooks/use-theme';\nimport { useAgentRegistration } from '../../agent/registry';\nimport type { AgentAdapter } from '../../agent/types';\nimport { toolRailAgent } from './tool-rail.agent';\n\n/* ------------------------------------------------------------------ */\n/* Tokenised widths */\n/* */\n/* Fixed + tokenised so the rail stays constraint-compliant — no */\n/* prop-driven inline styles. Bare `[inline-size:…]` is NOT a */\n/* recognised utility under the `ds:` prefix; it must carry the */\n/* prefix or Tailwind emits no rule. Consumers needing a different */\n/* size wrap the rail and override via CSS. */\n/* ------------------------------------------------------------------ */\nconst RAIL_WIDTH = 'ds:[inline-size:3rem]';\n// Panel width rides a consumer-overridable custom property (set\n// `--tool-rail-panel-inline-size` on the rail or a wrapper) so\n// content-heavy tools (e.g. an inbox feed) can widen their panel\n// without inline styles. Defaults to the 22rem tray-family width.\n// `--ai-tools-rail-panel-inline-size` is the deprecated alias var read\n// here as a fallback so external consumers that set the pre-rename name\n// keep working for one release; the resize hook only ever writes the new\n// `--tool-rail-panel-inline-size`.\nconst PANEL_WIDTH =\n 'ds:[inline-size:var(--tool-rail-panel-inline-size,var(--ai-tools-rail-panel-inline-size,22rem))]';\n// The custom property PANEL_WIDTH reads. The resize hook writes the\n// committed px width here (on the panel element, so it beats consumer\n// class overrides on the root) and removes it on reset.\nconst PANEL_SIZE_PROPERTY = '--tool-rail-panel-inline-size';\n// Resize clamp + nominal default, px (352px = the 22rem token default).\n// The ceiling is 880 so a form panel can reach a three-column layout:\n// pairing fields is the only way to shorten a long form without\n// shrinking a 44px target, and that needs real inline size.\nconst PANEL_MIN_SIZE = 288;\nconst PANEL_MAX_SIZE = 880;\nconst PANEL_DEFAULT_SIZE = 352;\n\n/* ------------------------------------------------------------------ */\n/* Public types */\n/* ------------------------------------------------------------------ */\n\nexport interface ToolRailTool {\n /** Stable tool id — used in `data-active`, the imperative handle, and\n * to label the open panel region. */\n id: string;\n /** Accessible name for the strip icon + tooltip, and the open panel's\n * region label. Never rendered as visible body text. */\n label: string;\n /** lucide-react glyph (rendered `aria-hidden` inside the IconButton). */\n icon: ReactNode;\n /** Panel body for this tool. Rendered inline-start of the strip when\n * `side='end'` (mirrored for `'start'`). The consumer composes it. */\n panel: ReactNode;\n /**\n * Optional non-scrolling header for this tool's panel. Rendered pinned at\n * the top of the open panel — above the scroll region — so a tool's title /\n * filters stay visible as the body scrolls. This is the rail-level home for\n * a sticky tool header; every tool gets it for free.\n */\n header?: ReactNode;\n /**\n * When true the panel body is NOT wrapped in the rail's `ScrollArea` — the\n * tool fills the (height-bounded) panel and owns its own scroll/layout.\n * Use for self-scrolling tools (e.g. `AppointmentTimeline`, whose infinite\n * scroll + today-anchoring + edge fades require it to be the scroll\n * container). Default `false` (the rail scrolls the body).\n */\n fill?: boolean;\n /** Optional unseen / notification count shown on the strip icon. */\n badgeCount?: number;\n /** When true the icon is non-interactive and skipped by roving focus. */\n disabled?: boolean;\n /**\n * Scope tier (drives the two-group divider). The two scope values render in\n * array order with a divider at the boundary between them — order the array\n * so the groups stay contiguous. A divider only appears when BOTH groups are\n * present; omit `scope` on every tool for an ungrouped strip (legacy). The\n * rail attaches no meaning beyond grouping — the host decides which value\n * leads (e.g. the Control Room pins favourites first).\n */\n scope?: 'global' | 'contextual';\n /**\n * When true this icon joins the drag-and-drop / `Alt`+Arrow reorder run.\n * The host supplies `onReorder` and owns the resulting order. Moves are\n * confined to the contiguous run of `reorderable` tools — so if EVERY tool\n * is `reorderable` the run is the whole strip and a tool can be dragged\n * across the scope divider; the host's `onReorder` decides what crossing it\n * means (e.g. the Control Room reads it as pin / unpin). Reordering never\n * changes focus roving — focus follows the moved tool to its new slot.\n */\n reorderable?: boolean;\n}\n\n/**\n * Curated imperative handle for ToolRail. Exposed as the forwardRef\n * target so a future agent / MCP UI bridge can drive the rail without\n * touching the DOM. See `tool-rail.agent.ts`.\n *\n * State surfaced here is strictly identifiers + counts — never any\n * tool's panel content (which may carry PHI).\n */\nexport interface ToolRailHandle {\n /** Currently-active tool id, or null when collapsed to strip-only. */\n getActiveToolId: () => string | null;\n /** Activate a tool by id (opens its panel), or null to collapse. */\n setActiveTool: (id: string | null) => void;\n /** Activate a tool by id (opens its panel). */\n open: (id: string) => void;\n /** Collapse to strip-only (no active tool). */\n close: () => void;\n}\n\n/* ------------------------------------------------------------------ */\n/* CVA — `side` drives the dock edge + which shadow faces main content */\n/* ------------------------------------------------------------------ */\n\nconst railVariants = cva(\n ['ds:flex ds:shrink-0 ds:h-full', 'ds:bg-[var(--background)]'].join(' '),\n {\n variants: {\n side: {\n // Strip docks inline-end; the panel mounts inline-start of it\n // (flex-row, panel rendered first). Shadow faces the main area —\n // no border against main (the rail stays line-free; the only seam\n // is the strip↔panel divider on the open panel, see render).\n // Accessible (AAA) theme swaps the soft chrome shadow for a solid 1px\n // border on the content-facing edge (border-s for end-docked).\n end: 'ds:flex-row ds:shadow-[var(--shadow-chrome-start)] ds:[.theme-accessible_&]:border-s ds:[.theme-accessible_&]:border-[var(--border)] ds:[.theme-accessible_&]:shadow-none',\n // Strip docks inline-start; the panel mounts inline-end of it.\n start:\n 'ds:flex-row-reverse ds:shadow-[var(--shadow-chrome-end)] ds:[.theme-accessible_&]:border-e ds:[.theme-accessible_&]:border-[var(--border)] ds:[.theme-accessible_&]:shadow-none',\n },\n },\n defaultVariants: { side: 'end' },\n },\n);\n\nconst stripVariants = cva(\n [\n 'ds:flex ds:shrink-0 ds:flex-col ds:items-center',\n 'ds:pt-[var(--spacing-md)] ds:pb-[var(--spacing-md)]',\n 'ds:gap-[var(--spacing-xs)]',\n RAIL_WIDTH,\n ].join(' '),\n);\n\nconst panelVariants = cva(\n [\n 'ds:relative ds:flex ds:min-h-0 ds:flex-col ds:h-full',\n 'ds:bg-[var(--background)]',\n PANEL_WIDTH,\n // Open / collapse: the panel fades and slides from the strip. The WIDTH\n // snaps on purpose — animating it would re-lay-out the main area (a\n // calendar grid) on every frame. Declared at rest so both directions\n // have a value to move from.\n 'ds:transition-[opacity,translate] ds:duration-[var(--animation-duration)]',\n 'ds:ease-[var(--ease-out)] ds:motion-reduce:transition-none',\n 'ds:data-[presence=entering]:opacity-0 ds:data-[presence=leaving]:opacity-0',\n 'ds:data-[presence=leaving]:pointer-events-none',\n 'ds:data-[resizing]:transition-none',\n ].join(' '),\n {\n variants: {\n // Slide toward the strip the panel belongs to, mirrored in RTL.\n side: {\n end: 'ds:data-[presence=entering]:translate-x-[var(--spacing-md)] ds:data-[presence=leaving]:translate-x-[var(--spacing-md)] ds:rtl:data-[presence=entering]:-translate-x-[var(--spacing-md)] ds:rtl:data-[presence=leaving]:-translate-x-[var(--spacing-md)]',\n start:\n 'ds:data-[presence=entering]:-translate-x-[var(--spacing-md)] ds:data-[presence=leaving]:-translate-x-[var(--spacing-md)] ds:rtl:data-[presence=entering]:translate-x-[var(--spacing-md)] ds:rtl:data-[presence=leaving]:translate-x-[var(--spacing-md)]',\n },\n },\n defaultVariants: { side: 'end' },\n },\n);\n\n/* The box the tool bodies share: a swap stacks two of them here, so the panel\n keeps one height. `clip`, not `hidden`: the swap's short slide must not\n make this a scroll container that a focus call could scroll sideways. */\nconst panelBodiesClass =\n 'ds:relative ds:flex ds:min-h-0 ds:flex-1 ds:flex-col ds:overflow-clip';\n\n/* Tool-to-tool swap is a short directional push: the new body fades in from\n the inline end over a picture of the old one, which fades out toward the\n inline start. One --animation-duration; the picture's animations are stilled. */\nconst panelBodyVariants = cva(\n [\n 'ds:flex ds:min-h-0 ds:flex-col',\n 'ds:transition-[opacity,translate] ds:duration-[var(--animation-duration)]',\n 'ds:ease-[var(--ease-out)] ds:motion-reduce:transition-none',\n 'ds:data-[presence=entering]:opacity-0 ds:data-[presence=leaving]:opacity-0',\n ].join(' '),\n {\n variants: {\n // Same small distance as the panel's own entrance, mirrored in RTL.\n layer: {\n live: [\n 'ds:relative ds:z-[1] ds:flex-1',\n 'ds:data-[presence=entering]:translate-x-[var(--spacing-md)]',\n 'ds:rtl:data-[presence=entering]:-translate-x-[var(--spacing-md)]',\n ].join(' '),\n leaving: [\n 'ds:pointer-events-none ds:absolute ds:inset-0 ds:z-0 ds:[&_*]:!animate-none',\n 'ds:data-[presence=leaving]:-translate-x-[var(--spacing-md)]',\n 'ds:rtl:data-[presence=leaving]:translate-x-[var(--spacing-md)]',\n ].join(' '),\n },\n },\n defaultVariants: { layer: 'live' },\n },\n);\n\n/** Longest a picture waits for its `transitionend` before it is dropped. */\nconst LEAVING_BODY_FALLBACK_MS = 500;\n\n/** A picture of a body on its way out of a swap. `exitId` is unique per swap. */\ninterface LeavingBody {\n exitId: string;\n toolId: string;\n /** Detached, sanitised clones of the old body's children. */\n nodes: Node[];\n /** Scroll offsets to restore once the clones are in the document. */\n scrolls: Array<[Element, number, number]>;\n}\n\n/* Attributes that would make a clone answer for the real thing: ids, form\n group names, kit markers and test handles. */\nconst CLONE_STRIPPED_ATTRIBUTES = [\n 'id',\n 'name',\n 'for',\n 'data-component',\n 'data-component-id',\n 'data-testid',\n];\n\n/** Whether the element's resolved transition lasts any time at all. */\nfunction hasTransition(node: HTMLElement): boolean {\n return window\n .getComputedStyle(node)\n .transitionDuration.split(',')\n .some((part) => Number.parseFloat(part) > 0);\n}\n\n/**\n * A picture of a tool body: deep clones of its children with nothing live in\n * them. The old body itself unmounts at once, exactly as it did before the\n * crossfade, so its effects, guards and pending work never outlive the swap.\n */\nfunction snapshotBody(\n body: HTMLElement,\n): Pick<LeavingBody, 'nodes' | 'scrolls'> {\n const holder = body.cloneNode(true) as HTMLElement;\n const originals = body.querySelectorAll('*');\n const clones = holder.querySelectorAll('*');\n const scrolls: LeavingBody['scrolls'] = [];\n originals.forEach((original, index) => {\n const clone = clones[index];\n if (!clone) return;\n if (original.scrollTop !== 0 || original.scrollLeft !== 0) {\n scrolls.push([clone, original.scrollTop, original.scrollLeft]);\n }\n if (\n original instanceof HTMLCanvasElement &&\n clone instanceof HTMLCanvasElement\n ) {\n try {\n clone.getContext('2d')?.drawImage(original, 0, 0);\n } catch {\n // A canvas that cannot be read back simply fades out blank.\n }\n }\n });\n clones.forEach((clone) => {\n // An svg keeps its ids: gradients and clips are wired by `url(#id)`.\n const inSvg = clone instanceof SVGElement;\n for (const name of CLONE_STRIPPED_ATTRIBUTES) {\n if (!(inSvg && name === 'id')) clone.removeAttribute(name);\n }\n // Nothing in a picture may load, play or run.\n if (clone.matches('iframe, video, audio, embed, object, source')) {\n for (const name of ['src', 'srcdoc', 'data', 'autoplay']) {\n clone.removeAttribute(name);\n }\n }\n });\n return { nodes: Array.from(holder.childNodes), scrolls };\n}\n\n// Resize handle on the panel's inner edge — mirrors Resizable's Handle\n// (::before hit area to --min-target-size, hover/focus/drag accent, token\n// focus ring) but absolutely positioned over the panel edge. Like the\n// Sidebar's handle it stays TRANSPARENT at rest: the rail root's\n// `shadow-chrome-*` (which faces the main content) carries the resting seam,\n// exactly as the start-docked Sidebar leans on its own shadow — so the rail\n// never shows the constant coloured bar it used to. The strip only tints\n// accent on hover / focus / drag.\nconst panelResizeHandleVariants = cva(\n [\n 'ds:absolute ds:[inset-block:0] ds:z-[1] ds:select-none ds:touch-none',\n 'ds:[inline-size:var(--resizable-handle-size)] ds:cursor-col-resize',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:hover:bg-[var(--accent)] ds:focus-visible:bg-[var(--accent)] ds:data-[resizing]:bg-[var(--accent)]',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:forced-colors:focus-visible:outline-[CanvasText]',\n \"ds:before:absolute ds:before:content-['']\",\n 'ds:before:[block-size:100%]',\n 'ds:before:[inline-size:var(--min-target-size)]',\n 'ds:before:[inset-block:0]',\n 'ds:before:[inset-inline:calc(0px_-_(var(--min-target-size)_-_var(--resizable-handle-size))_/_2)]',\n ],\n {\n variants: {\n edge: {\n 'inline-start': 'ds:start-0',\n 'inline-end': 'ds:end-0',\n },\n },\n defaultVariants: { edge: 'inline-start' },\n },\n);\n\n// Hand-rolled overlay count chip — mirrors the AliaSidebar / MessageTray\n// badge markup. A <Badge> would re-introduce its own landmark/role; the\n// strip icon already carries the count in its accessible name, so this\n// span is purely decorative (`aria-hidden`).\nconst badgeVariants = cva(\n [\n 'ds:absolute ds:-top-[var(--spacing-xs)] ds:-end-[var(--spacing-xs)]',\n 'ds:inline-flex ds:items-center ds:justify-center',\n 'ds:min-w-[calc(var(--spacing-md)+var(--spacing-xs))]',\n 'ds:h-[calc(var(--spacing-md)+var(--spacing-xs))]',\n 'ds:ps-[calc(var(--spacing-xs)/1.5)] ds:pe-[calc(var(--spacing-xs)/1.5)]',\n 'ds:rounded-[var(--radius-full)]',\n 'ds:bg-[color:var(--destructive)] ds:text-[color:var(--destructive-foreground)]',\n 'ds:text-[length:var(--font-size-xs)] ds:font-semibold ds:leading-none',\n 'ds:pointer-events-none ds:select-none',\n 'ds:forced-colors:outline ds:forced-colors:outline-1 ds:forced-colors:outline-[CanvasText]',\n ].join(' '),\n);\n\n// Per-icon slot — the positioned box that hosts the IconButton, its badge and\n// the optional affordance overlay. CVA carries the drag states: the dragged\n// icon dims; a hovered drop target shows a dashed accent ring (logical offset),\n// mirroring the Sidebar's favourite-row affordance.\nconst toolSlotVariants = cva(\n // `group/rail-tool` lets an affordance overlay (e.g. a pin star) reveal on\n // hover / focus-within of the whole slot.\n ['ds:group/rail-tool ds:relative', 'ds:rounded-[var(--radius-sm)]'],\n {\n variants: {\n dragging: { true: 'ds:opacity-60', false: '' },\n dropTarget: {\n true: 'ds:outline-[length:var(--focus-ring-width)] ds:outline-dashed ds:outline-[var(--accent)] ds:outline-offset-[length:var(--focus-ring-offset)]',\n false: '',\n },\n reorderable: {\n true: 'ds:cursor-grab ds:active:cursor-grabbing',\n false: '',\n },\n },\n defaultVariants: {\n dragging: false,\n dropTarget: false,\n reorderable: false,\n },\n },\n);\n\n/* A departing tool slot fades in place; the reflow hook then slides the\n surviving icons to close the gap. Declared at rest so the transition\n has a value to animate from the moment the leaving class lands. */\nconst toolLeavingClass = 'ds:opacity-0';\nconst toolElevationClass = [\n 'ds:transition-opacity ds:duration-[var(--animation-duration)]',\n 'ds:ease-[var(--ease-out)] ds:motion-reduce:transition-none',\n].join(' ');\n\n/* ------------------------------------------------------------------ */\n/* Props */\n/* ------------------------------------------------------------------ */\n\nexport interface ToolRailProps extends VariantProps<typeof railVariants> {\n /** Stable instance id, surfaced on the root as `data-component-id`. */\n id?: string;\n /** The tools shown as icons on the strip. */\n tools: ToolRailTool[];\n /** Controlled active tool id (null = collapsed / strip-only). */\n activeToolId?: string | null;\n /** Uncontrolled initial active tool id (default null). */\n defaultActiveToolId?: string | null;\n /** Fires whenever the active tool changes (incl. → null on collapse). */\n onActiveToolChange?: (id: string | null) => void;\n /** Which edge the rail docks to. Default `'end'` (inline-end). */\n side?: 'start' | 'end';\n /** Accessible label for the toolbar strip. */\n railLabel?: string;\n /**\n * Opt-in resize affordance for the open tool panel. Renders a\n * `role=\"separator\"` drag handle on the panel's inner edge (the edge\n * facing the main content). The committed width is written to\n * `--tool-rail-panel-inline-size` on the panel element (288–880px);\n * Enter / double-click resets to the token-driven default. Default `false`.\n */\n resizablePanel?: boolean;\n /**\n * Fires when the user reorders the `reorderable` run (drag-drop or\n * `Alt`+Arrow). `from` / `to` are indices into `tools`; the host applies the\n * move to the array it passes back. Reordering is enabled when this callback\n * is supplied AND at least one tool is `reorderable`. When the whole strip is\n * reorderable, `to` may land in the other scope group — the host interprets\n * the crossing (and may treat it as a no-op, e.g. reordering within a\n * host-ordered group).\n */\n onReorder?: (from: number, to: number) => void;\n /**\n * Optional override for the polite live-region message announced after a\n * reorder. Lets the host phrase membership-aware moves (e.g. \"Pinned X to\n * favourites\") instead of the generic \"moved to position N\". Return an empty\n * string to stay silent (e.g. for a move the host treats as a no-op). When\n * omitted, the rail announces the generic run-relative position.\n */\n formatReorderAnnouncement?: (args: {\n tool: ToolRailTool;\n from: number;\n to: number;\n }) => string;\n /**\n * Optional per-icon overlay control, rendered as a sibling of each strip\n * IconButton (the same positioned box the notification badge uses). Use for\n * a small affordance such as a pin toggle — the rail attaches no meaning to\n * what it renders. Receives the tool and its index / active state.\n */\n renderToolAffordance?: (\n tool: ToolRailTool,\n context: { index: number; isActive: boolean; isRovingTarget: boolean },\n ) => ReactNode;\n /**\n * Optional non-scrolling header rendered at the top of the OPEN tool panel,\n * above its scroll region. Host-owned content (e.g. a pin / unpin control) —\n * the rail attaches no meaning. Receives the active tool.\n */\n renderPanelHeader?: (\n tool: ToolRailTool,\n context: { isActive: boolean },\n ) => ReactNode;\n /**\n * Identity override for the root's `data-component` attribute. Defaults to\n * `'tool-rail'`. A product wrapper (e.g. ControlRoomRail) passes its own\n * kebab id so the DOM / cascade boundary — and an agent's `domHooks.root` —\n * can tell its surface apart from a bare ToolRail, without the engine ever\n * importing the wrapper.\n */\n dataComponent?: string;\n /**\n * Agent adapter registered for this rail instance. Defaults to\n * `toolRailAgent`. A wrapper passes its own adapter (matching\n * `dataComponent`) so the rail registers under the wrapper's identity. The\n * instance id is sourced from the `id` prop (also stamped as\n * `data-component-id`).\n */\n agentAdapter?: AgentAdapter<ToolRailHandle>;\n className?: string;\n}\n\n/* ------------------------------------------------------------------ */\n/* Helpers */\n/* ------------------------------------------------------------------ */\n\nfunction formatBadgeCount(count: number, overflowLabel: string): string {\n return count > 99 ? overflowLabel : String(count);\n}\n\n/* ------------------------------------------------------------------ */\n/* Root */\n/* ------------------------------------------------------------------ */\n\nexport const ToolRail = forwardRef<ToolRailHandle, ToolRailProps>(\n (\n {\n id,\n tools,\n activeToolId,\n defaultActiveToolId = null,\n onActiveToolChange,\n side = 'end',\n railLabel,\n resizablePanel = false,\n onReorder,\n formatReorderAnnouncement,\n renderToolAffordance,\n renderPanelHeader,\n dataComponent = 'tool-rail',\n agentAdapter = toolRailAgent,\n className,\n },\n ref,\n ) => {\n const { t } = useTranslation();\n\n // Controlled / uncontrolled bridge — the same hook MessageTray uses.\n const [activeRaw, setActiveRaw] = useControllableState<string | null>({\n value: activeToolId,\n defaultValue: defaultActiveToolId,\n onChange: onActiveToolChange,\n });\n const activeId = activeRaw ?? null;\n\n // Roving-tabindex bookkeeping for the vertical toolbar strip.\n const buttonsRef = useRef<Array<HTMLButtonElement | null>>([]);\n const panelRef = useRef<HTMLElement | null>(null);\n const [focusIndex, setFocusIndex] = useState(0);\n // Distinguishes keyboard activation (auto-focus into the panel) from\n // pointer activation (focus stays on the icon — less jarring).\n const activatedByKeyboardRef = useRef(false);\n // Set on Enter/Space keydown, read by the click handler that follows,\n // cleared on keyup — so a subsequent mouse click never inherits it.\n const keyboardActivateRef = useRef(false);\n\n const activeIndex = useMemo(\n () => tools.findIndex((tl) => tl.id === activeId),\n [tools, activeId],\n );\n const activeTool = activeIndex >= 0 ? tools[activeIndex] : null;\n // The panel outlives `activeTool` by one exit, so it keeps the last tool\n // it showed to have something to fade out.\n const lastToolRef = useRef<ToolRailTool | null>(activeTool);\n if (activeTool) lastToolRef.current = activeTool;\n\n // First non-disabled index — the resting roving stop when none active.\n const firstEnabledIndex = useMemo(\n () => tools.findIndex((tl) => !tl.disabled),\n [tools],\n );\n\n // Scope grouping: a divider marks the boundary between the two scope groups,\n // whichever order they appear in. The array is always grouped (all of one\n // scope, then the other); the divider precedes the first tool whose scope\n // differs from the lead tool's. `boundary > 0` guarantees both groups are\n // present. Render-only (not a `tools[]` member) so roving focus is untouched;\n // a legacy strip with no `scope` set stays ungrouped.\n const scopeDividerIndex = useMemo(() => {\n const lead = tools[0]?.scope;\n if (!lead) return -1;\n return tools.findIndex((tl) => tl.scope && tl.scope !== lead);\n }, [tools]);\n const showScopeDivider = scopeDividerIndex > 0;\n\n /* ---- Reorder (drag-and-drop + Alt+Arrow keyboard) ------------- */\n // The contiguous run of `reorderable` tools — a tool only moves within it.\n const reorderRun = useMemo(() => {\n const first = tools.findIndex((tl) => tl.reorderable);\n if (first < 0) return null;\n let last = first;\n while (last + 1 < tools.length && tools[last + 1]?.reorderable) last += 1;\n return { first, last };\n }, [tools]);\n const reorderEnabled = !!onReorder && reorderRun !== null;\n const reorderInstructionsId = useId();\n\n const [dragIndex, setDragIndex] = useState<number | null>(null);\n const [dropIndex, setDropIndex] = useState<number | null>(null);\n\n /* ---- Strip enter / exit / reflow animations ------------------ */\n /* The same hooks the note/task panels use, applied to the icon strip:\n when a contextual tool appears or disappears (e.g. selecting an\n appointment adds Notes + Details), surviving icons slide to their\n new positions and departing icons fade out in place. */\n const { resolvedTheme } = useTheme();\n const reduceMotion = resolvedTheme.endsWith('-accessible') || undefined;\n\n const { containerRef: reflowRef } = useListReflow<HTMLDivElement>({\n key: tools.map((tl) => tl.id).join(),\n reduceMotion,\n });\n\n const exit = useExitTransition({ reduceMotion });\n\n /* ---- Panel open / collapse, and tool-to-tool swap ------------- */\n const panelPresence = usePresenceTransition<HTMLElement>(\n activeTool !== null,\n { reduceMotion },\n );\n const panelLeaving = activeTool === null && panelPresence.mounted;\n const shownTool = activeTool ?? (panelLeaving ? lastToolRef.current : null);\n const { ref: presenceRef } = panelPresence;\n const setPanelNode = useCallback(\n (node: HTMLElement | null) => {\n panelRef.current = node;\n presenceRef(node);\n },\n [presenceRef],\n );\n // `inert` set on the node, not as a prop: React 18 has no boolean for it.\n useIsomorphicLayoutEffect(() => {\n const node = panelRef.current;\n if (!node) return;\n // Nothing focused may sit inside a hidden subtree. If focus was in the\n // panel, hand it to the tool's own icon in this same commit; the Escape\n // and close paths then find it already there.\n const active = document.activeElement;\n if (\n panelLeaving &&\n active instanceof HTMLElement &&\n node.contains(active)\n ) {\n const returnId = lastToolRef.current?.id;\n const icon = returnId\n ? rootRef.current?.querySelector<HTMLButtonElement>(\n `[data-tool-id=\"${CSS.escape(returnId)}\"]`,\n )\n : null;\n active.blur();\n node.setAttribute('inert', '');\n icon?.focus();\n return;\n }\n node.toggleAttribute('inert', panelLeaving);\n }, [panelLeaving]);\n // The body fades in when a tool replaces another in an already-open\n // panel; the panel's own entrance covers a first open. DERIVED during\n // render from the last tool that settled, so the new body's first commit\n // is already `entering` and the fade never starts from the wrong end.\n const systemReducedMotion = usePrefersReducedMotion();\n const [settledToolId, setSettledToolId] = useState<string | null>(\n activeTool?.id ?? null,\n );\n const shownActiveId = activeTool?.id ?? null;\n const bodyEntering =\n !reduceMotion &&\n !systemReducedMotion &&\n shownActiveId !== null &&\n settledToolId !== null &&\n settledToolId !== shownActiveId;\n useIsomorphicLayoutEffect(() => {\n if (settledToolId === shownActiveId) return undefined;\n if (!bodyEntering) {\n setSettledToolId(shownActiveId);\n return undefined;\n }\n // Two frames to paint `entering` and move off it; the timer covers a\n // hidden tab, which gets no frames.\n let inner = 0;\n const settle = () => setSettledToolId(shownActiveId);\n const outer = requestAnimationFrame(() => {\n inner = requestAnimationFrame(settle);\n });\n const fallback = window.setTimeout(settle, 64);\n return () => {\n cancelAnimationFrame(outer);\n cancelAnimationFrame(inner);\n window.clearTimeout(fallback);\n };\n }, [shownActiveId, settledToolId, bodyEntering]);\n\n // The crossfade's other half: a picture of the body being replaced, held\n // under the new one until its fade has played. Taken DURING render, so the\n // commit that mounts the new body already has it and is never blank.\n const motionOff = !!reduceMotion || systemReducedMotion;\n const bodiesRef = useRef<HTMLDivElement>(null);\n const [bodySwap, setBodySwap] = useState<{\n liveId: string | null;\n serial: number;\n /** The replaced body held focus, which its unmount is about to drop. */\n focusLost: boolean;\n leaving: LeavingBody[];\n }>({ liveId: shownActiveId, serial: 0, focusLost: false, leaving: [] });\n if (bodySwap.liveId !== shownActiveId) {\n const previous =\n bodySwap.liveId !== null && shownActiveId !== null\n ? (bodiesRef.current?.querySelector<HTMLElement>(\n ':scope > [data-tool-rail-layer=\"live\"]',\n ) ?? null)\n : null;\n const carried = bodySwap.leaving.filter(\n (body) => body.toolId !== shownActiveId,\n );\n setBodySwap({\n liveId: shownActiveId,\n serial: bodySwap.serial + 1,\n focusLost: previous?.contains(document.activeElement) ?? false,\n leaving:\n previous && !motionOff\n ? [\n ...carried.filter((body) => body.toolId !== bodySwap.liveId),\n {\n exitId: `${bodySwap.liveId}:${bodySwap.serial}`,\n toolId: bodySwap.liveId as string,\n ...snapshotBody(previous),\n },\n ]\n : carried,\n });\n }\n // A picture goes when its own fade ends. The timer is the fallback for a\n // hidden tab, which runs no transitions; it is longer than the fade so it\n // never cuts one short.\n const dropLeavingBody = useCallback((exitId: string) => {\n setBodySwap((current) =>\n current.leaving.some((body) => body.exitId === exitId)\n ? {\n ...current,\n leaving: current.leaving.filter((body) => body.exitId !== exitId),\n }\n : current,\n );\n }, []);\n const { leave: leaveBody } = useExitTransition({\n reduceMotion,\n durationMs: LEAVING_BODY_FALLBACK_MS,\n });\n useEffect(() => {\n for (const { exitId } of bodySwap.leaving) {\n leaveBody(exitId, () => dropLeavingBody(exitId));\n }\n }, [bodySwap.leaving, leaveBody, dropLeavingBody]);\n const leavingBodies = shownTool ? bodySwap.leaving : [];\n const heldBodyId =\n bodySwap.leaving[bodySwap.leaving.length - 1]?.exitId ?? null;\n // Fills a leaving layer once, as it mounts: `inert` (React 18 has no prop\n // for it), then the picture, then the scroll offsets it was taken at.\n const leavingRef = useRef(bodySwap.leaving);\n leavingRef.current = bodySwap.leaving;\n const fillLeavingBody = useCallback(\n (node: HTMLDivElement | null) => {\n if (!node || node.childNodes.length > 0) return;\n const body = leavingRef.current.find(\n (item) => item.exitId === node.dataset.exitId,\n );\n if (!body) return;\n // No fade to play (a 0ms token, or no kit stylesheet at all): the\n // picture has no job, so it goes at once rather than wait for the timer.\n if (!hasTransition(node)) {\n dropLeavingBody(body.exitId);\n return;\n }\n node.setAttribute('inert', '');\n node.append(...body.nodes);\n for (const [element, top, left] of body.scrolls) {\n element.scrollTop = top;\n element.scrollLeft = left;\n }\n },\n [dropLeavingBody],\n );\n // The old body took focus with it when it unmounted. Unless something in\n // the new tool has claimed it already, it goes to the new tool's icon.\n useIsomorphicLayoutEffect(() => {\n if (!bodySwap.focusLost || !shownActiveId) return;\n const active = document.activeElement;\n if (active && active !== document.body) return;\n rootRef.current\n ?.querySelector<HTMLButtonElement>(\n `[data-tool-id=\"${CSS.escape(shownActiveId)}\"]`,\n )\n ?.focus();\n }, [bodySwap.serial]);\n\n // Tools that were in the previous render but are gone now, kept around\n // until their exit fade completes. Rendered after the current tools\n // WITHOUT `data-reflow-id` so the reflow hook ignores them — they fade\n // out at the bottom of the strip while the surviving icons reflow.\n const [leavingTools, setLeavingTools] = useState<ToolRailTool[]>([]);\n const prevToolsRef = useRef<ToolRailTool[]>(tools);\n useEffect(() => {\n const prev = prevToolsRef.current;\n const currentIds = new Set(tools.map((tl) => tl.id));\n const removed = prev.filter((tl) => !currentIds.has(tl.id));\n if (removed.length > 0) {\n setLeavingTools((existing) => {\n const existingIds = new Set(existing.map((tl) => tl.id));\n return [\n ...existing,\n ...removed.filter((tl) => !existingIds.has(tl.id)),\n ];\n });\n for (const tl of removed) {\n exit.leave(tl.id, () => {\n setLeavingTools((existing) =>\n existing.filter((item) => item.id !== tl.id),\n );\n });\n }\n }\n prevToolsRef.current = tools;\n }, [tools, exit]);\n\n // sr-only announcement. The zero-width-space toggle forces a re-announce of\n // an identical message (e.g. moving the same item twice) — same technique\n // the Sidebar uses for its reorder live region.\n const [reorderMessage, setReorderMessage] = useState('');\n const announceToggle = useRef(false);\n const commitReorder = useCallback(\n (from: number, to: number) => {\n if (!onReorder || !reorderRun) return;\n const clamped = Math.max(\n reorderRun.first,\n Math.min(reorderRun.last, to),\n );\n if (clamped === from) return;\n onReorder(from, clamped);\n const moved = tools[from];\n if (moved) {\n // The host can phrase membership-aware moves (e.g. pin / unpin) and\n // can return '' to stay silent for a move it treats as a no-op.\n const text = formatReorderAnnouncement\n ? formatReorderAnnouncement({ tool: moved, from, to: clamped })\n : t('toolRail.reorderAnnounce', {\n tool: moved.label,\n to: clamped - reorderRun.first + 1,\n total: reorderRun.last - reorderRun.first + 1,\n defaultValue: '{{tool}} moved to position {{to}} of {{total}}',\n });\n if (text) {\n announceToggle.current = !announceToggle.current;\n setReorderMessage(announceToggle.current ? text : `${text}\\u200b`);\n }\n }\n },\n [onReorder, reorderRun, tools, t, formatReorderAnnouncement],\n );\n\n // The roving tab stop: the active icon when a tool is open, else the\n // index the user last focused, else the first enabled icon.\n const rovingIndex =\n activeIndex >= 0\n ? activeIndex\n : focusIndex >= 0 && !tools[focusIndex]?.disabled\n ? focusIndex\n : firstEnabledIndex;\n\n const selectTool = useCallback(\n (toolId: string, fromKeyboard: boolean) => {\n const tool = tools.find((tl) => tl.id === toolId);\n if (!tool || tool.disabled) return;\n activatedByKeyboardRef.current = fromKeyboard;\n // Clicking / activating the active tool collapses to strip-only.\n setActiveRaw(activeId === toolId ? null : toolId);\n },\n [tools, activeId, setActiveRaw],\n );\n\n /* ---- Roving arrow-key navigation (vertical toolbar) ----------- */\n const handleStripKeyDown = useCallback(\n (event: ReactKeyboardEvent<HTMLDivElement>) => {\n const count = tools.length;\n if (count === 0) return;\n // Alt+Arrow is reserved for reordering (handled on the icon); never\n // let it move focus roving as well.\n if (event.altKey) return;\n\n let next: number | null = null;\n if (event.key === 'ArrowDown') next = (rovingIndex + 1) % count;\n else if (event.key === 'ArrowUp')\n next = (rovingIndex - 1 + count) % count;\n else if (event.key === 'Home') next = 0;\n else if (event.key === 'End') next = count - 1;\n if (next === null) return;\n\n // Skip disabled icons in the travel direction.\n const goingBack = event.key === 'ArrowUp' || event.key === 'End';\n let candidate = next;\n let attempts = 0;\n while (attempts < count && tools[candidate]?.disabled) {\n candidate = goingBack\n ? (candidate - 1 + count) % count\n : (candidate + 1) % count;\n attempts += 1;\n }\n if (tools[candidate]?.disabled) return;\n\n event.preventDefault();\n setFocusIndex(candidate);\n buttonsRef.current[candidate]?.focus();\n },\n [tools, rovingIndex],\n );\n\n /* ---- Esc collapses + returns focus to the active tool's icon -- */\n // Attached imperatively via the root ref (not a JSX onKeyDown on the\n // static container) so the Escape shortcut works from anywhere inside the\n // open panel without an interaction handler on a non-interactive element.\n const rootRef = useRef<HTMLDivElement>(null);\n useEffect(() => {\n const node = rootRef.current;\n if (!node) return undefined;\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key !== 'Escape') return;\n if (activeIndex < 0) return;\n event.preventDefault();\n const returnIndex = activeIndex;\n setActiveRaw(null);\n setFocusIndex(returnIndex);\n // Defer until after the panel unmounts so focus lands cleanly.\n requestAnimationFrame(() => {\n buttonsRef.current[returnIndex]?.focus();\n });\n };\n node.addEventListener('keydown', onKeyDown);\n return () => node.removeEventListener('keydown', onKeyDown);\n }, [activeIndex, setActiveRaw]);\n\n /* ---- Move focus into the panel when opened by keyboard -------- */\n useIsomorphicLayoutEffect(() => {\n if (activeTool && activatedByKeyboardRef.current) {\n panelRef.current?.focus();\n }\n activatedByKeyboardRef.current = false;\n }, [activeTool]);\n\n /* ---- Opt-in panel resize (inner edge) -------------------------- */\n // The handle sits on the edge facing the main content: the panel's\n // inline-start edge for an end-docked rail, inline-end for start.\n const panelEdge = side === 'end' ? 'inline-start' : 'inline-end';\n const { separatorProps, isResizing, isResized } = useEdgeResize({\n edge: panelEdge,\n targetRef: panelRef,\n cssProperty: PANEL_SIZE_PROPERTY,\n minSize: PANEL_MIN_SIZE,\n maxSize: PANEL_MAX_SIZE,\n defaultSize: PANEL_DEFAULT_SIZE,\n disabled: !resizablePanel,\n });\n\n // The aside unmounts on collapse, dropping the hook's inline override.\n // Re-assert the committed width when a panel (re)mounts so a reopened\n // panel keeps the user's chosen size.\n const committedPanelWidth = separatorProps['aria-valuenow'];\n useIsomorphicLayoutEffect(() => {\n if (!resizablePanel || !isResized || !activeTool) return;\n panelRef.current?.style.setProperty(\n PANEL_SIZE_PROPERTY,\n `${committedPanelWidth}px`,\n );\n }, [activeTool, resizablePanel, isResized, committedPanelWidth]);\n\n /* ---- Curated imperative handle for agent integration ---------- */\n const activeIdRef = useRef<string | null>(activeId);\n activeIdRef.current = activeId;\n\n const handle = useMemo<ToolRailHandle>(\n () => ({\n getActiveToolId: () => activeIdRef.current,\n setActiveTool: (toolId) => {\n activatedByKeyboardRef.current = false;\n setActiveRaw(toolId);\n },\n open: (toolId) => {\n const tool = tools.find((tl) => tl.id === toolId);\n if (!tool || tool.disabled) return;\n activatedByKeyboardRef.current = false;\n setActiveRaw(toolId);\n },\n close: () => {\n const returnId = activeIdRef.current;\n activatedByKeyboardRef.current = false;\n setActiveRaw(null);\n // Return focus to the closed tool's strip icon (mirrors Escape) so a\n // close-button / pointer collapse never drops focus to <body>.\n if (returnId != null) {\n requestAnimationFrame(() => {\n rootRef.current\n ?.querySelector<HTMLButtonElement>(\n `[data-tool-id=\"${CSS.escape(returnId)}\"]`,\n )\n ?.focus();\n });\n }\n },\n }),\n [tools, setActiveRaw],\n );\n\n useImperativeHandle(ref, () => handle, [handle]);\n useAgentRegistration(agentAdapter, handle, id);\n\n const overflowLabel = t('toolRail.badgeCountOverflow', {\n defaultValue: '99+',\n });\n\n return (\n <div\n ref={rootRef}\n data-component={dataComponent}\n data-component-id={id}\n data-side={side}\n className={[railVariants({ side }), className]\n .filter(Boolean)\n .join(' ')}\n >\n {/* Reorder a11y: a polite live region announcing each move. Each\n reorderable icon carries its own keyboard instruction (rendered in\n its slot, referenced via aria-describedby). */}\n {reorderEnabled ? (\n <span role=\"status\" aria-live=\"polite\" className=\"ds:sr-only\">\n {reorderMessage}\n </span>\n ) : null}\n {/* The OPEN panel is the single complementary landmark, named by\n the active tool. Rendered only while a tool is active so two\n unnamed regions never coexist. */}\n {shownTool ? (\n <aside\n ref={setPanelNode}\n tabIndex={-1}\n aria-label={t('toolRail.panelLabel', {\n tool: shownTool.label,\n defaultValue: '{{tool}} panel',\n })}\n // A leaving panel is already closed to the user: out of the\n // accessibility tree, and `inert` (set above) while it fades.\n aria-hidden={panelLeaving || undefined}\n data-tool-rail-state={panelLeaving ? 'collapsing' : 'expanded'}\n data-presence={panelPresence.phase}\n data-active-tool={shownTool.id}\n data-resizing={isResizing ? '' : undefined}\n className={[\n panelVariants({ side }),\n // Subtle shadow — not a line — separating the panel from the\n // icon strip (the tab row). The panel casts a soft chrome\n // shadow toward the strip on its strip-facing edge. `z-[1]`\n // lifts it above the adjacent strip (the panel is already\n // `relative`) so the shadow paints at the seam instead of being\n // covered by the strip's opaque background. Only renders while\n // the panel is open (the aside is unmounted when collapsed), so\n // it never doubles as a rail↔main seam. In the accessible (AAA)\n // theme the soft shadow becomes a solid 1px border on that same\n // strip-facing edge.\n 'ds:z-[1]',\n side === 'end'\n ? 'ds:shadow-[var(--shadow-chrome-end)] ds:[.theme-accessible_&]:border-e ds:[.theme-accessible_&]:border-[var(--border)] ds:[.theme-accessible_&]:shadow-none'\n : 'ds:shadow-[var(--shadow-chrome-start)] ds:[.theme-accessible_&]:border-s ds:[.theme-accessible_&]:border-[var(--border)] ds:[.theme-accessible_&]:shadow-none',\n 'ds:focus-visible:outline-none',\n ].join(' ')}\n >\n {/* Optional host-owned, non-scrolling panel header (e.g. the\n Control Room's add / remove favourite control). Sits above the\n scroll region so it stays put as the panel body scrolls. */}\n {renderPanelHeader\n ? renderPanelHeader(shownTool, { isActive: !panelLeaving })\n : null}\n <div ref={bodiesRef} className={panelBodiesClass}>\n {/* Pictures of replaced bodies (see `snapshotBody`). The one just\n replaced holds at rest for the two frames the new body waits\n at `entering`, so both fades start together and sum to one. */}\n {leavingBodies.map((body) => (\n <div\n key={body.exitId}\n ref={fillLeavingBody}\n aria-hidden=\"true\"\n data-exit-id={body.exitId}\n data-tool-rail-body={body.toolId}\n data-tool-rail-layer=\"leaving\"\n data-presence={\n bodyEntering && body.exitId === heldBodyId\n ? 'present'\n : 'leaving'\n }\n className={panelBodyVariants({ layer: 'leaving' })}\n onTransitionEnd={(event) => {\n if (event.target === event.currentTarget)\n dropLeavingBody(body.exitId);\n }}\n />\n ))}\n <div\n key={shownTool.id}\n data-tool-rail-body={shownTool.id}\n data-tool-rail-layer=\"live\"\n data-presence={bodyEntering ? 'entering' : 'present'}\n className={panelBodyVariants({ layer: 'live' })}\n >\n {/* Optional per-tool pinned header — the rail-level home for a\n sticky tool header (title / filters). Non-scrolling, above\n the body, so it stays visible for every tool. */}\n {shownTool.header ? (\n <div className=\"ds:shrink-0\">{shownTool.header}</div>\n ) : null}\n {/* Body: a self-scrolling `fill` tool owns its own scroll inside\n the height-bounded panel; otherwise the rail scrolls it. */}\n {shownTool.fill ? (\n // data-tool-fill: a self-scrolling panel owns its own native\n // scroll, so a token rule paints its scrollbar to match the\n // 8px overlay. See tokens/index.css.\n <div data-tool-fill=\"\" className=\"ds:flex-1 ds:min-h-0\">\n {shownTool.panel}\n </div>\n ) : (\n <ScrollArea\n orientation=\"vertical\"\n className=\"ds:flex-1 ds:min-h-0\"\n >\n {shownTool.panel}\n </ScrollArea>\n )}\n </div>\n </div>\n {/* Inside the aside (so it belongs to the complementary\n landmark) and outside the toolbar strip — the strip's\n roving handlers never see its key events, and Escape\n still bubbles to the root to collapse, as everywhere\n else in the panel. No stopPropagation needed. */}\n {resizablePanel ? (\n <div\n {...separatorProps}\n aria-label={t('toolRail.resizePanel', {\n defaultValue: 'Resize tool panel',\n })}\n data-resizing={isResizing ? '' : undefined}\n className={panelResizeHandleVariants({ edge: panelEdge })}\n />\n ) : null}\n </aside>\n ) : null}\n\n {/* The 3rem icon strip — a vertical toolbar with roving tabindex.\n Self-contained TooltipProvider so consumers needn't mount one;\n Radix providers compose, so a host-level provider still works. */}\n <TooltipProvider>\n <div\n ref={reflowRef}\n role=\"toolbar\"\n aria-orientation=\"vertical\"\n aria-label={\n railLabel ?? t('toolRail.railLabel', { defaultValue: 'Tools' })\n }\n className={stripVariants()}\n onKeyDown={handleStripKeyDown}\n >\n {tools.map((tool, index) => {\n const isActive = tool.id === activeId;\n const showBadge =\n typeof tool.badgeCount === 'number' && tool.badgeCount > 0;\n // Fold the count into the accessible name so SR users hear it\n // without relying on the decorative chip.\n const accessibleName = showBadge\n ? t('toolRail.toolWithCount', {\n tool: tool.label,\n count: tool.badgeCount,\n defaultValue: '{{tool}}, {{count}} updates',\n })\n : tool.label;\n const canReorderTool =\n reorderEnabled && !!tool.reorderable && !tool.disabled;\n const reorderDescId = canReorderTool\n ? `${reorderInstructionsId}-${tool.id}`\n : undefined;\n return (\n <Fragment key={tool.id}>\n {showScopeDivider && index === scopeDividerIndex ? (\n <div\n role=\"separator\"\n aria-orientation=\"horizontal\"\n className=\"ds:my-[var(--spacing-2xs)] ds:h-px ds:w-[var(--spacing-lg)] ds:shrink-0 ds:bg-[var(--border)] ds:forced-colors:bg-[CanvasText]\"\n />\n ) : null}\n <div\n className={[\n toolSlotVariants({\n dragging: dragIndex === index,\n dropTarget: dropIndex === index && dragIndex !== index,\n reorderable: canReorderTool,\n }),\n toolElevationClass,\n REFLOW_ROW_CLASS,\n ]\n .filter(Boolean)\n .join(' ')}\n data-reflow-id={tool.id}\n data-dragging={dragIndex === index ? '' : undefined}\n // Drag the whole slot — the icon button is an unreliable\n // HTML5 drag source across browsers. The button keeps its\n // click + Alt+Arrow keyboard reorder; drag is pointer-only.\n draggable={canReorderTool || undefined}\n onDragStart={\n canReorderTool\n ? (event) => {\n setDragIndex(index);\n event.dataTransfer.effectAllowed = 'move';\n // Firefox needs data set to initiate a drag.\n event.dataTransfer.setData(\n 'text/plain',\n String(index),\n );\n }\n : undefined\n }\n onDragOver={\n canReorderTool\n ? (event) => {\n if (dragIndex === null) return;\n event.preventDefault();\n event.dataTransfer.dropEffect = 'move';\n if (dropIndex !== index) setDropIndex(index);\n }\n : undefined\n }\n onDragLeave={\n canReorderTool\n ? () =>\n setDropIndex((cur) => (cur === index ? null : cur))\n : undefined\n }\n onDrop={\n canReorderTool\n ? (event) => {\n event.preventDefault();\n const from = dragIndex;\n setDropIndex(null);\n setDragIndex(null);\n if (from === null || from === index) return;\n commitReorder(from, index);\n }\n : undefined\n }\n onDragEnd={\n canReorderTool\n ? () => {\n setDragIndex(null);\n setDropIndex(null);\n }\n : undefined\n }\n >\n <IconButton\n ref={(el) => {\n buttonsRef.current[index] = el;\n }}\n icon={tool.icon}\n tooltip={tool.label}\n aria-label={accessibleName}\n intent=\"ghost\"\n size=\"sm\"\n disabled={tool.disabled}\n aria-pressed={isActive}\n aria-expanded={isActive}\n data-active={isActive ? tool.id : undefined}\n data-tool-id={tool.id}\n aria-describedby={reorderDescId}\n aria-keyshortcuts={\n canReorderTool ? 'Alt+ArrowUp Alt+ArrowDown' : undefined\n }\n tabIndex={index === rovingIndex ? 0 : -1}\n onFocus={() => {\n if (!tool.disabled) setFocusIndex(index);\n }}\n onClick={() =>\n selectTool(tool.id, keyboardActivateRef.current)\n }\n onKeyDown={(event) => {\n // Enter/Space activate via the native button's click,\n // which fires AFTER this keydown. Flag the upcoming\n // click as keyboard-driven so focus moves into the\n // panel; reset on keyup so a later mouse click doesn't\n // inherit the flag.\n if (event.key === 'Enter' || event.key === ' ') {\n keyboardActivateRef.current = true;\n return;\n }\n // Alt+Arrow / Alt+Home / Alt+End reorder within the run.\n // Focus follows the moved icon to its new index; roving\n // ignores Alt (see handleStripKeyDown).\n if (canReorderTool && event.altKey && reorderRun) {\n let target: number | null = null;\n if (event.key === 'ArrowUp') target = index - 1;\n else if (event.key === 'ArrowDown')\n target = index + 1;\n else if (event.key === 'Home')\n target = reorderRun.first;\n else if (event.key === 'End')\n target = reorderRun.last;\n if (target !== null) {\n event.preventDefault();\n const dest = Math.max(\n reorderRun.first,\n Math.min(reorderRun.last, target),\n );\n // Focus follows the moved TOOL (by id), not the\n // slot index — so it lands correctly however the\n // host reinterprets the move (reorder, cross-group\n // pin / unpin, or a no-op that leaves it in place).\n const movedId = tool.id;\n commitReorder(index, dest);\n requestAnimationFrame(() => {\n rootRef.current\n ?.querySelector<HTMLButtonElement>(\n `[data-tool-id=\"${CSS.escape(movedId)}\"]`,\n )\n ?.focus();\n });\n }\n }\n }}\n onKeyUp={(event) => {\n if (event.key === 'Enter' || event.key === ' ') {\n keyboardActivateRef.current = false;\n }\n }}\n />\n {showBadge ? (\n <span aria-hidden=\"true\" className={badgeVariants()}>\n {formatBadgeCount(\n tool.badgeCount as number,\n overflowLabel,\n )}\n </span>\n ) : null}\n {renderToolAffordance?.(tool, {\n index,\n isActive,\n isRovingTarget: index === rovingIndex,\n })}\n {reorderDescId ? (\n <span id={reorderDescId} className=\"ds:sr-only\">\n {t('toolRail.reorderInstructions', {\n tool: tool.label,\n defaultValue:\n 'Reorder {{tool}}. Press Alt + Up or Alt + Down to move.',\n })}\n </span>\n ) : null}\n </div>\n </Fragment>\n );\n })}\n {/* Departing tools: rendered without `data-reflow-id` so the\n reflow hook ignores them. They fade out here while the\n surviving icons above reflow to their new positions. */}\n {leavingTools.map((tool) =>\n exit.isLeaving(tool.id) ? (\n <div\n key={tool.id}\n className={[\n toolSlotVariants({\n dragging: false,\n dropTarget: false,\n reorderable: false,\n }),\n toolElevationClass,\n toolLeavingClass,\n ]\n .filter(Boolean)\n .join(' ')}\n aria-hidden=\"true\"\n >\n <IconButton\n icon={tool.icon}\n intent=\"ghost\"\n size=\"sm\"\n disabled\n tabIndex={-1}\n />\n </div>\n ) : null,\n )}\n </div>\n </TooltipProvider>\n </div>\n );\n },\n);\n\nToolRail.displayName = 'ToolRail';\n"],"names":["toolRailAgent","handle","args","RAIL_WIDTH","PANEL_WIDTH","PANEL_SIZE_PROPERTY","PANEL_MIN_SIZE","PANEL_MAX_SIZE","PANEL_DEFAULT_SIZE","railVariants","cva","stripVariants","panelVariants","panelBodiesClass","panelBodyVariants","LEAVING_BODY_FALLBACK_MS","CLONE_STRIPPED_ATTRIBUTES","hasTransition","node","part","snapshotBody","body","holder","originals","clones","scrolls","original","index","clone","_a","inSvg","name","panelResizeHandleVariants","badgeVariants","toolSlotVariants","toolLeavingClass","toolElevationClass","formatBadgeCount","count","overflowLabel","ToolRail","forwardRef","id","tools","activeToolId","defaultActiveToolId","onActiveToolChange","side","railLabel","resizablePanel","onReorder","formatReorderAnnouncement","renderToolAffordance","renderPanelHeader","dataComponent","agentAdapter","className","ref","t","useTranslation","activeRaw","setActiveRaw","useControllableState","activeId","buttonsRef","useRef","panelRef","focusIndex","setFocusIndex","useState","activatedByKeyboardRef","keyboardActivateRef","activeIndex","useMemo","tl","activeTool","lastToolRef","firstEnabledIndex","scopeDividerIndex","lead","showScopeDivider","reorderRun","first","last","reorderEnabled","reorderInstructionsId","useId","dragIndex","setDragIndex","dropIndex","setDropIndex","resolvedTheme","useTheme","reduceMotion","reflowRef","useListReflow","exit","useExitTransition","panelPresence","usePresenceTransition","panelLeaving","shownTool","presenceRef","setPanelNode","useCallback","useIsomorphicLayoutEffect","active","returnId","icon","_b","rootRef","systemReducedMotion","usePrefersReducedMotion","settledToolId","setSettledToolId","shownActiveId","bodyEntering","inner","settle","outer","fallback","motionOff","bodiesRef","bodySwap","setBodySwap","previous","carried","dropLeavingBody","exitId","current","leaveBody","useEffect","leavingBodies","heldBodyId","leavingRef","fillLeavingBody","item","element","top","left","leavingTools","setLeavingTools","prevToolsRef","prev","currentIds","removed","existing","existingIds","reorderMessage","setReorderMessage","announceToggle","commitReorder","from","to","clamped","moved","text","rovingIndex","_c","selectTool","toolId","fromKeyboard","tool","handleStripKeyDown","event","next","goingBack","candidate","attempts","onKeyDown","returnIndex","panelEdge","separatorProps","isResizing","isResized","useEdgeResize","committedPanelWidth","activeIdRef","useImperativeHandle","useAgentRegistration","jsxs","jsx","ScrollArea","TooltipProvider","isActive","showBadge","accessibleName","canReorderTool","reorderDescId","Fragment","REFLOW_ROW_CLASS","cur","IconButton","el","target","dest","movedId"],"mappings":";;;;;;;;;;;;;;;AAYO,MAAMA,KAA8C;AAAA,EACzD,IAAI;AAAA,EACJ,cAAc,CAAC,QAAQ,SAAS,eAAe;AAAA,EAC/C,OAAO;AAAA,IACL,cAAc;AAAA,MACZ,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE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