laif-ds 0.2.91 → 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.
- package/dist/CHANGELOG.md +26 -0
- package/dist/_virtual/index3.js +5 -5
- package/dist/_virtual/index4.js +5 -5
- package/dist/_virtual/index5.js +4 -4
- package/dist/agent-docs/adoption-report.json +37 -38
- package/dist/agent-docs/components/AppBottomNav.md +426 -0
- package/dist/agent-docs/components/AppSidebar.md +302 -19
- package/dist/agent-docs/components/Sidebar.md +4 -0
- package/dist/agent-docs/components-list.md +2 -1
- package/dist/agent-docs/manifest.json +113 -14
- package/dist/components/design-tokens.js +84 -0
- package/dist/components/ui/app-bottom-nav.js +165 -0
- package/dist/components/ui/app-sidebar-mobile.js +220 -0
- package/dist/components/ui/app-sidebar.js +366 -109
- package/dist/components/ui/sheet.js +26 -24
- package/dist/components/ui/sidebar.js +190 -166
- package/dist/css-for-template.css +2 -2
- package/dist/index.d.ts +92 -1
- package/dist/index.js +183 -181
- package/dist/node_modules/eventemitter3/index.js +1 -1
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +1 -1
- package/dist/node_modules/recharts/es6/util/Events.js +1 -1
- package/dist/node_modules/unified/lib/index.js +1 -1
- package/dist/styles.v3.css +1 -1
- package/package.json +3 -2
|
@@ -1,67 +1,92 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import * as
|
|
4
|
-
import { designTokens as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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:
|
|
23
|
-
() => [...
|
|
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((
|
|
26
|
-
).map((r) =>
|
|
34
|
+
(r) => r.subItems?.length && (r.isActive || r.subItems.some((n) => n.isActive))
|
|
35
|
+
).map((r) => Z(e, r))
|
|
27
36
|
).join("|"),
|
|
28
|
-
[
|
|
37
|
+
[i, a]
|
|
29
38
|
);
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const r =
|
|
33
|
-
return r.length ? { ...e, ...Object.fromEntries(r.map((
|
|
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
|
-
}, [
|
|
36
|
-
const
|
|
37
|
-
r ?
|
|
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
|
-
|
|
40
|
-
const e =
|
|
41
|
-
!e || document.activeElement !== document.body ||
|
|
42
|
-
}, [
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
),
|
|
51
|
-
|
|
52
|
-
|
|
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
|
|
56
|
-
|
|
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
|
-
...
|
|
86
|
+
...v,
|
|
62
87
|
children: r
|
|
63
88
|
}
|
|
64
|
-
) }) : /* @__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
|
-
},
|
|
74
|
-
const r = /* @__PURE__ */
|
|
75
|
-
|
|
98
|
+
}, se = (e) => {
|
|
99
|
+
const r = /* @__PURE__ */ s(E, { children: [
|
|
100
|
+
T(e, "xs"),
|
|
76
101
|
/* @__PURE__ */ t("span", { children: e.title })
|
|
77
|
-
] }),
|
|
102
|
+
] }), n = d(
|
|
78
103
|
"flex w-full items-center gap-2",
|
|
79
|
-
e.isActive &&
|
|
104
|
+
e.isActive && l.dropdownItem.selected
|
|
80
105
|
);
|
|
81
|
-
return /* @__PURE__ */ t(
|
|
82
|
-
|
|
106
|
+
return /* @__PURE__ */ t(pe, { asChild: !0, children: u ? /* @__PURE__ */ t(
|
|
107
|
+
u,
|
|
83
108
|
{
|
|
84
109
|
href: e.url,
|
|
85
|
-
className:
|
|
110
|
+
className: n,
|
|
86
111
|
"aria-current": e.isActive ? "page" : void 0,
|
|
87
|
-
...
|
|
112
|
+
...v,
|
|
88
113
|
children: r
|
|
89
114
|
}
|
|
90
115
|
) : /* @__PURE__ */ t(
|
|
91
116
|
"a",
|
|
92
117
|
{
|
|
93
118
|
href: e.url,
|
|
94
|
-
className:
|
|
119
|
+
className: n,
|
|
95
120
|
"aria-current": e.isActive ? "page" : void 0,
|
|
96
121
|
children: r
|
|
97
122
|
}
|
|
98
|
-
) },
|
|
99
|
-
},
|
|
100
|
-
const
|
|
101
|
-
return
|
|
102
|
-
|
|
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:
|
|
108
|
-
|
|
132
|
+
children: u ? /* @__PURE__ */ s(
|
|
133
|
+
u,
|
|
109
134
|
{
|
|
110
135
|
href: r.url,
|
|
111
136
|
"aria-current": r.isActive ? "page" : void 0,
|
|
112
|
-
...
|
|
137
|
+
...v,
|
|
113
138
|
children: [
|
|
114
|
-
|
|
115
|
-
|
|
139
|
+
w(r),
|
|
140
|
+
M
|
|
116
141
|
]
|
|
117
142
|
}
|
|
118
|
-
) : /* @__PURE__ */
|
|
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
|
-
|
|
125
|
-
|
|
149
|
+
w(r),
|
|
150
|
+
M
|
|
126
151
|
]
|
|
127
152
|
}
|
|
128
153
|
)
|
|
129
154
|
}
|
|
130
|
-
) },
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
-
/* @__PURE__ */ t(
|
|
133
|
-
|
|
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:
|
|
160
|
+
ref: S(n),
|
|
136
161
|
type: "button",
|
|
137
162
|
isActive: r.isActive,
|
|
138
163
|
onFocus: () => {
|
|
139
|
-
|
|
164
|
+
p.current = n;
|
|
140
165
|
},
|
|
141
166
|
children: [
|
|
142
|
-
|
|
143
|
-
|
|
167
|
+
w(r),
|
|
168
|
+
M
|
|
144
169
|
]
|
|
145
170
|
}
|
|
146
171
|
) }) }),
|
|
147
172
|
/* @__PURE__ */ t(
|
|
148
|
-
|
|
173
|
+
Q,
|
|
149
174
|
{
|
|
150
175
|
side: "right",
|
|
151
176
|
align: "start",
|
|
152
177
|
sideOffset: 8,
|
|
153
178
|
className: "min-w-48",
|
|
154
|
-
children:
|
|
179
|
+
children: c.map(se)
|
|
155
180
|
}
|
|
156
181
|
)
|
|
157
182
|
] }),
|
|
158
183
|
/* @__PURE__ */ t(
|
|
159
|
-
|
|
184
|
+
O,
|
|
160
185
|
{
|
|
161
186
|
side: "right",
|
|
162
187
|
align: "center",
|
|
163
|
-
hidden: !
|
|
188
|
+
hidden: !x,
|
|
164
189
|
children: r.title
|
|
165
190
|
}
|
|
166
191
|
)
|
|
167
|
-
] }) },
|
|
168
|
-
/* @__PURE__ */
|
|
169
|
-
|
|
192
|
+
] }) }, n) : /* @__PURE__ */ s(D, { children: [
|
|
193
|
+
/* @__PURE__ */ s(
|
|
194
|
+
_,
|
|
170
195
|
{
|
|
171
|
-
ref:
|
|
196
|
+
ref: S(n),
|
|
172
197
|
type: "button",
|
|
173
198
|
isActive: r.isActive,
|
|
174
199
|
tooltip: r.title,
|
|
175
|
-
"aria-expanded":
|
|
176
|
-
"aria-controls":
|
|
200
|
+
"aria-expanded": f,
|
|
201
|
+
"aria-controls": Y,
|
|
177
202
|
onFocus: () => {
|
|
178
|
-
|
|
203
|
+
p.current = n;
|
|
179
204
|
},
|
|
180
|
-
onClick: () =>
|
|
205
|
+
onClick: () => H((m) => ({ ...m, [n]: !m[n] })),
|
|
181
206
|
children: [
|
|
182
|
-
|
|
183
|
-
|
|
207
|
+
w(r),
|
|
208
|
+
M,
|
|
184
209
|
/* @__PURE__ */ t(
|
|
185
|
-
|
|
210
|
+
k,
|
|
186
211
|
{
|
|
187
|
-
name:
|
|
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
|
-
|
|
195
|
-
] },
|
|
196
|
-
},
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
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
|
-
|
|
466
|
+
Oe as AppSidebar
|
|
210
467
|
};
|