@webdevarif/dashui 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +82 -0
- package/dist/index.d.mts +328 -0
- package/dist/index.d.ts +328 -0
- package/dist/index.js +1642 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1525 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +64 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,1525 @@
|
|
|
1
|
+
// src/components/primitives/button.tsx
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
|
|
6
|
+
// src/lib/utils.ts
|
|
7
|
+
import { clsx } from "clsx";
|
|
8
|
+
import { twMerge } from "tailwind-merge";
|
|
9
|
+
function cn(...inputs) {
|
|
10
|
+
return twMerge(clsx(inputs));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// src/components/primitives/button.tsx
|
|
14
|
+
import { jsx } from "react/jsx-runtime";
|
|
15
|
+
var buttonVariants = cva(
|
|
16
|
+
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
17
|
+
{
|
|
18
|
+
variants: {
|
|
19
|
+
variant: {
|
|
20
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
21
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
22
|
+
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
23
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
24
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
25
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
26
|
+
},
|
|
27
|
+
size: {
|
|
28
|
+
default: "h-10 px-4 py-2",
|
|
29
|
+
sm: "h-9 rounded-md px-3",
|
|
30
|
+
lg: "h-11 rounded-md px-8",
|
|
31
|
+
icon: "h-10 w-10"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
defaultVariants: {
|
|
35
|
+
variant: "default",
|
|
36
|
+
size: "default"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
var Button = React.forwardRef(
|
|
41
|
+
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
42
|
+
const Comp = asChild ? Slot : "button";
|
|
43
|
+
return /* @__PURE__ */ jsx(
|
|
44
|
+
Comp,
|
|
45
|
+
{
|
|
46
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
47
|
+
ref,
|
|
48
|
+
...props
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
Button.displayName = "Button";
|
|
54
|
+
|
|
55
|
+
// src/components/primitives/badge.tsx
|
|
56
|
+
import { cva as cva2 } from "class-variance-authority";
|
|
57
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
58
|
+
var badgeVariants = cva2(
|
|
59
|
+
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
60
|
+
{
|
|
61
|
+
variants: {
|
|
62
|
+
variant: {
|
|
63
|
+
default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
|
|
64
|
+
secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
65
|
+
destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
|
|
66
|
+
outline: "text-foreground",
|
|
67
|
+
success: "border-transparent bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-100",
|
|
68
|
+
warning: "border-transparent bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-100"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
defaultVariants: {
|
|
72
|
+
variant: "default"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
function Badge({ className, variant, ...props }) {
|
|
77
|
+
return /* @__PURE__ */ jsx2("div", { className: cn(badgeVariants({ variant }), className), ...props });
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// src/components/primitives/card.tsx
|
|
81
|
+
import * as React2 from "react";
|
|
82
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
83
|
+
var Card = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
|
|
84
|
+
"div",
|
|
85
|
+
{
|
|
86
|
+
ref,
|
|
87
|
+
className: cn(
|
|
88
|
+
"rounded-lg border bg-card text-card-foreground shadow-sm",
|
|
89
|
+
className
|
|
90
|
+
),
|
|
91
|
+
...props
|
|
92
|
+
}
|
|
93
|
+
));
|
|
94
|
+
Card.displayName = "Card";
|
|
95
|
+
var CardHeader = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
|
|
96
|
+
"div",
|
|
97
|
+
{
|
|
98
|
+
ref,
|
|
99
|
+
className: cn("flex flex-col space-y-1.5 p-6", className),
|
|
100
|
+
...props
|
|
101
|
+
}
|
|
102
|
+
));
|
|
103
|
+
CardHeader.displayName = "CardHeader";
|
|
104
|
+
var CardTitle = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
|
|
105
|
+
"h3",
|
|
106
|
+
{
|
|
107
|
+
ref,
|
|
108
|
+
className: cn(
|
|
109
|
+
"text-2xl font-semibold leading-none tracking-tight",
|
|
110
|
+
className
|
|
111
|
+
),
|
|
112
|
+
...props
|
|
113
|
+
}
|
|
114
|
+
));
|
|
115
|
+
CardTitle.displayName = "CardTitle";
|
|
116
|
+
var CardDescription = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
|
|
117
|
+
"p",
|
|
118
|
+
{
|
|
119
|
+
ref,
|
|
120
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
121
|
+
...props
|
|
122
|
+
}
|
|
123
|
+
));
|
|
124
|
+
CardDescription.displayName = "CardDescription";
|
|
125
|
+
var CardContent = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3("div", { ref, className: cn("p-6 pt-0", className), ...props }));
|
|
126
|
+
CardContent.displayName = "CardContent";
|
|
127
|
+
var CardFooter = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
|
|
128
|
+
"div",
|
|
129
|
+
{
|
|
130
|
+
ref,
|
|
131
|
+
className: cn("flex items-center p-6 pt-0", className),
|
|
132
|
+
...props
|
|
133
|
+
}
|
|
134
|
+
));
|
|
135
|
+
CardFooter.displayName = "CardFooter";
|
|
136
|
+
|
|
137
|
+
// src/components/primitives/checkbox.tsx
|
|
138
|
+
import * as React3 from "react";
|
|
139
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
140
|
+
import { Check } from "lucide-react";
|
|
141
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
142
|
+
var Checkbox = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx4(
|
|
143
|
+
CheckboxPrimitive.Root,
|
|
144
|
+
{
|
|
145
|
+
ref,
|
|
146
|
+
className: cn(
|
|
147
|
+
"peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
|
|
148
|
+
className
|
|
149
|
+
),
|
|
150
|
+
...props,
|
|
151
|
+
children: /* @__PURE__ */ jsx4(
|
|
152
|
+
CheckboxPrimitive.Indicator,
|
|
153
|
+
{
|
|
154
|
+
className: cn("flex items-center justify-center text-current"),
|
|
155
|
+
children: /* @__PURE__ */ jsx4(Check, { className: "h-4 w-4" })
|
|
156
|
+
}
|
|
157
|
+
)
|
|
158
|
+
}
|
|
159
|
+
));
|
|
160
|
+
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
161
|
+
|
|
162
|
+
// src/components/primitives/dialog.tsx
|
|
163
|
+
import * as React4 from "react";
|
|
164
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
165
|
+
import { X } from "lucide-react";
|
|
166
|
+
import { jsx as jsx5, jsxs } from "react/jsx-runtime";
|
|
167
|
+
var Dialog = DialogPrimitive.Root;
|
|
168
|
+
var DialogTrigger = DialogPrimitive.Trigger;
|
|
169
|
+
var DialogClose = DialogPrimitive.Close;
|
|
170
|
+
var DialogPortal = DialogPrimitive.Portal;
|
|
171
|
+
var DialogOverlay = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx5(
|
|
172
|
+
DialogPrimitive.Overlay,
|
|
173
|
+
{
|
|
174
|
+
ref,
|
|
175
|
+
className: cn(
|
|
176
|
+
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
177
|
+
className
|
|
178
|
+
),
|
|
179
|
+
...props
|
|
180
|
+
}
|
|
181
|
+
));
|
|
182
|
+
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
183
|
+
var DialogContent = React4.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
184
|
+
/* @__PURE__ */ jsx5(DialogOverlay, {}),
|
|
185
|
+
/* @__PURE__ */ jsxs(
|
|
186
|
+
DialogPrimitive.Content,
|
|
187
|
+
{
|
|
188
|
+
ref,
|
|
189
|
+
className: cn(
|
|
190
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
191
|
+
className
|
|
192
|
+
),
|
|
193
|
+
...props,
|
|
194
|
+
children: [
|
|
195
|
+
children,
|
|
196
|
+
/* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
|
|
197
|
+
/* @__PURE__ */ jsx5(X, { className: "h-4 w-4" }),
|
|
198
|
+
/* @__PURE__ */ jsx5("span", { className: "sr-only", children: "Close" })
|
|
199
|
+
] })
|
|
200
|
+
]
|
|
201
|
+
}
|
|
202
|
+
)
|
|
203
|
+
] }));
|
|
204
|
+
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
205
|
+
var DialogHeader = ({
|
|
206
|
+
className,
|
|
207
|
+
...props
|
|
208
|
+
}) => /* @__PURE__ */ jsx5(
|
|
209
|
+
"div",
|
|
210
|
+
{
|
|
211
|
+
className: cn(
|
|
212
|
+
"flex flex-col space-y-1.5 text-center sm:text-left",
|
|
213
|
+
className
|
|
214
|
+
),
|
|
215
|
+
...props
|
|
216
|
+
}
|
|
217
|
+
);
|
|
218
|
+
DialogHeader.displayName = "DialogHeader";
|
|
219
|
+
var DialogFooter = ({
|
|
220
|
+
className,
|
|
221
|
+
...props
|
|
222
|
+
}) => /* @__PURE__ */ jsx5(
|
|
223
|
+
"div",
|
|
224
|
+
{
|
|
225
|
+
className: cn(
|
|
226
|
+
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
227
|
+
className
|
|
228
|
+
),
|
|
229
|
+
...props
|
|
230
|
+
}
|
|
231
|
+
);
|
|
232
|
+
DialogFooter.displayName = "DialogFooter";
|
|
233
|
+
var DialogTitle = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx5(
|
|
234
|
+
DialogPrimitive.Title,
|
|
235
|
+
{
|
|
236
|
+
ref,
|
|
237
|
+
className: cn(
|
|
238
|
+
"text-lg font-semibold leading-none tracking-tight",
|
|
239
|
+
className
|
|
240
|
+
),
|
|
241
|
+
...props
|
|
242
|
+
}
|
|
243
|
+
));
|
|
244
|
+
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
245
|
+
var DialogDescription = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx5(
|
|
246
|
+
DialogPrimitive.Description,
|
|
247
|
+
{
|
|
248
|
+
ref,
|
|
249
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
250
|
+
...props
|
|
251
|
+
}
|
|
252
|
+
));
|
|
253
|
+
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
254
|
+
|
|
255
|
+
// src/components/primitives/dropdown-menu.tsx
|
|
256
|
+
import * as React5 from "react";
|
|
257
|
+
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
258
|
+
import { Check as Check2, ChevronRight, Circle } from "lucide-react";
|
|
259
|
+
import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
260
|
+
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
261
|
+
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
262
|
+
var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
263
|
+
var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
264
|
+
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
265
|
+
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
266
|
+
var DropdownMenuSubTrigger = React5.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs2(
|
|
267
|
+
DropdownMenuPrimitive.SubTrigger,
|
|
268
|
+
{
|
|
269
|
+
ref,
|
|
270
|
+
className: cn(
|
|
271
|
+
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
|
|
272
|
+
inset && "pl-8",
|
|
273
|
+
className
|
|
274
|
+
),
|
|
275
|
+
...props,
|
|
276
|
+
children: [
|
|
277
|
+
children,
|
|
278
|
+
/* @__PURE__ */ jsx6(ChevronRight, { className: "ml-auto h-4 w-4" })
|
|
279
|
+
]
|
|
280
|
+
}
|
|
281
|
+
));
|
|
282
|
+
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
283
|
+
var DropdownMenuSubContent = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx6(
|
|
284
|
+
DropdownMenuPrimitive.SubContent,
|
|
285
|
+
{
|
|
286
|
+
ref,
|
|
287
|
+
className: cn(
|
|
288
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-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",
|
|
289
|
+
className
|
|
290
|
+
),
|
|
291
|
+
...props
|
|
292
|
+
}
|
|
293
|
+
));
|
|
294
|
+
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
295
|
+
var DropdownMenuContent = React5.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx6(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx6(
|
|
296
|
+
DropdownMenuPrimitive.Content,
|
|
297
|
+
{
|
|
298
|
+
ref,
|
|
299
|
+
sideOffset,
|
|
300
|
+
className: cn(
|
|
301
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-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",
|
|
302
|
+
className
|
|
303
|
+
),
|
|
304
|
+
...props
|
|
305
|
+
}
|
|
306
|
+
) }));
|
|
307
|
+
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
308
|
+
var DropdownMenuItem = React5.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx6(
|
|
309
|
+
DropdownMenuPrimitive.Item,
|
|
310
|
+
{
|
|
311
|
+
ref,
|
|
312
|
+
className: cn(
|
|
313
|
+
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
314
|
+
inset && "pl-8",
|
|
315
|
+
className
|
|
316
|
+
),
|
|
317
|
+
...props
|
|
318
|
+
}
|
|
319
|
+
));
|
|
320
|
+
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
321
|
+
var DropdownMenuCheckboxItem = React5.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs2(
|
|
322
|
+
DropdownMenuPrimitive.CheckboxItem,
|
|
323
|
+
{
|
|
324
|
+
ref,
|
|
325
|
+
className: cn(
|
|
326
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
327
|
+
className
|
|
328
|
+
),
|
|
329
|
+
checked,
|
|
330
|
+
...props,
|
|
331
|
+
children: [
|
|
332
|
+
/* @__PURE__ */ jsx6("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx6(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx6(Check2, { className: "h-4 w-4" }) }) }),
|
|
333
|
+
children
|
|
334
|
+
]
|
|
335
|
+
}
|
|
336
|
+
));
|
|
337
|
+
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
338
|
+
var DropdownMenuRadioItem = React5.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs2(
|
|
339
|
+
DropdownMenuPrimitive.RadioItem,
|
|
340
|
+
{
|
|
341
|
+
ref,
|
|
342
|
+
className: cn(
|
|
343
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
344
|
+
className
|
|
345
|
+
),
|
|
346
|
+
...props,
|
|
347
|
+
children: [
|
|
348
|
+
/* @__PURE__ */ jsx6("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx6(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx6(Circle, { className: "h-2 w-2 fill-current" }) }) }),
|
|
349
|
+
children
|
|
350
|
+
]
|
|
351
|
+
}
|
|
352
|
+
));
|
|
353
|
+
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
354
|
+
var DropdownMenuLabel = React5.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx6(
|
|
355
|
+
DropdownMenuPrimitive.Label,
|
|
356
|
+
{
|
|
357
|
+
ref,
|
|
358
|
+
className: cn(
|
|
359
|
+
"px-2 py-1.5 text-sm font-semibold",
|
|
360
|
+
inset && "pl-8",
|
|
361
|
+
className
|
|
362
|
+
),
|
|
363
|
+
...props
|
|
364
|
+
}
|
|
365
|
+
));
|
|
366
|
+
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
367
|
+
var DropdownMenuSeparator = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx6(
|
|
368
|
+
DropdownMenuPrimitive.Separator,
|
|
369
|
+
{
|
|
370
|
+
ref,
|
|
371
|
+
className: cn("-mx-1 my-1 h-px bg-muted", className),
|
|
372
|
+
...props
|
|
373
|
+
}
|
|
374
|
+
));
|
|
375
|
+
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
376
|
+
var DropdownMenuShortcut = ({
|
|
377
|
+
className,
|
|
378
|
+
...props
|
|
379
|
+
}) => {
|
|
380
|
+
return /* @__PURE__ */ jsx6(
|
|
381
|
+
"span",
|
|
382
|
+
{
|
|
383
|
+
className: cn("ml-auto text-xs tracking-widest opacity-60", className),
|
|
384
|
+
...props
|
|
385
|
+
}
|
|
386
|
+
);
|
|
387
|
+
};
|
|
388
|
+
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
389
|
+
|
|
390
|
+
// src/components/primitives/input.tsx
|
|
391
|
+
import * as React6 from "react";
|
|
392
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
393
|
+
var Input = React6.forwardRef(
|
|
394
|
+
({ className, type, error, ...props }, ref) => {
|
|
395
|
+
return /* @__PURE__ */ jsx7(
|
|
396
|
+
"input",
|
|
397
|
+
{
|
|
398
|
+
type,
|
|
399
|
+
className: cn(
|
|
400
|
+
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
401
|
+
error && "border-destructive focus-visible:ring-destructive",
|
|
402
|
+
className
|
|
403
|
+
),
|
|
404
|
+
ref,
|
|
405
|
+
...props
|
|
406
|
+
}
|
|
407
|
+
);
|
|
408
|
+
}
|
|
409
|
+
);
|
|
410
|
+
Input.displayName = "Input";
|
|
411
|
+
|
|
412
|
+
// src/components/primitives/label.tsx
|
|
413
|
+
import * as React7 from "react";
|
|
414
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
415
|
+
import { cva as cva3 } from "class-variance-authority";
|
|
416
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
417
|
+
var labelVariants = cva3(
|
|
418
|
+
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
419
|
+
);
|
|
420
|
+
var Label2 = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(
|
|
421
|
+
LabelPrimitive.Root,
|
|
422
|
+
{
|
|
423
|
+
ref,
|
|
424
|
+
className: cn(labelVariants(), className),
|
|
425
|
+
...props
|
|
426
|
+
}
|
|
427
|
+
));
|
|
428
|
+
Label2.displayName = LabelPrimitive.Root.displayName;
|
|
429
|
+
|
|
430
|
+
// src/components/primitives/popover.tsx
|
|
431
|
+
import * as React8 from "react";
|
|
432
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
433
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
434
|
+
var Popover = PopoverPrimitive.Root;
|
|
435
|
+
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
436
|
+
var PopoverContent = React8.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx9(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx9(
|
|
437
|
+
PopoverPrimitive.Content,
|
|
438
|
+
{
|
|
439
|
+
ref,
|
|
440
|
+
align,
|
|
441
|
+
sideOffset,
|
|
442
|
+
className: cn(
|
|
443
|
+
"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-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",
|
|
444
|
+
className
|
|
445
|
+
),
|
|
446
|
+
...props
|
|
447
|
+
}
|
|
448
|
+
) }));
|
|
449
|
+
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
450
|
+
|
|
451
|
+
// src/components/primitives/select.tsx
|
|
452
|
+
import * as React9 from "react";
|
|
453
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
454
|
+
import { Check as Check3, ChevronDown, ChevronUp } from "lucide-react";
|
|
455
|
+
import { jsx as jsx10, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
456
|
+
var Select = SelectPrimitive.Root;
|
|
457
|
+
var SelectGroup = SelectPrimitive.Group;
|
|
458
|
+
var SelectValue = SelectPrimitive.Value;
|
|
459
|
+
var SelectTrigger = React9.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs3(
|
|
460
|
+
SelectPrimitive.Trigger,
|
|
461
|
+
{
|
|
462
|
+
ref,
|
|
463
|
+
className: cn(
|
|
464
|
+
"flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
465
|
+
className
|
|
466
|
+
),
|
|
467
|
+
...props,
|
|
468
|
+
children: [
|
|
469
|
+
children,
|
|
470
|
+
/* @__PURE__ */ jsx10(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx10(ChevronDown, { className: "h-4 w-4 opacity-50" }) })
|
|
471
|
+
]
|
|
472
|
+
}
|
|
473
|
+
));
|
|
474
|
+
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
475
|
+
var SelectScrollUpButton = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
476
|
+
SelectPrimitive.ScrollUpButton,
|
|
477
|
+
{
|
|
478
|
+
ref,
|
|
479
|
+
className: cn(
|
|
480
|
+
"flex cursor-default items-center justify-center py-1",
|
|
481
|
+
className
|
|
482
|
+
),
|
|
483
|
+
...props,
|
|
484
|
+
children: /* @__PURE__ */ jsx10(ChevronUp, { className: "h-4 w-4" })
|
|
485
|
+
}
|
|
486
|
+
));
|
|
487
|
+
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
488
|
+
var SelectScrollDownButton = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
489
|
+
SelectPrimitive.ScrollDownButton,
|
|
490
|
+
{
|
|
491
|
+
ref,
|
|
492
|
+
className: cn(
|
|
493
|
+
"flex cursor-default items-center justify-center py-1",
|
|
494
|
+
className
|
|
495
|
+
),
|
|
496
|
+
...props,
|
|
497
|
+
children: /* @__PURE__ */ jsx10(ChevronDown, { className: "h-4 w-4" })
|
|
498
|
+
}
|
|
499
|
+
));
|
|
500
|
+
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
501
|
+
var SelectContent = React9.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx10(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs3(
|
|
502
|
+
SelectPrimitive.Content,
|
|
503
|
+
{
|
|
504
|
+
ref,
|
|
505
|
+
className: cn(
|
|
506
|
+
"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-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",
|
|
507
|
+
position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
508
|
+
className
|
|
509
|
+
),
|
|
510
|
+
position,
|
|
511
|
+
...props,
|
|
512
|
+
children: [
|
|
513
|
+
/* @__PURE__ */ jsx10(SelectScrollUpButton, {}),
|
|
514
|
+
/* @__PURE__ */ jsx10(
|
|
515
|
+
SelectPrimitive.Viewport,
|
|
516
|
+
{
|
|
517
|
+
className: cn(
|
|
518
|
+
"p-1",
|
|
519
|
+
position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
520
|
+
),
|
|
521
|
+
children
|
|
522
|
+
}
|
|
523
|
+
),
|
|
524
|
+
/* @__PURE__ */ jsx10(SelectScrollDownButton, {})
|
|
525
|
+
]
|
|
526
|
+
}
|
|
527
|
+
) }));
|
|
528
|
+
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
529
|
+
var SelectLabel = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
530
|
+
SelectPrimitive.Label,
|
|
531
|
+
{
|
|
532
|
+
ref,
|
|
533
|
+
className: cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className),
|
|
534
|
+
...props
|
|
535
|
+
}
|
|
536
|
+
));
|
|
537
|
+
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
538
|
+
var SelectItem = React9.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs3(
|
|
539
|
+
SelectPrimitive.Item,
|
|
540
|
+
{
|
|
541
|
+
ref,
|
|
542
|
+
className: cn(
|
|
543
|
+
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
544
|
+
className
|
|
545
|
+
),
|
|
546
|
+
...props,
|
|
547
|
+
children: [
|
|
548
|
+
/* @__PURE__ */ jsx10("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx10(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx10(Check3, { className: "h-4 w-4" }) }) }),
|
|
549
|
+
/* @__PURE__ */ jsx10(SelectPrimitive.ItemText, { children })
|
|
550
|
+
]
|
|
551
|
+
}
|
|
552
|
+
));
|
|
553
|
+
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
554
|
+
var SelectSeparator = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
555
|
+
SelectPrimitive.Separator,
|
|
556
|
+
{
|
|
557
|
+
ref,
|
|
558
|
+
className: cn("-mx-1 my-1 h-px bg-muted", className),
|
|
559
|
+
...props
|
|
560
|
+
}
|
|
561
|
+
));
|
|
562
|
+
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
563
|
+
|
|
564
|
+
// src/components/primitives/separator.tsx
|
|
565
|
+
import * as React10 from "react";
|
|
566
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
567
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
568
|
+
var Separator3 = React10.forwardRef(
|
|
569
|
+
({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx11(
|
|
570
|
+
SeparatorPrimitive.Root,
|
|
571
|
+
{
|
|
572
|
+
ref,
|
|
573
|
+
decorative,
|
|
574
|
+
orientation,
|
|
575
|
+
className: cn(
|
|
576
|
+
"shrink-0 bg-border",
|
|
577
|
+
orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
|
578
|
+
className
|
|
579
|
+
),
|
|
580
|
+
...props
|
|
581
|
+
}
|
|
582
|
+
)
|
|
583
|
+
);
|
|
584
|
+
Separator3.displayName = SeparatorPrimitive.Root.displayName;
|
|
585
|
+
|
|
586
|
+
// src/components/primitives/skeleton.tsx
|
|
587
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
588
|
+
function Skeleton({
|
|
589
|
+
className,
|
|
590
|
+
...props
|
|
591
|
+
}) {
|
|
592
|
+
return /* @__PURE__ */ jsx12(
|
|
593
|
+
"div",
|
|
594
|
+
{
|
|
595
|
+
className: cn("animate-pulse rounded-md bg-muted", className),
|
|
596
|
+
...props
|
|
597
|
+
}
|
|
598
|
+
);
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
// src/components/primitives/switch.tsx
|
|
602
|
+
import * as React11 from "react";
|
|
603
|
+
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
604
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
605
|
+
var Switch = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx13(
|
|
606
|
+
SwitchPrimitives.Root,
|
|
607
|
+
{
|
|
608
|
+
className: cn(
|
|
609
|
+
"peer inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
|
|
610
|
+
className
|
|
611
|
+
),
|
|
612
|
+
...props,
|
|
613
|
+
ref,
|
|
614
|
+
children: /* @__PURE__ */ jsx13(
|
|
615
|
+
SwitchPrimitives.Thumb,
|
|
616
|
+
{
|
|
617
|
+
className: cn(
|
|
618
|
+
"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
|
|
619
|
+
)
|
|
620
|
+
}
|
|
621
|
+
)
|
|
622
|
+
}
|
|
623
|
+
));
|
|
624
|
+
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
625
|
+
|
|
626
|
+
// src/components/primitives/tabs.tsx
|
|
627
|
+
import * as React12 from "react";
|
|
628
|
+
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
629
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
630
|
+
var Tabs = TabsPrimitive.Root;
|
|
631
|
+
var TabsList = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx14(
|
|
632
|
+
TabsPrimitive.List,
|
|
633
|
+
{
|
|
634
|
+
ref,
|
|
635
|
+
className: cn(
|
|
636
|
+
"inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",
|
|
637
|
+
className
|
|
638
|
+
),
|
|
639
|
+
...props
|
|
640
|
+
}
|
|
641
|
+
));
|
|
642
|
+
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
643
|
+
var TabsTrigger = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx14(
|
|
644
|
+
TabsPrimitive.Trigger,
|
|
645
|
+
{
|
|
646
|
+
ref,
|
|
647
|
+
className: cn(
|
|
648
|
+
"inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",
|
|
649
|
+
className
|
|
650
|
+
),
|
|
651
|
+
...props
|
|
652
|
+
}
|
|
653
|
+
));
|
|
654
|
+
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
655
|
+
var TabsContent = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx14(
|
|
656
|
+
TabsPrimitive.Content,
|
|
657
|
+
{
|
|
658
|
+
ref,
|
|
659
|
+
className: cn(
|
|
660
|
+
"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
661
|
+
className
|
|
662
|
+
),
|
|
663
|
+
...props
|
|
664
|
+
}
|
|
665
|
+
));
|
|
666
|
+
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
667
|
+
|
|
668
|
+
// src/components/primitives/textarea.tsx
|
|
669
|
+
import * as React13 from "react";
|
|
670
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
671
|
+
var Textarea = React13.forwardRef(
|
|
672
|
+
({ className, error, ...props }, ref) => {
|
|
673
|
+
return /* @__PURE__ */ jsx15(
|
|
674
|
+
"textarea",
|
|
675
|
+
{
|
|
676
|
+
className: cn(
|
|
677
|
+
"flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
678
|
+
error && "border-destructive focus-visible:ring-destructive",
|
|
679
|
+
className
|
|
680
|
+
),
|
|
681
|
+
ref,
|
|
682
|
+
...props
|
|
683
|
+
}
|
|
684
|
+
);
|
|
685
|
+
}
|
|
686
|
+
);
|
|
687
|
+
Textarea.displayName = "Textarea";
|
|
688
|
+
|
|
689
|
+
// src/components/primitives/tooltip.tsx
|
|
690
|
+
import * as React14 from "react";
|
|
691
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
692
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
693
|
+
var TooltipProvider = TooltipPrimitive.Provider;
|
|
694
|
+
var Tooltip = TooltipPrimitive.Root;
|
|
695
|
+
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
696
|
+
var TooltipContent = React14.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx16(
|
|
697
|
+
TooltipPrimitive.Content,
|
|
698
|
+
{
|
|
699
|
+
ref,
|
|
700
|
+
sideOffset,
|
|
701
|
+
className: cn(
|
|
702
|
+
"z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-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",
|
|
703
|
+
className
|
|
704
|
+
),
|
|
705
|
+
...props
|
|
706
|
+
}
|
|
707
|
+
));
|
|
708
|
+
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
709
|
+
|
|
710
|
+
// src/components/layout/app-shell.tsx
|
|
711
|
+
import { jsx as jsx17, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
712
|
+
function AppShell({ sidebar, children, collapsed }) {
|
|
713
|
+
return /* @__PURE__ */ jsxs4("div", { className: "flex h-screen overflow-hidden bg-background", children: [
|
|
714
|
+
/* @__PURE__ */ jsx17(
|
|
715
|
+
"aside",
|
|
716
|
+
{
|
|
717
|
+
className: cn(
|
|
718
|
+
"hidden border-r bg-card transition-all duration-300 md:block",
|
|
719
|
+
collapsed ? "w-[var(--sidebar-collapsed-width)]" : "w-[var(--sidebar-width)]"
|
|
720
|
+
),
|
|
721
|
+
children: sidebar
|
|
722
|
+
}
|
|
723
|
+
),
|
|
724
|
+
/* @__PURE__ */ jsx17("main", { className: "flex flex-1 flex-col overflow-hidden", children })
|
|
725
|
+
] });
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
// src/components/layout/sidebar.tsx
|
|
729
|
+
import * as React15 from "react";
|
|
730
|
+
import { ChevronDown as ChevronDown2, ChevronsLeft, ChevronsRight } from "lucide-react";
|
|
731
|
+
import { Fragment, jsx as jsx18, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
732
|
+
function SidebarItemComponent({
|
|
733
|
+
item,
|
|
734
|
+
collapsed,
|
|
735
|
+
depth = 0
|
|
736
|
+
}) {
|
|
737
|
+
const [open, setOpen] = React15.useState(
|
|
738
|
+
item.active || item.children?.some((c) => c.active) || false
|
|
739
|
+
);
|
|
740
|
+
const Icon2 = item.icon;
|
|
741
|
+
const hasChildren = item.children && item.children.length > 0;
|
|
742
|
+
if (hasChildren) {
|
|
743
|
+
return /* @__PURE__ */ jsxs5("div", { children: [
|
|
744
|
+
/* @__PURE__ */ jsxs5(
|
|
745
|
+
"button",
|
|
746
|
+
{
|
|
747
|
+
onClick: () => setOpen(!open),
|
|
748
|
+
className: cn(
|
|
749
|
+
"flex w-full items-center gap-3 rounded-md px-3 py-2 text-sm font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",
|
|
750
|
+
item.active && "bg-accent text-accent-foreground",
|
|
751
|
+
depth > 0 && "pl-9"
|
|
752
|
+
),
|
|
753
|
+
children: [
|
|
754
|
+
Icon2 && /* @__PURE__ */ jsx18(Icon2, { className: "h-4 w-4 shrink-0" }),
|
|
755
|
+
!collapsed && /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
756
|
+
/* @__PURE__ */ jsx18("span", { className: "flex-1 text-left", children: item.label }),
|
|
757
|
+
/* @__PURE__ */ jsx18(
|
|
758
|
+
ChevronDown2,
|
|
759
|
+
{
|
|
760
|
+
className: cn(
|
|
761
|
+
"h-4 w-4 shrink-0 transition-transform",
|
|
762
|
+
open && "rotate-180"
|
|
763
|
+
)
|
|
764
|
+
}
|
|
765
|
+
)
|
|
766
|
+
] })
|
|
767
|
+
]
|
|
768
|
+
}
|
|
769
|
+
),
|
|
770
|
+
open && !collapsed && /* @__PURE__ */ jsx18("div", { className: "mt-1 space-y-1", children: item.children.map((child) => /* @__PURE__ */ jsx18(
|
|
771
|
+
SidebarItemComponent,
|
|
772
|
+
{
|
|
773
|
+
item: child,
|
|
774
|
+
collapsed,
|
|
775
|
+
depth: depth + 1
|
|
776
|
+
},
|
|
777
|
+
child.href
|
|
778
|
+
)) })
|
|
779
|
+
] });
|
|
780
|
+
}
|
|
781
|
+
return /* @__PURE__ */ jsxs5(
|
|
782
|
+
"a",
|
|
783
|
+
{
|
|
784
|
+
href: item.href,
|
|
785
|
+
className: cn(
|
|
786
|
+
"flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",
|
|
787
|
+
item.active && "bg-accent text-accent-foreground",
|
|
788
|
+
depth > 0 && "pl-9"
|
|
789
|
+
),
|
|
790
|
+
children: [
|
|
791
|
+
Icon2 && /* @__PURE__ */ jsx18(Icon2, { className: "h-4 w-4 shrink-0" }),
|
|
792
|
+
!collapsed && /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
793
|
+
/* @__PURE__ */ jsx18("span", { className: "flex-1", children: item.label }),
|
|
794
|
+
item.badge !== void 0 && /* @__PURE__ */ jsx18("span", { className: "ml-auto rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary", children: item.badge })
|
|
795
|
+
] })
|
|
796
|
+
]
|
|
797
|
+
}
|
|
798
|
+
);
|
|
799
|
+
}
|
|
800
|
+
function Sidebar({
|
|
801
|
+
logo,
|
|
802
|
+
items,
|
|
803
|
+
footer,
|
|
804
|
+
collapsed,
|
|
805
|
+
onCollapse
|
|
806
|
+
}) {
|
|
807
|
+
return /* @__PURE__ */ jsxs5("div", { className: "flex h-full flex-col", children: [
|
|
808
|
+
logo && /* @__PURE__ */ jsx18("div", { className: "flex h-14 items-center border-b px-4", children: logo }),
|
|
809
|
+
/* @__PURE__ */ jsx18("nav", { className: "flex-1 space-y-1 overflow-y-auto p-3", children: items.map((item) => /* @__PURE__ */ jsx18(
|
|
810
|
+
SidebarItemComponent,
|
|
811
|
+
{
|
|
812
|
+
item,
|
|
813
|
+
collapsed
|
|
814
|
+
},
|
|
815
|
+
item.href
|
|
816
|
+
)) }),
|
|
817
|
+
/* @__PURE__ */ jsxs5("div", { className: "border-t p-3", children: [
|
|
818
|
+
footer,
|
|
819
|
+
onCollapse && /* @__PURE__ */ jsx18(
|
|
820
|
+
"button",
|
|
821
|
+
{
|
|
822
|
+
onClick: () => onCollapse(!collapsed),
|
|
823
|
+
className: "flex w-full items-center justify-center rounded-md p-2 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",
|
|
824
|
+
children: collapsed ? /* @__PURE__ */ jsx18(ChevronsRight, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx18(ChevronsLeft, { className: "h-4 w-4" })
|
|
825
|
+
}
|
|
826
|
+
)
|
|
827
|
+
] })
|
|
828
|
+
] });
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
// src/components/layout/top-bar.tsx
|
|
832
|
+
import { Menu } from "lucide-react";
|
|
833
|
+
import { jsx as jsx19, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
834
|
+
function TopBar({
|
|
835
|
+
storeName,
|
|
836
|
+
user,
|
|
837
|
+
onMenuToggle,
|
|
838
|
+
actions,
|
|
839
|
+
className
|
|
840
|
+
}) {
|
|
841
|
+
return /* @__PURE__ */ jsxs6(
|
|
842
|
+
"header",
|
|
843
|
+
{
|
|
844
|
+
className: cn(
|
|
845
|
+
"flex h-14 items-center gap-4 border-b bg-card px-4 lg:px-6",
|
|
846
|
+
className
|
|
847
|
+
),
|
|
848
|
+
children: [
|
|
849
|
+
onMenuToggle && /* @__PURE__ */ jsxs6(
|
|
850
|
+
"button",
|
|
851
|
+
{
|
|
852
|
+
onClick: onMenuToggle,
|
|
853
|
+
className: "rounded-md p-2 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground md:hidden",
|
|
854
|
+
children: [
|
|
855
|
+
/* @__PURE__ */ jsx19(Menu, { className: "h-5 w-5" }),
|
|
856
|
+
/* @__PURE__ */ jsx19("span", { className: "sr-only", children: "Toggle menu" })
|
|
857
|
+
]
|
|
858
|
+
}
|
|
859
|
+
),
|
|
860
|
+
storeName && /* @__PURE__ */ jsx19("div", { className: "font-semibold text-foreground", children: storeName }),
|
|
861
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex flex-1 items-center justify-end gap-4", children: [
|
|
862
|
+
actions,
|
|
863
|
+
user && /* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-3", children: [
|
|
864
|
+
/* @__PURE__ */ jsxs6("div", { className: "hidden text-right text-sm md:block", children: [
|
|
865
|
+
/* @__PURE__ */ jsx19("div", { className: "font-medium", children: user.name }),
|
|
866
|
+
/* @__PURE__ */ jsx19("div", { className: "text-muted-foreground text-xs", children: user.email })
|
|
867
|
+
] }),
|
|
868
|
+
/* @__PURE__ */ jsx19("div", { className: "flex h-8 w-8 items-center justify-center rounded-full bg-primary text-xs font-medium text-primary-foreground", children: user.avatar ? /* @__PURE__ */ jsx19(
|
|
869
|
+
"img",
|
|
870
|
+
{
|
|
871
|
+
src: user.avatar,
|
|
872
|
+
alt: user.name,
|
|
873
|
+
className: "h-full w-full rounded-full object-cover"
|
|
874
|
+
}
|
|
875
|
+
) : user.name.split(" ").map((n) => n[0]).join("").toUpperCase().slice(0, 2) })
|
|
876
|
+
] })
|
|
877
|
+
] })
|
|
878
|
+
]
|
|
879
|
+
}
|
|
880
|
+
);
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
// src/components/layout/page.tsx
|
|
884
|
+
import * as React16 from "react";
|
|
885
|
+
import { ChevronRight as ChevronRight2 } from "lucide-react";
|
|
886
|
+
import { jsx as jsx20, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
887
|
+
function Page({
|
|
888
|
+
title,
|
|
889
|
+
subtitle,
|
|
890
|
+
actions,
|
|
891
|
+
breadcrumbs,
|
|
892
|
+
children,
|
|
893
|
+
fullWidth
|
|
894
|
+
}) {
|
|
895
|
+
return /* @__PURE__ */ jsx20("div", { className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ jsxs7(
|
|
896
|
+
"div",
|
|
897
|
+
{
|
|
898
|
+
className: cn(
|
|
899
|
+
"mx-auto space-y-6 p-6",
|
|
900
|
+
!fullWidth && "max-w-6xl"
|
|
901
|
+
),
|
|
902
|
+
children: [
|
|
903
|
+
breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx20("nav", { className: "flex items-center space-x-1 text-sm text-muted-foreground", children: breadcrumbs.map((crumb, index) => /* @__PURE__ */ jsxs7(React16.Fragment, { children: [
|
|
904
|
+
index > 0 && /* @__PURE__ */ jsx20(ChevronRight2, { className: "h-4 w-4" }),
|
|
905
|
+
crumb.href ? /* @__PURE__ */ jsx20(
|
|
906
|
+
"a",
|
|
907
|
+
{
|
|
908
|
+
href: crumb.href,
|
|
909
|
+
className: "hover:text-foreground transition-colors",
|
|
910
|
+
children: crumb.label
|
|
911
|
+
}
|
|
912
|
+
) : /* @__PURE__ */ jsx20("span", { className: "text-foreground", children: crumb.label })
|
|
913
|
+
] }, index)) }),
|
|
914
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex items-center justify-between", children: [
|
|
915
|
+
/* @__PURE__ */ jsxs7("div", { children: [
|
|
916
|
+
/* @__PURE__ */ jsx20("h1", { className: "text-2xl font-bold tracking-tight", children: title }),
|
|
917
|
+
subtitle && /* @__PURE__ */ jsx20("p", { className: "text-muted-foreground mt-1", children: subtitle })
|
|
918
|
+
] }),
|
|
919
|
+
actions && /* @__PURE__ */ jsx20("div", { className: "flex items-center gap-2", children: actions })
|
|
920
|
+
] }),
|
|
921
|
+
children
|
|
922
|
+
]
|
|
923
|
+
}
|
|
924
|
+
) });
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
// src/components/layout/page-section.tsx
|
|
928
|
+
import { jsx as jsx21, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
929
|
+
function PageSection({
|
|
930
|
+
title,
|
|
931
|
+
description,
|
|
932
|
+
children,
|
|
933
|
+
actions,
|
|
934
|
+
className
|
|
935
|
+
}) {
|
|
936
|
+
return /* @__PURE__ */ jsxs8(
|
|
937
|
+
"div",
|
|
938
|
+
{
|
|
939
|
+
className: cn(
|
|
940
|
+
"rounded-lg border bg-card text-card-foreground shadow-sm",
|
|
941
|
+
className
|
|
942
|
+
),
|
|
943
|
+
children: [
|
|
944
|
+
(title || description || actions) && /* @__PURE__ */ jsxs8("div", { className: "flex items-start justify-between border-b p-6", children: [
|
|
945
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
946
|
+
title && /* @__PURE__ */ jsx21("h2", { className: "text-lg font-semibold", children: title }),
|
|
947
|
+
description && /* @__PURE__ */ jsx21("p", { className: "mt-1 text-sm text-muted-foreground", children: description })
|
|
948
|
+
] }),
|
|
949
|
+
actions && /* @__PURE__ */ jsx21("div", { className: "flex items-center gap-2", children: actions })
|
|
950
|
+
] }),
|
|
951
|
+
/* @__PURE__ */ jsx21("div", { className: "p-6", children })
|
|
952
|
+
]
|
|
953
|
+
}
|
|
954
|
+
);
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
// src/components/data/data-table.tsx
|
|
958
|
+
import { jsx as jsx22, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
959
|
+
function DataTable({
|
|
960
|
+
columns,
|
|
961
|
+
data,
|
|
962
|
+
loading,
|
|
963
|
+
pagination,
|
|
964
|
+
selection,
|
|
965
|
+
onRowClick,
|
|
966
|
+
emptyState,
|
|
967
|
+
actions
|
|
968
|
+
}) {
|
|
969
|
+
const idKey = selection?.idKey ?? "id";
|
|
970
|
+
const allSelected = selection && data.length > 0 && data.every((row) => selection.selected.includes(String(row[idKey])));
|
|
971
|
+
const someSelected = selection && data.some((row) => selection.selected.includes(String(row[idKey]))) && !allSelected;
|
|
972
|
+
function toggleAll() {
|
|
973
|
+
if (!selection) return;
|
|
974
|
+
if (allSelected) {
|
|
975
|
+
selection.onSelect([]);
|
|
976
|
+
} else {
|
|
977
|
+
selection.onSelect(data.map((row) => String(row[idKey])));
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
function toggleRow(row) {
|
|
981
|
+
if (!selection) return;
|
|
982
|
+
const id = String(row[idKey]);
|
|
983
|
+
if (selection.selected.includes(id)) {
|
|
984
|
+
selection.onSelect(selection.selected.filter((s) => s !== id));
|
|
985
|
+
} else {
|
|
986
|
+
selection.onSelect([...selection.selected, id]);
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
const totalPages = pagination ? Math.ceil(pagination.total / pagination.pageSize) : 1;
|
|
990
|
+
return /* @__PURE__ */ jsxs9("div", { className: "space-y-4", children: [
|
|
991
|
+
selection && selection.selected.length > 0 && actions && /* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-2 rounded-md border bg-muted/50 p-2", children: [
|
|
992
|
+
/* @__PURE__ */ jsxs9("span", { className: "text-sm text-muted-foreground", children: [
|
|
993
|
+
selection.selected.length,
|
|
994
|
+
" selected"
|
|
995
|
+
] }),
|
|
996
|
+
actions
|
|
997
|
+
] }),
|
|
998
|
+
/* @__PURE__ */ jsx22("div", { className: "rounded-md border", children: /* @__PURE__ */ jsx22("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs9("table", { className: "w-full text-sm", children: [
|
|
999
|
+
/* @__PURE__ */ jsx22("thead", { children: /* @__PURE__ */ jsxs9("tr", { className: "border-b bg-muted/50", children: [
|
|
1000
|
+
selection && /* @__PURE__ */ jsx22("th", { className: "w-12 px-4 py-3", children: /* @__PURE__ */ jsx22(
|
|
1001
|
+
Checkbox,
|
|
1002
|
+
{
|
|
1003
|
+
checked: allSelected,
|
|
1004
|
+
ref: (el) => {
|
|
1005
|
+
if (el) {
|
|
1006
|
+
el.indeterminate = someSelected ?? false;
|
|
1007
|
+
}
|
|
1008
|
+
},
|
|
1009
|
+
onCheckedChange: toggleAll
|
|
1010
|
+
}
|
|
1011
|
+
) }),
|
|
1012
|
+
columns.map((col) => /* @__PURE__ */ jsx22(
|
|
1013
|
+
"th",
|
|
1014
|
+
{
|
|
1015
|
+
className: "px-4 py-3 text-left font-medium text-muted-foreground",
|
|
1016
|
+
style: col.width ? { width: col.width } : void 0,
|
|
1017
|
+
children: col.header
|
|
1018
|
+
},
|
|
1019
|
+
String(col.key)
|
|
1020
|
+
))
|
|
1021
|
+
] }) }),
|
|
1022
|
+
/* @__PURE__ */ jsx22("tbody", { children: loading ? Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ jsxs9("tr", { className: "border-b", children: [
|
|
1023
|
+
selection && /* @__PURE__ */ jsx22("td", { className: "px-4 py-3", children: /* @__PURE__ */ jsx22(Skeleton, { className: "h-4 w-4" }) }),
|
|
1024
|
+
columns.map((col) => /* @__PURE__ */ jsx22("td", { className: "px-4 py-3", children: /* @__PURE__ */ jsx22(Skeleton, { className: "h-4 w-24" }) }, String(col.key)))
|
|
1025
|
+
] }, i)) : data.length === 0 ? /* @__PURE__ */ jsx22("tr", { children: /* @__PURE__ */ jsx22(
|
|
1026
|
+
"td",
|
|
1027
|
+
{
|
|
1028
|
+
colSpan: columns.length + (selection ? 1 : 0),
|
|
1029
|
+
className: "py-12 text-center",
|
|
1030
|
+
children: emptyState || /* @__PURE__ */ jsx22("p", { className: "text-muted-foreground", children: "No data found" })
|
|
1031
|
+
}
|
|
1032
|
+
) }) : data.map((row, idx) => {
|
|
1033
|
+
const rowId = String(row[idKey] ?? idx);
|
|
1034
|
+
const isSelected = selection?.selected.includes(rowId);
|
|
1035
|
+
return /* @__PURE__ */ jsxs9(
|
|
1036
|
+
"tr",
|
|
1037
|
+
{
|
|
1038
|
+
className: cn(
|
|
1039
|
+
"border-b transition-colors hover:bg-muted/50",
|
|
1040
|
+
isSelected && "bg-muted/50",
|
|
1041
|
+
onRowClick && "cursor-pointer"
|
|
1042
|
+
),
|
|
1043
|
+
onClick: () => onRowClick?.(row),
|
|
1044
|
+
children: [
|
|
1045
|
+
selection && /* @__PURE__ */ jsx22(
|
|
1046
|
+
"td",
|
|
1047
|
+
{
|
|
1048
|
+
className: "px-4 py-3",
|
|
1049
|
+
onClick: (e) => e.stopPropagation(),
|
|
1050
|
+
children: /* @__PURE__ */ jsx22(
|
|
1051
|
+
Checkbox,
|
|
1052
|
+
{
|
|
1053
|
+
checked: isSelected,
|
|
1054
|
+
onCheckedChange: () => toggleRow(row)
|
|
1055
|
+
}
|
|
1056
|
+
)
|
|
1057
|
+
}
|
|
1058
|
+
),
|
|
1059
|
+
columns.map((col) => /* @__PURE__ */ jsx22("td", { className: "px-4 py-3", children: col.cell ? col.cell(row) : String(row[col.key] ?? "") }, String(col.key)))
|
|
1060
|
+
]
|
|
1061
|
+
},
|
|
1062
|
+
rowId
|
|
1063
|
+
);
|
|
1064
|
+
}) })
|
|
1065
|
+
] }) }) }),
|
|
1066
|
+
pagination && totalPages > 1 && /* @__PURE__ */ jsxs9("div", { className: "flex items-center justify-between px-2", children: [
|
|
1067
|
+
/* @__PURE__ */ jsxs9("div", { className: "text-sm text-muted-foreground", children: [
|
|
1068
|
+
"Page ",
|
|
1069
|
+
pagination.page,
|
|
1070
|
+
" of ",
|
|
1071
|
+
totalPages,
|
|
1072
|
+
" (",
|
|
1073
|
+
pagination.total,
|
|
1074
|
+
" total)"
|
|
1075
|
+
] }),
|
|
1076
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-2", children: [
|
|
1077
|
+
/* @__PURE__ */ jsx22(
|
|
1078
|
+
"button",
|
|
1079
|
+
{
|
|
1080
|
+
className: "rounded-md border px-3 py-1.5 text-sm disabled:opacity-50",
|
|
1081
|
+
disabled: pagination.page <= 1,
|
|
1082
|
+
onClick: () => pagination.onPageChange(pagination.page - 1),
|
|
1083
|
+
children: "Previous"
|
|
1084
|
+
}
|
|
1085
|
+
),
|
|
1086
|
+
/* @__PURE__ */ jsx22(
|
|
1087
|
+
"button",
|
|
1088
|
+
{
|
|
1089
|
+
className: "rounded-md border px-3 py-1.5 text-sm disabled:opacity-50",
|
|
1090
|
+
disabled: pagination.page >= totalPages,
|
|
1091
|
+
onClick: () => pagination.onPageChange(pagination.page + 1),
|
|
1092
|
+
children: "Next"
|
|
1093
|
+
}
|
|
1094
|
+
)
|
|
1095
|
+
] })
|
|
1096
|
+
] })
|
|
1097
|
+
] });
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
// src/components/data/empty-state.tsx
|
|
1101
|
+
import { jsx as jsx23, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1102
|
+
function EmptyState({
|
|
1103
|
+
icon: Icon2,
|
|
1104
|
+
title,
|
|
1105
|
+
description,
|
|
1106
|
+
action,
|
|
1107
|
+
className
|
|
1108
|
+
}) {
|
|
1109
|
+
return /* @__PURE__ */ jsxs10(
|
|
1110
|
+
"div",
|
|
1111
|
+
{
|
|
1112
|
+
className: cn(
|
|
1113
|
+
"flex flex-col items-center justify-center py-12 text-center",
|
|
1114
|
+
className
|
|
1115
|
+
),
|
|
1116
|
+
children: [
|
|
1117
|
+
Icon2 && /* @__PURE__ */ jsx23("div", { className: "mb-4 rounded-full bg-muted p-3", children: /* @__PURE__ */ jsx23(Icon2, { className: "h-6 w-6 text-muted-foreground" }) }),
|
|
1118
|
+
/* @__PURE__ */ jsx23("h3", { className: "text-lg font-semibold", children: title }),
|
|
1119
|
+
description && /* @__PURE__ */ jsx23("p", { className: "mt-1 max-w-sm text-sm text-muted-foreground", children: description }),
|
|
1120
|
+
action && /* @__PURE__ */ jsx23("div", { className: "mt-4", children: action })
|
|
1121
|
+
]
|
|
1122
|
+
}
|
|
1123
|
+
);
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
// src/components/data/pagination.tsx
|
|
1127
|
+
import * as React17 from "react";
|
|
1128
|
+
import { ChevronLeft, ChevronRight as ChevronRight3 } from "lucide-react";
|
|
1129
|
+
import { jsx as jsx24, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1130
|
+
function Pagination({
|
|
1131
|
+
page,
|
|
1132
|
+
totalPages,
|
|
1133
|
+
onPageChange,
|
|
1134
|
+
className
|
|
1135
|
+
}) {
|
|
1136
|
+
const pages = React17.useMemo(() => {
|
|
1137
|
+
const items = [];
|
|
1138
|
+
if (totalPages <= 7) {
|
|
1139
|
+
for (let i = 1; i <= totalPages; i++) items.push(i);
|
|
1140
|
+
} else {
|
|
1141
|
+
items.push(1);
|
|
1142
|
+
if (page > 3) items.push("ellipsis");
|
|
1143
|
+
const start = Math.max(2, page - 1);
|
|
1144
|
+
const end = Math.min(totalPages - 1, page + 1);
|
|
1145
|
+
for (let i = start; i <= end; i++) items.push(i);
|
|
1146
|
+
if (page < totalPages - 2) items.push("ellipsis");
|
|
1147
|
+
items.push(totalPages);
|
|
1148
|
+
}
|
|
1149
|
+
return items;
|
|
1150
|
+
}, [page, totalPages]);
|
|
1151
|
+
if (totalPages <= 1) return null;
|
|
1152
|
+
return /* @__PURE__ */ jsxs11("nav", { className: cn("flex items-center gap-1", className), children: [
|
|
1153
|
+
/* @__PURE__ */ jsx24(
|
|
1154
|
+
"button",
|
|
1155
|
+
{
|
|
1156
|
+
className: "inline-flex h-9 w-9 items-center justify-center rounded-md border text-sm disabled:opacity-50",
|
|
1157
|
+
disabled: page <= 1,
|
|
1158
|
+
onClick: () => onPageChange(page - 1),
|
|
1159
|
+
children: /* @__PURE__ */ jsx24(ChevronLeft, { className: "h-4 w-4" })
|
|
1160
|
+
}
|
|
1161
|
+
),
|
|
1162
|
+
pages.map(
|
|
1163
|
+
(p, i) => p === "ellipsis" ? /* @__PURE__ */ jsx24("span", { className: "px-2 text-muted-foreground", children: "..." }, `e-${i}`) : /* @__PURE__ */ jsx24(
|
|
1164
|
+
"button",
|
|
1165
|
+
{
|
|
1166
|
+
className: cn(
|
|
1167
|
+
"inline-flex h-9 w-9 items-center justify-center rounded-md border text-sm",
|
|
1168
|
+
p === page && "bg-primary text-primary-foreground"
|
|
1169
|
+
),
|
|
1170
|
+
onClick: () => onPageChange(p),
|
|
1171
|
+
children: p
|
|
1172
|
+
},
|
|
1173
|
+
p
|
|
1174
|
+
)
|
|
1175
|
+
),
|
|
1176
|
+
/* @__PURE__ */ jsx24(
|
|
1177
|
+
"button",
|
|
1178
|
+
{
|
|
1179
|
+
className: "inline-flex h-9 w-9 items-center justify-center rounded-md border text-sm disabled:opacity-50",
|
|
1180
|
+
disabled: page >= totalPages,
|
|
1181
|
+
onClick: () => onPageChange(page + 1),
|
|
1182
|
+
children: /* @__PURE__ */ jsx24(ChevronRight3, { className: "h-4 w-4" })
|
|
1183
|
+
}
|
|
1184
|
+
)
|
|
1185
|
+
] });
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
// src/components/data/stats.tsx
|
|
1189
|
+
import { ArrowDown, ArrowUp } from "lucide-react";
|
|
1190
|
+
import { jsx as jsx25, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1191
|
+
function Stats({ stats, columns = 4, className }) {
|
|
1192
|
+
return /* @__PURE__ */ jsx25(
|
|
1193
|
+
"div",
|
|
1194
|
+
{
|
|
1195
|
+
className: cn(
|
|
1196
|
+
"grid gap-4",
|
|
1197
|
+
columns === 2 && "grid-cols-1 sm:grid-cols-2",
|
|
1198
|
+
columns === 3 && "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",
|
|
1199
|
+
columns === 4 && "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4",
|
|
1200
|
+
className
|
|
1201
|
+
),
|
|
1202
|
+
children: stats.map((stat, index) => {
|
|
1203
|
+
const Icon2 = stat.icon;
|
|
1204
|
+
return /* @__PURE__ */ jsxs12(
|
|
1205
|
+
"div",
|
|
1206
|
+
{
|
|
1207
|
+
className: "rounded-lg border bg-card p-6 text-card-foreground shadow-sm",
|
|
1208
|
+
children: [
|
|
1209
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex items-center justify-between", children: [
|
|
1210
|
+
/* @__PURE__ */ jsx25("p", { className: "text-sm font-medium text-muted-foreground", children: stat.label }),
|
|
1211
|
+
Icon2 && /* @__PURE__ */ jsx25(Icon2, { className: "h-4 w-4 text-muted-foreground" })
|
|
1212
|
+
] }),
|
|
1213
|
+
/* @__PURE__ */ jsxs12("div", { className: "mt-2 flex items-baseline gap-2", children: [
|
|
1214
|
+
/* @__PURE__ */ jsx25("p", { className: "text-2xl font-bold", children: stat.value }),
|
|
1215
|
+
stat.change && /* @__PURE__ */ jsxs12(
|
|
1216
|
+
"span",
|
|
1217
|
+
{
|
|
1218
|
+
className: cn(
|
|
1219
|
+
"inline-flex items-center text-xs font-medium",
|
|
1220
|
+
stat.change.type === "increase" ? "text-green-600 dark:text-green-400" : "text-red-600 dark:text-red-400"
|
|
1221
|
+
),
|
|
1222
|
+
children: [
|
|
1223
|
+
stat.change.type === "increase" ? /* @__PURE__ */ jsx25(ArrowUp, { className: "mr-0.5 h-3 w-3" }) : /* @__PURE__ */ jsx25(ArrowDown, { className: "mr-0.5 h-3 w-3" }),
|
|
1224
|
+
stat.change.value,
|
|
1225
|
+
"%"
|
|
1226
|
+
]
|
|
1227
|
+
}
|
|
1228
|
+
)
|
|
1229
|
+
] })
|
|
1230
|
+
]
|
|
1231
|
+
},
|
|
1232
|
+
index
|
|
1233
|
+
);
|
|
1234
|
+
})
|
|
1235
|
+
}
|
|
1236
|
+
);
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
// src/components/form/form-field.tsx
|
|
1240
|
+
import { jsx as jsx26, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1241
|
+
function FormField({
|
|
1242
|
+
label,
|
|
1243
|
+
error,
|
|
1244
|
+
hint,
|
|
1245
|
+
required,
|
|
1246
|
+
children,
|
|
1247
|
+
className
|
|
1248
|
+
}) {
|
|
1249
|
+
return /* @__PURE__ */ jsxs13("div", { className: cn("space-y-2", className), children: [
|
|
1250
|
+
/* @__PURE__ */ jsxs13(Label2, { children: [
|
|
1251
|
+
label,
|
|
1252
|
+
required && /* @__PURE__ */ jsx26("span", { className: "ml-1 text-destructive", children: "*" })
|
|
1253
|
+
] }),
|
|
1254
|
+
children,
|
|
1255
|
+
hint && !error && /* @__PURE__ */ jsx26("p", { className: "text-sm text-muted-foreground", children: hint }),
|
|
1256
|
+
error && /* @__PURE__ */ jsx26("p", { className: "text-sm text-destructive", children: error })
|
|
1257
|
+
] });
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
// src/components/form/form-layout.tsx
|
|
1261
|
+
import { jsx as jsx27, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1262
|
+
function FormLayout({
|
|
1263
|
+
title,
|
|
1264
|
+
description,
|
|
1265
|
+
children,
|
|
1266
|
+
actions,
|
|
1267
|
+
className
|
|
1268
|
+
}) {
|
|
1269
|
+
return /* @__PURE__ */ jsxs14(
|
|
1270
|
+
"div",
|
|
1271
|
+
{
|
|
1272
|
+
className: cn(
|
|
1273
|
+
"rounded-lg border bg-card text-card-foreground shadow-sm",
|
|
1274
|
+
className
|
|
1275
|
+
),
|
|
1276
|
+
children: [
|
|
1277
|
+
(title || description) && /* @__PURE__ */ jsxs14("div", { className: "border-b p-6", children: [
|
|
1278
|
+
title && /* @__PURE__ */ jsx27("h3", { className: "text-lg font-semibold", children: title }),
|
|
1279
|
+
description && /* @__PURE__ */ jsx27("p", { className: "mt-1 text-sm text-muted-foreground", children: description })
|
|
1280
|
+
] }),
|
|
1281
|
+
/* @__PURE__ */ jsx27("div", { className: "space-y-6 p-6", children }),
|
|
1282
|
+
actions && /* @__PURE__ */ jsx27("div", { className: "flex items-center justify-end gap-2 border-t px-6 py-4", children: actions })
|
|
1283
|
+
]
|
|
1284
|
+
}
|
|
1285
|
+
);
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
// src/components/form/form-section.tsx
|
|
1289
|
+
import { jsx as jsx28, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1290
|
+
function FormSection({
|
|
1291
|
+
title,
|
|
1292
|
+
description,
|
|
1293
|
+
children,
|
|
1294
|
+
className
|
|
1295
|
+
}) {
|
|
1296
|
+
return /* @__PURE__ */ jsxs15("div", { className: cn("space-y-4", className), children: [
|
|
1297
|
+
/* @__PURE__ */ jsxs15("div", { children: [
|
|
1298
|
+
/* @__PURE__ */ jsx28("h4", { className: "text-sm font-medium", children: title }),
|
|
1299
|
+
description && /* @__PURE__ */ jsx28("p", { className: "mt-1 text-sm text-muted-foreground", children: description })
|
|
1300
|
+
] }),
|
|
1301
|
+
/* @__PURE__ */ jsx28("div", { className: "space-y-4", children })
|
|
1302
|
+
] });
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
// src/components/feedback/alert.tsx
|
|
1306
|
+
import { AlertCircle, CheckCircle2, Info, AlertTriangle, X as X2 } from "lucide-react";
|
|
1307
|
+
import { jsx as jsx29, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1308
|
+
var variantConfig = {
|
|
1309
|
+
info: {
|
|
1310
|
+
icon: Info,
|
|
1311
|
+
classes: "border-blue-200 bg-blue-50 text-blue-900 dark:border-blue-800 dark:bg-blue-950 dark:text-blue-100"
|
|
1312
|
+
},
|
|
1313
|
+
success: {
|
|
1314
|
+
icon: CheckCircle2,
|
|
1315
|
+
classes: "border-green-200 bg-green-50 text-green-900 dark:border-green-800 dark:bg-green-950 dark:text-green-100"
|
|
1316
|
+
},
|
|
1317
|
+
warning: {
|
|
1318
|
+
icon: AlertTriangle,
|
|
1319
|
+
classes: "border-yellow-200 bg-yellow-50 text-yellow-900 dark:border-yellow-800 dark:bg-yellow-950 dark:text-yellow-100"
|
|
1320
|
+
},
|
|
1321
|
+
error: {
|
|
1322
|
+
icon: AlertCircle,
|
|
1323
|
+
classes: "border-red-200 bg-red-50 text-red-900 dark:border-red-800 dark:bg-red-950 dark:text-red-100"
|
|
1324
|
+
}
|
|
1325
|
+
};
|
|
1326
|
+
function Alert({
|
|
1327
|
+
variant = "info",
|
|
1328
|
+
title,
|
|
1329
|
+
children,
|
|
1330
|
+
dismissible,
|
|
1331
|
+
onDismiss,
|
|
1332
|
+
className
|
|
1333
|
+
}) {
|
|
1334
|
+
const config = variantConfig[variant];
|
|
1335
|
+
const Icon2 = config.icon;
|
|
1336
|
+
return /* @__PURE__ */ jsxs16(
|
|
1337
|
+
"div",
|
|
1338
|
+
{
|
|
1339
|
+
className: cn(
|
|
1340
|
+
"relative flex gap-3 rounded-lg border p-4",
|
|
1341
|
+
config.classes,
|
|
1342
|
+
className
|
|
1343
|
+
),
|
|
1344
|
+
role: "alert",
|
|
1345
|
+
children: [
|
|
1346
|
+
/* @__PURE__ */ jsx29(Icon2, { className: "mt-0.5 h-5 w-5 shrink-0" }),
|
|
1347
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex-1", children: [
|
|
1348
|
+
title && /* @__PURE__ */ jsx29("p", { className: "font-medium", children: title }),
|
|
1349
|
+
/* @__PURE__ */ jsx29("div", { className: cn("text-sm", title && "mt-1"), children })
|
|
1350
|
+
] }),
|
|
1351
|
+
dismissible && /* @__PURE__ */ jsx29(
|
|
1352
|
+
"button",
|
|
1353
|
+
{
|
|
1354
|
+
onClick: onDismiss,
|
|
1355
|
+
className: "absolute right-3 top-3 rounded-md p-1 opacity-70 hover:opacity-100",
|
|
1356
|
+
children: /* @__PURE__ */ jsx29(X2, { className: "h-4 w-4" })
|
|
1357
|
+
}
|
|
1358
|
+
)
|
|
1359
|
+
]
|
|
1360
|
+
}
|
|
1361
|
+
);
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
// src/components/feedback/loading-spinner.tsx
|
|
1365
|
+
import { Loader2 } from "lucide-react";
|
|
1366
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
1367
|
+
var sizeMap = {
|
|
1368
|
+
sm: "h-4 w-4",
|
|
1369
|
+
md: "h-6 w-6",
|
|
1370
|
+
lg: "h-8 w-8"
|
|
1371
|
+
};
|
|
1372
|
+
function LoadingSpinner({ size = "md", className }) {
|
|
1373
|
+
return /* @__PURE__ */ jsx30(
|
|
1374
|
+
Loader2,
|
|
1375
|
+
{
|
|
1376
|
+
className: cn("animate-spin text-muted-foreground", sizeMap[size], className)
|
|
1377
|
+
}
|
|
1378
|
+
);
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
// src/components/feedback/confirm-dialog.tsx
|
|
1382
|
+
import { jsx as jsx31, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1383
|
+
function ConfirmDialog({
|
|
1384
|
+
open,
|
|
1385
|
+
onOpenChange,
|
|
1386
|
+
title,
|
|
1387
|
+
description,
|
|
1388
|
+
confirmLabel = "Confirm",
|
|
1389
|
+
cancelLabel = "Cancel",
|
|
1390
|
+
onConfirm,
|
|
1391
|
+
loading,
|
|
1392
|
+
variant = "default"
|
|
1393
|
+
}) {
|
|
1394
|
+
return /* @__PURE__ */ jsx31(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs17(DialogContent, { children: [
|
|
1395
|
+
/* @__PURE__ */ jsxs17(DialogHeader, { children: [
|
|
1396
|
+
/* @__PURE__ */ jsx31(DialogTitle, { children: title }),
|
|
1397
|
+
description && /* @__PURE__ */ jsx31(DialogDescription, { children: description })
|
|
1398
|
+
] }),
|
|
1399
|
+
/* @__PURE__ */ jsxs17(DialogFooter, { children: [
|
|
1400
|
+
/* @__PURE__ */ jsx31(
|
|
1401
|
+
Button,
|
|
1402
|
+
{
|
|
1403
|
+
variant: "outline",
|
|
1404
|
+
onClick: () => onOpenChange(false),
|
|
1405
|
+
disabled: loading,
|
|
1406
|
+
children: cancelLabel
|
|
1407
|
+
}
|
|
1408
|
+
),
|
|
1409
|
+
/* @__PURE__ */ jsxs17(
|
|
1410
|
+
Button,
|
|
1411
|
+
{
|
|
1412
|
+
variant: variant === "destructive" ? "destructive" : "default",
|
|
1413
|
+
onClick: onConfirm,
|
|
1414
|
+
disabled: loading,
|
|
1415
|
+
children: [
|
|
1416
|
+
loading && /* @__PURE__ */ jsx31(LoadingSpinner, { size: "sm", className: "mr-2" }),
|
|
1417
|
+
confirmLabel
|
|
1418
|
+
]
|
|
1419
|
+
}
|
|
1420
|
+
)
|
|
1421
|
+
] })
|
|
1422
|
+
] }) });
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
// src/hooks/index.ts
|
|
1426
|
+
import { useState as useState2 } from "react";
|
|
1427
|
+
function useDisclosure(initial = false) {
|
|
1428
|
+
const [isOpen, setIsOpen] = useState2(initial);
|
|
1429
|
+
return {
|
|
1430
|
+
isOpen,
|
|
1431
|
+
open: () => setIsOpen(true),
|
|
1432
|
+
close: () => setIsOpen(false),
|
|
1433
|
+
toggle: () => setIsOpen((prev) => !prev),
|
|
1434
|
+
onOpenChange: setIsOpen
|
|
1435
|
+
};
|
|
1436
|
+
}
|
|
1437
|
+
function usePagination(total, pageSize = 20) {
|
|
1438
|
+
const [page, setPage] = useState2(1);
|
|
1439
|
+
const totalPages = Math.ceil(total / pageSize);
|
|
1440
|
+
return { page, setPage, pageSize, total, totalPages };
|
|
1441
|
+
}
|
|
1442
|
+
export {
|
|
1443
|
+
Alert,
|
|
1444
|
+
AppShell,
|
|
1445
|
+
Badge,
|
|
1446
|
+
Button,
|
|
1447
|
+
Card,
|
|
1448
|
+
CardContent,
|
|
1449
|
+
CardDescription,
|
|
1450
|
+
CardFooter,
|
|
1451
|
+
CardHeader,
|
|
1452
|
+
CardTitle,
|
|
1453
|
+
Checkbox,
|
|
1454
|
+
ConfirmDialog,
|
|
1455
|
+
DataTable,
|
|
1456
|
+
Dialog,
|
|
1457
|
+
DialogClose,
|
|
1458
|
+
DialogContent,
|
|
1459
|
+
DialogDescription,
|
|
1460
|
+
DialogFooter,
|
|
1461
|
+
DialogHeader,
|
|
1462
|
+
DialogOverlay,
|
|
1463
|
+
DialogPortal,
|
|
1464
|
+
DialogTitle,
|
|
1465
|
+
DialogTrigger,
|
|
1466
|
+
DropdownMenu,
|
|
1467
|
+
DropdownMenuCheckboxItem,
|
|
1468
|
+
DropdownMenuContent,
|
|
1469
|
+
DropdownMenuGroup,
|
|
1470
|
+
DropdownMenuItem,
|
|
1471
|
+
DropdownMenuLabel,
|
|
1472
|
+
DropdownMenuPortal,
|
|
1473
|
+
DropdownMenuRadioGroup,
|
|
1474
|
+
DropdownMenuRadioItem,
|
|
1475
|
+
DropdownMenuSeparator,
|
|
1476
|
+
DropdownMenuShortcut,
|
|
1477
|
+
DropdownMenuSub,
|
|
1478
|
+
DropdownMenuSubContent,
|
|
1479
|
+
DropdownMenuSubTrigger,
|
|
1480
|
+
DropdownMenuTrigger,
|
|
1481
|
+
EmptyState,
|
|
1482
|
+
FormField,
|
|
1483
|
+
FormLayout,
|
|
1484
|
+
FormSection,
|
|
1485
|
+
Input,
|
|
1486
|
+
Label2 as Label,
|
|
1487
|
+
LoadingSpinner,
|
|
1488
|
+
Page,
|
|
1489
|
+
PageSection,
|
|
1490
|
+
Pagination,
|
|
1491
|
+
Popover,
|
|
1492
|
+
PopoverContent,
|
|
1493
|
+
PopoverTrigger,
|
|
1494
|
+
Select,
|
|
1495
|
+
SelectContent,
|
|
1496
|
+
SelectGroup,
|
|
1497
|
+
SelectItem,
|
|
1498
|
+
SelectLabel,
|
|
1499
|
+
SelectScrollDownButton,
|
|
1500
|
+
SelectScrollUpButton,
|
|
1501
|
+
SelectSeparator,
|
|
1502
|
+
SelectTrigger,
|
|
1503
|
+
SelectValue,
|
|
1504
|
+
Separator3 as Separator,
|
|
1505
|
+
Sidebar,
|
|
1506
|
+
Skeleton,
|
|
1507
|
+
Stats,
|
|
1508
|
+
Switch,
|
|
1509
|
+
Tabs,
|
|
1510
|
+
TabsContent,
|
|
1511
|
+
TabsList,
|
|
1512
|
+
TabsTrigger,
|
|
1513
|
+
Textarea,
|
|
1514
|
+
Tooltip,
|
|
1515
|
+
TooltipContent,
|
|
1516
|
+
TooltipProvider,
|
|
1517
|
+
TooltipTrigger,
|
|
1518
|
+
TopBar,
|
|
1519
|
+
badgeVariants,
|
|
1520
|
+
buttonVariants,
|
|
1521
|
+
cn,
|
|
1522
|
+
useDisclosure,
|
|
1523
|
+
usePagination
|
|
1524
|
+
};
|
|
1525
|
+
//# sourceMappingURL=index.mjs.map
|