@enterprise-ui-react/react 1.0.6

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,2112 @@
1
+ import { breakpointValues } from './chunk-EMI46XY6.js';
2
+ export { borders, breakpointValues, breakpoints, colors, darkShadows, elevation, mediaQueries, motion, semanticBorders, semanticSpacing, shadows, spacing, typography, zIndex } from './chunk-EMI46XY6.js';
3
+ import { clsx } from 'clsx';
4
+ import { twMerge } from 'tailwind-merge';
5
+ import React6, { createContext, useState, useEffect, useContext } from 'react';
6
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
7
+ import { cva } from 'class-variance-authority';
8
+ import { motion } from 'framer-motion';
9
+ import { X, Menu, ChevronRight, ChevronLeft, Minus, Check, Circle, ChevronDown, ChevronUp, Loader2, Info, AlertTriangle, AlertCircle, CheckCircle2 } from 'lucide-react';
10
+ import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
11
+ import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
12
+ import * as SwitchPrimitives from '@radix-ui/react-switch';
13
+ import * as SelectPrimitive from '@radix-ui/react-select';
14
+ import * as ToastPrimitives from '@radix-ui/react-toast';
15
+ import * as DialogPrimitive from '@radix-ui/react-dialog';
16
+ import * as AvatarPrimitive from '@radix-ui/react-avatar';
17
+ import * as TooltipPrimitive from '@radix-ui/react-tooltip';
18
+ import * as ProgressPrimitive from '@radix-ui/react-progress';
19
+
20
+ function cn(...inputs) {
21
+ return twMerge(clsx(inputs));
22
+ }
23
+
24
+ // src/utils/theme.ts
25
+ var THEME_STORAGE_KEY = "enterprise-ui-theme";
26
+ function getSystemTheme() {
27
+ if (typeof window === "undefined") return "light";
28
+ return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
29
+ }
30
+ function getStoredTheme() {
31
+ if (typeof window === "undefined") return null;
32
+ return localStorage.getItem(THEME_STORAGE_KEY) || null;
33
+ }
34
+ function setStoredTheme(theme) {
35
+ if (typeof window === "undefined") return;
36
+ localStorage.setItem(THEME_STORAGE_KEY, theme);
37
+ }
38
+ function getResolvedTheme(theme) {
39
+ if (theme === "system") {
40
+ return getSystemTheme();
41
+ }
42
+ return theme;
43
+ }
44
+ function applyTheme(theme) {
45
+ if (typeof window === "undefined") return;
46
+ const root = window.document.documentElement;
47
+ root.classList.remove("light", "dark");
48
+ root.classList.add(theme);
49
+ }
50
+ function initializeTheme() {
51
+ const stored = getStoredTheme() || "system";
52
+ const resolved = getResolvedTheme(stored);
53
+ applyTheme(resolved);
54
+ return resolved;
55
+ }
56
+
57
+ // src/utils/accessibility.ts
58
+ function generateId(prefix = "enterprise-ui") {
59
+ return `${prefix}-${Math.random().toString(36).substr(2, 9)}`;
60
+ }
61
+ function isFocusable(element) {
62
+ if (element.tabIndex < 0) return false;
63
+ if (element.hasAttribute("disabled")) return false;
64
+ const tagName = element.tagName.toLowerCase();
65
+ const focusableTags = ["a", "button", "input", "select", "textarea"];
66
+ if (focusableTags.includes(tagName)) {
67
+ return true;
68
+ }
69
+ return element.tabIndex >= 0;
70
+ }
71
+ function getFocusableElements(container) {
72
+ const selector = [
73
+ "a[href]",
74
+ "button:not([disabled])",
75
+ "input:not([disabled])",
76
+ "select:not([disabled])",
77
+ "textarea:not([disabled])",
78
+ '[tabindex]:not([tabindex="-1"])'
79
+ ].join(", ");
80
+ return Array.from(container.querySelectorAll(selector));
81
+ }
82
+ function trapFocus(container, event) {
83
+ if (event.key !== "Tab") return;
84
+ const focusableElements = getFocusableElements(container);
85
+ if (focusableElements.length === 0) return;
86
+ const firstElement = focusableElements[0];
87
+ const lastElement = focusableElements[focusableElements.length - 1];
88
+ if (event.shiftKey) {
89
+ if (document.activeElement === firstElement) {
90
+ event.preventDefault();
91
+ lastElement.focus();
92
+ }
93
+ } else {
94
+ if (document.activeElement === lastElement) {
95
+ event.preventDefault();
96
+ firstElement.focus();
97
+ }
98
+ }
99
+ }
100
+ function announceToScreenReader(message, priority = "polite") {
101
+ if (typeof document === "undefined") return;
102
+ const announcement = document.createElement("div");
103
+ announcement.setAttribute("role", "status");
104
+ announcement.setAttribute("aria-live", priority);
105
+ announcement.setAttribute("aria-atomic", "true");
106
+ announcement.className = "sr-only";
107
+ announcement.textContent = message;
108
+ document.body.appendChild(announcement);
109
+ setTimeout(() => {
110
+ document.body.removeChild(announcement);
111
+ }, 1e3);
112
+ }
113
+ function getContrastRatio(color1, color2) {
114
+ const getLuminance = (color) => {
115
+ const hex = color.replace("#", "");
116
+ const r = parseInt(hex.substr(0, 2), 16) / 255;
117
+ const g = parseInt(hex.substr(2, 2), 16) / 255;
118
+ const b = parseInt(hex.substr(4, 2), 16) / 255;
119
+ const [rs, gs, bs] = [r, g, b].map(
120
+ (c) => c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4)
121
+ );
122
+ return 0.2126 * rs + 0.7152 * gs + 0.0722 * bs;
123
+ };
124
+ const l1 = getLuminance(color1);
125
+ const l2 = getLuminance(color2);
126
+ const lighter = Math.max(l1, l2);
127
+ const darker = Math.min(l1, l2);
128
+ return (lighter + 0.05) / (darker + 0.05);
129
+ }
130
+ function meetsWCAGAA(foreground, background, largeText = false) {
131
+ const ratio = getContrastRatio(foreground, background);
132
+ return largeText ? ratio >= 3 : ratio >= 4.5;
133
+ }
134
+
135
+ // src/utils/responsive.ts
136
+ function matchesBreakpoint(breakpoint) {
137
+ if (typeof window === "undefined") return false;
138
+ return window.innerWidth >= breakpointValues[breakpoint];
139
+ }
140
+ function getCurrentBreakpoint() {
141
+ if (typeof window === "undefined") return "sm";
142
+ const width = window.innerWidth;
143
+ if (width >= breakpointValues["3xl"]) return "3xl";
144
+ if (width >= breakpointValues["2xl"]) return "2xl";
145
+ if (width >= breakpointValues.xl) return "xl";
146
+ if (width >= breakpointValues.lg) return "lg";
147
+ if (width >= breakpointValues.md) return "md";
148
+ if (width >= breakpointValues.sm) return "sm";
149
+ return "xs";
150
+ }
151
+ function isMobile() {
152
+ if (typeof window === "undefined") return false;
153
+ return window.innerWidth < breakpointValues.md;
154
+ }
155
+ function isTablet() {
156
+ if (typeof window === "undefined") return false;
157
+ return window.innerWidth >= breakpointValues.md && window.innerWidth < breakpointValues.lg;
158
+ }
159
+ function isDesktop() {
160
+ if (typeof window === "undefined") return false;
161
+ return window.innerWidth >= breakpointValues.lg;
162
+ }
163
+
164
+ // src/utils/format.ts
165
+ function formatNumber(num, options) {
166
+ return new Intl.NumberFormat("en-US", options).format(num);
167
+ }
168
+ function formatCurrency(amount, currency = "USD", locale = "en-US") {
169
+ return new Intl.NumberFormat(locale, {
170
+ style: "currency",
171
+ currency
172
+ }).format(amount);
173
+ }
174
+ function formatPercent(value, decimals = 0, locale = "en-US") {
175
+ return new Intl.NumberFormat(locale, {
176
+ style: "percent",
177
+ minimumFractionDigits: decimals,
178
+ maximumFractionDigits: decimals
179
+ }).format(value);
180
+ }
181
+ function formatDate(date, format = "medium", locale = "en-US") {
182
+ const d = new Date(date);
183
+ return new Intl.DateTimeFormat(locale, { dateStyle: format }).format(d);
184
+ }
185
+ function formatRelativeTime(date, locale = "en-US") {
186
+ const d = new Date(date);
187
+ const now = /* @__PURE__ */ new Date();
188
+ const diffInSeconds = Math.floor((now.getTime() - d.getTime()) / 1e3);
189
+ const rtf = new Intl.RelativeTimeFormat(locale, { numeric: "auto" });
190
+ if (diffInSeconds < 60) return rtf.format(-diffInSeconds, "second");
191
+ if (diffInSeconds < 3600) return rtf.format(-Math.floor(diffInSeconds / 60), "minute");
192
+ if (diffInSeconds < 86400) return rtf.format(-Math.floor(diffInSeconds / 3600), "hour");
193
+ if (diffInSeconds < 604800) return rtf.format(-Math.floor(diffInSeconds / 86400), "day");
194
+ if (diffInSeconds < 2592e3) return rtf.format(-Math.floor(diffInSeconds / 604800), "week");
195
+ if (diffInSeconds < 31536e3) return rtf.format(-Math.floor(diffInSeconds / 2592e3), "month");
196
+ return rtf.format(-Math.floor(diffInSeconds / 31536e3), "year");
197
+ }
198
+ function formatFileSize(bytes, decimals = 2) {
199
+ if (bytes === 0) return "0 Bytes";
200
+ const k = 1024;
201
+ const sizes = ["Bytes", "KB", "MB", "GB", "TB"];
202
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
203
+ return `${parseFloat((bytes / Math.pow(k, i)).toFixed(decimals))} ${sizes[i]}`;
204
+ }
205
+ function truncate(text, maxLength) {
206
+ if (text.length <= maxLength) return text;
207
+ return `${text.slice(0, maxLength - 3)}...`;
208
+ }
209
+ function toTitleCase(str) {
210
+ return str.replace(
211
+ /\w\S*/g,
212
+ (txt) => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase()
213
+ );
214
+ }
215
+ function toKebabCase(str) {
216
+ return str.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase();
217
+ }
218
+ function toCamelCase(str) {
219
+ return str.replace(
220
+ /(?:^\w|[A-Z]|\b\w)/g,
221
+ (word, index) => index === 0 ? word.toLowerCase() : word.toUpperCase()
222
+ ).replace(/[\s-_]+/g, "");
223
+ }
224
+ var ThemeContext = createContext(void 0);
225
+ function ThemeProvider({
226
+ children,
227
+ defaultTheme = "system"
228
+ }) {
229
+ const [theme, setThemeState] = useState(
230
+ () => getStoredTheme() || defaultTheme
231
+ );
232
+ const [resolvedTheme, setResolvedTheme] = useState(
233
+ () => getResolvedTheme(theme)
234
+ );
235
+ useEffect(() => {
236
+ const resolved = getResolvedTheme(theme);
237
+ setResolvedTheme(resolved);
238
+ applyTheme(resolved);
239
+ }, [theme]);
240
+ useEffect(() => {
241
+ if (theme !== "system") return;
242
+ const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
243
+ const handleChange = () => {
244
+ const resolved = getSystemTheme();
245
+ setResolvedTheme(resolved);
246
+ applyTheme(resolved);
247
+ };
248
+ mediaQuery.addEventListener("change", handleChange);
249
+ return () => mediaQuery.removeEventListener("change", handleChange);
250
+ }, [theme]);
251
+ const setTheme = (newTheme) => {
252
+ setThemeState(newTheme);
253
+ setStoredTheme(newTheme);
254
+ };
255
+ return /* @__PURE__ */ jsx(ThemeContext.Provider, { value: { theme, resolvedTheme, setTheme }, children });
256
+ }
257
+ function useTheme() {
258
+ const context = useContext(ThemeContext);
259
+ if (context === void 0) {
260
+ throw new Error("useTheme must be used within a ThemeProvider");
261
+ }
262
+ return context;
263
+ }
264
+ var typographyVariants = cva("", {
265
+ variants: {
266
+ variant: {
267
+ h1: "text-5xl font-bold tracking-tight leading-tight",
268
+ h2: "text-4xl font-bold tracking-tight",
269
+ h3: "text-3xl font-semibold tracking-tight",
270
+ h4: "text-2xl font-semibold",
271
+ h5: "text-xl font-semibold",
272
+ h6: "text-lg font-semibold",
273
+ body: "text-base font-normal",
274
+ bodyLarge: "text-lg font-normal",
275
+ bodySmall: "text-sm font-normal",
276
+ label: "text-sm font-medium",
277
+ caption: "text-xs font-normal",
278
+ overline: "text-xs font-semibold uppercase tracking-wide",
279
+ code: "font-mono text-sm"
280
+ },
281
+ color: {
282
+ primary: "text-text-primary dark:text-dark-text-primary",
283
+ secondary: "text-text-secondary dark:text-dark-text-secondary",
284
+ tertiary: "text-text-tertiary dark:text-dark-text-tertiary",
285
+ disabled: "text-text-disabled dark:text-dark-text-disabled",
286
+ inverse: "text-text-inverse",
287
+ link: "text-text-link dark:text-dark-text-link hover:text-text-linkHover dark:hover:text-dark-text-linkHover",
288
+ success: "text-success-dark dark:text-success-light",
289
+ warning: "text-warning-dark dark:text-warning-light",
290
+ error: "text-error-dark dark:text-error-light",
291
+ info: "text-info-dark dark:text-info-light"
292
+ },
293
+ align: {
294
+ left: "text-left",
295
+ center: "text-center",
296
+ right: "text-right",
297
+ justify: "text-justify"
298
+ },
299
+ weight: {
300
+ normal: "font-normal",
301
+ medium: "font-medium",
302
+ semibold: "font-semibold",
303
+ bold: "font-bold"
304
+ }
305
+ },
306
+ defaultVariants: {
307
+ variant: "body",
308
+ color: "primary",
309
+ align: "left"
310
+ }
311
+ });
312
+ var Typography = React6.forwardRef(
313
+ ({
314
+ as,
315
+ variant = "body",
316
+ color,
317
+ align,
318
+ weight,
319
+ truncate: truncate2,
320
+ className,
321
+ children,
322
+ ...props
323
+ }, ref) => {
324
+ const Component = as || getDefaultElement(variant);
325
+ return React6.createElement(
326
+ Component,
327
+ {
328
+ ref,
329
+ className: cn(
330
+ typographyVariants({ variant, color, align, weight }),
331
+ truncate2 && "truncate",
332
+ className
333
+ ),
334
+ ...props
335
+ },
336
+ children
337
+ );
338
+ }
339
+ );
340
+ Typography.displayName = "Typography";
341
+ function getDefaultElement(variant) {
342
+ switch (variant) {
343
+ case "h1":
344
+ return "h1";
345
+ case "h2":
346
+ return "h2";
347
+ case "h3":
348
+ return "h3";
349
+ case "h4":
350
+ return "h4";
351
+ case "h5":
352
+ return "h5";
353
+ case "h6":
354
+ return "h6";
355
+ case "code":
356
+ return "code";
357
+ case "overline":
358
+ case "caption":
359
+ case "label":
360
+ return "span";
361
+ default:
362
+ return "p";
363
+ }
364
+ }
365
+ var H1 = (props) => /* @__PURE__ */ jsx(Typography, { variant: "h1", ...props });
366
+ var H2 = (props) => /* @__PURE__ */ jsx(Typography, { variant: "h2", ...props });
367
+ var H3 = (props) => /* @__PURE__ */ jsx(Typography, { variant: "h3", ...props });
368
+ var H4 = (props) => /* @__PURE__ */ jsx(Typography, { variant: "h4", ...props });
369
+ var H5 = (props) => /* @__PURE__ */ jsx(Typography, { variant: "h5", ...props });
370
+ var H6 = (props) => /* @__PURE__ */ jsx(Typography, { variant: "h6", ...props });
371
+ var Text = (props) => /* @__PURE__ */ jsx(Typography, { variant: "body", ...props });
372
+ var Label = (props) => /* @__PURE__ */ jsx(Typography, { variant: "label", ...props });
373
+ var Caption = (props) => /* @__PURE__ */ jsx(Typography, { variant: "caption", ...props });
374
+ var Code = (props) => /* @__PURE__ */ jsx(Typography, { variant: "code", ...props });
375
+ var iconVariants = cva("", {
376
+ variants: {
377
+ size: {
378
+ xs: "w-3 h-3",
379
+ sm: "w-4 h-4",
380
+ md: "w-5 h-5",
381
+ lg: "w-6 h-6",
382
+ xl: "w-8 h-8",
383
+ "2xl": "w-10 h-10"
384
+ },
385
+ color: {
386
+ primary: "text-text-primary dark:text-dark-text-primary",
387
+ secondary: "text-text-secondary dark:text-dark-text-secondary",
388
+ tertiary: "text-text-tertiary dark:text-dark-text-tertiary",
389
+ disabled: "text-text-disabled dark:text-dark-text-disabled",
390
+ inverse: "text-text-inverse",
391
+ accent: "text-primary dark:text-primary",
392
+ success: "text-success dark:text-success",
393
+ warning: "text-warning dark:text-warning",
394
+ error: "text-error dark:text-error",
395
+ info: "text-info dark:text-info"
396
+ }
397
+ },
398
+ defaultVariants: {
399
+ size: "md",
400
+ color: "primary"
401
+ }
402
+ });
403
+ var Icon = React6.forwardRef(
404
+ ({ icon: IconComponent, size, color, className, ...props }, ref) => {
405
+ return /* @__PURE__ */ jsx(
406
+ IconComponent,
407
+ {
408
+ ref,
409
+ className: cn(iconVariants({ size, color }), className),
410
+ ...props
411
+ }
412
+ );
413
+ }
414
+ );
415
+ Icon.displayName = "Icon";
416
+ var FadeIn = ({
417
+ delay = 0,
418
+ duration = 0.2,
419
+ children,
420
+ ...props
421
+ }) => {
422
+ return /* @__PURE__ */ jsx(
423
+ motion.div,
424
+ {
425
+ initial: { opacity: 0 },
426
+ animate: { opacity: 1 },
427
+ exit: { opacity: 0 },
428
+ transition: { duration, delay },
429
+ ...props,
430
+ children
431
+ }
432
+ );
433
+ };
434
+ FadeIn.displayName = "FadeIn";
435
+ var SlideIn = ({
436
+ direction = "up",
437
+ delay = 0,
438
+ duration = 0.3,
439
+ distance = 100,
440
+ children,
441
+ ...props
442
+ }) => {
443
+ const getInitialPosition = () => {
444
+ switch (direction) {
445
+ case "up":
446
+ return { y: distance, x: 0 };
447
+ case "down":
448
+ return { y: -distance, x: 0 };
449
+ case "left":
450
+ return { x: distance, y: 0 };
451
+ case "right":
452
+ return { x: -distance, y: 0 };
453
+ }
454
+ };
455
+ return /* @__PURE__ */ jsx(
456
+ motion.div,
457
+ {
458
+ initial: { ...getInitialPosition(), opacity: 0 },
459
+ animate: { x: 0, y: 0, opacity: 1 },
460
+ exit: { ...getInitialPosition(), opacity: 0 },
461
+ transition: { duration, delay, ease: [0, 0, 0.2, 1] },
462
+ ...props,
463
+ children
464
+ }
465
+ );
466
+ };
467
+ SlideIn.displayName = "SlideIn";
468
+ var ScaleIn = ({
469
+ delay = 0,
470
+ duration = 0.2,
471
+ initialScale = 0.95,
472
+ children,
473
+ ...props
474
+ }) => {
475
+ return /* @__PURE__ */ jsx(
476
+ motion.div,
477
+ {
478
+ initial: { scale: initialScale, opacity: 0 },
479
+ animate: { scale: 1, opacity: 1 },
480
+ exit: { scale: initialScale, opacity: 0 },
481
+ transition: { duration, delay, ease: [0, 0, 0.2, 1] },
482
+ ...props,
483
+ children
484
+ }
485
+ );
486
+ };
487
+ ScaleIn.displayName = "ScaleIn";
488
+ var Stagger = ({
489
+ staggerDelay = 0.1,
490
+ children,
491
+ ...props
492
+ }) => {
493
+ return /* @__PURE__ */ jsx(
494
+ motion.div,
495
+ {
496
+ initial: "hidden",
497
+ animate: "visible",
498
+ variants: {
499
+ visible: {
500
+ transition: {
501
+ staggerChildren: staggerDelay
502
+ }
503
+ }
504
+ },
505
+ ...props,
506
+ children
507
+ }
508
+ );
509
+ };
510
+ Stagger.displayName = "Stagger";
511
+ var StaggerItem = ({
512
+ children,
513
+ ...props
514
+ }) => {
515
+ return /* @__PURE__ */ jsx(
516
+ motion.div,
517
+ {
518
+ variants: {
519
+ hidden: { opacity: 0, y: 20 },
520
+ visible: { opacity: 1, y: 0 }
521
+ },
522
+ ...props,
523
+ children
524
+ }
525
+ );
526
+ };
527
+ StaggerItem.displayName = "StaggerItem";
528
+ var containerVariants = cva("mx-auto w-full px-4 sm:px-6 lg:px-8", {
529
+ variants: {
530
+ maxWidth: {
531
+ xs: "max-w-screen-xs",
532
+ sm: "max-w-screen-sm",
533
+ md: "max-w-screen-md",
534
+ lg: "max-w-screen-lg",
535
+ xl: "max-w-screen-xl",
536
+ "2xl": "max-w-screen-2xl",
537
+ "3xl": "max-w-screen-3xl",
538
+ full: "max-w-full"
539
+ }
540
+ },
541
+ defaultVariants: {
542
+ maxWidth: "xl"
543
+ }
544
+ });
545
+ var Container = React6.forwardRef(
546
+ ({ as: Component = "div", maxWidth, className, ...props }, ref) => {
547
+ return React6.createElement(Component, {
548
+ ref,
549
+ className: cn(containerVariants({ maxWidth }), className),
550
+ ...props
551
+ });
552
+ }
553
+ );
554
+ Container.displayName = "Container";
555
+ var gridVariants = cva("grid", {
556
+ variants: {
557
+ cols: {
558
+ 1: "grid-cols-1",
559
+ 2: "grid-cols-2",
560
+ 3: "grid-cols-3",
561
+ 4: "grid-cols-4",
562
+ 5: "grid-cols-5",
563
+ 6: "grid-cols-6",
564
+ 12: "grid-cols-12"
565
+ },
566
+ gap: {
567
+ 0: "gap-0",
568
+ 1: "gap-1",
569
+ 2: "gap-2",
570
+ 3: "gap-3",
571
+ 4: "gap-4",
572
+ 5: "gap-5",
573
+ 6: "gap-6",
574
+ 8: "gap-8",
575
+ 10: "gap-10",
576
+ 12: "gap-12"
577
+ }
578
+ },
579
+ defaultVariants: {
580
+ cols: 1,
581
+ gap: 4
582
+ }
583
+ });
584
+ var Grid = React6.forwardRef(
585
+ ({ as: Component = "div", cols, gap, responsive, className, ...props }, ref) => {
586
+ const responsiveClasses = responsive ? Object.entries(responsive).map(([breakpoint, columns]) => {
587
+ if (breakpoint === "sm") return `sm:grid-cols-${columns}`;
588
+ if (breakpoint === "md") return `md:grid-cols-${columns}`;
589
+ if (breakpoint === "lg") return `lg:grid-cols-${columns}`;
590
+ if (breakpoint === "xl") return `xl:grid-cols-${columns}`;
591
+ if (breakpoint === "2xl") return `2xl:grid-cols-${columns}`;
592
+ return "";
593
+ }).join(" ") : "";
594
+ return React6.createElement(Component, {
595
+ ref,
596
+ className: cn(gridVariants({ cols, gap }), responsiveClasses, className),
597
+ ...props
598
+ });
599
+ }
600
+ );
601
+ Grid.displayName = "Grid";
602
+ var GridItem = React6.forwardRef(
603
+ ({ colSpan, rowSpan, colStart, colEnd, rowStart, rowEnd, className, ...props }, ref) => {
604
+ const spanClasses = [
605
+ colSpan && `col-span-${colSpan}`,
606
+ rowSpan && `row-span-${rowSpan}`,
607
+ colStart && `col-start-${colStart}`,
608
+ colEnd && `col-end-${colEnd}`,
609
+ rowStart && `row-start-${rowStart}`,
610
+ rowEnd && `row-end-${rowEnd}`
611
+ ].filter(Boolean).join(" ");
612
+ return /* @__PURE__ */ jsx("div", { ref, className: cn(spanClasses, className), ...props });
613
+ }
614
+ );
615
+ GridItem.displayName = "GridItem";
616
+ var stackVariants = cva("flex", {
617
+ variants: {
618
+ direction: {
619
+ row: "flex-row",
620
+ column: "flex-col",
621
+ rowReverse: "flex-row-reverse",
622
+ columnReverse: "flex-col-reverse"
623
+ },
624
+ gap: {
625
+ 0: "gap-0",
626
+ 1: "gap-1",
627
+ 2: "gap-2",
628
+ 3: "gap-3",
629
+ 4: "gap-4",
630
+ 5: "gap-5",
631
+ 6: "gap-6",
632
+ 8: "gap-8",
633
+ 10: "gap-10",
634
+ 12: "gap-12"
635
+ },
636
+ align: {
637
+ start: "items-start",
638
+ center: "items-center",
639
+ end: "items-end",
640
+ stretch: "items-stretch",
641
+ baseline: "items-baseline"
642
+ },
643
+ justify: {
644
+ start: "justify-start",
645
+ center: "justify-center",
646
+ end: "justify-end",
647
+ between: "justify-between",
648
+ around: "justify-around",
649
+ evenly: "justify-evenly"
650
+ },
651
+ wrap: {
652
+ true: "flex-wrap",
653
+ false: "flex-nowrap",
654
+ reverse: "flex-wrap-reverse"
655
+ }
656
+ },
657
+ defaultVariants: {
658
+ direction: "column",
659
+ gap: 4,
660
+ align: "stretch",
661
+ justify: "start",
662
+ wrap: false
663
+ }
664
+ });
665
+ var Stack = React6.forwardRef(
666
+ ({
667
+ as: Component = "div",
668
+ direction,
669
+ gap,
670
+ align,
671
+ justify,
672
+ wrap,
673
+ className,
674
+ ...props
675
+ }, ref) => {
676
+ return React6.createElement(Component, {
677
+ ref,
678
+ className: cn(
679
+ stackVariants({ direction, gap, align, justify, wrap }),
680
+ className
681
+ ),
682
+ ...props
683
+ });
684
+ }
685
+ );
686
+ Stack.displayName = "Stack";
687
+ var HStack = React6.forwardRef((props, ref) => /* @__PURE__ */ jsx(Stack, { ref, direction: "row", ...props }));
688
+ HStack.displayName = "HStack";
689
+ var VStack = React6.forwardRef((props, ref) => /* @__PURE__ */ jsx(Stack, { ref, direction: "column", ...props }));
690
+ VStack.displayName = "VStack";
691
+ var sidebarVariants = cva(
692
+ "fixed inset-y-0 left-0 z-50 flex flex-col border-r border-border bg-background-surface transition-all duration-300",
693
+ {
694
+ variants: {
695
+ collapsed: {
696
+ true: "w-16",
697
+ false: "w-64"
698
+ },
699
+ mobile: {
700
+ true: "w-64",
701
+ false: ""
702
+ }
703
+ },
704
+ defaultVariants: {
705
+ collapsed: false,
706
+ mobile: false
707
+ }
708
+ }
709
+ );
710
+ var Sidebar = React6.forwardRef(
711
+ ({
712
+ collapsible = true,
713
+ defaultCollapsed = false,
714
+ collapsed: controlledCollapsed,
715
+ onCollapsedChange,
716
+ className,
717
+ children,
718
+ ...props
719
+ }, ref) => {
720
+ const [internalCollapsed, setInternalCollapsed] = React6.useState(defaultCollapsed);
721
+ const [mobileOpen, setMobileOpen] = React6.useState(false);
722
+ const collapsed = controlledCollapsed !== void 0 ? controlledCollapsed : internalCollapsed;
723
+ const handleToggle = () => {
724
+ const newCollapsed = !collapsed;
725
+ setInternalCollapsed(newCollapsed);
726
+ onCollapsedChange?.(newCollapsed);
727
+ };
728
+ const handleMobileToggle = () => {
729
+ setMobileOpen(!mobileOpen);
730
+ };
731
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
732
+ /* @__PURE__ */ jsx(
733
+ "button",
734
+ {
735
+ onClick: handleMobileToggle,
736
+ className: "fixed left-4 top-4 z-50 rounded-md p-2 lg:hidden bg-background-surface border border-border shadow-md",
737
+ "aria-label": "Toggle sidebar",
738
+ children: mobileOpen ? /* @__PURE__ */ jsx(X, { className: "h-5 w-5" }) : /* @__PURE__ */ jsx(Menu, { className: "h-5 w-5" })
739
+ }
740
+ ),
741
+ mobileOpen && /* @__PURE__ */ jsx(
742
+ "div",
743
+ {
744
+ className: "fixed inset-0 z-40 bg-background-overlay lg:hidden",
745
+ onClick: handleMobileToggle
746
+ }
747
+ ),
748
+ /* @__PURE__ */ jsxs(
749
+ "div",
750
+ {
751
+ ref,
752
+ className: cn(
753
+ sidebarVariants({ collapsed }),
754
+ "max-lg:translate-x-[-100%]",
755
+ mobileOpen && "max-lg:translate-x-0",
756
+ className
757
+ ),
758
+ ...props,
759
+ children: [
760
+ /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto overflow-x-hidden", children }),
761
+ collapsible && /* @__PURE__ */ jsx(
762
+ "button",
763
+ {
764
+ onClick: handleToggle,
765
+ className: "hidden lg:flex items-center justify-center h-12 border-t border-border hover:bg-background-hover transition-colors",
766
+ "aria-label": collapsed ? "Expand sidebar" : "Collapse sidebar",
767
+ children: collapsed ? /* @__PURE__ */ jsx(ChevronRight, { className: "h-5 w-5" }) : /* @__PURE__ */ jsx(ChevronLeft, { className: "h-5 w-5" })
768
+ }
769
+ )
770
+ ]
771
+ }
772
+ )
773
+ ] });
774
+ }
775
+ );
776
+ Sidebar.displayName = "Sidebar";
777
+ var SidebarHeader = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
778
+ "div",
779
+ {
780
+ ref,
781
+ className: cn("flex h-16 items-center border-b border-border px-4", className),
782
+ ...props
783
+ }
784
+ ));
785
+ SidebarHeader.displayName = "SidebarHeader";
786
+ var SidebarContent = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("flex-1 py-4", className), ...props }));
787
+ SidebarContent.displayName = "SidebarContent";
788
+ var SidebarFooter = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
789
+ "div",
790
+ {
791
+ ref,
792
+ className: cn("border-t border-border p-4", className),
793
+ ...props
794
+ }
795
+ ));
796
+ SidebarFooter.displayName = "SidebarFooter";
797
+ var SidebarNav = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("nav", { ref, className: cn("space-y-1 px-2", className), ...props }));
798
+ SidebarNav.displayName = "SidebarNav";
799
+ var SidebarNavItem = React6.forwardRef(({ active, icon, collapsed, className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
800
+ "a",
801
+ {
802
+ ref,
803
+ className: cn(
804
+ "flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors",
805
+ active ? "bg-primary text-primary-text" : "text-text-secondary hover:bg-background-hover hover:text-text-primary",
806
+ collapsed && "justify-center",
807
+ className
808
+ ),
809
+ ...props,
810
+ children: [
811
+ icon && /* @__PURE__ */ jsx("span", { className: "flex-shrink-0", children: icon }),
812
+ !collapsed && /* @__PURE__ */ jsx("span", { className: "truncate", children })
813
+ ]
814
+ }
815
+ ));
816
+ SidebarNavItem.displayName = "SidebarNavItem";
817
+ var SidebarGroup = React6.forwardRef(
818
+ ({ title, collapsed, className, children, ...props }, ref) => /* @__PURE__ */ jsxs("div", { ref, className: cn("px-2 py-2", className), ...props, children: [
819
+ title && !collapsed && /* @__PURE__ */ jsx("div", { className: "px-3 py-2 text-xs font-semibold text-text-tertiary uppercase tracking-wide", children: title }),
820
+ /* @__PURE__ */ jsx("div", { className: "space-y-1", children })
821
+ ] })
822
+ );
823
+ SidebarGroup.displayName = "SidebarGroup";
824
+ var PageShell = React6.forwardRef(
825
+ ({ sidebar, header, footer, sidebarCollapsed, className, children, ...props }, ref) => {
826
+ return /* @__PURE__ */ jsxs("div", { ref, className: cn("min-h-screen", className), ...props, children: [
827
+ sidebar && /* @__PURE__ */ jsx("div", { className: "sidebar-wrapper", children: sidebar }),
828
+ /* @__PURE__ */ jsxs(
829
+ "div",
830
+ {
831
+ className: cn(
832
+ "flex min-h-screen flex-col transition-all duration-300",
833
+ sidebar && !sidebarCollapsed && "lg:pl-64",
834
+ sidebar && sidebarCollapsed && "lg:pl-16"
835
+ ),
836
+ children: [
837
+ header && /* @__PURE__ */ jsx("header", { className: "sticky top-0 z-40 border-b border-border bg-background-surface", children: header }),
838
+ /* @__PURE__ */ jsx("main", { className: "flex-1", children }),
839
+ footer && /* @__PURE__ */ jsx("footer", { className: "border-t border-border bg-background-surface", children: footer })
840
+ ]
841
+ }
842
+ )
843
+ ] });
844
+ }
845
+ );
846
+ PageShell.displayName = "PageShell";
847
+ var PageHeader = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
848
+ "div",
849
+ {
850
+ ref,
851
+ className: cn("flex h-16 items-center gap-4 px-6", className),
852
+ ...props
853
+ }
854
+ ));
855
+ PageHeader.displayName = "PageHeader";
856
+ var PageContent = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("p-6", className), ...props }));
857
+ PageContent.displayName = "PageContent";
858
+ var PageTitle = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
859
+ "h1",
860
+ {
861
+ ref,
862
+ className: cn("text-2xl font-semibold tracking-tight", className),
863
+ ...props
864
+ }
865
+ ));
866
+ PageTitle.displayName = "PageTitle";
867
+ var PageDescription = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
868
+ "p",
869
+ {
870
+ ref,
871
+ className: cn("text-sm text-text-secondary", className),
872
+ ...props
873
+ }
874
+ ));
875
+ PageDescription.displayName = "PageDescription";
876
+ var inputVariants = cva(
877
+ "flex w-full rounded-md border bg-background-surface px-3 py-2 text-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-text-tertiary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
878
+ {
879
+ variants: {
880
+ variant: {
881
+ default: "border-border hover:border-border-strong",
882
+ error: "border-error focus-visible:ring-error",
883
+ success: "border-success focus-visible:ring-success"
884
+ },
885
+ size: {
886
+ sm: "h-8 text-xs",
887
+ md: "h-10 text-sm",
888
+ lg: "h-11 text-base"
889
+ }
890
+ },
891
+ defaultVariants: {
892
+ variant: "default",
893
+ size: "md"
894
+ }
895
+ }
896
+ );
897
+ var Input = React6.forwardRef(
898
+ ({
899
+ className,
900
+ variant,
901
+ size,
902
+ type = "text",
903
+ leftIcon,
904
+ rightIcon,
905
+ error,
906
+ helperText,
907
+ label,
908
+ required,
909
+ id,
910
+ ...props
911
+ }, ref) => {
912
+ const generatedId = React6.useId();
913
+ const inputId = id ?? generatedId;
914
+ const errorId = `${inputId}-error`;
915
+ const helperId = `${inputId}-helper`;
916
+ const hasError = !!error;
917
+ const finalVariant = hasError ? "error" : variant;
918
+ return /* @__PURE__ */ jsxs("div", { className: "w-full", children: [
919
+ label && /* @__PURE__ */ jsxs(
920
+ "label",
921
+ {
922
+ htmlFor: inputId,
923
+ className: "mb-1.5 block text-sm font-medium text-text-primary",
924
+ children: [
925
+ label,
926
+ required && /* @__PURE__ */ jsx("span", { className: "ml-1 text-error", children: "*" })
927
+ ]
928
+ }
929
+ ),
930
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
931
+ leftIcon && /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-text-tertiary", children: leftIcon }),
932
+ /* @__PURE__ */ jsx(
933
+ "input",
934
+ {
935
+ type,
936
+ id: inputId,
937
+ className: cn(
938
+ inputVariants({ variant: finalVariant, size }),
939
+ leftIcon && "pl-10",
940
+ rightIcon && "pr-10",
941
+ className
942
+ ),
943
+ ref,
944
+ "aria-invalid": hasError,
945
+ "aria-describedby": error ? errorId : helperText ? helperId : void 0,
946
+ ...props
947
+ }
948
+ ),
949
+ rightIcon && /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-text-tertiary", children: rightIcon })
950
+ ] }),
951
+ error && /* @__PURE__ */ jsx("p", { id: errorId, className: "mt-1.5 text-xs text-error", role: "alert", children: error }),
952
+ helperText && !error && /* @__PURE__ */ jsx("p", { id: helperId, className: "mt-1.5 text-xs text-text-secondary", children: helperText })
953
+ ] });
954
+ }
955
+ );
956
+ Input.displayName = "Input";
957
+ var textareaVariants = cva(
958
+ "flex min-h-[80px] w-full rounded-md border bg-background-surface px-3 py-2 text-sm transition-colors placeholder:text-text-tertiary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
959
+ {
960
+ variants: {
961
+ variant: {
962
+ default: "border-border hover:border-border-strong",
963
+ error: "border-error focus-visible:ring-error",
964
+ success: "border-success focus-visible:ring-success"
965
+ },
966
+ resize: {
967
+ none: "resize-none",
968
+ vertical: "resize-y",
969
+ horizontal: "resize-x",
970
+ both: "resize"
971
+ }
972
+ },
973
+ defaultVariants: {
974
+ variant: "default",
975
+ resize: "vertical"
976
+ }
977
+ }
978
+ );
979
+ var Textarea = React6.forwardRef(
980
+ ({
981
+ className,
982
+ variant,
983
+ resize,
984
+ error,
985
+ helperText,
986
+ label,
987
+ required,
988
+ id,
989
+ ...props
990
+ }, ref) => {
991
+ const generatedId = React6.useId();
992
+ const textareaId = id ?? generatedId;
993
+ const errorId = `${textareaId}-error`;
994
+ const helperId = `${textareaId}-helper`;
995
+ const hasError = !!error;
996
+ const finalVariant = hasError ? "error" : variant;
997
+ return /* @__PURE__ */ jsxs("div", { className: "w-full", children: [
998
+ label && /* @__PURE__ */ jsxs(
999
+ "label",
1000
+ {
1001
+ htmlFor: textareaId,
1002
+ className: "mb-1.5 block text-sm font-medium text-text-primary",
1003
+ children: [
1004
+ label,
1005
+ required && /* @__PURE__ */ jsx("span", { className: "ml-1 text-error", children: "*" })
1006
+ ]
1007
+ }
1008
+ ),
1009
+ /* @__PURE__ */ jsx(
1010
+ "textarea",
1011
+ {
1012
+ id: textareaId,
1013
+ className: cn(
1014
+ textareaVariants({ variant: finalVariant, resize }),
1015
+ className
1016
+ ),
1017
+ ref,
1018
+ "aria-invalid": hasError,
1019
+ "aria-describedby": error ? errorId : helperText ? helperId : void 0,
1020
+ ...props
1021
+ }
1022
+ ),
1023
+ error && /* @__PURE__ */ jsx("p", { id: errorId, className: "mt-1.5 text-xs text-error", role: "alert", children: error }),
1024
+ helperText && !error && /* @__PURE__ */ jsx("p", { id: helperId, className: "mt-1.5 text-xs text-text-secondary", children: helperText })
1025
+ ] });
1026
+ }
1027
+ );
1028
+ Textarea.displayName = "Textarea";
1029
+ var Checkbox = React6.forwardRef(
1030
+ ({ className, label, helperText, error, indeterminate, id, ...props }, ref) => {
1031
+ const generatedId = React6.useId();
1032
+ const checkboxId = id ?? generatedId;
1033
+ const errorId = `${checkboxId}-error`;
1034
+ const helperId = `${checkboxId}-helper`;
1035
+ const hasError = !!error;
1036
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
1037
+ /* @__PURE__ */ jsx(
1038
+ CheckboxPrimitive.Root,
1039
+ {
1040
+ ref,
1041
+ id: checkboxId,
1042
+ className: cn(
1043
+ "peer h-5 w-5 shrink-0 rounded border border-border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:border-primary data-[state=checked]:text-primary-text",
1044
+ hasError && "border-error focus-visible:ring-error",
1045
+ className
1046
+ ),
1047
+ "aria-invalid": hasError,
1048
+ "aria-describedby": error ? errorId : helperText ? helperId : void 0,
1049
+ ...props,
1050
+ children: /* @__PURE__ */ jsx(
1051
+ CheckboxPrimitive.Indicator,
1052
+ {
1053
+ className: cn("flex items-center justify-center text-current"),
1054
+ children: indeterminate ? /* @__PURE__ */ jsx(Minus, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" })
1055
+ }
1056
+ )
1057
+ }
1058
+ ),
1059
+ (label || helperText || error) && /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
1060
+ label && /* @__PURE__ */ jsx(
1061
+ "label",
1062
+ {
1063
+ htmlFor: checkboxId,
1064
+ className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
1065
+ children: label
1066
+ }
1067
+ ),
1068
+ error && /* @__PURE__ */ jsx(
1069
+ "p",
1070
+ {
1071
+ id: errorId,
1072
+ className: "mt-1 text-xs text-error",
1073
+ role: "alert",
1074
+ children: error
1075
+ }
1076
+ ),
1077
+ helperText && !error && /* @__PURE__ */ jsx("p", { id: helperId, className: "mt-1 text-xs text-text-secondary", children: helperText })
1078
+ ] })
1079
+ ] });
1080
+ }
1081
+ );
1082
+ Checkbox.displayName = CheckboxPrimitive.Root.displayName;
1083
+ var RadioGroup = React6.forwardRef(({ className, ...props }, ref) => {
1084
+ return /* @__PURE__ */ jsx(
1085
+ RadioGroupPrimitive.Root,
1086
+ {
1087
+ className: cn("grid gap-2", className),
1088
+ ...props,
1089
+ ref
1090
+ }
1091
+ );
1092
+ });
1093
+ RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
1094
+ var RadioItem = React6.forwardRef(({ className, label, helperText, id, ...props }, ref) => {
1095
+ const generatedId = React6.useId();
1096
+ const radioId = id ?? generatedId;
1097
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
1098
+ /* @__PURE__ */ jsx(
1099
+ RadioGroupPrimitive.Item,
1100
+ {
1101
+ ref,
1102
+ id: radioId,
1103
+ className: cn(
1104
+ "aspect-square h-5 w-5 rounded-full border border-border text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
1105
+ className
1106
+ ),
1107
+ ...props,
1108
+ children: /* @__PURE__ */ jsx(RadioGroupPrimitive.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx(Circle, { className: "h-2.5 w-2.5 fill-current text-current" }) })
1109
+ }
1110
+ ),
1111
+ (label || helperText) && /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
1112
+ label && /* @__PURE__ */ jsx(
1113
+ "label",
1114
+ {
1115
+ htmlFor: radioId,
1116
+ className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
1117
+ children: label
1118
+ }
1119
+ ),
1120
+ helperText && /* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-text-secondary", children: helperText })
1121
+ ] })
1122
+ ] });
1123
+ });
1124
+ RadioItem.displayName = RadioGroupPrimitive.Item.displayName;
1125
+ var Switch = React6.forwardRef(({ className, label, helperText, error, id, ...props }, ref) => {
1126
+ const generatedId = React6.useId();
1127
+ const switchId = id ?? generatedId;
1128
+ const errorId = `${switchId}-error`;
1129
+ const helperId = `${switchId}-helper`;
1130
+ const hasError = !!error;
1131
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
1132
+ /* @__PURE__ */ jsx(
1133
+ SwitchPrimitives.Root,
1134
+ {
1135
+ id: switchId,
1136
+ className: cn(
1137
+ "peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-border-strong",
1138
+ hasError && "focus-visible:ring-error",
1139
+ className
1140
+ ),
1141
+ "aria-invalid": hasError,
1142
+ "aria-describedby": error ? errorId : helperText ? helperId : void 0,
1143
+ ...props,
1144
+ ref,
1145
+ children: /* @__PURE__ */ jsx(
1146
+ SwitchPrimitives.Thumb,
1147
+ {
1148
+ className: cn(
1149
+ "pointer-events-none block h-5 w-5 rounded-full bg-background-surface shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
1150
+ )
1151
+ }
1152
+ )
1153
+ }
1154
+ ),
1155
+ (label || helperText || error) && /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
1156
+ label && /* @__PURE__ */ jsx(
1157
+ "label",
1158
+ {
1159
+ htmlFor: switchId,
1160
+ className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
1161
+ children: label
1162
+ }
1163
+ ),
1164
+ error && /* @__PURE__ */ jsx("p", { id: errorId, className: "mt-1 text-xs text-error", role: "alert", children: error }),
1165
+ helperText && !error && /* @__PURE__ */ jsx("p", { id: helperId, className: "mt-1 text-xs text-text-secondary", children: helperText })
1166
+ ] })
1167
+ ] });
1168
+ });
1169
+ Switch.displayName = SwitchPrimitives.Root.displayName;
1170
+ var Select = SelectPrimitive.Root;
1171
+ var SelectGroup = SelectPrimitive.Group;
1172
+ var SelectValue = SelectPrimitive.Value;
1173
+ var SelectTrigger = React6.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
1174
+ SelectPrimitive.Trigger,
1175
+ {
1176
+ ref,
1177
+ className: cn(
1178
+ "flex h-10 w-full items-center justify-between rounded-md border border-border bg-background-surface px-3 py-2 text-sm placeholder:text-text-tertiary focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
1179
+ className
1180
+ ),
1181
+ ...props,
1182
+ children: [
1183
+ children,
1184
+ /* @__PURE__ */ jsx(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4 opacity-50" }) })
1185
+ ]
1186
+ }
1187
+ ));
1188
+ SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
1189
+ var SelectScrollUpButton = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1190
+ SelectPrimitive.ScrollUpButton,
1191
+ {
1192
+ ref,
1193
+ className: cn(
1194
+ "flex cursor-default items-center justify-center py-1",
1195
+ className
1196
+ ),
1197
+ ...props,
1198
+ children: /* @__PURE__ */ jsx(ChevronUp, { className: "h-4 w-4" })
1199
+ }
1200
+ ));
1201
+ SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
1202
+ var SelectScrollDownButton = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1203
+ SelectPrimitive.ScrollDownButton,
1204
+ {
1205
+ ref,
1206
+ className: cn(
1207
+ "flex cursor-default items-center justify-center py-1",
1208
+ className
1209
+ ),
1210
+ ...props,
1211
+ children: /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4" })
1212
+ }
1213
+ ));
1214
+ SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
1215
+ var SelectContent = React6.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
1216
+ SelectPrimitive.Content,
1217
+ {
1218
+ ref,
1219
+ className: cn(
1220
+ "relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border border-border bg-background-surface text-text-primary shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1221
+ 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",
1222
+ className
1223
+ ),
1224
+ position,
1225
+ ...props,
1226
+ children: [
1227
+ /* @__PURE__ */ jsx(SelectScrollUpButton, {}),
1228
+ /* @__PURE__ */ jsx(
1229
+ SelectPrimitive.Viewport,
1230
+ {
1231
+ className: cn(
1232
+ "p-1",
1233
+ position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
1234
+ ),
1235
+ children
1236
+ }
1237
+ ),
1238
+ /* @__PURE__ */ jsx(SelectScrollDownButton, {})
1239
+ ]
1240
+ }
1241
+ ) }));
1242
+ SelectContent.displayName = SelectPrimitive.Content.displayName;
1243
+ var SelectLabel = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1244
+ SelectPrimitive.Label,
1245
+ {
1246
+ ref,
1247
+ className: cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className),
1248
+ ...props
1249
+ }
1250
+ ));
1251
+ SelectLabel.displayName = SelectPrimitive.Label.displayName;
1252
+ var SelectItem = React6.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
1253
+ SelectPrimitive.Item,
1254
+ {
1255
+ ref,
1256
+ className: cn(
1257
+ "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-background-hover focus:text-text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1258
+ className
1259
+ ),
1260
+ ...props,
1261
+ children: [
1262
+ /* @__PURE__ */ jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" }) }) }),
1263
+ /* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })
1264
+ ]
1265
+ }
1266
+ ));
1267
+ SelectItem.displayName = SelectPrimitive.Item.displayName;
1268
+ var SelectSeparator = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1269
+ SelectPrimitive.Separator,
1270
+ {
1271
+ ref,
1272
+ className: cn("-mx-1 my-1 h-px bg-border", className),
1273
+ ...props
1274
+ }
1275
+ ));
1276
+ SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
1277
+ var buttonVariants = cva(
1278
+ "inline-flex items-center justify-center gap-2 rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
1279
+ {
1280
+ variants: {
1281
+ variant: {
1282
+ primary: "bg-primary text-primary-text hover:bg-primary-hover active:bg-primary-active",
1283
+ secondary: "bg-background-surface text-text-primary border border-border hover:bg-background-hover active:bg-background-active",
1284
+ outline: "border border-border bg-transparent hover:bg-background-hover active:bg-background-active",
1285
+ ghost: "bg-transparent hover:bg-background-hover active:bg-background-active",
1286
+ danger: "bg-error text-error-text hover:bg-error-hover active:bg-error-active",
1287
+ success: "bg-success text-success-text hover:bg-success-hover active:bg-success-active",
1288
+ link: "text-text-link hover:text-text-linkHover underline-offset-4 hover:underline"
1289
+ },
1290
+ size: {
1291
+ xs: "h-7 px-2 text-xs",
1292
+ sm: "h-8 px-3 text-sm",
1293
+ md: "h-10 px-4 text-base",
1294
+ lg: "h-11 px-6 text-lg",
1295
+ xl: "h-12 px-8 text-lg"
1296
+ },
1297
+ fullWidth: {
1298
+ true: "w-full"
1299
+ }
1300
+ },
1301
+ defaultVariants: {
1302
+ variant: "primary",
1303
+ size: "md"
1304
+ }
1305
+ }
1306
+ );
1307
+ var Button = React6.forwardRef(
1308
+ ({
1309
+ className,
1310
+ variant,
1311
+ size,
1312
+ fullWidth,
1313
+ loading,
1314
+ disabled,
1315
+ leftIcon,
1316
+ rightIcon,
1317
+ children,
1318
+ ...props
1319
+ }, ref) => {
1320
+ return /* @__PURE__ */ jsxs(
1321
+ "button",
1322
+ {
1323
+ className: cn(buttonVariants({ variant, size, fullWidth, className })),
1324
+ ref,
1325
+ disabled: disabled || loading,
1326
+ ...props,
1327
+ children: [
1328
+ loading ? /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }) : leftIcon && /* @__PURE__ */ jsx("span", { className: "inline-flex", children: leftIcon }),
1329
+ children,
1330
+ !loading && rightIcon && /* @__PURE__ */ jsx("span", { className: "inline-flex", children: rightIcon })
1331
+ ]
1332
+ }
1333
+ );
1334
+ }
1335
+ );
1336
+ Button.displayName = "Button";
1337
+ var toastVariants = cva(
1338
+ "group pointer-events-auto relative flex w-full items-center justify-between gap-3 overflow-hidden rounded-lg border p-4 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",
1339
+ {
1340
+ variants: {
1341
+ variant: {
1342
+ default: "border-border bg-background-surface text-text-primary",
1343
+ success: "border-success bg-success-light text-success-dark dark:bg-success-dark dark:text-success-light",
1344
+ error: "border-error bg-error-light text-error-dark dark:bg-error-dark dark:text-error-light",
1345
+ warning: "border-warning bg-warning-light text-warning-dark dark:bg-warning-dark dark:text-warning-light",
1346
+ info: "border-info bg-info-light text-info-dark dark:bg-info-dark dark:text-info-light"
1347
+ }
1348
+ },
1349
+ defaultVariants: {
1350
+ variant: "default"
1351
+ }
1352
+ }
1353
+ );
1354
+ var ToastProvider = ToastPrimitives.Provider;
1355
+ var ToastViewport = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1356
+ ToastPrimitives.Viewport,
1357
+ {
1358
+ ref,
1359
+ className: cn(
1360
+ "fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",
1361
+ className
1362
+ ),
1363
+ ...props
1364
+ }
1365
+ ));
1366
+ ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
1367
+ var Toast = React6.forwardRef(({ className, variant, ...props }, ref) => {
1368
+ return /* @__PURE__ */ jsx(
1369
+ ToastPrimitives.Root,
1370
+ {
1371
+ ref,
1372
+ className: cn(toastVariants({ variant }), className),
1373
+ ...props
1374
+ }
1375
+ );
1376
+ });
1377
+ Toast.displayName = ToastPrimitives.Root.displayName;
1378
+ var ToastAction = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1379
+ ToastPrimitives.Action,
1380
+ {
1381
+ ref,
1382
+ className: cn(
1383
+ "inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-background-hover focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
1384
+ className
1385
+ ),
1386
+ ...props
1387
+ }
1388
+ ));
1389
+ ToastAction.displayName = ToastPrimitives.Action.displayName;
1390
+ var ToastClose = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1391
+ ToastPrimitives.Close,
1392
+ {
1393
+ ref,
1394
+ className: cn(
1395
+ "absolute right-2 top-2 rounded-md p-1 text-text-secondary opacity-70 transition-opacity hover:opacity-100 focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100",
1396
+ className
1397
+ ),
1398
+ "toast-close": "",
1399
+ ...props,
1400
+ children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
1401
+ }
1402
+ ));
1403
+ ToastClose.displayName = ToastPrimitives.Close.displayName;
1404
+ var ToastTitle = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1405
+ ToastPrimitives.Title,
1406
+ {
1407
+ ref,
1408
+ className: cn("text-sm font-semibold", className),
1409
+ ...props
1410
+ }
1411
+ ));
1412
+ ToastTitle.displayName = ToastPrimitives.Title.displayName;
1413
+ var ToastDescription = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1414
+ ToastPrimitives.Description,
1415
+ {
1416
+ ref,
1417
+ className: cn("text-sm opacity-90", className),
1418
+ ...props
1419
+ }
1420
+ ));
1421
+ ToastDescription.displayName = ToastPrimitives.Description.displayName;
1422
+ var toastIcons = {
1423
+ success: CheckCircle2,
1424
+ error: AlertCircle,
1425
+ warning: AlertTriangle,
1426
+ info: Info
1427
+ };
1428
+ var TOAST_LIMIT = 5;
1429
+ var TOAST_REMOVE_DELAY = 1e6;
1430
+ var count = 0;
1431
+ function genId() {
1432
+ count = (count + 1) % Number.MAX_VALUE;
1433
+ return count.toString();
1434
+ }
1435
+ var toastTimeouts = /* @__PURE__ */ new Map();
1436
+ var addToRemoveQueue = (toastId) => {
1437
+ if (toastTimeouts.has(toastId)) {
1438
+ return;
1439
+ }
1440
+ const timeout = setTimeout(() => {
1441
+ toastTimeouts.delete(toastId);
1442
+ dispatch({
1443
+ type: "REMOVE_TOAST",
1444
+ toastId
1445
+ });
1446
+ }, TOAST_REMOVE_DELAY);
1447
+ toastTimeouts.set(toastId, timeout);
1448
+ };
1449
+ var reducer = (state, action) => {
1450
+ switch (action.type) {
1451
+ case "ADD_TOAST":
1452
+ return {
1453
+ ...state,
1454
+ toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT)
1455
+ };
1456
+ case "UPDATE_TOAST":
1457
+ return {
1458
+ ...state,
1459
+ toasts: state.toasts.map(
1460
+ (t) => t.id === action.toast.id ? { ...t, ...action.toast } : t
1461
+ )
1462
+ };
1463
+ case "DISMISS_TOAST": {
1464
+ const { toastId } = action;
1465
+ if (toastId) {
1466
+ addToRemoveQueue(toastId);
1467
+ } else {
1468
+ state.toasts.forEach((toast2) => {
1469
+ addToRemoveQueue(toast2.id);
1470
+ });
1471
+ }
1472
+ return {
1473
+ ...state,
1474
+ toasts: state.toasts.map(
1475
+ (t) => t.id === toastId || toastId === void 0 ? {
1476
+ ...t,
1477
+ open: false
1478
+ } : t
1479
+ )
1480
+ };
1481
+ }
1482
+ case "REMOVE_TOAST":
1483
+ if (action.toastId === void 0) {
1484
+ return {
1485
+ ...state,
1486
+ toasts: []
1487
+ };
1488
+ }
1489
+ return {
1490
+ ...state,
1491
+ toasts: state.toasts.filter((t) => t.id !== action.toastId)
1492
+ };
1493
+ }
1494
+ };
1495
+ var listeners = [];
1496
+ var memoryState = { toasts: [] };
1497
+ function dispatch(action) {
1498
+ memoryState = reducer(memoryState, action);
1499
+ listeners.forEach((listener) => {
1500
+ listener(memoryState);
1501
+ });
1502
+ }
1503
+ function toast({ ...props }) {
1504
+ const id = genId();
1505
+ const update = (props2) => dispatch({
1506
+ type: "UPDATE_TOAST",
1507
+ toast: { ...props2, id }
1508
+ });
1509
+ const dismiss = () => dispatch({ type: "DISMISS_TOAST", toastId: id });
1510
+ dispatch({
1511
+ type: "ADD_TOAST",
1512
+ toast: {
1513
+ ...props,
1514
+ id,
1515
+ open: true,
1516
+ onOpenChange: (open) => {
1517
+ if (!open) dismiss();
1518
+ }
1519
+ }
1520
+ });
1521
+ return {
1522
+ id,
1523
+ dismiss,
1524
+ update
1525
+ };
1526
+ }
1527
+ function useToast() {
1528
+ const [state, setState] = React6.useState(memoryState);
1529
+ React6.useEffect(() => {
1530
+ listeners.push(setState);
1531
+ return () => {
1532
+ const index = listeners.indexOf(setState);
1533
+ if (index > -1) {
1534
+ listeners.splice(index, 1);
1535
+ }
1536
+ };
1537
+ }, [state]);
1538
+ return {
1539
+ ...state,
1540
+ toast,
1541
+ dismiss: (toastId) => dispatch({ type: "DISMISS_TOAST", toastId })
1542
+ };
1543
+ }
1544
+ function Toaster() {
1545
+ const { toasts } = useToast();
1546
+ return /* @__PURE__ */ jsxs(ToastProvider, { children: [
1547
+ toasts.map(function({ id, title, description, action, variant, ...props }) {
1548
+ const Icon3 = variant && variant !== "default" ? toastIcons[variant] : null;
1549
+ return /* @__PURE__ */ jsxs(Toast, { variant, ...props, children: [
1550
+ /* @__PURE__ */ jsxs("div", { className: "flex gap-3", children: [
1551
+ Icon3 && /* @__PURE__ */ jsx(Icon3, { className: "h-5 w-5 shrink-0" }),
1552
+ /* @__PURE__ */ jsxs("div", { className: "grid gap-1", children: [
1553
+ title && /* @__PURE__ */ jsx(ToastTitle, { children: title }),
1554
+ description && /* @__PURE__ */ jsx(ToastDescription, { children: description })
1555
+ ] })
1556
+ ] }),
1557
+ action,
1558
+ /* @__PURE__ */ jsx(ToastClose, {})
1559
+ ] }, id);
1560
+ }),
1561
+ /* @__PURE__ */ jsx(ToastViewport, {})
1562
+ ] });
1563
+ }
1564
+ var alertVariants = cva(
1565
+ "relative w-full rounded-lg border p-4 [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:pl-8",
1566
+ {
1567
+ variants: {
1568
+ variant: {
1569
+ default: "bg-background-surface border-border text-text-primary",
1570
+ success: "bg-success-light border-success text-success-dark dark:bg-success-dark dark:border-success dark:text-success-light",
1571
+ error: "bg-error-light border-error text-error-dark dark:bg-error-dark dark:border-error dark:text-error-light",
1572
+ warning: "bg-warning-light border-warning text-warning-dark dark:bg-warning-dark dark:border-warning dark:text-warning-light",
1573
+ info: "bg-info-light border-info text-info-dark dark:bg-info-dark dark:border-info dark:text-info-light"
1574
+ }
1575
+ },
1576
+ defaultVariants: {
1577
+ variant: "default"
1578
+ }
1579
+ }
1580
+ );
1581
+ var Alert = React6.forwardRef(
1582
+ ({ className, variant, icon, closable, onClose, children, ...props }, ref) => {
1583
+ const [visible, setVisible] = React6.useState(true);
1584
+ const handleClose = () => {
1585
+ setVisible(false);
1586
+ onClose?.();
1587
+ };
1588
+ if (!visible) return null;
1589
+ const defaultIcon = getDefaultIcon(variant);
1590
+ return /* @__PURE__ */ jsxs(
1591
+ "div",
1592
+ {
1593
+ ref,
1594
+ role: "alert",
1595
+ className: cn(alertVariants({ variant }), className),
1596
+ ...props,
1597
+ children: [
1598
+ (icon || defaultIcon) && /* @__PURE__ */ jsx("div", { className: "absolute left-4 top-4", children: icon || defaultIcon }),
1599
+ /* @__PURE__ */ jsx("div", { className: cn(icon || defaultIcon ? "pl-8" : ""), children }),
1600
+ closable && /* @__PURE__ */ jsx(
1601
+ "button",
1602
+ {
1603
+ onClick: handleClose,
1604
+ className: "absolute right-4 top-4 rounded-md p-1 opacity-70 transition-opacity hover:opacity-100 focus:opacity-100 focus:outline-none focus:ring-2",
1605
+ "aria-label": "Close alert",
1606
+ children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
1607
+ }
1608
+ )
1609
+ ]
1610
+ }
1611
+ );
1612
+ }
1613
+ );
1614
+ Alert.displayName = "Alert";
1615
+ var AlertTitle = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1616
+ "h5",
1617
+ {
1618
+ ref,
1619
+ className: cn("mb-1 font-semibold leading-none tracking-tight", className),
1620
+ ...props
1621
+ }
1622
+ ));
1623
+ AlertTitle.displayName = "AlertTitle";
1624
+ var AlertDescription = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1625
+ "div",
1626
+ {
1627
+ ref,
1628
+ className: cn("text-sm [&_p]:leading-relaxed", className),
1629
+ ...props
1630
+ }
1631
+ ));
1632
+ AlertDescription.displayName = "AlertDescription";
1633
+ function getDefaultIcon(variant) {
1634
+ const iconClass = "h-5 w-5";
1635
+ switch (variant) {
1636
+ case "success":
1637
+ return /* @__PURE__ */ jsx(CheckCircle2, { className: iconClass });
1638
+ case "error":
1639
+ return /* @__PURE__ */ jsx(AlertCircle, { className: iconClass });
1640
+ case "warning":
1641
+ return /* @__PURE__ */ jsx(AlertTriangle, { className: iconClass });
1642
+ case "info":
1643
+ return /* @__PURE__ */ jsx(Info, { className: iconClass });
1644
+ default:
1645
+ return /* @__PURE__ */ jsx(Info, { className: iconClass });
1646
+ }
1647
+ }
1648
+ var Modal = DialogPrimitive.Root;
1649
+ var ModalTrigger = DialogPrimitive.Trigger;
1650
+ var ModalPortal = DialogPrimitive.Portal;
1651
+ var ModalClose = DialogPrimitive.Close;
1652
+ var ModalOverlay = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1653
+ DialogPrimitive.Overlay,
1654
+ {
1655
+ ref,
1656
+ className: cn(
1657
+ "fixed inset-0 z-50 bg-background-overlay data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
1658
+ className
1659
+ ),
1660
+ ...props
1661
+ }
1662
+ ));
1663
+ ModalOverlay.displayName = DialogPrimitive.Overlay.displayName;
1664
+ var ModalContent = React6.forwardRef(({ className, children, showCloseButton = true, ...props }, ref) => /* @__PURE__ */ jsxs(ModalPortal, { children: [
1665
+ /* @__PURE__ */ jsx(ModalOverlay, {}),
1666
+ /* @__PURE__ */ jsxs(
1667
+ DialogPrimitive.Content,
1668
+ {
1669
+ ref,
1670
+ className: cn(
1671
+ "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-border bg-background-surface p-6 shadow-xl duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-xl",
1672
+ className
1673
+ ),
1674
+ ...props,
1675
+ children: [
1676
+ children,
1677
+ showCloseButton && /* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-background-active", children: [
1678
+ /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
1679
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
1680
+ ] })
1681
+ ]
1682
+ }
1683
+ )
1684
+ ] }));
1685
+ ModalContent.displayName = DialogPrimitive.Content.displayName;
1686
+ var ModalHeader = ({
1687
+ className,
1688
+ ...props
1689
+ }) => /* @__PURE__ */ jsx(
1690
+ "div",
1691
+ {
1692
+ className: cn(
1693
+ "flex flex-col space-y-1.5 text-center sm:text-left",
1694
+ className
1695
+ ),
1696
+ ...props
1697
+ }
1698
+ );
1699
+ ModalHeader.displayName = "ModalHeader";
1700
+ var ModalFooter = ({
1701
+ className,
1702
+ ...props
1703
+ }) => /* @__PURE__ */ jsx(
1704
+ "div",
1705
+ {
1706
+ className: cn(
1707
+ "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
1708
+ className
1709
+ ),
1710
+ ...props
1711
+ }
1712
+ );
1713
+ ModalFooter.displayName = "ModalFooter";
1714
+ var ModalTitle = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1715
+ DialogPrimitive.Title,
1716
+ {
1717
+ ref,
1718
+ className: cn(
1719
+ "text-2xl font-semibold leading-none tracking-tight",
1720
+ className
1721
+ ),
1722
+ ...props
1723
+ }
1724
+ ));
1725
+ ModalTitle.displayName = DialogPrimitive.Title.displayName;
1726
+ var ModalDescription = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1727
+ DialogPrimitive.Description,
1728
+ {
1729
+ ref,
1730
+ className: cn("text-sm text-text-secondary", className),
1731
+ ...props
1732
+ }
1733
+ ));
1734
+ ModalDescription.displayName = DialogPrimitive.Description.displayName;
1735
+ var cardVariants = cva(
1736
+ "rounded-lg border border-border bg-background-surface text-text-primary",
1737
+ {
1738
+ variants: {
1739
+ variant: {
1740
+ default: "",
1741
+ elevated: "shadow-md",
1742
+ outlined: "border-2"
1743
+ },
1744
+ padding: {
1745
+ none: "",
1746
+ sm: "p-4",
1747
+ md: "p-6",
1748
+ lg: "p-8"
1749
+ },
1750
+ hoverable: {
1751
+ true: "transition-all hover:shadow-lg hover:-translate-y-1 cursor-pointer"
1752
+ }
1753
+ },
1754
+ defaultVariants: {
1755
+ variant: "default",
1756
+ padding: "md"
1757
+ }
1758
+ }
1759
+ );
1760
+ var Card = React6.forwardRef(
1761
+ ({ as: Component = "div", variant, padding, hoverable, className, ...props }, ref) => {
1762
+ return React6.createElement(Component, {
1763
+ ref,
1764
+ className: cn(cardVariants({ variant, padding, hoverable }), className),
1765
+ ...props
1766
+ });
1767
+ }
1768
+ );
1769
+ Card.displayName = "Card";
1770
+ var CardHeader = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1771
+ "div",
1772
+ {
1773
+ ref,
1774
+ className: cn("flex flex-col space-y-1.5 p-6", className),
1775
+ ...props
1776
+ }
1777
+ ));
1778
+ CardHeader.displayName = "CardHeader";
1779
+ var CardTitle = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1780
+ "h3",
1781
+ {
1782
+ ref,
1783
+ className: cn(
1784
+ "text-xl font-semibold leading-none tracking-tight",
1785
+ className
1786
+ ),
1787
+ ...props
1788
+ }
1789
+ ));
1790
+ CardTitle.displayName = "CardTitle";
1791
+ var CardDescription = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1792
+ "p",
1793
+ {
1794
+ ref,
1795
+ className: cn("text-sm text-text-secondary", className),
1796
+ ...props
1797
+ }
1798
+ ));
1799
+ CardDescription.displayName = "CardDescription";
1800
+ var CardContent = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("p-6 pt-0", className), ...props }));
1801
+ CardContent.displayName = "CardContent";
1802
+ var CardFooter = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1803
+ "div",
1804
+ {
1805
+ ref,
1806
+ className: cn("flex items-center p-6 pt-0", className),
1807
+ ...props
1808
+ }
1809
+ ));
1810
+ CardFooter.displayName = "CardFooter";
1811
+ var badgeVariants = cva(
1812
+ "inline-flex items-center rounded-full border font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",
1813
+ {
1814
+ variants: {
1815
+ variant: {
1816
+ default: "border-transparent bg-primary text-primary-text hover:bg-primary-hover",
1817
+ secondary: "border-transparent bg-background-active text-text-secondary hover:bg-border",
1818
+ outline: "border-border text-text-primary",
1819
+ success: "border-transparent bg-success-light text-success-dark dark:bg-success-dark dark:text-success-light",
1820
+ error: "border-transparent bg-error-light text-error-dark dark:bg-error-dark dark:text-error-light",
1821
+ warning: "border-transparent bg-warning-light text-warning-dark dark:bg-warning-dark dark:text-warning-light",
1822
+ info: "border-transparent bg-info-light text-info-dark dark:bg-info-dark dark:text-info-light"
1823
+ },
1824
+ size: {
1825
+ sm: "px-2 py-0.5 text-xs",
1826
+ md: "px-2.5 py-0.5 text-sm",
1827
+ lg: "px-3 py-1 text-base"
1828
+ }
1829
+ },
1830
+ defaultVariants: {
1831
+ variant: "default",
1832
+ size: "md"
1833
+ }
1834
+ }
1835
+ );
1836
+ var Badge = React6.forwardRef(
1837
+ ({
1838
+ className,
1839
+ variant,
1840
+ size,
1841
+ leftIcon,
1842
+ rightIcon,
1843
+ onRemove,
1844
+ children,
1845
+ ...props
1846
+ }, ref) => {
1847
+ return /* @__PURE__ */ jsxs(
1848
+ "div",
1849
+ {
1850
+ ref,
1851
+ className: cn(badgeVariants({ variant, size }), className),
1852
+ ...props,
1853
+ children: [
1854
+ leftIcon && /* @__PURE__ */ jsx("span", { className: "mr-1 inline-flex", children: leftIcon }),
1855
+ children,
1856
+ rightIcon && /* @__PURE__ */ jsx("span", { className: "ml-1 inline-flex", children: rightIcon }),
1857
+ onRemove && /* @__PURE__ */ jsx(
1858
+ "button",
1859
+ {
1860
+ onClick: onRemove,
1861
+ className: "ml-1 inline-flex rounded-full hover:bg-black/10 dark:hover:bg-white/10",
1862
+ "aria-label": "Remove",
1863
+ children: /* @__PURE__ */ jsx(
1864
+ "svg",
1865
+ {
1866
+ className: "h-3 w-3",
1867
+ fill: "none",
1868
+ stroke: "currentColor",
1869
+ viewBox: "0 0 24 24",
1870
+ children: /* @__PURE__ */ jsx(
1871
+ "path",
1872
+ {
1873
+ strokeLinecap: "round",
1874
+ strokeLinejoin: "round",
1875
+ strokeWidth: 2,
1876
+ d: "M6 18L18 6M6 6l12 12"
1877
+ }
1878
+ )
1879
+ }
1880
+ )
1881
+ }
1882
+ )
1883
+ ]
1884
+ }
1885
+ );
1886
+ }
1887
+ );
1888
+ Badge.displayName = "Badge";
1889
+ var avatarVariants = cva(
1890
+ "relative flex shrink-0 overflow-hidden rounded-full",
1891
+ {
1892
+ variants: {
1893
+ size: {
1894
+ xs: "h-6 w-6 text-xs",
1895
+ sm: "h-8 w-8 text-sm",
1896
+ md: "h-10 w-10 text-base",
1897
+ lg: "h-12 w-12 text-lg",
1898
+ xl: "h-16 w-16 text-xl",
1899
+ "2xl": "h-20 w-20 text-2xl"
1900
+ }
1901
+ },
1902
+ defaultVariants: {
1903
+ size: "md"
1904
+ }
1905
+ }
1906
+ );
1907
+ var Avatar = React6.forwardRef(({ className, size, src, alt, fallback, ...props }, ref) => {
1908
+ return /* @__PURE__ */ jsxs(
1909
+ AvatarPrimitive.Root,
1910
+ {
1911
+ ref,
1912
+ className: cn(avatarVariants({ size }), className),
1913
+ ...props,
1914
+ children: [
1915
+ /* @__PURE__ */ jsx(AvatarImage, { src, alt }),
1916
+ /* @__PURE__ */ jsx(AvatarFallback, { children: fallback || getInitials(alt || "") })
1917
+ ]
1918
+ }
1919
+ );
1920
+ });
1921
+ Avatar.displayName = AvatarPrimitive.Root.displayName;
1922
+ var AvatarImage = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1923
+ AvatarPrimitive.Image,
1924
+ {
1925
+ ref,
1926
+ className: cn("aspect-square h-full w-full", className),
1927
+ ...props
1928
+ }
1929
+ ));
1930
+ AvatarImage.displayName = AvatarPrimitive.Image.displayName;
1931
+ var AvatarFallback = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1932
+ AvatarPrimitive.Fallback,
1933
+ {
1934
+ ref,
1935
+ className: cn(
1936
+ "flex h-full w-full items-center justify-center rounded-full bg-border-strong text-text-secondary font-medium",
1937
+ className
1938
+ ),
1939
+ ...props
1940
+ }
1941
+ ));
1942
+ AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
1943
+ function getInitials(name) {
1944
+ const parts = name.split(" ").filter(Boolean);
1945
+ if (parts.length === 0) return "?";
1946
+ if (parts.length === 1) return parts[0].charAt(0).toUpperCase();
1947
+ return (parts[0].charAt(0) + parts[parts.length - 1].charAt(0)).toUpperCase();
1948
+ }
1949
+ var Table = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsx(
1950
+ "table",
1951
+ {
1952
+ ref,
1953
+ className: cn("w-full caption-bottom text-sm", className),
1954
+ ...props
1955
+ }
1956
+ ) }));
1957
+ Table.displayName = "Table";
1958
+ var TableHeader = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1959
+ "thead",
1960
+ {
1961
+ ref,
1962
+ className: cn(
1963
+ "border-b border-border bg-background-hover [&_tr]:border-b",
1964
+ className
1965
+ ),
1966
+ ...props
1967
+ }
1968
+ ));
1969
+ TableHeader.displayName = "TableHeader";
1970
+ var TableBody = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1971
+ "tbody",
1972
+ {
1973
+ ref,
1974
+ className: cn("[&_tr:last-child]:border-0", className),
1975
+ ...props
1976
+ }
1977
+ ));
1978
+ TableBody.displayName = "TableBody";
1979
+ var TableFooter = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1980
+ "tfoot",
1981
+ {
1982
+ ref,
1983
+ className: cn(
1984
+ "border-t border-border bg-background-hover font-medium [&>tr]:last:border-b-0",
1985
+ className
1986
+ ),
1987
+ ...props
1988
+ }
1989
+ ));
1990
+ TableFooter.displayName = "TableFooter";
1991
+ var TableRow = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1992
+ "tr",
1993
+ {
1994
+ ref,
1995
+ className: cn(
1996
+ "border-b border-border transition-colors hover:bg-background-hover data-[state=selected]:bg-background-active",
1997
+ className
1998
+ ),
1999
+ ...props
2000
+ }
2001
+ ));
2002
+ TableRow.displayName = "TableRow";
2003
+ var TableHead = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2004
+ "th",
2005
+ {
2006
+ ref,
2007
+ className: cn(
2008
+ "h-12 px-4 text-left align-middle font-semibold text-text-secondary [&:has([role=checkbox])]:pr-0",
2009
+ className
2010
+ ),
2011
+ ...props
2012
+ }
2013
+ ));
2014
+ TableHead.displayName = "TableHead";
2015
+ var TableCell = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2016
+ "td",
2017
+ {
2018
+ ref,
2019
+ className: cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className),
2020
+ ...props
2021
+ }
2022
+ ));
2023
+ TableCell.displayName = "TableCell";
2024
+ var TableCaption = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2025
+ "caption",
2026
+ {
2027
+ ref,
2028
+ className: cn("mt-4 text-sm text-text-secondary", className),
2029
+ ...props
2030
+ }
2031
+ ));
2032
+ TableCaption.displayName = "TableCaption";
2033
+ var TooltipProvider = TooltipPrimitive.Provider;
2034
+ var Tooltip = TooltipPrimitive.Root;
2035
+ var TooltipTrigger = TooltipPrimitive.Trigger;
2036
+ var TooltipContent = React6.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(
2037
+ TooltipPrimitive.Content,
2038
+ {
2039
+ ref,
2040
+ sideOffset,
2041
+ className: cn(
2042
+ "z-50 overflow-hidden rounded-md border border-border bg-background-surface px-3 py-1.5 text-sm text-text-primary shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
2043
+ className
2044
+ ),
2045
+ ...props
2046
+ }
2047
+ ));
2048
+ TooltipContent.displayName = TooltipPrimitive.Content.displayName;
2049
+ var progressVariants = cva(
2050
+ "relative h-2 w-full overflow-hidden rounded-full bg-background-active",
2051
+ {
2052
+ variants: {
2053
+ size: {
2054
+ sm: "h-1",
2055
+ md: "h-2",
2056
+ lg: "h-3"
2057
+ }
2058
+ },
2059
+ defaultVariants: {
2060
+ size: "md"
2061
+ }
2062
+ }
2063
+ );
2064
+ var Progress = React6.forwardRef(({ className, value, size, indicatorClassName, ...props }, ref) => /* @__PURE__ */ jsx(
2065
+ ProgressPrimitive.Root,
2066
+ {
2067
+ ref,
2068
+ className: cn(progressVariants({ size }), className),
2069
+ ...props,
2070
+ children: /* @__PURE__ */ jsx(
2071
+ ProgressPrimitive.Indicator,
2072
+ {
2073
+ className: cn(
2074
+ "h-full w-full flex-1 bg-primary transition-all",
2075
+ indicatorClassName
2076
+ ),
2077
+ style: { transform: `translateX(-${100 - (value || 0)}%)` }
2078
+ }
2079
+ )
2080
+ }
2081
+ ));
2082
+ Progress.displayName = ProgressPrimitive.Root.displayName;
2083
+ var skeletonVariants = cva(
2084
+ "animate-pulse rounded-md bg-background-active",
2085
+ {
2086
+ variants: {
2087
+ variant: {
2088
+ default: "",
2089
+ circle: "rounded-full",
2090
+ text: "h-4"
2091
+ }
2092
+ },
2093
+ defaultVariants: {
2094
+ variant: "default"
2095
+ }
2096
+ }
2097
+ );
2098
+ var Skeleton = React6.forwardRef(
2099
+ ({ className, variant, ...props }, ref) => {
2100
+ return /* @__PURE__ */ jsx(
2101
+ "div",
2102
+ {
2103
+ ref,
2104
+ className: cn(skeletonVariants({ variant }), className),
2105
+ ...props
2106
+ }
2107
+ );
2108
+ }
2109
+ );
2110
+ Skeleton.displayName = "Skeleton";
2111
+
2112
+ export { Alert, AlertDescription, AlertTitle, Avatar, AvatarFallback, AvatarImage, Badge, Button, Caption, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Code, Container, FadeIn, Grid, GridItem, H1, H2, H3, H4, H5, H6, HStack, Icon, Input, Label, Modal, ModalClose, ModalContent, ModalDescription, ModalFooter, ModalHeader, ModalOverlay, ModalPortal, ModalTitle, ModalTrigger, PageContent, PageDescription, PageHeader, PageShell, PageTitle, Progress, RadioGroup, RadioItem, ScaleIn, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarHeader, SidebarNav, SidebarNavItem, Skeleton, SlideIn, Stack, Stagger, StaggerItem, Switch, THEME_STORAGE_KEY, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Text, Textarea, ThemeProvider, Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Typography, VStack, announceToScreenReader, applyTheme, cn, formatCurrency, formatDate, formatFileSize, formatNumber, formatPercent, formatRelativeTime, generateId, getContrastRatio, getCurrentBreakpoint, getFocusableElements, getResolvedTheme, getStoredTheme, getSystemTheme, initializeTheme, isDesktop, isFocusable, isMobile, isTablet, matchesBreakpoint, meetsWCAGAA, setStoredTheme, toCamelCase, toKebabCase, toTitleCase, toast, toastIcons, trapFocus, truncate, useTheme, useToast };