laif-ds 1.0.0 → 1.0.2
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 +25 -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 +26 -24
- package/dist/agent-docs/components/AppBottomNav.md +180 -49
- package/dist/agent-docs/components/AppSidebar.md +504 -11
- package/dist/agent-docs/components/Sidebar.md +72 -1
- package/dist/agent-docs/components-list.md +3 -2
- package/dist/agent-docs/manifest.json +52 -15
- package/dist/components/design-tokens.js +0 -64
- package/dist/components/nav-tokens.js +41 -0
- package/dist/components/ui/app-bottom-nav.js +125 -130
- package/dist/components/ui/app-sidebar-mobile.js +119 -104
- package/dist/components/ui/app-sidebar.js +516 -313
- package/dist/components/ui/nav-badge.js +66 -0
- package/dist/components/ui/sidebar.js +272 -207
- package/dist/index.d.ts +122 -29
- 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 +1 -1
|
@@ -1,129 +1,139 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { Root as
|
|
4
|
-
import { cva as
|
|
2
|
+
import { jsx as i, jsxs as N } from "react/jsx-runtime";
|
|
3
|
+
import { Root as y } from "../../node_modules/@radix-ui/react-slot/dist/index.js";
|
|
4
|
+
import { cva as A } from "../../node_modules/class-variance-authority/dist/index.js";
|
|
5
5
|
import * as r from "react";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
|
|
6
|
+
import { designTokens as C } from "../design-tokens.js";
|
|
7
|
+
import { navTokens as B } from "../nav-tokens.js";
|
|
8
|
+
import { Button as D } from "./button.js";
|
|
9
|
+
import { Input as O } from "./input.js";
|
|
10
|
+
import { Separator as G } from "./separator.js";
|
|
11
|
+
import { Sheet as H, SheetContent as j, SheetHeader as K, SheetTitle as L } from "./sheet.js";
|
|
12
|
+
import { Skeleton as z } from "./skeleton.js";
|
|
13
|
+
import { Tooltip as P, TooltipTrigger as F, TooltipContent as $, TooltipProvider as V } from "./tooltip.js";
|
|
14
|
+
import { useIsMobile as q } from "../../hooks/use-mobile.js";
|
|
15
|
+
import { cn as o } from "../../lib/utils.js";
|
|
16
|
+
import W from "../../node_modules/lucide-react/dist/esm/icons/panel-left.js";
|
|
17
|
+
const U = "sidebar_state", X = 3600 * 24 * 7, Y = "16rem", J = "3rem", Q = "b", I = r.createContext(null);
|
|
16
18
|
function M() {
|
|
17
|
-
const a = r.useContext(
|
|
19
|
+
const a = r.useContext(I);
|
|
18
20
|
if (!a)
|
|
19
21
|
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
20
22
|
return a;
|
|
21
23
|
}
|
|
22
|
-
const
|
|
24
|
+
const Z = r.forwardRef(
|
|
23
25
|
({
|
|
24
26
|
defaultOpen: a = !0,
|
|
25
27
|
open: e,
|
|
26
28
|
onOpenChange: t,
|
|
27
|
-
className:
|
|
29
|
+
className: d,
|
|
28
30
|
style: n,
|
|
29
31
|
children: s,
|
|
30
32
|
...m
|
|
31
|
-
},
|
|
32
|
-
const
|
|
33
|
+
}, v) => {
|
|
34
|
+
const l = q(), [b, f] = r.useState(!1), [g, u] = r.useState(!1);
|
|
35
|
+
r.useEffect(() => {
|
|
36
|
+
l && u(!1);
|
|
37
|
+
}, [l]);
|
|
38
|
+
const [x, h] = r.useState(
|
|
33
39
|
null
|
|
34
40
|
);
|
|
35
41
|
r.useEffect(() => {
|
|
36
|
-
|
|
37
|
-
}, [
|
|
38
|
-
const [
|
|
39
|
-
(
|
|
40
|
-
const p = typeof
|
|
41
|
-
t ? t(p) :
|
|
42
|
+
b || h(null);
|
|
43
|
+
}, [b]);
|
|
44
|
+
const [w, T] = r.useState(a), S = e ?? w, R = r.useCallback(
|
|
45
|
+
(c) => {
|
|
46
|
+
const p = typeof c == "function" ? c(S) : c;
|
|
47
|
+
t ? t(p) : T(p), document.cookie = `${U}=${p}; path=/; max-age=${X}`;
|
|
42
48
|
},
|
|
43
|
-
[t,
|
|
44
|
-
),
|
|
49
|
+
[t, S]
|
|
50
|
+
), k = r.useCallback(() => l ? f((c) => !c) : R((c) => !c), [l, R, f]);
|
|
45
51
|
r.useEffect(() => {
|
|
46
|
-
const
|
|
47
|
-
p.key ===
|
|
52
|
+
const c = (p) => {
|
|
53
|
+
p.key === Q && (p.metaKey || p.ctrlKey) && (p.preventDefault(), k());
|
|
48
54
|
};
|
|
49
|
-
return window.addEventListener("keydown",
|
|
50
|
-
}, [
|
|
51
|
-
const _ =
|
|
55
|
+
return window.addEventListener("keydown", c), () => window.removeEventListener("keydown", c);
|
|
56
|
+
}, [k]);
|
|
57
|
+
const _ = S || g ? "expanded" : "collapsed", E = r.useMemo(
|
|
52
58
|
() => ({
|
|
53
59
|
state: _,
|
|
54
|
-
open:
|
|
55
|
-
setOpen:
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
open: S,
|
|
61
|
+
setOpen: R,
|
|
62
|
+
peek: g,
|
|
63
|
+
setPeek: u,
|
|
64
|
+
isMobile: l,
|
|
65
|
+
openMobile: b,
|
|
66
|
+
setOpenMobile: f,
|
|
67
|
+
mobileNavTarget: x,
|
|
68
|
+
setMobileNavTarget: h,
|
|
69
|
+
toggleSidebar: k
|
|
62
70
|
}),
|
|
63
71
|
[
|
|
64
72
|
_,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
73
|
+
S,
|
|
74
|
+
R,
|
|
75
|
+
g,
|
|
68
76
|
u,
|
|
77
|
+
l,
|
|
69
78
|
b,
|
|
70
79
|
f,
|
|
71
|
-
|
|
72
|
-
|
|
80
|
+
x,
|
|
81
|
+
h,
|
|
82
|
+
k
|
|
73
83
|
]
|
|
74
84
|
);
|
|
75
|
-
return /* @__PURE__ */
|
|
85
|
+
return /* @__PURE__ */ i(I.Provider, { value: E, children: /* @__PURE__ */ i(V, { delayDuration: 0, children: /* @__PURE__ */ i(
|
|
76
86
|
"div",
|
|
77
87
|
{
|
|
78
88
|
style: {
|
|
79
|
-
"--sidebar-width":
|
|
80
|
-
"--sidebar-width-icon":
|
|
89
|
+
"--sidebar-width": Y,
|
|
90
|
+
"--sidebar-width-icon": J,
|
|
81
91
|
...n
|
|
82
92
|
},
|
|
83
|
-
className:
|
|
93
|
+
className: o(
|
|
84
94
|
"group/sidebar-wrapper has-[[data-variant=inset]]:bg-d-sidebar flex min-h-svh w-full",
|
|
85
|
-
|
|
95
|
+
d
|
|
86
96
|
),
|
|
87
|
-
ref:
|
|
97
|
+
ref: v,
|
|
88
98
|
...m,
|
|
89
99
|
children: s
|
|
90
100
|
}
|
|
91
101
|
) }) });
|
|
92
102
|
}
|
|
93
103
|
);
|
|
94
|
-
|
|
95
|
-
const
|
|
104
|
+
Z.displayName = "SidebarProvider";
|
|
105
|
+
const ee = r.forwardRef(
|
|
96
106
|
({
|
|
97
107
|
side: a = "left",
|
|
98
108
|
variant: e = "sidebar",
|
|
99
109
|
collapsible: t = "offcanvas",
|
|
100
|
-
className:
|
|
110
|
+
className: d,
|
|
101
111
|
children: n,
|
|
102
112
|
...s
|
|
103
113
|
}, m) => {
|
|
104
|
-
const { isMobile:
|
|
105
|
-
return
|
|
106
|
-
|
|
114
|
+
const { isMobile: v, state: l, peek: b, openMobile: f, setOpenMobile: g } = M(), u = r.useRef(null), x = r.useRef(null);
|
|
115
|
+
return v ? /* @__PURE__ */ i(H, { open: f, onOpenChange: g, ...s, children: /* @__PURE__ */ N(
|
|
116
|
+
j,
|
|
107
117
|
{
|
|
108
118
|
"data-sidebar": "sidebar",
|
|
109
119
|
"data-mobile": "true",
|
|
110
|
-
className: "bg-d-sidebar text-d-sidebar-foreground p-0 [
|
|
120
|
+
className: "bg-d-sidebar text-d-sidebar-foreground p-0 [&>button]:top-2 [&>button]:right-2 [&>button]:flex [&>button]:size-11 [&>button]:items-center [&>button]:justify-center [&>button]:opacity-100",
|
|
111
121
|
side: "full",
|
|
112
122
|
"aria-describedby": void 0,
|
|
113
|
-
onOpenAutoFocus: (
|
|
114
|
-
|
|
115
|
-
const
|
|
116
|
-
|
|
123
|
+
onOpenAutoFocus: (h) => {
|
|
124
|
+
h.preventDefault();
|
|
125
|
+
const w = document.activeElement;
|
|
126
|
+
x.current = w instanceof HTMLElement && w !== document.body ? w : null, u.current?.focus();
|
|
117
127
|
},
|
|
118
|
-
onCloseAutoFocus: (
|
|
119
|
-
|
|
128
|
+
onCloseAutoFocus: (h) => {
|
|
129
|
+
h.preventDefault(), x.current?.focus();
|
|
120
130
|
},
|
|
121
131
|
children: [
|
|
122
|
-
/* @__PURE__ */
|
|
123
|
-
/* @__PURE__ */
|
|
132
|
+
/* @__PURE__ */ i(K, { className: "sr-only", children: /* @__PURE__ */ i(L, { children: "Navigation menu" }) }),
|
|
133
|
+
/* @__PURE__ */ i(
|
|
124
134
|
"div",
|
|
125
135
|
{
|
|
126
|
-
ref:
|
|
136
|
+
ref: u,
|
|
127
137
|
tabIndex: -1,
|
|
128
138
|
className: "flex h-full w-full flex-col outline-none",
|
|
129
139
|
children: n
|
|
@@ -131,54 +141,94 @@ const Y = r.forwardRef(
|
|
|
131
141
|
)
|
|
132
142
|
]
|
|
133
143
|
}
|
|
134
|
-
) }) : t === "none" ? /* @__PURE__ */
|
|
144
|
+
) }) : t === "none" ? /* @__PURE__ */ i(
|
|
135
145
|
"div",
|
|
136
146
|
{
|
|
137
|
-
className:
|
|
147
|
+
className: o(
|
|
138
148
|
"bg-d-sidebar text-d-sidebar-foreground flex h-full w-[var(--sidebar-width)] flex-col",
|
|
139
|
-
|
|
149
|
+
d
|
|
140
150
|
),
|
|
141
151
|
ref: m,
|
|
142
152
|
...s,
|
|
143
153
|
children: n
|
|
144
154
|
}
|
|
145
|
-
) : /* @__PURE__ */
|
|
155
|
+
) : /* @__PURE__ */ N(
|
|
146
156
|
"div",
|
|
147
157
|
{
|
|
148
158
|
ref: m,
|
|
149
159
|
className: "group peer text-d-sidebar-foreground hidden md:block",
|
|
150
|
-
"data-state":
|
|
151
|
-
"data-collapsible":
|
|
160
|
+
"data-state": l,
|
|
161
|
+
"data-collapsible": l === "collapsed" ? t : "",
|
|
152
162
|
"data-variant": e,
|
|
153
163
|
"data-side": a,
|
|
164
|
+
"data-peek": b ? "true" : void 0,
|
|
154
165
|
children: [
|
|
155
|
-
/* @__PURE__ */
|
|
166
|
+
/* @__PURE__ */ i(
|
|
156
167
|
"div",
|
|
157
168
|
{
|
|
158
|
-
className:
|
|
159
|
-
"relative w-[var(--sidebar-width)] bg-transparent transition-[width] duration-200 ease-linear",
|
|
169
|
+
className: o(
|
|
170
|
+
"relative w-[var(--sidebar-width)] bg-transparent transition-[width] duration-200 ease-linear motion-reduce:transition-none",
|
|
160
171
|
"group-data-[collapsible=offcanvas]:w-0",
|
|
161
172
|
"group-data-[side=right]:rotate-180",
|
|
162
|
-
|
|
173
|
+
// The peek rule repeats the icon width instead of sharing the
|
|
174
|
+
// selector with `collapsible=icon`: `data-collapsible` is emptied
|
|
175
|
+
// the moment `state` flips to "expanded", so during a peek that
|
|
176
|
+
// selector no longer matches and the gap would grow to the full
|
|
177
|
+
// width — dragging the whole page 13rem to the right. Holding the
|
|
178
|
+
// gap here is what makes the peek an overlay. Same formula per
|
|
179
|
+
// variant, or floating/inset lose the 16px of padding they reserve.
|
|
180
|
+
e === "floating" || e === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))] group-data-[peek=true]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]" : "group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)] group-data-[peek=true]:w-[var(--sidebar-width-icon)]"
|
|
163
181
|
)
|
|
164
182
|
}
|
|
165
183
|
),
|
|
166
|
-
/* @__PURE__ */
|
|
184
|
+
/* @__PURE__ */ i(
|
|
167
185
|
"div",
|
|
168
186
|
{
|
|
169
|
-
className:
|
|
170
|
-
"fixed inset-y-0 z-10 hidden h-svh w-[var(--sidebar-width)] transition-[left,right,width] duration-200 ease-linear md:flex",
|
|
187
|
+
className: o(
|
|
188
|
+
"fixed inset-y-0 z-10 hidden h-svh w-[var(--sidebar-width)] transition-[left,right,width] duration-200 ease-linear motion-reduce:transition-none md:flex",
|
|
171
189
|
a === "left" ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
|
|
172
190
|
// Adjust the padding for floating and inset variants.
|
|
173
|
-
e === "floating" || e === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]" :
|
|
174
|
-
|
|
191
|
+
e === "floating" || e === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]" : (
|
|
192
|
+
// `border-d-sidebar-border` is not decoration, it is the fix: the
|
|
193
|
+
// v4 entry (`src/styles/index.css`) carries no
|
|
194
|
+
// `* { border-color }` base reset — only `index.v3.css` does —
|
|
195
|
+
// so a bare `border-r` resolves to Tailwind v4's default,
|
|
196
|
+
// `currentColor`. That inherits the host app's body text
|
|
197
|
+
// colour, which is how the panel's edge came out near-white on
|
|
198
|
+
// a dark theme and near-black on a light one. Naming the token
|
|
199
|
+
// pins it to `--colors--border--subtle`, the same value the
|
|
200
|
+
// rail, the separator and the floating variant already use.
|
|
201
|
+
"border-d-sidebar-border group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)] group-data-[side=left]:border-r group-data-[side=right]:border-l"
|
|
202
|
+
),
|
|
203
|
+
// PENDING PO DECISION: the resting `z-10` sits under the sticky
|
|
204
|
+
// header the template apps put in the main area, so a peeking panel
|
|
205
|
+
// would slide *behind* it. `z-30` clears every sticky layer in the
|
|
206
|
+
// current templates but the right value depends on the host app's
|
|
207
|
+
// stack, which the library cannot know — hence a working default
|
|
208
|
+
// rather than a prop. Raised only while peeking: pinned is a push,
|
|
209
|
+
// it covers nothing, and leaving it high would change what the
|
|
210
|
+
// sidebar overlaps in a state that works today.
|
|
211
|
+
"group-data-[peek=true]:z-30",
|
|
212
|
+
d
|
|
175
213
|
),
|
|
176
214
|
...s,
|
|
177
|
-
children: /* @__PURE__ */
|
|
215
|
+
children: /* @__PURE__ */ i(
|
|
178
216
|
"div",
|
|
179
217
|
{
|
|
180
218
|
"data-sidebar": "sidebar",
|
|
181
|
-
className:
|
|
219
|
+
className: o(
|
|
220
|
+
"bg-d-sidebar group-data-[variant=floating]:border-d-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow",
|
|
221
|
+
// The overlay's shadow lives on this element and not on the
|
|
222
|
+
// panel: the panel's transition is a single declaration shared by
|
|
223
|
+
// `left`/`right`/`width`, and those must stay on the primitive's
|
|
224
|
+
// 200ms linear (the gap div animates in lockstep with them during
|
|
225
|
+
// a pin, and a second curve would desync the two). A shadow is not
|
|
226
|
+
// a layout property, so here it can take the house curve without
|
|
227
|
+
// dragging the width along.
|
|
228
|
+
"transition-shadow group-data-[peek=true]:shadow-lg motion-reduce:transition-none",
|
|
229
|
+
C.motion.duration,
|
|
230
|
+
C.motion.ease
|
|
231
|
+
),
|
|
182
232
|
children: n
|
|
183
233
|
}
|
|
184
234
|
)
|
|
@@ -189,41 +239,41 @@ const Y = r.forwardRef(
|
|
|
189
239
|
);
|
|
190
240
|
}
|
|
191
241
|
);
|
|
192
|
-
|
|
193
|
-
const
|
|
242
|
+
ee.displayName = "Sidebar";
|
|
243
|
+
const ae = r.forwardRef(({ className: a, onClick: e, ...t }, d) => {
|
|
194
244
|
const { toggleSidebar: n } = M();
|
|
195
|
-
return /* @__PURE__ */
|
|
196
|
-
|
|
245
|
+
return /* @__PURE__ */ N(
|
|
246
|
+
D,
|
|
197
247
|
{
|
|
198
|
-
ref:
|
|
248
|
+
ref: d,
|
|
199
249
|
"data-sidebar": "trigger",
|
|
200
250
|
variant: "ghost",
|
|
201
251
|
size: "icon",
|
|
202
|
-
className:
|
|
252
|
+
className: o("h-7 w-7", a),
|
|
203
253
|
onClick: (s) => {
|
|
204
254
|
e?.(s), n();
|
|
205
255
|
},
|
|
206
256
|
...t,
|
|
207
257
|
children: [
|
|
208
|
-
/* @__PURE__ */
|
|
209
|
-
/* @__PURE__ */
|
|
258
|
+
/* @__PURE__ */ i(W, {}),
|
|
259
|
+
/* @__PURE__ */ i("span", { className: "sr-only", children: "Toggle Sidebar" })
|
|
210
260
|
]
|
|
211
261
|
}
|
|
212
262
|
);
|
|
213
263
|
});
|
|
214
|
-
|
|
215
|
-
const
|
|
216
|
-
const { toggleSidebar:
|
|
217
|
-
return /* @__PURE__ */
|
|
264
|
+
ae.displayName = "SidebarTrigger";
|
|
265
|
+
const te = r.forwardRef(({ className: a, ...e }, t) => {
|
|
266
|
+
const { toggleSidebar: d } = M();
|
|
267
|
+
return /* @__PURE__ */ i(
|
|
218
268
|
"button",
|
|
219
269
|
{
|
|
220
270
|
ref: t,
|
|
221
271
|
"data-sidebar": "rail",
|
|
222
272
|
"aria-label": "Toggle Sidebar",
|
|
223
273
|
tabIndex: -1,
|
|
224
|
-
onClick:
|
|
274
|
+
onClick: d,
|
|
225
275
|
title: "Toggle Sidebar",
|
|
226
|
-
className:
|
|
276
|
+
className: o(
|
|
227
277
|
"hover:after:bg-d-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex",
|
|
228
278
|
"[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize",
|
|
229
279
|
"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
|
|
@@ -236,92 +286,97 @@ const Q = r.forwardRef(({ className: a, ...e }, t) => {
|
|
|
236
286
|
}
|
|
237
287
|
);
|
|
238
288
|
});
|
|
239
|
-
|
|
240
|
-
const
|
|
289
|
+
te.displayName = "SidebarRail";
|
|
290
|
+
const re = r.forwardRef(({ className: a, ...e }, t) => /* @__PURE__ */ i(
|
|
241
291
|
"main",
|
|
242
292
|
{
|
|
243
293
|
ref: t,
|
|
244
|
-
className:
|
|
294
|
+
className: o(
|
|
245
295
|
"bg-d-background relative flex w-full flex-1 flex-col",
|
|
246
296
|
"md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2",
|
|
297
|
+
// Second half of the overlay fix, and easy to miss: the inset's left
|
|
298
|
+
// margin keys off `data-state`, which a peek flips to "expanded" — so
|
|
299
|
+
// without this the main area would slide by the 8px the collapsed rule
|
|
300
|
+
// adds, exactly the shift the gap div is being held still to prevent.
|
|
301
|
+
"md:peer-data-[peek=true]:peer-data-[variant=inset]:ml-2",
|
|
247
302
|
a
|
|
248
303
|
),
|
|
249
304
|
...e
|
|
250
305
|
}
|
|
251
306
|
));
|
|
252
|
-
|
|
253
|
-
const
|
|
254
|
-
|
|
307
|
+
re.displayName = "SidebarInset";
|
|
308
|
+
const ie = r.forwardRef(({ className: a, ...e }, t) => /* @__PURE__ */ i(
|
|
309
|
+
O,
|
|
255
310
|
{
|
|
256
311
|
ref: t,
|
|
257
312
|
"data-sidebar": "input",
|
|
258
|
-
className:
|
|
313
|
+
className: o(
|
|
259
314
|
"bg-d-background focus-visible:ring-d-sidebar-ring h-8 w-full shadow-none focus-visible:ring-2",
|
|
260
315
|
a
|
|
261
316
|
),
|
|
262
317
|
...e
|
|
263
318
|
}
|
|
264
319
|
));
|
|
265
|
-
|
|
266
|
-
const
|
|
320
|
+
ie.displayName = "SidebarInput";
|
|
321
|
+
const oe = r.forwardRef(({ className: a, ...e }, t) => /* @__PURE__ */ i(
|
|
267
322
|
"div",
|
|
268
323
|
{
|
|
269
324
|
ref: t,
|
|
270
325
|
"data-sidebar": "header",
|
|
271
|
-
className:
|
|
326
|
+
className: o("flex flex-col gap-2 p-2", a),
|
|
272
327
|
...e
|
|
273
328
|
}
|
|
274
329
|
));
|
|
275
|
-
|
|
276
|
-
const
|
|
330
|
+
oe.displayName = "SidebarHeader";
|
|
331
|
+
const de = r.forwardRef(({ className: a, ...e }, t) => /* @__PURE__ */ i(
|
|
277
332
|
"div",
|
|
278
333
|
{
|
|
279
334
|
ref: t,
|
|
280
335
|
"data-sidebar": "footer",
|
|
281
|
-
className:
|
|
336
|
+
className: o("flex flex-col gap-2 p-2", a),
|
|
282
337
|
...e
|
|
283
338
|
}
|
|
284
339
|
));
|
|
285
|
-
|
|
286
|
-
const
|
|
287
|
-
|
|
340
|
+
de.displayName = "SidebarFooter";
|
|
341
|
+
const ne = r.forwardRef(({ className: a, ...e }, t) => /* @__PURE__ */ i(
|
|
342
|
+
G,
|
|
288
343
|
{
|
|
289
344
|
ref: t,
|
|
290
345
|
"data-sidebar": "separator",
|
|
291
|
-
className:
|
|
346
|
+
className: o("bg-d-sidebar-border mx-2 w-auto", a),
|
|
292
347
|
...e
|
|
293
348
|
}
|
|
294
349
|
));
|
|
295
|
-
|
|
296
|
-
const
|
|
350
|
+
ne.displayName = "SidebarSeparator";
|
|
351
|
+
const se = r.forwardRef(({ className: a, ...e }, t) => /* @__PURE__ */ i(
|
|
297
352
|
"div",
|
|
298
353
|
{
|
|
299
354
|
ref: t,
|
|
300
355
|
"data-sidebar": "content",
|
|
301
|
-
className:
|
|
356
|
+
className: o(
|
|
302
357
|
"flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-x-hidden group-data-[collapsible=icon]:overflow-y-auto",
|
|
303
358
|
a
|
|
304
359
|
),
|
|
305
360
|
...e
|
|
306
361
|
}
|
|
307
362
|
));
|
|
308
|
-
|
|
309
|
-
const
|
|
363
|
+
se.displayName = "SidebarContent";
|
|
364
|
+
const le = r.forwardRef(({ className: a, ...e }, t) => /* @__PURE__ */ i(
|
|
310
365
|
"div",
|
|
311
366
|
{
|
|
312
367
|
ref: t,
|
|
313
368
|
"data-sidebar": "group",
|
|
314
|
-
className:
|
|
369
|
+
className: o("relative flex w-full min-w-0 flex-col p-2", a),
|
|
315
370
|
...e
|
|
316
371
|
}
|
|
317
372
|
));
|
|
318
|
-
|
|
319
|
-
const
|
|
320
|
-
e ?
|
|
373
|
+
le.displayName = "SidebarGroup";
|
|
374
|
+
const ce = r.forwardRef(({ className: a, asChild: e = !1, ...t }, d) => /* @__PURE__ */ i(
|
|
375
|
+
e ? y : "div",
|
|
321
376
|
{
|
|
322
|
-
ref:
|
|
377
|
+
ref: d,
|
|
323
378
|
"data-sidebar": "group-label",
|
|
324
|
-
className:
|
|
379
|
+
className: o(
|
|
325
380
|
"text-d-sidebar-foreground/70 ring-d-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium transition-[margin,opacity] duration-200 ease-linear outline-none focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
326
381
|
"group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
|
|
327
382
|
a
|
|
@@ -329,13 +384,13 @@ const oe = r.forwardRef(({ className: a, asChild: e = !1, ...t }, o) => /* @__PU
|
|
|
329
384
|
...t
|
|
330
385
|
}
|
|
331
386
|
));
|
|
332
|
-
|
|
333
|
-
const
|
|
334
|
-
e ?
|
|
387
|
+
ce.displayName = "SidebarGroupLabel";
|
|
388
|
+
const ue = r.forwardRef(({ className: a, asChild: e = !1, ...t }, d) => /* @__PURE__ */ i(
|
|
389
|
+
e ? y : "button",
|
|
335
390
|
{
|
|
336
|
-
ref:
|
|
391
|
+
ref: d,
|
|
337
392
|
"data-sidebar": "group-action",
|
|
338
|
-
className:
|
|
393
|
+
className: o(
|
|
339
394
|
"text-d-sidebar-foreground ring-d-sidebar-ring hover:bg-d-sidebar-accent hover:text-d-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 transition-transform outline-none focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
340
395
|
// Increases the hit area of the button on mobile.
|
|
341
396
|
"after:absolute after:-inset-2 after:md:hidden",
|
|
@@ -345,39 +400,49 @@ const ne = r.forwardRef(({ className: a, asChild: e = !1, ...t }, o) => /* @__PU
|
|
|
345
400
|
...t
|
|
346
401
|
}
|
|
347
402
|
));
|
|
348
|
-
|
|
349
|
-
const
|
|
403
|
+
ue.displayName = "SidebarGroupAction";
|
|
404
|
+
const be = r.forwardRef(({ className: a, ...e }, t) => /* @__PURE__ */ i(
|
|
350
405
|
"div",
|
|
351
406
|
{
|
|
352
407
|
ref: t,
|
|
353
408
|
"data-sidebar": "group-content",
|
|
354
|
-
className:
|
|
409
|
+
className: o("w-full text-sm", a),
|
|
355
410
|
...e
|
|
356
411
|
}
|
|
357
412
|
));
|
|
358
|
-
|
|
359
|
-
const
|
|
413
|
+
be.displayName = "SidebarGroupContent";
|
|
414
|
+
const fe = r.forwardRef(({ className: a, ...e }, t) => /* @__PURE__ */ i(
|
|
360
415
|
"ul",
|
|
361
416
|
{
|
|
362
417
|
ref: t,
|
|
363
418
|
"data-sidebar": "menu",
|
|
364
|
-
className:
|
|
419
|
+
className: o("flex w-full min-w-0 flex-col gap-1", a),
|
|
365
420
|
...e
|
|
366
421
|
}
|
|
367
422
|
));
|
|
368
|
-
|
|
369
|
-
const
|
|
423
|
+
fe.displayName = "SidebarMenu";
|
|
424
|
+
const pe = r.forwardRef(({ className: a, ...e }, t) => /* @__PURE__ */ i(
|
|
370
425
|
"li",
|
|
371
426
|
{
|
|
372
427
|
ref: t,
|
|
373
428
|
"data-sidebar": "menu-item",
|
|
374
|
-
className:
|
|
429
|
+
className: o("group/menu-item relative", a),
|
|
375
430
|
...e
|
|
376
431
|
}
|
|
377
432
|
));
|
|
378
|
-
|
|
379
|
-
const
|
|
380
|
-
|
|
433
|
+
pe.displayName = "SidebarMenuItem";
|
|
434
|
+
const me = A(
|
|
435
|
+
o(
|
|
436
|
+
"peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-d-sidebar-ring transition-[width,height,padding] hover:bg-d-sidebar-accent hover:text-d-sidebar-accent-foreground focus-visible:ring-2 active:bg-d-sidebar-accent active:text-d-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-d-sidebar-accent data-[active=true]:font-bold data-[active=true]:text-d-sidebar-accent-foreground data-[state=open]:hover:bg-d-sidebar-accent data-[state=open]:hover:text-d-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
|
|
437
|
+
// The rail's own geometry — 32px pill, 6px padding, 20px glyph — and the
|
|
438
|
+
// reason those three numbers are one decision is in the token.
|
|
439
|
+
//
|
|
440
|
+
// Its `[&>svg]:size-5` outranks the `[&>svg]:size-4` above it on
|
|
441
|
+
// specificity, not on order (`.group[data-collapsible=icon] .btn > svg` is
|
|
442
|
+
// one class more), so expanded rows keep 16px glyphs whichever way Tailwind
|
|
443
|
+
// sorts the two rules.
|
|
444
|
+
B.rail.button
|
|
445
|
+
),
|
|
381
446
|
{
|
|
382
447
|
variants: {
|
|
383
448
|
variant: {
|
|
@@ -395,50 +460,50 @@ const ue = I(
|
|
|
395
460
|
size: "default"
|
|
396
461
|
}
|
|
397
462
|
}
|
|
398
|
-
),
|
|
463
|
+
), ge = r.forwardRef(
|
|
399
464
|
({
|
|
400
465
|
asChild: a = !1,
|
|
401
466
|
isActive: e = !1,
|
|
402
467
|
variant: t = "default",
|
|
403
|
-
size:
|
|
468
|
+
size: d = "default",
|
|
404
469
|
tooltip: n,
|
|
405
470
|
className: s,
|
|
406
471
|
...m
|
|
407
|
-
},
|
|
408
|
-
const
|
|
409
|
-
|
|
472
|
+
}, v) => {
|
|
473
|
+
const l = a ? y : "button", { isMobile: b, state: f } = M(), g = f !== "collapsed" || b, u = /* @__PURE__ */ i(
|
|
474
|
+
l,
|
|
410
475
|
{
|
|
411
|
-
ref:
|
|
476
|
+
ref: v,
|
|
412
477
|
"data-sidebar": "menu-button",
|
|
413
|
-
"data-size":
|
|
478
|
+
"data-size": d,
|
|
414
479
|
"data-active": e,
|
|
415
|
-
className:
|
|
480
|
+
className: o(me({ variant: t, size: d }), s),
|
|
416
481
|
...m
|
|
417
482
|
}
|
|
418
483
|
);
|
|
419
484
|
return n ? (typeof n == "string" && (n = {
|
|
420
485
|
children: n
|
|
421
|
-
}), /* @__PURE__ */
|
|
422
|
-
/* @__PURE__ */
|
|
423
|
-
/* @__PURE__ */
|
|
424
|
-
|
|
486
|
+
}), /* @__PURE__ */ N(P, { children: [
|
|
487
|
+
/* @__PURE__ */ i(F, { asChild: !0, children: u }),
|
|
488
|
+
/* @__PURE__ */ i(
|
|
489
|
+
$,
|
|
425
490
|
{
|
|
426
491
|
side: "right",
|
|
427
492
|
align: "center",
|
|
428
|
-
hidden:
|
|
493
|
+
hidden: g,
|
|
429
494
|
...n
|
|
430
495
|
}
|
|
431
496
|
)
|
|
432
|
-
] })) :
|
|
497
|
+
] })) : u;
|
|
433
498
|
}
|
|
434
499
|
);
|
|
435
|
-
|
|
436
|
-
const
|
|
437
|
-
e ?
|
|
500
|
+
ge.displayName = "SidebarMenuButton";
|
|
501
|
+
const he = r.forwardRef(({ className: a, asChild: e = !1, showOnHover: t = !1, ...d }, n) => /* @__PURE__ */ i(
|
|
502
|
+
e ? y : "button",
|
|
438
503
|
{
|
|
439
504
|
ref: n,
|
|
440
505
|
"data-sidebar": "menu-action",
|
|
441
|
-
className:
|
|
506
|
+
className: o(
|
|
442
507
|
"text-d-sidebar-foreground ring-d-sidebar-ring hover:bg-d-sidebar-accent hover:text-d-sidebar-accent-foreground peer-hover/menu-button:text-d-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 transition-transform outline-none focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
443
508
|
// Increases the hit area of the button on mobile.
|
|
444
509
|
"after:absolute after:-inset-2 after:md:hidden",
|
|
@@ -449,16 +514,16 @@ const fe = r.forwardRef(({ className: a, asChild: e = !1, showOnHover: t = !1, .
|
|
|
449
514
|
t && "peer-data-[active=true]/menu-button:text-d-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",
|
|
450
515
|
a
|
|
451
516
|
),
|
|
452
|
-
...
|
|
517
|
+
...d
|
|
453
518
|
}
|
|
454
519
|
));
|
|
455
|
-
|
|
456
|
-
const
|
|
520
|
+
he.displayName = "SidebarMenuAction";
|
|
521
|
+
const ve = r.forwardRef(({ className: a, ...e }, t) => /* @__PURE__ */ i(
|
|
457
522
|
"div",
|
|
458
523
|
{
|
|
459
524
|
ref: t,
|
|
460
525
|
"data-sidebar": "menu-badge",
|
|
461
|
-
className:
|
|
526
|
+
className: o(
|
|
462
527
|
"text-d-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none",
|
|
463
528
|
"peer-hover/menu-button:text-d-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-d-sidebar-accent-foreground",
|
|
464
529
|
"peer-data-[size=sm]/menu-button:top-1",
|
|
@@ -470,26 +535,26 @@ const pe = r.forwardRef(({ className: a, ...e }, t) => /* @__PURE__ */ d(
|
|
|
470
535
|
...e
|
|
471
536
|
}
|
|
472
537
|
));
|
|
473
|
-
|
|
474
|
-
const
|
|
538
|
+
ve.displayName = "SidebarMenuBadge";
|
|
539
|
+
const xe = r.forwardRef(({ className: a, showIcon: e = !1, ...t }, d) => {
|
|
475
540
|
const n = r.useMemo(() => `${Math.floor(Math.random() * 40) + 50}%`, []);
|
|
476
|
-
return /* @__PURE__ */
|
|
541
|
+
return /* @__PURE__ */ N(
|
|
477
542
|
"div",
|
|
478
543
|
{
|
|
479
|
-
ref:
|
|
544
|
+
ref: d,
|
|
480
545
|
"data-sidebar": "menu-skeleton",
|
|
481
|
-
className:
|
|
546
|
+
className: o("flex h-8 items-center gap-2 rounded-md px-2", a),
|
|
482
547
|
...t,
|
|
483
548
|
children: [
|
|
484
|
-
e && /* @__PURE__ */
|
|
485
|
-
|
|
549
|
+
e && /* @__PURE__ */ i(
|
|
550
|
+
z,
|
|
486
551
|
{
|
|
487
552
|
className: "size-4 rounded-md",
|
|
488
553
|
"data-sidebar": "menu-skeleton-icon"
|
|
489
554
|
}
|
|
490
555
|
),
|
|
491
|
-
/* @__PURE__ */
|
|
492
|
-
|
|
556
|
+
/* @__PURE__ */ i(
|
|
557
|
+
z,
|
|
493
558
|
{
|
|
494
559
|
className: "h-4 max-w-[--skeleton-width] flex-1",
|
|
495
560
|
"data-sidebar": "menu-skeleton-text",
|
|
@@ -502,13 +567,13 @@ const me = r.forwardRef(({ className: a, showIcon: e = !1, ...t }, o) => {
|
|
|
502
567
|
}
|
|
503
568
|
);
|
|
504
569
|
});
|
|
505
|
-
|
|
506
|
-
const
|
|
570
|
+
xe.displayName = "SidebarMenuSkeleton";
|
|
571
|
+
const we = r.forwardRef(({ className: a, ...e }, t) => /* @__PURE__ */ i(
|
|
507
572
|
"ul",
|
|
508
573
|
{
|
|
509
574
|
ref: t,
|
|
510
575
|
"data-sidebar": "menu-sub",
|
|
511
|
-
className:
|
|
576
|
+
className: o(
|
|
512
577
|
"border-d-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5",
|
|
513
578
|
"group-data-[collapsible=icon]:hidden",
|
|
514
579
|
a
|
|
@@ -516,51 +581,51 @@ const ge = r.forwardRef(({ className: a, ...e }, t) => /* @__PURE__ */ d(
|
|
|
516
581
|
...e
|
|
517
582
|
}
|
|
518
583
|
));
|
|
519
|
-
|
|
520
|
-
const
|
|
521
|
-
|
|
522
|
-
const
|
|
523
|
-
a ?
|
|
584
|
+
we.displayName = "SidebarMenuSub";
|
|
585
|
+
const Se = r.forwardRef(({ ...a }, e) => /* @__PURE__ */ i("li", { ref: e, ...a }));
|
|
586
|
+
Se.displayName = "SidebarMenuSubItem";
|
|
587
|
+
const Ne = r.forwardRef(({ asChild: a = !1, size: e = "md", isActive: t, className: d, ...n }, s) => /* @__PURE__ */ i(
|
|
588
|
+
a ? y : "a",
|
|
524
589
|
{
|
|
525
590
|
ref: s,
|
|
526
591
|
"data-sidebar": "menu-sub-button",
|
|
527
592
|
"data-size": e,
|
|
528
593
|
"data-active": t,
|
|
529
|
-
className:
|
|
594
|
+
className: o(
|
|
530
595
|
"text-d-sidebar-foreground ring-d-sidebar-ring hover:bg-d-sidebar-accent hover:text-d-sidebar-accent-foreground active:bg-d-sidebar-accent active:text-d-sidebar-accent-foreground [&>svg]:text-d-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
|
|
531
596
|
"data-[active=true]:bg-d-sidebar-accent data-[active=true]:text-d-sidebar-accent-foreground data-[active=true]:font-bold",
|
|
532
597
|
e === "sm" && "text-xs",
|
|
533
598
|
e === "md" && "text-sm",
|
|
534
599
|
"group-data-[collapsible=icon]:hidden",
|
|
535
|
-
|
|
600
|
+
d
|
|
536
601
|
),
|
|
537
602
|
...n
|
|
538
603
|
}
|
|
539
604
|
));
|
|
540
|
-
|
|
605
|
+
Ne.displayName = "SidebarMenuSubButton";
|
|
541
606
|
export {
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
607
|
+
ee as Sidebar,
|
|
608
|
+
se as SidebarContent,
|
|
609
|
+
de as SidebarFooter,
|
|
610
|
+
le as SidebarGroup,
|
|
611
|
+
ue as SidebarGroupAction,
|
|
612
|
+
be as SidebarGroupContent,
|
|
613
|
+
ce as SidebarGroupLabel,
|
|
614
|
+
oe as SidebarHeader,
|
|
615
|
+
ie as SidebarInput,
|
|
616
|
+
re as SidebarInset,
|
|
617
|
+
fe as SidebarMenu,
|
|
618
|
+
he as SidebarMenuAction,
|
|
619
|
+
ve as SidebarMenuBadge,
|
|
620
|
+
ge as SidebarMenuButton,
|
|
621
|
+
pe as SidebarMenuItem,
|
|
622
|
+
xe as SidebarMenuSkeleton,
|
|
623
|
+
we as SidebarMenuSub,
|
|
624
|
+
Ne as SidebarMenuSubButton,
|
|
625
|
+
Se as SidebarMenuSubItem,
|
|
626
|
+
Z as SidebarProvider,
|
|
627
|
+
te as SidebarRail,
|
|
628
|
+
ne as SidebarSeparator,
|
|
629
|
+
ae as SidebarTrigger,
|
|
565
630
|
M as useSidebar
|
|
566
631
|
};
|