@lessly/ui 0.2.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 +80 -0
- package/dist/index.d.ts +791 -0
- package/dist/index.js +3189 -0
- package/dist/styles.css +507 -0
- package/dist/tailwind-preset.d.ts +394 -0
- package/dist/tailwind-preset.js +430 -0
- package/package.json +116 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,3189 @@
|
|
|
1
|
+
// src/lib/utils.ts
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { twMerge } from "tailwind-merge";
|
|
4
|
+
function cn(...inputs) {
|
|
5
|
+
return twMerge(clsx(inputs));
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
// src/components/button.tsx
|
|
9
|
+
import * as React from "react";
|
|
10
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
11
|
+
import { cva } from "class-variance-authority";
|
|
12
|
+
import { jsx } from "react/jsx-runtime";
|
|
13
|
+
var buttonVariants = cva(
|
|
14
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus disabled:pointer-events-none disabled:opacity-50",
|
|
15
|
+
{
|
|
16
|
+
variants: {
|
|
17
|
+
variant: {
|
|
18
|
+
default: "bg-blue-400 text-text-on-brand hover:bg-blue-350",
|
|
19
|
+
destructive: "bg-bg-danger text-text-on-danger hover:bg-bg-danger/90",
|
|
20
|
+
outline: "border border-border-default bg-transparent text-text-primary hover:bg-bg-secondary",
|
|
21
|
+
secondary: "bg-bg-secondary text-text-primary hover:bg-bg-secondary/80",
|
|
22
|
+
ghost: "hover:bg-bg-secondary text-text-primary",
|
|
23
|
+
link: "text-text-link underline-offset-4 hover:underline hover:text-text-link-hover"
|
|
24
|
+
},
|
|
25
|
+
size: {
|
|
26
|
+
default: "h-10 px-4 py-2",
|
|
27
|
+
sm: "h-9 rounded-md px-3",
|
|
28
|
+
lg: "h-11 rounded-md px-8",
|
|
29
|
+
icon: "h-10 w-10"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
defaultVariants: {
|
|
33
|
+
variant: "default",
|
|
34
|
+
size: "default"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
var Button = React.forwardRef(
|
|
39
|
+
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
40
|
+
const Comp = asChild ? Slot : "button";
|
|
41
|
+
return /* @__PURE__ */ jsx(Comp, { className: cn(buttonVariants({ variant, size, className })), ref, ...props });
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
Button.displayName = "Button";
|
|
45
|
+
|
|
46
|
+
// src/components/card.tsx
|
|
47
|
+
import * as React2 from "react";
|
|
48
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
49
|
+
var Card = React2.forwardRef(
|
|
50
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx2(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
ref,
|
|
54
|
+
className: cn(
|
|
55
|
+
"rounded-xl border border-border-subtle bg-bg-surface text-text-primary shadow-sm",
|
|
56
|
+
className
|
|
57
|
+
),
|
|
58
|
+
...props
|
|
59
|
+
}
|
|
60
|
+
)
|
|
61
|
+
);
|
|
62
|
+
Card.displayName = "Card";
|
|
63
|
+
var CardHeader = React2.forwardRef(
|
|
64
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx2("div", { ref, className: cn("flex flex-col space-y-1.5 p-6", className), ...props })
|
|
65
|
+
);
|
|
66
|
+
CardHeader.displayName = "CardHeader";
|
|
67
|
+
var CardTitle = React2.forwardRef(
|
|
68
|
+
({ className, ...props }, ref) => {
|
|
69
|
+
return (
|
|
70
|
+
// eslint-disable-next-line jsx-a11y/heading-has-content -- content passed via {...props} spread
|
|
71
|
+
/* @__PURE__ */ jsx2(
|
|
72
|
+
"h3",
|
|
73
|
+
{
|
|
74
|
+
ref,
|
|
75
|
+
className: cn("text-2xl font-semibold leading-none tracking-tight", className),
|
|
76
|
+
...props
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
CardTitle.displayName = "CardTitle";
|
|
83
|
+
var CardDescription = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2("p", { ref, className: cn("text-sm text-text-secondary", className), ...props }));
|
|
84
|
+
CardDescription.displayName = "CardDescription";
|
|
85
|
+
var CardContent = React2.forwardRef(
|
|
86
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx2("div", { ref, className: cn("p-6 pt-0", className), ...props })
|
|
87
|
+
);
|
|
88
|
+
CardContent.displayName = "CardContent";
|
|
89
|
+
var CardFooter = React2.forwardRef(
|
|
90
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx2("div", { ref, className: cn("flex items-center p-6 pt-0", className), ...props })
|
|
91
|
+
);
|
|
92
|
+
CardFooter.displayName = "CardFooter";
|
|
93
|
+
|
|
94
|
+
// src/components/dialog.tsx
|
|
95
|
+
import * as React3 from "react";
|
|
96
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
97
|
+
import { X } from "lucide-react";
|
|
98
|
+
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
99
|
+
var Dialog = DialogPrimitive.Root;
|
|
100
|
+
var DialogTrigger = DialogPrimitive.Trigger;
|
|
101
|
+
var DialogPortal = DialogPrimitive.Portal;
|
|
102
|
+
var DialogClose = DialogPrimitive.Close;
|
|
103
|
+
var DialogOverlay = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
|
|
104
|
+
DialogPrimitive.Overlay,
|
|
105
|
+
{
|
|
106
|
+
ref,
|
|
107
|
+
className: cn(
|
|
108
|
+
"fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
109
|
+
className
|
|
110
|
+
),
|
|
111
|
+
...props
|
|
112
|
+
}
|
|
113
|
+
));
|
|
114
|
+
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
115
|
+
var DialogContent = React3.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
116
|
+
/* @__PURE__ */ jsx3(DialogOverlay, {}),
|
|
117
|
+
/* @__PURE__ */ jsxs(
|
|
118
|
+
DialogPrimitive.Content,
|
|
119
|
+
{
|
|
120
|
+
ref,
|
|
121
|
+
className: cn(
|
|
122
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-border-subtle bg-bg-elevated 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 sm:rounded-lg",
|
|
123
|
+
className
|
|
124
|
+
),
|
|
125
|
+
...props,
|
|
126
|
+
children: [
|
|
127
|
+
children,
|
|
128
|
+
/* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm text-text-tertiary opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-border-focus disabled:pointer-events-none", children: [
|
|
129
|
+
/* @__PURE__ */ jsx3(X, { className: "h-4 w-4" }),
|
|
130
|
+
/* @__PURE__ */ jsx3("span", { className: "sr-only", children: "Close" })
|
|
131
|
+
] })
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
] }));
|
|
136
|
+
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
137
|
+
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsx3(
|
|
138
|
+
"div",
|
|
139
|
+
{
|
|
140
|
+
className: cn("flex flex-col gap-1.5 text-left", className),
|
|
141
|
+
...props
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
DialogHeader.displayName = "DialogHeader";
|
|
145
|
+
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsx3(
|
|
146
|
+
"div",
|
|
147
|
+
{
|
|
148
|
+
className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className),
|
|
149
|
+
...props
|
|
150
|
+
}
|
|
151
|
+
);
|
|
152
|
+
DialogFooter.displayName = "DialogFooter";
|
|
153
|
+
var DialogTitle = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
|
|
154
|
+
DialogPrimitive.Title,
|
|
155
|
+
{
|
|
156
|
+
ref,
|
|
157
|
+
className: cn("text-lg font-semibold text-text-primary", className),
|
|
158
|
+
...props
|
|
159
|
+
}
|
|
160
|
+
));
|
|
161
|
+
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
162
|
+
var DialogDescription = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
|
|
163
|
+
DialogPrimitive.Description,
|
|
164
|
+
{
|
|
165
|
+
ref,
|
|
166
|
+
className: cn("text-sm text-text-secondary", className),
|
|
167
|
+
...props
|
|
168
|
+
}
|
|
169
|
+
));
|
|
170
|
+
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
171
|
+
|
|
172
|
+
// src/components/dropdown-menu.tsx
|
|
173
|
+
import * as React4 from "react";
|
|
174
|
+
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
175
|
+
import { Check, ChevronRight, Circle } from "lucide-react";
|
|
176
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
177
|
+
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
178
|
+
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
179
|
+
var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
180
|
+
var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
181
|
+
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
182
|
+
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
183
|
+
var DropdownMenuSubTrigger = React4.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs2(
|
|
184
|
+
DropdownMenuPrimitive.SubTrigger,
|
|
185
|
+
{
|
|
186
|
+
ref,
|
|
187
|
+
className: cn(
|
|
188
|
+
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-bg-secondary data-[state=open]:bg-bg-secondary",
|
|
189
|
+
inset && "pl-8",
|
|
190
|
+
className
|
|
191
|
+
),
|
|
192
|
+
...props,
|
|
193
|
+
children: [
|
|
194
|
+
children,
|
|
195
|
+
/* @__PURE__ */ jsx4(ChevronRight, { className: "ml-auto h-4 w-4" })
|
|
196
|
+
]
|
|
197
|
+
}
|
|
198
|
+
));
|
|
199
|
+
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
200
|
+
var DropdownMenuSubContent = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx4(
|
|
201
|
+
DropdownMenuPrimitive.SubContent,
|
|
202
|
+
{
|
|
203
|
+
ref,
|
|
204
|
+
className: cn(
|
|
205
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border border-border-subtle bg-bg-elevated p-1 text-text-primary 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",
|
|
206
|
+
className
|
|
207
|
+
),
|
|
208
|
+
...props
|
|
209
|
+
}
|
|
210
|
+
));
|
|
211
|
+
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
212
|
+
var DropdownMenuContent = React4.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx4(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx4(
|
|
213
|
+
DropdownMenuPrimitive.Content,
|
|
214
|
+
{
|
|
215
|
+
ref,
|
|
216
|
+
sideOffset,
|
|
217
|
+
className: cn(
|
|
218
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border border-border-subtle bg-bg-elevated p-1 text-text-primary 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",
|
|
219
|
+
className
|
|
220
|
+
),
|
|
221
|
+
...props
|
|
222
|
+
}
|
|
223
|
+
) }));
|
|
224
|
+
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
225
|
+
var DropdownMenuItem = React4.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx4(
|
|
226
|
+
DropdownMenuPrimitive.Item,
|
|
227
|
+
{
|
|
228
|
+
ref,
|
|
229
|
+
className: cn(
|
|
230
|
+
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-bg-secondary focus:text-text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
231
|
+
inset && "pl-8",
|
|
232
|
+
className
|
|
233
|
+
),
|
|
234
|
+
...props
|
|
235
|
+
}
|
|
236
|
+
));
|
|
237
|
+
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
238
|
+
var DropdownMenuCheckboxItem = React4.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs2(
|
|
239
|
+
DropdownMenuPrimitive.CheckboxItem,
|
|
240
|
+
{
|
|
241
|
+
ref,
|
|
242
|
+
className: cn(
|
|
243
|
+
"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-bg-secondary focus:text-text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
244
|
+
className
|
|
245
|
+
),
|
|
246
|
+
checked,
|
|
247
|
+
...props,
|
|
248
|
+
children: [
|
|
249
|
+
/* @__PURE__ */ jsx4("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx4(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx4(Check, { className: "h-4 w-4" }) }) }),
|
|
250
|
+
children
|
|
251
|
+
]
|
|
252
|
+
}
|
|
253
|
+
));
|
|
254
|
+
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
255
|
+
var DropdownMenuRadioItem = React4.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs2(
|
|
256
|
+
DropdownMenuPrimitive.RadioItem,
|
|
257
|
+
{
|
|
258
|
+
ref,
|
|
259
|
+
className: cn(
|
|
260
|
+
"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-bg-secondary focus:text-text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
261
|
+
className
|
|
262
|
+
),
|
|
263
|
+
...props,
|
|
264
|
+
children: [
|
|
265
|
+
/* @__PURE__ */ jsx4("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx4(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx4(Circle, { className: "h-2 w-2 fill-current" }) }) }),
|
|
266
|
+
children
|
|
267
|
+
]
|
|
268
|
+
}
|
|
269
|
+
));
|
|
270
|
+
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
271
|
+
var DropdownMenuLabel = React4.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx4(
|
|
272
|
+
DropdownMenuPrimitive.Label,
|
|
273
|
+
{
|
|
274
|
+
ref,
|
|
275
|
+
className: cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className),
|
|
276
|
+
...props
|
|
277
|
+
}
|
|
278
|
+
));
|
|
279
|
+
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
280
|
+
var DropdownMenuSeparator = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx4(
|
|
281
|
+
DropdownMenuPrimitive.Separator,
|
|
282
|
+
{
|
|
283
|
+
ref,
|
|
284
|
+
className: cn("-mx-1 my-1 h-px bg-bg-secondary", className),
|
|
285
|
+
...props
|
|
286
|
+
}
|
|
287
|
+
));
|
|
288
|
+
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
289
|
+
var DropdownMenuShortcut = ({ className, ...props }) => {
|
|
290
|
+
return /* @__PURE__ */ jsx4("span", { className: cn("ml-auto text-xs tracking-widest opacity-60", className), ...props });
|
|
291
|
+
};
|
|
292
|
+
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
293
|
+
|
|
294
|
+
// src/components/input.tsx
|
|
295
|
+
import * as React5 from "react";
|
|
296
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
297
|
+
var Input = React5.forwardRef(
|
|
298
|
+
({ className, type, ...props }, ref) => {
|
|
299
|
+
return /* @__PURE__ */ jsx5(
|
|
300
|
+
"input",
|
|
301
|
+
{
|
|
302
|
+
type,
|
|
303
|
+
className: cn(
|
|
304
|
+
"flex h-10 w-full rounded-md border border-border-default bg-bg-primary text-text-primary px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-text-tertiary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus disabled:cursor-not-allowed disabled:opacity-50",
|
|
305
|
+
className
|
|
306
|
+
),
|
|
307
|
+
ref,
|
|
308
|
+
...props
|
|
309
|
+
}
|
|
310
|
+
);
|
|
311
|
+
}
|
|
312
|
+
);
|
|
313
|
+
Input.displayName = "Input";
|
|
314
|
+
|
|
315
|
+
// src/components/label.tsx
|
|
316
|
+
import * as React6 from "react";
|
|
317
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
318
|
+
import { cva as cva2 } from "class-variance-authority";
|
|
319
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
320
|
+
var labelVariants = cva2(
|
|
321
|
+
"text-text-primary text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
322
|
+
);
|
|
323
|
+
var Label2 = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx6(LabelPrimitive.Root, { ref, className: cn(labelVariants(), className), ...props }));
|
|
324
|
+
Label2.displayName = LabelPrimitive.Root.displayName;
|
|
325
|
+
|
|
326
|
+
// src/components/section-intro.tsx
|
|
327
|
+
import { Info } from "lucide-react";
|
|
328
|
+
import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
329
|
+
function SectionIntro({ what, when }) {
|
|
330
|
+
return /* @__PURE__ */ jsxs3("div", { className: "bg-bg-brand-subtle rounded-xl px-5 py-4 flex items-start gap-3 mb-5", children: [
|
|
331
|
+
/* @__PURE__ */ jsx7(Info, { className: "w-4 h-4 text-text-brand mt-0.5 flex-shrink-0", "aria-hidden": "true" }),
|
|
332
|
+
/* @__PURE__ */ jsxs3("div", { children: [
|
|
333
|
+
/* @__PURE__ */ jsx7("p", { className: "text-[0.8125rem] text-text-primary leading-relaxed", children: what }),
|
|
334
|
+
/* @__PURE__ */ jsx7("p", { className: "text-[0.8125rem] text-text-secondary leading-relaxed mt-1", children: when })
|
|
335
|
+
] })
|
|
336
|
+
] });
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
// src/components/select.tsx
|
|
340
|
+
import { ChevronDown } from "lucide-react";
|
|
341
|
+
import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
342
|
+
function Select({
|
|
343
|
+
value,
|
|
344
|
+
onValueChange,
|
|
345
|
+
options,
|
|
346
|
+
placeholder = "Select\u2026",
|
|
347
|
+
disabled,
|
|
348
|
+
className,
|
|
349
|
+
"data-testid": testId,
|
|
350
|
+
optionTestId
|
|
351
|
+
}) {
|
|
352
|
+
const selected = options.find((o) => o.value === value);
|
|
353
|
+
return /* @__PURE__ */ jsxs4(DropdownMenu, { children: [
|
|
354
|
+
/* @__PURE__ */ jsxs4(
|
|
355
|
+
DropdownMenuTrigger,
|
|
356
|
+
{
|
|
357
|
+
type: "button",
|
|
358
|
+
"data-testid": testId,
|
|
359
|
+
disabled,
|
|
360
|
+
className: cn(
|
|
361
|
+
"flex h-10 w-full items-center justify-between rounded-md border border-border-default bg-bg-primary px-3 text-sm text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus disabled:cursor-not-allowed disabled:opacity-50",
|
|
362
|
+
className
|
|
363
|
+
),
|
|
364
|
+
children: [
|
|
365
|
+
/* @__PURE__ */ jsx8("span", { className: cn("truncate", !selected && "text-text-tertiary"), children: selected ? selected.label : placeholder }),
|
|
366
|
+
/* @__PURE__ */ jsx8(ChevronDown, { className: "ml-2 h-4 w-4 shrink-0 text-text-tertiary" })
|
|
367
|
+
]
|
|
368
|
+
}
|
|
369
|
+
),
|
|
370
|
+
/* @__PURE__ */ jsx8(
|
|
371
|
+
DropdownMenuContent,
|
|
372
|
+
{
|
|
373
|
+
align: "start",
|
|
374
|
+
className: "max-h-64 w-[var(--radix-dropdown-menu-trigger-width)] overflow-y-auto",
|
|
375
|
+
children: /* @__PURE__ */ jsx8(DropdownMenuRadioGroup, { value: value ?? "", onValueChange, children: options.map((o) => /* @__PURE__ */ jsx8(DropdownMenuRadioItem, { value: o.value, "data-testid": optionTestId?.(o.value), children: o.label }, o.value)) })
|
|
376
|
+
}
|
|
377
|
+
)
|
|
378
|
+
] });
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
// src/components/switch.tsx
|
|
382
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
383
|
+
function Switch({
|
|
384
|
+
checked,
|
|
385
|
+
onCheckedChange,
|
|
386
|
+
disabled = false,
|
|
387
|
+
id,
|
|
388
|
+
className = "",
|
|
389
|
+
"aria-label": ariaLabel,
|
|
390
|
+
"data-testid": testId
|
|
391
|
+
}) {
|
|
392
|
+
return /* @__PURE__ */ jsx9(
|
|
393
|
+
"button",
|
|
394
|
+
{
|
|
395
|
+
type: "button",
|
|
396
|
+
role: "switch",
|
|
397
|
+
id,
|
|
398
|
+
"aria-checked": checked,
|
|
399
|
+
"aria-label": ariaLabel,
|
|
400
|
+
"data-testid": testId,
|
|
401
|
+
disabled,
|
|
402
|
+
onClick: () => onCheckedChange(!checked),
|
|
403
|
+
className: `relative inline-flex h-6 w-10 shrink-0 cursor-pointer rounded-full transition-colors outline-none focus-visible:ring-2 focus-visible:ring-border-focus focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface ${checked ? "bg-bg-brand-bright" : "bg-border-default"} ${disabled ? "cursor-not-allowed opacity-50" : ""} ${className}`,
|
|
404
|
+
children: /* @__PURE__ */ jsx9(
|
|
405
|
+
"span",
|
|
406
|
+
{
|
|
407
|
+
"aria-hidden": "true",
|
|
408
|
+
className: `pointer-events-none absolute top-1/2 left-0 h-4 w-4 -translate-y-1/2 rounded-full bg-white shadow transition-transform ${checked ? "translate-x-5" : "translate-x-1"}`
|
|
409
|
+
}
|
|
410
|
+
)
|
|
411
|
+
}
|
|
412
|
+
);
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
// src/components/checkbox.tsx
|
|
416
|
+
import * as React7 from "react";
|
|
417
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
418
|
+
import { Check as Check2 } from "lucide-react";
|
|
419
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
420
|
+
var Checkbox = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
421
|
+
CheckboxPrimitive.Root,
|
|
422
|
+
{
|
|
423
|
+
ref,
|
|
424
|
+
className: cn(
|
|
425
|
+
"peer size-4 shrink-0 rounded-sm border border-border-default focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-blue-400 data-[state=checked]:text-text-on-brand data-[state=checked]:border-blue-400",
|
|
426
|
+
className
|
|
427
|
+
),
|
|
428
|
+
...props,
|
|
429
|
+
children: /* @__PURE__ */ jsx10(CheckboxPrimitive.Indicator, { className: "flex items-center justify-center text-current", children: /* @__PURE__ */ jsx10(Check2, { className: "h-4 w-4" }) })
|
|
430
|
+
}
|
|
431
|
+
));
|
|
432
|
+
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
433
|
+
|
|
434
|
+
// src/components/radio-group.tsx
|
|
435
|
+
import * as React8 from "react";
|
|
436
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
437
|
+
import { Circle as Circle2 } from "lucide-react";
|
|
438
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
439
|
+
var RadioGroup2 = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(RadioGroupPrimitive.Root, { ref, className: cn("grid gap-2", className), ...props }));
|
|
440
|
+
RadioGroup2.displayName = RadioGroupPrimitive.Root.displayName;
|
|
441
|
+
var RadioGroupItem = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(
|
|
442
|
+
RadioGroupPrimitive.Item,
|
|
443
|
+
{
|
|
444
|
+
ref,
|
|
445
|
+
className: cn(
|
|
446
|
+
"aspect-square size-4 rounded-full border border-border-default text-blue-400 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-blue-400",
|
|
447
|
+
className
|
|
448
|
+
),
|
|
449
|
+
...props,
|
|
450
|
+
children: /* @__PURE__ */ jsx11(RadioGroupPrimitive.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx11(Circle2, { className: "h-2.5 w-2.5 fill-blue-400 text-blue-400" }) })
|
|
451
|
+
}
|
|
452
|
+
));
|
|
453
|
+
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
|
|
454
|
+
|
|
455
|
+
// src/components/textarea.tsx
|
|
456
|
+
import * as React9 from "react";
|
|
457
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
458
|
+
var Textarea = React9.forwardRef(
|
|
459
|
+
({ className, ...props }, ref) => {
|
|
460
|
+
return /* @__PURE__ */ jsx12(
|
|
461
|
+
"textarea",
|
|
462
|
+
{
|
|
463
|
+
ref,
|
|
464
|
+
className: cn(
|
|
465
|
+
"flex min-h-20 w-full rounded-md border border-border-default bg-bg-primary px-3 py-2 text-sm text-text-primary placeholder:text-text-tertiary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus disabled:cursor-not-allowed disabled:opacity-50",
|
|
466
|
+
className
|
|
467
|
+
),
|
|
468
|
+
...props
|
|
469
|
+
}
|
|
470
|
+
);
|
|
471
|
+
}
|
|
472
|
+
);
|
|
473
|
+
Textarea.displayName = "Textarea";
|
|
474
|
+
|
|
475
|
+
// src/components/slider.tsx
|
|
476
|
+
import * as React10 from "react";
|
|
477
|
+
import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
478
|
+
import { jsx as jsx13, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
479
|
+
var Slider = React10.forwardRef(({ className, ...props }, ref) => {
|
|
480
|
+
const thumbCount = (Array.isArray(props.value) ? props.value.length : void 0) ?? (Array.isArray(props.defaultValue) ? props.defaultValue.length : void 0) ?? 1;
|
|
481
|
+
return /* @__PURE__ */ jsxs5(
|
|
482
|
+
SliderPrimitive.Root,
|
|
483
|
+
{
|
|
484
|
+
ref,
|
|
485
|
+
className: cn("relative flex w-full touch-none select-none items-center", className),
|
|
486
|
+
...props,
|
|
487
|
+
children: [
|
|
488
|
+
/* @__PURE__ */ jsx13(SliderPrimitive.Track, { className: "relative h-1.5 w-full grow overflow-hidden rounded-full bg-bg-secondary", children: /* @__PURE__ */ jsx13(SliderPrimitive.Range, { className: "absolute h-full bg-blue-400" }) }),
|
|
489
|
+
Array.from({ length: thumbCount }).map((_, i) => /* @__PURE__ */ jsx13(
|
|
490
|
+
SliderPrimitive.Thumb,
|
|
491
|
+
{
|
|
492
|
+
className: "block size-5 rounded-full border border-border-brand bg-bg-elevated shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus data-[disabled]:pointer-events-none data-[disabled]:opacity-50"
|
|
493
|
+
},
|
|
494
|
+
i
|
|
495
|
+
))
|
|
496
|
+
]
|
|
497
|
+
}
|
|
498
|
+
);
|
|
499
|
+
});
|
|
500
|
+
Slider.displayName = SliderPrimitive.Root.displayName;
|
|
501
|
+
|
|
502
|
+
// src/components/toggle.tsx
|
|
503
|
+
import * as React11 from "react";
|
|
504
|
+
import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
505
|
+
import { cva as cva3 } from "class-variance-authority";
|
|
506
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
507
|
+
var toggleVariants = cva3(
|
|
508
|
+
"inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors hover:bg-bg-secondary hover:text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-bg-secondary data-[state=on]:text-text-primary [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
509
|
+
{
|
|
510
|
+
variants: {
|
|
511
|
+
variant: {
|
|
512
|
+
default: "bg-transparent",
|
|
513
|
+
outline: "border border-border-default bg-transparent"
|
|
514
|
+
},
|
|
515
|
+
size: {
|
|
516
|
+
default: "h-10 min-w-10 px-3",
|
|
517
|
+
sm: "h-9 min-w-9 px-2.5",
|
|
518
|
+
lg: "h-12 min-w-12 px-5"
|
|
519
|
+
}
|
|
520
|
+
},
|
|
521
|
+
defaultVariants: { variant: "default", size: "default" }
|
|
522
|
+
}
|
|
523
|
+
);
|
|
524
|
+
var Toggle = React11.forwardRef(({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsx14(TogglePrimitive.Root, { ref, className: cn(toggleVariants({ variant, size, className })), ...props }));
|
|
525
|
+
Toggle.displayName = TogglePrimitive.Root.displayName;
|
|
526
|
+
|
|
527
|
+
// src/components/toggle-group.tsx
|
|
528
|
+
import * as React12 from "react";
|
|
529
|
+
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
530
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
531
|
+
var ToggleGroupContext = React12.createContext({
|
|
532
|
+
size: "default",
|
|
533
|
+
variant: "default"
|
|
534
|
+
});
|
|
535
|
+
var ToggleGroup = React12.forwardRef(({ className, variant, size, children, ...props }, ref) => /* @__PURE__ */ jsx15(
|
|
536
|
+
ToggleGroupPrimitive.Root,
|
|
537
|
+
{
|
|
538
|
+
ref,
|
|
539
|
+
className: cn("flex items-center justify-center gap-1", className),
|
|
540
|
+
...props,
|
|
541
|
+
children: /* @__PURE__ */ jsx15(ToggleGroupContext.Provider, { value: { variant, size }, children })
|
|
542
|
+
}
|
|
543
|
+
));
|
|
544
|
+
ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;
|
|
545
|
+
var ToggleGroupItem = React12.forwardRef(({ className, children, variant, size, ...props }, ref) => {
|
|
546
|
+
const context = React12.useContext(ToggleGroupContext);
|
|
547
|
+
return /* @__PURE__ */ jsx15(
|
|
548
|
+
ToggleGroupPrimitive.Item,
|
|
549
|
+
{
|
|
550
|
+
ref,
|
|
551
|
+
className: cn(toggleVariants({ variant: context.variant || variant, size: context.size || size }), className),
|
|
552
|
+
...props,
|
|
553
|
+
children
|
|
554
|
+
}
|
|
555
|
+
);
|
|
556
|
+
});
|
|
557
|
+
ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
|
|
558
|
+
|
|
559
|
+
// src/components/input-otp.tsx
|
|
560
|
+
import * as React13 from "react";
|
|
561
|
+
import { OTPInput, OTPInputContext } from "input-otp";
|
|
562
|
+
import { Minus } from "lucide-react";
|
|
563
|
+
import { jsx as jsx16, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
564
|
+
var InputOTP = React13.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ jsx16(
|
|
565
|
+
OTPInput,
|
|
566
|
+
{
|
|
567
|
+
ref,
|
|
568
|
+
containerClassName: cn("flex items-center gap-2 has-[:disabled]:opacity-50", containerClassName),
|
|
569
|
+
className: cn("disabled:cursor-not-allowed", className),
|
|
570
|
+
...props
|
|
571
|
+
}
|
|
572
|
+
));
|
|
573
|
+
InputOTP.displayName = "InputOTP";
|
|
574
|
+
var InputOTPGroup = React13.forwardRef(
|
|
575
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx16("div", { ref, className: cn("flex items-center", className), ...props })
|
|
576
|
+
);
|
|
577
|
+
InputOTPGroup.displayName = "InputOTPGroup";
|
|
578
|
+
var InputOTPSlot = React13.forwardRef(({ index, className, ...props }, ref) => {
|
|
579
|
+
const inputOTPContext = React13.useContext(OTPInputContext);
|
|
580
|
+
const slot = inputOTPContext.slots[index];
|
|
581
|
+
const char = slot?.char;
|
|
582
|
+
const hasFakeCaret = slot?.hasFakeCaret;
|
|
583
|
+
const isActive = slot?.isActive;
|
|
584
|
+
return /* @__PURE__ */ jsxs6(
|
|
585
|
+
"div",
|
|
586
|
+
{
|
|
587
|
+
ref,
|
|
588
|
+
className: cn(
|
|
589
|
+
"relative flex size-10 items-center justify-center border-y border-r border-border-default text-sm text-text-primary transition-all first:rounded-l-md first:border-l last:rounded-r-md",
|
|
590
|
+
isActive && "z-10 ring-2 ring-border-focus",
|
|
591
|
+
className
|
|
592
|
+
),
|
|
593
|
+
...props,
|
|
594
|
+
children: [
|
|
595
|
+
char,
|
|
596
|
+
hasFakeCaret && /* @__PURE__ */ jsx16("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx16("div", { className: "h-4 w-px animate-pulse bg-text-primary" }) })
|
|
597
|
+
]
|
|
598
|
+
}
|
|
599
|
+
);
|
|
600
|
+
});
|
|
601
|
+
InputOTPSlot.displayName = "InputOTPSlot";
|
|
602
|
+
var InputOTPSeparator = React13.forwardRef(
|
|
603
|
+
({ ...props }, ref) => /* @__PURE__ */ jsx16("div", { ref, role: "separator", ...props, children: /* @__PURE__ */ jsx16(Minus, { className: "h-4 w-4 text-text-tertiary" }) })
|
|
604
|
+
);
|
|
605
|
+
InputOTPSeparator.displayName = "InputOTPSeparator";
|
|
606
|
+
|
|
607
|
+
// src/components/popover.tsx
|
|
608
|
+
import * as React14 from "react";
|
|
609
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
610
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
611
|
+
var Popover = PopoverPrimitive.Root;
|
|
612
|
+
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
613
|
+
var PopoverAnchor = PopoverPrimitive.Anchor;
|
|
614
|
+
var PopoverContent = React14.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx17(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx17(
|
|
615
|
+
PopoverPrimitive.Content,
|
|
616
|
+
{
|
|
617
|
+
ref,
|
|
618
|
+
align,
|
|
619
|
+
sideOffset,
|
|
620
|
+
className: cn(
|
|
621
|
+
"z-50 w-72 rounded-md border border-border-subtle bg-bg-elevated p-4 text-text-primary 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",
|
|
622
|
+
className
|
|
623
|
+
),
|
|
624
|
+
...props
|
|
625
|
+
}
|
|
626
|
+
) }));
|
|
627
|
+
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
628
|
+
|
|
629
|
+
// src/components/tooltip.tsx
|
|
630
|
+
import * as React15 from "react";
|
|
631
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
632
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
633
|
+
var TooltipProvider = TooltipPrimitive.Provider;
|
|
634
|
+
var Tooltip = TooltipPrimitive.Root;
|
|
635
|
+
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
636
|
+
var TooltipContent = React15.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx18(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx18(
|
|
637
|
+
TooltipPrimitive.Content,
|
|
638
|
+
{
|
|
639
|
+
ref,
|
|
640
|
+
sideOffset,
|
|
641
|
+
className: cn(
|
|
642
|
+
"z-50 overflow-hidden rounded-md border border-border-subtle bg-bg-elevated px-3 py-1.5 text-xs text-text-primary 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",
|
|
643
|
+
className
|
|
644
|
+
),
|
|
645
|
+
...props
|
|
646
|
+
}
|
|
647
|
+
) }));
|
|
648
|
+
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
649
|
+
|
|
650
|
+
// src/components/hover-card.tsx
|
|
651
|
+
import * as React16 from "react";
|
|
652
|
+
import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
|
|
653
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
654
|
+
var HoverCard = HoverCardPrimitive.Root;
|
|
655
|
+
var HoverCardTrigger = HoverCardPrimitive.Trigger;
|
|
656
|
+
var HoverCardContent = React16.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx19(HoverCardPrimitive.Portal, { children: /* @__PURE__ */ jsx19(
|
|
657
|
+
HoverCardPrimitive.Content,
|
|
658
|
+
{
|
|
659
|
+
ref,
|
|
660
|
+
align,
|
|
661
|
+
sideOffset,
|
|
662
|
+
className: cn(
|
|
663
|
+
"z-50 w-64 rounded-md border border-border-subtle bg-bg-elevated p-4 text-text-primary 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",
|
|
664
|
+
className
|
|
665
|
+
),
|
|
666
|
+
...props
|
|
667
|
+
}
|
|
668
|
+
) }));
|
|
669
|
+
HoverCardContent.displayName = HoverCardPrimitive.Content.displayName;
|
|
670
|
+
|
|
671
|
+
// src/components/sheet.tsx
|
|
672
|
+
import * as React17 from "react";
|
|
673
|
+
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
674
|
+
import { cva as cva4 } from "class-variance-authority";
|
|
675
|
+
import { X as X2 } from "lucide-react";
|
|
676
|
+
import { jsx as jsx20, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
677
|
+
var Sheet = SheetPrimitive.Root;
|
|
678
|
+
var SheetTrigger = SheetPrimitive.Trigger;
|
|
679
|
+
var SheetClose = SheetPrimitive.Close;
|
|
680
|
+
var SheetPortal = SheetPrimitive.Portal;
|
|
681
|
+
var SheetOverlay = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(
|
|
682
|
+
SheetPrimitive.Overlay,
|
|
683
|
+
{
|
|
684
|
+
ref,
|
|
685
|
+
className: cn(
|
|
686
|
+
"fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
687
|
+
className
|
|
688
|
+
),
|
|
689
|
+
...props
|
|
690
|
+
}
|
|
691
|
+
));
|
|
692
|
+
SheetOverlay.displayName = SheetPrimitive.Overlay.displayName;
|
|
693
|
+
var sheetVariants = cva4(
|
|
694
|
+
"fixed z-50 gap-4 bg-bg-elevated p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
|
|
695
|
+
{
|
|
696
|
+
variants: {
|
|
697
|
+
side: {
|
|
698
|
+
top: "inset-x-0 top-0 border-b border-border-subtle data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
|
|
699
|
+
bottom: "inset-x-0 bottom-0 border-t border-border-subtle data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
|
|
700
|
+
left: "inset-y-0 left-0 h-full w-3/4 border-r border-border-subtle data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
|
|
701
|
+
right: "inset-y-0 right-0 h-full w-3/4 border-l border-border-subtle data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"
|
|
702
|
+
}
|
|
703
|
+
},
|
|
704
|
+
defaultVariants: {
|
|
705
|
+
side: "right"
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
);
|
|
709
|
+
var SheetContent = React17.forwardRef(({ side = "right", className, children, ...props }, ref) => /* @__PURE__ */ jsxs7(SheetPortal, { children: [
|
|
710
|
+
/* @__PURE__ */ jsx20(SheetOverlay, {}),
|
|
711
|
+
/* @__PURE__ */ jsxs7(
|
|
712
|
+
SheetPrimitive.Content,
|
|
713
|
+
{
|
|
714
|
+
ref,
|
|
715
|
+
className: cn(sheetVariants({ side }), className),
|
|
716
|
+
...props,
|
|
717
|
+
children: [
|
|
718
|
+
children,
|
|
719
|
+
/* @__PURE__ */ jsxs7(SheetPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm text-text-tertiary opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-border-focus disabled:pointer-events-none", children: [
|
|
720
|
+
/* @__PURE__ */ jsx20(X2, { className: "h-4 w-4" }),
|
|
721
|
+
/* @__PURE__ */ jsx20("span", { className: "sr-only", children: "Close" })
|
|
722
|
+
] })
|
|
723
|
+
]
|
|
724
|
+
}
|
|
725
|
+
)
|
|
726
|
+
] }));
|
|
727
|
+
SheetContent.displayName = SheetPrimitive.Content.displayName;
|
|
728
|
+
var SheetHeader = ({ className, ...props }) => /* @__PURE__ */ jsx20(
|
|
729
|
+
"div",
|
|
730
|
+
{
|
|
731
|
+
className: cn("flex flex-col gap-1.5 text-left", className),
|
|
732
|
+
...props
|
|
733
|
+
}
|
|
734
|
+
);
|
|
735
|
+
SheetHeader.displayName = "SheetHeader";
|
|
736
|
+
var SheetFooter = ({ className, ...props }) => /* @__PURE__ */ jsx20(
|
|
737
|
+
"div",
|
|
738
|
+
{
|
|
739
|
+
className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className),
|
|
740
|
+
...props
|
|
741
|
+
}
|
|
742
|
+
);
|
|
743
|
+
SheetFooter.displayName = "SheetFooter";
|
|
744
|
+
var SheetTitle = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(
|
|
745
|
+
SheetPrimitive.Title,
|
|
746
|
+
{
|
|
747
|
+
ref,
|
|
748
|
+
className: cn("text-lg font-semibold text-text-primary", className),
|
|
749
|
+
...props
|
|
750
|
+
}
|
|
751
|
+
));
|
|
752
|
+
SheetTitle.displayName = SheetPrimitive.Title.displayName;
|
|
753
|
+
var SheetDescription = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(
|
|
754
|
+
SheetPrimitive.Description,
|
|
755
|
+
{
|
|
756
|
+
ref,
|
|
757
|
+
className: cn("text-sm text-text-secondary", className),
|
|
758
|
+
...props
|
|
759
|
+
}
|
|
760
|
+
));
|
|
761
|
+
SheetDescription.displayName = SheetPrimitive.Description.displayName;
|
|
762
|
+
|
|
763
|
+
// src/components/drawer.tsx
|
|
764
|
+
import * as React18 from "react";
|
|
765
|
+
import { Drawer as DrawerPrimitive } from "vaul";
|
|
766
|
+
import { jsx as jsx21, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
767
|
+
var Drawer = ({
|
|
768
|
+
shouldScaleBackground = true,
|
|
769
|
+
...props
|
|
770
|
+
}) => /* @__PURE__ */ jsx21(DrawerPrimitive.Root, { shouldScaleBackground, ...props });
|
|
771
|
+
Drawer.displayName = "Drawer";
|
|
772
|
+
var DrawerTrigger = DrawerPrimitive.Trigger;
|
|
773
|
+
var DrawerPortal = DrawerPrimitive.Portal;
|
|
774
|
+
var DrawerClose = DrawerPrimitive.Close;
|
|
775
|
+
var DrawerOverlay = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx21(
|
|
776
|
+
DrawerPrimitive.Overlay,
|
|
777
|
+
{
|
|
778
|
+
ref,
|
|
779
|
+
className: cn("fixed inset-0 z-50 bg-black/50", className),
|
|
780
|
+
...props
|
|
781
|
+
}
|
|
782
|
+
));
|
|
783
|
+
DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;
|
|
784
|
+
var DrawerContent = React18.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs8(DrawerPortal, { children: [
|
|
785
|
+
/* @__PURE__ */ jsx21(DrawerOverlay, {}),
|
|
786
|
+
/* @__PURE__ */ jsxs8(
|
|
787
|
+
DrawerPrimitive.Content,
|
|
788
|
+
{
|
|
789
|
+
ref,
|
|
790
|
+
className: cn(
|
|
791
|
+
"fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border border-border-subtle bg-bg-elevated",
|
|
792
|
+
className
|
|
793
|
+
),
|
|
794
|
+
...props,
|
|
795
|
+
children: [
|
|
796
|
+
/* @__PURE__ */ jsx21("div", { className: "mx-auto mt-4 h-2 w-[100px] rounded-full bg-bg-secondary" }),
|
|
797
|
+
children
|
|
798
|
+
]
|
|
799
|
+
}
|
|
800
|
+
)
|
|
801
|
+
] }));
|
|
802
|
+
DrawerContent.displayName = "DrawerContent";
|
|
803
|
+
var DrawerHeader = ({ className, ...props }) => /* @__PURE__ */ jsx21("div", { className: cn("grid gap-1.5 p-4 text-center sm:text-left", className), ...props });
|
|
804
|
+
DrawerHeader.displayName = "DrawerHeader";
|
|
805
|
+
var DrawerFooter = ({ className, ...props }) => /* @__PURE__ */ jsx21("div", { className: cn("mt-auto flex flex-col gap-2 p-4", className), ...props });
|
|
806
|
+
DrawerFooter.displayName = "DrawerFooter";
|
|
807
|
+
var DrawerTitle = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx21(
|
|
808
|
+
DrawerPrimitive.Title,
|
|
809
|
+
{
|
|
810
|
+
ref,
|
|
811
|
+
className: cn("text-lg font-semibold text-text-primary", className),
|
|
812
|
+
...props
|
|
813
|
+
}
|
|
814
|
+
));
|
|
815
|
+
DrawerTitle.displayName = DrawerPrimitive.Title.displayName;
|
|
816
|
+
var DrawerDescription = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx21(
|
|
817
|
+
DrawerPrimitive.Description,
|
|
818
|
+
{
|
|
819
|
+
ref,
|
|
820
|
+
className: cn("text-sm text-text-secondary", className),
|
|
821
|
+
...props
|
|
822
|
+
}
|
|
823
|
+
));
|
|
824
|
+
DrawerDescription.displayName = DrawerPrimitive.Description.displayName;
|
|
825
|
+
|
|
826
|
+
// src/components/alert-dialog.tsx
|
|
827
|
+
import * as React19 from "react";
|
|
828
|
+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
829
|
+
import { jsx as jsx22, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
830
|
+
var AlertDialog = AlertDialogPrimitive.Root;
|
|
831
|
+
var AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
832
|
+
var AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
833
|
+
var AlertDialogOverlay = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
834
|
+
AlertDialogPrimitive.Overlay,
|
|
835
|
+
{
|
|
836
|
+
ref,
|
|
837
|
+
className: cn(
|
|
838
|
+
"fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
839
|
+
className
|
|
840
|
+
),
|
|
841
|
+
...props
|
|
842
|
+
}
|
|
843
|
+
));
|
|
844
|
+
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
845
|
+
var AlertDialogContent = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs9(AlertDialogPortal, { children: [
|
|
846
|
+
/* @__PURE__ */ jsx22(AlertDialogOverlay, {}),
|
|
847
|
+
/* @__PURE__ */ jsx22(
|
|
848
|
+
AlertDialogPrimitive.Content,
|
|
849
|
+
{
|
|
850
|
+
ref,
|
|
851
|
+
className: cn(
|
|
852
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-border-subtle bg-bg-elevated 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 sm:rounded-lg",
|
|
853
|
+
className
|
|
854
|
+
),
|
|
855
|
+
...props
|
|
856
|
+
}
|
|
857
|
+
)
|
|
858
|
+
] }));
|
|
859
|
+
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
|
|
860
|
+
var AlertDialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsx22(
|
|
861
|
+
"div",
|
|
862
|
+
{
|
|
863
|
+
className: cn("flex flex-col gap-1.5 text-left", className),
|
|
864
|
+
...props
|
|
865
|
+
}
|
|
866
|
+
);
|
|
867
|
+
AlertDialogHeader.displayName = "AlertDialogHeader";
|
|
868
|
+
var AlertDialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsx22(
|
|
869
|
+
"div",
|
|
870
|
+
{
|
|
871
|
+
className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className),
|
|
872
|
+
...props
|
|
873
|
+
}
|
|
874
|
+
);
|
|
875
|
+
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
876
|
+
var AlertDialogTitle = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
877
|
+
AlertDialogPrimitive.Title,
|
|
878
|
+
{
|
|
879
|
+
ref,
|
|
880
|
+
className: cn("text-lg font-semibold text-text-primary", className),
|
|
881
|
+
...props
|
|
882
|
+
}
|
|
883
|
+
));
|
|
884
|
+
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
|
|
885
|
+
var AlertDialogDescription = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
886
|
+
AlertDialogPrimitive.Description,
|
|
887
|
+
{
|
|
888
|
+
ref,
|
|
889
|
+
className: cn("text-sm text-text-secondary", className),
|
|
890
|
+
...props
|
|
891
|
+
}
|
|
892
|
+
));
|
|
893
|
+
AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
|
|
894
|
+
var AlertDialogAction = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
895
|
+
AlertDialogPrimitive.Action,
|
|
896
|
+
{
|
|
897
|
+
ref,
|
|
898
|
+
className: cn(buttonVariants(), className),
|
|
899
|
+
...props
|
|
900
|
+
}
|
|
901
|
+
));
|
|
902
|
+
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
903
|
+
var AlertDialogCancel = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
904
|
+
AlertDialogPrimitive.Cancel,
|
|
905
|
+
{
|
|
906
|
+
ref,
|
|
907
|
+
className: cn(buttonVariants({ variant: "outline" }), "mt-2 sm:mt-0", className),
|
|
908
|
+
...props
|
|
909
|
+
}
|
|
910
|
+
));
|
|
911
|
+
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
|
|
912
|
+
|
|
913
|
+
// src/components/context-menu.tsx
|
|
914
|
+
import * as React20 from "react";
|
|
915
|
+
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
|
916
|
+
import { Check as Check3, ChevronRight as ChevronRight2, Circle as Circle3 } from "lucide-react";
|
|
917
|
+
import { jsx as jsx23, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
918
|
+
var ContextMenu = ContextMenuPrimitive.Root;
|
|
919
|
+
var ContextMenuTrigger = ContextMenuPrimitive.Trigger;
|
|
920
|
+
var ContextMenuGroup = ContextMenuPrimitive.Group;
|
|
921
|
+
var ContextMenuPortal = ContextMenuPrimitive.Portal;
|
|
922
|
+
var ContextMenuSub = ContextMenuPrimitive.Sub;
|
|
923
|
+
var ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
|
|
924
|
+
var ContextMenuSubTrigger = React20.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs10(
|
|
925
|
+
ContextMenuPrimitive.SubTrigger,
|
|
926
|
+
{
|
|
927
|
+
ref,
|
|
928
|
+
className: cn(
|
|
929
|
+
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-bg-secondary data-[state=open]:bg-bg-secondary",
|
|
930
|
+
inset && "pl-8",
|
|
931
|
+
className
|
|
932
|
+
),
|
|
933
|
+
...props,
|
|
934
|
+
children: [
|
|
935
|
+
children,
|
|
936
|
+
/* @__PURE__ */ jsx23(ChevronRight2, { className: "ml-auto h-4 w-4" })
|
|
937
|
+
]
|
|
938
|
+
}
|
|
939
|
+
));
|
|
940
|
+
ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
|
|
941
|
+
var ContextMenuSubContent = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(
|
|
942
|
+
ContextMenuPrimitive.SubContent,
|
|
943
|
+
{
|
|
944
|
+
ref,
|
|
945
|
+
className: cn(
|
|
946
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border border-border-subtle bg-bg-elevated p-1 text-text-primary 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",
|
|
947
|
+
className
|
|
948
|
+
),
|
|
949
|
+
...props
|
|
950
|
+
}
|
|
951
|
+
));
|
|
952
|
+
ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;
|
|
953
|
+
var ContextMenuContent = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(ContextMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx23(
|
|
954
|
+
ContextMenuPrimitive.Content,
|
|
955
|
+
{
|
|
956
|
+
ref,
|
|
957
|
+
className: cn(
|
|
958
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border border-border-subtle bg-bg-elevated p-1 text-text-primary 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",
|
|
959
|
+
className
|
|
960
|
+
),
|
|
961
|
+
...props
|
|
962
|
+
}
|
|
963
|
+
) }));
|
|
964
|
+
ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
|
|
965
|
+
var ContextMenuItem = React20.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx23(
|
|
966
|
+
ContextMenuPrimitive.Item,
|
|
967
|
+
{
|
|
968
|
+
ref,
|
|
969
|
+
className: cn(
|
|
970
|
+
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-bg-secondary focus:text-text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
971
|
+
inset && "pl-8",
|
|
972
|
+
className
|
|
973
|
+
),
|
|
974
|
+
...props
|
|
975
|
+
}
|
|
976
|
+
));
|
|
977
|
+
ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
|
|
978
|
+
var ContextMenuCheckboxItem = React20.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs10(
|
|
979
|
+
ContextMenuPrimitive.CheckboxItem,
|
|
980
|
+
{
|
|
981
|
+
ref,
|
|
982
|
+
className: cn(
|
|
983
|
+
"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-bg-secondary focus:text-text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
984
|
+
className
|
|
985
|
+
),
|
|
986
|
+
checked,
|
|
987
|
+
...props,
|
|
988
|
+
children: [
|
|
989
|
+
/* @__PURE__ */ jsx23("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx23(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx23(Check3, { className: "h-4 w-4" }) }) }),
|
|
990
|
+
children
|
|
991
|
+
]
|
|
992
|
+
}
|
|
993
|
+
));
|
|
994
|
+
ContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;
|
|
995
|
+
var ContextMenuRadioItem = React20.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs10(
|
|
996
|
+
ContextMenuPrimitive.RadioItem,
|
|
997
|
+
{
|
|
998
|
+
ref,
|
|
999
|
+
className: cn(
|
|
1000
|
+
"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-bg-secondary focus:text-text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
1001
|
+
className
|
|
1002
|
+
),
|
|
1003
|
+
...props,
|
|
1004
|
+
children: [
|
|
1005
|
+
/* @__PURE__ */ jsx23("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx23(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx23(Circle3, { className: "h-2 w-2 fill-current" }) }) }),
|
|
1006
|
+
children
|
|
1007
|
+
]
|
|
1008
|
+
}
|
|
1009
|
+
));
|
|
1010
|
+
ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;
|
|
1011
|
+
var ContextMenuLabel = React20.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx23(
|
|
1012
|
+
ContextMenuPrimitive.Label,
|
|
1013
|
+
{
|
|
1014
|
+
ref,
|
|
1015
|
+
className: cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className),
|
|
1016
|
+
...props
|
|
1017
|
+
}
|
|
1018
|
+
));
|
|
1019
|
+
ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;
|
|
1020
|
+
var ContextMenuSeparator = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(
|
|
1021
|
+
ContextMenuPrimitive.Separator,
|
|
1022
|
+
{
|
|
1023
|
+
ref,
|
|
1024
|
+
className: cn("-mx-1 my-1 h-px bg-bg-secondary", className),
|
|
1025
|
+
...props
|
|
1026
|
+
}
|
|
1027
|
+
));
|
|
1028
|
+
ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;
|
|
1029
|
+
var ContextMenuShortcut = ({ className, ...props }) => {
|
|
1030
|
+
return /* @__PURE__ */ jsx23("span", { className: cn("ml-auto text-xs tracking-widest opacity-60", className), ...props });
|
|
1031
|
+
};
|
|
1032
|
+
ContextMenuShortcut.displayName = "ContextMenuShortcut";
|
|
1033
|
+
|
|
1034
|
+
// src/components/menubar.tsx
|
|
1035
|
+
import * as React21 from "react";
|
|
1036
|
+
import * as MenubarPrimitive from "@radix-ui/react-menubar";
|
|
1037
|
+
import { Check as Check4, ChevronRight as ChevronRight3, Circle as Circle4 } from "lucide-react";
|
|
1038
|
+
import { jsx as jsx24, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1039
|
+
var MenubarMenu = (props) => /* @__PURE__ */ jsx24(MenubarPrimitive.Menu, { ...props });
|
|
1040
|
+
MenubarMenu.displayName = "MenubarMenu";
|
|
1041
|
+
var MenubarGroup = MenubarPrimitive.Group;
|
|
1042
|
+
var MenubarPortal = MenubarPrimitive.Portal;
|
|
1043
|
+
var MenubarSub = MenubarPrimitive.Sub;
|
|
1044
|
+
var MenubarRadioGroup = MenubarPrimitive.RadioGroup;
|
|
1045
|
+
var Menubar = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
|
|
1046
|
+
MenubarPrimitive.Root,
|
|
1047
|
+
{
|
|
1048
|
+
ref,
|
|
1049
|
+
className: cn(
|
|
1050
|
+
"flex h-10 items-center gap-1 rounded-md border border-border-subtle bg-bg-elevated p-1",
|
|
1051
|
+
className
|
|
1052
|
+
),
|
|
1053
|
+
...props
|
|
1054
|
+
}
|
|
1055
|
+
));
|
|
1056
|
+
Menubar.displayName = MenubarPrimitive.Root.displayName;
|
|
1057
|
+
var MenubarTrigger = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
|
|
1058
|
+
MenubarPrimitive.Trigger,
|
|
1059
|
+
{
|
|
1060
|
+
ref,
|
|
1061
|
+
className: cn(
|
|
1062
|
+
"flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none focus:bg-bg-secondary data-[state=open]:bg-bg-secondary",
|
|
1063
|
+
className
|
|
1064
|
+
),
|
|
1065
|
+
...props
|
|
1066
|
+
}
|
|
1067
|
+
));
|
|
1068
|
+
MenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName;
|
|
1069
|
+
var MenubarSubTrigger = React21.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs11(
|
|
1070
|
+
MenubarPrimitive.SubTrigger,
|
|
1071
|
+
{
|
|
1072
|
+
ref,
|
|
1073
|
+
className: cn(
|
|
1074
|
+
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-bg-secondary data-[state=open]:bg-bg-secondary",
|
|
1075
|
+
inset && "pl-8",
|
|
1076
|
+
className
|
|
1077
|
+
),
|
|
1078
|
+
...props,
|
|
1079
|
+
children: [
|
|
1080
|
+
children,
|
|
1081
|
+
/* @__PURE__ */ jsx24(ChevronRight3, { className: "ml-auto h-4 w-4" })
|
|
1082
|
+
]
|
|
1083
|
+
}
|
|
1084
|
+
));
|
|
1085
|
+
MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName;
|
|
1086
|
+
var MenubarSubContent = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
|
|
1087
|
+
MenubarPrimitive.SubContent,
|
|
1088
|
+
{
|
|
1089
|
+
ref,
|
|
1090
|
+
className: cn(
|
|
1091
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border border-border-subtle bg-bg-elevated p-1 text-text-primary 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",
|
|
1092
|
+
className
|
|
1093
|
+
),
|
|
1094
|
+
...props
|
|
1095
|
+
}
|
|
1096
|
+
));
|
|
1097
|
+
MenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName;
|
|
1098
|
+
var MenubarContent = React21.forwardRef(({ className, align = "start", alignOffset = -4, sideOffset = 8, ...props }, ref) => /* @__PURE__ */ jsx24(MenubarPrimitive.Portal, { children: /* @__PURE__ */ jsx24(
|
|
1099
|
+
MenubarPrimitive.Content,
|
|
1100
|
+
{
|
|
1101
|
+
ref,
|
|
1102
|
+
align,
|
|
1103
|
+
alignOffset,
|
|
1104
|
+
sideOffset,
|
|
1105
|
+
className: cn(
|
|
1106
|
+
"z-50 min-w-[12rem] overflow-hidden rounded-md border border-border-subtle bg-bg-elevated p-1 text-text-primary 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",
|
|
1107
|
+
className
|
|
1108
|
+
),
|
|
1109
|
+
...props
|
|
1110
|
+
}
|
|
1111
|
+
) }));
|
|
1112
|
+
MenubarContent.displayName = MenubarPrimitive.Content.displayName;
|
|
1113
|
+
var MenubarItem = React21.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx24(
|
|
1114
|
+
MenubarPrimitive.Item,
|
|
1115
|
+
{
|
|
1116
|
+
ref,
|
|
1117
|
+
className: cn(
|
|
1118
|
+
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-bg-secondary focus:text-text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
1119
|
+
inset && "pl-8",
|
|
1120
|
+
className
|
|
1121
|
+
),
|
|
1122
|
+
...props
|
|
1123
|
+
}
|
|
1124
|
+
));
|
|
1125
|
+
MenubarItem.displayName = MenubarPrimitive.Item.displayName;
|
|
1126
|
+
var MenubarCheckboxItem = React21.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs11(
|
|
1127
|
+
MenubarPrimitive.CheckboxItem,
|
|
1128
|
+
{
|
|
1129
|
+
ref,
|
|
1130
|
+
className: cn(
|
|
1131
|
+
"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-bg-secondary focus:text-text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
1132
|
+
className
|
|
1133
|
+
),
|
|
1134
|
+
checked,
|
|
1135
|
+
...props,
|
|
1136
|
+
children: [
|
|
1137
|
+
/* @__PURE__ */ jsx24("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx24(MenubarPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx24(Check4, { className: "h-4 w-4" }) }) }),
|
|
1138
|
+
children
|
|
1139
|
+
]
|
|
1140
|
+
}
|
|
1141
|
+
));
|
|
1142
|
+
MenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName;
|
|
1143
|
+
var MenubarRadioItem = React21.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs11(
|
|
1144
|
+
MenubarPrimitive.RadioItem,
|
|
1145
|
+
{
|
|
1146
|
+
ref,
|
|
1147
|
+
className: cn(
|
|
1148
|
+
"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-bg-secondary focus:text-text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
1149
|
+
className
|
|
1150
|
+
),
|
|
1151
|
+
...props,
|
|
1152
|
+
children: [
|
|
1153
|
+
/* @__PURE__ */ jsx24("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx24(MenubarPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx24(Circle4, { className: "h-2 w-2 fill-current" }) }) }),
|
|
1154
|
+
children
|
|
1155
|
+
]
|
|
1156
|
+
}
|
|
1157
|
+
));
|
|
1158
|
+
MenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName;
|
|
1159
|
+
var MenubarLabel = React21.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx24(
|
|
1160
|
+
MenubarPrimitive.Label,
|
|
1161
|
+
{
|
|
1162
|
+
ref,
|
|
1163
|
+
className: cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className),
|
|
1164
|
+
...props
|
|
1165
|
+
}
|
|
1166
|
+
));
|
|
1167
|
+
MenubarLabel.displayName = MenubarPrimitive.Label.displayName;
|
|
1168
|
+
var MenubarSeparator = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
|
|
1169
|
+
MenubarPrimitive.Separator,
|
|
1170
|
+
{
|
|
1171
|
+
ref,
|
|
1172
|
+
className: cn("-mx-1 my-1 h-px bg-bg-secondary", className),
|
|
1173
|
+
...props
|
|
1174
|
+
}
|
|
1175
|
+
));
|
|
1176
|
+
MenubarSeparator.displayName = MenubarPrimitive.Separator.displayName;
|
|
1177
|
+
var MenubarShortcut = ({ className, ...props }) => {
|
|
1178
|
+
return /* @__PURE__ */ jsx24("span", { className: cn("ml-auto text-xs tracking-widest opacity-60", className), ...props });
|
|
1179
|
+
};
|
|
1180
|
+
MenubarShortcut.displayName = "MenubarShortcut";
|
|
1181
|
+
|
|
1182
|
+
// src/components/badge.tsx
|
|
1183
|
+
import * as React22 from "react";
|
|
1184
|
+
import { cva as cva5 } from "class-variance-authority";
|
|
1185
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1186
|
+
var badgeVariants = cva5(
|
|
1187
|
+
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
1188
|
+
{
|
|
1189
|
+
variants: {
|
|
1190
|
+
variant: {
|
|
1191
|
+
default: "border-transparent bg-blue-400 text-text-on-brand",
|
|
1192
|
+
secondary: "border-transparent bg-bg-secondary text-text-primary",
|
|
1193
|
+
outline: "border-border-default text-text-primary",
|
|
1194
|
+
destructive: "border-transparent bg-bg-danger text-text-on-danger",
|
|
1195
|
+
success: "border-transparent bg-bg-success text-text-on-success",
|
|
1196
|
+
warning: "border-transparent bg-bg-warning text-text-on-warning"
|
|
1197
|
+
}
|
|
1198
|
+
},
|
|
1199
|
+
defaultVariants: { variant: "default" }
|
|
1200
|
+
}
|
|
1201
|
+
);
|
|
1202
|
+
var Badge = React22.forwardRef(
|
|
1203
|
+
({ className, variant, ...props }, ref) => /* @__PURE__ */ jsx25("div", { ref, className: cn(badgeVariants({ variant }), className), ...props })
|
|
1204
|
+
);
|
|
1205
|
+
Badge.displayName = "Badge";
|
|
1206
|
+
|
|
1207
|
+
// src/components/table.tsx
|
|
1208
|
+
import * as React23 from "react";
|
|
1209
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
1210
|
+
var Table = React23.forwardRef(
|
|
1211
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx26("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsx26("table", { ref, className: cn("w-full caption-bottom text-sm", className), ...props }) })
|
|
1212
|
+
);
|
|
1213
|
+
Table.displayName = "Table";
|
|
1214
|
+
var TableHeader = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx26("thead", { ref, className: cn("[&_tr]:border-b [&_tr]:border-border-subtle", className), ...props }));
|
|
1215
|
+
TableHeader.displayName = "TableHeader";
|
|
1216
|
+
var TableBody = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx26("tbody", { ref, className: cn("[&_tr:last-child]:border-0", className), ...props }));
|
|
1217
|
+
TableBody.displayName = "TableBody";
|
|
1218
|
+
var TableFooter = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx26(
|
|
1219
|
+
"tfoot",
|
|
1220
|
+
{
|
|
1221
|
+
ref,
|
|
1222
|
+
className: cn(
|
|
1223
|
+
"border-t border-border-subtle bg-bg-secondary/50 font-medium [&>tr]:last:border-b-0",
|
|
1224
|
+
className
|
|
1225
|
+
),
|
|
1226
|
+
...props
|
|
1227
|
+
}
|
|
1228
|
+
));
|
|
1229
|
+
TableFooter.displayName = "TableFooter";
|
|
1230
|
+
var TableRow = React23.forwardRef(
|
|
1231
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx26(
|
|
1232
|
+
"tr",
|
|
1233
|
+
{
|
|
1234
|
+
ref,
|
|
1235
|
+
className: cn(
|
|
1236
|
+
"border-b border-border-subtle transition-colors hover:bg-bg-secondary/50 data-[state=selected]:bg-bg-secondary",
|
|
1237
|
+
className
|
|
1238
|
+
),
|
|
1239
|
+
...props
|
|
1240
|
+
}
|
|
1241
|
+
)
|
|
1242
|
+
);
|
|
1243
|
+
TableRow.displayName = "TableRow";
|
|
1244
|
+
var TableHead = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx26(
|
|
1245
|
+
"th",
|
|
1246
|
+
{
|
|
1247
|
+
ref,
|
|
1248
|
+
className: cn(
|
|
1249
|
+
"h-12 px-4 text-left align-middle font-medium text-text-secondary [&:has([role=checkbox])]:pr-0",
|
|
1250
|
+
className
|
|
1251
|
+
),
|
|
1252
|
+
...props
|
|
1253
|
+
}
|
|
1254
|
+
));
|
|
1255
|
+
TableHead.displayName = "TableHead";
|
|
1256
|
+
var TableCell = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx26(
|
|
1257
|
+
"td",
|
|
1258
|
+
{
|
|
1259
|
+
ref,
|
|
1260
|
+
className: cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className),
|
|
1261
|
+
...props
|
|
1262
|
+
}
|
|
1263
|
+
));
|
|
1264
|
+
TableCell.displayName = "TableCell";
|
|
1265
|
+
var TableCaption = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx26("caption", { ref, className: cn("mt-4 text-sm text-text-secondary", className), ...props }));
|
|
1266
|
+
TableCaption.displayName = "TableCaption";
|
|
1267
|
+
|
|
1268
|
+
// src/components/skeleton.tsx
|
|
1269
|
+
import * as React24 from "react";
|
|
1270
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
1271
|
+
var Skeleton = React24.forwardRef(
|
|
1272
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx27("div", { ref, className: cn("animate-pulse rounded-md bg-bg-secondary", className), ...props })
|
|
1273
|
+
);
|
|
1274
|
+
Skeleton.displayName = "Skeleton";
|
|
1275
|
+
|
|
1276
|
+
// src/components/avatar.tsx
|
|
1277
|
+
import * as React25 from "react";
|
|
1278
|
+
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
1279
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
1280
|
+
var Avatar = React25.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx28(
|
|
1281
|
+
AvatarPrimitive.Root,
|
|
1282
|
+
{
|
|
1283
|
+
ref,
|
|
1284
|
+
className: cn("relative flex size-10 shrink-0 overflow-hidden rounded-full", className),
|
|
1285
|
+
...props
|
|
1286
|
+
}
|
|
1287
|
+
));
|
|
1288
|
+
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
1289
|
+
var AvatarImage = React25.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx28(AvatarPrimitive.Image, { ref, className: cn("aspect-square h-full w-full", className), ...props }));
|
|
1290
|
+
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
1291
|
+
var AvatarFallback = React25.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx28(
|
|
1292
|
+
AvatarPrimitive.Fallback,
|
|
1293
|
+
{
|
|
1294
|
+
ref,
|
|
1295
|
+
className: cn(
|
|
1296
|
+
"flex h-full w-full items-center justify-center rounded-full bg-bg-secondary text-text-primary",
|
|
1297
|
+
className
|
|
1298
|
+
),
|
|
1299
|
+
...props
|
|
1300
|
+
}
|
|
1301
|
+
));
|
|
1302
|
+
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
1303
|
+
|
|
1304
|
+
// src/components/separator.tsx
|
|
1305
|
+
import * as React26 from "react";
|
|
1306
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
1307
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
1308
|
+
var Separator4 = React26.forwardRef(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx29(
|
|
1309
|
+
SeparatorPrimitive.Root,
|
|
1310
|
+
{
|
|
1311
|
+
ref,
|
|
1312
|
+
decorative,
|
|
1313
|
+
orientation,
|
|
1314
|
+
className: cn(
|
|
1315
|
+
"shrink-0 bg-border-subtle",
|
|
1316
|
+
orientation === "horizontal" ? "h-px w-full" : "h-full w-px",
|
|
1317
|
+
className
|
|
1318
|
+
),
|
|
1319
|
+
...props
|
|
1320
|
+
}
|
|
1321
|
+
));
|
|
1322
|
+
Separator4.displayName = SeparatorPrimitive.Root.displayName;
|
|
1323
|
+
|
|
1324
|
+
// src/components/progress.tsx
|
|
1325
|
+
import * as React27 from "react";
|
|
1326
|
+
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
1327
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
1328
|
+
var Progress = React27.forwardRef(({ className, value, ...props }, ref) => /* @__PURE__ */ jsx30(
|
|
1329
|
+
ProgressPrimitive.Root,
|
|
1330
|
+
{
|
|
1331
|
+
ref,
|
|
1332
|
+
value,
|
|
1333
|
+
className: cn("relative h-4 w-full overflow-hidden rounded-full bg-bg-secondary", className),
|
|
1334
|
+
...props,
|
|
1335
|
+
children: /* @__PURE__ */ jsx30(
|
|
1336
|
+
ProgressPrimitive.Indicator,
|
|
1337
|
+
{
|
|
1338
|
+
className: "h-full w-full flex-1 bg-blue-400 transition-all",
|
|
1339
|
+
style: { transform: `translateX(-${100 - (value || 0)}%)` }
|
|
1340
|
+
}
|
|
1341
|
+
)
|
|
1342
|
+
}
|
|
1343
|
+
));
|
|
1344
|
+
Progress.displayName = ProgressPrimitive.Root.displayName;
|
|
1345
|
+
|
|
1346
|
+
// src/components/aspect-ratio.tsx
|
|
1347
|
+
import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio";
|
|
1348
|
+
var AspectRatio = AspectRatioPrimitive.Root;
|
|
1349
|
+
|
|
1350
|
+
// src/components/tabs.tsx
|
|
1351
|
+
import * as React28 from "react";
|
|
1352
|
+
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
1353
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
1354
|
+
var Tabs = TabsPrimitive.Root;
|
|
1355
|
+
var TabsList = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx31(
|
|
1356
|
+
TabsPrimitive.List,
|
|
1357
|
+
{
|
|
1358
|
+
ref,
|
|
1359
|
+
className: cn(
|
|
1360
|
+
"inline-flex h-10 items-center justify-center rounded-md bg-bg-secondary p-1 text-text-secondary",
|
|
1361
|
+
className
|
|
1362
|
+
),
|
|
1363
|
+
...props
|
|
1364
|
+
}
|
|
1365
|
+
));
|
|
1366
|
+
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
1367
|
+
var TabsTrigger = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx31(
|
|
1368
|
+
TabsPrimitive.Trigger,
|
|
1369
|
+
{
|
|
1370
|
+
ref,
|
|
1371
|
+
className: cn(
|
|
1372
|
+
"inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-bg-elevated data-[state=active]:text-text-primary data-[state=active]:shadow-sm",
|
|
1373
|
+
className
|
|
1374
|
+
),
|
|
1375
|
+
...props
|
|
1376
|
+
}
|
|
1377
|
+
));
|
|
1378
|
+
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
1379
|
+
var TabsContent = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx31(
|
|
1380
|
+
TabsPrimitive.Content,
|
|
1381
|
+
{
|
|
1382
|
+
ref,
|
|
1383
|
+
className: cn(
|
|
1384
|
+
"mt-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
1385
|
+
className
|
|
1386
|
+
),
|
|
1387
|
+
...props
|
|
1388
|
+
}
|
|
1389
|
+
));
|
|
1390
|
+
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
1391
|
+
|
|
1392
|
+
// src/components/accordion.tsx
|
|
1393
|
+
import * as React29 from "react";
|
|
1394
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
1395
|
+
import { ChevronDown as ChevronDown2 } from "lucide-react";
|
|
1396
|
+
import { jsx as jsx32, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1397
|
+
var Accordion = AccordionPrimitive.Root;
|
|
1398
|
+
var AccordionItem = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx32(
|
|
1399
|
+
AccordionPrimitive.Item,
|
|
1400
|
+
{
|
|
1401
|
+
ref,
|
|
1402
|
+
className: cn("border-b border-border-subtle", className),
|
|
1403
|
+
...props
|
|
1404
|
+
}
|
|
1405
|
+
));
|
|
1406
|
+
AccordionItem.displayName = AccordionPrimitive.Item.displayName;
|
|
1407
|
+
var AccordionTrigger = React29.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx32(AccordionPrimitive.Header, { className: "flex", children: /* @__PURE__ */ jsxs12(
|
|
1408
|
+
AccordionPrimitive.Trigger,
|
|
1409
|
+
{
|
|
1410
|
+
ref,
|
|
1411
|
+
className: cn(
|
|
1412
|
+
"flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",
|
|
1413
|
+
className
|
|
1414
|
+
),
|
|
1415
|
+
...props,
|
|
1416
|
+
children: [
|
|
1417
|
+
children,
|
|
1418
|
+
/* @__PURE__ */ jsx32(ChevronDown2, { className: "h-4 w-4 shrink-0 transition-transform duration-200" })
|
|
1419
|
+
]
|
|
1420
|
+
}
|
|
1421
|
+
) }));
|
|
1422
|
+
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
|
|
1423
|
+
var AccordionContent = React29.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx32(
|
|
1424
|
+
AccordionPrimitive.Content,
|
|
1425
|
+
{
|
|
1426
|
+
ref,
|
|
1427
|
+
className: cn(
|
|
1428
|
+
"overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
|
|
1429
|
+
),
|
|
1430
|
+
...props,
|
|
1431
|
+
children: /* @__PURE__ */ jsx32("div", { className: cn("pb-4 pt-0", className), children })
|
|
1432
|
+
}
|
|
1433
|
+
));
|
|
1434
|
+
AccordionContent.displayName = AccordionPrimitive.Content.displayName;
|
|
1435
|
+
|
|
1436
|
+
// src/components/collapsible.tsx
|
|
1437
|
+
import * as React30 from "react";
|
|
1438
|
+
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
1439
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
1440
|
+
var Collapsible = CollapsiblePrimitive.Root;
|
|
1441
|
+
var CollapsibleTrigger2 = CollapsiblePrimitive.CollapsibleTrigger;
|
|
1442
|
+
var CollapsibleContent2 = React30.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx33(
|
|
1443
|
+
CollapsiblePrimitive.CollapsibleContent,
|
|
1444
|
+
{
|
|
1445
|
+
ref,
|
|
1446
|
+
className: cn(
|
|
1447
|
+
"overflow-hidden text-sm data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down",
|
|
1448
|
+
className
|
|
1449
|
+
),
|
|
1450
|
+
...props
|
|
1451
|
+
}
|
|
1452
|
+
));
|
|
1453
|
+
CollapsibleContent2.displayName = CollapsiblePrimitive.CollapsibleContent.displayName;
|
|
1454
|
+
|
|
1455
|
+
// src/components/scroll-area.tsx
|
|
1456
|
+
import * as React31 from "react";
|
|
1457
|
+
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
1458
|
+
import { jsx as jsx34, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1459
|
+
var ScrollArea = React31.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs13(
|
|
1460
|
+
ScrollAreaPrimitive.Root,
|
|
1461
|
+
{
|
|
1462
|
+
ref,
|
|
1463
|
+
className: cn("relative overflow-hidden", className),
|
|
1464
|
+
...props,
|
|
1465
|
+
children: [
|
|
1466
|
+
/* @__PURE__ */ jsx34(ScrollAreaPrimitive.Viewport, { className: "h-full w-full rounded-[inherit]", children }),
|
|
1467
|
+
/* @__PURE__ */ jsx34(ScrollBar, {}),
|
|
1468
|
+
/* @__PURE__ */ jsx34(ScrollAreaPrimitive.Corner, {})
|
|
1469
|
+
]
|
|
1470
|
+
}
|
|
1471
|
+
));
|
|
1472
|
+
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
1473
|
+
var ScrollBar = React31.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsx34(
|
|
1474
|
+
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
|
1475
|
+
{
|
|
1476
|
+
ref,
|
|
1477
|
+
orientation,
|
|
1478
|
+
className: cn(
|
|
1479
|
+
"flex touch-none select-none transition-colors",
|
|
1480
|
+
orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
|
|
1481
|
+
orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
|
|
1482
|
+
className
|
|
1483
|
+
),
|
|
1484
|
+
...props,
|
|
1485
|
+
children: /* @__PURE__ */ jsx34(ScrollAreaPrimitive.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border-default" })
|
|
1486
|
+
}
|
|
1487
|
+
));
|
|
1488
|
+
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
1489
|
+
|
|
1490
|
+
// src/components/alert.tsx
|
|
1491
|
+
import * as React32 from "react";
|
|
1492
|
+
import { cva as cva6 } from "class-variance-authority";
|
|
1493
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
1494
|
+
var alertVariants = cva6(
|
|
1495
|
+
"relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4",
|
|
1496
|
+
{
|
|
1497
|
+
variants: {
|
|
1498
|
+
variant: {
|
|
1499
|
+
default: "bg-bg-elevated border-border-subtle text-text-primary",
|
|
1500
|
+
destructive: "bg-bg-danger border-border-danger text-text-on-danger",
|
|
1501
|
+
success: "bg-bg-success border-border-success text-text-on-success",
|
|
1502
|
+
warning: "bg-bg-warning border-border-warning text-text-on-warning"
|
|
1503
|
+
}
|
|
1504
|
+
},
|
|
1505
|
+
defaultVariants: { variant: "default" }
|
|
1506
|
+
}
|
|
1507
|
+
);
|
|
1508
|
+
var Alert = React32.forwardRef(({ className, variant, ...props }, ref) => /* @__PURE__ */ jsx35(
|
|
1509
|
+
"div",
|
|
1510
|
+
{
|
|
1511
|
+
ref,
|
|
1512
|
+
role: "alert",
|
|
1513
|
+
className: cn(alertVariants({ variant }), className),
|
|
1514
|
+
...props
|
|
1515
|
+
}
|
|
1516
|
+
));
|
|
1517
|
+
Alert.displayName = "Alert";
|
|
1518
|
+
var AlertTitle = React32.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx35(
|
|
1519
|
+
"h5",
|
|
1520
|
+
{
|
|
1521
|
+
ref,
|
|
1522
|
+
className: cn("mb-1 font-medium leading-none tracking-tight", className),
|
|
1523
|
+
...props
|
|
1524
|
+
}
|
|
1525
|
+
));
|
|
1526
|
+
AlertTitle.displayName = "AlertTitle";
|
|
1527
|
+
var AlertDescription = React32.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx35(
|
|
1528
|
+
"div",
|
|
1529
|
+
{
|
|
1530
|
+
ref,
|
|
1531
|
+
className: cn("text-sm [&_p]:leading-relaxed", className),
|
|
1532
|
+
...props
|
|
1533
|
+
}
|
|
1534
|
+
));
|
|
1535
|
+
AlertDescription.displayName = "AlertDescription";
|
|
1536
|
+
|
|
1537
|
+
// src/components/breadcrumb.tsx
|
|
1538
|
+
import * as React33 from "react";
|
|
1539
|
+
import { Slot as Slot2 } from "@radix-ui/react-slot";
|
|
1540
|
+
import { ChevronRight as ChevronRight4, MoreHorizontal } from "lucide-react";
|
|
1541
|
+
import { jsx as jsx36, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1542
|
+
var Breadcrumb = React33.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx36("nav", { ref, "aria-label": "breadcrumb", ...props }));
|
|
1543
|
+
Breadcrumb.displayName = "Breadcrumb";
|
|
1544
|
+
var BreadcrumbList = React33.forwardRef(
|
|
1545
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx36(
|
|
1546
|
+
"ol",
|
|
1547
|
+
{
|
|
1548
|
+
ref,
|
|
1549
|
+
className: cn(
|
|
1550
|
+
"flex flex-wrap items-center gap-1.5 break-words text-sm text-text-tertiary sm:gap-2.5",
|
|
1551
|
+
className
|
|
1552
|
+
),
|
|
1553
|
+
...props
|
|
1554
|
+
}
|
|
1555
|
+
)
|
|
1556
|
+
);
|
|
1557
|
+
BreadcrumbList.displayName = "BreadcrumbList";
|
|
1558
|
+
var BreadcrumbItem = React33.forwardRef(
|
|
1559
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx36("li", { ref, className: cn("inline-flex items-center gap-1.5", className), ...props })
|
|
1560
|
+
);
|
|
1561
|
+
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
1562
|
+
var BreadcrumbLink = React33.forwardRef(({ asChild, className, ...props }, ref) => {
|
|
1563
|
+
const Comp = asChild ? Slot2 : "a";
|
|
1564
|
+
return /* @__PURE__ */ jsx36(
|
|
1565
|
+
Comp,
|
|
1566
|
+
{
|
|
1567
|
+
ref,
|
|
1568
|
+
className: cn("transition-colors hover:text-text-primary", className),
|
|
1569
|
+
...props
|
|
1570
|
+
}
|
|
1571
|
+
);
|
|
1572
|
+
});
|
|
1573
|
+
BreadcrumbLink.displayName = "BreadcrumbLink";
|
|
1574
|
+
var BreadcrumbPage = React33.forwardRef(
|
|
1575
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx36(
|
|
1576
|
+
"span",
|
|
1577
|
+
{
|
|
1578
|
+
ref,
|
|
1579
|
+
role: "link",
|
|
1580
|
+
"aria-disabled": "true",
|
|
1581
|
+
"aria-current": "page",
|
|
1582
|
+
className: cn("font-normal text-text-primary", className),
|
|
1583
|
+
...props
|
|
1584
|
+
}
|
|
1585
|
+
)
|
|
1586
|
+
);
|
|
1587
|
+
BreadcrumbPage.displayName = "BreadcrumbPage";
|
|
1588
|
+
var BreadcrumbSeparator = ({
|
|
1589
|
+
children,
|
|
1590
|
+
className,
|
|
1591
|
+
...props
|
|
1592
|
+
}) => /* @__PURE__ */ jsx36(
|
|
1593
|
+
"li",
|
|
1594
|
+
{
|
|
1595
|
+
role: "presentation",
|
|
1596
|
+
"aria-hidden": "true",
|
|
1597
|
+
className: cn("[&>svg]:h-4 [&>svg]:w-4", className),
|
|
1598
|
+
...props,
|
|
1599
|
+
children: children ?? /* @__PURE__ */ jsx36(ChevronRight4, {})
|
|
1600
|
+
}
|
|
1601
|
+
);
|
|
1602
|
+
BreadcrumbSeparator.displayName = "BreadcrumbSeparator";
|
|
1603
|
+
var BreadcrumbEllipsis = ({ className, ...props }) => /* @__PURE__ */ jsxs14(
|
|
1604
|
+
"span",
|
|
1605
|
+
{
|
|
1606
|
+
role: "presentation",
|
|
1607
|
+
"aria-hidden": "true",
|
|
1608
|
+
className: cn("flex h-9 w-9 items-center justify-center", className),
|
|
1609
|
+
...props,
|
|
1610
|
+
children: [
|
|
1611
|
+
/* @__PURE__ */ jsx36(MoreHorizontal, { className: "h-4 w-4" }),
|
|
1612
|
+
/* @__PURE__ */ jsx36("span", { className: "sr-only", children: "More" })
|
|
1613
|
+
]
|
|
1614
|
+
}
|
|
1615
|
+
);
|
|
1616
|
+
BreadcrumbEllipsis.displayName = "BreadcrumbEllipsis";
|
|
1617
|
+
|
|
1618
|
+
// src/components/pagination.tsx
|
|
1619
|
+
import * as React34 from "react";
|
|
1620
|
+
import { ChevronLeft, ChevronRight as ChevronRight5, MoreHorizontal as MoreHorizontal2 } from "lucide-react";
|
|
1621
|
+
import { jsx as jsx37, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1622
|
+
var Pagination = ({ className, ...props }) => /* @__PURE__ */ jsx37(
|
|
1623
|
+
"nav",
|
|
1624
|
+
{
|
|
1625
|
+
role: "navigation",
|
|
1626
|
+
"aria-label": "pagination",
|
|
1627
|
+
className: cn("mx-auto flex w-full justify-center", className),
|
|
1628
|
+
...props
|
|
1629
|
+
}
|
|
1630
|
+
);
|
|
1631
|
+
Pagination.displayName = "Pagination";
|
|
1632
|
+
var PaginationContent = React34.forwardRef(
|
|
1633
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx37("ul", { ref, className: cn("flex flex-row items-center gap-1", className), ...props })
|
|
1634
|
+
);
|
|
1635
|
+
PaginationContent.displayName = "PaginationContent";
|
|
1636
|
+
var PaginationItem = React34.forwardRef(
|
|
1637
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx37("li", { ref, className: cn("", className), ...props })
|
|
1638
|
+
);
|
|
1639
|
+
PaginationItem.displayName = "PaginationItem";
|
|
1640
|
+
var PaginationLink = ({ className, isActive, size = "icon", ...props }) => /* @__PURE__ */ jsx37(
|
|
1641
|
+
"a",
|
|
1642
|
+
{
|
|
1643
|
+
"aria-current": isActive ? "page" : void 0,
|
|
1644
|
+
className: cn(
|
|
1645
|
+
buttonVariants({ variant: isActive ? "outline" : "ghost", size }),
|
|
1646
|
+
className
|
|
1647
|
+
),
|
|
1648
|
+
...props
|
|
1649
|
+
}
|
|
1650
|
+
);
|
|
1651
|
+
PaginationLink.displayName = "PaginationLink";
|
|
1652
|
+
var PaginationPrevious = ({ className, ...props }) => /* @__PURE__ */ jsxs15(
|
|
1653
|
+
PaginationLink,
|
|
1654
|
+
{
|
|
1655
|
+
"aria-label": "Go to previous page",
|
|
1656
|
+
size: "default",
|
|
1657
|
+
className: cn("gap-1 pl-2.5", className),
|
|
1658
|
+
...props,
|
|
1659
|
+
children: [
|
|
1660
|
+
/* @__PURE__ */ jsx37(ChevronLeft, { className: "h-4 w-4" }),
|
|
1661
|
+
/* @__PURE__ */ jsx37("span", { children: "Previous" })
|
|
1662
|
+
]
|
|
1663
|
+
}
|
|
1664
|
+
);
|
|
1665
|
+
PaginationPrevious.displayName = "PaginationPrevious";
|
|
1666
|
+
var PaginationNext = ({ className, ...props }) => /* @__PURE__ */ jsxs15(
|
|
1667
|
+
PaginationLink,
|
|
1668
|
+
{
|
|
1669
|
+
"aria-label": "Go to next page",
|
|
1670
|
+
size: "default",
|
|
1671
|
+
className: cn("gap-1 pr-2.5", className),
|
|
1672
|
+
...props,
|
|
1673
|
+
children: [
|
|
1674
|
+
/* @__PURE__ */ jsx37("span", { children: "Next" }),
|
|
1675
|
+
/* @__PURE__ */ jsx37(ChevronRight5, { className: "h-4 w-4" })
|
|
1676
|
+
]
|
|
1677
|
+
}
|
|
1678
|
+
);
|
|
1679
|
+
PaginationNext.displayName = "PaginationNext";
|
|
1680
|
+
var PaginationEllipsis = ({ className, ...props }) => /* @__PURE__ */ jsxs15(
|
|
1681
|
+
"span",
|
|
1682
|
+
{
|
|
1683
|
+
"aria-hidden": true,
|
|
1684
|
+
className: cn("flex h-9 w-9 items-center justify-center", className),
|
|
1685
|
+
...props,
|
|
1686
|
+
children: [
|
|
1687
|
+
/* @__PURE__ */ jsx37(MoreHorizontal2, { className: "h-4 w-4" }),
|
|
1688
|
+
/* @__PURE__ */ jsx37("span", { className: "sr-only", children: "More pages" })
|
|
1689
|
+
]
|
|
1690
|
+
}
|
|
1691
|
+
);
|
|
1692
|
+
PaginationEllipsis.displayName = "PaginationEllipsis";
|
|
1693
|
+
|
|
1694
|
+
// src/components/command.tsx
|
|
1695
|
+
import * as React35 from "react";
|
|
1696
|
+
import { Command as CommandPrimitive } from "cmdk";
|
|
1697
|
+
import { Search } from "lucide-react";
|
|
1698
|
+
import { jsx as jsx38, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1699
|
+
var Command = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx38(
|
|
1700
|
+
CommandPrimitive,
|
|
1701
|
+
{
|
|
1702
|
+
ref,
|
|
1703
|
+
className: cn(
|
|
1704
|
+
"flex h-full w-full flex-col overflow-hidden rounded-md bg-bg-elevated text-text-primary",
|
|
1705
|
+
className
|
|
1706
|
+
),
|
|
1707
|
+
...props
|
|
1708
|
+
}
|
|
1709
|
+
));
|
|
1710
|
+
Command.displayName = CommandPrimitive.displayName;
|
|
1711
|
+
var CommandDialog = ({ children, ...props }) => /* @__PURE__ */ jsx38(Dialog, { ...props, children: /* @__PURE__ */ jsx38(DialogContent, { className: "overflow-hidden p-0", children: /* @__PURE__ */ jsx38(Command, { className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-text-tertiary [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children }) }) });
|
|
1712
|
+
var CommandInput = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs16("div", { className: "flex items-center border-b border-border-subtle px-3", "cmdk-input-wrapper": "", children: [
|
|
1713
|
+
/* @__PURE__ */ jsx38(Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
1714
|
+
/* @__PURE__ */ jsx38(
|
|
1715
|
+
CommandPrimitive.Input,
|
|
1716
|
+
{
|
|
1717
|
+
ref,
|
|
1718
|
+
className: cn(
|
|
1719
|
+
"flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-text-tertiary disabled:cursor-not-allowed disabled:opacity-50",
|
|
1720
|
+
className
|
|
1721
|
+
),
|
|
1722
|
+
...props
|
|
1723
|
+
}
|
|
1724
|
+
)
|
|
1725
|
+
] }));
|
|
1726
|
+
CommandInput.displayName = CommandPrimitive.Input.displayName;
|
|
1727
|
+
var CommandList = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx38(
|
|
1728
|
+
CommandPrimitive.List,
|
|
1729
|
+
{
|
|
1730
|
+
ref,
|
|
1731
|
+
className: cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className),
|
|
1732
|
+
...props
|
|
1733
|
+
}
|
|
1734
|
+
));
|
|
1735
|
+
CommandList.displayName = CommandPrimitive.List.displayName;
|
|
1736
|
+
var CommandEmpty = React35.forwardRef((props, ref) => /* @__PURE__ */ jsx38(
|
|
1737
|
+
CommandPrimitive.Empty,
|
|
1738
|
+
{
|
|
1739
|
+
ref,
|
|
1740
|
+
className: "py-6 text-center text-sm text-text-tertiary",
|
|
1741
|
+
...props
|
|
1742
|
+
}
|
|
1743
|
+
));
|
|
1744
|
+
CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
|
|
1745
|
+
var CommandGroup = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx38(
|
|
1746
|
+
CommandPrimitive.Group,
|
|
1747
|
+
{
|
|
1748
|
+
ref,
|
|
1749
|
+
className: cn(
|
|
1750
|
+
"overflow-hidden p-1 text-text-primary [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-text-tertiary",
|
|
1751
|
+
className
|
|
1752
|
+
),
|
|
1753
|
+
...props
|
|
1754
|
+
}
|
|
1755
|
+
));
|
|
1756
|
+
CommandGroup.displayName = CommandPrimitive.Group.displayName;
|
|
1757
|
+
var CommandSeparator = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx38(
|
|
1758
|
+
CommandPrimitive.Separator,
|
|
1759
|
+
{
|
|
1760
|
+
ref,
|
|
1761
|
+
className: cn("-mx-1 h-px bg-border-subtle", className),
|
|
1762
|
+
...props
|
|
1763
|
+
}
|
|
1764
|
+
));
|
|
1765
|
+
CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
|
|
1766
|
+
var CommandItem = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx38(
|
|
1767
|
+
CommandPrimitive.Item,
|
|
1768
|
+
{
|
|
1769
|
+
ref,
|
|
1770
|
+
className: cn(
|
|
1771
|
+
"relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-bg-secondary data-[selected=true]:text-text-primary",
|
|
1772
|
+
className
|
|
1773
|
+
),
|
|
1774
|
+
...props
|
|
1775
|
+
}
|
|
1776
|
+
));
|
|
1777
|
+
CommandItem.displayName = CommandPrimitive.Item.displayName;
|
|
1778
|
+
var CommandShortcut = ({ className, ...props }) => /* @__PURE__ */ jsx38(
|
|
1779
|
+
"span",
|
|
1780
|
+
{
|
|
1781
|
+
className: cn("ml-auto text-xs tracking-widest text-text-tertiary", className),
|
|
1782
|
+
...props
|
|
1783
|
+
}
|
|
1784
|
+
);
|
|
1785
|
+
CommandShortcut.displayName = "CommandShortcut";
|
|
1786
|
+
|
|
1787
|
+
// src/components/navigation-menu.tsx
|
|
1788
|
+
import * as React36 from "react";
|
|
1789
|
+
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
|
|
1790
|
+
import { cva as cva7 } from "class-variance-authority";
|
|
1791
|
+
import { ChevronDown as ChevronDown3 } from "lucide-react";
|
|
1792
|
+
import { jsx as jsx39, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1793
|
+
var NavigationMenu = React36.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs17(
|
|
1794
|
+
NavigationMenuPrimitive.Root,
|
|
1795
|
+
{
|
|
1796
|
+
ref,
|
|
1797
|
+
className: cn("relative z-10 flex max-w-max flex-1 items-center justify-center", className),
|
|
1798
|
+
...props,
|
|
1799
|
+
children: [
|
|
1800
|
+
children,
|
|
1801
|
+
/* @__PURE__ */ jsx39(NavigationMenuViewport, {})
|
|
1802
|
+
]
|
|
1803
|
+
}
|
|
1804
|
+
));
|
|
1805
|
+
NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;
|
|
1806
|
+
var NavigationMenuList = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx39(
|
|
1807
|
+
NavigationMenuPrimitive.List,
|
|
1808
|
+
{
|
|
1809
|
+
ref,
|
|
1810
|
+
className: cn("group flex flex-1 list-none items-center justify-center gap-1", className),
|
|
1811
|
+
...props
|
|
1812
|
+
}
|
|
1813
|
+
));
|
|
1814
|
+
NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName;
|
|
1815
|
+
var NavigationMenuItem = NavigationMenuPrimitive.Item;
|
|
1816
|
+
var navigationMenuTriggerStyle = cva7(
|
|
1817
|
+
"group inline-flex h-10 w-max items-center justify-center rounded-md bg-bg-elevated px-4 py-2 text-sm font-medium transition-colors hover:bg-bg-secondary hover:text-text-primary focus:bg-bg-secondary focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=open]:bg-bg-secondary"
|
|
1818
|
+
);
|
|
1819
|
+
var NavigationMenuTrigger = React36.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs17(
|
|
1820
|
+
NavigationMenuPrimitive.Trigger,
|
|
1821
|
+
{
|
|
1822
|
+
ref,
|
|
1823
|
+
className: cn(navigationMenuTriggerStyle(), "group", className),
|
|
1824
|
+
...props,
|
|
1825
|
+
children: [
|
|
1826
|
+
children,
|
|
1827
|
+
" ",
|
|
1828
|
+
/* @__PURE__ */ jsx39(
|
|
1829
|
+
ChevronDown3,
|
|
1830
|
+
{
|
|
1831
|
+
className: "relative top-[1px] ml-1 h-4 w-4 transition duration-200 group-data-[state=open]:rotate-180",
|
|
1832
|
+
"aria-hidden": "true"
|
|
1833
|
+
}
|
|
1834
|
+
)
|
|
1835
|
+
]
|
|
1836
|
+
}
|
|
1837
|
+
));
|
|
1838
|
+
NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;
|
|
1839
|
+
var NavigationMenuContent = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx39(
|
|
1840
|
+
NavigationMenuPrimitive.Content,
|
|
1841
|
+
{
|
|
1842
|
+
ref,
|
|
1843
|
+
className: cn(
|
|
1844
|
+
"left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto",
|
|
1845
|
+
className
|
|
1846
|
+
),
|
|
1847
|
+
...props
|
|
1848
|
+
}
|
|
1849
|
+
));
|
|
1850
|
+
NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;
|
|
1851
|
+
var NavigationMenuLink = NavigationMenuPrimitive.Link;
|
|
1852
|
+
var NavigationMenuViewport = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx39("div", { className: cn("absolute left-0 top-full flex justify-center"), children: /* @__PURE__ */ jsx39(
|
|
1853
|
+
NavigationMenuPrimitive.Viewport,
|
|
1854
|
+
{
|
|
1855
|
+
ref,
|
|
1856
|
+
className: cn(
|
|
1857
|
+
"origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border border-border-subtle bg-bg-elevated text-text-primary shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",
|
|
1858
|
+
className
|
|
1859
|
+
),
|
|
1860
|
+
...props
|
|
1861
|
+
}
|
|
1862
|
+
) }));
|
|
1863
|
+
NavigationMenuViewport.displayName = NavigationMenuPrimitive.Viewport.displayName;
|
|
1864
|
+
var NavigationMenuIndicator = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx39(
|
|
1865
|
+
NavigationMenuPrimitive.Indicator,
|
|
1866
|
+
{
|
|
1867
|
+
ref,
|
|
1868
|
+
className: cn(
|
|
1869
|
+
"top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",
|
|
1870
|
+
className
|
|
1871
|
+
),
|
|
1872
|
+
...props,
|
|
1873
|
+
children: /* @__PURE__ */ jsx39("div", { className: "relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border-subtle shadow-md" })
|
|
1874
|
+
}
|
|
1875
|
+
));
|
|
1876
|
+
NavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayName;
|
|
1877
|
+
|
|
1878
|
+
// src/hooks/useTheme.ts
|
|
1879
|
+
import { useEffect, useState, useCallback } from "react";
|
|
1880
|
+
var STORAGE_KEY = "lessly_theme";
|
|
1881
|
+
function getSystemTheme() {
|
|
1882
|
+
if (typeof window === "undefined") return "dark";
|
|
1883
|
+
return window.matchMedia("(prefers-color-scheme: light)").matches ? "light" : "dark";
|
|
1884
|
+
}
|
|
1885
|
+
function resolveTheme(theme) {
|
|
1886
|
+
return theme === "system" ? getSystemTheme() : theme;
|
|
1887
|
+
}
|
|
1888
|
+
function applyTheme(resolved) {
|
|
1889
|
+
const root = document.documentElement;
|
|
1890
|
+
if (resolved === "light") {
|
|
1891
|
+
root.classList.add("light");
|
|
1892
|
+
root.classList.remove("dark");
|
|
1893
|
+
} else {
|
|
1894
|
+
root.classList.remove("light");
|
|
1895
|
+
root.classList.add("dark");
|
|
1896
|
+
}
|
|
1897
|
+
}
|
|
1898
|
+
function useTheme() {
|
|
1899
|
+
const [theme, setThemeState] = useState(() => {
|
|
1900
|
+
const stored = localStorage.getItem(STORAGE_KEY);
|
|
1901
|
+
return stored || "system";
|
|
1902
|
+
});
|
|
1903
|
+
const resolvedTheme = resolveTheme(theme);
|
|
1904
|
+
const setTheme = useCallback((newTheme) => {
|
|
1905
|
+
setThemeState(newTheme);
|
|
1906
|
+
localStorage.setItem(STORAGE_KEY, newTheme);
|
|
1907
|
+
applyTheme(resolveTheme(newTheme));
|
|
1908
|
+
window.dispatchEvent(new CustomEvent("lessly-theme-change", { detail: newTheme }));
|
|
1909
|
+
}, []);
|
|
1910
|
+
useEffect(() => {
|
|
1911
|
+
applyTheme(resolvedTheme);
|
|
1912
|
+
}, [resolvedTheme]);
|
|
1913
|
+
useEffect(() => {
|
|
1914
|
+
const handler = (e) => {
|
|
1915
|
+
const newTheme = e.detail;
|
|
1916
|
+
setThemeState(newTheme);
|
|
1917
|
+
};
|
|
1918
|
+
window.addEventListener("lessly-theme-change", handler);
|
|
1919
|
+
return () => window.removeEventListener("lessly-theme-change", handler);
|
|
1920
|
+
}, []);
|
|
1921
|
+
useEffect(() => {
|
|
1922
|
+
if (theme !== "system") return;
|
|
1923
|
+
const mql = window.matchMedia("(prefers-color-scheme: light)");
|
|
1924
|
+
const handler = () => applyTheme(getSystemTheme());
|
|
1925
|
+
mql.addEventListener("change", handler);
|
|
1926
|
+
return () => mql.removeEventListener("change", handler);
|
|
1927
|
+
}, [theme]);
|
|
1928
|
+
return { theme, setTheme, resolvedTheme };
|
|
1929
|
+
}
|
|
1930
|
+
|
|
1931
|
+
// src/components/sonner.tsx
|
|
1932
|
+
import { Toaster as SonnerToaster, toast } from "sonner";
|
|
1933
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
1934
|
+
var Toaster = ({ ...props }) => {
|
|
1935
|
+
const { resolvedTheme } = useTheme();
|
|
1936
|
+
return /* @__PURE__ */ jsx40(
|
|
1937
|
+
SonnerToaster,
|
|
1938
|
+
{
|
|
1939
|
+
theme: resolvedTheme,
|
|
1940
|
+
className: "toaster group",
|
|
1941
|
+
toastOptions: {
|
|
1942
|
+
classNames: {
|
|
1943
|
+
toast: "group toast bg-bg-elevated border border-border-subtle text-text-primary shadow-lg",
|
|
1944
|
+
description: "text-text-secondary",
|
|
1945
|
+
actionButton: "bg-blue-400 text-text-on-brand",
|
|
1946
|
+
cancelButton: "bg-bg-secondary text-text-primary"
|
|
1947
|
+
}
|
|
1948
|
+
},
|
|
1949
|
+
...props
|
|
1950
|
+
}
|
|
1951
|
+
);
|
|
1952
|
+
};
|
|
1953
|
+
|
|
1954
|
+
// src/theme/ThemeToggle.tsx
|
|
1955
|
+
import { Sun, Moon, Monitor } from "lucide-react";
|
|
1956
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
1957
|
+
var icons = {
|
|
1958
|
+
light: Sun,
|
|
1959
|
+
dark: Moon,
|
|
1960
|
+
system: Monitor
|
|
1961
|
+
};
|
|
1962
|
+
var nextTheme = {
|
|
1963
|
+
system: "light",
|
|
1964
|
+
light: "dark",
|
|
1965
|
+
dark: "system"
|
|
1966
|
+
};
|
|
1967
|
+
function ThemeToggle() {
|
|
1968
|
+
const { theme, setTheme } = useTheme();
|
|
1969
|
+
const Icon = icons[theme];
|
|
1970
|
+
return /* @__PURE__ */ jsx41(
|
|
1971
|
+
"button",
|
|
1972
|
+
{
|
|
1973
|
+
onClick: () => setTheme(nextTheme[theme]),
|
|
1974
|
+
className: "p-2 rounded-lg text-text-secondary hover:bg-bg-secondary transition-colors",
|
|
1975
|
+
"aria-label": `Switch to ${nextTheme[theme]} theme`,
|
|
1976
|
+
title: `Theme: ${theme}`,
|
|
1977
|
+
children: /* @__PURE__ */ jsx41(Icon, { className: "w-4 h-4" })
|
|
1978
|
+
}
|
|
1979
|
+
);
|
|
1980
|
+
}
|
|
1981
|
+
|
|
1982
|
+
// src/components/calendar.tsx
|
|
1983
|
+
import { ChevronLeft as ChevronLeft2, ChevronRight as ChevronRight6 } from "lucide-react";
|
|
1984
|
+
import { DayPicker } from "react-day-picker";
|
|
1985
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
1986
|
+
function Calendar({ className, classNames, showOutsideDays = true, ...props }) {
|
|
1987
|
+
return /* @__PURE__ */ jsx42(
|
|
1988
|
+
DayPicker,
|
|
1989
|
+
{
|
|
1990
|
+
showOutsideDays,
|
|
1991
|
+
className: cn("p-3", className),
|
|
1992
|
+
classNames: {
|
|
1993
|
+
months: "flex flex-col sm:flex-row gap-4",
|
|
1994
|
+
month: "flex flex-col gap-4",
|
|
1995
|
+
month_caption: "flex justify-center pt-1 relative items-center h-9",
|
|
1996
|
+
caption_label: "text-sm font-medium text-text-primary",
|
|
1997
|
+
nav: "flex items-center gap-1 absolute inset-x-0 top-1 justify-between px-1",
|
|
1998
|
+
button_previous: cn(
|
|
1999
|
+
buttonVariants({ variant: "outline" }),
|
|
2000
|
+
"size-7 p-0 opacity-70 hover:opacity-100"
|
|
2001
|
+
),
|
|
2002
|
+
button_next: cn(
|
|
2003
|
+
buttonVariants({ variant: "outline" }),
|
|
2004
|
+
"size-7 p-0 opacity-70 hover:opacity-100"
|
|
2005
|
+
),
|
|
2006
|
+
month_grid: "w-full border-collapse space-y-1",
|
|
2007
|
+
weekdays: "flex",
|
|
2008
|
+
weekday: "text-text-tertiary rounded-md w-9 font-normal text-xs",
|
|
2009
|
+
week: "flex w-full mt-2",
|
|
2010
|
+
day: "relative p-0 text-center text-sm focus-within:relative focus-within:z-20",
|
|
2011
|
+
day_button: cn(
|
|
2012
|
+
"inline-flex size-9 items-center justify-center rounded-md p-0 font-normal text-text-primary transition-colors",
|
|
2013
|
+
"hover:bg-bg-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
2014
|
+
"aria-selected:opacity-100"
|
|
2015
|
+
),
|
|
2016
|
+
selected: "[&>button]:bg-blue-400 [&>button]:text-text-on-brand [&>button]:hover:bg-blue-350 [&>button]:hover:text-text-on-brand",
|
|
2017
|
+
// Scope today's surface to non-selected buttons so a selected "today"
|
|
2018
|
+
// keeps the brand fill (rdp sets aria-selected on the selected button)
|
|
2019
|
+
// rather than colliding at equal specificity.
|
|
2020
|
+
today: '[&>button:not([aria-selected="true"])]:bg-bg-secondary [&>button:not([aria-selected="true"])]:text-text-primary',
|
|
2021
|
+
outside: "[&>button]:text-text-tertiary [&>button]:opacity-50",
|
|
2022
|
+
disabled: "[&>button]:text-text-disabled [&>button]:opacity-50",
|
|
2023
|
+
range_start: "[&>button]:bg-blue-400 [&>button]:text-text-on-brand rounded-l-md",
|
|
2024
|
+
range_end: "[&>button]:bg-blue-400 [&>button]:text-text-on-brand rounded-r-md",
|
|
2025
|
+
range_middle: "[&>button]:bg-bg-secondary [&>button]:text-text-primary [&>button]:rounded-none",
|
|
2026
|
+
hidden: "invisible",
|
|
2027
|
+
...classNames
|
|
2028
|
+
},
|
|
2029
|
+
components: {
|
|
2030
|
+
Chevron: ({ className: cls, orientation, ...rest }) => orientation === "left" ? /* @__PURE__ */ jsx42(ChevronLeft2, { className: cn("size-4", cls), ...rest }) : /* @__PURE__ */ jsx42(ChevronRight6, { className: cn("size-4", cls), ...rest })
|
|
2031
|
+
},
|
|
2032
|
+
...props
|
|
2033
|
+
}
|
|
2034
|
+
);
|
|
2035
|
+
}
|
|
2036
|
+
Calendar.displayName = "Calendar";
|
|
2037
|
+
|
|
2038
|
+
// src/components/date-picker.tsx
|
|
2039
|
+
import * as React37 from "react";
|
|
2040
|
+
import { Calendar as CalendarIcon } from "lucide-react";
|
|
2041
|
+
import { jsx as jsx43, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2042
|
+
var DEFAULT_FORMAT = {
|
|
2043
|
+
year: "numeric",
|
|
2044
|
+
month: "long",
|
|
2045
|
+
day: "numeric"
|
|
2046
|
+
};
|
|
2047
|
+
function DatePicker({
|
|
2048
|
+
value,
|
|
2049
|
+
onValueChange,
|
|
2050
|
+
placeholder = "Pick a date",
|
|
2051
|
+
disabled,
|
|
2052
|
+
className
|
|
2053
|
+
}) {
|
|
2054
|
+
const [open, setOpen] = React37.useState(false);
|
|
2055
|
+
return /* @__PURE__ */ jsxs18(Popover, { open, onOpenChange: setOpen, children: [
|
|
2056
|
+
/* @__PURE__ */ jsx43(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs18(
|
|
2057
|
+
Button,
|
|
2058
|
+
{
|
|
2059
|
+
type: "button",
|
|
2060
|
+
variant: "outline",
|
|
2061
|
+
disabled,
|
|
2062
|
+
className: cn("w-[240px] justify-start gap-2 text-left font-normal", !value && "text-text-tertiary", className),
|
|
2063
|
+
children: [
|
|
2064
|
+
/* @__PURE__ */ jsx43(CalendarIcon, { className: "size-4 shrink-0" }),
|
|
2065
|
+
value ? value.toLocaleDateString(void 0, DEFAULT_FORMAT) : placeholder
|
|
2066
|
+
]
|
|
2067
|
+
}
|
|
2068
|
+
) }),
|
|
2069
|
+
/* @__PURE__ */ jsx43(PopoverContent, { className: "w-auto p-0", align: "start", children: /* @__PURE__ */ jsx43(
|
|
2070
|
+
Calendar,
|
|
2071
|
+
{
|
|
2072
|
+
mode: "single",
|
|
2073
|
+
selected: value,
|
|
2074
|
+
defaultMonth: value,
|
|
2075
|
+
onSelect: (date) => {
|
|
2076
|
+
onValueChange(date);
|
|
2077
|
+
setOpen(false);
|
|
2078
|
+
}
|
|
2079
|
+
}
|
|
2080
|
+
) })
|
|
2081
|
+
] });
|
|
2082
|
+
}
|
|
2083
|
+
DatePicker.displayName = "DatePicker";
|
|
2084
|
+
|
|
2085
|
+
// src/components/carousel.tsx
|
|
2086
|
+
import * as React38 from "react";
|
|
2087
|
+
import useEmblaCarousel from "embla-carousel-react";
|
|
2088
|
+
import { ArrowLeft, ArrowRight } from "lucide-react";
|
|
2089
|
+
import { jsx as jsx44, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2090
|
+
var CarouselContext = React38.createContext(null);
|
|
2091
|
+
function useCarousel() {
|
|
2092
|
+
const context = React38.useContext(CarouselContext);
|
|
2093
|
+
if (!context) throw new Error("useCarousel must be used within a <Carousel />");
|
|
2094
|
+
return context;
|
|
2095
|
+
}
|
|
2096
|
+
var Carousel = React38.forwardRef(({ orientation = "horizontal", opts, setApi, plugins, className, children, ...props }, ref) => {
|
|
2097
|
+
const [carouselRef, api] = useEmblaCarousel(
|
|
2098
|
+
{ ...opts, axis: orientation === "horizontal" ? "x" : "y" },
|
|
2099
|
+
plugins
|
|
2100
|
+
);
|
|
2101
|
+
const [canScrollPrev, setCanScrollPrev] = React38.useState(false);
|
|
2102
|
+
const [canScrollNext, setCanScrollNext] = React38.useState(false);
|
|
2103
|
+
const onSelect = React38.useCallback((emblaApi) => {
|
|
2104
|
+
if (!emblaApi) return;
|
|
2105
|
+
setCanScrollPrev(emblaApi.canScrollPrev());
|
|
2106
|
+
setCanScrollNext(emblaApi.canScrollNext());
|
|
2107
|
+
}, []);
|
|
2108
|
+
const scrollPrev = React38.useCallback(() => api?.scrollPrev(), [api]);
|
|
2109
|
+
const scrollNext = React38.useCallback(() => api?.scrollNext(), [api]);
|
|
2110
|
+
const handleKeyDown = React38.useCallback(
|
|
2111
|
+
(event) => {
|
|
2112
|
+
if (event.key === "ArrowLeft") {
|
|
2113
|
+
event.preventDefault();
|
|
2114
|
+
scrollPrev();
|
|
2115
|
+
} else if (event.key === "ArrowRight") {
|
|
2116
|
+
event.preventDefault();
|
|
2117
|
+
scrollNext();
|
|
2118
|
+
}
|
|
2119
|
+
},
|
|
2120
|
+
[scrollPrev, scrollNext]
|
|
2121
|
+
);
|
|
2122
|
+
React38.useEffect(() => {
|
|
2123
|
+
if (!api || !setApi) return;
|
|
2124
|
+
setApi(api);
|
|
2125
|
+
}, [api, setApi]);
|
|
2126
|
+
React38.useEffect(() => {
|
|
2127
|
+
if (!api) return;
|
|
2128
|
+
onSelect(api);
|
|
2129
|
+
api.on("reInit", onSelect);
|
|
2130
|
+
api.on("select", onSelect);
|
|
2131
|
+
return () => {
|
|
2132
|
+
api.off("reInit", onSelect);
|
|
2133
|
+
api.off("select", onSelect);
|
|
2134
|
+
};
|
|
2135
|
+
}, [api, onSelect]);
|
|
2136
|
+
return /* @__PURE__ */ jsx44(
|
|
2137
|
+
CarouselContext.Provider,
|
|
2138
|
+
{
|
|
2139
|
+
value: {
|
|
2140
|
+
carouselRef,
|
|
2141
|
+
api,
|
|
2142
|
+
opts,
|
|
2143
|
+
orientation: orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
|
|
2144
|
+
scrollPrev,
|
|
2145
|
+
scrollNext,
|
|
2146
|
+
canScrollPrev,
|
|
2147
|
+
canScrollNext
|
|
2148
|
+
},
|
|
2149
|
+
children: /* @__PURE__ */ jsx44(
|
|
2150
|
+
"div",
|
|
2151
|
+
{
|
|
2152
|
+
ref,
|
|
2153
|
+
onKeyDownCapture: handleKeyDown,
|
|
2154
|
+
className: cn("relative", className),
|
|
2155
|
+
role: "region",
|
|
2156
|
+
"aria-roledescription": "carousel",
|
|
2157
|
+
...props,
|
|
2158
|
+
children
|
|
2159
|
+
}
|
|
2160
|
+
)
|
|
2161
|
+
}
|
|
2162
|
+
);
|
|
2163
|
+
});
|
|
2164
|
+
Carousel.displayName = "Carousel";
|
|
2165
|
+
var CarouselContent = React38.forwardRef(
|
|
2166
|
+
({ className, ...props }, ref) => {
|
|
2167
|
+
const { carouselRef, orientation } = useCarousel();
|
|
2168
|
+
return /* @__PURE__ */ jsx44("div", { ref: carouselRef, className: "overflow-hidden", children: /* @__PURE__ */ jsx44(
|
|
2169
|
+
"div",
|
|
2170
|
+
{
|
|
2171
|
+
ref,
|
|
2172
|
+
className: cn("flex", orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col", className),
|
|
2173
|
+
...props
|
|
2174
|
+
}
|
|
2175
|
+
) });
|
|
2176
|
+
}
|
|
2177
|
+
);
|
|
2178
|
+
CarouselContent.displayName = "CarouselContent";
|
|
2179
|
+
var CarouselItem = React38.forwardRef(
|
|
2180
|
+
({ className, ...props }, ref) => {
|
|
2181
|
+
const { orientation } = useCarousel();
|
|
2182
|
+
return /* @__PURE__ */ jsx44(
|
|
2183
|
+
"div",
|
|
2184
|
+
{
|
|
2185
|
+
ref,
|
|
2186
|
+
role: "group",
|
|
2187
|
+
"aria-roledescription": "slide",
|
|
2188
|
+
className: cn(
|
|
2189
|
+
"min-w-0 shrink-0 grow-0 basis-full",
|
|
2190
|
+
orientation === "horizontal" ? "pl-4" : "pt-4",
|
|
2191
|
+
className
|
|
2192
|
+
),
|
|
2193
|
+
...props
|
|
2194
|
+
}
|
|
2195
|
+
);
|
|
2196
|
+
}
|
|
2197
|
+
);
|
|
2198
|
+
CarouselItem.displayName = "CarouselItem";
|
|
2199
|
+
var CarouselPrevious = React38.forwardRef(({ className, ...props }, ref) => {
|
|
2200
|
+
const { orientation, scrollPrev, canScrollPrev } = useCarousel();
|
|
2201
|
+
return /* @__PURE__ */ jsxs19(
|
|
2202
|
+
"button",
|
|
2203
|
+
{
|
|
2204
|
+
ref,
|
|
2205
|
+
type: "button",
|
|
2206
|
+
className: cn(
|
|
2207
|
+
buttonVariants({ variant: "outline" }),
|
|
2208
|
+
"absolute size-8 rounded-full p-0",
|
|
2209
|
+
orientation === "horizontal" ? "-left-12 top-1/2 -translate-y-1/2" : "-top-12 left-1/2 -translate-x-1/2 rotate-90",
|
|
2210
|
+
className
|
|
2211
|
+
),
|
|
2212
|
+
disabled: !canScrollPrev,
|
|
2213
|
+
onClick: scrollPrev,
|
|
2214
|
+
...props,
|
|
2215
|
+
children: [
|
|
2216
|
+
/* @__PURE__ */ jsx44(ArrowLeft, { className: "size-4" }),
|
|
2217
|
+
/* @__PURE__ */ jsx44("span", { className: "sr-only", children: "Previous slide" })
|
|
2218
|
+
]
|
|
2219
|
+
}
|
|
2220
|
+
);
|
|
2221
|
+
});
|
|
2222
|
+
CarouselPrevious.displayName = "CarouselPrevious";
|
|
2223
|
+
var CarouselNext = React38.forwardRef(({ className, ...props }, ref) => {
|
|
2224
|
+
const { orientation, scrollNext, canScrollNext } = useCarousel();
|
|
2225
|
+
return /* @__PURE__ */ jsxs19(
|
|
2226
|
+
"button",
|
|
2227
|
+
{
|
|
2228
|
+
ref,
|
|
2229
|
+
type: "button",
|
|
2230
|
+
className: cn(
|
|
2231
|
+
buttonVariants({ variant: "outline" }),
|
|
2232
|
+
"absolute size-8 rounded-full p-0",
|
|
2233
|
+
orientation === "horizontal" ? "-right-12 top-1/2 -translate-y-1/2" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
|
|
2234
|
+
className
|
|
2235
|
+
),
|
|
2236
|
+
disabled: !canScrollNext,
|
|
2237
|
+
onClick: scrollNext,
|
|
2238
|
+
...props,
|
|
2239
|
+
children: [
|
|
2240
|
+
/* @__PURE__ */ jsx44(ArrowRight, { className: "size-4" }),
|
|
2241
|
+
/* @__PURE__ */ jsx44("span", { className: "sr-only", children: "Next slide" })
|
|
2242
|
+
]
|
|
2243
|
+
}
|
|
2244
|
+
);
|
|
2245
|
+
});
|
|
2246
|
+
CarouselNext.displayName = "CarouselNext";
|
|
2247
|
+
|
|
2248
|
+
// src/components/form.tsx
|
|
2249
|
+
import * as React39 from "react";
|
|
2250
|
+
import { Slot as Slot3 } from "@radix-ui/react-slot";
|
|
2251
|
+
import {
|
|
2252
|
+
Controller,
|
|
2253
|
+
FormProvider,
|
|
2254
|
+
useFormContext,
|
|
2255
|
+
useFormState
|
|
2256
|
+
} from "react-hook-form";
|
|
2257
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
2258
|
+
var Form = FormProvider;
|
|
2259
|
+
var FormFieldContext = React39.createContext(null);
|
|
2260
|
+
function FormField({ ...props }) {
|
|
2261
|
+
return /* @__PURE__ */ jsx45(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsx45(Controller, { ...props }) });
|
|
2262
|
+
}
|
|
2263
|
+
var FormItemContext = React39.createContext(null);
|
|
2264
|
+
function useFormField() {
|
|
2265
|
+
const fieldContext = React39.useContext(FormFieldContext);
|
|
2266
|
+
const itemContext = React39.useContext(FormItemContext);
|
|
2267
|
+
const { getFieldState } = useFormContext();
|
|
2268
|
+
const formState = useFormState({ name: fieldContext?.name });
|
|
2269
|
+
if (!fieldContext) throw new Error("useFormField should be used within <FormField>");
|
|
2270
|
+
const fieldState = getFieldState(fieldContext.name, formState);
|
|
2271
|
+
const { id } = itemContext ?? { id: "" };
|
|
2272
|
+
return {
|
|
2273
|
+
id,
|
|
2274
|
+
name: fieldContext.name,
|
|
2275
|
+
formItemId: `${id}-form-item`,
|
|
2276
|
+
formDescriptionId: `${id}-form-item-description`,
|
|
2277
|
+
formMessageId: `${id}-form-item-message`,
|
|
2278
|
+
...fieldState
|
|
2279
|
+
};
|
|
2280
|
+
}
|
|
2281
|
+
var FormItem = React39.forwardRef(
|
|
2282
|
+
({ className, ...props }, ref) => {
|
|
2283
|
+
const id = React39.useId();
|
|
2284
|
+
return /* @__PURE__ */ jsx45(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsx45("div", { ref, className: cn("space-y-2", className), ...props }) });
|
|
2285
|
+
}
|
|
2286
|
+
);
|
|
2287
|
+
FormItem.displayName = "FormItem";
|
|
2288
|
+
var FormLabel = React39.forwardRef(({ className, ...props }, ref) => {
|
|
2289
|
+
const { error, formItemId } = useFormField();
|
|
2290
|
+
return /* @__PURE__ */ jsx45(
|
|
2291
|
+
Label2,
|
|
2292
|
+
{
|
|
2293
|
+
ref,
|
|
2294
|
+
className: cn(error && "text-text-danger", className),
|
|
2295
|
+
htmlFor: formItemId,
|
|
2296
|
+
...props
|
|
2297
|
+
}
|
|
2298
|
+
);
|
|
2299
|
+
});
|
|
2300
|
+
FormLabel.displayName = "FormLabel";
|
|
2301
|
+
var FormControl = React39.forwardRef(({ ...props }, ref) => {
|
|
2302
|
+
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
2303
|
+
return /* @__PURE__ */ jsx45(
|
|
2304
|
+
Slot3,
|
|
2305
|
+
{
|
|
2306
|
+
ref,
|
|
2307
|
+
id: formItemId,
|
|
2308
|
+
"aria-describedby": !error ? formDescriptionId : `${formDescriptionId} ${formMessageId}`,
|
|
2309
|
+
"aria-invalid": !!error,
|
|
2310
|
+
...props
|
|
2311
|
+
}
|
|
2312
|
+
);
|
|
2313
|
+
});
|
|
2314
|
+
FormControl.displayName = "FormControl";
|
|
2315
|
+
var FormDescription = React39.forwardRef(({ className, ...props }, ref) => {
|
|
2316
|
+
const { formDescriptionId } = useFormField();
|
|
2317
|
+
return /* @__PURE__ */ jsx45(
|
|
2318
|
+
"p",
|
|
2319
|
+
{
|
|
2320
|
+
ref,
|
|
2321
|
+
id: formDescriptionId,
|
|
2322
|
+
className: cn("text-sm text-text-tertiary", className),
|
|
2323
|
+
...props
|
|
2324
|
+
}
|
|
2325
|
+
);
|
|
2326
|
+
});
|
|
2327
|
+
FormDescription.displayName = "FormDescription";
|
|
2328
|
+
var FormMessage = React39.forwardRef(({ className, children, ...props }, ref) => {
|
|
2329
|
+
const { error, formMessageId } = useFormField();
|
|
2330
|
+
const body = error ? String(error?.message ?? "") : children;
|
|
2331
|
+
if (!body) return null;
|
|
2332
|
+
return /* @__PURE__ */ jsx45(
|
|
2333
|
+
"p",
|
|
2334
|
+
{
|
|
2335
|
+
ref,
|
|
2336
|
+
id: formMessageId,
|
|
2337
|
+
className: cn("text-sm font-medium text-text-danger", className),
|
|
2338
|
+
...props,
|
|
2339
|
+
children: body
|
|
2340
|
+
}
|
|
2341
|
+
);
|
|
2342
|
+
});
|
|
2343
|
+
FormMessage.displayName = "FormMessage";
|
|
2344
|
+
|
|
2345
|
+
// src/components/status-dot.tsx
|
|
2346
|
+
import * as React40 from "react";
|
|
2347
|
+
import { cva as cva8 } from "class-variance-authority";
|
|
2348
|
+
import { jsx as jsx46, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2349
|
+
var statusDotVariants = cva8("inline-block shrink-0 rounded-full", {
|
|
2350
|
+
variants: {
|
|
2351
|
+
status: {
|
|
2352
|
+
success: "bg-bg-success",
|
|
2353
|
+
brand: "bg-blue-400",
|
|
2354
|
+
warning: "bg-bg-warning",
|
|
2355
|
+
danger: "bg-bg-danger",
|
|
2356
|
+
neutral: "bg-neutral-400"
|
|
2357
|
+
},
|
|
2358
|
+
size: { sm: "size-1.5", md: "size-2", lg: "size-2.5" }
|
|
2359
|
+
},
|
|
2360
|
+
defaultVariants: { status: "neutral", size: "md" }
|
|
2361
|
+
});
|
|
2362
|
+
var StatusDot = React40.forwardRef(
|
|
2363
|
+
({ className, status, size, pulse = false, ...props }, ref) => /* @__PURE__ */ jsxs20(
|
|
2364
|
+
"span",
|
|
2365
|
+
{
|
|
2366
|
+
ref,
|
|
2367
|
+
role: "status",
|
|
2368
|
+
"aria-label": status ?? "neutral",
|
|
2369
|
+
className: cn("relative inline-flex", className),
|
|
2370
|
+
...props,
|
|
2371
|
+
children: [
|
|
2372
|
+
pulse && /* @__PURE__ */ jsx46(
|
|
2373
|
+
"span",
|
|
2374
|
+
{
|
|
2375
|
+
"aria-hidden": "true",
|
|
2376
|
+
className: cn(statusDotVariants({ status, size }), "absolute inset-0 animate-ping opacity-75")
|
|
2377
|
+
}
|
|
2378
|
+
),
|
|
2379
|
+
/* @__PURE__ */ jsx46("span", { className: cn(statusDotVariants({ status, size })) })
|
|
2380
|
+
]
|
|
2381
|
+
}
|
|
2382
|
+
)
|
|
2383
|
+
);
|
|
2384
|
+
StatusDot.displayName = "StatusDot";
|
|
2385
|
+
|
|
2386
|
+
// src/components/docs-link.tsx
|
|
2387
|
+
import * as React41 from "react";
|
|
2388
|
+
import { BookOpen, ExternalLink } from "lucide-react";
|
|
2389
|
+
import { jsx as jsx47, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2390
|
+
var DocsLink = React41.forwardRef(
|
|
2391
|
+
({ href = "https://docs.lessly.com", label = "Docs", className, ...props }, ref) => /* @__PURE__ */ jsxs21(
|
|
2392
|
+
"a",
|
|
2393
|
+
{
|
|
2394
|
+
ref,
|
|
2395
|
+
href,
|
|
2396
|
+
target: "_blank",
|
|
2397
|
+
rel: "noreferrer noopener",
|
|
2398
|
+
className: cn(
|
|
2399
|
+
"inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-sm text-text-secondary transition-colors hover:bg-bg-secondary hover:text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
2400
|
+
className
|
|
2401
|
+
),
|
|
2402
|
+
...props,
|
|
2403
|
+
children: [
|
|
2404
|
+
/* @__PURE__ */ jsx47(BookOpen, { className: "size-4", "aria-hidden": "true" }),
|
|
2405
|
+
label,
|
|
2406
|
+
/* @__PURE__ */ jsx47(ExternalLink, { className: "size-3 text-text-tertiary", "aria-hidden": "true" })
|
|
2407
|
+
]
|
|
2408
|
+
}
|
|
2409
|
+
)
|
|
2410
|
+
);
|
|
2411
|
+
DocsLink.displayName = "DocsLink";
|
|
2412
|
+
|
|
2413
|
+
// src/components/empty-state.tsx
|
|
2414
|
+
import * as React42 from "react";
|
|
2415
|
+
import { jsx as jsx48, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2416
|
+
var EmptyState = React42.forwardRef(
|
|
2417
|
+
({ icon: Icon, title, description, action, className, ...props }, ref) => /* @__PURE__ */ jsxs22(
|
|
2418
|
+
"div",
|
|
2419
|
+
{
|
|
2420
|
+
ref,
|
|
2421
|
+
className: cn(
|
|
2422
|
+
"flex flex-col items-center justify-center rounded-xl border border-dashed border-border-default bg-bg-surface px-6 py-12 text-center",
|
|
2423
|
+
className
|
|
2424
|
+
),
|
|
2425
|
+
...props,
|
|
2426
|
+
children: [
|
|
2427
|
+
Icon && /* @__PURE__ */ jsx48("div", { className: "mb-4 flex size-11 items-center justify-center rounded-full bg-bg-secondary", children: /* @__PURE__ */ jsx48(Icon, { className: "size-5 text-icon-secondary", "aria-hidden": "true" }) }),
|
|
2428
|
+
/* @__PURE__ */ jsx48("p", { className: "text-base font-semibold text-text-primary", children: title }),
|
|
2429
|
+
description && /* @__PURE__ */ jsx48("p", { className: "mt-1 max-w-sm text-sm text-text-secondary", children: description }),
|
|
2430
|
+
action && /* @__PURE__ */ jsx48("div", { className: "mt-4", children: action })
|
|
2431
|
+
]
|
|
2432
|
+
}
|
|
2433
|
+
)
|
|
2434
|
+
);
|
|
2435
|
+
EmptyState.displayName = "EmptyState";
|
|
2436
|
+
|
|
2437
|
+
// src/components/copy-button.tsx
|
|
2438
|
+
import * as React43 from "react";
|
|
2439
|
+
import { Check as Check5, Copy } from "lucide-react";
|
|
2440
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
2441
|
+
var CopyButton = React43.forwardRef(
|
|
2442
|
+
({ value, label = "Copy", className, variant = "ghost", size = "icon", onClick, ...props }, ref) => {
|
|
2443
|
+
const [copied, setCopied] = React43.useState(false);
|
|
2444
|
+
const timer = React43.useRef(void 0);
|
|
2445
|
+
React43.useEffect(() => () => clearTimeout(timer.current), []);
|
|
2446
|
+
const handleClick = async (e) => {
|
|
2447
|
+
onClick?.(e);
|
|
2448
|
+
if (!navigator.clipboard?.writeText) return;
|
|
2449
|
+
try {
|
|
2450
|
+
await navigator.clipboard.writeText(value);
|
|
2451
|
+
setCopied(true);
|
|
2452
|
+
clearTimeout(timer.current);
|
|
2453
|
+
timer.current = setTimeout(() => setCopied(false), 1500);
|
|
2454
|
+
} catch {
|
|
2455
|
+
}
|
|
2456
|
+
};
|
|
2457
|
+
return /* @__PURE__ */ jsx49(
|
|
2458
|
+
Button,
|
|
2459
|
+
{
|
|
2460
|
+
ref,
|
|
2461
|
+
type: "button",
|
|
2462
|
+
variant,
|
|
2463
|
+
size,
|
|
2464
|
+
onClick: handleClick,
|
|
2465
|
+
className: cn(className),
|
|
2466
|
+
...props,
|
|
2467
|
+
"aria-label": copied ? "Copied" : label,
|
|
2468
|
+
children: copied ? /* @__PURE__ */ jsx49(Check5, { className: "size-4 text-text-success" }) : /* @__PURE__ */ jsx49(Copy, { className: "size-4" })
|
|
2469
|
+
}
|
|
2470
|
+
);
|
|
2471
|
+
}
|
|
2472
|
+
);
|
|
2473
|
+
CopyButton.displayName = "CopyButton";
|
|
2474
|
+
|
|
2475
|
+
// src/components/stat-card.tsx
|
|
2476
|
+
import * as React44 from "react";
|
|
2477
|
+
import { ArrowDown, ArrowUp, Info as Info2, Minus as Minus2 } from "lucide-react";
|
|
2478
|
+
import { jsx as jsx50, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2479
|
+
var directionIcons = {
|
|
2480
|
+
up: ArrowUp,
|
|
2481
|
+
down: ArrowDown,
|
|
2482
|
+
neutral: Minus2
|
|
2483
|
+
};
|
|
2484
|
+
var toneClasses = {
|
|
2485
|
+
positive: "text-text-success",
|
|
2486
|
+
negative: "text-text-danger",
|
|
2487
|
+
neutral: "text-text-tertiary"
|
|
2488
|
+
};
|
|
2489
|
+
var toneFromDirection = {
|
|
2490
|
+
up: "positive",
|
|
2491
|
+
down: "negative",
|
|
2492
|
+
neutral: "neutral"
|
|
2493
|
+
};
|
|
2494
|
+
var StatCard = React44.forwardRef(
|
|
2495
|
+
({ label, value, delta, hint, sub, icon: Icon, className, ...props }, ref) => {
|
|
2496
|
+
const direction = delta?.direction ?? "neutral";
|
|
2497
|
+
const tone = delta?.tone ?? toneFromDirection[direction];
|
|
2498
|
+
const DeltaIcon = directionIcons[direction];
|
|
2499
|
+
const deltaClass = toneClasses[tone];
|
|
2500
|
+
return /* @__PURE__ */ jsxs23(
|
|
2501
|
+
"div",
|
|
2502
|
+
{
|
|
2503
|
+
ref,
|
|
2504
|
+
className: cn("rounded-xl border border-border-subtle bg-bg-surface p-5", className),
|
|
2505
|
+
...props,
|
|
2506
|
+
children: [
|
|
2507
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex items-center justify-between gap-2", children: [
|
|
2508
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex items-center gap-1.5", children: [
|
|
2509
|
+
/* @__PURE__ */ jsx50("span", { className: "text-xs font-medium uppercase tracking-wide text-text-tertiary", children: label }),
|
|
2510
|
+
hint && /* @__PURE__ */ jsx50(TooltipProvider, { children: /* @__PURE__ */ jsxs23(Tooltip, { children: [
|
|
2511
|
+
/* @__PURE__ */ jsx50(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx50("button", { type: "button", "aria-label": "More info", className: "inline-flex cursor-help text-icon-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus rounded-sm", children: /* @__PURE__ */ jsx50(Info2, { className: "size-3.5", "aria-hidden": "true" }) }) }),
|
|
2512
|
+
/* @__PURE__ */ jsx50(TooltipContent, { children: hint })
|
|
2513
|
+
] }) })
|
|
2514
|
+
] }),
|
|
2515
|
+
Icon && /* @__PURE__ */ jsx50(Icon, { className: "size-4 text-icon-secondary", "aria-hidden": "true" })
|
|
2516
|
+
] }),
|
|
2517
|
+
/* @__PURE__ */ jsx50("div", { className: "mt-2 text-3xl font-semibold text-text-primary", children: value }),
|
|
2518
|
+
(delta || sub) && /* @__PURE__ */ jsxs23("div", { className: "mt-2 flex items-center gap-2 text-sm", children: [
|
|
2519
|
+
delta && /* @__PURE__ */ jsxs23("span", { className: cn("inline-flex items-center gap-0.5 font-medium", deltaClass), children: [
|
|
2520
|
+
/* @__PURE__ */ jsx50(DeltaIcon, { className: "size-3.5", "aria-hidden": "true" }),
|
|
2521
|
+
delta.value
|
|
2522
|
+
] }),
|
|
2523
|
+
sub && /* @__PURE__ */ jsx50("span", { className: "text-text-tertiary", children: sub })
|
|
2524
|
+
] })
|
|
2525
|
+
]
|
|
2526
|
+
}
|
|
2527
|
+
);
|
|
2528
|
+
}
|
|
2529
|
+
);
|
|
2530
|
+
StatCard.displayName = "StatCard";
|
|
2531
|
+
|
|
2532
|
+
// src/components/confirm-dialog.tsx
|
|
2533
|
+
import * as React45 from "react";
|
|
2534
|
+
import { Loader2 } from "lucide-react";
|
|
2535
|
+
import { jsx as jsx51, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2536
|
+
var InlineError = React45.forwardRef(
|
|
2537
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ jsx51(
|
|
2538
|
+
"div",
|
|
2539
|
+
{
|
|
2540
|
+
ref,
|
|
2541
|
+
role: "alert",
|
|
2542
|
+
className: cn(
|
|
2543
|
+
"rounded-md border border-border-danger bg-bg-danger-subtle px-3 py-2 text-sm text-text-danger",
|
|
2544
|
+
className
|
|
2545
|
+
),
|
|
2546
|
+
...props,
|
|
2547
|
+
children
|
|
2548
|
+
}
|
|
2549
|
+
)
|
|
2550
|
+
);
|
|
2551
|
+
InlineError.displayName = "InlineError";
|
|
2552
|
+
function ConfirmDialog({
|
|
2553
|
+
open,
|
|
2554
|
+
onOpenChange,
|
|
2555
|
+
trigger,
|
|
2556
|
+
title,
|
|
2557
|
+
description,
|
|
2558
|
+
confirmLabel = "Confirm",
|
|
2559
|
+
cancelLabel = "Cancel",
|
|
2560
|
+
destructive = false,
|
|
2561
|
+
onConfirm
|
|
2562
|
+
}) {
|
|
2563
|
+
const [internalOpen, setInternalOpen] = React45.useState(false);
|
|
2564
|
+
const isControlled = open !== void 0;
|
|
2565
|
+
const actualOpen = isControlled ? open : internalOpen;
|
|
2566
|
+
const [busy, setBusy] = React45.useState(false);
|
|
2567
|
+
const [error, setError] = React45.useState(null);
|
|
2568
|
+
React45.useEffect(() => {
|
|
2569
|
+
if (!actualOpen) setError(null);
|
|
2570
|
+
}, [actualOpen]);
|
|
2571
|
+
const setOpen = (next) => {
|
|
2572
|
+
if (!isControlled) setInternalOpen(next);
|
|
2573
|
+
onOpenChange?.(next);
|
|
2574
|
+
if (!next) setError(null);
|
|
2575
|
+
};
|
|
2576
|
+
const handleConfirm = async () => {
|
|
2577
|
+
setBusy(true);
|
|
2578
|
+
setError(null);
|
|
2579
|
+
try {
|
|
2580
|
+
await onConfirm();
|
|
2581
|
+
setOpen(false);
|
|
2582
|
+
} catch (e) {
|
|
2583
|
+
setError(e instanceof Error ? e.message : "Something went wrong");
|
|
2584
|
+
} finally {
|
|
2585
|
+
setBusy(false);
|
|
2586
|
+
}
|
|
2587
|
+
};
|
|
2588
|
+
return /* @__PURE__ */ jsxs24(Dialog, { open: actualOpen, onOpenChange: (next) => {
|
|
2589
|
+
if (!busy) setOpen(next);
|
|
2590
|
+
}, children: [
|
|
2591
|
+
trigger && /* @__PURE__ */ jsx51(DialogTrigger, { asChild: true, children: trigger }),
|
|
2592
|
+
/* @__PURE__ */ jsxs24(DialogContent, { children: [
|
|
2593
|
+
/* @__PURE__ */ jsxs24(DialogHeader, { children: [
|
|
2594
|
+
/* @__PURE__ */ jsx51(DialogTitle, { children: title }),
|
|
2595
|
+
description && /* @__PURE__ */ jsx51(DialogDescription, { children: description })
|
|
2596
|
+
] }),
|
|
2597
|
+
error && /* @__PURE__ */ jsx51(InlineError, { children: error }),
|
|
2598
|
+
/* @__PURE__ */ jsxs24(DialogFooter, { children: [
|
|
2599
|
+
/* @__PURE__ */ jsx51(Button, { variant: "outline", disabled: busy, onClick: () => setOpen(false), children: cancelLabel }),
|
|
2600
|
+
/* @__PURE__ */ jsxs24(Button, { variant: destructive ? "destructive" : "default", disabled: busy, onClick: handleConfirm, children: [
|
|
2601
|
+
busy && /* @__PURE__ */ jsx51(Loader2, { className: "size-4 animate-spin", "aria-hidden": "true" }),
|
|
2602
|
+
confirmLabel
|
|
2603
|
+
] })
|
|
2604
|
+
] })
|
|
2605
|
+
] })
|
|
2606
|
+
] });
|
|
2607
|
+
}
|
|
2608
|
+
|
|
2609
|
+
// src/components/user-menu.tsx
|
|
2610
|
+
import { ChevronsUpDown } from "lucide-react";
|
|
2611
|
+
import { Fragment, jsx as jsx52, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2612
|
+
function initialsOf(name) {
|
|
2613
|
+
const parts = name.trim().split(/\s+/).filter(Boolean);
|
|
2614
|
+
if (parts.length === 0) return "?";
|
|
2615
|
+
if (parts.length === 1) return parts[0].slice(0, 2).toUpperCase();
|
|
2616
|
+
return (parts[0][0] + parts[parts.length - 1][0]).toUpperCase();
|
|
2617
|
+
}
|
|
2618
|
+
function UserMenu({ user, items, collapsed = false, align = "end" }) {
|
|
2619
|
+
const avatar = /* @__PURE__ */ jsxs25(Avatar, { className: collapsed ? "size-9" : "size-8", children: [
|
|
2620
|
+
user.avatarUrl && /* @__PURE__ */ jsx52(AvatarImage, { src: user.avatarUrl, alt: user.name }),
|
|
2621
|
+
/* @__PURE__ */ jsx52(AvatarFallback, { className: "text-xs", children: initialsOf(user.name) })
|
|
2622
|
+
] });
|
|
2623
|
+
const trigger = collapsed ? /* @__PURE__ */ jsx52(
|
|
2624
|
+
"button",
|
|
2625
|
+
{
|
|
2626
|
+
type: "button",
|
|
2627
|
+
"aria-label": user.name,
|
|
2628
|
+
className: "rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
2629
|
+
children: avatar
|
|
2630
|
+
}
|
|
2631
|
+
) : /* @__PURE__ */ jsxs25(
|
|
2632
|
+
"button",
|
|
2633
|
+
{
|
|
2634
|
+
type: "button",
|
|
2635
|
+
className: "flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-bg-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
2636
|
+
children: [
|
|
2637
|
+
avatar,
|
|
2638
|
+
/* @__PURE__ */ jsxs25("span", { className: "min-w-0 flex-1", children: [
|
|
2639
|
+
/* @__PURE__ */ jsx52("span", { className: "block truncate text-sm font-medium text-text-primary", children: user.name }),
|
|
2640
|
+
user.email && /* @__PURE__ */ jsx52("span", { className: "block truncate text-xs text-text-tertiary", children: user.email })
|
|
2641
|
+
] }),
|
|
2642
|
+
/* @__PURE__ */ jsx52(ChevronsUpDown, { className: "size-4 shrink-0 text-icon-secondary", "aria-hidden": "true" })
|
|
2643
|
+
]
|
|
2644
|
+
}
|
|
2645
|
+
);
|
|
2646
|
+
const menuTrigger = /* @__PURE__ */ jsx52(DropdownMenuTrigger, { asChild: true, children: trigger });
|
|
2647
|
+
const menu = /* @__PURE__ */ jsxs25(DropdownMenu, { children: [
|
|
2648
|
+
collapsed ? /* @__PURE__ */ jsx52(TooltipProvider, { children: /* @__PURE__ */ jsxs25(Tooltip, { children: [
|
|
2649
|
+
/* @__PURE__ */ jsx52(TooltipTrigger, { asChild: true, children: menuTrigger }),
|
|
2650
|
+
/* @__PURE__ */ jsx52(TooltipContent, { side: "right", children: user.name })
|
|
2651
|
+
] }) }) : menuTrigger,
|
|
2652
|
+
/* @__PURE__ */ jsxs25(DropdownMenuContent, { align, className: "w-56", children: [
|
|
2653
|
+
/* @__PURE__ */ jsxs25(DropdownMenuLabel, { children: [
|
|
2654
|
+
/* @__PURE__ */ jsx52("span", { className: "block truncate text-sm font-medium text-text-primary", children: user.name }),
|
|
2655
|
+
user.email && /* @__PURE__ */ jsx52("span", { className: "block truncate text-xs font-normal text-text-tertiary", children: user.email })
|
|
2656
|
+
] }),
|
|
2657
|
+
/* @__PURE__ */ jsx52(DropdownMenuSeparator, {}),
|
|
2658
|
+
items.map((item, i) => {
|
|
2659
|
+
const Icon = item.icon;
|
|
2660
|
+
const content = /* @__PURE__ */ jsxs25(Fragment, { children: [
|
|
2661
|
+
Icon && /* @__PURE__ */ jsx52(Icon, { className: "size-4", "aria-hidden": "true" }),
|
|
2662
|
+
item.label
|
|
2663
|
+
] });
|
|
2664
|
+
return /* @__PURE__ */ jsx52(
|
|
2665
|
+
DropdownMenuItem,
|
|
2666
|
+
{
|
|
2667
|
+
onSelect: item.onSelect,
|
|
2668
|
+
className: cn("gap-2", item.destructive && "text-text-danger focus:text-text-danger"),
|
|
2669
|
+
asChild: Boolean(item.href),
|
|
2670
|
+
children: item.href ? /* @__PURE__ */ jsx52("a", { href: item.href, children: content }) : content
|
|
2671
|
+
},
|
|
2672
|
+
`${item.label}-${i}`
|
|
2673
|
+
);
|
|
2674
|
+
})
|
|
2675
|
+
] })
|
|
2676
|
+
] });
|
|
2677
|
+
return menu;
|
|
2678
|
+
}
|
|
2679
|
+
|
|
2680
|
+
// src/components/extension-link.tsx
|
|
2681
|
+
import { Link as Link2 } from "react-router";
|
|
2682
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
2683
|
+
function ExtensionLink({ uiMode, to, className, children, ...anchorProps }) {
|
|
2684
|
+
if (uiMode === "federation") {
|
|
2685
|
+
return /* @__PURE__ */ jsx53(Link2, { to, className, ...anchorProps, children });
|
|
2686
|
+
}
|
|
2687
|
+
return /* @__PURE__ */ jsx53("a", { href: to, className, ...anchorProps, children });
|
|
2688
|
+
}
|
|
2689
|
+
ExtensionLink.displayName = "ExtensionLink";
|
|
2690
|
+
|
|
2691
|
+
// src/components/extension-icon.tsx
|
|
2692
|
+
import * as React46 from "react";
|
|
2693
|
+
import * as LucideIcons from "lucide-react";
|
|
2694
|
+
import { Puzzle } from "lucide-react";
|
|
2695
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
2696
|
+
var FORWARD_REF = /* @__PURE__ */ Symbol.for("react.forward_ref");
|
|
2697
|
+
var catalog = LucideIcons;
|
|
2698
|
+
function toPascalCase(name) {
|
|
2699
|
+
return name.split("-").filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("");
|
|
2700
|
+
}
|
|
2701
|
+
function resolveIcon(name) {
|
|
2702
|
+
const exportName = toPascalCase(name);
|
|
2703
|
+
if (!exportName || exportName === "Icon") return void 0;
|
|
2704
|
+
const candidate = catalog[exportName];
|
|
2705
|
+
if (candidate != null && typeof candidate === "object" && candidate.$$typeof === FORWARD_REF) {
|
|
2706
|
+
return candidate;
|
|
2707
|
+
}
|
|
2708
|
+
return void 0;
|
|
2709
|
+
}
|
|
2710
|
+
function isKnownExtensionIcon(name) {
|
|
2711
|
+
return resolveIcon(name) !== void 0;
|
|
2712
|
+
}
|
|
2713
|
+
var warnedUnknownIcons = /* @__PURE__ */ new Set();
|
|
2714
|
+
function warnUnknownIconOnce(name) {
|
|
2715
|
+
if (process.env.NODE_ENV === "production") return;
|
|
2716
|
+
if (warnedUnknownIcons.has(name)) return;
|
|
2717
|
+
warnedUnknownIcons.add(name);
|
|
2718
|
+
console.warn(`[@lessly/ui] ExtensionIcon: unknown icon "${name}" \u2014 falling back to Puzzle.`);
|
|
2719
|
+
}
|
|
2720
|
+
var ExtensionIcon = React46.forwardRef(
|
|
2721
|
+
({ name, ...props }, ref) => {
|
|
2722
|
+
const Icon = resolveIcon(name);
|
|
2723
|
+
if (!Icon) {
|
|
2724
|
+
warnUnknownIconOnce(name);
|
|
2725
|
+
return /* @__PURE__ */ jsx54(Puzzle, { ref, ...props });
|
|
2726
|
+
}
|
|
2727
|
+
return /* @__PURE__ */ jsx54(Icon, { ref, ...props });
|
|
2728
|
+
}
|
|
2729
|
+
);
|
|
2730
|
+
ExtensionIcon.displayName = "ExtensionIcon";
|
|
2731
|
+
|
|
2732
|
+
// src/hooks/use-mobile.ts
|
|
2733
|
+
import { useEffect as useEffect5, useState as useState6 } from "react";
|
|
2734
|
+
var MD_BREAKPOINT = 768;
|
|
2735
|
+
function useIsMobile() {
|
|
2736
|
+
const [isMobile, setIsMobile] = useState6(
|
|
2737
|
+
typeof window !== "undefined" ? window.innerWidth < MD_BREAKPOINT : false
|
|
2738
|
+
);
|
|
2739
|
+
useEffect5(() => {
|
|
2740
|
+
const mql = window.matchMedia(`(max-width: ${String(MD_BREAKPOINT - 1)}px)`);
|
|
2741
|
+
const handler = (e) => {
|
|
2742
|
+
setIsMobile(e.matches);
|
|
2743
|
+
};
|
|
2744
|
+
mql.addEventListener("change", handler);
|
|
2745
|
+
setIsMobile(mql.matches);
|
|
2746
|
+
return () => {
|
|
2747
|
+
mql.removeEventListener("change", handler);
|
|
2748
|
+
};
|
|
2749
|
+
}, []);
|
|
2750
|
+
return isMobile;
|
|
2751
|
+
}
|
|
2752
|
+
|
|
2753
|
+
// src/hooks/use-sidebar.ts
|
|
2754
|
+
import { useCallback as useCallback3, useState as useState7 } from "react";
|
|
2755
|
+
function useSidebar(options = {}) {
|
|
2756
|
+
const { collapsed: controlled, defaultCollapsed = false, onCollapsedChange } = options;
|
|
2757
|
+
const isControlled = controlled !== void 0;
|
|
2758
|
+
const [internal, setInternal] = useState7(defaultCollapsed);
|
|
2759
|
+
const collapsed = isControlled ? controlled : internal;
|
|
2760
|
+
const setCollapsed = useCallback3(
|
|
2761
|
+
(next) => {
|
|
2762
|
+
if (!isControlled) setInternal(next);
|
|
2763
|
+
onCollapsedChange?.(next);
|
|
2764
|
+
},
|
|
2765
|
+
[isControlled, onCollapsedChange]
|
|
2766
|
+
);
|
|
2767
|
+
const toggle = useCallback3(() => {
|
|
2768
|
+
setCollapsed(!collapsed);
|
|
2769
|
+
}, [collapsed, setCollapsed]);
|
|
2770
|
+
return { collapsed, setCollapsed, toggle };
|
|
2771
|
+
}
|
|
2772
|
+
|
|
2773
|
+
// src/components/sidebar-nav.tsx
|
|
2774
|
+
import { Link as Link3, useLocation } from "react-router";
|
|
2775
|
+
import { jsx as jsx55, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2776
|
+
function isActivePath(pathname, full, exact) {
|
|
2777
|
+
if (exact) return pathname === full;
|
|
2778
|
+
return pathname === full || pathname.startsWith(`${full}/`);
|
|
2779
|
+
}
|
|
2780
|
+
function SidebarNavLink({
|
|
2781
|
+
item,
|
|
2782
|
+
collapsed = false,
|
|
2783
|
+
active = false,
|
|
2784
|
+
basePath = "",
|
|
2785
|
+
LinkComponent,
|
|
2786
|
+
className
|
|
2787
|
+
}) {
|
|
2788
|
+
const Comp = LinkComponent ?? Link3;
|
|
2789
|
+
const to = `${basePath}${item.href}`;
|
|
2790
|
+
const Icon = item.icon;
|
|
2791
|
+
const link = /* @__PURE__ */ jsxs26(
|
|
2792
|
+
Comp,
|
|
2793
|
+
{
|
|
2794
|
+
to,
|
|
2795
|
+
className: cn(
|
|
2796
|
+
"flex items-center rounded-lg text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
2797
|
+
collapsed ? "size-9 justify-center" : "w-full gap-2.5 px-2.5 py-[7px]",
|
|
2798
|
+
active ? "bg-bg-secondary font-medium text-text-brand" : "text-text-secondary hover:bg-bg-secondary hover:text-text-primary",
|
|
2799
|
+
className
|
|
2800
|
+
),
|
|
2801
|
+
"aria-current": active ? "page" : void 0,
|
|
2802
|
+
"aria-label": collapsed ? item.label : void 0,
|
|
2803
|
+
children: [
|
|
2804
|
+
Icon && /* @__PURE__ */ jsx55(Icon, { className: "size-[18px] shrink-0", "aria-hidden": "true" }),
|
|
2805
|
+
!collapsed && item.label
|
|
2806
|
+
]
|
|
2807
|
+
}
|
|
2808
|
+
);
|
|
2809
|
+
if (!collapsed) return link;
|
|
2810
|
+
return /* @__PURE__ */ jsxs26(Tooltip, { children: [
|
|
2811
|
+
/* @__PURE__ */ jsx55(TooltipTrigger, { asChild: true, children: link }),
|
|
2812
|
+
/* @__PURE__ */ jsx55(TooltipContent, { side: "right", children: item.label })
|
|
2813
|
+
] });
|
|
2814
|
+
}
|
|
2815
|
+
function SidebarNav({
|
|
2816
|
+
items,
|
|
2817
|
+
collapsed = false,
|
|
2818
|
+
basePath = "",
|
|
2819
|
+
LinkComponent,
|
|
2820
|
+
isItemActive,
|
|
2821
|
+
className
|
|
2822
|
+
}) {
|
|
2823
|
+
const { pathname } = useLocation();
|
|
2824
|
+
const nav = /* @__PURE__ */ jsx55(
|
|
2825
|
+
"nav",
|
|
2826
|
+
{
|
|
2827
|
+
className: cn(
|
|
2828
|
+
"flex flex-col gap-0.5",
|
|
2829
|
+
collapsed ? "items-center px-1" : "px-2",
|
|
2830
|
+
className
|
|
2831
|
+
),
|
|
2832
|
+
children: items.map((item) => {
|
|
2833
|
+
const full = `${basePath}${item.href}`;
|
|
2834
|
+
const active = isItemActive ? isItemActive(item, pathname) : isActivePath(pathname, full, item.exact);
|
|
2835
|
+
return /* @__PURE__ */ jsx55(
|
|
2836
|
+
SidebarNavLink,
|
|
2837
|
+
{
|
|
2838
|
+
item,
|
|
2839
|
+
active,
|
|
2840
|
+
collapsed,
|
|
2841
|
+
basePath,
|
|
2842
|
+
LinkComponent
|
|
2843
|
+
},
|
|
2844
|
+
item.href
|
|
2845
|
+
);
|
|
2846
|
+
})
|
|
2847
|
+
}
|
|
2848
|
+
);
|
|
2849
|
+
return collapsed ? /* @__PURE__ */ jsx55(TooltipProvider, { children: nav }) : nav;
|
|
2850
|
+
}
|
|
2851
|
+
|
|
2852
|
+
// src/components/app-sidebar.tsx
|
|
2853
|
+
import { PanelLeft } from "lucide-react";
|
|
2854
|
+
import { jsx as jsx56, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2855
|
+
function AppSidebar({
|
|
2856
|
+
items,
|
|
2857
|
+
logo,
|
|
2858
|
+
logoCollapsed,
|
|
2859
|
+
header,
|
|
2860
|
+
footer,
|
|
2861
|
+
collapsed: controlled,
|
|
2862
|
+
defaultCollapsed,
|
|
2863
|
+
onCollapsedChange,
|
|
2864
|
+
basePath,
|
|
2865
|
+
LinkComponent,
|
|
2866
|
+
isItemActive,
|
|
2867
|
+
className
|
|
2868
|
+
}) {
|
|
2869
|
+
const { collapsed, toggle } = useSidebar({
|
|
2870
|
+
collapsed: controlled,
|
|
2871
|
+
defaultCollapsed,
|
|
2872
|
+
onCollapsedChange
|
|
2873
|
+
});
|
|
2874
|
+
return /* @__PURE__ */ jsxs27(
|
|
2875
|
+
"aside",
|
|
2876
|
+
{
|
|
2877
|
+
"data-collapsed": collapsed,
|
|
2878
|
+
className: cn(
|
|
2879
|
+
"flex h-full flex-col overflow-hidden rounded-2xl border border-border-subtle bg-bg-surface transition-[width] duration-200 ease-in-out",
|
|
2880
|
+
collapsed ? "w-[52px]" : "w-[220px]",
|
|
2881
|
+
className
|
|
2882
|
+
),
|
|
2883
|
+
children: [
|
|
2884
|
+
collapsed ? /* @__PURE__ */ jsx56("div", { className: "flex justify-center border-b border-border-subtle p-2", children: header ?? /* @__PURE__ */ jsxs27("div", { className: "group relative flex size-8 items-center justify-center", children: [
|
|
2885
|
+
/* @__PURE__ */ jsx56("span", { className: "pointer-events-none transition-opacity group-hover:opacity-0 group-focus-within:opacity-0", children: logoCollapsed ?? logo }),
|
|
2886
|
+
/* @__PURE__ */ jsx56(
|
|
2887
|
+
"button",
|
|
2888
|
+
{
|
|
2889
|
+
type: "button",
|
|
2890
|
+
onClick: toggle,
|
|
2891
|
+
"aria-label": "Expand sidebar",
|
|
2892
|
+
"aria-expanded": false,
|
|
2893
|
+
className: "absolute inset-0 flex items-center justify-center rounded-md text-text-secondary opacity-0 transition-opacity hover:bg-bg-secondary focus-visible:outline-none focus-visible:opacity-100 focus-visible:ring-2 focus-visible:ring-border-focus group-hover:opacity-100 group-focus-within:opacity-100",
|
|
2894
|
+
children: /* @__PURE__ */ jsx56(PanelLeft, { className: "size-4", "aria-hidden": "true" })
|
|
2895
|
+
}
|
|
2896
|
+
)
|
|
2897
|
+
] }) }) : /* @__PURE__ */ jsxs27("div", { className: "flex items-center justify-between border-b border-border-subtle p-2", children: [
|
|
2898
|
+
header ?? logo,
|
|
2899
|
+
/* @__PURE__ */ jsx56(
|
|
2900
|
+
"button",
|
|
2901
|
+
{
|
|
2902
|
+
type: "button",
|
|
2903
|
+
onClick: toggle,
|
|
2904
|
+
"aria-label": "Collapse sidebar",
|
|
2905
|
+
"aria-expanded": true,
|
|
2906
|
+
className: "flex size-6 items-center justify-center rounded-md text-text-secondary transition-colors hover:bg-bg-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
2907
|
+
children: /* @__PURE__ */ jsx56(PanelLeft, { className: "size-4", "aria-hidden": "true" })
|
|
2908
|
+
}
|
|
2909
|
+
)
|
|
2910
|
+
] }),
|
|
2911
|
+
/* @__PURE__ */ jsx56("div", { className: "flex-1 overflow-y-auto overflow-x-hidden py-2", children: /* @__PURE__ */ jsx56(SidebarNav, { items, collapsed, basePath, LinkComponent, isItemActive }) }),
|
|
2912
|
+
footer && /* @__PURE__ */ jsx56("div", { className: cn("border-t border-border-subtle", collapsed ? "px-1 py-2" : "px-2 py-2"), children: footer })
|
|
2913
|
+
]
|
|
2914
|
+
}
|
|
2915
|
+
);
|
|
2916
|
+
}
|
|
2917
|
+
|
|
2918
|
+
// src/components/app-shell.tsx
|
|
2919
|
+
import * as React47 from "react";
|
|
2920
|
+
import { Menu as Menu2 } from "lucide-react";
|
|
2921
|
+
import { useLocation as useLocation2 } from "react-router";
|
|
2922
|
+
import { jsx as jsx57, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2923
|
+
function expandedSidebar(sidebar) {
|
|
2924
|
+
return React47.isValidElement(sidebar) ? React47.cloneElement(sidebar, { collapsed: false }) : sidebar;
|
|
2925
|
+
}
|
|
2926
|
+
function AppShell({ sidebar, topBar, children, className }) {
|
|
2927
|
+
const { pathname } = useLocation2();
|
|
2928
|
+
const [mobileOpen, setMobileOpen] = React47.useState(false);
|
|
2929
|
+
React47.useEffect(() => {
|
|
2930
|
+
setMobileOpen(false);
|
|
2931
|
+
}, [pathname]);
|
|
2932
|
+
const isMobile = useIsMobile();
|
|
2933
|
+
if (isMobile) {
|
|
2934
|
+
return /* @__PURE__ */ jsx57(TooltipProvider, { children: /* @__PURE__ */ jsxs28("div", { className: cn("flex min-h-screen flex-col bg-bg-sunken", className), children: [
|
|
2935
|
+
/* @__PURE__ */ jsxs28("header", { className: "flex shrink-0 items-center justify-between border-b border-border-subtle bg-bg-surface px-4 py-3", children: [
|
|
2936
|
+
/* @__PURE__ */ jsxs28(Sheet, { open: mobileOpen, onOpenChange: setMobileOpen, children: [
|
|
2937
|
+
/* @__PURE__ */ jsx57(SheetTrigger, { asChild: true, children: /* @__PURE__ */ jsx57(Button, { variant: "ghost", size: "icon", className: "size-8 text-text-secondary", "aria-label": "Open navigation", children: /* @__PURE__ */ jsx57(Menu2, { className: "size-5" }) }) }),
|
|
2938
|
+
/* @__PURE__ */ jsxs28(SheetContent, { side: "left", className: "w-[240px] bg-bg-surface p-0", children: [
|
|
2939
|
+
/* @__PURE__ */ jsx57(SheetTitle, { className: "sr-only", children: "Navigation" }),
|
|
2940
|
+
/* @__PURE__ */ jsx57(SheetDescription, { className: "sr-only", children: "Application navigation menu" }),
|
|
2941
|
+
expandedSidebar(sidebar)
|
|
2942
|
+
] })
|
|
2943
|
+
] }),
|
|
2944
|
+
/* @__PURE__ */ jsx57("div", { className: "flex items-center gap-2", children: topBar })
|
|
2945
|
+
] }),
|
|
2946
|
+
/* @__PURE__ */ jsx57("main", { className: "flex-1 overflow-auto p-4", children })
|
|
2947
|
+
] }) });
|
|
2948
|
+
}
|
|
2949
|
+
return /* @__PURE__ */ jsx57(TooltipProvider, { children: /* @__PURE__ */ jsxs28("div", { className: cn("flex min-h-screen gap-3 bg-bg-sunken p-6", className), children: [
|
|
2950
|
+
/* @__PURE__ */ jsx57("div", { className: "sticky top-6 h-[calc(100vh-48px)] shrink-0", children: sidebar }),
|
|
2951
|
+
/* @__PURE__ */ jsxs28("div", { className: "flex min-w-0 flex-1 flex-col overflow-hidden rounded-2xl border border-border-subtle bg-bg-surface", children: [
|
|
2952
|
+
/* @__PURE__ */ jsx57("div", { className: "flex min-h-[52px] shrink-0 items-center justify-end gap-2 border-b border-border-subtle px-5", children: topBar }),
|
|
2953
|
+
/* @__PURE__ */ jsx57("main", { className: "flex-1 overflow-auto px-7 py-8", children })
|
|
2954
|
+
] })
|
|
2955
|
+
] }) });
|
|
2956
|
+
}
|
|
2957
|
+
var AuthenticatedLayout = AppShell;
|
|
2958
|
+
export {
|
|
2959
|
+
Accordion,
|
|
2960
|
+
AccordionContent,
|
|
2961
|
+
AccordionItem,
|
|
2962
|
+
AccordionTrigger,
|
|
2963
|
+
Alert,
|
|
2964
|
+
AlertDescription,
|
|
2965
|
+
AlertDialog,
|
|
2966
|
+
AlertDialogAction,
|
|
2967
|
+
AlertDialogCancel,
|
|
2968
|
+
AlertDialogContent,
|
|
2969
|
+
AlertDialogDescription,
|
|
2970
|
+
AlertDialogFooter,
|
|
2971
|
+
AlertDialogHeader,
|
|
2972
|
+
AlertDialogOverlay,
|
|
2973
|
+
AlertDialogPortal,
|
|
2974
|
+
AlertDialogTitle,
|
|
2975
|
+
AlertDialogTrigger,
|
|
2976
|
+
AlertTitle,
|
|
2977
|
+
AppShell,
|
|
2978
|
+
AppSidebar,
|
|
2979
|
+
AspectRatio,
|
|
2980
|
+
AuthenticatedLayout,
|
|
2981
|
+
Avatar,
|
|
2982
|
+
AvatarFallback,
|
|
2983
|
+
AvatarImage,
|
|
2984
|
+
Badge,
|
|
2985
|
+
Breadcrumb,
|
|
2986
|
+
BreadcrumbEllipsis,
|
|
2987
|
+
BreadcrumbItem,
|
|
2988
|
+
BreadcrumbLink,
|
|
2989
|
+
BreadcrumbList,
|
|
2990
|
+
BreadcrumbPage,
|
|
2991
|
+
BreadcrumbSeparator,
|
|
2992
|
+
Button,
|
|
2993
|
+
Calendar,
|
|
2994
|
+
Card,
|
|
2995
|
+
CardContent,
|
|
2996
|
+
CardDescription,
|
|
2997
|
+
CardFooter,
|
|
2998
|
+
CardHeader,
|
|
2999
|
+
CardTitle,
|
|
3000
|
+
Carousel,
|
|
3001
|
+
CarouselContent,
|
|
3002
|
+
CarouselItem,
|
|
3003
|
+
CarouselNext,
|
|
3004
|
+
CarouselPrevious,
|
|
3005
|
+
Checkbox,
|
|
3006
|
+
Collapsible,
|
|
3007
|
+
CollapsibleContent2 as CollapsibleContent,
|
|
3008
|
+
CollapsibleTrigger2 as CollapsibleTrigger,
|
|
3009
|
+
Command,
|
|
3010
|
+
CommandDialog,
|
|
3011
|
+
CommandEmpty,
|
|
3012
|
+
CommandGroup,
|
|
3013
|
+
CommandInput,
|
|
3014
|
+
CommandItem,
|
|
3015
|
+
CommandList,
|
|
3016
|
+
CommandSeparator,
|
|
3017
|
+
CommandShortcut,
|
|
3018
|
+
ConfirmDialog,
|
|
3019
|
+
ContextMenu,
|
|
3020
|
+
ContextMenuCheckboxItem,
|
|
3021
|
+
ContextMenuContent,
|
|
3022
|
+
ContextMenuGroup,
|
|
3023
|
+
ContextMenuItem,
|
|
3024
|
+
ContextMenuLabel,
|
|
3025
|
+
ContextMenuPortal,
|
|
3026
|
+
ContextMenuRadioGroup,
|
|
3027
|
+
ContextMenuRadioItem,
|
|
3028
|
+
ContextMenuSeparator,
|
|
3029
|
+
ContextMenuShortcut,
|
|
3030
|
+
ContextMenuSub,
|
|
3031
|
+
ContextMenuSubContent,
|
|
3032
|
+
ContextMenuSubTrigger,
|
|
3033
|
+
ContextMenuTrigger,
|
|
3034
|
+
CopyButton,
|
|
3035
|
+
DatePicker,
|
|
3036
|
+
Dialog,
|
|
3037
|
+
DialogClose,
|
|
3038
|
+
DialogContent,
|
|
3039
|
+
DialogDescription,
|
|
3040
|
+
DialogFooter,
|
|
3041
|
+
DialogHeader,
|
|
3042
|
+
DialogOverlay,
|
|
3043
|
+
DialogPortal,
|
|
3044
|
+
DialogTitle,
|
|
3045
|
+
DialogTrigger,
|
|
3046
|
+
DocsLink,
|
|
3047
|
+
Drawer,
|
|
3048
|
+
DrawerClose,
|
|
3049
|
+
DrawerContent,
|
|
3050
|
+
DrawerDescription,
|
|
3051
|
+
DrawerFooter,
|
|
3052
|
+
DrawerHeader,
|
|
3053
|
+
DrawerOverlay,
|
|
3054
|
+
DrawerPortal,
|
|
3055
|
+
DrawerTitle,
|
|
3056
|
+
DrawerTrigger,
|
|
3057
|
+
DropdownMenu,
|
|
3058
|
+
DropdownMenuCheckboxItem,
|
|
3059
|
+
DropdownMenuContent,
|
|
3060
|
+
DropdownMenuGroup,
|
|
3061
|
+
DropdownMenuItem,
|
|
3062
|
+
DropdownMenuLabel,
|
|
3063
|
+
DropdownMenuPortal,
|
|
3064
|
+
DropdownMenuRadioGroup,
|
|
3065
|
+
DropdownMenuRadioItem,
|
|
3066
|
+
DropdownMenuSeparator,
|
|
3067
|
+
DropdownMenuShortcut,
|
|
3068
|
+
DropdownMenuSub,
|
|
3069
|
+
DropdownMenuSubContent,
|
|
3070
|
+
DropdownMenuSubTrigger,
|
|
3071
|
+
DropdownMenuTrigger,
|
|
3072
|
+
EmptyState,
|
|
3073
|
+
ExtensionIcon,
|
|
3074
|
+
ExtensionLink,
|
|
3075
|
+
Form,
|
|
3076
|
+
FormControl,
|
|
3077
|
+
FormDescription,
|
|
3078
|
+
FormField,
|
|
3079
|
+
FormItem,
|
|
3080
|
+
FormLabel,
|
|
3081
|
+
FormMessage,
|
|
3082
|
+
HoverCard,
|
|
3083
|
+
HoverCardContent,
|
|
3084
|
+
HoverCardTrigger,
|
|
3085
|
+
InlineError,
|
|
3086
|
+
Input,
|
|
3087
|
+
InputOTP,
|
|
3088
|
+
InputOTPGroup,
|
|
3089
|
+
InputOTPSeparator,
|
|
3090
|
+
InputOTPSlot,
|
|
3091
|
+
Label2 as Label,
|
|
3092
|
+
Menubar,
|
|
3093
|
+
MenubarCheckboxItem,
|
|
3094
|
+
MenubarContent,
|
|
3095
|
+
MenubarGroup,
|
|
3096
|
+
MenubarItem,
|
|
3097
|
+
MenubarLabel,
|
|
3098
|
+
MenubarMenu,
|
|
3099
|
+
MenubarPortal,
|
|
3100
|
+
MenubarRadioGroup,
|
|
3101
|
+
MenubarRadioItem,
|
|
3102
|
+
MenubarSeparator,
|
|
3103
|
+
MenubarShortcut,
|
|
3104
|
+
MenubarSub,
|
|
3105
|
+
MenubarSubContent,
|
|
3106
|
+
MenubarSubTrigger,
|
|
3107
|
+
MenubarTrigger,
|
|
3108
|
+
NavigationMenu,
|
|
3109
|
+
NavigationMenuContent,
|
|
3110
|
+
NavigationMenuIndicator,
|
|
3111
|
+
NavigationMenuItem,
|
|
3112
|
+
NavigationMenuLink,
|
|
3113
|
+
NavigationMenuList,
|
|
3114
|
+
NavigationMenuTrigger,
|
|
3115
|
+
NavigationMenuViewport,
|
|
3116
|
+
Pagination,
|
|
3117
|
+
PaginationContent,
|
|
3118
|
+
PaginationEllipsis,
|
|
3119
|
+
PaginationItem,
|
|
3120
|
+
PaginationLink,
|
|
3121
|
+
PaginationNext,
|
|
3122
|
+
PaginationPrevious,
|
|
3123
|
+
Popover,
|
|
3124
|
+
PopoverAnchor,
|
|
3125
|
+
PopoverContent,
|
|
3126
|
+
PopoverTrigger,
|
|
3127
|
+
Progress,
|
|
3128
|
+
RadioGroup2 as RadioGroup,
|
|
3129
|
+
RadioGroupItem,
|
|
3130
|
+
ScrollArea,
|
|
3131
|
+
ScrollBar,
|
|
3132
|
+
SectionIntro,
|
|
3133
|
+
Select,
|
|
3134
|
+
Separator4 as Separator,
|
|
3135
|
+
Sheet,
|
|
3136
|
+
SheetClose,
|
|
3137
|
+
SheetContent,
|
|
3138
|
+
SheetDescription,
|
|
3139
|
+
SheetFooter,
|
|
3140
|
+
SheetHeader,
|
|
3141
|
+
SheetOverlay,
|
|
3142
|
+
SheetPortal,
|
|
3143
|
+
SheetTitle,
|
|
3144
|
+
SheetTrigger,
|
|
3145
|
+
SidebarNav,
|
|
3146
|
+
SidebarNavLink,
|
|
3147
|
+
Skeleton,
|
|
3148
|
+
Slider,
|
|
3149
|
+
StatCard,
|
|
3150
|
+
StatusDot,
|
|
3151
|
+
Switch,
|
|
3152
|
+
Table,
|
|
3153
|
+
TableBody,
|
|
3154
|
+
TableCaption,
|
|
3155
|
+
TableCell,
|
|
3156
|
+
TableFooter,
|
|
3157
|
+
TableHead,
|
|
3158
|
+
TableHeader,
|
|
3159
|
+
TableRow,
|
|
3160
|
+
Tabs,
|
|
3161
|
+
TabsContent,
|
|
3162
|
+
TabsList,
|
|
3163
|
+
TabsTrigger,
|
|
3164
|
+
Textarea,
|
|
3165
|
+
ThemeToggle,
|
|
3166
|
+
Toaster,
|
|
3167
|
+
Toggle,
|
|
3168
|
+
ToggleGroup,
|
|
3169
|
+
ToggleGroupItem,
|
|
3170
|
+
Tooltip,
|
|
3171
|
+
TooltipContent,
|
|
3172
|
+
TooltipProvider,
|
|
3173
|
+
TooltipTrigger,
|
|
3174
|
+
UserMenu,
|
|
3175
|
+
alertVariants,
|
|
3176
|
+
badgeVariants,
|
|
3177
|
+
buttonVariants,
|
|
3178
|
+
cn,
|
|
3179
|
+
isKnownExtensionIcon,
|
|
3180
|
+
navigationMenuTriggerStyle,
|
|
3181
|
+
statusDotVariants,
|
|
3182
|
+
toast,
|
|
3183
|
+
toggleVariants,
|
|
3184
|
+
useCarousel,
|
|
3185
|
+
useFormField,
|
|
3186
|
+
useIsMobile,
|
|
3187
|
+
useSidebar,
|
|
3188
|
+
useTheme
|
|
3189
|
+
};
|