@gamecp/ui 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,1306 @@
1
+ 'use strict';
2
+
3
+ var React4 = require('react');
4
+ var jsxRuntime = require('react/jsx-runtime');
5
+ var ri = require('react-icons/ri');
6
+ var NextLink = require('next/link');
7
+ var reactDom = require('react-dom');
8
+ var framerMotion = require('framer-motion');
9
+
10
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
11
+
12
+ var React4__default = /*#__PURE__*/_interopDefault(React4);
13
+ var NextLink__default = /*#__PURE__*/_interopDefault(NextLink);
14
+
15
+ // src/Button.tsx
16
+ var variantClasses = {
17
+ primary: "bg-primary text-primary-foreground hover:bg-primary/90 border-transparent",
18
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 border-transparent",
19
+ destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90 border-transparent",
20
+ ghost: "bg-transparent hover:bg-muted hover:text-foreground border-transparent",
21
+ link: "bg-transparent text-primary underline-offset-4 hover:underline border-transparent p-0",
22
+ outline: "bg-transparent border-border hover:bg-muted hover:text-foreground"
23
+ };
24
+ var sizeClasses = {
25
+ sm: "px-3 py-1.5 text-sm",
26
+ md: "px-4 py-2 text-sm",
27
+ lg: "px-6 py-3 text-base"
28
+ };
29
+ var Button = React4.forwardRef(
30
+ ({
31
+ variant = "primary",
32
+ size = "md",
33
+ isLoading = false,
34
+ leftIcon,
35
+ rightIcon,
36
+ fullWidth = false,
37
+ className = "",
38
+ disabled,
39
+ children,
40
+ ...props
41
+ }, ref) => {
42
+ const baseClasses = "inline-flex items-center justify-center gap-2 font-medium rounded-md border transition-colors focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed";
43
+ const classes = [
44
+ baseClasses,
45
+ variantClasses[variant],
46
+ variant !== "link" ? sizeClasses[size] : "",
47
+ fullWidth ? "w-full" : "",
48
+ className
49
+ ].filter(Boolean).join(" ");
50
+ return /* @__PURE__ */ jsxRuntime.jsxs(
51
+ "button",
52
+ {
53
+ ref,
54
+ className: classes,
55
+ disabled: disabled || isLoading,
56
+ ...props,
57
+ children: [
58
+ isLoading && /* @__PURE__ */ jsxRuntime.jsxs(
59
+ "svg",
60
+ {
61
+ className: "animate-spin h-4 w-4",
62
+ xmlns: "http://www.w3.org/2000/svg",
63
+ fill: "none",
64
+ viewBox: "0 0 24 24",
65
+ children: [
66
+ /* @__PURE__ */ jsxRuntime.jsx(
67
+ "circle",
68
+ {
69
+ className: "opacity-25",
70
+ cx: "12",
71
+ cy: "12",
72
+ r: "10",
73
+ stroke: "currentColor",
74
+ strokeWidth: "4"
75
+ }
76
+ ),
77
+ /* @__PURE__ */ jsxRuntime.jsx(
78
+ "path",
79
+ {
80
+ className: "opacity-75",
81
+ fill: "currentColor",
82
+ d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
83
+ }
84
+ )
85
+ ]
86
+ }
87
+ ),
88
+ !isLoading && leftIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-shrink-0", children: leftIcon }),
89
+ children,
90
+ !isLoading && rightIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-shrink-0", children: rightIcon })
91
+ ]
92
+ }
93
+ );
94
+ }
95
+ );
96
+ Button.displayName = "Button";
97
+ var Button_default = Button;
98
+ var badgeVariants = {
99
+ default: "bg-gray-100 text-foreground border-border",
100
+ primary: "bg-primary-100 text-primary-800 border-primary-200",
101
+ secondary: "bg-gray-100 text-foreground border-border",
102
+ success: "bg-success text-success-dark border-success-light",
103
+ warning: "bg-yellow-100 text-yellow-800 border-yellow-200",
104
+ error: "bg-red-100 text-red-800 border-red-200",
105
+ info: "bg-muted text-muted-foreground border-ring",
106
+ gray: "bg-gray-100 text-foreground border-border",
107
+ purple: "bg-purple-100 text-purple-800 border-purple-200",
108
+ pink: "bg-pink-100 text-pink-800 border-pink-200",
109
+ indigo: "bg-indigo-100 text-indigo-800 border-indigo-200",
110
+ yellow: "bg-yellow-100 text-yellow-800 border-yellow-200",
111
+ orange: "bg-orange-100 text-orange-800 border-orange-200",
112
+ teal: "bg-teal-100 text-teal-800 border-teal-200",
113
+ cyan: "bg-cyan-100 text-cyan-800 border-cyan-200",
114
+ lime: "bg-lime-100 text-lime-800 border-lime-200",
115
+ emerald: "bg-emerald-100 text-emerald-800 border-emerald-200",
116
+ rose: "bg-rose-100 text-rose-800 border-rose-200",
117
+ sky: "bg-sky-100 text-sky-800 border-sky-200",
118
+ violet: "bg-violet-100 text-violet-800 border-violet-200",
119
+ fuchsia: "bg-fuchsia-100 text-fuchsia-800 border-fuchsia-200",
120
+ amber: "bg-amber-100 text-amber-800 border-amber-200"
121
+ };
122
+ var badgeSizes = {
123
+ sm: "px-2 py-0.5 text-xs",
124
+ md: "px-2.5 py-0.5 text-xs",
125
+ lg: "px-3 py-1 text-sm"
126
+ };
127
+ function Badge({
128
+ children,
129
+ variant = "default",
130
+ size = "md",
131
+ className = "",
132
+ customColors
133
+ }) {
134
+ const baseClasses = "inline-flex items-center font-medium rounded-full border";
135
+ const variantClasses4 = variant === "custom" ? "" : badgeVariants[variant];
136
+ const sizeClasses4 = badgeSizes[size];
137
+ const customStyles = variant === "custom" && customColors ? {
138
+ backgroundColor: customColors.background,
139
+ color: customColors.text,
140
+ borderColor: customColors.border || customColors.background
141
+ } : {};
142
+ return /* @__PURE__ */ jsxRuntime.jsx(
143
+ "span",
144
+ {
145
+ className: `${baseClasses} ${variantClasses4} ${sizeClasses4} ${className}`,
146
+ style: customStyles,
147
+ children
148
+ }
149
+ );
150
+ }
151
+ var SuccessBadge = (props) => /* @__PURE__ */ jsxRuntime.jsx(Badge, { ...props, variant: "success" });
152
+ var WarningBadge = (props) => /* @__PURE__ */ jsxRuntime.jsx(Badge, { ...props, variant: "warning" });
153
+ var ErrorBadge = (props) => /* @__PURE__ */ jsxRuntime.jsx(Badge, { ...props, variant: "error" });
154
+ var InfoBadge = (props) => /* @__PURE__ */ jsxRuntime.jsx(Badge, { ...props, variant: "info" });
155
+ var PrimaryBadge = (props) => /* @__PURE__ */ jsxRuntime.jsx(Badge, { ...props, variant: "primary" });
156
+ var GrayBadge = (props) => /* @__PURE__ */ jsxRuntime.jsx(Badge, { ...props, variant: "gray" });
157
+ function StatusBadge({
158
+ isActive,
159
+ activeText = "Active",
160
+ inactiveText = "Inactive",
161
+ ...props
162
+ }) {
163
+ return /* @__PURE__ */ jsxRuntime.jsx(Badge, { ...props, variant: isActive ? "success" : "error", children: isActive ? activeText : inactiveText });
164
+ }
165
+ var sizeClasses2 = {
166
+ xs: "w-3 h-3",
167
+ sm: "w-4 h-4",
168
+ md: "w-5 h-5",
169
+ lg: "w-6 h-6",
170
+ xl: "w-8 h-8",
171
+ "2": "w-2 h-2",
172
+ "3": "w-3 h-3",
173
+ "4": "w-4 h-4",
174
+ "5": "w-5 h-5",
175
+ "6": "w-6 h-6"
176
+ };
177
+ var colorClasses = {
178
+ default: "text-muted-foreground hover:text-muted-foreground",
179
+ gray: "text-muted-foreground hover:text-muted-foreground",
180
+ primary: "text-ring hover:text-primary-foreground",
181
+ secondary: "text-secondary-foreground hover:text-foreground"
182
+ };
183
+ function DropDownArrow({
184
+ isOpen,
185
+ disabled = false,
186
+ size = "sm",
187
+ color = "default",
188
+ className = "",
189
+ "aria-hidden": ariaHidden
190
+ }) {
191
+ const baseClasses = `${sizeClasses2[size]} flex-shrink-0 transition-transform`;
192
+ const rotationClasses = isOpen ? "rotate-180" : "";
193
+ const colorClassesApplied = disabled ? "text-muted-foreground" : colorClasses[color];
194
+ const combinedClasses = `${baseClasses} ${rotationClasses} ${colorClassesApplied} ${className}`.trim();
195
+ return /* @__PURE__ */ jsxRuntime.jsx(ri.RiArrowDownSLine, { className: combinedClasses, "aria-hidden": ariaHidden });
196
+ }
197
+ var paddingClasses = {
198
+ none: "",
199
+ sm: "p-3",
200
+ md: "p-4",
201
+ lg: "p-6",
202
+ xl: "p-8"
203
+ };
204
+ var borderAccentClasses = {
205
+ none: "",
206
+ green: "border-l-4 border-l-green-500",
207
+ blue: "border-l-4 border-l-ring",
208
+ red: "border-l-4 border-l-red-500",
209
+ yellow: "border-l-4 border-l-yellow-500",
210
+ purple: "border-l-4 border-l-purple-500",
211
+ orange: "border-l-4 border-l-orange-500",
212
+ gray: "border-l-4 border-l-gray-500"
213
+ };
214
+ var variantClasses2 = {
215
+ default: "card",
216
+ elevated: "card shadow-lg border border-border",
217
+ outlined: "card rounded-lg border-2 border-border",
218
+ filled: "bg-muted rounded-lg border border-border"
219
+ };
220
+ var iconColorClasses = {
221
+ green: "text-success",
222
+ blue: "text-primary",
223
+ red: "text-destructive",
224
+ yellow: "text-yellow-600",
225
+ purple: "text-purple-600",
226
+ orange: "text-orange-600",
227
+ gray: "text-muted-foreground",
228
+ indigo: "text-indigo-600",
229
+ pink: "text-pink-600"
230
+ };
231
+ var iconSizeClasses = {
232
+ sm: "w-4 h-4",
233
+ md: "w-6 h-6",
234
+ lg: "w-8 h-8"
235
+ };
236
+ var statusClasses = {
237
+ success: "bg-success-light border-success-light",
238
+ warning: "bg-yellow-50 border-yellow-200",
239
+ error: "bg-destructive border-destructive",
240
+ info: "bg-primary border-primary",
241
+ neutral: "bg-muted border-border"
242
+ };
243
+ function Card({
244
+ children,
245
+ className = "",
246
+ onClick,
247
+ disabled = false,
248
+ padding = "md",
249
+ borderAccent = "none",
250
+ variant = "default",
251
+ overflow = "visible",
252
+ minHeight,
253
+ maxHeight,
254
+ hover = false,
255
+ clickable = false,
256
+ title,
257
+ subtitle,
258
+ description,
259
+ icon: Icon,
260
+ iconColor = "blue",
261
+ iconSize = "md",
262
+ actionButton,
263
+ headerClassName = "",
264
+ accordion = false,
265
+ defaultExpanded = true,
266
+ onToggle,
267
+ contentClassName = "",
268
+ status,
269
+ statusIcon,
270
+ statusText
271
+ }) {
272
+ const [isExpanded, setIsExpanded] = React4.useState(defaultExpanded);
273
+ const baseClasses = [
274
+ variantClasses2[variant],
275
+ paddingClasses[padding],
276
+ borderAccentClasses[borderAccent],
277
+ overflow !== "visible" ? `overflow-${overflow}` : "",
278
+ hover ? "hover:shadow-md transition-shadow" : "",
279
+ clickable || onClick ? "cursor-pointer" : "",
280
+ disabled ? "opacity-50 cursor-not-allowed" : "",
281
+ status ? statusClasses[status] : ""
282
+ ].filter(Boolean).join(" ");
283
+ const style = {};
284
+ if (minHeight) style.minHeight = minHeight;
285
+ if (maxHeight) style.maxHeight = maxHeight;
286
+ const handleClick = () => {
287
+ if (disabled) return;
288
+ onClick?.();
289
+ };
290
+ const handleToggle = () => {
291
+ if (accordion) {
292
+ const newExpanded = !isExpanded;
293
+ setIsExpanded(newExpanded);
294
+ onToggle?.(newExpanded);
295
+ }
296
+ };
297
+ return /* @__PURE__ */ jsxRuntime.jsxs(
298
+ "div",
299
+ {
300
+ className: `${baseClasses} ${className}`,
301
+ style,
302
+ onClick: clickable || onClick ? handleClick : void 0,
303
+ children: [
304
+ (title || subtitle || description || Icon || actionButton || status) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${headerClassName}`, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
305
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
306
+ Icon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${iconColorClasses[iconColor]} flex-shrink-0`, children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: iconSizeClasses[iconSize] }) }),
307
+ statusIcon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0", children: statusIcon }),
308
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
309
+ title && /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg font-semibold text-foreground truncate", children: title }),
310
+ subtitle && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-muted-foreground truncate", children: subtitle }),
311
+ description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground mt-1", children: description }),
312
+ statusText && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground mt-1", children: statusText })
313
+ ] })
314
+ ] }),
315
+ actionButton && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0 ml-4", children: actionButton }),
316
+ accordion && /* @__PURE__ */ jsxRuntime.jsxs(
317
+ "button",
318
+ {
319
+ type: "button",
320
+ onClick: (e) => {
321
+ e.stopPropagation();
322
+ handleToggle();
323
+ },
324
+ "aria-expanded": isExpanded,
325
+ "aria-label": `${isExpanded ? "Hide" : "Show"} ${title || "content"}`,
326
+ className: "flex items-center text-sm text-muted-foreground hover:text-foreground transition-colors ml-4",
327
+ children: [
328
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mr-1", children: isExpanded ? "Hide" : "Show" }),
329
+ /* @__PURE__ */ jsxRuntime.jsx(
330
+ DropDownArrow,
331
+ {
332
+ isOpen: isExpanded,
333
+ size: "sm",
334
+ color: "gray",
335
+ "aria-hidden": true
336
+ }
337
+ )
338
+ ]
339
+ }
340
+ )
341
+ ] }) }),
342
+ /* @__PURE__ */ jsxRuntime.jsx(
343
+ "div",
344
+ {
345
+ className: `${contentClassName} ${accordion && !isExpanded ? "hidden" : ""}`,
346
+ children
347
+ }
348
+ )
349
+ ]
350
+ }
351
+ );
352
+ }
353
+ function SimpleCard({
354
+ children,
355
+ className = "",
356
+ ...props
357
+ }) {
358
+ return /* @__PURE__ */ jsxRuntime.jsx(Card, { className, ...props, children });
359
+ }
360
+ function HeaderCard({
361
+ title,
362
+ subtitle,
363
+ description,
364
+ icon,
365
+ iconColor,
366
+ iconSize,
367
+ actionButton,
368
+ children,
369
+ className = "",
370
+ ...props
371
+ }) {
372
+ return /* @__PURE__ */ jsxRuntime.jsx(
373
+ Card,
374
+ {
375
+ title,
376
+ subtitle,
377
+ description,
378
+ icon,
379
+ iconColor,
380
+ iconSize,
381
+ actionButton,
382
+ className,
383
+ ...props,
384
+ children
385
+ }
386
+ );
387
+ }
388
+ function StatusCard({
389
+ status,
390
+ statusIcon,
391
+ statusText,
392
+ children,
393
+ className = "",
394
+ ...props
395
+ }) {
396
+ return /* @__PURE__ */ jsxRuntime.jsx(
397
+ Card,
398
+ {
399
+ status,
400
+ statusIcon,
401
+ statusText,
402
+ className,
403
+ ...props,
404
+ children
405
+ }
406
+ );
407
+ }
408
+ function ClickableCard({
409
+ onClick,
410
+ children,
411
+ className = "",
412
+ ...props
413
+ }) {
414
+ return /* @__PURE__ */ jsxRuntime.jsx(Card, { onClick, clickable: true, hover: true, className, ...props, children });
415
+ }
416
+ function AccordionCard({
417
+ accordion = true,
418
+ children,
419
+ className = "",
420
+ ...props
421
+ }) {
422
+ return /* @__PURE__ */ jsxRuntime.jsx(Card, { accordion, className, ...props, children });
423
+ }
424
+ var variantClasses3 = {
425
+ default: "text-foreground hover:text-primary",
426
+ primary: "text-primary hover:text-primary/80",
427
+ muted: "text-muted-foreground hover:text-foreground"
428
+ };
429
+ var Link = React4.forwardRef(
430
+ ({
431
+ href,
432
+ variant = "default",
433
+ underline = false,
434
+ external = false,
435
+ className = "",
436
+ children,
437
+ ...props
438
+ }, ref) => {
439
+ const classes = [
440
+ "transition-colors",
441
+ variantClasses3[variant],
442
+ underline ? "underline underline-offset-4" : "hover:underline hover:underline-offset-4",
443
+ className
444
+ ].filter(Boolean).join(" ");
445
+ if (external || href.startsWith("http")) {
446
+ return /* @__PURE__ */ jsxRuntime.jsx(
447
+ "a",
448
+ {
449
+ ref,
450
+ href,
451
+ className: classes,
452
+ target: "_blank",
453
+ rel: "noopener noreferrer",
454
+ ...props,
455
+ children
456
+ }
457
+ );
458
+ }
459
+ return /* @__PURE__ */ jsxRuntime.jsx(NextLink__default.default, { ref, href, className: classes, ...props, children });
460
+ }
461
+ );
462
+ Link.displayName = "Link";
463
+ var Link_default = Link;
464
+ function FormInput({
465
+ label,
466
+ name,
467
+ type = "text",
468
+ value,
469
+ onChange,
470
+ placeholder,
471
+ required = false,
472
+ disabled = false,
473
+ error,
474
+ className = "",
475
+ inputClassName = "",
476
+ min,
477
+ max,
478
+ step,
479
+ maxLength,
480
+ autoComplete,
481
+ description,
482
+ footerDescription,
483
+ autoFocus = false,
484
+ onKeyDown,
485
+ onBlur,
486
+ icon,
487
+ rows = 3,
488
+ showHidePassword = false,
489
+ onGeneratePassword,
490
+ copyable = false,
491
+ readOnly = false,
492
+ clearable = true
493
+ }) {
494
+ const [showPassword, setShowPassword] = React4.useState(false);
495
+ const [copied, setCopied] = React4.useState(false);
496
+ const handleCopy = async () => {
497
+ try {
498
+ await navigator.clipboard.writeText(String(value));
499
+ setCopied(true);
500
+ setTimeout(() => setCopied(false), 2e3);
501
+ } catch (err) {
502
+ console.error("Failed to copy:", err);
503
+ }
504
+ };
505
+ const shouldShowIcons = (inputType) => {
506
+ return inputType !== "checkbox" && inputType !== "textarea";
507
+ };
508
+ const getIconConfig = (iconProp) => {
509
+ if (!iconProp) return { left: null, right: null };
510
+ if (React4__default.default.isValidElement(iconProp)) {
511
+ return { left: iconProp, right: null };
512
+ }
513
+ if (typeof iconProp === "object" && iconProp !== null && ("left" in iconProp || "right" in iconProp)) {
514
+ return { left: iconProp.left || null, right: iconProp.right || null };
515
+ }
516
+ return {
517
+ left: React4__default.default.isValidElement(iconProp) ? iconProp : null,
518
+ right: null
519
+ };
520
+ };
521
+ const renderIcon = (iconNode, position) => {
522
+ if (!iconNode) return null;
523
+ const rightPositionClass = position === "right" && type === "number" ? "right-4 pr-3" : position === "right" ? "right-0 pr-3" : "left-0 pl-3";
524
+ return /* @__PURE__ */ jsxRuntime.jsx(
525
+ "div",
526
+ {
527
+ className: `absolute inset-y-0 ${rightPositionClass} flex items-center pointer-events-none`,
528
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-muted-foreground", children: iconNode })
529
+ }
530
+ );
531
+ };
532
+ const getInputPaddingClasses = (inputType, iconConfig) => {
533
+ if (!shouldShowIcons(inputType)) return "";
534
+ const paddingClasses2 = [];
535
+ if (iconConfig.left) paddingClasses2.push("pl-10");
536
+ if (iconConfig.right) {
537
+ paddingClasses2.push(inputType === "number" ? "pr-12" : "pr-10");
538
+ }
539
+ return paddingClasses2.join(" ");
540
+ };
541
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `form-group ${className}`, children: type === "checkbox" ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center p-2 space-x-3 h-full", children: [
542
+ /* @__PURE__ */ jsxRuntime.jsx(
543
+ "input",
544
+ {
545
+ id: name,
546
+ name,
547
+ type: "checkbox",
548
+ checked: Boolean(value),
549
+ onChange: (e) => {
550
+ const newValue = e.target.checked;
551
+ const syntheticEvent = {
552
+ target: {
553
+ name: e.target.name,
554
+ value: newValue,
555
+ checked: newValue
556
+ },
557
+ currentTarget: {
558
+ name: e.target.name,
559
+ value: newValue,
560
+ checked: newValue
561
+ }
562
+ };
563
+ onChange(syntheticEvent);
564
+ },
565
+ required,
566
+ disabled,
567
+ onKeyDown,
568
+ className: "sr-only",
569
+ "aria-label": label,
570
+ "aria-describedby": error ? `${name}-error` : description ? `${name}-description` : void 0,
571
+ "aria-invalid": error ? "true" : "false"
572
+ }
573
+ ),
574
+ /* @__PURE__ */ jsxRuntime.jsx(
575
+ "button",
576
+ {
577
+ type: "button",
578
+ onClick: () => {
579
+ if (!disabled) {
580
+ const checkbox = document.getElementById(
581
+ name
582
+ );
583
+ if (checkbox) {
584
+ checkbox.click();
585
+ }
586
+ }
587
+ },
588
+ disabled,
589
+ className: `
590
+ relative inline-flex h-6 w-11 items-center rounded-full transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2
591
+ ${Boolean(value) ? "bg-primary" : "bg-muted"}
592
+ ${disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"}
593
+ ${error ? "ring-2 ring-destructive" : ""}
594
+ `,
595
+ "aria-label": `${label}${required ? " (required)" : ""}`,
596
+ "aria-describedby": name,
597
+ children: /* @__PURE__ */ jsxRuntime.jsx(
598
+ "span",
599
+ {
600
+ className: `
601
+ inline-block h-4 w-4 transform rounded-full bg-background border border-border transition duration-200 ease-in-out
602
+ ${Boolean(value) ? "translate-x-6" : "translate-x-1"}
603
+ `
604
+ }
605
+ )
606
+ }
607
+ ),
608
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col", children: [
609
+ /* @__PURE__ */ jsxRuntime.jsxs(
610
+ "label",
611
+ {
612
+ htmlFor: name,
613
+ className: "text-sm font-medium text-foreground cursor-pointer",
614
+ onClick: () => {
615
+ if (!disabled) {
616
+ const checkbox = document.getElementById(
617
+ name
618
+ );
619
+ if (checkbox) {
620
+ checkbox.click();
621
+ }
622
+ }
623
+ },
624
+ children: [
625
+ label,
626
+ required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-destructive ml-1", "aria-label": "required", children: "*" })
627
+ ]
628
+ }
629
+ ),
630
+ description && /* @__PURE__ */ jsxRuntime.jsx(
631
+ "span",
632
+ {
633
+ id: `${name}-description`,
634
+ className: "text-xs text-muted-foreground",
635
+ children: description
636
+ }
637
+ )
638
+ ] }),
639
+ error && /* @__PURE__ */ jsxRuntime.jsx("div", { id: `${name}-error`, className: "form-error", role: "alert", children: typeof error === "string" ? /* @__PURE__ */ jsxRuntime.jsx("p", { children: error }) : error })
640
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
641
+ label && /* @__PURE__ */ jsxRuntime.jsxs("label", { htmlFor: name, className: "form-label", children: [
642
+ label,
643
+ required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "form-label-required", children: "*" })
644
+ ] }),
645
+ description && /* @__PURE__ */ jsxRuntime.jsx("p", { id: `${name}-description`, className: "form-description", children: description }),
646
+ type === "textarea" ? /* @__PURE__ */ jsxRuntime.jsx(
647
+ "textarea",
648
+ {
649
+ id: name,
650
+ name,
651
+ value,
652
+ onChange,
653
+ placeholder,
654
+ required,
655
+ disabled,
656
+ autoFocus,
657
+ onKeyDown,
658
+ onBlur,
659
+ rows,
660
+ maxLength,
661
+ "aria-invalid": error ? "true" : "false",
662
+ "aria-describedby": error ? `${name}-error` : description ? `${name}-description` : void 0,
663
+ className: `form-input ${error ? "form-input-error" : ""} ${inputClassName}`
664
+ }
665
+ ) : type === "color" ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-3", children: [
666
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-10 h-10 border border-input rounded-md overflow-hidden bg-card", children: [
667
+ /* @__PURE__ */ jsxRuntime.jsx(
668
+ "input",
669
+ {
670
+ id: name,
671
+ name,
672
+ type: "color",
673
+ value,
674
+ onChange,
675
+ required,
676
+ disabled,
677
+ className: "absolute inset-0 w-full h-full cursor-pointer opacity-0"
678
+ }
679
+ ),
680
+ /* @__PURE__ */ jsxRuntime.jsx(
681
+ "div",
682
+ {
683
+ className: "w-full h-full rounded-md",
684
+ style: { backgroundColor: value }
685
+ }
686
+ )
687
+ ] }),
688
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
689
+ /* @__PURE__ */ jsxRuntime.jsx(
690
+ "input",
691
+ {
692
+ id: `${name}-text`,
693
+ name: `${name}-text`,
694
+ type: "text",
695
+ value,
696
+ onChange,
697
+ placeholder,
698
+ required,
699
+ disabled,
700
+ maxLength,
701
+ autoComplete,
702
+ autoFocus,
703
+ onKeyDown,
704
+ onBlur,
705
+ className: `form-input max-w-24 ${error ? "form-input-error" : ""} ${getInputPaddingClasses(type, getIconConfig(icon))} ${inputClassName}`,
706
+ "aria-label": `${label} text input`
707
+ }
708
+ ),
709
+ shouldShowIcons(type) && (() => {
710
+ const iconConfig = getIconConfig(icon);
711
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
712
+ renderIcon(iconConfig.left, "left"),
713
+ renderIcon(iconConfig.right, "right")
714
+ ] });
715
+ })()
716
+ ] })
717
+ ] }) : showHidePassword && type === "password" ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
718
+ /* @__PURE__ */ jsxRuntime.jsx(
719
+ "input",
720
+ {
721
+ id: name,
722
+ name,
723
+ type: showPassword ? "text" : "password",
724
+ value,
725
+ onChange,
726
+ placeholder,
727
+ required,
728
+ disabled: disabled || readOnly,
729
+ readOnly,
730
+ maxLength,
731
+ autoComplete,
732
+ autoFocus,
733
+ onKeyDown,
734
+ onBlur,
735
+ "aria-invalid": error ? "true" : "false",
736
+ "aria-describedby": error ? `${name}-error` : description ? `${name}-description` : void 0,
737
+ className: `form-input ${error ? "form-input-error" : ""} ${readOnly ? "bg-muted cursor-default" : ""} ${copyable ? "pr-20" : "pr-10"} ${getInputPaddingClasses(type, getIconConfig(icon))} ${inputClassName}`
738
+ }
739
+ ),
740
+ shouldShowIcons(type) && (() => {
741
+ const iconConfig = getIconConfig(icon);
742
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
743
+ renderIcon(iconConfig.left, "left"),
744
+ renderIcon(iconConfig.right, "right")
745
+ ] });
746
+ })(),
747
+ copyable && /* @__PURE__ */ jsxRuntime.jsx(
748
+ "button",
749
+ {
750
+ type: "button",
751
+ onClick: handleCopy,
752
+ className: "absolute inset-y-0 right-8 flex items-center pr-3 text-muted-foreground hover:text-foreground transition-colors duration-200 z-10",
753
+ "aria-label": `Copy ${label}`,
754
+ title: copied ? "Copied!" : `Copy ${label}`,
755
+ children: copied ? /* @__PURE__ */ jsxRuntime.jsx(ri.RiCheckLine, { className: "w-4 h-4 text-green-500", "aria-hidden": "true" }) : /* @__PURE__ */ jsxRuntime.jsx(ri.RiFileCopyLine, { className: "w-4 h-4", "aria-hidden": "true" })
756
+ }
757
+ ),
758
+ /* @__PURE__ */ jsxRuntime.jsx(
759
+ "button",
760
+ {
761
+ type: "button",
762
+ onClick: () => setShowPassword(!showPassword),
763
+ className: "absolute inset-y-0 right-0 flex items-center pr-3 text-muted-foreground hover:text-foreground transition-colors duration-200 z-10",
764
+ "aria-label": showPassword ? "Hide password" : "Show password",
765
+ title: showPassword ? "Hide password" : "Show password",
766
+ children: showPassword ? /* @__PURE__ */ jsxRuntime.jsx(ri.RiEyeOffLine, { className: "w-4 h-4", "aria-hidden": "true" }) : /* @__PURE__ */ jsxRuntime.jsx(ri.RiEyeLine, { className: "w-4 h-4", "aria-hidden": "true" })
767
+ }
768
+ ),
769
+ onGeneratePassword && !readOnly && /* @__PURE__ */ jsxRuntime.jsx(
770
+ "button",
771
+ {
772
+ type: "button",
773
+ onClick: onGeneratePassword,
774
+ className: `absolute inset-y-0 ${copyable ? "right-16" : "right-8"} flex items-center pr-3 text-muted-foreground hover:text-foreground transition-colors duration-200 z-10`,
775
+ "aria-label": "Generate new password",
776
+ title: "Generate new password",
777
+ children: /* @__PURE__ */ jsxRuntime.jsx(ri.RiRefreshLine, { className: "w-4 h-4", "aria-hidden": "true" })
778
+ }
779
+ )
780
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative group", children: [
781
+ /* @__PURE__ */ jsxRuntime.jsx(
782
+ "input",
783
+ {
784
+ id: name,
785
+ name,
786
+ type,
787
+ value,
788
+ onChange,
789
+ placeholder,
790
+ required,
791
+ disabled: disabled || readOnly,
792
+ readOnly,
793
+ min,
794
+ max,
795
+ step,
796
+ maxLength,
797
+ autoComplete,
798
+ autoFocus,
799
+ onKeyDown,
800
+ onBlur,
801
+ "aria-invalid": error ? "true" : "false",
802
+ "aria-describedby": error ? `${name}-error` : description ? `${name}-description` : void 0,
803
+ className: `form-input ${error ? "form-input-error" : ""} ${readOnly ? "bg-muted cursor-default" : ""} ${copyable ? "pr-10" : ""} ${getInputPaddingClasses(type, getIconConfig(icon))} ${inputClassName}`
804
+ }
805
+ ),
806
+ shouldShowIcons(type) && (() => {
807
+ const iconConfig = getIconConfig(icon);
808
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
809
+ renderIcon(iconConfig.left, "left"),
810
+ renderIcon(iconConfig.right, "right")
811
+ ] });
812
+ })(),
813
+ copyable && /* @__PURE__ */ jsxRuntime.jsx(
814
+ "button",
815
+ {
816
+ type: "button",
817
+ onClick: handleCopy,
818
+ className: `absolute inset-y-0 right-0 flex items-center pr-3 text-muted-foreground hover:text-foreground transition-all duration-200 z-10`,
819
+ "aria-label": `Copy ${label}`,
820
+ title: copied ? "Copied!" : `Copy ${label}`,
821
+ children: copied ? /* @__PURE__ */ jsxRuntime.jsx(ri.RiCheckLine, { className: "w-4 h-4 text-green-500", "aria-hidden": "true" }) : /* @__PURE__ */ jsxRuntime.jsx(ri.RiFileCopyLine, { className: "w-4 h-4", "aria-hidden": "true" })
822
+ }
823
+ ),
824
+ clearable && !copyable && value !== "" && value !== null && value !== void 0 && !disabled && !readOnly && /* @__PURE__ */ jsxRuntime.jsx(
825
+ "button",
826
+ {
827
+ type: "button",
828
+ onClick: () => {
829
+ const syntheticEvent = {
830
+ target: { name, value: "" }
831
+ };
832
+ onChange(syntheticEvent);
833
+ },
834
+ className: `absolute inset-y-0 ${type === "number" ? "right-4" : "right-0"} flex items-center pr-3 text-muted-foreground hover:text-muted-foreground transition-all duration-200 z-10 opacity-0 group-hover:opacity-100`,
835
+ "aria-label": `Clear ${label}`,
836
+ title: `Clear ${label}`,
837
+ children: /* @__PURE__ */ jsxRuntime.jsx(ri.RiCloseLine, { className: "w-4 h-4", "aria-hidden": "true" })
838
+ }
839
+ )
840
+ ] }),
841
+ footerDescription && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs mt-1", children: footerDescription }),
842
+ error && /* @__PURE__ */ jsxRuntime.jsx("div", { id: `${name}-error`, className: "form-error", role: "alert", children: typeof error === "string" ? /* @__PURE__ */ jsxRuntime.jsx("p", { children: error }) : error })
843
+ ] }) });
844
+ }
845
+ function Switch({
846
+ checked,
847
+ onChange,
848
+ disabled = false,
849
+ label,
850
+ description,
851
+ className = "",
852
+ size = "md"
853
+ }) {
854
+ const toggle = () => {
855
+ if (!disabled) {
856
+ onChange(!checked);
857
+ }
858
+ };
859
+ const sizes = {
860
+ sm: { track: "w-8 h-4", thumb: "w-3 h-3", translate: "translate-x-4" },
861
+ md: { track: "w-11 h-6", thumb: "w-5 h-5", translate: "translate-x-5" },
862
+ lg: { track: "w-14 h-8", thumb: "w-7 h-7", translate: "translate-x-6" }
863
+ };
864
+ const currentSize = sizes[size];
865
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `flex items-start ${className}`, children: [
866
+ /* @__PURE__ */ jsxRuntime.jsx(
867
+ "button",
868
+ {
869
+ type: "button",
870
+ role: "switch",
871
+ "aria-checked": checked,
872
+ disabled,
873
+ onClick: toggle,
874
+ className: `
875
+ relative inline-flex flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent
876
+ transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2
877
+ ${checked ? "bg-primary" : "bg-muted"}
878
+ ${disabled ? "opacity-50 cursor-not-allowed" : ""}
879
+ ${currentSize.track}
880
+ `,
881
+ children: /* @__PURE__ */ jsxRuntime.jsx(
882
+ "span",
883
+ {
884
+ "aria-hidden": "true",
885
+ className: `
886
+ pointer-events-none inline-block transform rounded-full bg-white shadow ring-0
887
+ transition duration-200 ease-in-out
888
+ ${checked ? currentSize.translate : "translate-x-0"}
889
+ ${currentSize.thumb}
890
+ `
891
+ }
892
+ )
893
+ }
894
+ ),
895
+ (label || description) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ml-3 text-sm leading-6", children: [
896
+ label && /* @__PURE__ */ jsxRuntime.jsx("label", { className: "font-medium text-foreground cursor-pointer", onClick: toggle, children: label }),
897
+ description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground", children: description })
898
+ ] })
899
+ ] });
900
+ }
901
+ var sizeClasses3 = {
902
+ sm: "max-w-md",
903
+ md: "max-w-2xl",
904
+ lg: "max-w-4xl",
905
+ xl: "max-w-6xl",
906
+ full: "max-w-full mx-4"
907
+ };
908
+ function Modal({
909
+ isOpen,
910
+ onClose,
911
+ children,
912
+ title,
913
+ header,
914
+ blocking = false,
915
+ size = "md",
916
+ className = "",
917
+ footer,
918
+ fullScreen = false,
919
+ noPadding = false,
920
+ footerBg = "gray",
921
+ variant = "default",
922
+ scrollable = true,
923
+ "aria-describedby": ariaDescribedBy,
924
+ customStyles = {}
925
+ }) {
926
+ const modalContentRef = React4.useRef(null);
927
+ const previousActiveElementRef = React4.useRef(null);
928
+ const hasPerformedInitialFocusRef = React4.useRef(false);
929
+ const getFocusableElements = () => {
930
+ if (!modalContentRef.current) return [];
931
+ const focusableSelectors = [
932
+ "button:not([disabled])",
933
+ "a[href]",
934
+ "input:not([disabled])",
935
+ "select:not([disabled])",
936
+ "textarea:not([disabled])",
937
+ '[tabindex]:not([tabindex="-1"])'
938
+ ].join(", ");
939
+ return Array.from(
940
+ modalContentRef.current.querySelectorAll(focusableSelectors)
941
+ );
942
+ };
943
+ React4.useEffect(() => {
944
+ if (!isOpen) {
945
+ hasPerformedInitialFocusRef.current = false;
946
+ return;
947
+ }
948
+ if (!hasPerformedInitialFocusRef.current) {
949
+ previousActiveElementRef.current = document.activeElement;
950
+ }
951
+ let timeoutId = null;
952
+ if (!hasPerformedInitialFocusRef.current) {
953
+ const focusableElements = getFocusableElements();
954
+ const firstFocusable = focusableElements[0];
955
+ timeoutId = setTimeout(() => {
956
+ const activeElement = document.activeElement;
957
+ const isHTMLElement = activeElement instanceof HTMLElement;
958
+ const isUserTyping = activeElement && (activeElement.tagName === "INPUT" || activeElement.tagName === "TEXTAREA" || isHTMLElement && activeElement.isContentEditable);
959
+ const isFocusInModal = modalContentRef.current?.contains(activeElement);
960
+ if (!isUserTyping && !isFocusInModal) {
961
+ if (firstFocusable) {
962
+ firstFocusable.focus();
963
+ hasPerformedInitialFocusRef.current = true;
964
+ } else if (modalContentRef.current) {
965
+ modalContentRef.current.focus();
966
+ hasPerformedInitialFocusRef.current = true;
967
+ }
968
+ } else if (isFocusInModal) {
969
+ hasPerformedInitialFocusRef.current = true;
970
+ }
971
+ }, 100);
972
+ }
973
+ const handleTab = (event) => {
974
+ if (event.key !== "Tab") return;
975
+ const focusableElements = getFocusableElements();
976
+ if (focusableElements.length === 0) return;
977
+ const firstElement = focusableElements[0];
978
+ const lastElement = focusableElements[focusableElements.length - 1];
979
+ if (event.shiftKey) {
980
+ if (document.activeElement === firstElement) {
981
+ event.preventDefault();
982
+ lastElement.focus();
983
+ }
984
+ } else {
985
+ if (document.activeElement === lastElement) {
986
+ event.preventDefault();
987
+ firstElement.focus();
988
+ }
989
+ }
990
+ };
991
+ const handleEsc = (event) => {
992
+ if (event.key === "Escape" && !blocking) {
993
+ onClose();
994
+ }
995
+ };
996
+ document.addEventListener("keydown", handleTab);
997
+ document.addEventListener("keydown", handleEsc);
998
+ document.body.style.overflow = "hidden";
999
+ return () => {
1000
+ if (timeoutId) {
1001
+ clearTimeout(timeoutId);
1002
+ }
1003
+ document.removeEventListener("keydown", handleTab);
1004
+ document.removeEventListener("keydown", handleEsc);
1005
+ document.body.style.overflow = "unset";
1006
+ if (!isOpen && previousActiveElementRef.current) {
1007
+ previousActiveElementRef.current.focus();
1008
+ }
1009
+ };
1010
+ }, [isOpen, onClose, blocking]);
1011
+ const modalRoot = (() => {
1012
+ if (typeof document === "undefined") return null;
1013
+ let root = document.getElementById("modal-root");
1014
+ if (!root) {
1015
+ root = document.createElement("div");
1016
+ root.id = "modal-root";
1017
+ document.body.appendChild(root);
1018
+ }
1019
+ return root;
1020
+ })();
1021
+ if (!modalRoot) {
1022
+ return null;
1023
+ }
1024
+ const backdropVariants = {
1025
+ hidden: { opacity: 0 },
1026
+ visible: { opacity: 1 }
1027
+ };
1028
+ const modalVariants = {
1029
+ hidden: {
1030
+ opacity: 0,
1031
+ scale: 0.95,
1032
+ y: 20
1033
+ },
1034
+ visible: {
1035
+ opacity: 1,
1036
+ scale: 1,
1037
+ y: 0,
1038
+ transition: {
1039
+ duration: 0.2,
1040
+ ease: "easeOut"
1041
+ }
1042
+ },
1043
+ exit: {
1044
+ opacity: 0,
1045
+ scale: 0.9,
1046
+ y: 100,
1047
+ // Slide down much further for reverse effect
1048
+ transition: {
1049
+ duration: 0.3,
1050
+ ease: "easeIn"
1051
+ }
1052
+ }
1053
+ };
1054
+ if (!isOpen) return null;
1055
+ if (variant === "plain") {
1056
+ return reactDom.createPortal(
1057
+ /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: /* @__PURE__ */ jsxRuntime.jsx(
1058
+ framerMotion.motion.div,
1059
+ {
1060
+ className: `modal-backdrop fixed inset-0 w-screen h-screen flex items-center ${customStyles.backdrop?.includes("justify-") ? customStyles.backdrop : customStyles.backdrop ? `${customStyles.backdrop} justify-center` : "justify-center bg-black/10"} z-[999999] m-0 ${fullScreen ? "p-0" : "p-4"}`,
1061
+ variants: backdropVariants,
1062
+ initial: "hidden",
1063
+ animate: isOpen ? "visible" : "hidden",
1064
+ exit: "hidden",
1065
+ onClick: blocking ? void 0 : onClose,
1066
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1067
+ framerMotion.motion.div,
1068
+ {
1069
+ ref: modalContentRef,
1070
+ role: "dialog",
1071
+ "aria-modal": "true",
1072
+ "aria-labelledby": title ? "modal-title-plain" : void 0,
1073
+ "aria-describedby": ariaDescribedBy || "modal-content-plain",
1074
+ tabIndex: -1,
1075
+ className: `w-full flex flex-col overflow-hidden relative z-[1000000] ${customStyles.container || "bg-card shadow-xl"} ${fullScreen ? "h-full rounded-none" : `rounded-lg ${className} ${sizeClasses3[size]} max-h-[90vh]`}`,
1076
+ variants: modalVariants,
1077
+ initial: "hidden",
1078
+ animate: isOpen ? "visible" : "exit",
1079
+ exit: "exit",
1080
+ onClick: (e) => e.stopPropagation(),
1081
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1082
+ "div",
1083
+ {
1084
+ id: "modal-content-plain",
1085
+ className: `flex-1 ${customStyles.content || ""}`,
1086
+ children
1087
+ }
1088
+ )
1089
+ },
1090
+ "modal-content"
1091
+ )
1092
+ },
1093
+ "modal-backdrop"
1094
+ ) }),
1095
+ modalRoot
1096
+ );
1097
+ }
1098
+ return reactDom.createPortal(
1099
+ /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: /* @__PURE__ */ jsxRuntime.jsx(
1100
+ framerMotion.motion.div,
1101
+ {
1102
+ className: `modal-backdrop fixed inset-0 w-screen h-screen bg-black/10 flex items-center ${customStyles.backdrop || "justify-center"} z-[999999] m-0 ${fullScreen ? "p-0" : "p-4"}`,
1103
+ variants: backdropVariants,
1104
+ initial: "hidden",
1105
+ animate: isOpen ? "visible" : "hidden",
1106
+ exit: "hidden",
1107
+ onClick: blocking ? void 0 : onClose,
1108
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
1109
+ framerMotion.motion.div,
1110
+ {
1111
+ ref: modalContentRef,
1112
+ role: "dialog",
1113
+ "aria-modal": "true",
1114
+ "aria-labelledby": title ? "modal-title" : void 0,
1115
+ "aria-describedby": ariaDescribedBy || "modal-content",
1116
+ tabIndex: -1,
1117
+ className: `bg-card border border-border shadow-xl w-full flex flex-col overflow-hidden relative z-[1000000] ${fullScreen ? "h-full rounded-none" : `rounded-lg ${customStyles.container || className || sizeClasses3[size]} max-h-[90vh]`}`,
1118
+ variants: modalVariants,
1119
+ initial: "hidden",
1120
+ animate: isOpen ? "visible" : "exit",
1121
+ exit: "exit",
1122
+ onClick: (e) => e.stopPropagation(),
1123
+ children: [
1124
+ header ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0", children: header }) : title ? /* @__PURE__ */ jsxRuntime.jsxs(
1125
+ "div",
1126
+ {
1127
+ className: `px-6 py-4 border-b border-border flex justify-between items-center flex-shrink-0 ${customStyles.header || ""}`,
1128
+ children: [
1129
+ /* @__PURE__ */ jsxRuntime.jsx(
1130
+ "h2",
1131
+ {
1132
+ id: "modal-title",
1133
+ className: "text-xl font-semibold text-foreground",
1134
+ children: title
1135
+ }
1136
+ ),
1137
+ /* @__PURE__ */ jsxRuntime.jsx(
1138
+ "button",
1139
+ {
1140
+ onClick: onClose,
1141
+ className: "p-2 text-muted-foreground hover:text-foreground hover:bg-muted rounded-full transition-colors",
1142
+ title: "Close",
1143
+ "aria-label": "Close modal",
1144
+ disabled: blocking,
1145
+ children: /* @__PURE__ */ jsxRuntime.jsx(ri.RiCloseLine, { className: "w-5 h-5", "aria-hidden": "true" })
1146
+ }
1147
+ )
1148
+ ]
1149
+ }
1150
+ ) : null,
1151
+ /* @__PURE__ */ jsxRuntime.jsx(
1152
+ "div",
1153
+ {
1154
+ id: "modal-content",
1155
+ className: `bg-background text-foreground flex-1 ${scrollable ? "overflow-y-auto" : ""} ${fullScreen || noPadding ? "p-0" : "px-6 py-4"}`,
1156
+ children
1157
+ }
1158
+ ),
1159
+ footer && /* @__PURE__ */ jsxRuntime.jsx(
1160
+ "div",
1161
+ {
1162
+ className: `flex-shrink-0 px-6 py-4 border-t border-border ${footerBg === "white" ? "bg-card" : "bg-muted"} ${customStyles.footer || ""}`,
1163
+ children: footer
1164
+ }
1165
+ )
1166
+ ]
1167
+ },
1168
+ "modal-content"
1169
+ )
1170
+ },
1171
+ "modal-backdrop"
1172
+ ) }),
1173
+ modalRoot
1174
+ );
1175
+ }
1176
+ var LoadingSpinner = ({
1177
+ message = "Initializing...",
1178
+ className,
1179
+ showMessage = false
1180
+ }) => {
1181
+ const containerClasses = className !== void 0 ? className : "flex items-center justify-center h-screen min-h-screen";
1182
+ return /* @__PURE__ */ jsxRuntime.jsx(
1183
+ "div",
1184
+ {
1185
+ className: containerClasses,
1186
+ role: "status",
1187
+ "aria-live": "polite",
1188
+ "aria-label": message,
1189
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center", children: [
1190
+ /* @__PURE__ */ jsxRuntime.jsxs(
1191
+ "div",
1192
+ {
1193
+ className: "flex items-center justify-center space-x-2 mb-6",
1194
+ "aria-hidden": "true",
1195
+ children: [
1196
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-1.5 h-12 bg-gradient-to-t from-primary-600 to-primary-400 rounded-full shadow-sm [animation:wave_1.2s_ease-in-out_infinite] [animation-delay:0s]" }),
1197
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-1.5 h-8 bg-gradient-to-t from-primary-600 to-primary-400 rounded-full shadow-sm [animation:wave_1.2s_ease-in-out_infinite] [animation-delay:0.2s]" }),
1198
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-1.5 h-8 bg-gradient-to-t from-primary-600 to-primary-400 rounded-full shadow-sm [animation:wave_1.2s_ease-in-out_infinite] [animation-delay:0.4s]" }),
1199
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-1.5 h-12 bg-gradient-to-t from-primary-600 to-primary-400 rounded-full shadow-sm [animation:wave_1.2s_ease-in-out_infinite] [animation-delay:0.6s]" })
1200
+ ]
1201
+ }
1202
+ ),
1203
+ showMessage && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2", children: /* @__PURE__ */ jsxRuntime.jsx(
1204
+ "p",
1205
+ {
1206
+ className: "text-sm text-secondary-foreground animate-pulse",
1207
+ "aria-live": "polite",
1208
+ children: message
1209
+ }
1210
+ ) })
1211
+ ] })
1212
+ }
1213
+ );
1214
+ };
1215
+ var LoadingSpinner_default = LoadingSpinner;
1216
+ function PageHeader({
1217
+ icon: Icon,
1218
+ title,
1219
+ subtitle,
1220
+ rightContent,
1221
+ className = ""
1222
+ }) {
1223
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `mb-6 lg:mb-8 ${className}`, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "header-layout", children: [
1224
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-3", children: [
1225
+ Icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "w-6 h-6 lg:w-8 lg:h-8 flex-shrink-0" }),
1226
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
1227
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-xl lg:text-3xl font-bold text-foreground truncate", children: title }),
1228
+ subtitle && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm lg:text-base text-muted-foreground", children: subtitle })
1229
+ ] })
1230
+ ] }),
1231
+ rightContent && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center space-x-2 lg:space-x-3 flex-shrink-0", children: rightContent })
1232
+ ] }) });
1233
+ }
1234
+ function FormSection({
1235
+ title,
1236
+ description,
1237
+ children,
1238
+ className = ""
1239
+ }) {
1240
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `space-y-4 ${className}`, children: [
1241
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1242
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg font-medium ", children: title }),
1243
+ description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-sm text-muted-foreground", children: description })
1244
+ ] }),
1245
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-4", children })
1246
+ ] });
1247
+ }
1248
+ function Grid({
1249
+ children,
1250
+ cols = 1,
1251
+ gap = 4,
1252
+ className = ""
1253
+ }) {
1254
+ const colClasses = {
1255
+ 1: "grid-cols-1",
1256
+ 2: "grid-cols-1 md:grid-cols-2",
1257
+ 3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3",
1258
+ 4: "grid-cols-1 md:grid-cols-2 lg:grid-cols-4",
1259
+ 5: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-5",
1260
+ 6: "grid-cols-2 md:grid-cols-3 lg:grid-cols-6",
1261
+ 12: "grid-cols-12"
1262
+ };
1263
+ const gapClasses = {
1264
+ 1: "gap-1",
1265
+ 2: "gap-2",
1266
+ 3: "gap-3",
1267
+ 4: "gap-4",
1268
+ 6: "gap-6",
1269
+ 8: "gap-8"
1270
+ };
1271
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `grid ${colClasses[cols]} ${gapClasses[gap]} ${className}`, children });
1272
+ }
1273
+ function GridItem({
1274
+ children,
1275
+ span = 1,
1276
+ className = ""
1277
+ }) {
1278
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `col-span-${span} ${className}`, children });
1279
+ }
1280
+
1281
+ exports.AccordionCard = AccordionCard;
1282
+ exports.Badge = Badge;
1283
+ exports.Button = Button_default;
1284
+ exports.Card = Card;
1285
+ exports.ClickableCard = ClickableCard;
1286
+ exports.ErrorBadge = ErrorBadge;
1287
+ exports.FormInput = FormInput;
1288
+ exports.FormSection = FormSection;
1289
+ exports.GrayBadge = GrayBadge;
1290
+ exports.Grid = Grid;
1291
+ exports.GridItem = GridItem;
1292
+ exports.HeaderCard = HeaderCard;
1293
+ exports.InfoBadge = InfoBadge;
1294
+ exports.Link = Link_default;
1295
+ exports.LoadingSpinner = LoadingSpinner_default;
1296
+ exports.Modal = Modal;
1297
+ exports.PageHeader = PageHeader;
1298
+ exports.PrimaryBadge = PrimaryBadge;
1299
+ exports.SimpleCard = SimpleCard;
1300
+ exports.StatusBadge = StatusBadge;
1301
+ exports.StatusCard = StatusCard;
1302
+ exports.SuccessBadge = SuccessBadge;
1303
+ exports.Switch = Switch;
1304
+ exports.WarningBadge = WarningBadge;
1305
+ //# sourceMappingURL=index.js.map
1306
+ //# sourceMappingURL=index.js.map