@prediktif/ui 0.1.8 → 0.1.9
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/index.d.mts +38 -27
- package/dist/index.d.ts +38 -27
- package/dist/index.js +1191 -142
- package/dist/index.mjs +1157 -108
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -31,30 +31,229 @@ var __objRest = (source, exclude) => {
|
|
|
31
31
|
return target;
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
// src/components/composed/
|
|
34
|
+
// src/components/composed/app-sidebar.tsx
|
|
35
|
+
import { ChevronsUpDown, Command, LockIcon } from "lucide-react";
|
|
36
|
+
import Link from "next/link";
|
|
37
|
+
import { usePathname } from "next/navigation";
|
|
35
38
|
import { memo } from "react";
|
|
36
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
37
|
-
var HeaderTitle = memo(function HeaderTitle2({
|
|
38
|
-
title,
|
|
39
|
-
subtitle,
|
|
40
|
-
children
|
|
41
|
-
}) {
|
|
42
|
-
return /* @__PURE__ */ jsxs("div", { className: "w-full space-y-4", children: [
|
|
43
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
44
|
-
/* @__PURE__ */ jsx("h1", { className: "font-semibold", children: title }),
|
|
45
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: subtitle })
|
|
46
|
-
] }),
|
|
47
|
-
children
|
|
48
|
-
] });
|
|
49
|
-
});
|
|
50
39
|
|
|
51
|
-
// src/components/
|
|
52
|
-
import {
|
|
40
|
+
// src/components/ui/alert-dialog.tsx
|
|
41
|
+
import { AlertDialog as AlertDialogPrimitive } from "@base-ui/react/alert-dialog";
|
|
42
|
+
import { cn as cn2 } from "cn";
|
|
43
|
+
|
|
44
|
+
// src/components/ui/button.tsx
|
|
45
|
+
import { Button as ButtonPrimitive } from "@base-ui/react/button";
|
|
46
|
+
import { cva } from "class-variance-authority";
|
|
47
|
+
import { cn } from "cn";
|
|
48
|
+
import { jsx } from "react/jsx-runtime";
|
|
49
|
+
var buttonVariants = cva(
|
|
50
|
+
"group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-xs/relaxed font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
51
|
+
{
|
|
52
|
+
variants: {
|
|
53
|
+
variant: {
|
|
54
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/80",
|
|
55
|
+
outline: "border-border hover:bg-input/50 hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:bg-input/30",
|
|
56
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
|
|
57
|
+
ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
|
|
58
|
+
destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
|
|
59
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
60
|
+
},
|
|
61
|
+
size: {
|
|
62
|
+
default: "h-7 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
63
|
+
xs: "h-5 gap-1 rounded-sm px-2 text-[0.625rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-2.5",
|
|
64
|
+
sm: "h-6 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
65
|
+
lg: "h-8 gap-1 px-2.5 text-xs/relaxed has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-4",
|
|
66
|
+
icon: "size-7 [&_svg:not([class*='size-'])]:size-3.5",
|
|
67
|
+
"icon-xs": "size-5 rounded-sm [&_svg:not([class*='size-'])]:size-2.5",
|
|
68
|
+
"icon-sm": "size-6 [&_svg:not([class*='size-'])]:size-3",
|
|
69
|
+
"icon-lg": "size-8 [&_svg:not([class*='size-'])]:size-4"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
defaultVariants: {
|
|
73
|
+
variant: "default",
|
|
74
|
+
size: "default"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
function Button(_a) {
|
|
79
|
+
var _b = _a, {
|
|
80
|
+
className,
|
|
81
|
+
variant = "default",
|
|
82
|
+
size = "default"
|
|
83
|
+
} = _b, props = __objRest(_b, [
|
|
84
|
+
"className",
|
|
85
|
+
"variant",
|
|
86
|
+
"size"
|
|
87
|
+
]);
|
|
88
|
+
return /* @__PURE__ */ jsx(
|
|
89
|
+
ButtonPrimitive,
|
|
90
|
+
__spreadValues({
|
|
91
|
+
"data-slot": "button",
|
|
92
|
+
className: cn(buttonVariants({ variant, size, className }))
|
|
93
|
+
}, props)
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// src/components/ui/alert-dialog.tsx
|
|
98
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
99
|
+
function AlertDialog(_a) {
|
|
100
|
+
var props = __objRest(_a, []);
|
|
101
|
+
return /* @__PURE__ */ jsx2(AlertDialogPrimitive.Root, __spreadValues({ "data-slot": "alert-dialog" }, props));
|
|
102
|
+
}
|
|
103
|
+
function AlertDialogTrigger(_a) {
|
|
104
|
+
var props = __objRest(_a, []);
|
|
105
|
+
return /* @__PURE__ */ jsx2(AlertDialogPrimitive.Trigger, __spreadValues({ "data-slot": "alert-dialog-trigger" }, props));
|
|
106
|
+
}
|
|
107
|
+
function AlertDialogPortal(_a) {
|
|
108
|
+
var props = __objRest(_a, []);
|
|
109
|
+
return /* @__PURE__ */ jsx2(AlertDialogPrimitive.Portal, __spreadValues({ "data-slot": "alert-dialog-portal" }, props));
|
|
110
|
+
}
|
|
111
|
+
function AlertDialogOverlay(_a) {
|
|
112
|
+
var _b = _a, {
|
|
113
|
+
className
|
|
114
|
+
} = _b, props = __objRest(_b, [
|
|
115
|
+
"className"
|
|
116
|
+
]);
|
|
117
|
+
return /* @__PURE__ */ jsx2(
|
|
118
|
+
AlertDialogPrimitive.Backdrop,
|
|
119
|
+
__spreadValues({
|
|
120
|
+
"data-slot": "alert-dialog-overlay",
|
|
121
|
+
className: cn2(
|
|
122
|
+
"fixed inset-0 isolate z-50 bg-black/80 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
|
|
123
|
+
className
|
|
124
|
+
)
|
|
125
|
+
}, props)
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
function AlertDialogContent(_a) {
|
|
129
|
+
var _b = _a, {
|
|
130
|
+
className,
|
|
131
|
+
size = "default"
|
|
132
|
+
} = _b, props = __objRest(_b, [
|
|
133
|
+
"className",
|
|
134
|
+
"size"
|
|
135
|
+
]);
|
|
136
|
+
return /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [
|
|
137
|
+
/* @__PURE__ */ jsx2(AlertDialogOverlay, {}),
|
|
138
|
+
/* @__PURE__ */ jsx2(
|
|
139
|
+
AlertDialogPrimitive.Popup,
|
|
140
|
+
__spreadValues({
|
|
141
|
+
"data-slot": "alert-dialog-content",
|
|
142
|
+
"data-size": size,
|
|
143
|
+
className: cn2(
|
|
144
|
+
"group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-3 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-64 data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
145
|
+
className
|
|
146
|
+
)
|
|
147
|
+
}, props)
|
|
148
|
+
)
|
|
149
|
+
] });
|
|
150
|
+
}
|
|
151
|
+
function AlertDialogHeader(_a) {
|
|
152
|
+
var _b = _a, {
|
|
153
|
+
className
|
|
154
|
+
} = _b, props = __objRest(_b, [
|
|
155
|
+
"className"
|
|
156
|
+
]);
|
|
157
|
+
return /* @__PURE__ */ jsx2(
|
|
158
|
+
"div",
|
|
159
|
+
__spreadValues({
|
|
160
|
+
"data-slot": "alert-dialog-header",
|
|
161
|
+
className: cn2(
|
|
162
|
+
"grid grid-rows-[auto_1fr] place-items-center gap-1 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",
|
|
163
|
+
className
|
|
164
|
+
)
|
|
165
|
+
}, props)
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
function AlertDialogFooter(_a) {
|
|
169
|
+
var _b = _a, {
|
|
170
|
+
className
|
|
171
|
+
} = _b, props = __objRest(_b, [
|
|
172
|
+
"className"
|
|
173
|
+
]);
|
|
174
|
+
return /* @__PURE__ */ jsx2(
|
|
175
|
+
"div",
|
|
176
|
+
__spreadValues({
|
|
177
|
+
"data-slot": "alert-dialog-footer",
|
|
178
|
+
className: cn2(
|
|
179
|
+
"flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",
|
|
180
|
+
className
|
|
181
|
+
)
|
|
182
|
+
}, props)
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
function AlertDialogTitle(_a) {
|
|
186
|
+
var _b = _a, {
|
|
187
|
+
className
|
|
188
|
+
} = _b, props = __objRest(_b, [
|
|
189
|
+
"className"
|
|
190
|
+
]);
|
|
191
|
+
return /* @__PURE__ */ jsx2(
|
|
192
|
+
AlertDialogPrimitive.Title,
|
|
193
|
+
__spreadValues({
|
|
194
|
+
"data-slot": "alert-dialog-title",
|
|
195
|
+
className: cn2(
|
|
196
|
+
"font-heading text-sm font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",
|
|
197
|
+
className
|
|
198
|
+
)
|
|
199
|
+
}, props)
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
function AlertDialogDescription(_a) {
|
|
203
|
+
var _b = _a, {
|
|
204
|
+
className
|
|
205
|
+
} = _b, props = __objRest(_b, [
|
|
206
|
+
"className"
|
|
207
|
+
]);
|
|
208
|
+
return /* @__PURE__ */ jsx2(
|
|
209
|
+
AlertDialogPrimitive.Description,
|
|
210
|
+
__spreadValues({
|
|
211
|
+
"data-slot": "alert-dialog-description",
|
|
212
|
+
className: cn2(
|
|
213
|
+
"text-xs/relaxed text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",
|
|
214
|
+
className
|
|
215
|
+
)
|
|
216
|
+
}, props)
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
function AlertDialogAction(_a) {
|
|
220
|
+
var _b = _a, {
|
|
221
|
+
className
|
|
222
|
+
} = _b, props = __objRest(_b, [
|
|
223
|
+
"className"
|
|
224
|
+
]);
|
|
225
|
+
return /* @__PURE__ */ jsx2(
|
|
226
|
+
Button,
|
|
227
|
+
__spreadValues({
|
|
228
|
+
"data-slot": "alert-dialog-action",
|
|
229
|
+
className: cn2(className)
|
|
230
|
+
}, props)
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
function AlertDialogCancel(_a) {
|
|
234
|
+
var _b = _a, {
|
|
235
|
+
className,
|
|
236
|
+
variant = "outline",
|
|
237
|
+
size = "default"
|
|
238
|
+
} = _b, props = __objRest(_b, [
|
|
239
|
+
"className",
|
|
240
|
+
"variant",
|
|
241
|
+
"size"
|
|
242
|
+
]);
|
|
243
|
+
return /* @__PURE__ */ jsx2(
|
|
244
|
+
AlertDialogPrimitive.Close,
|
|
245
|
+
__spreadValues({
|
|
246
|
+
"data-slot": "alert-dialog-cancel",
|
|
247
|
+
className: cn2(className),
|
|
248
|
+
render: /* @__PURE__ */ jsx2(Button, { variant, size })
|
|
249
|
+
}, props)
|
|
250
|
+
);
|
|
251
|
+
}
|
|
53
252
|
|
|
54
253
|
// src/components/ui/avatar.tsx
|
|
55
254
|
import { Avatar as AvatarPrimitive } from "@base-ui/react/avatar";
|
|
56
|
-
import { cn } from "cn";
|
|
57
|
-
import { jsx as
|
|
255
|
+
import { cn as cn3 } from "cn";
|
|
256
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
58
257
|
function Avatar(_a) {
|
|
59
258
|
var _b = _a, {
|
|
60
259
|
className,
|
|
@@ -63,12 +262,12 @@ function Avatar(_a) {
|
|
|
63
262
|
"className",
|
|
64
263
|
"size"
|
|
65
264
|
]);
|
|
66
|
-
return /* @__PURE__ */
|
|
265
|
+
return /* @__PURE__ */ jsx3(
|
|
67
266
|
AvatarPrimitive.Root,
|
|
68
267
|
__spreadValues({
|
|
69
268
|
"data-slot": "avatar",
|
|
70
269
|
"data-size": size,
|
|
71
|
-
className:
|
|
270
|
+
className: cn3(
|
|
72
271
|
"group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",
|
|
73
272
|
className
|
|
74
273
|
)
|
|
@@ -77,11 +276,11 @@ function Avatar(_a) {
|
|
|
77
276
|
}
|
|
78
277
|
function AvatarImage(_a) {
|
|
79
278
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
80
|
-
return /* @__PURE__ */
|
|
279
|
+
return /* @__PURE__ */ jsx3(
|
|
81
280
|
AvatarPrimitive.Image,
|
|
82
281
|
__spreadValues({
|
|
83
282
|
"data-slot": "avatar-image",
|
|
84
|
-
className:
|
|
283
|
+
className: cn3(
|
|
85
284
|
"aspect-square size-full rounded-full object-cover",
|
|
86
285
|
className
|
|
87
286
|
)
|
|
@@ -94,11 +293,11 @@ function AvatarFallback(_a) {
|
|
|
94
293
|
} = _b, props = __objRest(_b, [
|
|
95
294
|
"className"
|
|
96
295
|
]);
|
|
97
|
-
return /* @__PURE__ */
|
|
296
|
+
return /* @__PURE__ */ jsx3(
|
|
98
297
|
AvatarPrimitive.Fallback,
|
|
99
298
|
__spreadValues({
|
|
100
299
|
"data-slot": "avatar-fallback",
|
|
101
|
-
className:
|
|
300
|
+
className: cn3(
|
|
102
301
|
"flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",
|
|
103
302
|
className
|
|
104
303
|
)
|
|
@@ -106,80 +305,364 @@ function AvatarFallback(_a) {
|
|
|
106
305
|
);
|
|
107
306
|
}
|
|
108
307
|
|
|
109
|
-
// src/components/ui/
|
|
308
|
+
// src/components/ui/breadcrumb.tsx
|
|
110
309
|
import { mergeProps } from "@base-ui/react/merge-props";
|
|
111
310
|
import { useRender } from "@base-ui/react/use-render";
|
|
112
|
-
import {
|
|
113
|
-
import {
|
|
114
|
-
import {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
311
|
+
import { cn as cn4 } from "cn";
|
|
312
|
+
import { ChevronRightIcon, MoreHorizontalIcon } from "lucide-react";
|
|
313
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
314
|
+
function Breadcrumb(_a) {
|
|
315
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
316
|
+
return /* @__PURE__ */ jsx4(
|
|
317
|
+
"nav",
|
|
318
|
+
__spreadValues({
|
|
319
|
+
"aria-label": "breadcrumb",
|
|
320
|
+
"data-slot": "breadcrumb",
|
|
321
|
+
className: cn4(className)
|
|
322
|
+
}, props)
|
|
323
|
+
);
|
|
324
|
+
}
|
|
325
|
+
function BreadcrumbList(_a) {
|
|
326
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
327
|
+
return /* @__PURE__ */ jsx4(
|
|
328
|
+
"ol",
|
|
329
|
+
__spreadValues({
|
|
330
|
+
"data-slot": "breadcrumb-list",
|
|
331
|
+
className: cn4(
|
|
332
|
+
"flex flex-wrap items-center gap-1.5 text-xs/relaxed wrap-break-word text-muted-foreground",
|
|
333
|
+
className
|
|
334
|
+
)
|
|
335
|
+
}, props)
|
|
336
|
+
);
|
|
337
|
+
}
|
|
338
|
+
function BreadcrumbItem(_a) {
|
|
339
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
340
|
+
return /* @__PURE__ */ jsx4(
|
|
341
|
+
"li",
|
|
342
|
+
__spreadValues({
|
|
343
|
+
"data-slot": "breadcrumb-item",
|
|
344
|
+
className: cn4("inline-flex items-center gap-1", className)
|
|
345
|
+
}, props)
|
|
346
|
+
);
|
|
347
|
+
}
|
|
348
|
+
function BreadcrumbLink(_a) {
|
|
349
|
+
var _b = _a, {
|
|
350
|
+
className,
|
|
351
|
+
render
|
|
352
|
+
} = _b, props = __objRest(_b, [
|
|
353
|
+
"className",
|
|
354
|
+
"render"
|
|
355
|
+
]);
|
|
356
|
+
return useRender({
|
|
357
|
+
defaultTagName: "a",
|
|
358
|
+
props: mergeProps(
|
|
359
|
+
{
|
|
360
|
+
className: cn4("transition-colors hover:text-foreground", className)
|
|
133
361
|
},
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
icon: "size-7 [&_svg:not([class*='size-'])]:size-3.5",
|
|
140
|
-
"icon-xs": "size-5 rounded-sm [&_svg:not([class*='size-'])]:size-2.5",
|
|
141
|
-
"icon-sm": "size-6 [&_svg:not([class*='size-'])]:size-3",
|
|
142
|
-
"icon-lg": "size-8 [&_svg:not([class*='size-'])]:size-4"
|
|
143
|
-
}
|
|
144
|
-
},
|
|
145
|
-
defaultVariants: {
|
|
146
|
-
variant: "default",
|
|
147
|
-
size: "default"
|
|
362
|
+
props
|
|
363
|
+
),
|
|
364
|
+
render,
|
|
365
|
+
state: {
|
|
366
|
+
slot: "breadcrumb-link"
|
|
148
367
|
}
|
|
149
|
-
}
|
|
150
|
-
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
function BreadcrumbPage(_a) {
|
|
371
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
372
|
+
return /* @__PURE__ */ jsx4(
|
|
373
|
+
"span",
|
|
374
|
+
__spreadValues({
|
|
375
|
+
"data-slot": "breadcrumb-page",
|
|
376
|
+
role: "link",
|
|
377
|
+
"aria-disabled": "true",
|
|
378
|
+
"aria-current": "page",
|
|
379
|
+
className: cn4("font-normal text-foreground", className)
|
|
380
|
+
}, props)
|
|
381
|
+
);
|
|
382
|
+
}
|
|
383
|
+
function BreadcrumbSeparator(_a) {
|
|
384
|
+
var _b = _a, {
|
|
385
|
+
children,
|
|
386
|
+
className
|
|
387
|
+
} = _b, props = __objRest(_b, [
|
|
388
|
+
"children",
|
|
389
|
+
"className"
|
|
390
|
+
]);
|
|
391
|
+
return /* @__PURE__ */ jsx4(
|
|
392
|
+
"li",
|
|
393
|
+
__spreadProps(__spreadValues({
|
|
394
|
+
"data-slot": "breadcrumb-separator",
|
|
395
|
+
role: "presentation",
|
|
396
|
+
"aria-hidden": "true",
|
|
397
|
+
className: cn4("[&>svg]:size-3.5", className)
|
|
398
|
+
}, props), {
|
|
399
|
+
children: children != null ? children : /* @__PURE__ */ jsx4(ChevronRightIcon, {})
|
|
400
|
+
})
|
|
401
|
+
);
|
|
402
|
+
}
|
|
151
403
|
|
|
152
|
-
// src/components/ui/
|
|
153
|
-
import {
|
|
154
|
-
import { cn as
|
|
155
|
-
import {
|
|
404
|
+
// src/components/ui/dropdown-menu.tsx
|
|
405
|
+
import { Menu as MenuPrimitive } from "@base-ui/react/menu";
|
|
406
|
+
import { cn as cn5 } from "cn";
|
|
407
|
+
import { CheckIcon, ChevronRightIcon as ChevronRightIcon2 } from "lucide-react";
|
|
408
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
409
|
+
function DropdownMenu(_a) {
|
|
410
|
+
var props = __objRest(_a, []);
|
|
411
|
+
return /* @__PURE__ */ jsx5(MenuPrimitive.Root, __spreadValues({ "data-slot": "dropdown-menu" }, props));
|
|
412
|
+
}
|
|
413
|
+
function DropdownMenuTrigger(_a) {
|
|
414
|
+
var props = __objRest(_a, []);
|
|
415
|
+
return /* @__PURE__ */ jsx5(MenuPrimitive.Trigger, __spreadValues({ "data-slot": "dropdown-menu-trigger" }, props));
|
|
416
|
+
}
|
|
417
|
+
function DropdownMenuContent(_a) {
|
|
418
|
+
var _b = _a, {
|
|
419
|
+
align = "start",
|
|
420
|
+
alignOffset = 0,
|
|
421
|
+
side = "bottom",
|
|
422
|
+
sideOffset = 4,
|
|
423
|
+
className
|
|
424
|
+
} = _b, props = __objRest(_b, [
|
|
425
|
+
"align",
|
|
426
|
+
"alignOffset",
|
|
427
|
+
"side",
|
|
428
|
+
"sideOffset",
|
|
429
|
+
"className"
|
|
430
|
+
]);
|
|
431
|
+
return /* @__PURE__ */ jsx5(MenuPrimitive.Portal, { children: /* @__PURE__ */ jsx5(
|
|
432
|
+
MenuPrimitive.Positioner,
|
|
433
|
+
{
|
|
434
|
+
className: "isolate z-50 outline-none",
|
|
435
|
+
align,
|
|
436
|
+
alignOffset,
|
|
437
|
+
side,
|
|
438
|
+
sideOffset,
|
|
439
|
+
children: /* @__PURE__ */ jsx5(
|
|
440
|
+
MenuPrimitive.Popup,
|
|
441
|
+
__spreadValues({
|
|
442
|
+
"data-slot": "dropdown-menu-content",
|
|
443
|
+
className: cn5(
|
|
444
|
+
"z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
445
|
+
className
|
|
446
|
+
)
|
|
447
|
+
}, props)
|
|
448
|
+
)
|
|
449
|
+
}
|
|
450
|
+
) });
|
|
451
|
+
}
|
|
452
|
+
function DropdownMenuGroup(_a) {
|
|
453
|
+
var props = __objRest(_a, []);
|
|
454
|
+
return /* @__PURE__ */ jsx5(MenuPrimitive.Group, __spreadValues({ "data-slot": "dropdown-menu-group" }, props));
|
|
455
|
+
}
|
|
456
|
+
function DropdownMenuLabel(_a) {
|
|
457
|
+
var _b = _a, {
|
|
458
|
+
className,
|
|
459
|
+
inset
|
|
460
|
+
} = _b, props = __objRest(_b, [
|
|
461
|
+
"className",
|
|
462
|
+
"inset"
|
|
463
|
+
]);
|
|
464
|
+
return /* @__PURE__ */ jsx5(
|
|
465
|
+
MenuPrimitive.GroupLabel,
|
|
466
|
+
__spreadValues({
|
|
467
|
+
"data-slot": "dropdown-menu-label",
|
|
468
|
+
"data-inset": inset,
|
|
469
|
+
className: cn5(
|
|
470
|
+
"px-2 py-1.5 text-xs text-muted-foreground data-inset:pl-7.5",
|
|
471
|
+
className
|
|
472
|
+
)
|
|
473
|
+
}, props)
|
|
474
|
+
);
|
|
475
|
+
}
|
|
476
|
+
function DropdownMenuItem(_a) {
|
|
477
|
+
var _b = _a, {
|
|
478
|
+
className,
|
|
479
|
+
inset,
|
|
480
|
+
variant = "default"
|
|
481
|
+
} = _b, props = __objRest(_b, [
|
|
482
|
+
"className",
|
|
483
|
+
"inset",
|
|
484
|
+
"variant"
|
|
485
|
+
]);
|
|
486
|
+
return /* @__PURE__ */ jsx5(
|
|
487
|
+
MenuPrimitive.Item,
|
|
488
|
+
__spreadValues({
|
|
489
|
+
"data-slot": "dropdown-menu-item",
|
|
490
|
+
"data-inset": inset,
|
|
491
|
+
"data-variant": variant,
|
|
492
|
+
className: cn5(
|
|
493
|
+
"group/dropdown-menu-item relative flex min-h-7 cursor-default items-center gap-2 rounded-md px-2 py-1 text-xs/relaxed outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7.5 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 data-[variant=destructive]:*:[svg]:text-destructive",
|
|
494
|
+
className
|
|
495
|
+
)
|
|
496
|
+
}, props)
|
|
497
|
+
);
|
|
498
|
+
}
|
|
156
499
|
|
|
157
500
|
// src/components/ui/separator.tsx
|
|
158
501
|
import { Separator as SeparatorPrimitive } from "@base-ui/react/separator";
|
|
159
|
-
import { cn as
|
|
160
|
-
import { jsx as
|
|
502
|
+
import { cn as cn6 } from "cn";
|
|
503
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
504
|
+
function Separator(_a) {
|
|
505
|
+
var _b = _a, {
|
|
506
|
+
className,
|
|
507
|
+
orientation = "horizontal"
|
|
508
|
+
} = _b, props = __objRest(_b, [
|
|
509
|
+
"className",
|
|
510
|
+
"orientation"
|
|
511
|
+
]);
|
|
512
|
+
return /* @__PURE__ */ jsx6(
|
|
513
|
+
SeparatorPrimitive,
|
|
514
|
+
__spreadValues({
|
|
515
|
+
"data-slot": "separator",
|
|
516
|
+
orientation,
|
|
517
|
+
className: cn6(
|
|
518
|
+
"shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",
|
|
519
|
+
className
|
|
520
|
+
)
|
|
521
|
+
}, props)
|
|
522
|
+
);
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
// src/components/ui/sidebar.tsx
|
|
526
|
+
import { mergeProps as mergeProps2 } from "@base-ui/react/merge-props";
|
|
527
|
+
import { useRender as useRender2 } from "@base-ui/react/use-render";
|
|
528
|
+
import { cva as cva2 } from "class-variance-authority";
|
|
529
|
+
import { cn as cn11 } from "cn";
|
|
530
|
+
import { PanelLeftIcon } from "lucide-react";
|
|
531
|
+
import * as React2 from "react";
|
|
532
|
+
|
|
533
|
+
// src/components/ui/input.tsx
|
|
534
|
+
import { Input as InputPrimitive } from "@base-ui/react/input";
|
|
535
|
+
import { cn as cn7 } from "cn";
|
|
536
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
161
537
|
|
|
162
538
|
// src/components/ui/sheet.tsx
|
|
163
539
|
import { Dialog as SheetPrimitive } from "@base-ui/react/dialog";
|
|
164
|
-
import { cn as
|
|
540
|
+
import { cn as cn8 } from "cn";
|
|
165
541
|
import { XIcon } from "lucide-react";
|
|
166
|
-
import { jsx as
|
|
542
|
+
import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
543
|
+
function Sheet(_a) {
|
|
544
|
+
var props = __objRest(_a, []);
|
|
545
|
+
return /* @__PURE__ */ jsx8(SheetPrimitive.Root, __spreadValues({ "data-slot": "sheet" }, props));
|
|
546
|
+
}
|
|
547
|
+
function SheetPortal(_a) {
|
|
548
|
+
var props = __objRest(_a, []);
|
|
549
|
+
return /* @__PURE__ */ jsx8(SheetPrimitive.Portal, __spreadValues({ "data-slot": "sheet-portal" }, props));
|
|
550
|
+
}
|
|
551
|
+
function SheetOverlay(_a) {
|
|
552
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
553
|
+
return /* @__PURE__ */ jsx8(
|
|
554
|
+
SheetPrimitive.Backdrop,
|
|
555
|
+
__spreadValues({
|
|
556
|
+
"data-slot": "sheet-overlay",
|
|
557
|
+
className: cn8(
|
|
558
|
+
"fixed inset-0 z-50 bg-black/80 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",
|
|
559
|
+
className
|
|
560
|
+
)
|
|
561
|
+
}, props)
|
|
562
|
+
);
|
|
563
|
+
}
|
|
564
|
+
function SheetContent(_a) {
|
|
565
|
+
var _b = _a, {
|
|
566
|
+
className,
|
|
567
|
+
children,
|
|
568
|
+
side = "right",
|
|
569
|
+
showCloseButton = true
|
|
570
|
+
} = _b, props = __objRest(_b, [
|
|
571
|
+
"className",
|
|
572
|
+
"children",
|
|
573
|
+
"side",
|
|
574
|
+
"showCloseButton"
|
|
575
|
+
]);
|
|
576
|
+
return /* @__PURE__ */ jsxs4(SheetPortal, { children: [
|
|
577
|
+
/* @__PURE__ */ jsx8(SheetOverlay, {}),
|
|
578
|
+
/* @__PURE__ */ jsxs4(
|
|
579
|
+
SheetPrimitive.Popup,
|
|
580
|
+
__spreadProps(__spreadValues({
|
|
581
|
+
"data-slot": "sheet-content",
|
|
582
|
+
"data-side": side,
|
|
583
|
+
className: cn8(
|
|
584
|
+
"fixed z-50 flex flex-col bg-popover bg-clip-padding text-xs/relaxed text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",
|
|
585
|
+
className
|
|
586
|
+
)
|
|
587
|
+
}, props), {
|
|
588
|
+
children: [
|
|
589
|
+
children,
|
|
590
|
+
showCloseButton && /* @__PURE__ */ jsxs4(
|
|
591
|
+
SheetPrimitive.Close,
|
|
592
|
+
{
|
|
593
|
+
"data-slot": "sheet-close",
|
|
594
|
+
render: /* @__PURE__ */ jsx8(
|
|
595
|
+
Button,
|
|
596
|
+
{
|
|
597
|
+
variant: "ghost",
|
|
598
|
+
className: "absolute top-4 right-4",
|
|
599
|
+
size: "icon-sm"
|
|
600
|
+
}
|
|
601
|
+
),
|
|
602
|
+
children: [
|
|
603
|
+
/* @__PURE__ */ jsx8(XIcon, {}),
|
|
604
|
+
/* @__PURE__ */ jsx8("span", { className: "sr-only", children: "Close" })
|
|
605
|
+
]
|
|
606
|
+
}
|
|
607
|
+
)
|
|
608
|
+
]
|
|
609
|
+
})
|
|
610
|
+
)
|
|
611
|
+
] });
|
|
612
|
+
}
|
|
613
|
+
function SheetHeader(_a) {
|
|
614
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
615
|
+
return /* @__PURE__ */ jsx8(
|
|
616
|
+
"div",
|
|
617
|
+
__spreadValues({
|
|
618
|
+
"data-slot": "sheet-header",
|
|
619
|
+
className: cn8("flex flex-col gap-1.5 p-6", className)
|
|
620
|
+
}, props)
|
|
621
|
+
);
|
|
622
|
+
}
|
|
623
|
+
function SheetTitle(_a) {
|
|
624
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
625
|
+
return /* @__PURE__ */ jsx8(
|
|
626
|
+
SheetPrimitive.Title,
|
|
627
|
+
__spreadValues({
|
|
628
|
+
"data-slot": "sheet-title",
|
|
629
|
+
className: cn8(
|
|
630
|
+
"font-heading text-sm font-medium text-foreground",
|
|
631
|
+
className
|
|
632
|
+
)
|
|
633
|
+
}, props)
|
|
634
|
+
);
|
|
635
|
+
}
|
|
636
|
+
function SheetDescription(_a) {
|
|
637
|
+
var _b = _a, {
|
|
638
|
+
className
|
|
639
|
+
} = _b, props = __objRest(_b, [
|
|
640
|
+
"className"
|
|
641
|
+
]);
|
|
642
|
+
return /* @__PURE__ */ jsx8(
|
|
643
|
+
SheetPrimitive.Description,
|
|
644
|
+
__spreadValues({
|
|
645
|
+
"data-slot": "sheet-description",
|
|
646
|
+
className: cn8("text-xs/relaxed text-muted-foreground", className)
|
|
647
|
+
}, props)
|
|
648
|
+
);
|
|
649
|
+
}
|
|
167
650
|
|
|
168
651
|
// src/components/ui/skeleton.tsx
|
|
169
|
-
import { cn as
|
|
170
|
-
import { jsx as
|
|
652
|
+
import { cn as cn9 } from "cn";
|
|
653
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
171
654
|
|
|
172
655
|
// src/components/ui/tooltip.tsx
|
|
173
656
|
import { Tooltip as TooltipPrimitive } from "@base-ui/react/tooltip";
|
|
174
|
-
import { cn as
|
|
175
|
-
import { jsx as
|
|
657
|
+
import { cn as cn10 } from "cn";
|
|
658
|
+
import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
176
659
|
function Tooltip(_a) {
|
|
177
660
|
var props = __objRest(_a, []);
|
|
178
|
-
return /* @__PURE__ */
|
|
661
|
+
return /* @__PURE__ */ jsx10(TooltipPrimitive.Root, __spreadValues({ "data-slot": "tooltip" }, props));
|
|
179
662
|
}
|
|
180
663
|
function TooltipTrigger(_a) {
|
|
181
664
|
var props = __objRest(_a, []);
|
|
182
|
-
return /* @__PURE__ */
|
|
665
|
+
return /* @__PURE__ */ jsx10(TooltipPrimitive.Trigger, __spreadValues({ "data-slot": "tooltip-trigger" }, props));
|
|
183
666
|
}
|
|
184
667
|
function TooltipContent(_a) {
|
|
185
668
|
var _b = _a, {
|
|
@@ -197,7 +680,7 @@ function TooltipContent(_a) {
|
|
|
197
680
|
"alignOffset",
|
|
198
681
|
"children"
|
|
199
682
|
]);
|
|
200
|
-
return /* @__PURE__ */
|
|
683
|
+
return /* @__PURE__ */ jsx10(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx10(
|
|
201
684
|
TooltipPrimitive.Positioner,
|
|
202
685
|
{
|
|
203
686
|
align,
|
|
@@ -205,18 +688,18 @@ function TooltipContent(_a) {
|
|
|
205
688
|
side,
|
|
206
689
|
sideOffset,
|
|
207
690
|
className: "isolate z-50",
|
|
208
|
-
children: /* @__PURE__ */
|
|
691
|
+
children: /* @__PURE__ */ jsxs5(
|
|
209
692
|
TooltipPrimitive.Popup,
|
|
210
693
|
__spreadProps(__spreadValues({
|
|
211
694
|
"data-slot": "tooltip-content",
|
|
212
|
-
className:
|
|
695
|
+
className: cn10(
|
|
213
696
|
"z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
214
697
|
className
|
|
215
698
|
)
|
|
216
699
|
}, props), {
|
|
217
700
|
children: [
|
|
218
701
|
children,
|
|
219
|
-
/* @__PURE__ */
|
|
702
|
+
/* @__PURE__ */ jsx10(TooltipPrimitive.Arrow, { className: "z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5" })
|
|
220
703
|
]
|
|
221
704
|
})
|
|
222
705
|
)
|
|
@@ -226,10 +709,31 @@ function TooltipContent(_a) {
|
|
|
226
709
|
|
|
227
710
|
// src/hooks/use-mobile.ts
|
|
228
711
|
import * as React from "react";
|
|
712
|
+
var MOBILE_BREAKPOINT = 768;
|
|
713
|
+
function useIsMobile() {
|
|
714
|
+
const [isMobile, setIsMobile] = React.useState(
|
|
715
|
+
void 0
|
|
716
|
+
);
|
|
717
|
+
React.useEffect(() => {
|
|
718
|
+
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
719
|
+
const onChange = () => {
|
|
720
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
721
|
+
};
|
|
722
|
+
mql.addEventListener("change", onChange);
|
|
723
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
724
|
+
return () => mql.removeEventListener("change", onChange);
|
|
725
|
+
}, []);
|
|
726
|
+
return !!isMobile;
|
|
727
|
+
}
|
|
229
728
|
|
|
230
729
|
// src/components/ui/sidebar.tsx
|
|
231
|
-
import { jsx as
|
|
730
|
+
import { jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
731
|
+
var SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
232
732
|
var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
733
|
+
var SIDEBAR_WIDTH = "16rem";
|
|
734
|
+
var SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
735
|
+
var SIDEBAR_WIDTH_ICON = "3rem";
|
|
736
|
+
var SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
233
737
|
var SidebarContext = React2.createContext(null);
|
|
234
738
|
function useSidebar() {
|
|
235
739
|
const context = React2.useContext(SidebarContext);
|
|
@@ -238,36 +742,360 @@ function useSidebar() {
|
|
|
238
742
|
}
|
|
239
743
|
return context;
|
|
240
744
|
}
|
|
745
|
+
function SidebarProvider(_a) {
|
|
746
|
+
var _b = _a, {
|
|
747
|
+
defaultOpen = true,
|
|
748
|
+
open: openProp,
|
|
749
|
+
onOpenChange: setOpenProp,
|
|
750
|
+
className,
|
|
751
|
+
style,
|
|
752
|
+
children
|
|
753
|
+
} = _b, props = __objRest(_b, [
|
|
754
|
+
"defaultOpen",
|
|
755
|
+
"open",
|
|
756
|
+
"onOpenChange",
|
|
757
|
+
"className",
|
|
758
|
+
"style",
|
|
759
|
+
"children"
|
|
760
|
+
]);
|
|
761
|
+
const isMobile = useIsMobile();
|
|
762
|
+
const [openMobile, setOpenMobile] = React2.useState(false);
|
|
763
|
+
const [_open, _setOpen] = React2.useState(defaultOpen);
|
|
764
|
+
const open = openProp != null ? openProp : _open;
|
|
765
|
+
const setOpen = React2.useCallback(
|
|
766
|
+
(value) => {
|
|
767
|
+
const openState = typeof value === "function" ? value(open) : value;
|
|
768
|
+
if (setOpenProp) {
|
|
769
|
+
setOpenProp(openState);
|
|
770
|
+
} else {
|
|
771
|
+
_setOpen(openState);
|
|
772
|
+
}
|
|
773
|
+
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
774
|
+
},
|
|
775
|
+
[setOpenProp, open]
|
|
776
|
+
);
|
|
777
|
+
const toggleSidebar = React2.useCallback(() => {
|
|
778
|
+
return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
|
|
779
|
+
}, [isMobile, setOpen]);
|
|
780
|
+
React2.useEffect(() => {
|
|
781
|
+
const handleKeyDown = (event) => {
|
|
782
|
+
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
783
|
+
event.preventDefault();
|
|
784
|
+
toggleSidebar();
|
|
785
|
+
}
|
|
786
|
+
};
|
|
787
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
788
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
789
|
+
}, [toggleSidebar]);
|
|
790
|
+
const state = open ? "expanded" : "collapsed";
|
|
791
|
+
const contextValue = React2.useMemo(
|
|
792
|
+
() => ({
|
|
793
|
+
state,
|
|
794
|
+
open,
|
|
795
|
+
setOpen,
|
|
796
|
+
isMobile,
|
|
797
|
+
openMobile,
|
|
798
|
+
setOpenMobile,
|
|
799
|
+
toggleSidebar
|
|
800
|
+
}),
|
|
801
|
+
[state, open, setOpen, isMobile, openMobile, toggleSidebar]
|
|
802
|
+
);
|
|
803
|
+
return /* @__PURE__ */ jsx11(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx11(
|
|
804
|
+
"div",
|
|
805
|
+
__spreadProps(__spreadValues({
|
|
806
|
+
"data-slot": "sidebar-wrapper",
|
|
807
|
+
style: __spreadValues({
|
|
808
|
+
"--sidebar-width": SIDEBAR_WIDTH,
|
|
809
|
+
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON
|
|
810
|
+
}, style),
|
|
811
|
+
className: cn11(
|
|
812
|
+
"group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",
|
|
813
|
+
className
|
|
814
|
+
)
|
|
815
|
+
}, props), {
|
|
816
|
+
children
|
|
817
|
+
})
|
|
818
|
+
) });
|
|
819
|
+
}
|
|
820
|
+
function Sidebar(_a) {
|
|
821
|
+
var _b = _a, {
|
|
822
|
+
side = "left",
|
|
823
|
+
variant = "sidebar",
|
|
824
|
+
collapsible = "offcanvas",
|
|
825
|
+
className,
|
|
826
|
+
children,
|
|
827
|
+
dir
|
|
828
|
+
} = _b, props = __objRest(_b, [
|
|
829
|
+
"side",
|
|
830
|
+
"variant",
|
|
831
|
+
"collapsible",
|
|
832
|
+
"className",
|
|
833
|
+
"children",
|
|
834
|
+
"dir"
|
|
835
|
+
]);
|
|
836
|
+
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
837
|
+
if (collapsible === "none") {
|
|
838
|
+
return /* @__PURE__ */ jsx11(
|
|
839
|
+
"div",
|
|
840
|
+
__spreadProps(__spreadValues({
|
|
841
|
+
"data-slot": "sidebar",
|
|
842
|
+
className: cn11(
|
|
843
|
+
"flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",
|
|
844
|
+
className
|
|
845
|
+
)
|
|
846
|
+
}, props), {
|
|
847
|
+
children
|
|
848
|
+
})
|
|
849
|
+
);
|
|
850
|
+
}
|
|
851
|
+
if (isMobile) {
|
|
852
|
+
return /* @__PURE__ */ jsx11(Sheet, __spreadProps(__spreadValues({ open: openMobile, onOpenChange: setOpenMobile }, props), { children: /* @__PURE__ */ jsxs6(
|
|
853
|
+
SheetContent,
|
|
854
|
+
{
|
|
855
|
+
dir,
|
|
856
|
+
"data-sidebar": "sidebar",
|
|
857
|
+
"data-slot": "sidebar",
|
|
858
|
+
"data-mobile": "true",
|
|
859
|
+
className: "w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",
|
|
860
|
+
style: {
|
|
861
|
+
"--sidebar-width": SIDEBAR_WIDTH_MOBILE
|
|
862
|
+
},
|
|
863
|
+
side,
|
|
864
|
+
children: [
|
|
865
|
+
/* @__PURE__ */ jsxs6(SheetHeader, { className: "sr-only", children: [
|
|
866
|
+
/* @__PURE__ */ jsx11(SheetTitle, { children: "Sidebar" }),
|
|
867
|
+
/* @__PURE__ */ jsx11(SheetDescription, { children: "Displays the mobile sidebar." })
|
|
868
|
+
] }),
|
|
869
|
+
/* @__PURE__ */ jsx11("div", { className: "flex h-full w-full flex-col", children })
|
|
870
|
+
]
|
|
871
|
+
}
|
|
872
|
+
) }));
|
|
873
|
+
}
|
|
874
|
+
return /* @__PURE__ */ jsxs6(
|
|
875
|
+
"div",
|
|
876
|
+
{
|
|
877
|
+
className: "group peer hidden text-sidebar-foreground md:block",
|
|
878
|
+
"data-state": state,
|
|
879
|
+
"data-collapsible": state === "collapsed" ? collapsible : "",
|
|
880
|
+
"data-variant": variant,
|
|
881
|
+
"data-side": side,
|
|
882
|
+
"data-slot": "sidebar",
|
|
883
|
+
children: [
|
|
884
|
+
/* @__PURE__ */ jsx11(
|
|
885
|
+
"div",
|
|
886
|
+
{
|
|
887
|
+
"data-slot": "sidebar-gap",
|
|
888
|
+
className: cn11(
|
|
889
|
+
"relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear",
|
|
890
|
+
"group-data-[collapsible=offcanvas]:w-0",
|
|
891
|
+
"group-data-[side=right]:rotate-180",
|
|
892
|
+
variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"
|
|
893
|
+
)
|
|
894
|
+
}
|
|
895
|
+
),
|
|
896
|
+
/* @__PURE__ */ jsx11(
|
|
897
|
+
"div",
|
|
898
|
+
__spreadProps(__spreadValues({
|
|
899
|
+
"data-slot": "sidebar-container",
|
|
900
|
+
"data-side": side,
|
|
901
|
+
className: cn11(
|
|
902
|
+
"fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",
|
|
903
|
+
// Adjust the padding for floating and inset variants.
|
|
904
|
+
variant === "floating" || variant === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",
|
|
905
|
+
className
|
|
906
|
+
)
|
|
907
|
+
}, props), {
|
|
908
|
+
children: /* @__PURE__ */ jsx11(
|
|
909
|
+
"div",
|
|
910
|
+
{
|
|
911
|
+
"data-sidebar": "sidebar",
|
|
912
|
+
"data-slot": "sidebar-inner",
|
|
913
|
+
className: "flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border",
|
|
914
|
+
children
|
|
915
|
+
}
|
|
916
|
+
)
|
|
917
|
+
})
|
|
918
|
+
)
|
|
919
|
+
]
|
|
920
|
+
}
|
|
921
|
+
);
|
|
922
|
+
}
|
|
923
|
+
function SidebarTrigger(_a) {
|
|
924
|
+
var _b = _a, {
|
|
925
|
+
className,
|
|
926
|
+
onClick
|
|
927
|
+
} = _b, props = __objRest(_b, [
|
|
928
|
+
"className",
|
|
929
|
+
"onClick"
|
|
930
|
+
]);
|
|
931
|
+
const { toggleSidebar } = useSidebar();
|
|
932
|
+
return /* @__PURE__ */ jsxs6(
|
|
933
|
+
Button,
|
|
934
|
+
__spreadProps(__spreadValues({
|
|
935
|
+
"data-sidebar": "trigger",
|
|
936
|
+
"data-slot": "sidebar-trigger",
|
|
937
|
+
variant: "ghost",
|
|
938
|
+
size: "icon-sm",
|
|
939
|
+
className: cn11(className),
|
|
940
|
+
onClick: (event) => {
|
|
941
|
+
onClick == null ? void 0 : onClick(event);
|
|
942
|
+
toggleSidebar();
|
|
943
|
+
}
|
|
944
|
+
}, props), {
|
|
945
|
+
children: [
|
|
946
|
+
/* @__PURE__ */ jsx11(PanelLeftIcon, {}),
|
|
947
|
+
/* @__PURE__ */ jsx11("span", { className: "sr-only", children: "Toggle Sidebar" })
|
|
948
|
+
]
|
|
949
|
+
})
|
|
950
|
+
);
|
|
951
|
+
}
|
|
952
|
+
function SidebarRail(_a) {
|
|
953
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
954
|
+
const { toggleSidebar } = useSidebar();
|
|
955
|
+
return /* @__PURE__ */ jsx11(
|
|
956
|
+
"button",
|
|
957
|
+
__spreadValues({
|
|
958
|
+
"data-sidebar": "rail",
|
|
959
|
+
"data-slot": "sidebar-rail",
|
|
960
|
+
"aria-label": "Toggle Sidebar",
|
|
961
|
+
tabIndex: -1,
|
|
962
|
+
onClick: toggleSidebar,
|
|
963
|
+
title: "Toggle Sidebar",
|
|
964
|
+
className: cn11(
|
|
965
|
+
"absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2",
|
|
966
|
+
"in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
|
|
967
|
+
"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
|
|
968
|
+
"group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar",
|
|
969
|
+
"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
|
|
970
|
+
"[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
|
|
971
|
+
className
|
|
972
|
+
)
|
|
973
|
+
}, props)
|
|
974
|
+
);
|
|
975
|
+
}
|
|
976
|
+
function SidebarInset(_a) {
|
|
977
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
978
|
+
return /* @__PURE__ */ jsx11(
|
|
979
|
+
"main",
|
|
980
|
+
__spreadValues({
|
|
981
|
+
"data-slot": "sidebar-inset",
|
|
982
|
+
className: cn11(
|
|
983
|
+
"relative flex w-full flex-1 flex-col bg-background 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-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",
|
|
984
|
+
className
|
|
985
|
+
)
|
|
986
|
+
}, props)
|
|
987
|
+
);
|
|
988
|
+
}
|
|
989
|
+
function SidebarHeader(_a) {
|
|
990
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
991
|
+
return /* @__PURE__ */ jsx11(
|
|
992
|
+
"div",
|
|
993
|
+
__spreadValues({
|
|
994
|
+
"data-slot": "sidebar-header",
|
|
995
|
+
"data-sidebar": "header",
|
|
996
|
+
className: cn11("flex flex-col gap-2 p-2", className)
|
|
997
|
+
}, props)
|
|
998
|
+
);
|
|
999
|
+
}
|
|
241
1000
|
function SidebarFooter(_a) {
|
|
242
1001
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
243
|
-
return /* @__PURE__ */
|
|
1002
|
+
return /* @__PURE__ */ jsx11(
|
|
244
1003
|
"div",
|
|
245
1004
|
__spreadValues({
|
|
246
1005
|
"data-slot": "sidebar-footer",
|
|
247
1006
|
"data-sidebar": "footer",
|
|
248
|
-
className:
|
|
1007
|
+
className: cn11("flex flex-col gap-2 p-2", className)
|
|
1008
|
+
}, props)
|
|
1009
|
+
);
|
|
1010
|
+
}
|
|
1011
|
+
function SidebarContent(_a) {
|
|
1012
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1013
|
+
return /* @__PURE__ */ jsx11(
|
|
1014
|
+
"div",
|
|
1015
|
+
__spreadValues({
|
|
1016
|
+
"data-slot": "sidebar-content",
|
|
1017
|
+
"data-sidebar": "content",
|
|
1018
|
+
className: cn11(
|
|
1019
|
+
"no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
|
|
1020
|
+
className
|
|
1021
|
+
)
|
|
1022
|
+
}, props)
|
|
1023
|
+
);
|
|
1024
|
+
}
|
|
1025
|
+
function SidebarGroup(_a) {
|
|
1026
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1027
|
+
return /* @__PURE__ */ jsx11(
|
|
1028
|
+
"div",
|
|
1029
|
+
__spreadValues({
|
|
1030
|
+
"data-slot": "sidebar-group",
|
|
1031
|
+
"data-sidebar": "group",
|
|
1032
|
+
className: cn11(
|
|
1033
|
+
"relative flex w-full min-w-0 flex-col px-2 py-1",
|
|
1034
|
+
className
|
|
1035
|
+
)
|
|
1036
|
+
}, props)
|
|
1037
|
+
);
|
|
1038
|
+
}
|
|
1039
|
+
function SidebarGroupLabel(_a) {
|
|
1040
|
+
var _b = _a, {
|
|
1041
|
+
className,
|
|
1042
|
+
render
|
|
1043
|
+
} = _b, props = __objRest(_b, [
|
|
1044
|
+
"className",
|
|
1045
|
+
"render"
|
|
1046
|
+
]);
|
|
1047
|
+
return useRender2({
|
|
1048
|
+
defaultTagName: "div",
|
|
1049
|
+
props: mergeProps2(
|
|
1050
|
+
{
|
|
1051
|
+
className: cn11(
|
|
1052
|
+
"flex h-8 shrink-0 items-center rounded-md px-2 text-xs text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
1053
|
+
className
|
|
1054
|
+
)
|
|
1055
|
+
},
|
|
1056
|
+
props
|
|
1057
|
+
),
|
|
1058
|
+
render,
|
|
1059
|
+
state: {
|
|
1060
|
+
slot: "sidebar-group-label",
|
|
1061
|
+
sidebar: "group-label"
|
|
1062
|
+
}
|
|
1063
|
+
});
|
|
1064
|
+
}
|
|
1065
|
+
function SidebarGroupContent(_a) {
|
|
1066
|
+
var _b = _a, {
|
|
1067
|
+
className
|
|
1068
|
+
} = _b, props = __objRest(_b, [
|
|
1069
|
+
"className"
|
|
1070
|
+
]);
|
|
1071
|
+
return /* @__PURE__ */ jsx11(
|
|
1072
|
+
"div",
|
|
1073
|
+
__spreadValues({
|
|
1074
|
+
"data-slot": "sidebar-group-content",
|
|
1075
|
+
"data-sidebar": "group-content",
|
|
1076
|
+
className: cn11("w-full text-xs", className)
|
|
249
1077
|
}, props)
|
|
250
1078
|
);
|
|
251
1079
|
}
|
|
252
1080
|
function SidebarMenu(_a) {
|
|
253
1081
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
254
|
-
return /* @__PURE__ */
|
|
1082
|
+
return /* @__PURE__ */ jsx11(
|
|
255
1083
|
"ul",
|
|
256
1084
|
__spreadValues({
|
|
257
1085
|
"data-slot": "sidebar-menu",
|
|
258
1086
|
"data-sidebar": "menu",
|
|
259
|
-
className:
|
|
1087
|
+
className: cn11("flex w-full min-w-0 flex-col gap-px", className)
|
|
260
1088
|
}, props)
|
|
261
1089
|
);
|
|
262
1090
|
}
|
|
263
1091
|
function SidebarMenuItem(_a) {
|
|
264
1092
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
265
|
-
return /* @__PURE__ */
|
|
1093
|
+
return /* @__PURE__ */ jsx11(
|
|
266
1094
|
"li",
|
|
267
1095
|
__spreadValues({
|
|
268
1096
|
"data-slot": "sidebar-menu-item",
|
|
269
1097
|
"data-sidebar": "menu-item",
|
|
270
|
-
className:
|
|
1098
|
+
className: cn11("group/menu-item relative", className)
|
|
271
1099
|
}, props)
|
|
272
1100
|
);
|
|
273
1101
|
}
|
|
@@ -308,15 +1136,15 @@ function SidebarMenuButton(_a) {
|
|
|
308
1136
|
"className"
|
|
309
1137
|
]);
|
|
310
1138
|
const { isMobile, state } = useSidebar();
|
|
311
|
-
const comp =
|
|
1139
|
+
const comp = useRender2({
|
|
312
1140
|
defaultTagName: "button",
|
|
313
|
-
props:
|
|
1141
|
+
props: mergeProps2(
|
|
314
1142
|
{
|
|
315
|
-
className:
|
|
1143
|
+
className: cn11(sidebarMenuButtonVariants({ variant, size }), className)
|
|
316
1144
|
},
|
|
317
1145
|
props
|
|
318
1146
|
),
|
|
319
|
-
render: !tooltip ? render : /* @__PURE__ */
|
|
1147
|
+
render: !tooltip ? render : /* @__PURE__ */ jsx11(TooltipTrigger, { render }),
|
|
320
1148
|
state: {
|
|
321
1149
|
slot: "sidebar-menu-button",
|
|
322
1150
|
sidebar: "menu-button",
|
|
@@ -332,9 +1160,9 @@ function SidebarMenuButton(_a) {
|
|
|
332
1160
|
children: tooltip
|
|
333
1161
|
};
|
|
334
1162
|
}
|
|
335
|
-
return /* @__PURE__ */
|
|
1163
|
+
return /* @__PURE__ */ jsxs6(Tooltip, { children: [
|
|
336
1164
|
comp,
|
|
337
|
-
/* @__PURE__ */
|
|
1165
|
+
/* @__PURE__ */ jsx11(
|
|
338
1166
|
TooltipContent,
|
|
339
1167
|
__spreadValues({
|
|
340
1168
|
side: "right",
|
|
@@ -344,28 +1172,249 @@ function SidebarMenuButton(_a) {
|
|
|
344
1172
|
)
|
|
345
1173
|
] });
|
|
346
1174
|
}
|
|
1175
|
+
function SidebarMenuBadge(_a) {
|
|
1176
|
+
var _b = _a, {
|
|
1177
|
+
className
|
|
1178
|
+
} = _b, props = __objRest(_b, [
|
|
1179
|
+
"className"
|
|
1180
|
+
]);
|
|
1181
|
+
return /* @__PURE__ */ jsx11(
|
|
1182
|
+
"div",
|
|
1183
|
+
__spreadValues({
|
|
1184
|
+
"data-slot": "sidebar-menu-badge",
|
|
1185
|
+
"data-sidebar": "menu-badge",
|
|
1186
|
+
className: cn11(
|
|
1187
|
+
"pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-[calc(var(--radius-sm)-2px)] px-1 text-xs font-medium text-sidebar-foreground tabular-nums select-none group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 peer-data-active/menu-button:text-sidebar-accent-foreground",
|
|
1188
|
+
className
|
|
1189
|
+
)
|
|
1190
|
+
}, props)
|
|
1191
|
+
);
|
|
1192
|
+
}
|
|
347
1193
|
|
|
348
|
-
// src/components/composed/
|
|
349
|
-
import { jsx as
|
|
350
|
-
|
|
1194
|
+
// src/components/composed/app-sidebar.tsx
|
|
1195
|
+
import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1196
|
+
function formatSegment(segment, subHref, navMainItems = [], navSecondaryItems = []) {
|
|
1197
|
+
if (subHref) {
|
|
1198
|
+
const matched = [...navMainItems, ...navSecondaryItems].find(
|
|
1199
|
+
(item) => item.url === subHref
|
|
1200
|
+
);
|
|
1201
|
+
if (matched) return matched.title;
|
|
1202
|
+
}
|
|
1203
|
+
return segment.split("-").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
|
|
1204
|
+
}
|
|
1205
|
+
function isRouteActive(url, pathname) {
|
|
1206
|
+
if (!pathname) return false;
|
|
1207
|
+
if (url === "/") return pathname === "/";
|
|
1208
|
+
const rootPrefix = `/${url.split("/")[1]}`;
|
|
1209
|
+
return pathname === url || pathname.startsWith(rootPrefix);
|
|
1210
|
+
}
|
|
1211
|
+
var AppSidebar = memo(function AppSidebar2({
|
|
351
1212
|
name,
|
|
352
1213
|
email,
|
|
1214
|
+
orgRole,
|
|
1215
|
+
brand = "Prediktif",
|
|
1216
|
+
href,
|
|
1217
|
+
confirmDialog = false,
|
|
1218
|
+
headerDropdown = false,
|
|
353
1219
|
image,
|
|
354
|
-
|
|
1220
|
+
defaultOpen = true,
|
|
1221
|
+
navMainItems,
|
|
1222
|
+
navSecondaryItems = [],
|
|
1223
|
+
organizations,
|
|
1224
|
+
activeOrg,
|
|
1225
|
+
setActiveOrg,
|
|
1226
|
+
children
|
|
355
1227
|
}) {
|
|
1228
|
+
const _isMobile = useIsMobile();
|
|
1229
|
+
const pathname = usePathname();
|
|
1230
|
+
const segments = pathname ? pathname.split("/").filter(Boolean) : [];
|
|
356
1231
|
const initials = name ? name.trim().split(" ").map((n) => n[0]).join("").substring(0, 2).toUpperCase() : "U";
|
|
357
|
-
return /* @__PURE__ */
|
|
358
|
-
/* @__PURE__ */
|
|
359
|
-
/* @__PURE__ */
|
|
360
|
-
|
|
1232
|
+
return /* @__PURE__ */ jsxs7(SidebarProvider, { defaultOpen, children: [
|
|
1233
|
+
/* @__PURE__ */ jsxs7(Sidebar, { collapsible: "icon", children: [
|
|
1234
|
+
/* @__PURE__ */ jsx12(SidebarHeader, { children: headerDropdown ? /* @__PURE__ */ jsx12(SidebarMenu, { children: /* @__PURE__ */ jsx12(SidebarMenuItem, { children: /* @__PURE__ */ jsxs7(DropdownMenu, { children: [
|
|
1235
|
+
/* @__PURE__ */ jsx12(
|
|
1236
|
+
DropdownMenuTrigger,
|
|
1237
|
+
{
|
|
1238
|
+
render: /* @__PURE__ */ jsxs7(
|
|
1239
|
+
SidebarMenuButton,
|
|
1240
|
+
{
|
|
1241
|
+
size: "lg",
|
|
1242
|
+
className: "data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",
|
|
1243
|
+
children: [
|
|
1244
|
+
/* @__PURE__ */ jsx12("div", { className: "flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground", children: /* @__PURE__ */ jsx12(Command, { className: "size-4" }) }),
|
|
1245
|
+
/* @__PURE__ */ jsxs7("div", { className: "grid flex-1 text-left text-sm leading-tight", children: [
|
|
1246
|
+
/* @__PURE__ */ jsx12("span", { className: "truncate font-medium", children: (activeOrg == null ? void 0 : activeOrg.name) || brand }),
|
|
1247
|
+
/* @__PURE__ */ jsx12("span", { className: "truncate text-xs", children: (activeOrg == null ? void 0 : activeOrg.plan) || orgRole })
|
|
1248
|
+
] }),
|
|
1249
|
+
/* @__PURE__ */ jsx12(ChevronsUpDown, { className: "ml-auto" })
|
|
1250
|
+
]
|
|
1251
|
+
}
|
|
1252
|
+
)
|
|
1253
|
+
}
|
|
1254
|
+
),
|
|
1255
|
+
/* @__PURE__ */ jsx12(
|
|
1256
|
+
DropdownMenuContent,
|
|
1257
|
+
{
|
|
1258
|
+
className: "w-(--radix-dropdown-menu-trigger-width) min-w-60 rounded-lg",
|
|
1259
|
+
align: "start",
|
|
1260
|
+
side: "bottom",
|
|
1261
|
+
sideOffset: 4,
|
|
1262
|
+
children: /* @__PURE__ */ jsxs7(DropdownMenuGroup, { children: [
|
|
1263
|
+
/* @__PURE__ */ jsx12(DropdownMenuLabel, { className: "text-xs text-muted-foreground", children: "Organizations" }),
|
|
1264
|
+
(organizations || []).map((org) => {
|
|
1265
|
+
return /* @__PURE__ */ jsxs7(
|
|
1266
|
+
DropdownMenuItem,
|
|
1267
|
+
{
|
|
1268
|
+
onClick: () => setActiveOrg == null ? void 0 : setActiveOrg(org),
|
|
1269
|
+
className: "gap-2 p-2",
|
|
1270
|
+
children: [
|
|
1271
|
+
/* @__PURE__ */ jsx12("div", { className: "flex size-6 items-center justify-center rounded-md border", children: /* @__PURE__ */ jsx12(Command, { className: "size-3.5 shrink-0" }) }),
|
|
1272
|
+
org.name
|
|
1273
|
+
]
|
|
1274
|
+
},
|
|
1275
|
+
org.name
|
|
1276
|
+
);
|
|
1277
|
+
})
|
|
1278
|
+
] })
|
|
1279
|
+
}
|
|
1280
|
+
)
|
|
1281
|
+
] }) }) }) : /* @__PURE__ */ jsx12(SidebarMenu, { children: /* @__PURE__ */ jsx12(SidebarMenuItem, { children: /* @__PURE__ */ jsxs7(SidebarMenuButton, { size: "lg", render: /* @__PURE__ */ jsx12(Link, { href: "/" }), children: [
|
|
1282
|
+
/* @__PURE__ */ jsx12("div", { className: "flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground", children: /* @__PURE__ */ jsx12(Command, { className: "size-4" }) }),
|
|
1283
|
+
/* @__PURE__ */ jsxs7("div", { className: "grid flex-1 text-left text-sm leading-tight", children: [
|
|
1284
|
+
/* @__PURE__ */ jsx12("span", { className: "truncate font-medium", children: brand }),
|
|
1285
|
+
/* @__PURE__ */ jsx12("span", { className: "truncate text-xs", children: orgRole })
|
|
1286
|
+
] })
|
|
1287
|
+
] }) }) }) }),
|
|
1288
|
+
/* @__PURE__ */ jsxs7(SidebarContent, { children: [
|
|
1289
|
+
/* @__PURE__ */ jsxs7(SidebarGroup, { children: [
|
|
1290
|
+
/* @__PURE__ */ jsx12(SidebarGroupLabel, { children: "Platform" }),
|
|
1291
|
+
/* @__PURE__ */ jsx12(SidebarMenu, { children: navMainItems.map(({ title, url, icon: Icon, locked }) => {
|
|
1292
|
+
const isActive = isRouteActive(url, pathname);
|
|
1293
|
+
return /* @__PURE__ */ jsxs7(SidebarMenuItem, { children: [
|
|
1294
|
+
/* @__PURE__ */ jsxs7(
|
|
1295
|
+
SidebarMenuButton,
|
|
1296
|
+
{
|
|
1297
|
+
isActive,
|
|
1298
|
+
tooltip: title,
|
|
1299
|
+
render: /* @__PURE__ */ jsx12(Link, { href: url }),
|
|
1300
|
+
children: [
|
|
1301
|
+
/* @__PURE__ */ jsx12(Icon, {}),
|
|
1302
|
+
/* @__PURE__ */ jsx12("span", { children: title })
|
|
1303
|
+
]
|
|
1304
|
+
}
|
|
1305
|
+
),
|
|
1306
|
+
locked && /* @__PURE__ */ jsx12(SidebarMenuBadge, { children: /* @__PURE__ */ jsx12(LockIcon, { size: 12 }) })
|
|
1307
|
+
] }, title);
|
|
1308
|
+
}) })
|
|
1309
|
+
] }),
|
|
1310
|
+
/* @__PURE__ */ jsx12(SidebarGroup, { className: "mt-auto", children: /* @__PURE__ */ jsx12(SidebarGroupContent, { children: /* @__PURE__ */ jsx12(SidebarMenu, { children: navSecondaryItems.map(({ title, url, icon: Icon, locked }) => {
|
|
1311
|
+
const isActive = isRouteActive(url, pathname);
|
|
1312
|
+
return /* @__PURE__ */ jsxs7(SidebarMenuItem, { children: [
|
|
1313
|
+
/* @__PURE__ */ jsxs7(
|
|
1314
|
+
SidebarMenuButton,
|
|
1315
|
+
{
|
|
1316
|
+
size: "sm",
|
|
1317
|
+
isActive,
|
|
1318
|
+
tooltip: title,
|
|
1319
|
+
render: /* @__PURE__ */ jsx12(Link, { href: url }),
|
|
1320
|
+
children: [
|
|
1321
|
+
/* @__PURE__ */ jsx12(Icon, {}),
|
|
1322
|
+
/* @__PURE__ */ jsx12("span", { children: title })
|
|
1323
|
+
]
|
|
1324
|
+
}
|
|
1325
|
+
),
|
|
1326
|
+
locked && /* @__PURE__ */ jsx12(SidebarMenuBadge, { children: /* @__PURE__ */ jsx12(LockIcon, { size: 12 }) })
|
|
1327
|
+
] }, title);
|
|
1328
|
+
}) }) }) })
|
|
1329
|
+
] }),
|
|
1330
|
+
/* @__PURE__ */ jsx12(SidebarFooter, { children: /* @__PURE__ */ jsx12(SidebarMenu, { children: /* @__PURE__ */ jsx12(SidebarMenuItem, { children: confirmDialog ? /* @__PURE__ */ jsxs7(AlertDialog, { children: [
|
|
1331
|
+
/* @__PURE__ */ jsx12(
|
|
1332
|
+
AlertDialogTrigger,
|
|
1333
|
+
{
|
|
1334
|
+
render: /* @__PURE__ */ jsxs7(SidebarMenuButton, { size: "lg", children: [
|
|
1335
|
+
/* @__PURE__ */ jsxs7(Avatar, { children: [
|
|
1336
|
+
/* @__PURE__ */ jsx12(AvatarImage, { src: image || "", alt: name || "" }),
|
|
1337
|
+
/* @__PURE__ */ jsx12(AvatarFallback, { children: initials })
|
|
1338
|
+
] }),
|
|
1339
|
+
/* @__PURE__ */ jsxs7("div", { className: "grid flex-1 text-left text-sm leading-tight", children: [
|
|
1340
|
+
/* @__PURE__ */ jsx12("span", { className: "truncate font-medium", children: name }),
|
|
1341
|
+
/* @__PURE__ */ jsx12("span", { className: "truncate text-xs text-muted-foreground", children: email })
|
|
1342
|
+
] })
|
|
1343
|
+
] })
|
|
1344
|
+
}
|
|
1345
|
+
),
|
|
1346
|
+
/* @__PURE__ */ jsxs7(AlertDialogContent, { children: [
|
|
1347
|
+
/* @__PURE__ */ jsxs7(AlertDialogHeader, { children: [
|
|
1348
|
+
/* @__PURE__ */ jsx12(AlertDialogTitle, { children: "Manage Account in Identity" }),
|
|
1349
|
+
/* @__PURE__ */ jsx12(AlertDialogDescription, { children: "You will be redirected to the Identity website to manage your profile, account, and settings." })
|
|
1350
|
+
] }),
|
|
1351
|
+
/* @__PURE__ */ jsxs7(AlertDialogFooter, { children: [
|
|
1352
|
+
/* @__PURE__ */ jsx12(AlertDialogCancel, { children: "Cancel" }),
|
|
1353
|
+
/* @__PURE__ */ jsx12(
|
|
1354
|
+
AlertDialogAction,
|
|
1355
|
+
{
|
|
1356
|
+
nativeButton: false,
|
|
1357
|
+
render: /* @__PURE__ */ jsx12(Link, { href, target: "_blank" }),
|
|
1358
|
+
children: "Continue"
|
|
1359
|
+
}
|
|
1360
|
+
)
|
|
1361
|
+
] })
|
|
1362
|
+
] })
|
|
1363
|
+
] }) : /* @__PURE__ */ jsxs7(SidebarMenuButton, { size: "lg", render: /* @__PURE__ */ jsx12(Link, { href }), children: [
|
|
1364
|
+
/* @__PURE__ */ jsxs7(Avatar, { children: [
|
|
1365
|
+
/* @__PURE__ */ jsx12(AvatarImage, { src: image || "", alt: name || "" }),
|
|
1366
|
+
/* @__PURE__ */ jsx12(AvatarFallback, { children: initials })
|
|
1367
|
+
] }),
|
|
1368
|
+
/* @__PURE__ */ jsxs7("div", { className: "grid flex-1 text-left text-sm leading-tight", children: [
|
|
1369
|
+
/* @__PURE__ */ jsx12("span", { className: "truncate font-medium", children: name }),
|
|
1370
|
+
/* @__PURE__ */ jsx12("span", { className: "truncate text-xs text-muted-foreground", children: email })
|
|
1371
|
+
] })
|
|
1372
|
+
] }) }) }) }),
|
|
1373
|
+
/* @__PURE__ */ jsx12(SidebarRail, {})
|
|
361
1374
|
] }),
|
|
362
|
-
/* @__PURE__ */
|
|
363
|
-
/* @__PURE__ */
|
|
364
|
-
|
|
1375
|
+
/* @__PURE__ */ jsxs7(SidebarInset, { children: [
|
|
1376
|
+
/* @__PURE__ */ jsx12("header", { className: "flex h-16 shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: /* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-2 px-4", children: [
|
|
1377
|
+
/* @__PURE__ */ jsx12(SidebarTrigger, { className: "-ml-1" }),
|
|
1378
|
+
/* @__PURE__ */ jsx12(
|
|
1379
|
+
Separator,
|
|
1380
|
+
{
|
|
1381
|
+
orientation: "vertical",
|
|
1382
|
+
className: "mr-2 data-vertical:h-4 data-vertical:self-auto"
|
|
1383
|
+
}
|
|
1384
|
+
),
|
|
1385
|
+
/* @__PURE__ */ jsx12(Breadcrumb, { children: /* @__PURE__ */ jsxs7(BreadcrumbList, { children: [
|
|
1386
|
+
/* @__PURE__ */ jsx12(BreadcrumbItem, { children: /* @__PURE__ */ jsx12(BreadcrumbLink, { render: /* @__PURE__ */ jsx12(Link, { href: "/" }), children: "Platform" }) }),
|
|
1387
|
+
/* @__PURE__ */ jsx12(BreadcrumbSeparator, {}),
|
|
1388
|
+
/* @__PURE__ */ jsx12(BreadcrumbItem, { children: /* @__PURE__ */ jsx12(BreadcrumbPage, { children: segments.length === 0 ? "Overview" : formatSegment(
|
|
1389
|
+
segments[segments.length - 1],
|
|
1390
|
+
`/${segments.join("/")}`,
|
|
1391
|
+
navMainItems,
|
|
1392
|
+
navSecondaryItems
|
|
1393
|
+
) }) })
|
|
1394
|
+
] }) })
|
|
1395
|
+
] }) }),
|
|
1396
|
+
/* @__PURE__ */ jsx12("div", { className: "p-4 pt-0", children })
|
|
365
1397
|
] })
|
|
366
|
-
] })
|
|
1398
|
+
] });
|
|
1399
|
+
});
|
|
1400
|
+
|
|
1401
|
+
// src/components/composed/header-title.tsx
|
|
1402
|
+
import { memo as memo2 } from "react";
|
|
1403
|
+
import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1404
|
+
var HeaderTitle = memo2(function HeaderTitle2({
|
|
1405
|
+
title,
|
|
1406
|
+
subtitle,
|
|
1407
|
+
children
|
|
1408
|
+
}) {
|
|
1409
|
+
return /* @__PURE__ */ jsxs8("div", { className: "w-full space-y-4", children: [
|
|
1410
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
1411
|
+
/* @__PURE__ */ jsx13("h1", { className: "font-semibold", children: title }),
|
|
1412
|
+
/* @__PURE__ */ jsx13("p", { className: "text-xs text-muted-foreground", children: subtitle })
|
|
1413
|
+
] }),
|
|
1414
|
+
children
|
|
1415
|
+
] });
|
|
367
1416
|
});
|
|
368
1417
|
export {
|
|
369
|
-
|
|
370
|
-
|
|
1418
|
+
AppSidebar,
|
|
1419
|
+
HeaderTitle
|
|
371
1420
|
};
|