@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.
package/dist/index.js ADDED
@@ -0,0 +1,1588 @@
1
+ 'use strict';
2
+
3
+ var clsx = require('clsx');
4
+ var tailwindMerge = require('tailwind-merge');
5
+ var React2 = require('react');
6
+ var jsxRuntime = require('react/jsx-runtime');
7
+ var nextThemes = require('next-themes');
8
+ var lucideReact = require('lucide-react');
9
+ var reactSlot = require('@radix-ui/react-slot');
10
+ var classVarianceAuthority = require('class-variance-authority');
11
+ var LabelPrimitive = require('@radix-ui/react-label');
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
+ var ui_star = require('@orangecheck/ui');
19
+
20
+ function _interopNamespace(e) {
21
+ if (e && e.__esModule) return e;
22
+ var n = Object.create(null);
23
+ if (e) {
24
+ Object.keys(e).forEach(function (k) {
25
+ if (k !== 'default') {
26
+ var d = Object.getOwnPropertyDescriptor(e, k);
27
+ Object.defineProperty(n, k, d.get ? d : {
28
+ enumerable: true,
29
+ get: function () { return e[k]; }
30
+ });
31
+ }
32
+ });
33
+ }
34
+ n.default = e;
35
+ return Object.freeze(n);
36
+ }
37
+
38
+ var React2__namespace = /*#__PURE__*/_interopNamespace(React2);
39
+ var LabelPrimitive__namespace = /*#__PURE__*/_interopNamespace(LabelPrimitive);
40
+ var SeparatorPrimitive__namespace = /*#__PURE__*/_interopNamespace(SeparatorPrimitive);
41
+ var DialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(DialogPrimitive);
42
+ var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespace(PopoverPrimitive);
43
+ var AccordionPrimitive__namespace = /*#__PURE__*/_interopNamespace(AccordionPrimitive);
44
+ var SelectPrimitive__namespace = /*#__PURE__*/_interopNamespace(SelectPrimitive);
45
+ var ui_star__namespace = /*#__PURE__*/_interopNamespace(ui_star);
46
+
47
+ var __defProp = Object.defineProperty;
48
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
49
+ var __getOwnPropNames = Object.getOwnPropertyNames;
50
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
51
+ var __export = (target, all) => {
52
+ for (var name in all)
53
+ __defProp(target, name, { get: all[name], enumerable: true });
54
+ };
55
+ var __copyProps = (to, from, except, desc) => {
56
+ if (from && typeof from === "object" || typeof from === "function") {
57
+ for (let key of __getOwnPropNames(from))
58
+ if (!__hasOwnProp.call(to, key) && key !== except)
59
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
60
+ }
61
+ return to;
62
+ };
63
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget);
64
+
65
+ // src/index.ts
66
+ var src_exports = {};
67
+ __export(src_exports, {
68
+ Accordion: () => Accordion,
69
+ AccordionContent: () => AccordionContent,
70
+ AccordionItem: () => AccordionItem,
71
+ AccordionTrigger: () => AccordionTrigger,
72
+ Alert: () => Alert,
73
+ AlertDescription: () => AlertDescription,
74
+ AlertTitle: () => AlertTitle,
75
+ AlertWithAction: () => AlertWithAction,
76
+ AlertWithCountdown: () => AlertWithCountdown,
77
+ Badge: () => Badge,
78
+ Button: () => Button,
79
+ ConfirmHost: () => ConfirmHost,
80
+ DEFAULT_OC_THEME: () => DEFAULT_OC_THEME,
81
+ Dialog: () => Dialog,
82
+ DialogClose: () => DialogClose,
83
+ DialogContent: () => DialogContent,
84
+ DialogDescription: () => DialogDescription,
85
+ DialogFooter: () => DialogFooter,
86
+ DialogHeader: () => DialogHeader,
87
+ DialogOverlay: () => DialogOverlay,
88
+ DialogPortal: () => DialogPortal,
89
+ DialogTitle: () => DialogTitle,
90
+ DialogTrigger: () => DialogTrigger,
91
+ ErrorBoundary: () => ErrorBoundary,
92
+ Input: () => Input,
93
+ Label: () => Label,
94
+ Modal: () => Modal,
95
+ OC_SKIN_COOKIE: () => OC_SKIN_COOKIE,
96
+ OC_THEMES: () => OC_THEMES,
97
+ OcThemeBridge: () => OcThemeBridge,
98
+ OcThemePicker: () => OcThemePicker,
99
+ OcThemeProvider: () => OcThemeProvider,
100
+ Pagination: () => Pagination,
101
+ Popover: () => Popover,
102
+ PopoverAnchor: () => PopoverAnchor,
103
+ PopoverContent: () => PopoverContent,
104
+ PopoverTrigger: () => PopoverTrigger,
105
+ PromptHost: () => PromptHost,
106
+ Select: () => Select,
107
+ SelectContent: () => SelectContent,
108
+ SelectGroup: () => SelectGroup,
109
+ SelectItem: () => SelectItem,
110
+ SelectLabel: () => SelectLabel,
111
+ SelectScrollDownButton: () => SelectScrollDownButton,
112
+ SelectScrollUpButton: () => SelectScrollUpButton,
113
+ SelectSeparator: () => SelectSeparator,
114
+ SelectTrigger: () => SelectTrigger,
115
+ SelectValue: () => SelectValue,
116
+ Separator: () => Separator,
117
+ Sheet: () => Sheet,
118
+ SheetContent: () => SheetContent,
119
+ SheetDescription: () => SheetDescription,
120
+ SheetHeader: () => SheetHeader,
121
+ SheetOverlay: () => SheetOverlay,
122
+ SheetPortal: () => SheetPortal,
123
+ SheetTitle: () => SheetTitle,
124
+ SheetTrigger: () => SheetTrigger,
125
+ Skeleton: () => Skeleton,
126
+ Textarea: () => Textarea,
127
+ ThemeToggle: () => ThemeToggle,
128
+ ThemeToggleLink: () => ThemeToggleLink,
129
+ Toaster: () => Toaster,
130
+ Working: () => Working,
131
+ WorkingPanel: () => WorkingPanel,
132
+ badgeVariants: () => badgeVariants,
133
+ buttonVariants: () => buttonVariants,
134
+ cn: () => cn,
135
+ confirm: () => confirm,
136
+ getOcThemeInitScript: () => getOcThemeInitScript,
137
+ isKnownTheme: () => isKnownTheme,
138
+ prompt: () => prompt,
139
+ resolveTheme: () => resolveTheme,
140
+ useOcSkin: () => useOcSkin
141
+ });
142
+ function cn(...inputs) {
143
+ return tailwindMerge.twMerge(clsx.clsx(inputs));
144
+ }
145
+
146
+ // src/tokens/themes.ts
147
+ var OC_THEMES = [
148
+ {
149
+ id: "orangecheck",
150
+ label: "orangecheck",
151
+ description: "the default \u2014 Bitcoin-orange, sharp 0.25rem corners, Inter + JetBrains Mono"
152
+ },
153
+ {
154
+ id: "midnight",
155
+ label: "midnight",
156
+ description: "indigo on slate, softer rounded 0.625rem corners, Manrope sans \u2014 calmer, SaaS-ier"
157
+ },
158
+ {
159
+ id: "phosphor",
160
+ label: "phosphor",
161
+ description: "CRT terminal green, hard 0.125rem corners, fully monospace \u2014 far from orange"
162
+ },
163
+ {
164
+ id: "aurora",
165
+ label: "aurora",
166
+ description: "cool teal, generous 0.75rem corners, soft elevation \u2014 flips the flat ethos"
167
+ }
168
+ ];
169
+ var DEFAULT_OC_THEME = "orangecheck";
170
+ function isKnownTheme(id) {
171
+ return !!id && OC_THEMES.some((t) => t.id === id);
172
+ }
173
+ function resolveTheme(id) {
174
+ return isKnownTheme(id) ? id : DEFAULT_OC_THEME;
175
+ }
176
+ var OC_SKIN_COOKIE = "oc_skin";
177
+ var ONE_YEAR = 60 * 60 * 24 * 365;
178
+ var ATTR = "data-oc-theme";
179
+ function readSkinCookie() {
180
+ if (typeof document === "undefined") return null;
181
+ const prefix = `${OC_SKIN_COOKIE}=`;
182
+ for (const part of document.cookie.split(";")) {
183
+ const trimmed = part.trim();
184
+ if (trimmed.startsWith(prefix)) {
185
+ const v = decodeURIComponent(trimmed.slice(prefix.length));
186
+ return v.length > 0 ? v : null;
187
+ }
188
+ }
189
+ return null;
190
+ }
191
+ function writeSkinCookie(value) {
192
+ if (typeof document === "undefined") return;
193
+ const isLocal = location.hostname === "localhost" || location.hostname === "127.0.0.1";
194
+ const parts = [
195
+ `${OC_SKIN_COOKIE}=${encodeURIComponent(value)}`,
196
+ "Path=/",
197
+ `Max-Age=${ONE_YEAR}`,
198
+ "SameSite=Lax"
199
+ ];
200
+ if (!isLocal) {
201
+ parts.push("Domain=.ochk.io");
202
+ parts.push("Secure");
203
+ }
204
+ document.cookie = parts.join("; ");
205
+ }
206
+ function applyAttr(skin) {
207
+ if (typeof document === "undefined") return;
208
+ document.documentElement.setAttribute(ATTR, skin);
209
+ }
210
+ var OcSkinContext = React2.createContext(null);
211
+ function OcThemeProvider({ children, defaultSkin = DEFAULT_OC_THEME }) {
212
+ const [skin, setSkinState] = React2.useState(() => resolveTheme(defaultSkin));
213
+ const hydratedRef = React2.useRef(false);
214
+ React2.useEffect(() => {
215
+ if (hydratedRef.current) return;
216
+ hydratedRef.current = true;
217
+ const fromCookie = resolveTheme(readSkinCookie() ?? defaultSkin);
218
+ applyAttr(fromCookie);
219
+ setSkinState(fromCookie);
220
+ }, [defaultSkin]);
221
+ React2.useEffect(() => {
222
+ function sync() {
223
+ const fromCookie = resolveTheme(readSkinCookie() ?? skin);
224
+ if (fromCookie !== skin) {
225
+ applyAttr(fromCookie);
226
+ setSkinState(fromCookie);
227
+ }
228
+ }
229
+ window.addEventListener("focus", sync);
230
+ document.addEventListener("visibilitychange", sync);
231
+ return () => {
232
+ window.removeEventListener("focus", sync);
233
+ document.removeEventListener("visibilitychange", sync);
234
+ };
235
+ }, [skin]);
236
+ const setSkin = React2.useCallback((id) => {
237
+ const next = resolveTheme(id);
238
+ applyAttr(next);
239
+ writeSkinCookie(next);
240
+ setSkinState(next);
241
+ }, []);
242
+ const value = React2.useMemo(
243
+ () => ({ skin, setSkin, themes: OC_THEMES }),
244
+ [skin, setSkin]
245
+ );
246
+ return /* @__PURE__ */ jsxRuntime.jsx(OcSkinContext.Provider, { value, children });
247
+ }
248
+ function useOcSkin() {
249
+ const ctx = React2.useContext(OcSkinContext);
250
+ if (!ctx) {
251
+ throw new Error("useOcSkin must be used within <OcThemeProvider>");
252
+ }
253
+ return ctx;
254
+ }
255
+ function getOcThemeInitScript(defaultSkin = DEFAULT_OC_THEME) {
256
+ return `(function(){try{var m=document.cookie.match(/(?:^|; )${OC_SKIN_COOKIE}=([^;]*)/);var s=m?decodeURIComponent(m[1]):'${defaultSkin}';if(!s){s='${defaultSkin}';}document.documentElement.setAttribute('${ATTR}',s);}catch(e){document.documentElement.setAttribute('${ATTR}','${defaultSkin}');}})();`;
257
+ }
258
+ var COOKIE = "oc_theme";
259
+ var ALLOWED = /* @__PURE__ */ new Set(["light", "dark", "system"]);
260
+ var ONE_YEAR2 = 60 * 60 * 24 * 365;
261
+ function readCookie(name) {
262
+ if (typeof document === "undefined") return null;
263
+ const prefix = `${name}=`;
264
+ for (const part of document.cookie.split(";")) {
265
+ const trimmed = part.trim();
266
+ if (trimmed.startsWith(prefix)) {
267
+ const v = decodeURIComponent(trimmed.slice(prefix.length));
268
+ return v.length > 0 ? v : null;
269
+ }
270
+ }
271
+ return null;
272
+ }
273
+ function writeCookie(value) {
274
+ if (typeof document === "undefined") return;
275
+ if (!ALLOWED.has(value)) return;
276
+ const isLocal = location.hostname === "localhost" || location.hostname === "127.0.0.1";
277
+ const parts = [
278
+ `${COOKIE}=${encodeURIComponent(value)}`,
279
+ "Path=/",
280
+ `Max-Age=${ONE_YEAR2}`,
281
+ "SameSite=Lax"
282
+ ];
283
+ if (!isLocal) {
284
+ parts.push("Domain=.ochk.io");
285
+ parts.push("Secure");
286
+ }
287
+ document.cookie = parts.join("; ");
288
+ }
289
+ function OcThemeBridge() {
290
+ const { theme, setTheme } = nextThemes.useTheme();
291
+ const hydratedRef = React2.useRef(false);
292
+ React2.useEffect(() => {
293
+ if (hydratedRef.current) return;
294
+ hydratedRef.current = true;
295
+ const cookieValue = readCookie(COOKIE);
296
+ if (cookieValue && ALLOWED.has(cookieValue) && cookieValue !== theme) {
297
+ setTheme(cookieValue);
298
+ }
299
+ }, [theme, setTheme]);
300
+ React2.useEffect(() => {
301
+ if (!hydratedRef.current) return;
302
+ if (!theme) return;
303
+ writeCookie(theme);
304
+ }, [theme]);
305
+ return null;
306
+ }
307
+ function OcThemePicker({ className, triggerClassName, popoverClassName }) {
308
+ const { skin, setSkin, themes } = useOcSkin();
309
+ const [open, setOpen] = React2.useState(false);
310
+ const rootRef = React2.useRef(null);
311
+ React2.useEffect(() => {
312
+ if (!open) return;
313
+ function onDown(e) {
314
+ if (rootRef.current && !rootRef.current.contains(e.target)) setOpen(false);
315
+ }
316
+ function onKey(e) {
317
+ if (e.key === "Escape") setOpen(false);
318
+ }
319
+ document.addEventListener("mousedown", onDown);
320
+ document.addEventListener("keydown", onKey);
321
+ return () => {
322
+ document.removeEventListener("mousedown", onDown);
323
+ document.removeEventListener("keydown", onKey);
324
+ };
325
+ }, [open]);
326
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: rootRef, className: cn("relative", className), children: [
327
+ /* @__PURE__ */ jsxRuntime.jsx(
328
+ "button",
329
+ {
330
+ type: "button",
331
+ "aria-label": "choose theme",
332
+ "aria-haspopup": "menu",
333
+ "aria-expanded": open,
334
+ title: "choose theme",
335
+ onClick: () => setOpen((v) => !v),
336
+ className: cn(
337
+ "text-muted-foreground hover:text-foreground inline-flex size-9 items-center justify-center rounded-md transition-colors outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50",
338
+ triggerClassName
339
+ ),
340
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Palette, { className: "size-4", "aria-hidden": true })
341
+ }
342
+ ),
343
+ open && /* @__PURE__ */ jsxRuntime.jsxs(
344
+ "div",
345
+ {
346
+ role: "menu",
347
+ className: cn(
348
+ "bg-popover text-popover-foreground absolute right-0 z-50 mt-2 w-64 overflow-hidden rounded-md border shadow-md",
349
+ popoverClassName
350
+ ),
351
+ children: [
352
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "label-mono text-muted-foreground px-3 pt-3 pb-1", children: "theme" }),
353
+ /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "pb-1", children: themes.map((t) => {
354
+ const active = t.id === skin;
355
+ return /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsxs(
356
+ "button",
357
+ {
358
+ type: "button",
359
+ role: "menuitemradio",
360
+ "aria-checked": active,
361
+ onClick: () => {
362
+ setSkin(t.id);
363
+ setOpen(false);
364
+ },
365
+ className: cn(
366
+ "hover:bg-accent hover:text-accent-foreground flex w-full items-start gap-2 px-3 py-2 text-left transition-colors",
367
+ active && "text-foreground"
368
+ ),
369
+ children: [
370
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mt-0.5 size-4 shrink-0", children: active && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "size-4 text-primary", "aria-hidden": true }) }),
371
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "min-w-0", children: [
372
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block text-sm font-medium", children: t.label }),
373
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground block text-xs leading-snug", children: t.description })
374
+ ] })
375
+ ]
376
+ }
377
+ ) }, t.id);
378
+ }) })
379
+ ]
380
+ }
381
+ )
382
+ ] });
383
+ }
384
+ var buttonVariants = classVarianceAuthority.cva(
385
+ "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",
386
+ {
387
+ variants: {
388
+ variant: {
389
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
390
+ destructive: "bg-destructive hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 text-white",
391
+ 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",
392
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
393
+ ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
394
+ link: "text-primary underline-offset-4 hover:underline"
395
+ },
396
+ size: {
397
+ default: "h-9 px-4 py-2 has-[>svg]:px-3",
398
+ sm: "h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",
399
+ lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
400
+ icon: "size-9"
401
+ }
402
+ },
403
+ defaultVariants: {
404
+ variant: "default",
405
+ size: "default"
406
+ }
407
+ }
408
+ );
409
+ function Button({
410
+ className,
411
+ variant,
412
+ size,
413
+ asChild = false,
414
+ ...props
415
+ }) {
416
+ const Comp = asChild ? reactSlot.Slot : "button";
417
+ return /* @__PURE__ */ jsxRuntime.jsx(
418
+ Comp,
419
+ {
420
+ "data-slot": "button",
421
+ className: cn(buttonVariants({ variant, size, className })),
422
+ ...props
423
+ }
424
+ );
425
+ }
426
+ var badgeVariants = classVarianceAuthority.cva(
427
+ "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",
428
+ {
429
+ variants: {
430
+ variant: {
431
+ default: "bg-primary text-primary-foreground [a&]:hover:bg-primary/90 border-transparent",
432
+ secondary: "bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90 border-transparent",
433
+ destructive: "bg-destructive text-destructive-foreground [a&]:hover:bg-destructive/90 border-transparent",
434
+ warning: "bg-warning text-warning-foreground [a&]:hover:bg-warning/90 border-transparent",
435
+ success: "bg-success text-success-foreground [a&]:hover:bg-success/90 border-transparent",
436
+ info: "bg-info text-info-foreground [a&]:hover:bg-info/90 border-transparent",
437
+ outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"
438
+ }
439
+ },
440
+ defaultVariants: { variant: "default" }
441
+ }
442
+ );
443
+ function Badge({
444
+ className,
445
+ variant,
446
+ asChild = false,
447
+ ...props
448
+ }) {
449
+ const Comp = asChild ? reactSlot.Slot : "span";
450
+ return /* @__PURE__ */ jsxRuntime.jsx(Comp, { "data-slot": "badge", className: cn(badgeVariants({ variant }), className), ...props });
451
+ }
452
+ function Input({ className, type, ...props }) {
453
+ return /* @__PURE__ */ jsxRuntime.jsx(
454
+ "input",
455
+ {
456
+ type,
457
+ "data-slot": "input",
458
+ className: cn(
459
+ "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",
460
+ "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
461
+ "aria-invalid:ring-brand/25 dark:aria-invalid:ring-brand/35 aria-invalid:border-brand",
462
+ className
463
+ ),
464
+ ...props
465
+ }
466
+ );
467
+ }
468
+ function Label({ className, ...props }) {
469
+ return /* @__PURE__ */ jsxRuntime.jsx(
470
+ LabelPrimitive__namespace.Root,
471
+ {
472
+ "data-slot": "label",
473
+ className: cn(
474
+ "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",
475
+ className
476
+ ),
477
+ ...props
478
+ }
479
+ );
480
+ }
481
+ var alertVariants = classVarianceAuthority.cva(
482
+ "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",
483
+ {
484
+ variants: {
485
+ variant: {
486
+ default: "bg-card text-card-foreground",
487
+ destructive: "text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",
488
+ success: "text-success bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-success/90",
489
+ warning: "text-warning bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-warning/90"
490
+ }
491
+ },
492
+ defaultVariants: { variant: "default" }
493
+ }
494
+ );
495
+ function Alert({
496
+ className,
497
+ variant,
498
+ ...props
499
+ }) {
500
+ return /* @__PURE__ */ jsxRuntime.jsx(
501
+ "div",
502
+ {
503
+ "data-slot": "alert",
504
+ role: "alert",
505
+ className: cn(alertVariants({ variant }), className),
506
+ ...props
507
+ }
508
+ );
509
+ }
510
+ function AlertTitle({ className, ...props }) {
511
+ return /* @__PURE__ */ jsxRuntime.jsx(
512
+ "div",
513
+ {
514
+ "data-slot": "alert-title",
515
+ className: cn("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight", className),
516
+ ...props
517
+ }
518
+ );
519
+ }
520
+ function AlertDescription({ className, ...props }) {
521
+ return /* @__PURE__ */ jsxRuntime.jsx(
522
+ "div",
523
+ {
524
+ "data-slot": "alert-description",
525
+ className: cn(
526
+ "text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",
527
+ className
528
+ ),
529
+ ...props
530
+ }
531
+ );
532
+ }
533
+ function AlertWithAction({
534
+ variant = "default",
535
+ icon: Icon2,
536
+ title,
537
+ description,
538
+ actionLabel,
539
+ onAction,
540
+ actionVariant = "outline",
541
+ actionIcon,
542
+ actionDisabled,
543
+ actionContent,
544
+ className
545
+ }) {
546
+ return /* @__PURE__ */ jsxRuntime.jsxs(Alert, { variant, className, children: [
547
+ Icon2 && /* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "h-4 w-4" }),
548
+ title && /* @__PURE__ */ jsxRuntime.jsx(AlertTitle, { children: title }),
549
+ /* @__PURE__ */ jsxRuntime.jsxs(AlertDescription, { children: [
550
+ description,
551
+ (actionLabel || actionContent) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-3 flex items-center gap-2", children: [
552
+ actionContent,
553
+ actionLabel && onAction && /* @__PURE__ */ jsxRuntime.jsxs(
554
+ Button,
555
+ {
556
+ size: "sm",
557
+ variant: actionVariant,
558
+ onClick: onAction,
559
+ disabled: actionDisabled,
560
+ className: cn(!actionContent && "ml-auto"),
561
+ children: [
562
+ actionIcon,
563
+ actionLabel
564
+ ]
565
+ }
566
+ )
567
+ ] })
568
+ ] })
569
+ ] });
570
+ }
571
+ function AlertWithCountdown({
572
+ variant = "default",
573
+ icon: Icon2,
574
+ title,
575
+ description,
576
+ countdown,
577
+ countdownLabel,
578
+ countdownIcon,
579
+ actionLabel = "Check Now",
580
+ onAction,
581
+ actionIcon,
582
+ actionDisabled,
583
+ className
584
+ }) {
585
+ const label = countdownLabel ? countdownLabel.replace("{countdown}", countdown.toString()) : `Rechecking in ${countdown} second${countdown !== 1 ? "s" : ""}...`;
586
+ return /* @__PURE__ */ jsxRuntime.jsxs(Alert, { variant, className, children: [
587
+ Icon2 && /* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "h-4 w-4" }),
588
+ title && /* @__PURE__ */ jsxRuntime.jsx(AlertTitle, { children: title }),
589
+ /* @__PURE__ */ jsxRuntime.jsxs(AlertDescription, { children: [
590
+ description,
591
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-3 flex items-center gap-2 text-sm", children: [
592
+ countdownIcon,
593
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: label }),
594
+ onAction && /* @__PURE__ */ jsxRuntime.jsxs(
595
+ Button,
596
+ {
597
+ size: "sm",
598
+ variant: "outline",
599
+ onClick: onAction,
600
+ disabled: actionDisabled,
601
+ className: "ml-auto",
602
+ children: [
603
+ actionIcon,
604
+ actionLabel
605
+ ]
606
+ }
607
+ )
608
+ ] })
609
+ ] })
610
+ ] });
611
+ }
612
+ function Textarea({ className, ...props }) {
613
+ return /* @__PURE__ */ jsxRuntime.jsx(
614
+ "textarea",
615
+ {
616
+ "data-slot": "textarea",
617
+ className: cn(
618
+ "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",
619
+ "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
620
+ className
621
+ ),
622
+ ...props
623
+ }
624
+ );
625
+ }
626
+ function ThemeToggle({ className }) {
627
+ const { resolvedTheme, setTheme } = nextThemes.useTheme();
628
+ const [mounted, setMounted] = React2.useState(false);
629
+ React2.useEffect(() => setMounted(true), []);
630
+ const isDark = resolvedTheme === "dark";
631
+ return /* @__PURE__ */ jsxRuntime.jsx(
632
+ Button,
633
+ {
634
+ variant: "ghost",
635
+ size: "icon",
636
+ "aria-label": isDark ? "Switch to light mode" : "Switch to dark mode",
637
+ title: isDark ? "Switch to light mode" : "Switch to dark mode",
638
+ onClick: () => setTheme(isDark ? "light" : "dark"),
639
+ className: cn("text-muted-foreground hover:text-foreground", className),
640
+ 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" })
641
+ }
642
+ );
643
+ }
644
+ function ThemeToggleLink() {
645
+ const { resolvedTheme, setTheme } = nextThemes.useTheme();
646
+ const [mounted, setMounted] = React2.useState(false);
647
+ React2.useEffect(() => setMounted(true), []);
648
+ const isDark = mounted && resolvedTheme === "dark";
649
+ return /* @__PURE__ */ jsxRuntime.jsxs(
650
+ "button",
651
+ {
652
+ type: "button",
653
+ onClick: () => setTheme(isDark ? "light" : "dark"),
654
+ className: "hover:text-foreground flex w-full items-center justify-between px-2 py-2 text-left text-xs tracking-wide uppercase transition-colors",
655
+ children: [
656
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "tracking-wide lowercase", children: [
657
+ "> ",
658
+ mounted ? isDark ? "light mode" : "dark mode" : "theme"
659
+ ] }),
660
+ mounted && (isDark ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Sun, { className: "size-3.5" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Moon, { className: "size-3.5" }))
661
+ ]
662
+ }
663
+ );
664
+ }
665
+ function Working({ text, size = "md", progress, className }) {
666
+ const isSmall = size === "sm";
667
+ return /* @__PURE__ */ jsxRuntime.jsxs(
668
+ "span",
669
+ {
670
+ "aria-live": "polite",
671
+ className: cn(
672
+ "inline-flex items-center gap-2 font-mono",
673
+ isSmall ? "text-[11px]" : "text-xs",
674
+ "text-muted-foreground",
675
+ className
676
+ ),
677
+ children: [
678
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "oc-working-cursor", "aria-hidden": true, children: [
679
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "oc-working-dot", style: { animationDelay: "0ms" }, children: "\xB7" }),
680
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "oc-working-dot", style: { animationDelay: "140ms" }, children: "\xB7" }),
681
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "oc-working-dot", style: { animationDelay: "280ms" }, children: "\xB7" })
682
+ ] }),
683
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "oc-working-text", children: [
684
+ text,
685
+ progress && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-muted-foreground/60 ml-1.5", children: [
686
+ "[",
687
+ progress,
688
+ "]"
689
+ ] })
690
+ ] })
691
+ ]
692
+ }
693
+ );
694
+ }
695
+ function WorkingPanel({ text, progress }) {
696
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "terminal", children: [
697
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "terminal-title", children: [
698
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "terminal-dot" }),
699
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "terminal-dot" }),
700
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "terminal-dot" }),
701
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-2", children: "in progress" })
702
+ ] }),
703
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-3 p-5", children: /* @__PURE__ */ jsxRuntime.jsx(Working, { text, ...progress ? { progress } : {} }) })
704
+ ] });
705
+ }
706
+ var ErrorBoundary = class extends React2__namespace.Component {
707
+ constructor() {
708
+ super(...arguments);
709
+ this.state = { error: null };
710
+ this.reset = () => this.setState({ error: null });
711
+ }
712
+ static getDerivedStateFromError(error) {
713
+ return { error };
714
+ }
715
+ componentDidCatch(error, info) {
716
+ console.error("[ErrorBoundary]", error, info);
717
+ }
718
+ render() {
719
+ if (this.state.error) {
720
+ if (this.props.fallback) {
721
+ return this.props.fallback(this.state.error, this.reset);
722
+ }
723
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "container py-16", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "terminal", children: [
724
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "terminal-title", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-destructive flex items-center gap-1.5", children: "! fatal" }) }),
725
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3 p-5 font-mono text-xs leading-relaxed", children: [
726
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { children: [
727
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-destructive", children: [
728
+ "> ",
729
+ "err:"
730
+ ] }),
731
+ " ",
732
+ this.state.error.message || "unknown error"
733
+ ] }),
734
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-muted-foreground", children: [
735
+ "> ",
736
+ "this page crashed. reload to recover."
737
+ ] }),
738
+ /* @__PURE__ */ jsxRuntime.jsx(
739
+ "button",
740
+ {
741
+ type: "button",
742
+ onClick: this.reset,
743
+ 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",
744
+ children: "retry"
745
+ }
746
+ )
747
+ ] })
748
+ ] }) });
749
+ }
750
+ return this.props.children;
751
+ }
752
+ };
753
+ function Skeleton({ className }) {
754
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("bg-muted/40 animate-pulse rounded-sm", className) });
755
+ }
756
+ function Separator({
757
+ className,
758
+ orientation = "horizontal",
759
+ decorative = true,
760
+ ...props
761
+ }) {
762
+ return /* @__PURE__ */ jsxRuntime.jsx(
763
+ SeparatorPrimitive__namespace.Root,
764
+ {
765
+ "data-slot": "separator",
766
+ decorative,
767
+ orientation,
768
+ className: cn(
769
+ "bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
770
+ className
771
+ ),
772
+ ...props
773
+ }
774
+ );
775
+ }
776
+ function Sheet(props) {
777
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Root, { "data-slot": "sheet", ...props });
778
+ }
779
+ function SheetTrigger(props) {
780
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Trigger, { "data-slot": "sheet-trigger", ...props });
781
+ }
782
+ function SheetPortal(props) {
783
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Portal, { "data-slot": "sheet-portal", ...props });
784
+ }
785
+ function SheetOverlay({ className, ...props }) {
786
+ return /* @__PURE__ */ jsxRuntime.jsx(
787
+ DialogPrimitive__namespace.Overlay,
788
+ {
789
+ "data-slot": "sheet-overlay",
790
+ className: cn(
791
+ "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",
792
+ className
793
+ ),
794
+ ...props
795
+ }
796
+ );
797
+ }
798
+ function SheetContent({
799
+ className,
800
+ children,
801
+ side = "right",
802
+ ...props
803
+ }) {
804
+ const sideClasses = {
805
+ 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",
806
+ 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",
807
+ top: "inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
808
+ bottom: "inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom"
809
+ };
810
+ return /* @__PURE__ */ jsxRuntime.jsxs(SheetPortal, { children: [
811
+ /* @__PURE__ */ jsxRuntime.jsx(SheetOverlay, {}),
812
+ /* @__PURE__ */ jsxRuntime.jsxs(
813
+ DialogPrimitive__namespace.Content,
814
+ {
815
+ "data-slot": "sheet-content",
816
+ className: cn(
817
+ "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",
818
+ sideClasses[side],
819
+ className
820
+ ),
821
+ ...props,
822
+ children: [
823
+ children,
824
+ /* @__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: [
825
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "size-4" }),
826
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })
827
+ ] })
828
+ ]
829
+ }
830
+ )
831
+ ] });
832
+ }
833
+ function SheetHeader({ className, ...props }) {
834
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "sheet-header", className: cn("flex flex-col gap-1.5 p-4", className), ...props });
835
+ }
836
+ function SheetTitle({ className, ...props }) {
837
+ return /* @__PURE__ */ jsxRuntime.jsx(
838
+ DialogPrimitive__namespace.Title,
839
+ {
840
+ "data-slot": "sheet-title",
841
+ className: cn("text-foreground font-semibold", className),
842
+ ...props
843
+ }
844
+ );
845
+ }
846
+ function SheetDescription({
847
+ className,
848
+ ...props
849
+ }) {
850
+ return /* @__PURE__ */ jsxRuntime.jsx(
851
+ DialogPrimitive__namespace.Description,
852
+ {
853
+ "data-slot": "sheet-description",
854
+ className: cn("text-muted-foreground text-sm", className),
855
+ ...props
856
+ }
857
+ );
858
+ }
859
+ function Dialog({ ...props }) {
860
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Root, { "data-slot": "dialog", ...props });
861
+ }
862
+ function DialogTrigger({ ...props }) {
863
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Trigger, { "data-slot": "dialog-trigger", ...props });
864
+ }
865
+ function DialogPortal({ ...props }) {
866
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Portal, { "data-slot": "dialog-portal", ...props });
867
+ }
868
+ function DialogClose({ ...props }) {
869
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Close, { "data-slot": "dialog-close", ...props });
870
+ }
871
+ function DialogOverlay({
872
+ className,
873
+ ...props
874
+ }) {
875
+ return /* @__PURE__ */ jsxRuntime.jsx(
876
+ DialogPrimitive__namespace.Overlay,
877
+ {
878
+ "data-slot": "dialog-overlay",
879
+ className: cn(
880
+ "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",
881
+ className
882
+ ),
883
+ ...props
884
+ }
885
+ );
886
+ }
887
+ function DialogContent({
888
+ className,
889
+ children,
890
+ showCloseButton = true,
891
+ ...props
892
+ }) {
893
+ return /* @__PURE__ */ jsxRuntime.jsxs(DialogPortal, { "data-slot": "dialog-portal", children: [
894
+ /* @__PURE__ */ jsxRuntime.jsx(DialogOverlay, {}),
895
+ /* @__PURE__ */ jsxRuntime.jsxs(
896
+ DialogPrimitive__namespace.Content,
897
+ {
898
+ "data-slot": "dialog-content",
899
+ className: cn(
900
+ "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",
901
+ className
902
+ ),
903
+ ...props,
904
+ children: [
905
+ children,
906
+ showCloseButton && /* @__PURE__ */ jsxRuntime.jsxs(
907
+ DialogPrimitive__namespace.Close,
908
+ {
909
+ "data-slot": "dialog-close",
910
+ 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",
911
+ children: [
912
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, {}),
913
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })
914
+ ]
915
+ }
916
+ )
917
+ ]
918
+ }
919
+ )
920
+ ] });
921
+ }
922
+ function DialogHeader({ className, ...props }) {
923
+ return /* @__PURE__ */ jsxRuntime.jsx(
924
+ "div",
925
+ {
926
+ "data-slot": "dialog-header",
927
+ className: cn("flex flex-col gap-2 text-center sm:text-left", className),
928
+ ...props
929
+ }
930
+ );
931
+ }
932
+ function DialogFooter({ className, ...props }) {
933
+ return /* @__PURE__ */ jsxRuntime.jsx(
934
+ "div",
935
+ {
936
+ "data-slot": "dialog-footer",
937
+ className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className),
938
+ ...props
939
+ }
940
+ );
941
+ }
942
+ function DialogTitle({ className, ...props }) {
943
+ return /* @__PURE__ */ jsxRuntime.jsx(
944
+ DialogPrimitive__namespace.Title,
945
+ {
946
+ "data-slot": "dialog-title",
947
+ className: cn("text-lg leading-none font-semibold", className),
948
+ ...props
949
+ }
950
+ );
951
+ }
952
+ function DialogDescription({
953
+ className,
954
+ ...props
955
+ }) {
956
+ return /* @__PURE__ */ jsxRuntime.jsx(
957
+ DialogPrimitive__namespace.Description,
958
+ {
959
+ "data-slot": "dialog-description",
960
+ className: cn("text-muted-foreground text-sm", className),
961
+ ...props
962
+ }
963
+ );
964
+ }
965
+ var NODE_ENV = globalThis.process?.env?.NODE_ENV;
966
+ var pending = null;
967
+ var notifyHost = null;
968
+ var hostMountCount = 0;
969
+ function confirm(opts) {
970
+ return new Promise((resolve) => {
971
+ pending = { ...opts, resolve };
972
+ if (notifyHost) {
973
+ notifyHost();
974
+ } else if (NODE_ENV !== "production") {
975
+ console.warn("[ConfirmDialog] confirm() called but no <ConfirmHost /> is mounted");
976
+ }
977
+ });
978
+ }
979
+ function ConfirmHost() {
980
+ const [state, setState] = React2.useState(null);
981
+ const submittingRef = React2.useRef(false);
982
+ React2.useEffect(() => {
983
+ hostMountCount += 1;
984
+ if (hostMountCount > 1 && NODE_ENV !== "production") {
985
+ console.warn(
986
+ "[ConfirmDialog] multiple <ConfirmHost /> instances mounted \u2014 the last one wins"
987
+ );
988
+ }
989
+ notifyHost = () => setState(pending);
990
+ if (pending) setState(pending);
991
+ return () => {
992
+ hostMountCount -= 1;
993
+ notifyHost = null;
994
+ };
995
+ }, []);
996
+ const close = React2.useCallback(
997
+ (ok) => {
998
+ if (submittingRef.current) return;
999
+ submittingRef.current = true;
1000
+ state?.resolve(ok);
1001
+ pending = null;
1002
+ setState(null);
1003
+ requestAnimationFrame(() => {
1004
+ submittingRef.current = false;
1005
+ });
1006
+ },
1007
+ [state]
1008
+ );
1009
+ if (!state) return null;
1010
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Root, { open: true, onOpenChange: (open) => !open && close(false), children: /* @__PURE__ */ jsxRuntime.jsxs(DialogPrimitive__namespace.Portal, { children: [
1011
+ /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Overlay, { className: "fixed inset-0 z-50 bg-black/50 backdrop-blur-sm" }),
1012
+ /* @__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: [
1013
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "terminal-title", children: /* @__PURE__ */ jsxRuntime.jsxs(
1014
+ "span",
1015
+ {
1016
+ className: "flex items-center gap-1.5 " + (state.destructive ? "text-destructive" : "text-primary"),
1017
+ children: [
1018
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertTriangle, { className: "size-3.5" }),
1019
+ state.title
1020
+ ]
1021
+ }
1022
+ ) }),
1023
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4 p-4 sm:p-5", children: [
1024
+ /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Title, { className: "sr-only", children: state.title }),
1025
+ /* @__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 }) }),
1026
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center justify-end gap-2", children: [
1027
+ /* @__PURE__ */ jsxRuntime.jsx(
1028
+ Button,
1029
+ {
1030
+ variant: "outline",
1031
+ onClick: () => close(false),
1032
+ className: "font-mono text-[11px] tracking-widest uppercase",
1033
+ children: state.cancelLabel ?? "cancel"
1034
+ }
1035
+ ),
1036
+ /* @__PURE__ */ jsxRuntime.jsx(
1037
+ Button,
1038
+ {
1039
+ onClick: () => close(true),
1040
+ className: "font-display tracking-wide uppercase " + (state.destructive ? "bg-destructive text-destructive-foreground hover:bg-destructive/90" : ""),
1041
+ children: state.confirmLabel ?? "confirm"
1042
+ }
1043
+ )
1044
+ ] })
1045
+ ] })
1046
+ ] })
1047
+ ] }) });
1048
+ }
1049
+ var NODE_ENV2 = globalThis.process?.env?.NODE_ENV;
1050
+ var pending2 = null;
1051
+ var notifyHost2 = null;
1052
+ var hostMountCount2 = 0;
1053
+ function prompt(opts) {
1054
+ return new Promise((resolve) => {
1055
+ pending2 = { ...opts, resolve };
1056
+ if (notifyHost2) {
1057
+ notifyHost2();
1058
+ } else if (NODE_ENV2 !== "production") {
1059
+ console.warn("[PromptDialog] prompt() called but no <PromptHost /> is mounted");
1060
+ }
1061
+ });
1062
+ }
1063
+ function PromptHost() {
1064
+ const [state, setState] = React2.useState(null);
1065
+ const [value, setValue] = React2.useState("");
1066
+ const [confirmValue, setConfirmValue] = React2.useState("");
1067
+ const [error, setError] = React2.useState(null);
1068
+ const submittingRef = React2.useRef(false);
1069
+ React2.useEffect(() => {
1070
+ hostMountCount2 += 1;
1071
+ if (hostMountCount2 > 1 && NODE_ENV2 !== "production") {
1072
+ console.warn("[PromptDialog] multiple <PromptHost /> instances mounted");
1073
+ }
1074
+ notifyHost2 = () => {
1075
+ setValue(pending2?.defaultValue ?? "");
1076
+ setConfirmValue("");
1077
+ setError(null);
1078
+ setState(pending2);
1079
+ };
1080
+ if (pending2) notifyHost2();
1081
+ return () => {
1082
+ hostMountCount2 -= 1;
1083
+ notifyHost2 = null;
1084
+ };
1085
+ }, []);
1086
+ const close = React2.useCallback(
1087
+ (result) => {
1088
+ if (submittingRef.current) return;
1089
+ submittingRef.current = true;
1090
+ state?.resolve(result);
1091
+ pending2 = null;
1092
+ setState(null);
1093
+ requestAnimationFrame(() => {
1094
+ submittingRef.current = false;
1095
+ });
1096
+ },
1097
+ [state]
1098
+ );
1099
+ const submit = React2.useCallback(() => {
1100
+ if (!state) return;
1101
+ const v = value;
1102
+ if (state.minLength && v.length < state.minLength) {
1103
+ setError(`must be at least ${state.minLength} characters`);
1104
+ return;
1105
+ }
1106
+ if (state.confirmField && v !== confirmValue) {
1107
+ setError("the two entries do not match");
1108
+ return;
1109
+ }
1110
+ if (state.validate) {
1111
+ const msg = state.validate(v);
1112
+ if (msg) {
1113
+ setError(msg);
1114
+ return;
1115
+ }
1116
+ }
1117
+ close(v);
1118
+ }, [state, value, confirmValue, close]);
1119
+ if (!state) return null;
1120
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Root, { open: true, onOpenChange: (open) => !open && close(null), children: /* @__PURE__ */ jsxRuntime.jsxs(DialogPrimitive__namespace.Portal, { children: [
1121
+ /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Overlay, { className: "fixed inset-0 z-50 bg-black/50 backdrop-blur-sm" }),
1122
+ /* @__PURE__ */ jsxRuntime.jsxs(
1123
+ DialogPrimitive__namespace.Content,
1124
+ {
1125
+ 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",
1126
+ onKeyDown: (e) => {
1127
+ if (e.key === "Enter" && !e.shiftKey) {
1128
+ e.preventDefault();
1129
+ submit();
1130
+ }
1131
+ },
1132
+ children: [
1133
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "terminal-title", children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-primary flex items-center gap-1.5", children: [
1134
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pencil, { className: "size-3.5" }),
1135
+ state.title
1136
+ ] }) }),
1137
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4 p-4 sm:p-5", children: [
1138
+ /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Title, { className: "sr-only", children: state.title }),
1139
+ 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 }) }),
1140
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1141
+ state.label && /* @__PURE__ */ jsxRuntime.jsx(Label, { children: state.label }),
1142
+ /* @__PURE__ */ jsxRuntime.jsx(
1143
+ Input,
1144
+ {
1145
+ autoFocus: true,
1146
+ type: state.secret ? "password" : "text",
1147
+ value,
1148
+ onChange: (e) => {
1149
+ setValue(e.target.value);
1150
+ setError(null);
1151
+ },
1152
+ placeholder: state.placeholder,
1153
+ autoComplete: "off",
1154
+ spellCheck: false,
1155
+ className: (state.label ? "mt-2 " : "") + (state.secret ? "font-mono" : "")
1156
+ }
1157
+ )
1158
+ ] }),
1159
+ state.confirmField && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1160
+ /* @__PURE__ */ jsxRuntime.jsx(Label, { children: "confirm" }),
1161
+ /* @__PURE__ */ jsxRuntime.jsx(
1162
+ Input,
1163
+ {
1164
+ type: state.secret ? "password" : "text",
1165
+ value: confirmValue,
1166
+ onChange: (e) => {
1167
+ setConfirmValue(e.target.value);
1168
+ setError(null);
1169
+ },
1170
+ placeholder: "re-enter to confirm",
1171
+ autoComplete: "off",
1172
+ spellCheck: false,
1173
+ className: "mt-2 " + (state.secret ? "font-mono" : "")
1174
+ }
1175
+ )
1176
+ ] }),
1177
+ error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-destructive font-mono text-xs", children: error }),
1178
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center justify-end gap-2", children: [
1179
+ /* @__PURE__ */ jsxRuntime.jsx(
1180
+ Button,
1181
+ {
1182
+ variant: "outline",
1183
+ onClick: () => close(null),
1184
+ className: "font-mono text-[11px] tracking-widest uppercase",
1185
+ children: state.cancelLabel ?? "cancel"
1186
+ }
1187
+ ),
1188
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: submit, className: "font-display tracking-wide uppercase", children: state.confirmLabel ?? "ok" })
1189
+ ] })
1190
+ ] })
1191
+ ]
1192
+ }
1193
+ )
1194
+ ] }) });
1195
+ }
1196
+ function Modal({ open, onOpenChange, title, subtitle, children, actions, width = "wide" }) {
1197
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Root, { open, onOpenChange, children: /* @__PURE__ */ jsxRuntime.jsxs(DialogPrimitive__namespace.Portal, { children: [
1198
+ /* @__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" }),
1199
+ /* @__PURE__ */ jsxRuntime.jsxs(
1200
+ DialogPrimitive__namespace.Content,
1201
+ {
1202
+ className: cn(
1203
+ "terminal fixed top-[5vh] left-1/2 z-[110] flex max-h-[90vh] -translate-x-1/2 flex-col overflow-hidden rounded-sm border",
1204
+ width === "wide" ? "w-[95vw] max-w-screen-2xl" : "w-[80vw] max-w-3xl",
1205
+ "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"
1206
+ ),
1207
+ children: [
1208
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "terminal-title flex shrink-0 items-center justify-between gap-3", children: [
1209
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
1210
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "terminal-dot", "aria-hidden": true }),
1211
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "terminal-dot opacity-70", "aria-hidden": true }),
1212
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "terminal-dot opacity-50", "aria-hidden": true }),
1213
+ /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Title, { className: "ml-2 truncate", children: title }),
1214
+ subtitle && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-muted-foreground/70 ml-1 truncate text-[10px] normal-case tracking-normal", children: [
1215
+ "\xB7 ",
1216
+ subtitle
1217
+ ] })
1218
+ ] }),
1219
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
1220
+ actions,
1221
+ /* @__PURE__ */ jsxRuntime.jsx(
1222
+ DialogPrimitive__namespace.Close,
1223
+ {
1224
+ "aria-label": "close",
1225
+ className: "text-muted-foreground hover:text-foreground inline-flex h-6 w-6 items-center justify-center rounded-sm",
1226
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "size-3.5" })
1227
+ }
1228
+ )
1229
+ ] })
1230
+ ] }),
1231
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-y-auto p-4 sm:p-6", children })
1232
+ ]
1233
+ }
1234
+ )
1235
+ ] }) });
1236
+ }
1237
+ function Pagination({ page, pageSize, total, onPage, className }) {
1238
+ if (total <= pageSize) return null;
1239
+ const start = page * pageSize;
1240
+ const shown = Math.max(0, Math.min(pageSize, total - start));
1241
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between " + (className ?? "mt-3"), children: [
1242
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-muted-foreground/70 font-mono text-[10px]", children: [
1243
+ start + 1,
1244
+ "\u2013",
1245
+ start + shown,
1246
+ " of ",
1247
+ total
1248
+ ] }),
1249
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2", children: [
1250
+ /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", size: "sm", onClick: () => onPage(page - 1), disabled: page === 0, children: [
1251
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, { className: "size-4" }),
1252
+ " prev"
1253
+ ] }),
1254
+ /* @__PURE__ */ jsxRuntime.jsxs(
1255
+ Button,
1256
+ {
1257
+ variant: "outline",
1258
+ size: "sm",
1259
+ onClick: () => onPage(page + 1),
1260
+ disabled: start + pageSize >= total,
1261
+ children: [
1262
+ "next ",
1263
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "size-4" })
1264
+ ]
1265
+ }
1266
+ )
1267
+ ] })
1268
+ ] });
1269
+ }
1270
+ function Popover({ ...props }) {
1271
+ return /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Root, { "data-slot": "popover", ...props });
1272
+ }
1273
+ function PopoverTrigger({ ...props }) {
1274
+ return /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Trigger, { "data-slot": "popover-trigger", ...props });
1275
+ }
1276
+ function PopoverContent({
1277
+ className,
1278
+ align = "center",
1279
+ sideOffset = 4,
1280
+ ...props
1281
+ }) {
1282
+ return /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
1283
+ PopoverPrimitive__namespace.Content,
1284
+ {
1285
+ "data-slot": "popover-content",
1286
+ align,
1287
+ sideOffset,
1288
+ className: cn(
1289
+ "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",
1290
+ className
1291
+ ),
1292
+ ...props
1293
+ }
1294
+ ) });
1295
+ }
1296
+ function PopoverAnchor({ ...props }) {
1297
+ return /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Anchor, { "data-slot": "popover-anchor", ...props });
1298
+ }
1299
+ var Accordion = AccordionPrimitive__namespace.Root;
1300
+ var AccordionItem = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(AccordionPrimitive__namespace.Item, { ref, className: cn("border-b", className), ...props }));
1301
+ AccordionItem.displayName = "AccordionItem";
1302
+ var AccordionTrigger = React2__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(AccordionPrimitive__namespace.Header, { className: "flex", children: /* @__PURE__ */ jsxRuntime.jsxs(
1303
+ AccordionPrimitive__namespace.Trigger,
1304
+ {
1305
+ ref,
1306
+ className: cn(
1307
+ "flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",
1308
+ className
1309
+ ),
1310
+ ...props,
1311
+ children: [
1312
+ children,
1313
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-4 w-4 shrink-0 transition-transform duration-200" })
1314
+ ]
1315
+ }
1316
+ ) }));
1317
+ AccordionTrigger.displayName = AccordionPrimitive__namespace.Trigger.displayName;
1318
+ var AccordionContent = React2__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1319
+ AccordionPrimitive__namespace.Content,
1320
+ {
1321
+ ref,
1322
+ className: "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm transition-all",
1323
+ ...props,
1324
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("pt-0 pb-4", className), children })
1325
+ }
1326
+ ));
1327
+ AccordionContent.displayName = AccordionPrimitive__namespace.Content.displayName;
1328
+ function Select({ ...props }) {
1329
+ return /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Root, { "data-slot": "select", ...props });
1330
+ }
1331
+ function SelectGroup({ ...props }) {
1332
+ return /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Group, { "data-slot": "select-group", ...props });
1333
+ }
1334
+ function SelectValue({ ...props }) {
1335
+ return /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Value, { "data-slot": "select-value", ...props });
1336
+ }
1337
+ function SelectTrigger({
1338
+ className,
1339
+ size = "default",
1340
+ children,
1341
+ ...props
1342
+ }) {
1343
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1344
+ SelectPrimitive__namespace.Trigger,
1345
+ {
1346
+ "data-slot": "select-trigger",
1347
+ "data-size": size,
1348
+ className: cn(
1349
+ "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",
1350
+ className
1351
+ ),
1352
+ ...props,
1353
+ children: [
1354
+ children,
1355
+ /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Icon, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDownIcon, { className: "size-4 opacity-50" }) })
1356
+ ]
1357
+ }
1358
+ );
1359
+ }
1360
+ function SelectContent({
1361
+ className,
1362
+ children,
1363
+ position = "popper",
1364
+ ...props
1365
+ }) {
1366
+ return /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
1367
+ SelectPrimitive__namespace.Content,
1368
+ {
1369
+ "data-slot": "select-content",
1370
+ className: cn(
1371
+ "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",
1372
+ 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",
1373
+ className
1374
+ ),
1375
+ position,
1376
+ ...props,
1377
+ children: [
1378
+ /* @__PURE__ */ jsxRuntime.jsx(SelectScrollUpButton, {}),
1379
+ /* @__PURE__ */ jsxRuntime.jsx(
1380
+ SelectPrimitive__namespace.Viewport,
1381
+ {
1382
+ className: cn(
1383
+ "p-1",
1384
+ position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
1385
+ ),
1386
+ children
1387
+ }
1388
+ ),
1389
+ /* @__PURE__ */ jsxRuntime.jsx(SelectScrollDownButton, {})
1390
+ ]
1391
+ }
1392
+ ) });
1393
+ }
1394
+ function SelectLabel({ className, ...props }) {
1395
+ return /* @__PURE__ */ jsxRuntime.jsx(
1396
+ SelectPrimitive__namespace.Label,
1397
+ {
1398
+ "data-slot": "select-label",
1399
+ className: cn("text-muted-foreground px-2 py-1.5 text-xs", className),
1400
+ ...props
1401
+ }
1402
+ );
1403
+ }
1404
+ function SelectItem({
1405
+ className,
1406
+ children,
1407
+ ...props
1408
+ }) {
1409
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1410
+ SelectPrimitive__namespace.Item,
1411
+ {
1412
+ "data-slot": "select-item",
1413
+ className: cn(
1414
+ "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",
1415
+ className
1416
+ ),
1417
+ ...props,
1418
+ children: [
1419
+ /* @__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" }) }) }),
1420
+ /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemText, { children })
1421
+ ]
1422
+ }
1423
+ );
1424
+ }
1425
+ function SelectSeparator({
1426
+ className,
1427
+ ...props
1428
+ }) {
1429
+ return /* @__PURE__ */ jsxRuntime.jsx(
1430
+ SelectPrimitive__namespace.Separator,
1431
+ {
1432
+ "data-slot": "select-separator",
1433
+ className: cn("bg-border pointer-events-none -mx-1 my-1 h-px", className),
1434
+ ...props
1435
+ }
1436
+ );
1437
+ }
1438
+ function SelectScrollUpButton({
1439
+ className,
1440
+ ...props
1441
+ }) {
1442
+ return /* @__PURE__ */ jsxRuntime.jsx(
1443
+ SelectPrimitive__namespace.ScrollUpButton,
1444
+ {
1445
+ "data-slot": "select-scroll-up-button",
1446
+ className: cn("flex cursor-default items-center justify-center py-1", className),
1447
+ ...props,
1448
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronUpIcon, { className: "size-4" })
1449
+ }
1450
+ );
1451
+ }
1452
+ function SelectScrollDownButton({
1453
+ className,
1454
+ ...props
1455
+ }) {
1456
+ return /* @__PURE__ */ jsxRuntime.jsx(
1457
+ SelectPrimitive__namespace.ScrollDownButton,
1458
+ {
1459
+ "data-slot": "select-scroll-down-button",
1460
+ className: cn("flex cursor-default items-center justify-center py-1", className),
1461
+ ...props,
1462
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDownIcon, { className: "size-4" })
1463
+ }
1464
+ );
1465
+ }
1466
+ var Toaster = ({ ...props }) => {
1467
+ const { theme = "system" } = nextThemes.useTheme();
1468
+ return /* @__PURE__ */ jsxRuntime.jsx(
1469
+ sonner.Toaster,
1470
+ {
1471
+ theme,
1472
+ className: "toaster group",
1473
+ toastOptions: {
1474
+ classNames: {
1475
+ toast: "group toast group-[.toaster]:bg-card group-[.toaster]:text-card-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",
1476
+ description: "group-[.toast]:text-muted-foreground",
1477
+ actionButton: "group-[.toast]:bg-foreground group-[.toast]:text-background",
1478
+ cancelButton: "group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",
1479
+ error: "group-[.toaster]:!bg-card group-[.toaster]:!text-foreground group-[.toaster]:!border-border",
1480
+ success: "group-[.toaster]:!bg-card group-[.toaster]:!text-foreground group-[.toaster]:!border-border",
1481
+ warning: "group-[.toaster]:!bg-card group-[.toaster]:!text-foreground group-[.toaster]:!border-border",
1482
+ info: "group-[.toaster]:!bg-card group-[.toaster]:!text-muted-foreground group-[.toaster]:!border-border"
1483
+ }
1484
+ },
1485
+ style: {
1486
+ "--normal-bg": "var(--card)",
1487
+ "--normal-text": "var(--card-foreground)",
1488
+ "--normal-border": "var(--border)",
1489
+ "--error-bg": "var(--card)",
1490
+ "--error-text": "var(--foreground)",
1491
+ "--error-border": "var(--border)",
1492
+ "--success-bg": "var(--card)",
1493
+ "--success-text": "var(--foreground)",
1494
+ "--success-border": "var(--border)",
1495
+ "--warning-bg": "var(--card)",
1496
+ "--warning-text": "var(--foreground)",
1497
+ "--warning-border": "var(--border)",
1498
+ "--info-bg": "var(--card)",
1499
+ "--info-text": "var(--muted-foreground)",
1500
+ "--info-border": "var(--border)"
1501
+ },
1502
+ ...props
1503
+ }
1504
+ );
1505
+ };
1506
+
1507
+ // src/components/index.ts
1508
+ var components_exports = {};
1509
+ __reExport(components_exports, ui_star__namespace);
1510
+
1511
+ // src/index.ts
1512
+ __reExport(src_exports, components_exports);
1513
+
1514
+ exports.Accordion = Accordion;
1515
+ exports.AccordionContent = AccordionContent;
1516
+ exports.AccordionItem = AccordionItem;
1517
+ exports.AccordionTrigger = AccordionTrigger;
1518
+ exports.Alert = Alert;
1519
+ exports.AlertDescription = AlertDescription;
1520
+ exports.AlertTitle = AlertTitle;
1521
+ exports.AlertWithAction = AlertWithAction;
1522
+ exports.AlertWithCountdown = AlertWithCountdown;
1523
+ exports.Badge = Badge;
1524
+ exports.Button = Button;
1525
+ exports.ConfirmHost = ConfirmHost;
1526
+ exports.DEFAULT_OC_THEME = DEFAULT_OC_THEME;
1527
+ exports.Dialog = Dialog;
1528
+ exports.DialogClose = DialogClose;
1529
+ exports.DialogContent = DialogContent;
1530
+ exports.DialogDescription = DialogDescription;
1531
+ exports.DialogFooter = DialogFooter;
1532
+ exports.DialogHeader = DialogHeader;
1533
+ exports.DialogOverlay = DialogOverlay;
1534
+ exports.DialogPortal = DialogPortal;
1535
+ exports.DialogTitle = DialogTitle;
1536
+ exports.DialogTrigger = DialogTrigger;
1537
+ exports.ErrorBoundary = ErrorBoundary;
1538
+ exports.Input = Input;
1539
+ exports.Label = Label;
1540
+ exports.Modal = Modal;
1541
+ exports.OC_SKIN_COOKIE = OC_SKIN_COOKIE;
1542
+ exports.OC_THEMES = OC_THEMES;
1543
+ exports.OcThemeBridge = OcThemeBridge;
1544
+ exports.OcThemePicker = OcThemePicker;
1545
+ exports.OcThemeProvider = OcThemeProvider;
1546
+ exports.Pagination = Pagination;
1547
+ exports.Popover = Popover;
1548
+ exports.PopoverAnchor = PopoverAnchor;
1549
+ exports.PopoverContent = PopoverContent;
1550
+ exports.PopoverTrigger = PopoverTrigger;
1551
+ exports.PromptHost = PromptHost;
1552
+ exports.Select = Select;
1553
+ exports.SelectContent = SelectContent;
1554
+ exports.SelectGroup = SelectGroup;
1555
+ exports.SelectItem = SelectItem;
1556
+ exports.SelectLabel = SelectLabel;
1557
+ exports.SelectScrollDownButton = SelectScrollDownButton;
1558
+ exports.SelectScrollUpButton = SelectScrollUpButton;
1559
+ exports.SelectSeparator = SelectSeparator;
1560
+ exports.SelectTrigger = SelectTrigger;
1561
+ exports.SelectValue = SelectValue;
1562
+ exports.Separator = Separator;
1563
+ exports.Sheet = Sheet;
1564
+ exports.SheetContent = SheetContent;
1565
+ exports.SheetDescription = SheetDescription;
1566
+ exports.SheetHeader = SheetHeader;
1567
+ exports.SheetOverlay = SheetOverlay;
1568
+ exports.SheetPortal = SheetPortal;
1569
+ exports.SheetTitle = SheetTitle;
1570
+ exports.SheetTrigger = SheetTrigger;
1571
+ exports.Skeleton = Skeleton;
1572
+ exports.Textarea = Textarea;
1573
+ exports.ThemeToggle = ThemeToggle;
1574
+ exports.ThemeToggleLink = ThemeToggleLink;
1575
+ exports.Toaster = Toaster;
1576
+ exports.Working = Working;
1577
+ exports.WorkingPanel = WorkingPanel;
1578
+ exports.badgeVariants = badgeVariants;
1579
+ exports.buttonVariants = buttonVariants;
1580
+ exports.cn = cn;
1581
+ exports.confirm = confirm;
1582
+ exports.getOcThemeInitScript = getOcThemeInitScript;
1583
+ exports.isKnownTheme = isKnownTheme;
1584
+ exports.prompt = prompt;
1585
+ exports.resolveTheme = resolveTheme;
1586
+ exports.useOcSkin = useOcSkin;
1587
+ //# sourceMappingURL=index.js.map
1588
+ //# sourceMappingURL=index.js.map