laif-ds 0.2.92 → 1.0.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.
@@ -1,67 +1,92 @@
1
1
  "use client";
2
- import { jsxs as n, jsx as t, Fragment as R } from "react/jsx-runtime";
3
- import * as s from "react";
4
- import { designTokens as J } from "../design-tokens.js";
5
- import { DropdownMenu as Q, DropdownMenuTrigger as U, DropdownMenuContent as V, DropdownMenuItem as W } from "./dropdown-menu.js";
6
- import { Icon as h } from "./icon.js";
7
- import { useSidebar as X, Sidebar as Y, SidebarHeader as Z, SidebarContent as _, SidebarRail as k, SidebarGroup as P, SidebarGroupLabel as L, SidebarGroupContent as ee, SidebarMenu as re, SidebarMenuItem as x, SidebarMenuButton as M, SidebarMenuSub as te, SidebarMenuSubItem as ie, SidebarMenuSubButton as T } from "./sidebar.js";
8
- import { Tooltip as ne, TooltipTrigger as ce, TooltipContent as se } from "./tooltip.js";
9
- import { cn as le } from "../../lib/utils.js";
10
- const $ = (c, l) => `${c.title} ${l.url} ${l.title}`, D = (c) => `${c.url} ${c.title}`;
11
- function me({
12
- navigation: c,
13
- navigationFooter: l,
14
- headerContent: w,
15
- footerContent: j,
16
- showRail: z = !0,
17
- collapsible: f,
18
- linkComponent: a,
19
- linkProps: p = {},
20
- ...G
2
+ import { jsx as t, jsxs as s, Fragment as E } from "react/jsx-runtime";
3
+ import * as o from "react";
4
+ import { designTokens as l } from "../design-tokens.js";
5
+ import { AppSidebarMobile as de } from "./app-sidebar-mobile.js";
6
+ import { DropdownMenu as q, DropdownMenuTrigger as J, DropdownMenuContent as Q, DropdownMenuRadioGroup as ue, DropdownMenuRadioItem as he, DropdownMenuItem as pe } from "./dropdown-menu.js";
7
+ import { Icon as k } from "./icon.js";
8
+ import { useSidebar as fe, Sidebar as W, SidebarHeader as me, SidebarContent as be, SidebarRail as ge, SidebarGroup as z, SidebarSeparator as ve, SidebarGroupLabel as xe, SidebarGroupContent as Se, SidebarMenu as Ne, SidebarMenuItem as D, SidebarMenuButton as _, SidebarMenuSub as Ae, SidebarMenuSubItem as we, SidebarMenuSubButton as X } from "./sidebar.js";
9
+ import { Tabs as ye, TabsList as Me, TabsContent as Te, TabsTrigger as Ce } from "./tabs.js";
10
+ import { Tooltip as j, TooltipTrigger as K, TooltipContent as O } from "./tooltip.js";
11
+ import { cn as d } from "../../lib/utils.js";
12
+ const Z = (i, a) => `${i.title} ${a.url} ${a.title}`, P = (i) => `${i.url} ${i.title}`, Ie = { xs: "size-4", sm: "size-5" }, T = (i, a, b) => {
13
+ if (i.icon) {
14
+ const h = i.icon;
15
+ return /* @__PURE__ */ t(h, { className: d(Ie[a], "shrink-0", b) });
16
+ }
17
+ return i.iconName ? /* @__PURE__ */ t(k, { name: i.iconName, size: a, className: b }) : null;
18
+ }, C = "__group-selector";
19
+ function Oe({
20
+ navigation: i,
21
+ navigationFooter: a,
22
+ navigationDisplay: b = "list",
23
+ headerContent: h,
24
+ footerContent: B,
25
+ showRail: L = !0,
26
+ collapsible: g,
27
+ linkComponent: u,
28
+ linkProps: v = {},
29
+ ...F
21
30
  }) {
22
- const { state: K, isMobile: I } = X(), B = s.useId(), m = f === "icon" && K === "collapsed" && !I, [O, y] = s.useState({}), g = s.useMemo(
23
- () => [...c, ...l ?? []].flatMap(
31
+ const { state: ee, isMobile: V } = fe(), re = o.useId(), x = g === "icon" && ee === "collapsed" && !V, [te, H] = o.useState({}), I = o.useMemo(
32
+ () => [...i, ...a ?? []].flatMap(
24
33
  (e) => e.items.filter(
25
- (r) => r.subItems?.length && (r.isActive || r.subItems.some((i) => i.isActive))
26
- ).map((r) => $(e, r))
34
+ (r) => r.subItems?.length && (r.isActive || r.subItems.some((n) => n.isActive))
35
+ ).map((r) => Z(e, r))
27
36
  ).join("|"),
28
- [c, l]
37
+ [i, a]
29
38
  );
30
- s.useEffect(() => {
31
- g && y((e) => {
32
- const r = g.split("|").filter((i) => e[i] === void 0);
33
- return r.length ? { ...e, ...Object.fromEntries(r.map((i) => [i, !0])) } : e;
39
+ o.useEffect(() => {
40
+ I && H((e) => {
41
+ const r = I.split("|").filter((n) => e[n] === void 0);
42
+ return r.length ? { ...e, ...Object.fromEntries(r.map((n) => [n, !0])) } : e;
34
43
  });
35
- }, [g]);
36
- const v = s.useRef(/* @__PURE__ */ new Map()), A = s.useRef(null), N = (e) => (r) => {
37
- r ? v.current.set(e, r) : v.current.delete(e);
44
+ }, [I]);
45
+ const $ = o.useRef(/* @__PURE__ */ new Map()), p = o.useRef(null), S = (e) => (r) => {
46
+ r ? $.current.set(e, r) : $.current.delete(e);
38
47
  };
39
- s.useLayoutEffect(() => {
40
- const e = A.current;
41
- !e || document.activeElement !== document.body || v.current.get(e)?.focus();
42
- }, [m]);
43
- const o = (e) => e.iconName ? /* @__PURE__ */ t(h, { name: e.iconName, size: "sm" }) : f !== "icon" ? null : /* @__PURE__ */ t(
44
- "span",
45
- {
46
- "aria-hidden": "true",
47
- className: "flex size-4 shrink-0 items-center justify-center text-xs font-semibold uppercase opacity-0 transition-opacity group-data-[collapsible=icon]:opacity-100",
48
- children: e.title.charAt(0)
49
- }
50
- ), F = (e) => {
51
- const r = /* @__PURE__ */ n(R, { children: [
52
- e.iconName && /* @__PURE__ */ t(h, { name: e.iconName, size: "xs" }),
48
+ o.useLayoutEffect(() => {
49
+ const e = p.current;
50
+ !e || document.activeElement !== document.body || $.current.get(e)?.focus();
51
+ }, [x]);
52
+ const ne = b === "tab" && i.length > 1, N = o.useMemo(() => {
53
+ const e = i.findIndex(
54
+ (r) => r.items.some(
55
+ (n) => n.isActive || n.subItems?.some((c) => c.isActive)
56
+ )
57
+ );
58
+ return e === -1 ? null : e;
59
+ }, [i]), [U, G] = o.useState(
60
+ N ?? 0
61
+ );
62
+ o.useEffect(() => {
63
+ N !== null && G(N);
64
+ }, [N]);
65
+ const A = U < i.length ? U : 0, w = (e) => {
66
+ const r = T(e, "sm");
67
+ return r || (g !== "icon" ? null : /* @__PURE__ */ t(
68
+ "span",
69
+ {
70
+ "aria-hidden": "true",
71
+ className: "flex size-4 shrink-0 items-center justify-center text-xs font-semibold uppercase opacity-0 transition-opacity group-data-[collapsible=icon]:opacity-100",
72
+ children: e.title.charAt(0)
73
+ }
74
+ ));
75
+ }, ie = (e) => {
76
+ const r = /* @__PURE__ */ s(E, { children: [
77
+ T(e, "xs"),
53
78
  /* @__PURE__ */ t("span", { children: e.title })
54
79
  ] });
55
- return a ? /* @__PURE__ */ t(T, { isActive: e.isActive, asChild: !0, children: /* @__PURE__ */ t(
56
- a,
80
+ return u ? /* @__PURE__ */ t(X, { isActive: e.isActive, asChild: !0, children: /* @__PURE__ */ t(
81
+ u,
57
82
  {
58
83
  href: e.url,
59
84
  className: "flex w-full items-center gap-2",
60
85
  "aria-current": e.isActive ? "page" : void 0,
61
- ...p,
86
+ ...v,
62
87
  children: r
63
88
  }
64
- ) }) : /* @__PURE__ */ t(T, { isActive: e.isActive, asChild: !0, children: /* @__PURE__ */ t(
89
+ ) }) : /* @__PURE__ */ t(X, { isActive: e.isActive, asChild: !0, children: /* @__PURE__ */ t(
65
90
  "a",
66
91
  {
67
92
  href: e.url,
@@ -70,141 +95,373 @@ function me({
70
95
  children: r
71
96
  }
72
97
  ) });
73
- }, H = (e) => {
74
- const r = /* @__PURE__ */ n(R, { children: [
75
- e.iconName && /* @__PURE__ */ t(h, { name: e.iconName, size: "xs" }),
98
+ }, se = (e) => {
99
+ const r = /* @__PURE__ */ s(E, { children: [
100
+ T(e, "xs"),
76
101
  /* @__PURE__ */ t("span", { children: e.title })
77
- ] }), i = le(
102
+ ] }), n = d(
78
103
  "flex w-full items-center gap-2",
79
- e.isActive && J.dropdownItem.selected
104
+ e.isActive && l.dropdownItem.selected
80
105
  );
81
- return /* @__PURE__ */ t(W, { asChild: !0, children: a ? /* @__PURE__ */ t(
82
- a,
106
+ return /* @__PURE__ */ t(pe, { asChild: !0, children: u ? /* @__PURE__ */ t(
107
+ u,
83
108
  {
84
109
  href: e.url,
85
- className: i,
110
+ className: n,
86
111
  "aria-current": e.isActive ? "page" : void 0,
87
- ...p,
112
+ ...v,
88
113
  children: r
89
114
  }
90
115
  ) : /* @__PURE__ */ t(
91
116
  "a",
92
117
  {
93
118
  href: e.url,
94
- className: i,
119
+ className: n,
95
120
  "aria-current": e.isActive ? "page" : void 0,
96
121
  children: r
97
122
  }
98
- ) }, D(e));
99
- }, q = (e, r) => {
100
- const i = $(e, r), S = r.subItems ?? [], b = O[i] ?? !1, E = `${B}-${i.replace(/[^\w-]+/g, "-")}-submenu`, u = /* @__PURE__ */ t("span", { className: "truncate", children: r.title });
101
- return S.length === 0 ? /* @__PURE__ */ t(x, { children: /* @__PURE__ */ t(
102
- M,
123
+ ) }, P(e));
124
+ }, ce = (e, r) => {
125
+ const n = Z(e, r), c = r.subItems ?? [], f = te[n] ?? !1, Y = `${re}-${n.replace(/[^\w-]+/g, "-")}-submenu`, M = /* @__PURE__ */ t("span", { className: "truncate", children: r.title });
126
+ return c.length === 0 ? /* @__PURE__ */ t(D, { children: /* @__PURE__ */ t(
127
+ _,
103
128
  {
104
129
  asChild: !0,
105
130
  isActive: r.isActive,
106
131
  tooltip: r.title,
107
- children: a ? /* @__PURE__ */ n(
108
- a,
132
+ children: u ? /* @__PURE__ */ s(
133
+ u,
109
134
  {
110
135
  href: r.url,
111
136
  "aria-current": r.isActive ? "page" : void 0,
112
- ...p,
137
+ ...v,
113
138
  children: [
114
- o(r),
115
- u
139
+ w(r),
140
+ M
116
141
  ]
117
142
  }
118
- ) : /* @__PURE__ */ n(
143
+ ) : /* @__PURE__ */ s(
119
144
  "a",
120
145
  {
121
146
  href: r.url,
122
147
  "aria-current": r.isActive ? "page" : void 0,
123
148
  children: [
124
- o(r),
125
- u
149
+ w(r),
150
+ M
126
151
  ]
127
152
  }
128
153
  )
129
154
  }
130
- ) }, i) : m ? /* @__PURE__ */ t(x, { children: /* @__PURE__ */ n(ne, { children: [
131
- /* @__PURE__ */ n(Q, { modal: !1, children: [
132
- /* @__PURE__ */ t(U, { asChild: !0, children: /* @__PURE__ */ t(ce, { asChild: !0, children: /* @__PURE__ */ n(
133
- M,
155
+ ) }, n) : x ? /* @__PURE__ */ t(D, { children: /* @__PURE__ */ s(j, { children: [
156
+ /* @__PURE__ */ s(q, { modal: !1, children: [
157
+ /* @__PURE__ */ t(J, { asChild: !0, children: /* @__PURE__ */ t(K, { asChild: !0, children: /* @__PURE__ */ s(
158
+ _,
134
159
  {
135
- ref: N(i),
160
+ ref: S(n),
136
161
  type: "button",
137
162
  isActive: r.isActive,
138
163
  onFocus: () => {
139
- A.current = i;
164
+ p.current = n;
140
165
  },
141
166
  children: [
142
- o(r),
143
- u
167
+ w(r),
168
+ M
144
169
  ]
145
170
  }
146
171
  ) }) }),
147
172
  /* @__PURE__ */ t(
148
- V,
173
+ Q,
149
174
  {
150
175
  side: "right",
151
176
  align: "start",
152
177
  sideOffset: 8,
153
178
  className: "min-w-48",
154
- children: S.map(H)
179
+ children: c.map(se)
155
180
  }
156
181
  )
157
182
  ] }),
158
183
  /* @__PURE__ */ t(
159
- se,
184
+ O,
160
185
  {
161
186
  side: "right",
162
187
  align: "center",
163
- hidden: !m,
188
+ hidden: !x,
164
189
  children: r.title
165
190
  }
166
191
  )
167
- ] }) }, i) : /* @__PURE__ */ n(x, { children: [
168
- /* @__PURE__ */ n(
169
- M,
192
+ ] }) }, n) : /* @__PURE__ */ s(D, { children: [
193
+ /* @__PURE__ */ s(
194
+ _,
170
195
  {
171
- ref: N(i),
196
+ ref: S(n),
172
197
  type: "button",
173
198
  isActive: r.isActive,
174
199
  tooltip: r.title,
175
- "aria-expanded": b,
176
- "aria-controls": E,
200
+ "aria-expanded": f,
201
+ "aria-controls": Y,
177
202
  onFocus: () => {
178
- A.current = i;
203
+ p.current = n;
179
204
  },
180
- onClick: () => y((d) => ({ ...d, [i]: !d[i] })),
205
+ onClick: () => H((m) => ({ ...m, [n]: !m[n] })),
181
206
  children: [
182
- o(r),
183
- u,
207
+ w(r),
208
+ M,
184
209
  /* @__PURE__ */ t(
185
- h,
210
+ k,
186
211
  {
187
- name: b ? "ChevronDown" : "ChevronRight",
212
+ name: f ? "ChevronDown" : "ChevronRight",
188
213
  className: "text-d-muted-foreground ml-auto size-4 shrink-0 group-data-[collapsible=icon]:hidden"
189
214
  }
190
215
  )
191
216
  ]
192
217
  }
193
218
  ),
194
- b && /* @__PURE__ */ t(te, { id: E, children: S.map((d) => /* @__PURE__ */ t(ie, { children: F(d) }, D(d))) })
195
- ] }, i);
196
- }, C = (e) => /* @__PURE__ */ n(P, { children: [
197
- e.title && /* @__PURE__ */ t(L, { children: e.title }),
198
- /* @__PURE__ */ t(ee, { children: /* @__PURE__ */ t(re, { children: e.items.map((r) => q(e, r)) }) })
199
- ] }, e.title);
200
- return /* @__PURE__ */ n(Y, { collapsible: f, ...G, children: [
201
- w && /* @__PURE__ */ t(Z, { children: w }),
202
- /* @__PURE__ */ t(_, { children: c.map((e) => C(e)) }),
203
- l?.map((e) => C(e)),
204
- j,
205
- z && /* @__PURE__ */ t(k, {})
219
+ f && /* @__PURE__ */ t(Ae, { id: Y, children: c.map((m) => /* @__PURE__ */ t(we, { children: ie(m) }, P(m))) })
220
+ ] }, n);
221
+ }, y = (e, r = !0, n) => /* @__PURE__ */ s(
222
+ z,
223
+ {
224
+ role: n ? "group" : void 0,
225
+ "aria-label": n,
226
+ children: [
227
+ r && e.title && /* @__PURE__ */ t(xe, { children: e.title }),
228
+ /* @__PURE__ */ t(Se, { children: /* @__PURE__ */ t(Ne, { children: e.items.map((c) => ce(e, c)) }) })
229
+ ]
230
+ },
231
+ e.title
232
+ ), R = (e) => {
233
+ const r = T(e, "sm");
234
+ return r || /* @__PURE__ */ t(
235
+ "span",
236
+ {
237
+ "aria-hidden": "true",
238
+ className: "flex size-4 shrink-0 items-center justify-center text-xs font-semibold uppercase",
239
+ children: e.title.charAt(0)
240
+ }
241
+ );
242
+ }, ae = (e, r) => {
243
+ const n = `${r} ${e.title}`, c = r === A, f = /* @__PURE__ */ s(
244
+ Ce,
245
+ {
246
+ value: String(r),
247
+ ref: c ? S(C) : void 0,
248
+ onFocus: c ? () => {
249
+ p.current = C;
250
+ } : void 0,
251
+ className: d(
252
+ "text-d-sidebar-foreground/70 h-8 min-w-0 flex-initial justify-start gap-0 p-2",
253
+ // Overrides the `transition-all duration-200` the primitive inherits
254
+ // from `focusRing`: `all` would also pick up the width the label
255
+ // animation drives from the child, and 200ms/`ease-out` is not the
256
+ // house curve.
257
+ //
258
+ // No `interaction.active` here. These tabs are styled as sidebar rows,
259
+ // and no row in the sidebar squashes — `SidebarMenuButton` has no
260
+ // press state at all, and `app-sidebar-mobile.tsx` turns the token
261
+ // down in as many words ("that is the button squash, wrong on a list
262
+ // row"). A tab that squashed above nav rows that do not would break
263
+ // the rail's homogeneity, which is the same reason the icon-mode
264
+ // selector button below refuses it.
265
+ "transition-[box-shadow,background-color,border-color,color]",
266
+ l.motion.duration,
267
+ l.motion.ease,
268
+ // Only the *unselected* tabs take a hover tint.
269
+ // `hover:bg-d-sidebar-accent/50` has specificity 0-2-0 and so beat the
270
+ // selected tab's own background, halving its alpha (0.4 -> 0.2): the
271
+ // hover *lightened* the selected tab instead of darkening it. The
272
+ // pointer query is the second half of the same fix — without it a tap
273
+ // on a tablet (>= 768px, where this bar is rendered) leaves the hover
274
+ // tint stuck on the tab it opened.
275
+ !c && "[@media(hover:hover)_and_(pointer:fine)]:hover:bg-d-sidebar-accent/50 [@media(hover:hover)_and_(pointer:fine)]:hover:text-d-sidebar-accent-foreground",
276
+ c && "bg-d-sidebar-accent text-d-sidebar-accent-foreground font-semibold shadow-none"
277
+ ),
278
+ children: [
279
+ R(e),
280
+ /* @__PURE__ */ t(
281
+ "span",
282
+ {
283
+ className: d(
284
+ // Deliberate exception: `grid-template-columns` is a layout
285
+ // property, so this animation runs on the main thread and cannot be
286
+ // composited. It is kept on purpose — it is the only CSS-only way to
287
+ // animate to the *content's* width (`width: auto` is not
288
+ // animatable), and the alternative is a JS measurement or a
289
+ // `max-width` guess to keep in sync with the longest title. The cost
290
+ // is bounded by there being a handful of tabs, each reflowing a
291
+ // single text node. Do not "fix" this into a transform.
292
+ "grid grid-cols-[0fr] transition-[grid-template-columns] motion-reduce:transition-none",
293
+ l.motion.duration,
294
+ l.motion.ease,
295
+ c && "grid-cols-[1fr]"
296
+ ),
297
+ children: /* @__PURE__ */ t(
298
+ "span",
299
+ {
300
+ className: d(
301
+ // `text-ellipsis` needs all three of overflow/nowrap/ellipsis on
302
+ // this box: it is the grid item, so the 0fr/1fr column is what
303
+ // gives it the definite width the text overflows.
304
+ "overflow-hidden text-ellipsis whitespace-nowrap",
305
+ // Clipping alone let the text slide out from under the icon with a
306
+ // hard edge, so it fades. Asymmetric on purpose, and both halves
307
+ // are timed against the *same* front-loaded curve the width uses —
308
+ // which covers ~90% of its travel in the first quarter of its
309
+ // 160ms, so "half the duration" would not have been half the
310
+ // distance.
311
+ // Exit: 60ms, no delay. Measured, the tab is ~91% shut 43ms in,
312
+ // so anything slower leaves the text visibly under the closing
313
+ // edge; at 60ms on this curve it is at ~2% opacity by then.
314
+ // Entry: delayed 70ms, by which point the box is already ~88%
315
+ // open. That delay doubles as the ellipsis mitigation — the
316
+ // narrow "A…"/"Am…" intermediate states play out while the text
317
+ // is still transparent.
318
+ "transition-opacity motion-reduce:transition-none",
319
+ l.motion.ease,
320
+ c ? "opacity-100 delay-[70ms] duration-[140ms]" : "opacity-0 delay-0 duration-[60ms]"
321
+ ),
322
+ children: /* @__PURE__ */ t("span", { className: "pl-2", children: e.title })
323
+ }
324
+ )
325
+ }
326
+ )
327
+ ]
328
+ },
329
+ n
330
+ );
331
+ return /* @__PURE__ */ s(j, { children: [
332
+ /* @__PURE__ */ t(K, { asChild: !0, children: f }),
333
+ /* @__PURE__ */ t(O, { side: "right", align: "center", hidden: c, children: e.title })
334
+ ] }, n);
335
+ }, oe = () => {
336
+ const e = i[A];
337
+ return /* @__PURE__ */ s(E, { children: [
338
+ /* @__PURE__ */ t(z, { className: "pb-0", children: /* @__PURE__ */ s(j, { children: [
339
+ /* @__PURE__ */ s(q, { modal: !1, children: [
340
+ /* @__PURE__ */ t(J, { asChild: !0, children: /* @__PURE__ */ t(K, { asChild: !0, children: /* @__PURE__ */ s(
341
+ "button",
342
+ {
343
+ type: "button",
344
+ ref: S(C),
345
+ onFocus: () => {
346
+ p.current = C;
347
+ },
348
+ "aria-label": `Navigation group: ${e.title}`,
349
+ className: d(
350
+ // Not `SidebarMenuButton`: in icon mode the primitive
351
+ // forces `!size-8 !p-2`, which would flatten the
352
+ // icon-over-chevron stack this button is.
353
+ "group/tab-selector flex h-10 w-8 cursor-pointer flex-col items-center gap-0.5 pt-2 pb-0.5",
354
+ // `renderGroupTabIcon` asks for `size="sm"` (20px) and
355
+ // relies on the host to bring it down; expanded, that host
356
+ // is `TabsTrigger`. Without the same rule here the icon
357
+ // rendered 20px wide and was squashed to 16 tall by the
358
+ // column — measured, and visibly distorted. `:not([class*='size-'])`
359
+ // is what keeps it off the chevron's own `size-3`.
360
+ "[&_svg:not([class*='size-'])]:size-4",
361
+ // Same surface as the selected tab when expanded, so the
362
+ // swap reads as a change of shape, not of state.
363
+ "bg-d-sidebar-accent text-d-sidebar-accent-foreground font-semibold",
364
+ l.radius.default,
365
+ l.focusRing
366
+ ),
367
+ children: [
368
+ R(e),
369
+ /* @__PURE__ */ t(
370
+ k,
371
+ {
372
+ name: "ChevronDown",
373
+ className: d(
374
+ "text-d-sidebar-foreground/70 size-3 shrink-0 transition-colors",
375
+ "group-hover/tab-selector:text-d-sidebar-accent-foreground",
376
+ "group-data-[state=open]/tab-selector:text-d-sidebar-accent-foreground",
377
+ "animate-in fade-in motion-reduce:animate-none motion-reduce:transition-none"
378
+ )
379
+ }
380
+ )
381
+ ]
382
+ }
383
+ ) }) }),
384
+ /* @__PURE__ */ t(
385
+ Q,
386
+ {
387
+ side: "right",
388
+ align: "start",
389
+ sideOffset: 8,
390
+ "aria-label": "Navigation groups",
391
+ className: "max-w-64 min-w-48",
392
+ children: /* @__PURE__ */ t(
393
+ ue,
394
+ {
395
+ value: String(A),
396
+ onValueChange: (r) => G(Number(r)),
397
+ children: i.map((r, n) => /* @__PURE__ */ s(
398
+ he,
399
+ {
400
+ value: String(n),
401
+ className: "cursor-pointer gap-2 [&>svg]:size-4",
402
+ children: [
403
+ R(r),
404
+ /* @__PURE__ */ t("span", { className: "truncate", children: r.title })
405
+ ]
406
+ },
407
+ `${n} ${r.title}`
408
+ ))
409
+ }
410
+ )
411
+ }
412
+ )
413
+ ] }),
414
+ /* @__PURE__ */ t(O, { side: "right", align: "center", children: e.title })
415
+ ] }) }),
416
+ /* @__PURE__ */ t(ve, {}),
417
+ y(e, !1, e.title)
418
+ ] });
419
+ }, le = () => /* @__PURE__ */ s(
420
+ ye,
421
+ {
422
+ value: String(A),
423
+ onValueChange: (e) => G(Number(e)),
424
+ className: "gap-0",
425
+ children: [
426
+ /* @__PURE__ */ t(z, { className: "pb-0", children: /* @__PURE__ */ t(
427
+ Me,
428
+ {
429
+ className: d(
430
+ // `justify-start`: tabs are sized by their content now, not stretched
431
+ // to equal widths, so the row packs to the left and the space the
432
+ // selected tab does not need stays empty.
433
+ "h-auto w-full justify-start gap-1 bg-transparent p-0"
434
+ // 3rem of rail leaves no room for a row of tabs: they stack into an
435
+ // icon-only strip instead of falling back to a flat list, so the
436
+ // "one group at a time" model survives the collapse.
437
+ ),
438
+ children: i.map((e, r) => ae(e, r))
439
+ }
440
+ ) }),
441
+ i.map((e, r) => /* @__PURE__ */ t(Te, { value: String(r), children: y(e, !1) }, `${r} ${e.title}`))
442
+ ]
443
+ }
444
+ );
445
+ return V ? /* @__PURE__ */ t(W, { collapsible: g, ...F, children: /* @__PURE__ */ t(
446
+ de,
447
+ {
448
+ navigation: i,
449
+ navigationFooter: a,
450
+ headerContent: h,
451
+ footerContent: B,
452
+ linkComponent: u,
453
+ linkProps: v
454
+ }
455
+ ) }) : /* @__PURE__ */ s(W, { collapsible: g, ...F, children: [
456
+ h && /* @__PURE__ */ t(me, { children: h }),
457
+ /* @__PURE__ */ t(be, { children: ne ? x ? oe() : le() : i.map(
458
+ (e) => y(e, i.length > 1)
459
+ ) }),
460
+ a?.map((e) => y(e)),
461
+ B,
462
+ L && /* @__PURE__ */ t(ge, {})
206
463
  ] });
207
464
  }
208
465
  export {
209
- me as AppSidebar
466
+ Oe as AppSidebar
210
467
  };