@orangecheck/design 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1235 @@
1
+ 'use strict';
2
+
3
+ var reactSlot = require('@radix-ui/react-slot');
4
+ var classVarianceAuthority = require('class-variance-authority');
5
+ var clsx = require('clsx');
6
+ var tailwindMerge = require('tailwind-merge');
7
+ var jsxRuntime = require('react/jsx-runtime');
8
+ var LabelPrimitive = require('@radix-ui/react-label');
9
+ var lucideReact = require('lucide-react');
10
+ var nextThemes = require('next-themes');
11
+ var React2 = require('react');
12
+ var SeparatorPrimitive = require('@radix-ui/react-separator');
13
+ var DialogPrimitive = require('@radix-ui/react-dialog');
14
+ var PopoverPrimitive = require('@radix-ui/react-popover');
15
+ var AccordionPrimitive = require('@radix-ui/react-accordion');
16
+ var SelectPrimitive = require('@radix-ui/react-select');
17
+ var sonner = require('sonner');
18
+
19
+ function _interopNamespace(e) {
20
+ if (e && e.__esModule) return e;
21
+ var n = Object.create(null);
22
+ if (e) {
23
+ Object.keys(e).forEach(function (k) {
24
+ if (k !== 'default') {
25
+ var d = Object.getOwnPropertyDescriptor(e, k);
26
+ Object.defineProperty(n, k, d.get ? d : {
27
+ enumerable: true,
28
+ get: function () { return e[k]; }
29
+ });
30
+ }
31
+ });
32
+ }
33
+ n.default = e;
34
+ return Object.freeze(n);
35
+ }
36
+
37
+ var LabelPrimitive__namespace = /*#__PURE__*/_interopNamespace(LabelPrimitive);
38
+ var React2__namespace = /*#__PURE__*/_interopNamespace(React2);
39
+ var SeparatorPrimitive__namespace = /*#__PURE__*/_interopNamespace(SeparatorPrimitive);
40
+ var DialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(DialogPrimitive);
41
+ var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespace(PopoverPrimitive);
42
+ var AccordionPrimitive__namespace = /*#__PURE__*/_interopNamespace(AccordionPrimitive);
43
+ var SelectPrimitive__namespace = /*#__PURE__*/_interopNamespace(SelectPrimitive);
44
+
45
+ // src/primitives/button.tsx
46
+ function cn(...inputs) {
47
+ return tailwindMerge.twMerge(clsx.clsx(inputs));
48
+ }
49
+ var buttonVariants = classVarianceAuthority.cva(
50
+ "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
51
+ {
52
+ variants: {
53
+ variant: {
54
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
55
+ destructive: "bg-destructive hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 text-white",
56
+ outline: "bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 border shadow-xs",
57
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
58
+ ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
59
+ link: "text-primary underline-offset-4 hover:underline"
60
+ },
61
+ size: {
62
+ default: "h-9 px-4 py-2 has-[>svg]:px-3",
63
+ sm: "h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",
64
+ lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
65
+ icon: "size-9"
66
+ }
67
+ },
68
+ defaultVariants: {
69
+ variant: "default",
70
+ size: "default"
71
+ }
72
+ }
73
+ );
74
+ function Button({
75
+ className,
76
+ variant,
77
+ size,
78
+ asChild = false,
79
+ ...props
80
+ }) {
81
+ const Comp = asChild ? reactSlot.Slot : "button";
82
+ return /* @__PURE__ */ jsxRuntime.jsx(
83
+ Comp,
84
+ {
85
+ "data-slot": "button",
86
+ className: cn(buttonVariants({ variant, size, className })),
87
+ ...props
88
+ }
89
+ );
90
+ }
91
+ var badgeVariants = classVarianceAuthority.cva(
92
+ "focus-visible:border-ring focus-visible:ring-ring/50 inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-md border px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] [&>svg]:pointer-events-none [&>svg]:size-3",
93
+ {
94
+ variants: {
95
+ variant: {
96
+ default: "bg-primary text-primary-foreground [a&]:hover:bg-primary/90 border-transparent",
97
+ secondary: "bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90 border-transparent",
98
+ destructive: "bg-destructive text-destructive-foreground [a&]:hover:bg-destructive/90 border-transparent",
99
+ warning: "bg-warning text-warning-foreground [a&]:hover:bg-warning/90 border-transparent",
100
+ success: "bg-success text-success-foreground [a&]:hover:bg-success/90 border-transparent",
101
+ info: "bg-info text-info-foreground [a&]:hover:bg-info/90 border-transparent",
102
+ outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"
103
+ }
104
+ },
105
+ defaultVariants: { variant: "default" }
106
+ }
107
+ );
108
+ function Badge({
109
+ className,
110
+ variant,
111
+ asChild = false,
112
+ ...props
113
+ }) {
114
+ const Comp = asChild ? reactSlot.Slot : "span";
115
+ return /* @__PURE__ */ jsxRuntime.jsx(Comp, { "data-slot": "badge", className: cn(badgeVariants({ variant }), className), ...props });
116
+ }
117
+ function Input({ className, type, ...props }) {
118
+ return /* @__PURE__ */ jsxRuntime.jsx(
119
+ "input",
120
+ {
121
+ type,
122
+ "data-slot": "input",
123
+ className: cn(
124
+ "file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground border-input bg-input/30 hover:bg-input/50 dark:bg-input/30 dark:hover:bg-input/50 h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base shadow-xs transition-[color,box-shadow,background-color] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
125
+ "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
126
+ "aria-invalid:ring-brand/25 dark:aria-invalid:ring-brand/35 aria-invalid:border-brand",
127
+ className
128
+ ),
129
+ ...props
130
+ }
131
+ );
132
+ }
133
+ function Label({ className, ...props }) {
134
+ return /* @__PURE__ */ jsxRuntime.jsx(
135
+ LabelPrimitive__namespace.Root,
136
+ {
137
+ "data-slot": "label",
138
+ className: cn(
139
+ "flex select-none items-center gap-2 text-sm font-medium leading-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
140
+ className
141
+ ),
142
+ ...props
143
+ }
144
+ );
145
+ }
146
+ var alertVariants = classVarianceAuthority.cva(
147
+ "relative grid w-full grid-cols-[0_1fr] items-start gap-x-0 gap-y-0.5 rounded-md border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",
148
+ {
149
+ variants: {
150
+ variant: {
151
+ default: "bg-card text-card-foreground",
152
+ destructive: "text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",
153
+ success: "text-success bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-success/90",
154
+ warning: "text-warning bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-warning/90"
155
+ }
156
+ },
157
+ defaultVariants: { variant: "default" }
158
+ }
159
+ );
160
+ function Alert({
161
+ className,
162
+ variant,
163
+ ...props
164
+ }) {
165
+ return /* @__PURE__ */ jsxRuntime.jsx(
166
+ "div",
167
+ {
168
+ "data-slot": "alert",
169
+ role: "alert",
170
+ className: cn(alertVariants({ variant }), className),
171
+ ...props
172
+ }
173
+ );
174
+ }
175
+ function AlertTitle({ className, ...props }) {
176
+ return /* @__PURE__ */ jsxRuntime.jsx(
177
+ "div",
178
+ {
179
+ "data-slot": "alert-title",
180
+ className: cn("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight", className),
181
+ ...props
182
+ }
183
+ );
184
+ }
185
+ function AlertDescription({ className, ...props }) {
186
+ return /* @__PURE__ */ jsxRuntime.jsx(
187
+ "div",
188
+ {
189
+ "data-slot": "alert-description",
190
+ className: cn(
191
+ "text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",
192
+ className
193
+ ),
194
+ ...props
195
+ }
196
+ );
197
+ }
198
+ function AlertWithAction({
199
+ variant = "default",
200
+ icon: Icon2,
201
+ title,
202
+ description,
203
+ actionLabel,
204
+ onAction,
205
+ actionVariant = "outline",
206
+ actionIcon,
207
+ actionDisabled,
208
+ actionContent,
209
+ className
210
+ }) {
211
+ return /* @__PURE__ */ jsxRuntime.jsxs(Alert, { variant, className, children: [
212
+ Icon2 && /* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "h-4 w-4" }),
213
+ title && /* @__PURE__ */ jsxRuntime.jsx(AlertTitle, { children: title }),
214
+ /* @__PURE__ */ jsxRuntime.jsxs(AlertDescription, { children: [
215
+ description,
216
+ (actionLabel || actionContent) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-3 flex items-center gap-2", children: [
217
+ actionContent,
218
+ actionLabel && onAction && /* @__PURE__ */ jsxRuntime.jsxs(
219
+ Button,
220
+ {
221
+ size: "sm",
222
+ variant: actionVariant,
223
+ onClick: onAction,
224
+ disabled: actionDisabled,
225
+ className: cn(!actionContent && "ml-auto"),
226
+ children: [
227
+ actionIcon,
228
+ actionLabel
229
+ ]
230
+ }
231
+ )
232
+ ] })
233
+ ] })
234
+ ] });
235
+ }
236
+ function AlertWithCountdown({
237
+ variant = "default",
238
+ icon: Icon2,
239
+ title,
240
+ description,
241
+ countdown,
242
+ countdownLabel,
243
+ countdownIcon,
244
+ actionLabel = "Check Now",
245
+ onAction,
246
+ actionIcon,
247
+ actionDisabled,
248
+ className
249
+ }) {
250
+ const label = countdownLabel ? countdownLabel.replace("{countdown}", countdown.toString()) : `Rechecking in ${countdown} second${countdown !== 1 ? "s" : ""}...`;
251
+ return /* @__PURE__ */ jsxRuntime.jsxs(Alert, { variant, className, children: [
252
+ Icon2 && /* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "h-4 w-4" }),
253
+ title && /* @__PURE__ */ jsxRuntime.jsx(AlertTitle, { children: title }),
254
+ /* @__PURE__ */ jsxRuntime.jsxs(AlertDescription, { children: [
255
+ description,
256
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-3 flex items-center gap-2 text-sm", children: [
257
+ countdownIcon,
258
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: label }),
259
+ onAction && /* @__PURE__ */ jsxRuntime.jsxs(
260
+ Button,
261
+ {
262
+ size: "sm",
263
+ variant: "outline",
264
+ onClick: onAction,
265
+ disabled: actionDisabled,
266
+ className: "ml-auto",
267
+ children: [
268
+ actionIcon,
269
+ actionLabel
270
+ ]
271
+ }
272
+ )
273
+ ] })
274
+ ] })
275
+ ] });
276
+ }
277
+ function Textarea({ className, ...props }) {
278
+ return /* @__PURE__ */ jsxRuntime.jsx(
279
+ "textarea",
280
+ {
281
+ "data-slot": "textarea",
282
+ className: cn(
283
+ "placeholder:text-muted-foreground border-input bg-input/30 hover:bg-input/50 dark:bg-input/30 dark:hover:bg-input/50 w-full min-w-0 rounded-md border px-3 py-2 font-mono text-xs leading-relaxed shadow-xs transition-[color,box-shadow,background-color] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
284
+ "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
285
+ className
286
+ ),
287
+ ...props
288
+ }
289
+ );
290
+ }
291
+ function ThemeToggle({ className }) {
292
+ const { resolvedTheme, setTheme } = nextThemes.useTheme();
293
+ const [mounted, setMounted] = React2.useState(false);
294
+ React2.useEffect(() => setMounted(true), []);
295
+ const isDark = resolvedTheme === "dark";
296
+ return /* @__PURE__ */ jsxRuntime.jsx(
297
+ Button,
298
+ {
299
+ variant: "ghost",
300
+ size: "icon",
301
+ "aria-label": isDark ? "Switch to light mode" : "Switch to dark mode",
302
+ title: isDark ? "Switch to light mode" : "Switch to dark mode",
303
+ onClick: () => setTheme(isDark ? "light" : "dark"),
304
+ className: cn("text-muted-foreground hover:text-foreground", className),
305
+ children: !mounted ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block size-4" }) : isDark ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Sun, { className: "size-4" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Moon, { className: "size-4" })
306
+ }
307
+ );
308
+ }
309
+ function ThemeToggleLink() {
310
+ const { resolvedTheme, setTheme } = nextThemes.useTheme();
311
+ const [mounted, setMounted] = React2.useState(false);
312
+ React2.useEffect(() => setMounted(true), []);
313
+ const isDark = mounted && resolvedTheme === "dark";
314
+ return /* @__PURE__ */ jsxRuntime.jsxs(
315
+ "button",
316
+ {
317
+ type: "button",
318
+ onClick: () => setTheme(isDark ? "light" : "dark"),
319
+ className: "hover:text-foreground flex w-full items-center justify-between px-2 py-2 text-left text-xs tracking-wide uppercase transition-colors",
320
+ children: [
321
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "tracking-wide lowercase", children: [
322
+ "> ",
323
+ mounted ? isDark ? "light mode" : "dark mode" : "theme"
324
+ ] }),
325
+ mounted && (isDark ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Sun, { className: "size-3.5" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Moon, { className: "size-3.5" }))
326
+ ]
327
+ }
328
+ );
329
+ }
330
+ function Working({ text, size = "md", progress, className }) {
331
+ const isSmall = size === "sm";
332
+ return /* @__PURE__ */ jsxRuntime.jsxs(
333
+ "span",
334
+ {
335
+ "aria-live": "polite",
336
+ className: cn(
337
+ "inline-flex items-center gap-2 font-mono",
338
+ isSmall ? "text-[11px]" : "text-xs",
339
+ "text-muted-foreground",
340
+ className
341
+ ),
342
+ children: [
343
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "oc-working-cursor", "aria-hidden": true, children: [
344
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "oc-working-dot", style: { animationDelay: "0ms" }, children: "\xB7" }),
345
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "oc-working-dot", style: { animationDelay: "140ms" }, children: "\xB7" }),
346
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "oc-working-dot", style: { animationDelay: "280ms" }, children: "\xB7" })
347
+ ] }),
348
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "oc-working-text", children: [
349
+ text,
350
+ progress && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-muted-foreground/60 ml-1.5", children: [
351
+ "[",
352
+ progress,
353
+ "]"
354
+ ] })
355
+ ] })
356
+ ]
357
+ }
358
+ );
359
+ }
360
+ function WorkingPanel({ text, progress }) {
361
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "terminal", children: [
362
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "terminal-title", children: [
363
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "terminal-dot" }),
364
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "terminal-dot" }),
365
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "terminal-dot" }),
366
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-2", children: "in progress" })
367
+ ] }),
368
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-3 p-5", children: /* @__PURE__ */ jsxRuntime.jsx(Working, { text, ...progress ? { progress } : {} }) })
369
+ ] });
370
+ }
371
+ var ErrorBoundary = class extends React2__namespace.Component {
372
+ constructor() {
373
+ super(...arguments);
374
+ this.state = { error: null };
375
+ this.reset = () => this.setState({ error: null });
376
+ }
377
+ static getDerivedStateFromError(error) {
378
+ return { error };
379
+ }
380
+ componentDidCatch(error, info) {
381
+ console.error("[ErrorBoundary]", error, info);
382
+ }
383
+ render() {
384
+ if (this.state.error) {
385
+ if (this.props.fallback) {
386
+ return this.props.fallback(this.state.error, this.reset);
387
+ }
388
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "container py-16", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "terminal", children: [
389
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "terminal-title", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-destructive flex items-center gap-1.5", children: "! fatal" }) }),
390
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3 p-5 font-mono text-xs leading-relaxed", children: [
391
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { children: [
392
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-destructive", children: [
393
+ "> ",
394
+ "err:"
395
+ ] }),
396
+ " ",
397
+ this.state.error.message || "unknown error"
398
+ ] }),
399
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-muted-foreground", children: [
400
+ "> ",
401
+ "this page crashed. reload to recover."
402
+ ] }),
403
+ /* @__PURE__ */ jsxRuntime.jsx(
404
+ "button",
405
+ {
406
+ type: "button",
407
+ onClick: this.reset,
408
+ className: "bg-primary text-primary-foreground hover:bg-primary/90 mt-2 inline-flex items-center justify-center gap-2 rounded-md px-4 py-2 font-mono text-xs tracking-widest uppercase",
409
+ children: "retry"
410
+ }
411
+ )
412
+ ] })
413
+ ] }) });
414
+ }
415
+ return this.props.children;
416
+ }
417
+ };
418
+ function Skeleton({ className }) {
419
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("bg-muted/40 animate-pulse rounded-sm", className) });
420
+ }
421
+ function Separator({
422
+ className,
423
+ orientation = "horizontal",
424
+ decorative = true,
425
+ ...props
426
+ }) {
427
+ return /* @__PURE__ */ jsxRuntime.jsx(
428
+ SeparatorPrimitive__namespace.Root,
429
+ {
430
+ "data-slot": "separator",
431
+ decorative,
432
+ orientation,
433
+ className: cn(
434
+ "bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
435
+ className
436
+ ),
437
+ ...props
438
+ }
439
+ );
440
+ }
441
+ function Sheet(props) {
442
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Root, { "data-slot": "sheet", ...props });
443
+ }
444
+ function SheetTrigger(props) {
445
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Trigger, { "data-slot": "sheet-trigger", ...props });
446
+ }
447
+ function SheetPortal(props) {
448
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Portal, { "data-slot": "sheet-portal", ...props });
449
+ }
450
+ function SheetOverlay({ className, ...props }) {
451
+ return /* @__PURE__ */ jsxRuntime.jsx(
452
+ DialogPrimitive__namespace.Overlay,
453
+ {
454
+ "data-slot": "sheet-overlay",
455
+ className: cn(
456
+ "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",
457
+ className
458
+ ),
459
+ ...props
460
+ }
461
+ );
462
+ }
463
+ function SheetContent({
464
+ className,
465
+ children,
466
+ side = "right",
467
+ ...props
468
+ }) {
469
+ const sideClasses = {
470
+ right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",
471
+ left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
472
+ top: "inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
473
+ bottom: "inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom"
474
+ };
475
+ return /* @__PURE__ */ jsxRuntime.jsxs(SheetPortal, { children: [
476
+ /* @__PURE__ */ jsxRuntime.jsx(SheetOverlay, {}),
477
+ /* @__PURE__ */ jsxRuntime.jsxs(
478
+ DialogPrimitive__namespace.Content,
479
+ {
480
+ "data-slot": "sheet-content",
481
+ className: cn(
482
+ "bg-background fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=closed]:animate-out data-[state=open]:duration-500 data-[state=open]:animate-in",
483
+ sideClasses[side],
484
+ className
485
+ ),
486
+ ...props,
487
+ children: [
488
+ children,
489
+ /* @__PURE__ */ jsxRuntime.jsxs(DialogPrimitive__namespace.Close, { className: "ring-offset-background focus:ring-ring absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none", children: [
490
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "size-4" }),
491
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })
492
+ ] })
493
+ ]
494
+ }
495
+ )
496
+ ] });
497
+ }
498
+ function SheetHeader({ className, ...props }) {
499
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "sheet-header", className: cn("flex flex-col gap-1.5 p-4", className), ...props });
500
+ }
501
+ function SheetTitle({ className, ...props }) {
502
+ return /* @__PURE__ */ jsxRuntime.jsx(
503
+ DialogPrimitive__namespace.Title,
504
+ {
505
+ "data-slot": "sheet-title",
506
+ className: cn("text-foreground font-semibold", className),
507
+ ...props
508
+ }
509
+ );
510
+ }
511
+ function SheetDescription({
512
+ className,
513
+ ...props
514
+ }) {
515
+ return /* @__PURE__ */ jsxRuntime.jsx(
516
+ DialogPrimitive__namespace.Description,
517
+ {
518
+ "data-slot": "sheet-description",
519
+ className: cn("text-muted-foreground text-sm", className),
520
+ ...props
521
+ }
522
+ );
523
+ }
524
+ function Dialog({ ...props }) {
525
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Root, { "data-slot": "dialog", ...props });
526
+ }
527
+ function DialogTrigger({ ...props }) {
528
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Trigger, { "data-slot": "dialog-trigger", ...props });
529
+ }
530
+ function DialogPortal({ ...props }) {
531
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Portal, { "data-slot": "dialog-portal", ...props });
532
+ }
533
+ function DialogClose({ ...props }) {
534
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Close, { "data-slot": "dialog-close", ...props });
535
+ }
536
+ function DialogOverlay({
537
+ className,
538
+ ...props
539
+ }) {
540
+ return /* @__PURE__ */ jsxRuntime.jsx(
541
+ DialogPrimitive__namespace.Overlay,
542
+ {
543
+ "data-slot": "dialog-overlay",
544
+ className: cn(
545
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
546
+ className
547
+ ),
548
+ ...props
549
+ }
550
+ );
551
+ }
552
+ function DialogContent({
553
+ className,
554
+ children,
555
+ showCloseButton = true,
556
+ ...props
557
+ }) {
558
+ return /* @__PURE__ */ jsxRuntime.jsxs(DialogPortal, { "data-slot": "dialog-portal", children: [
559
+ /* @__PURE__ */ jsxRuntime.jsx(DialogOverlay, {}),
560
+ /* @__PURE__ */ jsxRuntime.jsxs(
561
+ DialogPrimitive__namespace.Content,
562
+ {
563
+ "data-slot": "dialog-content",
564
+ className: cn(
565
+ "bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
566
+ className
567
+ ),
568
+ ...props,
569
+ children: [
570
+ children,
571
+ showCloseButton && /* @__PURE__ */ jsxRuntime.jsxs(
572
+ DialogPrimitive__namespace.Close,
573
+ {
574
+ "data-slot": "dialog-close",
575
+ className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
576
+ children: [
577
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, {}),
578
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })
579
+ ]
580
+ }
581
+ )
582
+ ]
583
+ }
584
+ )
585
+ ] });
586
+ }
587
+ function DialogHeader({ className, ...props }) {
588
+ return /* @__PURE__ */ jsxRuntime.jsx(
589
+ "div",
590
+ {
591
+ "data-slot": "dialog-header",
592
+ className: cn("flex flex-col gap-2 text-center sm:text-left", className),
593
+ ...props
594
+ }
595
+ );
596
+ }
597
+ function DialogFooter({ className, ...props }) {
598
+ return /* @__PURE__ */ jsxRuntime.jsx(
599
+ "div",
600
+ {
601
+ "data-slot": "dialog-footer",
602
+ className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className),
603
+ ...props
604
+ }
605
+ );
606
+ }
607
+ function DialogTitle({ className, ...props }) {
608
+ return /* @__PURE__ */ jsxRuntime.jsx(
609
+ DialogPrimitive__namespace.Title,
610
+ {
611
+ "data-slot": "dialog-title",
612
+ className: cn("text-lg leading-none font-semibold", className),
613
+ ...props
614
+ }
615
+ );
616
+ }
617
+ function DialogDescription({
618
+ className,
619
+ ...props
620
+ }) {
621
+ return /* @__PURE__ */ jsxRuntime.jsx(
622
+ DialogPrimitive__namespace.Description,
623
+ {
624
+ "data-slot": "dialog-description",
625
+ className: cn("text-muted-foreground text-sm", className),
626
+ ...props
627
+ }
628
+ );
629
+ }
630
+ var NODE_ENV = globalThis.process?.env?.NODE_ENV;
631
+ var pending = null;
632
+ var notifyHost = null;
633
+ var hostMountCount = 0;
634
+ function confirm(opts) {
635
+ return new Promise((resolve) => {
636
+ pending = { ...opts, resolve };
637
+ if (notifyHost) {
638
+ notifyHost();
639
+ } else if (NODE_ENV !== "production") {
640
+ console.warn("[ConfirmDialog] confirm() called but no <ConfirmHost /> is mounted");
641
+ }
642
+ });
643
+ }
644
+ function ConfirmHost() {
645
+ const [state, setState] = React2.useState(null);
646
+ const submittingRef = React2.useRef(false);
647
+ React2.useEffect(() => {
648
+ hostMountCount += 1;
649
+ if (hostMountCount > 1 && NODE_ENV !== "production") {
650
+ console.warn(
651
+ "[ConfirmDialog] multiple <ConfirmHost /> instances mounted \u2014 the last one wins"
652
+ );
653
+ }
654
+ notifyHost = () => setState(pending);
655
+ if (pending) setState(pending);
656
+ return () => {
657
+ hostMountCount -= 1;
658
+ notifyHost = null;
659
+ };
660
+ }, []);
661
+ const close = React2.useCallback(
662
+ (ok) => {
663
+ if (submittingRef.current) return;
664
+ submittingRef.current = true;
665
+ state?.resolve(ok);
666
+ pending = null;
667
+ setState(null);
668
+ requestAnimationFrame(() => {
669
+ submittingRef.current = false;
670
+ });
671
+ },
672
+ [state]
673
+ );
674
+ if (!state) return null;
675
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Root, { open: true, onOpenChange: (open) => !open && close(false), children: /* @__PURE__ */ jsxRuntime.jsxs(DialogPrimitive__namespace.Portal, { children: [
676
+ /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Overlay, { className: "fixed inset-0 z-50 bg-black/50 backdrop-blur-sm" }),
677
+ /* @__PURE__ */ jsxRuntime.jsxs(DialogPrimitive__namespace.Content, { className: "bg-card border-border fixed top-1/2 left-1/2 z-50 w-[90vw] max-w-md -translate-x-1/2 -translate-y-1/2 border shadow-lg outline-none", children: [
678
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "terminal-title", children: /* @__PURE__ */ jsxRuntime.jsxs(
679
+ "span",
680
+ {
681
+ className: "flex items-center gap-1.5 " + (state.destructive ? "text-destructive" : "text-primary"),
682
+ children: [
683
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertTriangle, { className: "size-3.5" }),
684
+ state.title
685
+ ]
686
+ }
687
+ ) }),
688
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4 p-4 sm:p-5", children: [
689
+ /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Title, { className: "sr-only", children: state.title }),
690
+ /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-muted-foreground font-mono text-xs leading-relaxed whitespace-pre-wrap", children: state.message }) }),
691
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center justify-end gap-2", children: [
692
+ /* @__PURE__ */ jsxRuntime.jsx(
693
+ Button,
694
+ {
695
+ variant: "outline",
696
+ onClick: () => close(false),
697
+ className: "font-mono text-[11px] tracking-widest uppercase",
698
+ children: state.cancelLabel ?? "cancel"
699
+ }
700
+ ),
701
+ /* @__PURE__ */ jsxRuntime.jsx(
702
+ Button,
703
+ {
704
+ onClick: () => close(true),
705
+ className: "font-display tracking-wide uppercase " + (state.destructive ? "bg-destructive text-destructive-foreground hover:bg-destructive/90" : ""),
706
+ children: state.confirmLabel ?? "confirm"
707
+ }
708
+ )
709
+ ] })
710
+ ] })
711
+ ] })
712
+ ] }) });
713
+ }
714
+ var NODE_ENV2 = globalThis.process?.env?.NODE_ENV;
715
+ var pending2 = null;
716
+ var notifyHost2 = null;
717
+ var hostMountCount2 = 0;
718
+ function prompt(opts) {
719
+ return new Promise((resolve) => {
720
+ pending2 = { ...opts, resolve };
721
+ if (notifyHost2) {
722
+ notifyHost2();
723
+ } else if (NODE_ENV2 !== "production") {
724
+ console.warn("[PromptDialog] prompt() called but no <PromptHost /> is mounted");
725
+ }
726
+ });
727
+ }
728
+ function PromptHost() {
729
+ const [state, setState] = React2.useState(null);
730
+ const [value, setValue] = React2.useState("");
731
+ const [confirmValue, setConfirmValue] = React2.useState("");
732
+ const [error, setError] = React2.useState(null);
733
+ const submittingRef = React2.useRef(false);
734
+ React2.useEffect(() => {
735
+ hostMountCount2 += 1;
736
+ if (hostMountCount2 > 1 && NODE_ENV2 !== "production") {
737
+ console.warn("[PromptDialog] multiple <PromptHost /> instances mounted");
738
+ }
739
+ notifyHost2 = () => {
740
+ setValue(pending2?.defaultValue ?? "");
741
+ setConfirmValue("");
742
+ setError(null);
743
+ setState(pending2);
744
+ };
745
+ if (pending2) notifyHost2();
746
+ return () => {
747
+ hostMountCount2 -= 1;
748
+ notifyHost2 = null;
749
+ };
750
+ }, []);
751
+ const close = React2.useCallback(
752
+ (result) => {
753
+ if (submittingRef.current) return;
754
+ submittingRef.current = true;
755
+ state?.resolve(result);
756
+ pending2 = null;
757
+ setState(null);
758
+ requestAnimationFrame(() => {
759
+ submittingRef.current = false;
760
+ });
761
+ },
762
+ [state]
763
+ );
764
+ const submit = React2.useCallback(() => {
765
+ if (!state) return;
766
+ const v = value;
767
+ if (state.minLength && v.length < state.minLength) {
768
+ setError(`must be at least ${state.minLength} characters`);
769
+ return;
770
+ }
771
+ if (state.confirmField && v !== confirmValue) {
772
+ setError("the two entries do not match");
773
+ return;
774
+ }
775
+ if (state.validate) {
776
+ const msg = state.validate(v);
777
+ if (msg) {
778
+ setError(msg);
779
+ return;
780
+ }
781
+ }
782
+ close(v);
783
+ }, [state, value, confirmValue, close]);
784
+ if (!state) return null;
785
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Root, { open: true, onOpenChange: (open) => !open && close(null), children: /* @__PURE__ */ jsxRuntime.jsxs(DialogPrimitive__namespace.Portal, { children: [
786
+ /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Overlay, { className: "fixed inset-0 z-50 bg-black/50 backdrop-blur-sm" }),
787
+ /* @__PURE__ */ jsxRuntime.jsxs(
788
+ DialogPrimitive__namespace.Content,
789
+ {
790
+ className: "bg-card border-border fixed top-1/2 left-1/2 z-50 w-[90vw] max-w-md -translate-x-1/2 -translate-y-1/2 border shadow-lg outline-none",
791
+ onKeyDown: (e) => {
792
+ if (e.key === "Enter" && !e.shiftKey) {
793
+ e.preventDefault();
794
+ submit();
795
+ }
796
+ },
797
+ children: [
798
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "terminal-title", children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-primary flex items-center gap-1.5", children: [
799
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pencil, { className: "size-3.5" }),
800
+ state.title
801
+ ] }) }),
802
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4 p-4 sm:p-5", children: [
803
+ /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Title, { className: "sr-only", children: state.title }),
804
+ state.message && /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-muted-foreground font-mono text-xs leading-relaxed whitespace-pre-wrap", children: state.message }) }),
805
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
806
+ state.label && /* @__PURE__ */ jsxRuntime.jsx(Label, { children: state.label }),
807
+ /* @__PURE__ */ jsxRuntime.jsx(
808
+ Input,
809
+ {
810
+ autoFocus: true,
811
+ type: state.secret ? "password" : "text",
812
+ value,
813
+ onChange: (e) => {
814
+ setValue(e.target.value);
815
+ setError(null);
816
+ },
817
+ placeholder: state.placeholder,
818
+ autoComplete: "off",
819
+ spellCheck: false,
820
+ className: (state.label ? "mt-2 " : "") + (state.secret ? "font-mono" : "")
821
+ }
822
+ )
823
+ ] }),
824
+ state.confirmField && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
825
+ /* @__PURE__ */ jsxRuntime.jsx(Label, { children: "confirm" }),
826
+ /* @__PURE__ */ jsxRuntime.jsx(
827
+ Input,
828
+ {
829
+ type: state.secret ? "password" : "text",
830
+ value: confirmValue,
831
+ onChange: (e) => {
832
+ setConfirmValue(e.target.value);
833
+ setError(null);
834
+ },
835
+ placeholder: "re-enter to confirm",
836
+ autoComplete: "off",
837
+ spellCheck: false,
838
+ className: "mt-2 " + (state.secret ? "font-mono" : "")
839
+ }
840
+ )
841
+ ] }),
842
+ error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-destructive font-mono text-xs", children: error }),
843
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center justify-end gap-2", children: [
844
+ /* @__PURE__ */ jsxRuntime.jsx(
845
+ Button,
846
+ {
847
+ variant: "outline",
848
+ onClick: () => close(null),
849
+ className: "font-mono text-[11px] tracking-widest uppercase",
850
+ children: state.cancelLabel ?? "cancel"
851
+ }
852
+ ),
853
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: submit, className: "font-display tracking-wide uppercase", children: state.confirmLabel ?? "ok" })
854
+ ] })
855
+ ] })
856
+ ]
857
+ }
858
+ )
859
+ ] }) });
860
+ }
861
+ function Modal({ open, onOpenChange, title, subtitle, children, actions, width = "wide" }) {
862
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Root, { open, onOpenChange, children: /* @__PURE__ */ jsxRuntime.jsxs(DialogPrimitive__namespace.Portal, { children: [
863
+ /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Overlay, { className: "bg-background/80 fixed inset-0 z-[100] backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0" }),
864
+ /* @__PURE__ */ jsxRuntime.jsxs(
865
+ DialogPrimitive__namespace.Content,
866
+ {
867
+ className: cn(
868
+ "terminal fixed top-[5vh] left-1/2 z-[110] flex max-h-[90vh] -translate-x-1/2 flex-col overflow-hidden rounded-sm border",
869
+ width === "wide" ? "w-[95vw] max-w-screen-2xl" : "w-[80vw] max-w-3xl",
870
+ "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"
871
+ ),
872
+ children: [
873
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "terminal-title flex shrink-0 items-center justify-between gap-3", children: [
874
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
875
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "terminal-dot", "aria-hidden": true }),
876
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "terminal-dot opacity-70", "aria-hidden": true }),
877
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "terminal-dot opacity-50", "aria-hidden": true }),
878
+ /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Title, { className: "ml-2 truncate", children: title }),
879
+ subtitle && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-muted-foreground/70 ml-1 truncate text-[10px] normal-case tracking-normal", children: [
880
+ "\xB7 ",
881
+ subtitle
882
+ ] })
883
+ ] }),
884
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
885
+ actions,
886
+ /* @__PURE__ */ jsxRuntime.jsx(
887
+ DialogPrimitive__namespace.Close,
888
+ {
889
+ "aria-label": "close",
890
+ className: "text-muted-foreground hover:text-foreground inline-flex h-6 w-6 items-center justify-center rounded-sm",
891
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "size-3.5" })
892
+ }
893
+ )
894
+ ] })
895
+ ] }),
896
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-y-auto p-4 sm:p-6", children })
897
+ ]
898
+ }
899
+ )
900
+ ] }) });
901
+ }
902
+ function Pagination({ page, pageSize, total, onPage, className }) {
903
+ if (total <= pageSize) return null;
904
+ const start = page * pageSize;
905
+ const shown = Math.max(0, Math.min(pageSize, total - start));
906
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between " + (className ?? "mt-3"), children: [
907
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-muted-foreground/70 font-mono text-[10px]", children: [
908
+ start + 1,
909
+ "\u2013",
910
+ start + shown,
911
+ " of ",
912
+ total
913
+ ] }),
914
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2", children: [
915
+ /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", size: "sm", onClick: () => onPage(page - 1), disabled: page === 0, children: [
916
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, { className: "size-4" }),
917
+ " prev"
918
+ ] }),
919
+ /* @__PURE__ */ jsxRuntime.jsxs(
920
+ Button,
921
+ {
922
+ variant: "outline",
923
+ size: "sm",
924
+ onClick: () => onPage(page + 1),
925
+ disabled: start + pageSize >= total,
926
+ children: [
927
+ "next ",
928
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "size-4" })
929
+ ]
930
+ }
931
+ )
932
+ ] })
933
+ ] });
934
+ }
935
+ function Popover({ ...props }) {
936
+ return /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Root, { "data-slot": "popover", ...props });
937
+ }
938
+ function PopoverTrigger({ ...props }) {
939
+ return /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Trigger, { "data-slot": "popover-trigger", ...props });
940
+ }
941
+ function PopoverContent({
942
+ className,
943
+ align = "center",
944
+ sideOffset = 4,
945
+ ...props
946
+ }) {
947
+ return /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
948
+ PopoverPrimitive__namespace.Content,
949
+ {
950
+ "data-slot": "popover-content",
951
+ align,
952
+ sideOffset,
953
+ className: cn(
954
+ "bg-popover text-popover-foreground 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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
955
+ className
956
+ ),
957
+ ...props
958
+ }
959
+ ) });
960
+ }
961
+ function PopoverAnchor({ ...props }) {
962
+ return /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Anchor, { "data-slot": "popover-anchor", ...props });
963
+ }
964
+ var Accordion = AccordionPrimitive__namespace.Root;
965
+ var AccordionItem = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(AccordionPrimitive__namespace.Item, { ref, className: cn("border-b", className), ...props }));
966
+ AccordionItem.displayName = "AccordionItem";
967
+ var AccordionTrigger = React2__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(AccordionPrimitive__namespace.Header, { className: "flex", children: /* @__PURE__ */ jsxRuntime.jsxs(
968
+ AccordionPrimitive__namespace.Trigger,
969
+ {
970
+ ref,
971
+ className: cn(
972
+ "flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",
973
+ className
974
+ ),
975
+ ...props,
976
+ children: [
977
+ children,
978
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-4 w-4 shrink-0 transition-transform duration-200" })
979
+ ]
980
+ }
981
+ ) }));
982
+ AccordionTrigger.displayName = AccordionPrimitive__namespace.Trigger.displayName;
983
+ var AccordionContent = React2__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
984
+ AccordionPrimitive__namespace.Content,
985
+ {
986
+ ref,
987
+ className: "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm transition-all",
988
+ ...props,
989
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("pt-0 pb-4", className), children })
990
+ }
991
+ ));
992
+ AccordionContent.displayName = AccordionPrimitive__namespace.Content.displayName;
993
+ function Select({ ...props }) {
994
+ return /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Root, { "data-slot": "select", ...props });
995
+ }
996
+ function SelectGroup({ ...props }) {
997
+ return /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Group, { "data-slot": "select-group", ...props });
998
+ }
999
+ function SelectValue({ ...props }) {
1000
+ return /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Value, { "data-slot": "select-value", ...props });
1001
+ }
1002
+ function SelectTrigger({
1003
+ className,
1004
+ size = "default",
1005
+ children,
1006
+ ...props
1007
+ }) {
1008
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1009
+ SelectPrimitive__namespace.Trigger,
1010
+ {
1011
+ "data-slot": "select-trigger",
1012
+ "data-size": size,
1013
+ className: cn(
1014
+ "border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive bg-input/30 hover:bg-input/50 dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow,background-color] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
1015
+ className
1016
+ ),
1017
+ ...props,
1018
+ children: [
1019
+ children,
1020
+ /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Icon, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDownIcon, { className: "size-4 opacity-50" }) })
1021
+ ]
1022
+ }
1023
+ );
1024
+ }
1025
+ function SelectContent({
1026
+ className,
1027
+ children,
1028
+ position = "popper",
1029
+ ...props
1030
+ }) {
1031
+ return /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
1032
+ SelectPrimitive__namespace.Content,
1033
+ {
1034
+ "data-slot": "select-content",
1035
+ className: cn(
1036
+ "bg-popover text-popover-foreground 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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",
1037
+ position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
1038
+ className
1039
+ ),
1040
+ position,
1041
+ ...props,
1042
+ children: [
1043
+ /* @__PURE__ */ jsxRuntime.jsx(SelectScrollUpButton, {}),
1044
+ /* @__PURE__ */ jsxRuntime.jsx(
1045
+ SelectPrimitive__namespace.Viewport,
1046
+ {
1047
+ className: cn(
1048
+ "p-1",
1049
+ position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
1050
+ ),
1051
+ children
1052
+ }
1053
+ ),
1054
+ /* @__PURE__ */ jsxRuntime.jsx(SelectScrollDownButton, {})
1055
+ ]
1056
+ }
1057
+ ) });
1058
+ }
1059
+ function SelectLabel({ className, ...props }) {
1060
+ return /* @__PURE__ */ jsxRuntime.jsx(
1061
+ SelectPrimitive__namespace.Label,
1062
+ {
1063
+ "data-slot": "select-label",
1064
+ className: cn("text-muted-foreground px-2 py-1.5 text-xs", className),
1065
+ ...props
1066
+ }
1067
+ );
1068
+ }
1069
+ function SelectItem({
1070
+ className,
1071
+ children,
1072
+ ...props
1073
+ }) {
1074
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1075
+ SelectPrimitive__namespace.Item,
1076
+ {
1077
+ "data-slot": "select-item",
1078
+ className: cn(
1079
+ "focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
1080
+ className
1081
+ ),
1082
+ ...props,
1083
+ children: [
1084
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckIcon, { className: "size-4" }) }) }),
1085
+ /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemText, { children })
1086
+ ]
1087
+ }
1088
+ );
1089
+ }
1090
+ function SelectSeparator({
1091
+ className,
1092
+ ...props
1093
+ }) {
1094
+ return /* @__PURE__ */ jsxRuntime.jsx(
1095
+ SelectPrimitive__namespace.Separator,
1096
+ {
1097
+ "data-slot": "select-separator",
1098
+ className: cn("bg-border pointer-events-none -mx-1 my-1 h-px", className),
1099
+ ...props
1100
+ }
1101
+ );
1102
+ }
1103
+ function SelectScrollUpButton({
1104
+ className,
1105
+ ...props
1106
+ }) {
1107
+ return /* @__PURE__ */ jsxRuntime.jsx(
1108
+ SelectPrimitive__namespace.ScrollUpButton,
1109
+ {
1110
+ "data-slot": "select-scroll-up-button",
1111
+ className: cn("flex cursor-default items-center justify-center py-1", className),
1112
+ ...props,
1113
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronUpIcon, { className: "size-4" })
1114
+ }
1115
+ );
1116
+ }
1117
+ function SelectScrollDownButton({
1118
+ className,
1119
+ ...props
1120
+ }) {
1121
+ return /* @__PURE__ */ jsxRuntime.jsx(
1122
+ SelectPrimitive__namespace.ScrollDownButton,
1123
+ {
1124
+ "data-slot": "select-scroll-down-button",
1125
+ className: cn("flex cursor-default items-center justify-center py-1", className),
1126
+ ...props,
1127
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDownIcon, { className: "size-4" })
1128
+ }
1129
+ );
1130
+ }
1131
+ var Toaster = ({ ...props }) => {
1132
+ const { theme = "system" } = nextThemes.useTheme();
1133
+ return /* @__PURE__ */ jsxRuntime.jsx(
1134
+ sonner.Toaster,
1135
+ {
1136
+ theme,
1137
+ className: "toaster group",
1138
+ toastOptions: {
1139
+ classNames: {
1140
+ toast: "group toast group-[.toaster]:bg-card group-[.toaster]:text-card-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",
1141
+ description: "group-[.toast]:text-muted-foreground",
1142
+ actionButton: "group-[.toast]:bg-foreground group-[.toast]:text-background",
1143
+ cancelButton: "group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",
1144
+ error: "group-[.toaster]:!bg-card group-[.toaster]:!text-foreground group-[.toaster]:!border-border",
1145
+ success: "group-[.toaster]:!bg-card group-[.toaster]:!text-foreground group-[.toaster]:!border-border",
1146
+ warning: "group-[.toaster]:!bg-card group-[.toaster]:!text-foreground group-[.toaster]:!border-border",
1147
+ info: "group-[.toaster]:!bg-card group-[.toaster]:!text-muted-foreground group-[.toaster]:!border-border"
1148
+ }
1149
+ },
1150
+ style: {
1151
+ "--normal-bg": "var(--card)",
1152
+ "--normal-text": "var(--card-foreground)",
1153
+ "--normal-border": "var(--border)",
1154
+ "--error-bg": "var(--card)",
1155
+ "--error-text": "var(--foreground)",
1156
+ "--error-border": "var(--border)",
1157
+ "--success-bg": "var(--card)",
1158
+ "--success-text": "var(--foreground)",
1159
+ "--success-border": "var(--border)",
1160
+ "--warning-bg": "var(--card)",
1161
+ "--warning-text": "var(--foreground)",
1162
+ "--warning-border": "var(--border)",
1163
+ "--info-bg": "var(--card)",
1164
+ "--info-text": "var(--muted-foreground)",
1165
+ "--info-border": "var(--border)"
1166
+ },
1167
+ ...props
1168
+ }
1169
+ );
1170
+ };
1171
+
1172
+ exports.Accordion = Accordion;
1173
+ exports.AccordionContent = AccordionContent;
1174
+ exports.AccordionItem = AccordionItem;
1175
+ exports.AccordionTrigger = AccordionTrigger;
1176
+ exports.Alert = Alert;
1177
+ exports.AlertDescription = AlertDescription;
1178
+ exports.AlertTitle = AlertTitle;
1179
+ exports.AlertWithAction = AlertWithAction;
1180
+ exports.AlertWithCountdown = AlertWithCountdown;
1181
+ exports.Badge = Badge;
1182
+ exports.Button = Button;
1183
+ exports.ConfirmHost = ConfirmHost;
1184
+ exports.Dialog = Dialog;
1185
+ exports.DialogClose = DialogClose;
1186
+ exports.DialogContent = DialogContent;
1187
+ exports.DialogDescription = DialogDescription;
1188
+ exports.DialogFooter = DialogFooter;
1189
+ exports.DialogHeader = DialogHeader;
1190
+ exports.DialogOverlay = DialogOverlay;
1191
+ exports.DialogPortal = DialogPortal;
1192
+ exports.DialogTitle = DialogTitle;
1193
+ exports.DialogTrigger = DialogTrigger;
1194
+ exports.ErrorBoundary = ErrorBoundary;
1195
+ exports.Input = Input;
1196
+ exports.Label = Label;
1197
+ exports.Modal = Modal;
1198
+ exports.Pagination = Pagination;
1199
+ exports.Popover = Popover;
1200
+ exports.PopoverAnchor = PopoverAnchor;
1201
+ exports.PopoverContent = PopoverContent;
1202
+ exports.PopoverTrigger = PopoverTrigger;
1203
+ exports.PromptHost = PromptHost;
1204
+ exports.Select = Select;
1205
+ exports.SelectContent = SelectContent;
1206
+ exports.SelectGroup = SelectGroup;
1207
+ exports.SelectItem = SelectItem;
1208
+ exports.SelectLabel = SelectLabel;
1209
+ exports.SelectScrollDownButton = SelectScrollDownButton;
1210
+ exports.SelectScrollUpButton = SelectScrollUpButton;
1211
+ exports.SelectSeparator = SelectSeparator;
1212
+ exports.SelectTrigger = SelectTrigger;
1213
+ exports.SelectValue = SelectValue;
1214
+ exports.Separator = Separator;
1215
+ exports.Sheet = Sheet;
1216
+ exports.SheetContent = SheetContent;
1217
+ exports.SheetDescription = SheetDescription;
1218
+ exports.SheetHeader = SheetHeader;
1219
+ exports.SheetOverlay = SheetOverlay;
1220
+ exports.SheetPortal = SheetPortal;
1221
+ exports.SheetTitle = SheetTitle;
1222
+ exports.SheetTrigger = SheetTrigger;
1223
+ exports.Skeleton = Skeleton;
1224
+ exports.Textarea = Textarea;
1225
+ exports.ThemeToggle = ThemeToggle;
1226
+ exports.ThemeToggleLink = ThemeToggleLink;
1227
+ exports.Toaster = Toaster;
1228
+ exports.Working = Working;
1229
+ exports.WorkingPanel = WorkingPanel;
1230
+ exports.badgeVariants = badgeVariants;
1231
+ exports.buttonVariants = buttonVariants;
1232
+ exports.confirm = confirm;
1233
+ exports.prompt = prompt;
1234
+ //# sourceMappingURL=primitives.js.map
1235
+ //# sourceMappingURL=primitives.js.map