@burdenoff/fe-libs 2026.1117.7 → 2026.1118.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,43 +4,53 @@ import { Tooltip as n, TooltipContent as r, TooltipTrigger as i } from "../../ui
4
4
  import { navLinkClick as a } from "./navLink.js";
5
5
  import { isShellNavMoreEntry as o } from "./shellNavVisibility.js";
6
6
  import { usePublishShellSidebarWidth as s } from "./shellSidebarWidth.js";
7
- import { useCallback as c, useEffect as l, useLayoutEffect as u, useMemo as d, useRef as f, useState as p } from "react";
8
- import { ArrowLeft as m, ChevronDown as h, ChevronRight as g, ChevronUp as _, PanelLeft as v, Pin as y, Plus as b, Search as x } from "lucide-react";
9
- import { clsx as S } from "clsx";
10
- import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
7
+ import { createContext as c, useCallback as l, useContext as u, useEffect as d, useId as f, useLayoutEffect as p, useMemo as m, useRef as h, useState as g } from "react";
8
+ import { ArrowLeft as _, ChevronDown as v, ChevronRight as y, ChevronUp as b, PanelLeft as x, Pin as S, Plus as C, Search as w } from "lucide-react";
9
+ import { clsx as T } from "clsx";
10
+ import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
11
11
  // src/chrome/shell/ShellSidebar.tsx
12
- var E = "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring";
13
- function D(e) {
14
- return e ? "bg-accent-soft text-text-primary" : "text-text-secondary hover:bg-bg-sunken hover:text-text-primary";
12
+ var k = "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring", A = c("default");
13
+ function j() {
14
+ return u(A) === "floating";
15
15
  }
16
- function O({ offsetClass: e = "-start-2.5" }) {
17
- return /* @__PURE__ */ w("span", {
16
+ var M = "bg-text-primary/6", N = "hover:bg-text-primary/4";
17
+ function P(e, t = !1) {
18
+ return t ? e ? `border border-border-default ${M} text-text-primary` : `border border-transparent text-text-secondary ${N} hover:text-text-primary` : e ? "bg-accent-soft text-text-primary" : "text-text-secondary hover:bg-bg-sunken hover:text-text-primary";
19
+ }
20
+ function F(e) {
21
+ return e ? "off" : void 0;
22
+ }
23
+ function I(e, t) {
24
+ return t ? T("shrink-0 text-caption tabular-nums", e ? "text-text-secondary" : "text-text-muted group-hover:text-text-secondary") : T("shrink-0 text-xs tabular-nums", e ? "text-text-primary" : "text-text-secondary");
25
+ }
26
+ function L({ offsetClass: e = "-start-2.5" }) {
27
+ return /* @__PURE__ */ D("span", {
18
28
  "aria-hidden": "true",
19
29
  "data-shell-active-bar": "",
20
- className: S("pointer-events-none absolute top-1/2 h-5 w-0.75 -translate-y-1/2 rounded-e-full bg-action-primary-bg", e)
30
+ className: T("pointer-events-none absolute top-1/2 h-5 w-0.75 -translate-y-1/2 rounded-e-full bg-action-primary-bg", e)
21
31
  });
22
32
  }
23
- function k({ children: e, className: t }) {
24
- return /* @__PURE__ */ w("kbd", {
25
- className: S("inline-flex h-5 shrink-0 items-center rounded border border-border-subtle bg-bg-sunken px-1.5 font-sans text-caption leading-none text-text-muted", t),
33
+ function R({ children: e, className: t }) {
34
+ return /* @__PURE__ */ D("kbd", {
35
+ className: T("inline-flex h-5 shrink-0 items-center rounded border border-border-subtle bg-bg-sunken px-1.5 font-sans text-caption leading-none text-text-muted", t),
26
36
  children: e
27
37
  });
28
38
  }
29
- function A({ badge: e, compact: t = !1 }) {
30
- return /* @__PURE__ */ w("span", {
39
+ function z({ badge: e, compact: t = !1 }) {
40
+ return /* @__PURE__ */ D("span", {
31
41
  "data-shell-badge": e.tone,
32
- className: S("inline-flex shrink-0 items-center justify-center rounded-pill font-semibold tabular-nums leading-none", t ? "h-3.5 min-w-3.5 px-1 text-caption" : "h-5 min-w-5 px-1.5 text-xs", e.tone === "accent" ? "bg-action-primary-bg text-action-primary-text" : "bg-bg-sunken text-text-secondary"),
42
+ className: T("inline-flex shrink-0 items-center justify-center rounded-pill font-semibold tabular-nums leading-none", t ? "h-3.5 min-w-3.5 px-1 text-caption" : "h-5 min-w-5 px-1.5 text-xs", e.tone === "accent" ? "bg-action-primary-bg text-action-primary-text" : "bg-bg-sunken text-text-secondary"),
33
43
  children: e.value
34
44
  });
35
45
  }
36
- function j(e, t = "size-4") {
37
- return S(t, "shrink-0", e ? "text-accent-primary" : "text-text-secondary");
46
+ function B(e, t = "size-4") {
47
+ return T(t, "shrink-0", e ? "text-accent-primary" : "text-text-secondary");
38
48
  }
39
- function M(e, t) {
49
+ function V(e, t) {
40
50
  if (e) return t ? t(e) : e;
41
51
  }
42
- function N({ href: e, onActivate: t, active: n, expanded: r, drill: i, title: o, className: s, children: c }) {
43
- return e ? /* @__PURE__ */ w("a", {
52
+ function H({ href: e, onActivate: t, active: n, expanded: r, drill: i, title: o, className: s, children: c }) {
53
+ return e ? /* @__PURE__ */ D("a", {
44
54
  href: e,
45
55
  onClick: a(t),
46
56
  "data-shell-drill": i,
@@ -48,7 +58,7 @@ function N({ href: e, onActivate: t, active: n, expanded: r, drill: i, title: o,
48
58
  title: o,
49
59
  className: s,
50
60
  children: c
51
- }) : /* @__PURE__ */ w("button", {
61
+ }) : /* @__PURE__ */ D("button", {
52
62
  type: "button",
53
63
  onClick: t,
54
64
  "data-shell-drill": i,
@@ -59,37 +69,37 @@ function N({ href: e, onActivate: t, active: n, expanded: r, drill: i, title: o,
59
69
  children: c
60
70
  });
61
71
  }
62
- function P(e, t) {
63
- return (e.children ?? []).some((e) => t.isEntryActive(e) || P(e, t));
72
+ function ee(e, t) {
73
+ return (e.children ?? []).some((e) => t.isEntryActive(e) || ee(e, t));
64
74
  }
65
- var F = "rtl:rotate-180";
66
- function I(e, t, { nav: n, viewId: r, expanded: i }) {
67
- return e.path ? i[e.id] ?? (t || P(e, n)) : n.isSectionOpen(r, `entry:${e.id}`, !o(e));
75
+ var U = "rtl:rotate-180";
76
+ function te(e, t, { nav: n, viewId: r, expanded: i }) {
77
+ return e.path ? i[e.id] ?? (t || ee(e, n)) : n.isSectionOpen(r, `entry:${e.id}`, !o(e));
68
78
  }
69
- function L(e, t, n, { nav: r, viewId: i, setExpanded: a }) {
79
+ function W(e, t, n, { nav: r, viewId: i, setExpanded: a }) {
70
80
  e.path ? a(e.id, n) : n !== t && r.toggleSection(i, `entry:${e.id}`, !o(e));
71
81
  }
72
- function R(e, t, n, r) {
82
+ function G(e, t, n, r) {
73
83
  if (!t) return {
74
84
  open: !1,
75
85
  setOpen: () => void 0
76
86
  };
77
- let i = I(e, n, r);
87
+ let i = te(e, n, r);
78
88
  return {
79
89
  open: i,
80
- setOpen: (t) => L(e, i, t, r)
90
+ setOpen: (t) => W(e, i, t, r)
81
91
  };
82
92
  }
83
- function z(e, t) {
93
+ function K(e, t) {
84
94
  return `${e.id}:${t.id}`;
85
95
  }
86
- function B(e, t, n) {
96
+ function q(e, t, n) {
87
97
  let r = [], i = (a) => {
88
98
  for (let s of a) {
89
99
  if (o(s)) continue;
90
100
  let a = s.children ?? [];
91
101
  if (a.length === 0) continue;
92
- let c = I(s, t.isEntryActive(s), {
102
+ let c = te(s, t.isEntryActive(s), {
93
103
  nav: t,
94
104
  viewId: e.id,
95
105
  expanded: n
@@ -100,112 +110,113 @@ function B(e, t, n) {
100
110
  }), i(a);
101
111
  }
102
112
  };
103
- for (let n of e.sections) (!n.collapsible || t.isSectionOpen(e.id, n.id)) && i(t.curateEntries(n.entries, z(e, n)));
113
+ for (let n of e.sections) (!n.collapsible || t.isSectionOpen(e.id, n.id)) && i(t.curateEntries(n.entries, K(e, n)));
104
114
  return r;
105
115
  }
106
- function V({ open: e }) {
107
- return e ? /* @__PURE__ */ w(h, {
116
+ function J({ open: e }) {
117
+ return e ? /* @__PURE__ */ D(v, {
108
118
  "aria-hidden": "true",
109
119
  className: "size-3.5 shrink-0"
110
- }) : /* @__PURE__ */ w(g, {
120
+ }) : /* @__PURE__ */ D(y, {
111
121
  "aria-hidden": "true",
112
- className: S("size-3.5 shrink-0", F)
122
+ className: T("size-3.5 shrink-0", U)
113
123
  });
114
124
  }
115
- function H({ entry: e, open: n, onToggle: r }) {
125
+ function Y({ entry: e, open: n, onToggle: r }) {
116
126
  let i = t(), a = n ? i("shell.sidebar.collapseGroup", "Collapse {{label}}", { label: e.label }) : i("shell.sidebar.expandGroup", "Expand {{label}}", { label: e.label });
117
- return /* @__PURE__ */ w("button", {
127
+ return /* @__PURE__ */ D("button", {
118
128
  type: "button",
119
129
  onClick: r,
120
130
  "aria-expanded": n,
121
131
  "aria-label": a,
122
- className: S("flex w-7 shrink-0 items-center justify-center rounded-button text-text-muted hover:text-text-primary", E),
123
- children: /* @__PURE__ */ w(V, { open: n })
132
+ className: T("flex w-7 shrink-0 items-center justify-center rounded-button text-text-muted hover:text-text-primary", k),
133
+ children: /* @__PURE__ */ D(J, { open: n })
124
134
  });
125
135
  }
126
- function U({ entries: e, rowProps: t }) {
127
- return /* @__PURE__ */ T("div", {
136
+ function X({ entries: e, rowProps: t }) {
137
+ return /* @__PURE__ */ O("div", {
128
138
  className: "relative",
129
- children: [/* @__PURE__ */ w("span", {
139
+ children: [/* @__PURE__ */ D("span", {
130
140
  "aria-hidden": "true",
131
141
  className: "pointer-events-none absolute inset-y-0 start-6.75 w-px bg-border-subtle"
132
- }), /* @__PURE__ */ w("ul", {
142
+ }), /* @__PURE__ */ D("ul", {
133
143
  className: "ms-8.5",
134
- children: e.map((e) => /* @__PURE__ */ w(G, {
144
+ children: e.map((e) => /* @__PURE__ */ D(ae, {
135
145
  entry: e,
136
146
  ...t
137
147
  }, e.id))
138
148
  })]
139
149
  });
140
150
  }
141
- function W({ entry: e, viewId: n, nav: r, onNavigate: i, hrefFor: a, onTogglePin: o, isPinned: s, expanded: c, setExpanded: l }) {
142
- let u = t(), d = r.isEntryActive(e), f = e.children ? r.filterEntries(e.children) : [], p = f.length > 0, { open: m, setOpen: h } = R(e, p, d, {
151
+ function ne({ entry: e, viewId: n, nav: r, onNavigate: i, hrefFor: a, onTogglePin: o, isPinned: s, expanded: c, setExpanded: l }) {
152
+ let u = t(), d = j(), f = r.isEntryActive(e), p = e.children ? r.filterEntries(e.children) : [], m = p.length > 0, { open: h, setOpen: g } = G(e, m, f, {
143
153
  nav: r,
144
154
  viewId: n,
145
155
  expanded: c,
146
156
  setExpanded: l
147
- }), _ = !!e.subtitle, v = s?.(e) ?? !1, b = !!(e.pinnable && o), x = e.icon;
148
- return /* @__PURE__ */ T("li", { children: [/* @__PURE__ */ T("div", {
157
+ }), _ = !!e.subtitle, v = s?.(e) ?? !1, b = !!(e.pinnable && o), x = e.icon, C = () => {
158
+ e.drillTo && r.push(e.drillTo), e.path && i(e.path), m && g(e.path ? !0 : !h);
159
+ }, w = d ? _ ? "items-start py-1.25" : "h-7.5 items-center" : _ ? "items-start py-1.5" : "h-8.5 items-center";
160
+ return /* @__PURE__ */ O("li", { children: [/* @__PURE__ */ O("div", {
149
161
  "data-shell-entry": e.id,
150
- "data-active": d ? "true" : void 0,
151
- className: S("group relative flex rounded-button", D(d)),
162
+ "data-active": f ? "true" : void 0,
163
+ "data-depth": F(d),
164
+ className: T("group relative flex rounded-button", P(f, d)),
152
165
  children: [
153
- d ? /* @__PURE__ */ w(O, {}) : null,
154
- /* @__PURE__ */ T(N, {
155
- href: M(e.path, a),
156
- onActivate: () => {
157
- e.drillTo && r.push(e.drillTo), e.path && i(e.path), p && h(e.path ? !0 : !m);
158
- },
159
- active: d,
160
- expanded: p ? m : void 0,
166
+ f && !d ? /* @__PURE__ */ D(L, {}) : null,
167
+ /* @__PURE__ */ O(H, {
168
+ href: V(e.path, a),
169
+ onActivate: C,
170
+ active: f,
171
+ expanded: m ? h : void 0,
161
172
  drill: e.drillTo,
162
- className: S("flex min-w-0 flex-1 gap-3 rounded-button ps-2 text-start", _ ? "items-start py-1.5" : "h-8.5 items-center", b || p && e.path ? "pe-1" : "pe-2.5", E),
173
+ className: T("flex min-w-0 flex-1 gap-3 rounded-button ps-2 text-start", w, b || m && e.path ? "pe-1" : d ? "pe-2" : "pe-2.5", k),
163
174
  children: [
164
- x ? /* @__PURE__ */ w(x, { className: S(j(d), _ && "mt-0.5") }) : null,
165
- /* @__PURE__ */ T("span", {
175
+ x ? /* @__PURE__ */ D(x, { className: T(B(f), _ && "mt-0.5") }) : null,
176
+ /* @__PURE__ */ O("span", {
166
177
  className: "flex min-w-0 flex-1 flex-col",
167
- children: [/* @__PURE__ */ w("span", {
168
- className: S("truncate text-body-sm leading-5", d ? "font-medium text-text-primary" : void 0),
178
+ children: [/* @__PURE__ */ D("span", {
179
+ className: T("truncate text-body-sm leading-5", f ? "font-medium text-text-primary" : void 0),
169
180
  children: e.label
170
- }), e.subtitle ? /* @__PURE__ */ w("span", {
171
- className: "truncate text-xs leading-4 text-text-muted",
181
+ }), e.subtitle ? /* @__PURE__ */ D("span", {
182
+ className: d && f ? "truncate text-xs leading-4 text-text-secondary" : "truncate text-xs leading-4 text-text-muted",
172
183
  children: e.subtitle
173
184
  }) : null]
174
185
  }),
175
- e.count === void 0 ? null : /* @__PURE__ */ w("span", {
176
- className: S("shrink-0 text-xs tabular-nums", d ? "text-text-primary" : "text-text-secondary"),
186
+ e.count === void 0 ? null : /* @__PURE__ */ D("span", {
187
+ className: I(f, d),
177
188
  children: e.count
178
189
  }),
179
- e.badge ? /* @__PURE__ */ w(A, { badge: e.badge }) : null,
180
- e.drillTo ? /* @__PURE__ */ w(g, {
190
+ e.badge ? /* @__PURE__ */ D(z, { badge: e.badge }) : null,
191
+ e.drillTo ? /* @__PURE__ */ D(y, {
181
192
  "aria-hidden": "true",
182
- className: S("size-3.5 shrink-0 text-text-muted", F)
193
+ className: T("size-3.5 shrink-0 text-text-muted", U)
183
194
  }) : null,
184
- p && !e.path ? /* @__PURE__ */ w("span", {
195
+ m && !e.path ? /* @__PURE__ */ D("span", {
185
196
  className: "text-text-muted",
186
- children: /* @__PURE__ */ w(V, { open: m })
197
+ children: /* @__PURE__ */ D(J, { open: h })
187
198
  }) : null
188
199
  ]
189
200
  }),
190
- p && e.path ? /* @__PURE__ */ w(H, {
201
+ m && e.path ? /* @__PURE__ */ D(Y, {
191
202
  entry: e,
192
- open: m,
193
- onToggle: () => h(!m)
203
+ open: h,
204
+ onToggle: () => g(!h)
194
205
  }) : null,
195
- b ? /* @__PURE__ */ w("button", {
206
+ b ? /* @__PURE__ */ D("button", {
196
207
  type: "button",
197
208
  onClick: () => o?.(e),
198
209
  "aria-pressed": v,
199
210
  "aria-label": v ? u("shell.sidebar.unpin", "Unpin {{label}}", { label: e.label }) : u("shell.sidebar.pin", "Pin {{label}} to the sidebar", { label: e.label }),
200
- className: S("flex w-7 shrink-0 justify-center rounded-button text-text-muted hover:text-text-primary", _ ? "items-start pt-2" : "items-center", v ? void 0 : "opacity-0 group-hover:opacity-100 focus-visible:opacity-100 group-focus-within:opacity-100", E),
201
- children: /* @__PURE__ */ w(y, {
211
+ className: T("flex w-7 shrink-0 justify-center rounded-button text-text-muted hover:text-text-primary", _ ? "items-start pt-2" : "items-center", v ? void 0 : "opacity-0 group-hover:opacity-100 focus-visible:opacity-100 group-focus-within:opacity-100", k),
212
+ children: /* @__PURE__ */ D(S, {
202
213
  "aria-hidden": "true",
203
214
  className: "size-3.5"
204
215
  })
205
216
  }) : null
206
217
  ]
207
- }), m ? /* @__PURE__ */ w(U, {
208
- entries: f,
218
+ }), h ? /* @__PURE__ */ D(X, {
219
+ entries: p,
209
220
  rowProps: {
210
221
  viewId: n,
211
222
  nav: r,
@@ -218,167 +229,216 @@ function W({ entry: e, viewId: n, nav: r, onNavigate: i, hrefFor: a, onTogglePin
218
229
  }
219
230
  }) : null] });
220
231
  }
221
- function G({ entry: e, ...t }) {
222
- let { nav: n, onNavigate: r, hrefFor: i } = t, a = n.isEntryActive(e), o = e.children ? n.filterEntries(e.children) : [], s = o.length > 0, { open: c, setOpen: l } = R(e, s, a, t), u = e.icon;
223
- return /* @__PURE__ */ T("li", { children: [/* @__PURE__ */ T("div", {
232
+ function re(e, t) {
233
+ return T("relative flex rounded-button", t && "group", P(e, t));
234
+ }
235
+ function ie(e, t, n) {
236
+ return T("flex h-7.5 min-w-0 flex-1 items-center gap-3 rounded-button ps-2 text-start", t && e.path ? "pe-1" : n ? "pe-2" : "pe-2.5", k);
237
+ }
238
+ function ae({ entry: e, ...t }) {
239
+ let { nav: n, onNavigate: r, hrefFor: i } = t, a = j(), o = n.isEntryActive(e), s = e.children ? n.filterEntries(e.children) : [], c = s.length > 0, { open: l, setOpen: u } = G(e, c, o, t), d = e.icon;
240
+ return /* @__PURE__ */ O("li", { children: [/* @__PURE__ */ O("div", {
224
241
  "data-shell-entry": e.id,
225
- "data-active": a ? "true" : void 0,
226
- className: S("relative flex rounded-button", D(a)),
227
- children: [/* @__PURE__ */ T(N, {
228
- href: M(e.path, i),
242
+ "data-active": o ? "true" : void 0,
243
+ "data-depth": F(a),
244
+ className: re(o, a),
245
+ children: [/* @__PURE__ */ O(H, {
246
+ href: V(e.path, i),
229
247
  onActivate: () => {
230
- e.drillTo && n.push(e.drillTo), e.path && r(e.path), s && l(e.path ? !0 : !c);
248
+ e.drillTo && n.push(e.drillTo), e.path && r(e.path), c && u(e.path ? !0 : !l);
231
249
  },
232
- active: a,
233
- expanded: s ? c : void 0,
250
+ active: o,
251
+ expanded: c ? l : void 0,
234
252
  drill: e.drillTo,
235
- className: S("flex h-7.5 min-w-0 flex-1 items-center gap-3 rounded-button ps-2 text-start", s && e.path ? "pe-1" : "pe-2.5", E),
253
+ className: ie(e, c, a),
236
254
  children: [
237
- u ? /* @__PURE__ */ w(u, { className: j(a) }) : null,
238
- /* @__PURE__ */ w("span", {
255
+ d ? /* @__PURE__ */ D(d, { className: B(o) }) : null,
256
+ /* @__PURE__ */ D("span", {
239
257
  className: "min-w-0 flex-1 truncate text-body-sm",
240
258
  children: e.label
241
259
  }),
242
- e.count === void 0 ? null : /* @__PURE__ */ w("span", {
243
- className: S("shrink-0 text-xs tabular-nums", a ? "text-text-primary" : "text-text-secondary"),
260
+ e.count === void 0 ? null : /* @__PURE__ */ D("span", {
261
+ className: I(o, a),
244
262
  children: e.count
245
263
  }),
246
- e.badge ? /* @__PURE__ */ w(A, { badge: e.badge }) : null,
247
- s && !e.path ? /* @__PURE__ */ w("span", {
264
+ e.badge ? /* @__PURE__ */ D(z, { badge: e.badge }) : null,
265
+ c && !e.path ? /* @__PURE__ */ D("span", {
248
266
  className: "text-text-muted",
249
- children: /* @__PURE__ */ w(V, { open: c })
267
+ children: /* @__PURE__ */ D(J, { open: l })
250
268
  }) : null
251
269
  ]
252
- }), s && e.path ? /* @__PURE__ */ w(H, {
270
+ }), c && e.path ? /* @__PURE__ */ D(Y, {
253
271
  entry: e,
254
- open: c,
255
- onToggle: () => l(!c)
272
+ open: l,
273
+ onToggle: () => u(!l)
256
274
  }) : null]
257
- }), c ? /* @__PURE__ */ w(U, {
258
- entries: o,
275
+ }), l ? /* @__PURE__ */ D(X, {
276
+ entries: s,
259
277
  rowProps: t
260
278
  }) : null] });
261
279
  }
262
- function K() {
263
- let [e, t] = p({});
280
+ function oe() {
281
+ let [e, t] = g({});
264
282
  return {
265
283
  expanded: e,
266
- setExpanded: c((e, n) => t((t) => ({
284
+ setExpanded: l((e, n) => t((t) => ({
267
285
  ...t,
268
286
  [e]: n
269
287
  })), [])
270
288
  };
271
289
  }
272
- function q({ children: e }) {
273
- return /* @__PURE__ */ w("span", {
274
- className: "truncate text-caption font-semibold uppercase tracking-wider text-text-muted",
290
+ function Z({ children: e, floating: t = !1 }) {
291
+ return /* @__PURE__ */ D("span", {
292
+ className: t ? "truncate text-body-sm font-semibold text-text-primary/70" : "truncate text-caption font-semibold uppercase tracking-wider text-text-muted",
275
293
  children: e
276
294
  });
277
295
  }
278
- function J({ view: e, section: n, ...r }) {
279
- let i = t(), { nav: a } = r, o = a.curateEntries(n.entries, z(e, n));
280
- if (o.length === 0) return null;
281
- let s = /* @__PURE__ */ w("ul", { children: o.map((t) => /* @__PURE__ */ w(W, {
296
+ function se({ label: e, count: t, open: n, controls: r, floating: i, onToggle: a }) {
297
+ return /* @__PURE__ */ O("button", {
298
+ type: "button",
299
+ "aria-expanded": n,
300
+ "aria-controls": r,
301
+ onClick: a,
302
+ "data-shell-section-toggle": "",
303
+ className: T("flex h-8 w-full min-w-0 flex-1 items-center gap-1.5 rounded-button px-2 text-start", i ? N : "hover:bg-bg-sunken", k),
304
+ children: [
305
+ /* @__PURE__ */ D(v, {
306
+ "aria-hidden": "true",
307
+ className: T("size-3.5 shrink-0 text-text-muted transition-transform duration-normal motion-reduce:transition-none", !n && "-rotate-90 rtl:rotate-90")
308
+ }),
309
+ /* @__PURE__ */ D(Z, {
310
+ floating: i,
311
+ children: e
312
+ }),
313
+ t === void 0 ? null : /* @__PURE__ */ O(E, { children: [" ", /* @__PURE__ */ D("span", {
314
+ "data-shell-section-count": "",
315
+ className: "shrink-0 text-caption tabular-nums text-text-muted",
316
+ children: t
317
+ })] })
318
+ ]
319
+ });
320
+ }
321
+ function ce({ view: e, section: n, nav: r, count: i, children: a }) {
322
+ let o = t(), s = j(), c = r.isSectionOpen(e.id, n.id), l = n.label ?? o("shell.sidebar.more", "More"), u = `shell-section-${e.id}-${n.id}`, d = () => r.toggleSection(e.id, n.id), f = s ? /* @__PURE__ */ D(se, {
323
+ label: l,
324
+ count: i,
325
+ open: c,
326
+ controls: c ? u : void 0,
327
+ floating: !0,
328
+ onToggle: d
329
+ }) : /* @__PURE__ */ O("button", {
330
+ type: "button",
331
+ "aria-expanded": c,
332
+ "aria-controls": c ? u : void 0,
333
+ onClick: d,
334
+ className: T("flex h-7 w-full items-center gap-2 rounded-button ps-2 pe-2.5 text-start hover:bg-bg-sunken", k),
335
+ children: [
336
+ /* @__PURE__ */ D(Z, { children: l }),
337
+ /* @__PURE__ */ D("span", {
338
+ className: "inline-flex h-4.5 min-w-4.5 items-center justify-center rounded-pill bg-bg-sunken px-1 text-caption leading-none tabular-nums text-text-secondary",
339
+ children: i
340
+ }),
341
+ /* @__PURE__ */ D("span", { className: "flex-1" }),
342
+ D(c ? b : v, {
343
+ "aria-hidden": "true",
344
+ className: "size-3.5 text-text-muted"
345
+ })
346
+ ]
347
+ });
348
+ return /* @__PURE__ */ O("div", {
349
+ "data-shell-section": n.id,
350
+ className: "pt-2",
351
+ children: [f, c ? /* @__PURE__ */ D("div", {
352
+ id: u,
353
+ children: a
354
+ }) : null]
355
+ });
356
+ }
357
+ function Q({ view: e, section: t, ...n }) {
358
+ let r = j(), { nav: i } = n, a = i.curateEntries(t.entries, K(e, t));
359
+ if (a.length === 0) return null;
360
+ let o = /* @__PURE__ */ D("ul", { children: a.map((t) => /* @__PURE__ */ D(ne, {
282
361
  entry: t,
283
362
  viewId: e.id,
284
- ...r
363
+ ...n
285
364
  }, t.id)) });
286
- if (n.collapsible) {
287
- let t = a.isSectionOpen(e.id, n.id), r = n.label ?? i("shell.sidebar.more", "More"), c = `shell-section-${e.id}-${n.id}`;
288
- return /* @__PURE__ */ T("div", {
289
- "data-shell-section": n.id,
290
- className: "pt-2",
291
- children: [/* @__PURE__ */ T("button", {
292
- type: "button",
293
- "aria-expanded": t,
294
- "aria-controls": t ? c : void 0,
295
- onClick: () => a.toggleSection(e.id, n.id),
296
- className: S("flex h-7 w-full items-center gap-2 rounded-button ps-2 pe-2.5 text-start hover:bg-bg-sunken", E),
297
- children: [
298
- /* @__PURE__ */ w(q, { children: r }),
299
- /* @__PURE__ */ w("span", {
300
- className: "inline-flex h-4.5 min-w-4.5 items-center justify-center rounded-pill bg-bg-sunken px-1 text-caption leading-none tabular-nums text-text-secondary",
301
- children: o.length
302
- }),
303
- /* @__PURE__ */ w("span", { className: "flex-1" }),
304
- w(t ? _ : h, {
305
- "aria-hidden": "true",
306
- className: "size-3.5 text-text-muted"
307
- })
308
- ]
309
- }), t ? /* @__PURE__ */ w("div", {
310
- id: c,
311
- children: s
312
- }) : null]
313
- });
314
- }
315
- return /* @__PURE__ */ T("div", {
316
- "data-shell-section": n.id,
317
- children: [n.label ? /* @__PURE__ */ w("div", {
318
- className: "px-2 pb-1.5 pt-3.5",
319
- children: /* @__PURE__ */ w(q, { children: n.label })
320
- }) : null, s]
365
+ return t.collapsible ? /* @__PURE__ */ D(ce, {
366
+ view: e,
367
+ section: t,
368
+ nav: i,
369
+ count: a.length,
370
+ children: o
371
+ }) : /* @__PURE__ */ O("div", {
372
+ "data-shell-section": t.id,
373
+ children: [t.label ? /* @__PURE__ */ D("div", {
374
+ className: r ? "mt-2 flex h-8 items-center px-2" : "px-2 pb-1.5 pt-3.5",
375
+ children: /* @__PURE__ */ D(Z, {
376
+ floating: r,
377
+ children: t.label
378
+ })
379
+ }) : null, o]
321
380
  });
322
381
  }
323
- function Y({ entry: e, shortcut: t, nav: n, onNavigate: r, hrefFor: i }) {
324
- let a = n.isEntryActive(e), o = e.icon;
325
- return /* @__PURE__ */ T("div", {
326
- className: "relative",
382
+ function le({ entry: e, shortcut: t, nav: n, onNavigate: r, hrefFor: i }) {
383
+ let a = j(), o = n.isEntryActive(e), s = e.icon;
384
+ return /* @__PURE__ */ O("div", {
385
+ className: a ? "relative mb-1.5" : "relative",
327
386
  "data-shell-entry": e.id,
328
- "data-active": a ? "true" : void 0,
329
- children: [a ? /* @__PURE__ */ w(O, {}) : null, /* @__PURE__ */ T(N, {
330
- href: M(e.path, i),
387
+ "data-active": o ? "true" : void 0,
388
+ "data-depth": F(a),
389
+ children: [o && !a ? /* @__PURE__ */ D(L, {}) : null, /* @__PURE__ */ O(H, {
390
+ href: V(e.path, i),
331
391
  onActivate: () => {
332
392
  e.drillTo && n.push(e.drillTo), e.path && r(e.path);
333
393
  },
334
- active: a,
394
+ active: o,
335
395
  drill: e.drillTo,
336
- className: S("flex h-9.5 w-full items-center gap-2.5 rounded-button ps-2 pe-2 text-start", D(a), E),
396
+ className: T(a ? "flex h-8 w-full items-center gap-2.5 rounded-button ps-2 pe-2 text-start" : "flex h-9.5 w-full items-center gap-2.5 rounded-button ps-2 pe-2 text-start", P(o, a), k),
337
397
  children: [
338
- /* @__PURE__ */ w("span", {
398
+ /* @__PURE__ */ D("span", {
339
399
  "aria-hidden": "true",
340
400
  className: "flex size-5.5 shrink-0 items-center justify-center rounded-md bg-linear-to-br from-brand-primary to-brand-secondary text-action-primary-text",
341
- children: o ? /* @__PURE__ */ w(o, { className: "size-3.5" }) : null
401
+ children: s ? /* @__PURE__ */ D(s, { className: "size-3.5" }) : null
342
402
  }),
343
- /* @__PURE__ */ w("span", {
403
+ /* @__PURE__ */ D("span", {
344
404
  className: "min-w-0 flex-1 truncate text-body-sm font-semibold text-text-primary",
345
405
  children: e.label
346
406
  }),
347
- t ? /* @__PURE__ */ w(k, { children: t }) : null
407
+ t ? /* @__PURE__ */ D(R, { children: t }) : null
348
408
  ]
349
409
  })]
350
410
  });
351
411
  }
352
- function X({ view: e, nav: t }) {
353
- let n = e.header?.icon;
354
- return /* @__PURE__ */ T("div", {
412
+ function ue({ view: e, nav: t }) {
413
+ let n = j(), r = e.header?.icon;
414
+ return /* @__PURE__ */ O("div", {
355
415
  className: "pb-1",
356
- children: [e.back ? /* @__PURE__ */ T("button", {
416
+ children: [e.back ? /* @__PURE__ */ O("button", {
357
417
  type: "button",
358
418
  onClick: () => t.back(),
359
419
  "data-shell-back": "",
360
- className: S("flex h-7 w-full items-center gap-2 rounded-button px-2 text-start text-text-secondary hover:bg-bg-sunken hover:text-text-primary", E),
361
- children: [/* @__PURE__ */ w(m, {
420
+ className: T(n ? `flex h-8 w-full items-center gap-2 rounded-button px-2 text-start text-text-secondary ${N} hover:text-text-primary` : "flex h-7 w-full items-center gap-2 rounded-button px-2 text-start text-text-secondary hover:bg-bg-sunken hover:text-text-primary", k),
421
+ children: [/* @__PURE__ */ D(_, {
362
422
  "aria-hidden": "true",
363
- className: S("size-3.5 shrink-0", F)
364
- }), /* @__PURE__ */ w("span", {
423
+ className: T("size-3.5 shrink-0", U)
424
+ }), /* @__PURE__ */ D("span", {
365
425
  className: "truncate text-body-sm",
366
426
  children: e.back.label
367
427
  })]
368
- }) : null, e.header ? /* @__PURE__ */ T("div", {
428
+ }) : null, e.header ? /* @__PURE__ */ O("div", {
369
429
  className: "flex items-center gap-2.5 px-2 pb-2 pt-2.5",
370
- children: [/* @__PURE__ */ w("span", {
430
+ children: [/* @__PURE__ */ D("span", {
371
431
  "aria-hidden": "true",
372
432
  className: "flex size-8 shrink-0 items-center justify-center rounded-button border border-border-subtle bg-bg-elevated",
373
- children: n ? /* @__PURE__ */ w(n, { className: "size-4 text-accent-primary" }) : null
374
- }), /* @__PURE__ */ T("span", {
433
+ children: r ? /* @__PURE__ */ D(r, { className: "size-4 text-accent-primary" }) : null
434
+ }), /* @__PURE__ */ O("span", {
375
435
  className: "flex min-w-0 flex-col",
376
- children: [/* @__PURE__ */ w("h2", {
436
+ children: [/* @__PURE__ */ D("h2", {
377
437
  tabIndex: -1,
378
438
  "data-shell-view-title": "",
379
439
  className: "truncate text-body-md font-bold leading-5 text-text-primary outline-none",
380
440
  children: e.header.title
381
- }), e.header.subtitle ? /* @__PURE__ */ w("span", {
441
+ }), e.header.subtitle ? /* @__PURE__ */ D("span", {
382
442
  className: "truncate text-xs leading-4 text-text-muted",
383
443
  children: e.header.subtitle
384
444
  }) : null]
@@ -386,9 +446,9 @@ function X({ view: e, nav: t }) {
386
446
  }) : null]
387
447
  });
388
448
  }
389
- function ee(e, t) {
390
- let n = f(null), r = f(e.activeView.id), i = e.activeView.id;
391
- return u(() => {
449
+ function de(e, t) {
450
+ let n = h(null), r = h(e.activeView.id), i = e.activeView.id;
451
+ return p(() => {
392
452
  let e = r.current;
393
453
  r.current = i;
394
454
  let a = n.current;
@@ -397,7 +457,7 @@ function ee(e, t) {
397
457
  if (!a || e === i || !o) return;
398
458
  let s = document.activeElement;
399
459
  (!s || s === document.body || o.contains(s)) && (o.querySelector(`[data-shell-drill="${CSS.escape(e)}"]`) ?? o.querySelector("[data-shell-back]") ?? o.querySelector("[data-shell-view-title]") ?? o.querySelector("nav a[href], nav button"))?.focus();
400
- }, [i, t]), d(() => ({
460
+ }, [i, t]), m(() => ({
401
461
  ...e,
402
462
  push: (t) => {
403
463
  n.current = "push", e.push(t);
@@ -407,149 +467,218 @@ function ee(e, t) {
407
467
  }
408
468
  }), [e]);
409
469
  }
410
- function te({ view: e, nav: t, expanded: n }) {
411
- return B(e, t, n).map(({ entry: e, open: t }) => ({
470
+ function fe({ view: e, nav: t, expanded: n }) {
471
+ return q(e, t, n).map(({ entry: e, open: t }) => ({
412
472
  id: e.id,
413
473
  label: e.label,
414
474
  expanded: t
415
475
  }));
416
476
  }
417
- function ne(e, t, n) {
418
- let { view: r, nav: i, expanded: a, setExpanded: o } = e, s = B(r, i, a).find(({ entry: e }) => e.id === t);
419
- return s ? s.open === n ? { status: "already" } : (L(s.entry, s.open, n, {
477
+ function pe(e, t, n) {
478
+ let { view: r, nav: i, expanded: a, setExpanded: o } = e, s = q(r, i, a).find(({ entry: e }) => e.id === t);
479
+ return s ? s.open === n ? { status: "already" } : (W(s.entry, s.open, n, {
420
480
  nav: i,
421
481
  viewId: r.id,
422
482
  setExpanded: o
423
483
  }), { status: "done" }) : { status: "failed" };
424
484
  }
425
- function re(n) {
426
- let { nav: r, rootId: i, topBlock: a, actions: o, footer: c, primaryEntry: u, primaryShortcut: p, rootAfter: m, banner: h, onNavigate: g, hrefFor: _, onTogglePin: v, isPinned: y, onToggleCollapse: b } = n, x = t(), { expanded: S, setExpanded: E } = K(), D = f(null);
427
- s(D);
428
- let O = ee(r, D), k = O.activeView, A = k.id === i, j = f({
429
- nav: O,
430
- view: k,
431
- expanded: S,
432
- setExpanded: E,
485
+ var me = "flex min-h-0 flex-1 flex-col overflow-hidden rounded-2xl border border-border-subtle bg-bg-surface", he = {
486
+ default: {
487
+ aside: "flex h-full w-[272px] shrink-0 flex-col border-e border-border-subtle bg-bg-surface text-text-primary",
488
+ top: "shrink-0 px-2.5 pt-3",
489
+ actions: "shrink-0 px-2.5 pt-3",
490
+ banner: "shrink-0 px-2.5 pt-2.5",
491
+ nav: "scrollbar-slim scrollbar-hover-only min-h-0 flex-1 overflow-y-auto px-2.5 pb-3 pt-2.5",
492
+ footer: "shrink-0 border-t border-border-subtle px-2.5 py-2"
493
+ },
494
+ floating: {
495
+ aside: "flex h-full w-[272px] shrink-0 flex-col py-2 ps-2 text-text-primary",
496
+ top: "shrink-0 px-2 pb-1.5 pt-2",
497
+ actions: "shrink-0 px-2 pb-2",
498
+ banner: "shrink-0 px-2 pb-2",
499
+ nav: "scrollbar-slim scrollbar-hover-only min-h-0 flex-1 overflow-y-auto px-2 pb-2 pt-0.5",
500
+ footer: "shrink-0 px-2 pb-2 pt-1.5"
501
+ }
502
+ };
503
+ function ge(n) {
504
+ let { nav: r, rootId: i, topBlock: a, actions: o, footer: c, primaryEntry: l, primaryShortcut: u, rootAfter: f, banner: p, onNavigate: g, hrefFor: _, onTogglePin: v, isPinned: y, onToggleCollapse: b, appearance: x = "default" } = n, S = x === "floating", C = he[x], w = t(), { expanded: T, setExpanded: k } = oe(), j = h(null);
505
+ s(j);
506
+ let M = de(r, j), N = M.activeView, P = N.id === i, F = h({
507
+ nav: M,
508
+ view: N,
509
+ expanded: T,
510
+ setExpanded: k,
433
511
  onToggleCollapse: b
434
512
  });
435
- l(() => {
436
- j.current = {
437
- nav: O,
438
- view: k,
439
- expanded: S,
440
- setExpanded: E,
513
+ d(() => {
514
+ F.current = {
515
+ nav: M,
516
+ view: N,
517
+ expanded: T,
518
+ setExpanded: k,
441
519
  onToggleCollapse: b
442
520
  };
443
521
  }, [
444
- O,
522
+ M,
523
+ N,
524
+ T,
445
525
  k,
446
- S,
447
- E,
448
526
  b
449
527
  ]);
450
- let M = b !== void 0, N = d(() => M ? {
528
+ let I = b !== void 0, L = m(() => I ? {
451
529
  collapsed: () => !1,
452
530
  setCollapsed: (e) => {
453
- let t = j.current.onToggleCollapse;
531
+ let t = F.current.onToggleCollapse;
454
532
  return e ? t ? (t(), { status: "done" }) : { status: "failed" } : { status: "already" };
455
533
  },
456
- entries: () => te(j.current),
457
- setExpanded: (e, t) => ne(j.current, e, t)
458
- } : null, [M]);
459
- e("sidebar", N);
460
- let P = {
461
- nav: O,
534
+ entries: () => fe(F.current),
535
+ setExpanded: (e, t) => pe(F.current, e, t)
536
+ } : null, [I]);
537
+ e("sidebar", L);
538
+ let R = {
539
+ nav: M,
462
540
  onNavigate: g,
463
541
  hrefFor: _,
464
542
  onTogglePin: v,
465
543
  isPinned: y,
466
- expanded: S,
467
- setExpanded: E
468
- };
469
- return /* @__PURE__ */ T("aside", {
470
- ref: D,
471
- "data-tour": n["data-tour"],
472
- "data-shell-sidebar": "expanded",
473
- "data-shell-view": k.id,
474
- className: "flex h-full w-[272px] shrink-0 flex-col border-e border-border-subtle bg-bg-surface text-text-primary",
475
- children: [
476
- /* @__PURE__ */ w("div", {
477
- className: "shrink-0 px-2.5 pt-3",
478
- children: a
479
- }),
480
- /* @__PURE__ */ w("div", {
481
- className: "shrink-0 px-2.5 pt-3",
482
- children: o
483
- }),
484
- h ? /* @__PURE__ */ w("div", {
485
- "data-shell-sidebar-banner": "",
486
- className: "shrink-0 px-2.5 pt-2.5",
487
- children: h
488
- }) : null,
489
- /* @__PURE__ */ w("nav", {
490
- "aria-label": x("shell.sidebar.navigation", "Main navigation"),
491
- className: "scrollbar-slim scrollbar-hover-only min-h-0 flex-1 overflow-y-auto px-2.5 pb-3 pt-2.5",
492
- children: A ? /* @__PURE__ */ T(C, { children: [
493
- u && r.filterEntries([u]).length > 0 ? /* @__PURE__ */ w(Y, {
494
- entry: u,
495
- shortcut: p,
496
- nav: O,
497
- onNavigate: g,
498
- hrefFor: _
499
- }) : null,
500
- k.sections.map((e) => /* @__PURE__ */ w(J, {
501
- view: k,
502
- section: e,
503
- ...P
504
- }, e.id)),
505
- m
506
- ] }) : /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(X, {
507
- view: k,
508
- nav: O
509
- }), k.sections.map((e) => /* @__PURE__ */ w(J, {
510
- view: k,
544
+ expanded: T,
545
+ setExpanded: k
546
+ }, z = /* @__PURE__ */ O(E, { children: [
547
+ /* @__PURE__ */ D("div", {
548
+ className: C.top,
549
+ children: a
550
+ }),
551
+ /* @__PURE__ */ D("div", {
552
+ className: C.actions,
553
+ children: o
554
+ }),
555
+ p ? /* @__PURE__ */ D("div", {
556
+ "data-shell-sidebar-banner": "",
557
+ className: C.banner,
558
+ children: p
559
+ }) : null,
560
+ /* @__PURE__ */ D("nav", {
561
+ "aria-label": w("shell.sidebar.navigation", "Main navigation"),
562
+ className: C.nav,
563
+ children: P ? /* @__PURE__ */ O(E, { children: [
564
+ l && r.filterEntries([l]).length > 0 ? /* @__PURE__ */ D(le, {
565
+ entry: l,
566
+ shortcut: u,
567
+ nav: M,
568
+ onNavigate: g,
569
+ hrefFor: _
570
+ }) : null,
571
+ N.sections.map((e) => /* @__PURE__ */ D(Q, {
572
+ view: N,
511
573
  section: e,
512
- ...P
513
- }, e.id))] })
514
- }),
515
- /* @__PURE__ */ w("span", {
516
- "aria-live": "polite",
517
- className: "sr-only",
518
- children: A ? "" : k.header?.title ?? ""
519
- }),
520
- /* @__PURE__ */ w("div", {
521
- className: "shrink-0 border-t border-border-subtle px-2.5 py-2",
522
- children: c
574
+ ...R
575
+ }, e.id)),
576
+ f
577
+ ] }) : /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D(ue, {
578
+ view: N,
579
+ nav: M
580
+ }), N.sections.map((e) => /* @__PURE__ */ D(Q, {
581
+ view: N,
582
+ section: e,
583
+ ...R
584
+ }, e.id))] })
585
+ }),
586
+ /* @__PURE__ */ D("span", {
587
+ "aria-live": "polite",
588
+ className: "sr-only",
589
+ children: P ? "" : N.header?.title ?? ""
590
+ }),
591
+ /* @__PURE__ */ D("div", {
592
+ className: C.footer,
593
+ children: c
594
+ })
595
+ ] });
596
+ return /* @__PURE__ */ D(A.Provider, {
597
+ value: x,
598
+ children: /* @__PURE__ */ D("aside", {
599
+ ref: j,
600
+ "data-tour": n["data-tour"],
601
+ "data-shell-sidebar": "expanded",
602
+ "data-shell-view": N.id,
603
+ "data-shell-appearance": S ? "floating" : void 0,
604
+ className: C.aside,
605
+ children: S ? /* @__PURE__ */ D("div", {
606
+ "data-shell-panel": "",
607
+ className: me,
608
+ children: z
609
+ }) : z
610
+ })
611
+ });
612
+ }
613
+ function _e({ label: e, action: t, children: n, open: r, onOpenChange: i, count: a, floating: o }) {
614
+ let s = f();
615
+ return /* @__PURE__ */ O("section", {
616
+ "aria-label": e,
617
+ "data-shell-block": "",
618
+ "data-open": r ? "true" : "false",
619
+ className: "pt-2",
620
+ children: [/* @__PURE__ */ O("div", {
621
+ className: "flex items-center gap-1",
622
+ children: [/* @__PURE__ */ D(se, {
623
+ label: e,
624
+ count: a,
625
+ open: r,
626
+ controls: s,
627
+ floating: o,
628
+ onToggle: () => i(!r)
629
+ }), t]
630
+ }), /* @__PURE__ */ D("div", {
631
+ id: s,
632
+ inert: !r,
633
+ "data-shell-block-body": "",
634
+ className: T("grid transition-[grid-template-rows] duration-normal ease-out motion-reduce:transition-none", r ? "grid-rows-[1fr]" : "grid-rows-[0fr]"),
635
+ children: /* @__PURE__ */ D("div", {
636
+ className: T("-m-0.5 min-h-0 overflow-hidden p-0.5 transition-[visibility] duration-normal motion-reduce:transition-none", r ? "visible" : "invisible"),
637
+ children: n
523
638
  })
524
- ]
639
+ })]
525
640
  });
526
641
  }
527
- function ie({ label: e, action: t, children: n }) {
528
- return /* @__PURE__ */ T("section", {
642
+ function ve({ label: e, action: t, children: n, appearance: r, onOpenChange: i, open: a = !0, count: o }) {
643
+ let s = u(A), c = (r ?? s) === "floating";
644
+ return i ? /* @__PURE__ */ D(_e, {
645
+ label: e,
646
+ action: t,
647
+ open: a,
648
+ onOpenChange: i,
649
+ count: o,
650
+ floating: c,
651
+ children: n
652
+ }) : /* @__PURE__ */ O("section", {
529
653
  "aria-label": e,
530
654
  "data-shell-block": "",
531
- children: [/* @__PURE__ */ T("div", {
532
- className: "flex items-center gap-2 px-2 pb-1.5 pt-3.5",
533
- children: [/* @__PURE__ */ w("span", {
655
+ children: [/* @__PURE__ */ O("div", {
656
+ className: c ? "mt-2 flex h-8 items-center gap-2 px-2" : "flex items-center gap-2 px-2 pb-1.5 pt-3.5",
657
+ children: [/* @__PURE__ */ D("span", {
534
658
  className: "min-w-0 flex-1",
535
- children: /* @__PURE__ */ w(q, { children: e })
659
+ children: /* @__PURE__ */ D(Z, {
660
+ floating: c,
661
+ children: e
662
+ })
536
663
  }), t]
537
664
  }), n]
538
665
  });
539
666
  }
540
- function ae({ icon: e, label: t, active: n = !1, href: r, onClick: i, trailing: a }) {
541
- return /* @__PURE__ */ T("div", {
667
+ function ye({ icon: e, label: t, active: n = !1, href: r, onClick: i, trailing: a, appearance: o }) {
668
+ let s = u(A), c = (o ?? s) === "floating";
669
+ return /* @__PURE__ */ O("div", {
542
670
  "data-active": n ? "true" : void 0,
543
- className: S("group relative flex items-center rounded-button", D(n)),
671
+ "data-depth": F(c),
672
+ className: T("group relative flex items-center rounded-button", P(n, c)),
544
673
  children: [
545
- n ? /* @__PURE__ */ w(O, {}) : null,
546
- /* @__PURE__ */ T(N, {
674
+ n && !c ? /* @__PURE__ */ D(L, {}) : null,
675
+ /* @__PURE__ */ O(H, {
547
676
  href: r,
548
677
  onActivate: i,
549
678
  active: n,
550
679
  title: t,
551
- className: S("flex h-8 min-w-0 flex-1 items-center gap-2.5 rounded-button ps-2 text-start", a ? "pe-1" : "pe-2.5", E),
552
- children: [e ? /* @__PURE__ */ w(e, { className: j(n, "size-3.5") }) : null, /* @__PURE__ */ w("span", {
680
+ className: T(c ? "flex h-7.5 min-w-0 flex-1 items-center gap-2.5 rounded-button ps-2 text-start" : "flex h-8 min-w-0 flex-1 items-center gap-2.5 rounded-button ps-2 text-start", a ? "pe-1" : c ? "pe-2" : "pe-2.5", k),
681
+ children: [e ? /* @__PURE__ */ D(e, { className: B(n, "size-3.5") }) : null, /* @__PURE__ */ D("span", {
553
682
  className: "min-w-0 flex-1 truncate text-body-sm",
554
683
  children: t
555
684
  })]
@@ -558,155 +687,178 @@ function ae({ icon: e, label: t, active: n = !1, href: r, onClick: i, trailing:
558
687
  ]
559
688
  });
560
689
  }
561
- function Z({ label: e, hint: t }) {
562
- return /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w("span", {
690
+ function be({ label: e, hint: t }) {
691
+ return /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D("span", {
563
692
  className: "text-body-sm font-normal",
564
693
  children: e
565
- }), t ? /* @__PURE__ */ w(k, {
694
+ }), t ? /* @__PURE__ */ D(R, {
566
695
  className: "bg-bg-surface",
567
696
  children: t
568
697
  }) : null] });
569
698
  }
570
- function Q({ label: e, hint: t, icon: o, active: s = !1, badge: c, href: l, onClick: u, entryId: d, testId: f }) {
571
- let p = c ? `${e}, ${c.value}` : e, m = t ? `${e}, ${t}` : p, h = S("relative mx-auto flex size-10 items-center justify-center rounded-button", s ? "bg-accent-soft text-accent-primary" : "text-text-secondary hover:bg-bg-sunken hover:text-text-primary", E), g = /* @__PURE__ */ T(C, { children: [
572
- s ? /* @__PURE__ */ w(O, { offsetClass: "-start-3" }) : null,
573
- /* @__PURE__ */ w(o, { className: "size-4" }),
574
- c ? /* @__PURE__ */ w("span", {
699
+ function xe(e, t) {
700
+ return t ? e ? `border border-border-default ${M} text-accent-primary` : `border border-transparent text-text-secondary ${N} hover:text-text-primary` : e ? "bg-accent-soft text-accent-primary" : "text-text-secondary hover:bg-bg-sunken hover:text-text-primary";
701
+ }
702
+ function $({ label: e, hint: t, icon: o, active: s = !1, badge: c, href: l, onClick: u, entryId: d, testId: f }) {
703
+ let p = j(), m = c ? `${e}, ${c.value}` : e, h = t ? `${e}, ${t}` : m, g = T("relative mx-auto flex size-10 items-center justify-center rounded-button", xe(s, p), k), _ = /* @__PURE__ */ O(E, { children: [
704
+ s && !p ? /* @__PURE__ */ D(L, { offsetClass: "-start-3" }) : null,
705
+ /* @__PURE__ */ D(o, { className: "size-4" }),
706
+ c ? /* @__PURE__ */ D("span", {
575
707
  className: "absolute end-1 top-1",
576
- children: /* @__PURE__ */ w(A, {
708
+ children: /* @__PURE__ */ D(z, {
577
709
  badge: c,
578
710
  compact: !0
579
711
  })
580
712
  }) : null
581
713
  ] });
582
- return /* @__PURE__ */ T(n, {
714
+ return /* @__PURE__ */ O(n, {
583
715
  delayDuration: 200,
584
- children: [/* @__PURE__ */ w(i, {
716
+ children: [/* @__PURE__ */ D(i, {
585
717
  asChild: !0,
586
- children: l ? /* @__PURE__ */ w("a", {
718
+ children: l ? /* @__PURE__ */ D("a", {
587
719
  href: l,
588
720
  onClick: a(u),
589
- "aria-label": m,
721
+ "aria-label": h,
590
722
  "aria-current": s ? "page" : void 0,
591
723
  "data-shell-entry": d,
592
724
  "data-testid": f,
593
725
  "data-active": s ? "true" : void 0,
594
- className: h,
595
- children: g
596
- }) : /* @__PURE__ */ w("button", {
726
+ "data-depth": F(p),
727
+ className: g,
728
+ children: _
729
+ }) : /* @__PURE__ */ D("button", {
597
730
  type: "button",
598
731
  onClick: u,
599
- "aria-label": m,
732
+ "aria-label": h,
600
733
  "aria-current": s ? "page" : void 0,
601
734
  "data-shell-entry": d,
602
735
  "data-testid": f,
603
736
  "data-active": s ? "true" : void 0,
604
- className: h,
605
- children: g
737
+ "data-depth": F(p),
738
+ className: g,
739
+ children: _
606
740
  })
607
- }), /* @__PURE__ */ w(r, {
741
+ }), /* @__PURE__ */ D(r, {
608
742
  side: "right",
609
743
  sideOffset: 10,
610
744
  className: "flex items-center gap-2 rounded-md border border-border-subtle bg-popover px-2 py-1 text-text-primary shadow-overlay",
611
- children: /* @__PURE__ */ w(Z, {
745
+ children: /* @__PURE__ */ D(be, {
612
746
  label: e,
613
747
  hint: t
614
748
  })
615
749
  })]
616
750
  });
617
751
  }
618
- function $() {
619
- return /* @__PURE__ */ w("span", {
752
+ function Se() {
753
+ return /* @__PURE__ */ D("span", {
620
754
  "aria-hidden": "true",
621
755
  className: "mx-auto my-1.5 h-px w-8 shrink-0 bg-border-subtle"
622
756
  });
623
757
  }
624
- function oe(n) {
625
- let { nav: r, views: i, rootId: a, primaryEntry: c, banner: u, onNavigate: p, hrefFor: m, logo: h, onExpand: g, onNew: _, newSlot: y, onSearch: S, bell: C, avatar: E } = n, D = t(), O = f(null);
626
- s(O);
627
- let k = f(g);
628
- l(() => {
629
- k.current = g;
758
+ var Ce = {
759
+ default: {
760
+ aside: "flex h-full w-16 shrink-0 flex-col border-e border-border-subtle bg-bg-surface text-text-primary",
761
+ logo: "flex shrink-0 justify-center pt-4"
762
+ },
763
+ floating: {
764
+ aside: "flex h-full w-16 shrink-0 flex-col py-2 ps-2 text-text-primary",
765
+ logo: "flex shrink-0 justify-center pt-3.5"
766
+ }
767
+ };
768
+ function we(n) {
769
+ let { nav: r, views: i, rootId: a, primaryEntry: c, banner: l, onNavigate: u, hrefFor: f, logo: p, onExpand: g, onNew: _, newSlot: v, onSearch: y, bell: b, avatar: S, appearance: T = "default" } = n, k = T === "floating", j = Ce[T], M = t(), N = h(null);
770
+ s(N);
771
+ let P = h(g);
772
+ d(() => {
773
+ P.current = g;
630
774
  }, [g]);
631
- let A = d(() => ({
775
+ let F = m(() => ({
632
776
  collapsed: () => !0,
633
- setCollapsed: (e) => e ? { status: "already" } : (k.current(), { status: "done" }),
777
+ setCollapsed: (e) => e ? { status: "already" } : (P.current(), { status: "done" }),
634
778
  entries: () => [],
635
779
  setExpanded: () => ({ status: "failed" })
636
780
  }), []);
637
- e("sidebar", A);
638
- let j = i.find((e) => e.id === a) ?? i[0], N = j ? r.curateEntries(j.sections.flatMap((e) => e.entries), `${j.id}:rail`).filter((e) => !o(e)) : [], P = c ? r.filterEntries([c])[0] : void 0, F = (e) => {
639
- e.drillTo && r.push(e.drillTo), e.path ? p(e.path) : e.drillTo && g();
640
- }, I = (e) => r.isEntryActive(e) || e.drillTo !== void 0 && r.activeView.id === e.drillTo || (e.children ?? []).some((e) => o(e) ? (e.children ?? []).some((e) => r.isEntryActive(e)) : r.isEntryActive(e));
641
- return /* @__PURE__ */ T("aside", {
642
- ref: O,
643
- "data-tour": n["data-tour"],
644
- "data-shell-sidebar": "rail",
645
- className: "flex h-full w-16 shrink-0 flex-col border-e border-border-subtle bg-bg-surface text-text-primary",
646
- children: [
647
- /* @__PURE__ */ w("div", {
648
- className: "flex shrink-0 justify-center pt-4",
649
- children: h
650
- }),
651
- u ? /* @__PURE__ */ w("div", {
652
- "data-shell-sidebar-banner": "",
653
- className: "flex shrink-0 justify-center px-1 pt-2.5",
654
- children: u
655
- }) : null,
656
- /* @__PURE__ */ T("nav", {
657
- "aria-label": D("shell.sidebar.navigation", "Main navigation"),
658
- className: "scrollbar-slim flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto pt-2.5",
659
- children: [
660
- /* @__PURE__ */ w(Q, {
661
- label: D("shell.sidebar.expand", "Expand sidebar"),
662
- icon: v,
663
- onClick: g,
664
- testId: "shell-rail-expand"
665
- }),
666
- y ? /* @__PURE__ */ w("div", {
667
- className: "flex justify-center",
668
- children: y
669
- }) : /* @__PURE__ */ w(Q, {
670
- label: D("shell.sidebar.new", "New"),
671
- icon: b,
672
- onClick: _
673
- }),
674
- /* @__PURE__ */ w(Q, {
675
- label: D("shell.sidebar.search", "Search"),
676
- icon: x,
677
- onClick: S
678
- }),
679
- /* @__PURE__ */ w($, {}),
680
- P?.icon ? /* @__PURE__ */ w(Q, {
681
- label: P.label,
682
- icon: P.icon,
683
- active: I(P),
684
- href: M(P.path, m),
685
- onClick: () => F(P),
686
- entryId: P.id
687
- }) : null,
688
- N.map((e) => e.icon ? /* @__PURE__ */ w(Q, {
689
- label: e.label,
690
- hint: e.badge?.hint,
691
- icon: e.icon,
692
- active: I(e),
693
- badge: e.badge,
694
- href: M(e.path, m),
695
- onClick: () => F(e),
696
- entryId: e.id
697
- }, e.id) : null),
698
- /* @__PURE__ */ w($, {}),
699
- /* @__PURE__ */ w("div", {
700
- className: "flex justify-center",
701
- children: C
702
- })
703
- ]
704
- }),
705
- /* @__PURE__ */ w("div", {
706
- className: "flex shrink-0 justify-center border-t border-border-subtle py-3",
707
- children: E
708
- })
709
- ]
781
+ e("sidebar", F);
782
+ let I = i.find((e) => e.id === a) ?? i[0], L = I ? r.curateEntries(I.sections.flatMap((e) => e.entries), `${I.id}:rail`).filter((e) => !o(e)) : [], R = c ? r.filterEntries([c])[0] : void 0, z = (e) => {
783
+ e.drillTo && r.push(e.drillTo), e.path ? u(e.path) : e.drillTo && g();
784
+ }, B = (e) => r.isEntryActive(e) || e.drillTo !== void 0 && r.activeView.id === e.drillTo || (e.children ?? []).some((e) => o(e) ? (e.children ?? []).some((e) => r.isEntryActive(e)) : r.isEntryActive(e)), H = /* @__PURE__ */ O(E, { children: [
785
+ /* @__PURE__ */ D("div", {
786
+ className: j.logo,
787
+ children: p
788
+ }),
789
+ l ? /* @__PURE__ */ D("div", {
790
+ "data-shell-sidebar-banner": "",
791
+ className: "flex shrink-0 justify-center px-1 pt-2.5",
792
+ children: l
793
+ }) : null,
794
+ /* @__PURE__ */ O("nav", {
795
+ "aria-label": M("shell.sidebar.navigation", "Main navigation"),
796
+ className: "scrollbar-slim flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto pt-2.5",
797
+ children: [
798
+ /* @__PURE__ */ D($, {
799
+ label: M("shell.sidebar.expand", "Expand sidebar"),
800
+ icon: x,
801
+ onClick: g,
802
+ testId: "shell-rail-expand"
803
+ }),
804
+ v ? /* @__PURE__ */ D("div", {
805
+ className: "flex justify-center",
806
+ children: v
807
+ }) : /* @__PURE__ */ D($, {
808
+ label: M("shell.sidebar.new", "New"),
809
+ icon: C,
810
+ onClick: _
811
+ }),
812
+ /* @__PURE__ */ D($, {
813
+ label: M("shell.sidebar.search", "Search"),
814
+ icon: w,
815
+ onClick: y
816
+ }),
817
+ /* @__PURE__ */ D(Se, {}),
818
+ R?.icon ? /* @__PURE__ */ D($, {
819
+ label: R.label,
820
+ icon: R.icon,
821
+ active: B(R),
822
+ href: V(R.path, f),
823
+ onClick: () => z(R),
824
+ entryId: R.id
825
+ }) : null,
826
+ L.map((e) => e.icon ? /* @__PURE__ */ D($, {
827
+ label: e.label,
828
+ hint: e.badge?.hint,
829
+ icon: e.icon,
830
+ active: B(e),
831
+ badge: e.badge,
832
+ href: V(e.path, f),
833
+ onClick: () => z(e),
834
+ entryId: e.id
835
+ }, e.id) : null),
836
+ /* @__PURE__ */ D(Se, {}),
837
+ /* @__PURE__ */ D("div", {
838
+ className: "flex justify-center",
839
+ children: b
840
+ })
841
+ ]
842
+ }),
843
+ /* @__PURE__ */ D("div", {
844
+ className: "flex shrink-0 justify-center border-t border-border-subtle py-3",
845
+ children: S
846
+ })
847
+ ] });
848
+ return /* @__PURE__ */ D(A.Provider, {
849
+ value: T,
850
+ children: /* @__PURE__ */ D("aside", {
851
+ ref: N,
852
+ "data-tour": n["data-tour"],
853
+ "data-shell-sidebar": "rail",
854
+ "data-shell-appearance": k ? "floating" : void 0,
855
+ className: j.aside,
856
+ children: k ? /* @__PURE__ */ D("div", {
857
+ "data-shell-panel": "",
858
+ className: me,
859
+ children: H
860
+ }) : H
861
+ })
710
862
  });
711
863
  }
712
- export { k as ShellKbd, Z as ShellRailTooltipLabel, re as ShellSidebar, ae as ShellSidebarCompactRow, oe as ShellSidebarRail, ie as ShellSidebarSection };
864
+ export { R as ShellKbd, be as ShellRailTooltipLabel, ge as ShellSidebar, ye as ShellSidebarCompactRow, we as ShellSidebarRail, ve as ShellSidebarSection };