ssovee-os-web-ui 0.1.4

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,1972 @@
1
+ import * as React20 from 'react';
2
+ import React20__default, { useRef, useImperativeHandle, useCallback, useEffect, useState } from 'react';
3
+ import { jsxs, jsx } from 'react/jsx-runtime';
4
+ import { ArrowCircleRightIcon, CaretDownIcon, CheckIcon, MagnifyingGlassIcon, XIcon, CaretLeftIcon, CaretRightIcon, CaretUpIcon, InfoIcon, WarningIcon, CheckCircleIcon, UploadIcon } from '@phosphor-icons/react';
5
+
6
+ // src/components/Button.tsx
7
+
8
+ // src/utils/helpers.ts
9
+ function cn(...inputs) {
10
+ return inputs.filter(Boolean).join(" ");
11
+ }
12
+ var Button = React20__default.forwardRef(
13
+ ({
14
+ className,
15
+ variant = "primary",
16
+ tone = "primary",
17
+ size = "md",
18
+ loading = false,
19
+ leftIcon,
20
+ rightIcon,
21
+ fullWidth = false,
22
+ rounded = "lg",
23
+ disabled,
24
+ children,
25
+ ...props
26
+ }, ref) => {
27
+ const baseClasses = "inline-flex items-center justify-center font-medium transition-all duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed";
28
+ const variantClasses = {
29
+ primary: "bg-brand-color text-white hover:bg-brand-color/90 active:bg-brand-color/80 focus-visible:ring-brand-color/50 shadow-sm hover:shadow-md active:shadow-none disabled:bg-brand-color/50 disabled:text-white/80",
30
+ secondary: "bg-surface-3 text-neutral-100 hover:bg-surface-4 active:bg-surface-4 focus-visible:ring-surface-3/50 border border-surface-4 shadow-sm hover:shadow-md active:shadow-none disabled:bg-surface-3/50",
31
+ outline: "bg-transparent text-neutral-400 border border-surface-1 hover:bg-surface-1 active:bg-surface-1 focus-visible:ring-surface-1/50",
32
+ ghost: "bg-transparent text-neutral-400 hover:bg-surface-1 active:bg-surface-1 focus-visible:ring-surface-1/50",
33
+ danger: "bg-red-500 text-white hover:bg-red-600 active:bg-red-600 focus-visible:ring-red-500/50 shadow-sm hover:shadow-md active:shadow-none disabled:bg-red-500/50",
34
+ success: "bg-green-500 text-white hover:bg-green-600 active:bg-green-600 focus-visible:ring-green-500/50 shadow-sm hover:shadow-md active:shadow-none disabled:bg-green-500/50",
35
+ filled: "",
36
+ text: ""
37
+ };
38
+ const filledToneClasses = {
39
+ primary: "bg-brand-color text-white hover:bg-brand-color/90 active:bg-brand-color/80 focus-visible:ring-brand-color/50 shadow-sm hover:shadow-md active:shadow-none disabled:bg-brand-color/50 disabled:text-white/80",
40
+ neutral: "bg-surface-3 text-neutral-100 hover:bg-surface-4 active:bg-surface-4 focus-visible:ring-surface-3/50 shadow-sm hover:shadow-md active:shadow-none disabled:bg-surface-3/50",
41
+ success: "bg-green-500 text-white hover:bg-green-600 active:bg-green-600 focus-visible:ring-green-500/50 shadow-sm hover:shadow-md active:shadow-none disabled:bg-green-500/50",
42
+ danger: "bg-red-500 text-white hover:bg-red-600 active:bg-red-600 focus-visible:ring-red-500/50 shadow-sm hover:shadow-md active:shadow-none disabled:bg-red-500/50"
43
+ };
44
+ const textToneClasses = {
45
+ primary: "bg-transparent text-brand-color hover:text-brand-color/90 active:text-brand-color/80 hover:underline underline-offset-2 focus-visible:ring-brand-color/30",
46
+ neutral: "bg-transparent text-neutral-400 hover:text-neutral-300 active:text-neutral-300 focus-visible:ring-surface-1/50",
47
+ success: "bg-transparent text-green-600 hover:text-green-700 active:text-green-700 focus-visible:ring-green-500/30",
48
+ danger: "bg-transparent text-red-600 hover:text-red-700 active:text-red-700 focus-visible:ring-red-500/30"
49
+ };
50
+ const sizeClasses = {
51
+ sm: "h-8 px-3 text-sm",
52
+ md: "h-10 px-4 text-base",
53
+ lg: "h-12 px-5 text-lg",
54
+ xl: "h-14 px-6 text-xl"
55
+ };
56
+ const roundedClasses = {
57
+ sm: "rounded-[6px]",
58
+ md: "rounded-[6px]",
59
+ lg: "rounded-[6px]",
60
+ full: "rounded-full"
61
+ };
62
+ const widthClasses = fullWidth ? "w-full" : "";
63
+ return /* @__PURE__ */ jsxs(
64
+ "button",
65
+ {
66
+ ref,
67
+ className: cn(
68
+ baseClasses,
69
+ variant === "filled" ? filledToneClasses[tone] : variant === "text" ? textToneClasses[tone] : variantClasses[variant],
70
+ sizeClasses[size],
71
+ roundedClasses[rounded],
72
+ widthClasses,
73
+ className
74
+ ),
75
+ "data-variant": variant,
76
+ "data-tone": tone,
77
+ disabled: disabled || loading,
78
+ ...props,
79
+ children: [
80
+ loading && /* @__PURE__ */ jsx("div", { className: "mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }),
81
+ !loading && leftIcon && /* @__PURE__ */ jsx("span", { className: "mr-2", children: leftIcon }),
82
+ children,
83
+ !loading && rightIcon && /* @__PURE__ */ jsx("span", { className: "ml-2", children: rightIcon })
84
+ ]
85
+ }
86
+ );
87
+ }
88
+ );
89
+ Button.displayName = "Button";
90
+ var Button_default = Button;
91
+ var Typography = ({
92
+ as,
93
+ variant = "p",
94
+ size,
95
+ weight,
96
+ color,
97
+ className,
98
+ children
99
+ }) => {
100
+ const Component = as || variant;
101
+ const sizeClasses = {
102
+ xs: "text-xs",
103
+ sm: "text-sm",
104
+ md: "text-base",
105
+ lg: "text-lg",
106
+ xl: "text-xl",
107
+ "2xl": "text-2xl",
108
+ "3xl": "text-3xl",
109
+ "4xl": "text-4xl",
110
+ "5xl": "text-5xl"
111
+ };
112
+ const weightClasses = {
113
+ thin: "font-thin",
114
+ extralight: "font-extralight",
115
+ light: "font-light",
116
+ normal: "font-normal",
117
+ medium: "font-medium",
118
+ semibold: "font-semibold",
119
+ bold: "font-bold",
120
+ extrabold: "font-extrabold",
121
+ black: "font-black"
122
+ };
123
+ const colorClasses = {
124
+ "neutral-100": "text-neutral-100",
125
+ "neutral-200": "text-neutral-200",
126
+ "neutral-300": "text-neutral-300",
127
+ "neutral-400": "text-neutral-400",
128
+ "neutral-500": "text-neutral-500",
129
+ "neutral-600": "text-neutral-600",
130
+ "neutral-700": "text-neutral-700",
131
+ "neutral-800": "text-neutral-800",
132
+ "neutral-900": "text-neutral-900",
133
+ "brand-color": "text-brand-color",
134
+ "red-500": "text-red-500",
135
+ "green-500": "text-green-500",
136
+ "blue-500": "text-blue-500",
137
+ "yellow-500": "text-yellow-500"
138
+ };
139
+ const classes = cn(
140
+ size && sizeClasses[size],
141
+ weight && weightClasses[weight],
142
+ color && colorClasses[color],
143
+ className
144
+ );
145
+ return /* @__PURE__ */ jsx(Component, { className: classes, children });
146
+ };
147
+ var Typography_default = Typography;
148
+ var Input = React20__default.forwardRef(
149
+ ({
150
+ className,
151
+ variant = "default",
152
+ size = "md",
153
+ leftIcon,
154
+ rightIcon,
155
+ showSubmitButton = false,
156
+ onSubmit,
157
+ error,
158
+ label,
159
+ helperText,
160
+ fullWidth = false,
161
+ onKeyUp,
162
+ ...props
163
+ }, ref) => {
164
+ const baseClasses = "transition-all duration-200 focus:outline-none placeholder:text-neutral-300 rounded-[6px]";
165
+ const variantClasses = {
166
+ default: "bg-primary border border-surface-1 focus:border-brand-color focus:ring-1 focus:ring-brand-color/50",
167
+ filled: "bg-surface-4 border border-surface-4 focus:border-brand-color focus:ring-1 focus:ring-brand-color/50",
168
+ outline: "bg-transparent border border-surface-1 focus:border-brand-color focus:ring-1 focus:ring-brand-color/50"
169
+ };
170
+ const sizeClasses = {
171
+ sm: "h-8 px-2 text-sm",
172
+ md: "h-10 px-3 text-base",
173
+ lg: "h-12 px-4 text-lg"
174
+ };
175
+ const widthClasses = fullWidth ? "w-full" : "";
176
+ const handleKeyUp = (e) => {
177
+ if (e.key === "Enter" && onSubmit) {
178
+ onSubmit();
179
+ }
180
+ onKeyUp?.(e);
181
+ };
182
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col", fullWidth && "w-full"), children: [
183
+ label && /* @__PURE__ */ jsx("label", { className: "text-sm font-medium text-neutral-500 mb-1", children: label }),
184
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
185
+ leftIcon && /* @__PURE__ */ jsx("div", { className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-neutral-400", children: leftIcon }),
186
+ /* @__PURE__ */ jsx(
187
+ "input",
188
+ {
189
+ ref,
190
+ className: cn(
191
+ baseClasses,
192
+ variantClasses[variant],
193
+ sizeClasses[size],
194
+ widthClasses,
195
+ leftIcon ? "pl-10" : "",
196
+ rightIcon || showSubmitButton ? "pr-10" : "",
197
+ error && "border-red-500 focus:border-red-500 focus:ring-red-500/50",
198
+ className
199
+ ),
200
+ onKeyUp: handleKeyUp,
201
+ ...props
202
+ }
203
+ ),
204
+ rightIcon && !showSubmitButton && /* @__PURE__ */ jsx("div", { className: "absolute right-3 top-1/2 transform -translate-y-1/2 text-neutral-400", children: rightIcon }),
205
+ showSubmitButton && /* @__PURE__ */ jsx(
206
+ ArrowCircleRightIcon,
207
+ {
208
+ size: 20,
209
+ onClick: onSubmit,
210
+ className: "absolute right-3 top-1/2 transform -translate-y-1/2 text-neutral-300 cursor-pointer hover:text-neutral-400 transition-colors"
211
+ }
212
+ )
213
+ ] }),
214
+ (error || helperText) && /* @__PURE__ */ jsxs("div", { className: "mt-1", children: [
215
+ error && /* @__PURE__ */ jsx(Typography_default, { variant: "p", className: "text-xs text-red-500", children: error }),
216
+ helperText && !error && /* @__PURE__ */ jsx(Typography_default, { variant: "p", className: "text-xs text-neutral-400", children: helperText })
217
+ ] })
218
+ ] });
219
+ }
220
+ );
221
+ Input.displayName = "Input";
222
+ var Input_default = Input;
223
+ var TextArea = React20__default.forwardRef(
224
+ ({
225
+ className,
226
+ variant = "default",
227
+ size = "md",
228
+ error,
229
+ label,
230
+ helperText,
231
+ fullWidth = false,
232
+ resize = "vertical",
233
+ ...props
234
+ }, ref) => {
235
+ const baseClasses = "transition-all duration-200 focus:outline-none placeholder:text-neutral-300 rounded-[6px]";
236
+ const variantClasses = {
237
+ default: "bg-primary border border-surface-1 focus:border-brand-color focus:ring-1 focus:ring-brand-color/50",
238
+ filled: "bg-surface-4 border border-surface-4 focus:border-brand-color focus:ring-1 focus:ring-brand-color/50",
239
+ outline: "bg-transparent border border-surface-1 focus:border-brand-color focus:ring-1 focus:ring-brand-color/50"
240
+ };
241
+ const sizeClasses = {
242
+ sm: "px-2 py-1 text-sm",
243
+ md: "px-3 py-2 text-base",
244
+ lg: "px-4 py-3 text-lg"
245
+ };
246
+ const resizeClasses = {
247
+ none: "resize-none",
248
+ vertical: "resize-y",
249
+ horizontal: "resize-x",
250
+ both: "resize"
251
+ };
252
+ const widthClasses = fullWidth ? "w-full" : "";
253
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col", fullWidth && "w-full"), children: [
254
+ label && /* @__PURE__ */ jsx("label", { className: "text-sm font-medium text-neutral-500 mb-1", children: label }),
255
+ /* @__PURE__ */ jsx(
256
+ "textarea",
257
+ {
258
+ ref,
259
+ className: cn(
260
+ baseClasses,
261
+ variantClasses[variant],
262
+ sizeClasses[size],
263
+ resizeClasses[resize],
264
+ widthClasses,
265
+ error && "border-red-500 focus:border-red-500 focus:ring-red-500/50",
266
+ className
267
+ ),
268
+ ...props
269
+ }
270
+ ),
271
+ (error || helperText) && /* @__PURE__ */ jsxs("div", { className: "mt-1", children: [
272
+ error && /* @__PURE__ */ jsx(Typography_default, { variant: "p", className: "text-xs text-red-500", children: error }),
273
+ helperText && !error && /* @__PURE__ */ jsx(Typography_default, { variant: "p", className: "text-xs text-neutral-400", children: helperText })
274
+ ] })
275
+ ] });
276
+ }
277
+ );
278
+ TextArea.displayName = "TextArea";
279
+ var TextArea_default = TextArea;
280
+ var Select = React20__default.forwardRef(
281
+ ({
282
+ className,
283
+ options,
284
+ variant = "default",
285
+ size = "md",
286
+ error,
287
+ label,
288
+ helperText,
289
+ fullWidth = false,
290
+ onChange,
291
+ placeholder,
292
+ value,
293
+ ...props
294
+ }, ref) => {
295
+ const baseClasses = "transition-all duration-200 focus:outline-none appearance-none cursor-pointer rounded-[6px]";
296
+ const variantClasses = {
297
+ default: "bg-primary border border-surface-1 focus:border-brand-color focus:ring-1 focus:ring-brand-color/50",
298
+ filled: "bg-surface-4 border border-surface-4 focus:border-brand-color focus:ring-1 focus:ring-brand-color/50",
299
+ outline: "bg-transparent border border-surface-1 focus:border-brand-color focus:ring-1 focus:ring-brand-color/50"
300
+ };
301
+ const sizeClasses = {
302
+ sm: "h-8 px-2 text-sm",
303
+ md: "h-10 px-3 text-base",
304
+ lg: "h-12 px-4 text-lg"
305
+ };
306
+ const widthClasses = fullWidth ? "w-full" : "";
307
+ const handleChange = (e) => {
308
+ onChange?.(e.target.value);
309
+ };
310
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col", fullWidth && "w-full"), children: [
311
+ label && /* @__PURE__ */ jsx("label", { className: "text-sm font-medium text-neutral-500 mb-1", children: label }),
312
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
313
+ /* @__PURE__ */ jsxs(
314
+ "select",
315
+ {
316
+ ref,
317
+ className: cn(
318
+ baseClasses,
319
+ variantClasses[variant],
320
+ sizeClasses[size],
321
+ widthClasses,
322
+ "pr-10",
323
+ error && "border-red-500 focus:border-red-500 focus:ring-red-500/50",
324
+ className
325
+ ),
326
+ value,
327
+ onChange: handleChange,
328
+ ...props,
329
+ children: [
330
+ placeholder && /* @__PURE__ */ jsx("option", { value: "", disabled: true, children: placeholder }),
331
+ options.map((option) => /* @__PURE__ */ jsx(
332
+ "option",
333
+ {
334
+ value: option.value,
335
+ disabled: option.disabled,
336
+ children: option.label
337
+ },
338
+ option.value
339
+ ))
340
+ ]
341
+ }
342
+ ),
343
+ /* @__PURE__ */ jsx(
344
+ CaretDownIcon,
345
+ {
346
+ size: 16,
347
+ className: "absolute right-3 top-1/2 transform -translate-y-1/2 text-neutral-400 pointer-events-none"
348
+ }
349
+ )
350
+ ] }),
351
+ (error || helperText) && /* @__PURE__ */ jsxs("div", { className: "mt-1", children: [
352
+ error && /* @__PURE__ */ jsx(Typography_default, { variant: "p", className: "text-xs text-red-500", children: error }),
353
+ helperText && !error && /* @__PURE__ */ jsx(Typography_default, { variant: "p", className: "text-xs text-neutral-400", children: helperText })
354
+ ] })
355
+ ] });
356
+ }
357
+ );
358
+ Select.displayName = "Select";
359
+ var Select_default = Select;
360
+ var Checkbox = React20__default.forwardRef(
361
+ ({
362
+ className,
363
+ variant = "default",
364
+ size = "md",
365
+ error,
366
+ label,
367
+ helperText,
368
+ indeterminate = false,
369
+ checked,
370
+ onChange,
371
+ ...props
372
+ }, ref) => {
373
+ const baseClasses = "transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 cursor-pointer rounded-[6px]";
374
+ const variantClasses = {
375
+ default: "bg-primary border border-surface-1 focus:border-brand-color focus:ring-brand-color/50 checked:bg-brand-color checked:border-brand-color",
376
+ filled: "bg-surface-4 border border-surface-4 focus:border-brand-color focus:ring-brand-color/50 checked:bg-brand-color checked:border-brand-color"
377
+ };
378
+ const sizeClasses = {
379
+ sm: "w-4 h-4",
380
+ md: "w-5 h-5",
381
+ lg: "w-6 h-6"
382
+ };
383
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
384
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2", children: [
385
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
386
+ /* @__PURE__ */ jsx(
387
+ "input",
388
+ {
389
+ ref,
390
+ type: "checkbox",
391
+ className: cn(
392
+ baseClasses,
393
+ variantClasses[variant],
394
+ sizeClasses[size],
395
+ "appearance-none",
396
+ error && "border-red-500 focus:border-red-500 focus:ring-red-500/50",
397
+ className
398
+ ),
399
+ defaultChecked: checked,
400
+ onChange,
401
+ ...props
402
+ }
403
+ ),
404
+ (checked || indeterminate) && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center pointer-events-none", children: /* @__PURE__ */ jsx(
405
+ CheckIcon,
406
+ {
407
+ size: size === "sm" ? 12 : size === "md" ? 16 : 20,
408
+ className: "text-white",
409
+ weight: indeterminate ? "bold" : "regular"
410
+ }
411
+ ) })
412
+ ] }),
413
+ label && /* @__PURE__ */ jsx("label", { className: "text-sm text-neutral-400 cursor-pointer select-none", children: label })
414
+ ] }),
415
+ (error || helperText) && /* @__PURE__ */ jsxs("div", { className: "mt-1 ml-6", children: [
416
+ error && /* @__PURE__ */ jsx(Typography_default, { variant: "p", className: "text-xs text-red-500", children: error }),
417
+ helperText && !error && /* @__PURE__ */ jsx(Typography_default, { variant: "p", className: "text-xs text-neutral-400", children: helperText })
418
+ ] })
419
+ ] });
420
+ }
421
+ );
422
+ Checkbox.displayName = "Checkbox";
423
+ var Checkbox_default = Checkbox;
424
+ var Toggle = React20__default.forwardRef(
425
+ ({
426
+ checked,
427
+ onChange,
428
+ variant = "default",
429
+ size = "md",
430
+ disabled = false,
431
+ label,
432
+ helperText,
433
+ fullWidth = false
434
+ }, ref) => {
435
+ const baseClasses = "flex items-center rounded-full cursor-pointer transition-colors duration-300 focus:outline-none focus:ring-2 focus:ring-offset-2";
436
+ const variantClasses = {
437
+ default: "focus:ring-brand-color/50",
438
+ success: "focus:ring-green-500/50",
439
+ warning: "focus:ring-yellow-500/50",
440
+ danger: "focus:ring-red-500/50"
441
+ };
442
+ const toggleClasses = {
443
+ default: checked ? "bg-brand-color" : "bg-gray-500",
444
+ success: checked ? "bg-green-500" : "bg-gray-500",
445
+ warning: checked ? "bg-yellow-500" : "bg-gray-500",
446
+ danger: checked ? "bg-red-500" : "bg-gray-500"
447
+ };
448
+ const sizeClasses = {
449
+ sm: "w-8 h-4 px-0.5",
450
+ md: "w-10 h-5 px-0.5",
451
+ lg: "w-12 h-6 px-1"
452
+ };
453
+ const thumbSizeClasses = {
454
+ sm: "w-3 h-3",
455
+ md: "w-4 h-4",
456
+ lg: "w-5 h-5"
457
+ };
458
+ const thumbTransformClasses = {
459
+ sm: checked ? "translate-x-4" : "translate-x-0",
460
+ md: checked ? "translate-x-5" : "translate-x-0",
461
+ lg: checked ? "translate-x-6" : "translate-x-0"
462
+ };
463
+ const widthClasses = fullWidth ? "w-full" : "";
464
+ const handleClick = () => {
465
+ if (!disabled) {
466
+ onChange(!checked);
467
+ }
468
+ };
469
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col", fullWidth && "w-full"), children: [
470
+ /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-2", fullWidth && "w-full"), children: [
471
+ /* @__PURE__ */ jsx(
472
+ "button",
473
+ {
474
+ ref,
475
+ type: "button",
476
+ className: cn(
477
+ baseClasses,
478
+ variantClasses[variant],
479
+ toggleClasses[variant],
480
+ sizeClasses[size],
481
+ widthClasses,
482
+ disabled && "opacity-50 cursor-not-allowed"
483
+ ),
484
+ onClick: handleClick,
485
+ disabled,
486
+ role: "switch",
487
+ "aria-checked": checked,
488
+ children: /* @__PURE__ */ jsx(
489
+ "div",
490
+ {
491
+ className: cn(
492
+ "bg-white rounded-full shadow-md transform transition-transform duration-300",
493
+ thumbSizeClasses[size],
494
+ thumbTransformClasses[size]
495
+ )
496
+ }
497
+ )
498
+ }
499
+ ),
500
+ label && /* @__PURE__ */ jsx("span", { className: "text-sm text-neutral-500 cursor-pointer select-none", onClick: handleClick, children: label })
501
+ ] }),
502
+ helperText && /* @__PURE__ */ jsx("div", { className: "mt-1 ml-12", children: /* @__PURE__ */ jsx(Typography_default, { variant: "p", className: "text-xs text-neutral-400", children: helperText }) })
503
+ ] });
504
+ }
505
+ );
506
+ Toggle.displayName = "Toggle";
507
+ var Toggle_default = Toggle;
508
+ var Dropdown = ({
509
+ options,
510
+ value,
511
+ onChange,
512
+ placeholder = "Select an option",
513
+ variant = "default",
514
+ size = "md",
515
+ disabled = false,
516
+ className,
517
+ trigger
518
+ }) => {
519
+ const [isOpen, setIsOpen] = useState(false);
520
+ const dropdownRef = useRef(null);
521
+ const selectedOption = options.find((option) => option.value === value);
522
+ useEffect(() => {
523
+ const handleClickOutside = (event) => {
524
+ if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
525
+ setIsOpen(false);
526
+ }
527
+ };
528
+ document.addEventListener("mousedown", handleClickOutside);
529
+ return () => {
530
+ document.removeEventListener("mousedown", handleClickOutside);
531
+ };
532
+ }, []);
533
+ const handleToggle = () => {
534
+ if (!disabled) {
535
+ setIsOpen(!isOpen);
536
+ }
537
+ };
538
+ const handleSelect = (option) => {
539
+ if (!option.disabled) {
540
+ onChange?.(option.value);
541
+ setIsOpen(false);
542
+ }
543
+ };
544
+ const baseClasses = "transition-all duration-200 focus:outline-none cursor-pointer rounded-[6px]";
545
+ const variantClasses = {
546
+ default: "bg-primary border border-surface-1 focus:border-brand-color focus:ring-1 focus:ring-brand-color/50",
547
+ filled: "bg-surface-4 border border-surface-4 focus:border-brand-color focus:ring-1 focus:ring-brand-color/50",
548
+ outline: "bg-transparent border border-surface-1 focus:border-brand-color focus:ring-1 focus:ring-brand-color/50"
549
+ };
550
+ const sizeClasses = {
551
+ sm: "h-8 px-2 text-sm",
552
+ md: "h-10 px-3 text-base",
553
+ lg: "h-12 px-4 text-lg"
554
+ };
555
+ return /* @__PURE__ */ jsxs("div", { ref: dropdownRef, className: "", children: [
556
+ trigger ? /* @__PURE__ */ jsx("div", { onClick: handleToggle, className: "cursor-pointer", children: trigger }) : /* @__PURE__ */ jsxs(
557
+ "button",
558
+ {
559
+ onClick: handleToggle,
560
+ disabled,
561
+ className: cn(
562
+ baseClasses,
563
+ variantClasses[variant],
564
+ sizeClasses[size],
565
+ "w-full flex items-center justify-between pr-8",
566
+ disabled && "opacity-50 cursor-not-allowed",
567
+ className
568
+ ),
569
+ children: [
570
+ /* @__PURE__ */ jsx("span", { className: selectedOption ? "text-neutral-500" : "text-neutral-300", children: selectedOption ? selectedOption.label : placeholder }),
571
+ /* @__PURE__ */ jsx(
572
+ CaretDownIcon,
573
+ {
574
+ size: 16,
575
+ className: cn(
576
+ "text-neutral-400 transition-transform duration-200",
577
+ isOpen && "rotate-180"
578
+ )
579
+ }
580
+ )
581
+ ]
582
+ }
583
+ ),
584
+ isOpen && /* @__PURE__ */ jsx("div", { className: "absolute top-full left-0 right-0 mt-1 bg-secondary border border-surface-1 rounded-[6px] shadow-lg z-50 max-h-60 overflow-y-auto", children: options.map((option) => /* @__PURE__ */ jsxs(
585
+ "div",
586
+ {
587
+ onClick: () => handleSelect(option),
588
+ className: cn(
589
+ "px-3 py-2 cursor-pointer transition-colors duration-200 flex items-center gap-2",
590
+ option.value === value && "bg-brand-color text-neutral-500",
591
+ !option.disabled && "hover:bg-surface-3",
592
+ option.disabled && "opacity-50 cursor-not-allowed"
593
+ ),
594
+ children: [
595
+ option.icon && /* @__PURE__ */ jsx("span", { children: option.icon }),
596
+ /* @__PURE__ */ jsx("span", { children: option.label })
597
+ ]
598
+ },
599
+ option.value
600
+ )) })
601
+ ] });
602
+ };
603
+ var Dropdown_default = Dropdown;
604
+ var ImageWithPlaceholder = ({
605
+ src,
606
+ alt,
607
+ fallbackSrc = "",
608
+ className,
609
+ onError,
610
+ ...props
611
+ }) => {
612
+ const isValidSrc = (s) => {
613
+ if (!s) return false;
614
+ if (typeof s === "object") return true;
615
+ if (typeof s === "string") {
616
+ const trimmed = s.trim();
617
+ if (trimmed === "") return false;
618
+ if (trimmed.startsWith("data:")) return true;
619
+ if (trimmed.startsWith("/") || trimmed.startsWith("./") || trimmed.startsWith("../")) return true;
620
+ try {
621
+ new URL(trimmed);
622
+ return true;
623
+ } catch {
624
+ return false;
625
+ }
626
+ }
627
+ return true;
628
+ };
629
+ const initialSrc = isValidSrc(src) ? src : fallbackSrc;
630
+ const [imgSrc, setImgSrc] = useState(initialSrc);
631
+ const [hasError, setHasError] = useState(!isValidSrc(src));
632
+ useEffect(() => {
633
+ if (isValidSrc(src)) {
634
+ setImgSrc(src);
635
+ setHasError(false);
636
+ } else {
637
+ setImgSrc(fallbackSrc);
638
+ setHasError(true);
639
+ }
640
+ }, [src, fallbackSrc]);
641
+ const handleError = (e) => {
642
+ if (!hasError) {
643
+ setHasError(true);
644
+ setImgSrc(fallbackSrc);
645
+ }
646
+ if (onError) {
647
+ onError(e);
648
+ }
649
+ };
650
+ return /* @__PURE__ */ jsx(
651
+ "img",
652
+ {
653
+ ...props,
654
+ src: typeof imgSrc === "string" ? imgSrc : void 0,
655
+ alt,
656
+ className: cn(className),
657
+ onError: handleError
658
+ }
659
+ );
660
+ };
661
+ var ImageWithPlaceholder_default = ImageWithPlaceholder;
662
+ var Loading = ({
663
+ variant = "image",
664
+ size = "md",
665
+ text = "Loading...",
666
+ fullScreen = false,
667
+ className
668
+ }) => {
669
+ const sizeClasses = {
670
+ sm: "w-6 h-6",
671
+ md: "w-8 h-8",
672
+ lg: "w-12 h-12",
673
+ xl: "w-16 h-16"
674
+ };
675
+ const textSizeClasses = {
676
+ sm: "text-xs",
677
+ md: "text-sm",
678
+ lg: "text-base",
679
+ xl: "text-lg"
680
+ };
681
+ const renderSpinner = () => /* @__PURE__ */ jsx("div", { className: cn("animate-spin rounded-full border-2 border-current border-t-transparent", sizeClasses[size]) });
682
+ const renderDots = () => /* @__PURE__ */ jsxs("div", { className: "flex space-x-1", children: [
683
+ /* @__PURE__ */ jsx("div", { className: cn("animate-bounce rounded-full bg-current", sizeClasses[size]), style: { animationDelay: "0ms" } }),
684
+ /* @__PURE__ */ jsx("div", { className: cn("animate-bounce rounded-full bg-current", sizeClasses[size]), style: { animationDelay: "150ms" } }),
685
+ /* @__PURE__ */ jsx("div", { className: cn("animate-bounce rounded-full bg-current", sizeClasses[size]), style: { animationDelay: "300ms" } })
686
+ ] });
687
+ const renderPulse = () => /* @__PURE__ */ jsx("div", { className: cn("animate-pulse rounded-full bg-current", sizeClasses[size]) });
688
+ const imageSizes = {
689
+ sm: 24,
690
+ md: 32,
691
+ lg: 48,
692
+ xl: 64
693
+ };
694
+ const renderImage = () => /* @__PURE__ */ jsx(
695
+ ImageWithPlaceholder_default,
696
+ {
697
+ src: "/app-assets/Loader.gif",
698
+ alt: "Loader",
699
+ width: imageSizes[size],
700
+ height: imageSizes[size],
701
+ className: sizeClasses[size]
702
+ }
703
+ );
704
+ const renderLoader = () => {
705
+ switch (variant) {
706
+ case "spinner":
707
+ return renderSpinner();
708
+ case "dots":
709
+ return renderDots();
710
+ case "pulse":
711
+ return renderPulse();
712
+ case "image":
713
+ default:
714
+ return renderImage();
715
+ }
716
+ };
717
+ const content = /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col justify-center items-center", className), children: [
718
+ renderLoader(),
719
+ text && /* @__PURE__ */ jsx("div", { className: cn("mt-2 text-neutral-500", textSizeClasses[size]), children: text })
720
+ ] });
721
+ if (fullScreen) {
722
+ return /* @__PURE__ */ jsx("div", { className: "fixed inset-0 flex items-center justify-center bg-primary/50 backdrop-blur-sm z-50", children: content });
723
+ }
724
+ return content;
725
+ };
726
+ var Loading_default = Loading;
727
+ var Toast = ({
728
+ heading,
729
+ message,
730
+ type,
731
+ isVisible,
732
+ onClose,
733
+ duration = 5e3,
734
+ position = "bottom-left",
735
+ showCloseButton = true,
736
+ className
737
+ }) => {
738
+ const [isShowing, setIsShowing] = useState(false);
739
+ useEffect(() => {
740
+ if (isVisible) {
741
+ setIsShowing(true);
742
+ let timer = null;
743
+ if (type !== "error" && duration > 0) {
744
+ timer = setTimeout(() => {
745
+ setIsShowing(false);
746
+ setTimeout(onClose, 300);
747
+ }, duration);
748
+ }
749
+ return () => {
750
+ if (timer) {
751
+ clearTimeout(timer);
752
+ }
753
+ };
754
+ }
755
+ }, [isVisible, type, duration, onClose]);
756
+ if (!isVisible) return null;
757
+ const getIcon = () => {
758
+ switch (type) {
759
+ case "error":
760
+ return /* @__PURE__ */ jsx(WarningIcon, { size: 20, className: "text-red-500" });
761
+ case "success":
762
+ return /* @__PURE__ */ jsx(CheckCircleIcon, { size: 20, className: "text-green-500" });
763
+ case "warning":
764
+ return /* @__PURE__ */ jsx(WarningIcon, { size: 20, className: "text-yellow-500" });
765
+ case "info":
766
+ return /* @__PURE__ */ jsx(InfoIcon, { size: 20, className: "text-blue-500" });
767
+ default:
768
+ return /* @__PURE__ */ jsx(InfoIcon, { size: 20, className: "text-blue-500" });
769
+ }
770
+ };
771
+ const getTypeClasses = () => {
772
+ switch (type) {
773
+ case "error":
774
+ return "border-l-red-500 bg-red-50";
775
+ case "success":
776
+ return "border-l-green-500 bg-green-50";
777
+ case "warning":
778
+ return "border-l-yellow-500 bg-yellow-50";
779
+ case "info":
780
+ return "border-l-blue-500 bg-blue-50";
781
+ default:
782
+ return "border-l-blue-500 bg-blue-50";
783
+ }
784
+ };
785
+ const getPositionClasses = () => {
786
+ switch (position) {
787
+ case "top-left":
788
+ return "top-4 left-4";
789
+ case "top-right":
790
+ return "top-4 right-4";
791
+ case "bottom-left":
792
+ return "bottom-4 left-4";
793
+ case "bottom-right":
794
+ return "bottom-4 right-4";
795
+ case "top-center":
796
+ return "top-4 left-1/2 transform -translate-x-1/2";
797
+ case "bottom-center":
798
+ return "bottom-4 left-1/2 transform -translate-x-1/2";
799
+ default:
800
+ return "bottom-4 left-4";
801
+ }
802
+ };
803
+ const handleClose = () => {
804
+ setIsShowing(false);
805
+ setTimeout(onClose, 300);
806
+ };
807
+ return /* @__PURE__ */ jsx(
808
+ "div",
809
+ {
810
+ className: cn(
811
+ "fixed z-50 transform transition-all duration-300",
812
+ getPositionClasses(),
813
+ isShowing ? "translate-x-0 opacity-100" : "-translate-x-full opacity-0"
814
+ ),
815
+ children: /* @__PURE__ */ jsx(
816
+ "div",
817
+ {
818
+ className: cn(
819
+ "w-80 max-w-sm bg-secondary rounded-[6px] shadow-lg border-l-4 p-4",
820
+ getTypeClasses(),
821
+ className
822
+ ),
823
+ children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
824
+ /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 mt-0.5", children: getIcon() }),
825
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
826
+ heading && /* @__PURE__ */ jsx(Typography_default, { variant: "h4", className: "text-sm font-medium text-neutral-700 mb-1", children: heading }),
827
+ /* @__PURE__ */ jsx(Typography_default, { variant: "p", className: "text-sm text-neutral-600 leading-relaxed", children: message })
828
+ ] }),
829
+ showCloseButton && /* @__PURE__ */ jsx(
830
+ "button",
831
+ {
832
+ onClick: handleClose,
833
+ className: "flex-shrink-0 ml-2 text-neutral-400 hover:text-neutral-600 transition-colors",
834
+ children: /* @__PURE__ */ jsx(XIcon, { size: 16 })
835
+ }
836
+ )
837
+ ] })
838
+ }
839
+ )
840
+ }
841
+ );
842
+ };
843
+ var Toast_default = Toast;
844
+ var Alert = ({
845
+ type,
846
+ title,
847
+ message,
848
+ onClose,
849
+ showCloseButton = false,
850
+ variant = "default",
851
+ className,
852
+ children
853
+ }) => {
854
+ const getIcon = () => {
855
+ switch (type) {
856
+ case "success":
857
+ return /* @__PURE__ */ jsx(CheckCircleIcon, { size: 20, className: "text-green-500" });
858
+ case "error":
859
+ return /* @__PURE__ */ jsx(WarningIcon, { size: 20, className: "text-red-500" });
860
+ case "warning":
861
+ return /* @__PURE__ */ jsx(WarningIcon, { size: 20, className: "text-yellow-500" });
862
+ case "info":
863
+ return /* @__PURE__ */ jsx(InfoIcon, { size: 20, className: "text-blue-500" });
864
+ default:
865
+ return /* @__PURE__ */ jsx(InfoIcon, { size: 20, className: "text-blue-500" });
866
+ }
867
+ };
868
+ const getTypeClasses = () => {
869
+ switch (type) {
870
+ case "success":
871
+ return {
872
+ default: "bg-green-50 border-green-200 text-green-800",
873
+ filled: "bg-green-500 text-white",
874
+ outline: "bg-transparent border-green-500 text-green-700"
875
+ };
876
+ case "error":
877
+ return {
878
+ default: "bg-red-50 border-red-200 text-red-800",
879
+ filled: "bg-red-500 text-white",
880
+ outline: "bg-transparent border-red-500 text-red-700"
881
+ };
882
+ case "warning":
883
+ return {
884
+ default: "bg-yellow-50 border-yellow-200 text-yellow-800",
885
+ filled: "bg-yellow-500 text-white",
886
+ outline: "bg-transparent border-yellow-500 text-yellow-700"
887
+ };
888
+ case "info":
889
+ return {
890
+ default: "bg-blue-50 border-blue-200 text-blue-800",
891
+ filled: "bg-blue-500 text-white",
892
+ outline: "bg-transparent border-blue-500 text-blue-700"
893
+ };
894
+ default:
895
+ return {
896
+ default: "bg-blue-50 border-blue-200 text-blue-800",
897
+ filled: "bg-blue-500 text-white",
898
+ outline: "bg-transparent border-blue-500 text-blue-700"
899
+ };
900
+ }
901
+ };
902
+ const typeClasses = getTypeClasses()[variant];
903
+ return /* @__PURE__ */ jsx(
904
+ "div",
905
+ {
906
+ className: cn(
907
+ "rounded-[6px] border p-4",
908
+ typeClasses,
909
+ className
910
+ ),
911
+ role: "alert",
912
+ children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
913
+ /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 mt-0.5", children: getIcon() }),
914
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
915
+ title && /* @__PURE__ */ jsx(Typography_default, { variant: "h4", className: "text-sm font-medium mb-1", children: title }),
916
+ message && /* @__PURE__ */ jsx(Typography_default, { variant: "p", className: "text-sm leading-relaxed", children: message }),
917
+ children
918
+ ] }),
919
+ showCloseButton && onClose && /* @__PURE__ */ jsx(
920
+ "button",
921
+ {
922
+ onClick: onClose,
923
+ className: "flex-shrink-0 ml-2 text-current opacity-70 hover:opacity-100 transition-opacity",
924
+ children: /* @__PURE__ */ jsx(XIcon, { size: 16 })
925
+ }
926
+ )
927
+ ] })
928
+ }
929
+ );
930
+ };
931
+ var Alert_default = Alert;
932
+ var Modal = ({
933
+ isOpen,
934
+ onClose,
935
+ title,
936
+ children,
937
+ size = "md",
938
+ showCloseButton = true,
939
+ closeOnOverlayClick = true,
940
+ closeOnEscape = true,
941
+ className
942
+ }) => {
943
+ useEffect(() => {
944
+ if (!isOpen) return;
945
+ const handleEscape = (e) => {
946
+ if (e.key === "Escape" && closeOnEscape) {
947
+ onClose();
948
+ }
949
+ };
950
+ document.addEventListener("keydown", handleEscape);
951
+ document.body.style.overflow = "hidden";
952
+ return () => {
953
+ document.removeEventListener("keydown", handleEscape);
954
+ document.body.style.overflow = "unset";
955
+ };
956
+ }, [isOpen, onClose, closeOnEscape]);
957
+ if (!isOpen) return null;
958
+ const sizeClasses = {
959
+ sm: "max-w-sm",
960
+ md: "max-w-md",
961
+ lg: "max-w-lg",
962
+ xl: "max-w-xl",
963
+ full: "max-w-full mx-4"
964
+ };
965
+ const handleOverlayClick = (e) => {
966
+ if (e.target === e.currentTarget && closeOnOverlayClick) {
967
+ onClose();
968
+ }
969
+ };
970
+ return /* @__PURE__ */ jsx(
971
+ "div",
972
+ {
973
+ className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",
974
+ onClick: handleOverlayClick,
975
+ children: /* @__PURE__ */ jsxs(
976
+ "div",
977
+ {
978
+ className: cn(
979
+ "bg-secondary rounded-[6px] shadow-xl w-full mx-4 max-h-[90vh] overflow-hidden",
980
+ sizeClasses[size],
981
+ className
982
+ ),
983
+ children: [
984
+ (title || showCloseButton) && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-4 py-2 border-b border-surface-1", children: [
985
+ title && /* @__PURE__ */ jsx(
986
+ Typography_default,
987
+ {
988
+ variant: "h2",
989
+ className: "text-lg font-semibold text-neutral-500",
990
+ children: title
991
+ }
992
+ ),
993
+ showCloseButton && /* @__PURE__ */ jsx(
994
+ "button",
995
+ {
996
+ onClick: onClose,
997
+ className: "p-1 text-neutral-400 hover:text-neutral-600 transition-colors",
998
+ children: /* @__PURE__ */ jsx(XIcon, { size: 20 })
999
+ }
1000
+ )
1001
+ ] }),
1002
+ /* @__PURE__ */ jsx("div", { className: "px-4 py-2 overflow-y-auto max-h-[calc(90vh-120px)]", children })
1003
+ ]
1004
+ }
1005
+ )
1006
+ }
1007
+ );
1008
+ };
1009
+ var Modal_default = Modal;
1010
+ var Card = React20__default.forwardRef(
1011
+ ({
1012
+ className,
1013
+ variant = "default",
1014
+ padding = "md",
1015
+ children,
1016
+ ...props
1017
+ }, ref) => {
1018
+ const variantClasses = {
1019
+ default: "bg-secondary border border-surface-1",
1020
+ elevated: "bg-secondary border border-surface-1 shadow-lg",
1021
+ outlined: "bg-transparent border border-surface-1",
1022
+ filled: "bg-surface-4 border border-surface-4"
1023
+ };
1024
+ const paddingClasses = {
1025
+ none: "",
1026
+ sm: "p-3",
1027
+ md: "p-4",
1028
+ lg: "p-6"
1029
+ };
1030
+ return /* @__PURE__ */ jsx(
1031
+ "div",
1032
+ {
1033
+ ref,
1034
+ className: cn(
1035
+ "rounded-[6px] transition-all duration-200",
1036
+ variantClasses[variant],
1037
+ paddingClasses[padding],
1038
+ className
1039
+ ),
1040
+ ...props,
1041
+ children
1042
+ }
1043
+ );
1044
+ }
1045
+ );
1046
+ Card.displayName = "Card";
1047
+ var Card_default = Card;
1048
+ var Badge = React20__default.forwardRef(
1049
+ ({
1050
+ className,
1051
+ variant = "default",
1052
+ size = "md",
1053
+ rounded = "md",
1054
+ children,
1055
+ ...props
1056
+ }, ref) => {
1057
+ const variantClasses = {
1058
+ default: "bg-surface-3 text-neutral-400",
1059
+ primary: "bg-brand-color text-neutral-500",
1060
+ success: "bg-green-500 text-white",
1061
+ warning: "bg-yellow-500 text-white",
1062
+ danger: "bg-red-500 text-white",
1063
+ info: "bg-blue-500 text-white"
1064
+ };
1065
+ const sizeClasses = {
1066
+ sm: "px-2 py-0.5 text-xs",
1067
+ md: "px-2.5 py-1 text-sm",
1068
+ lg: "px-3 py-1.5 text-base"
1069
+ };
1070
+ const roundedClasses = {
1071
+ sm: "rounded-[6px]",
1072
+ md: "rounded-[6px]",
1073
+ lg: "rounded-[6px]",
1074
+ full: "rounded-full"
1075
+ };
1076
+ return /* @__PURE__ */ jsx(
1077
+ "span",
1078
+ {
1079
+ ref,
1080
+ className: cn(
1081
+ "inline-flex items-center font-medium",
1082
+ variantClasses[variant],
1083
+ sizeClasses[size],
1084
+ roundedClasses[rounded],
1085
+ className
1086
+ ),
1087
+ ...props,
1088
+ children
1089
+ }
1090
+ );
1091
+ }
1092
+ );
1093
+ Badge.displayName = "Badge";
1094
+ var Badge_default = Badge;
1095
+ var Avatar = ({
1096
+ src,
1097
+ alt = "Avatar",
1098
+ size = "md",
1099
+ fallback,
1100
+ className,
1101
+ onClick
1102
+ }) => {
1103
+ const [imgError, setImgError] = useState(false);
1104
+ const sizeClasses = {
1105
+ sm: "w-8 h-8 text-xs",
1106
+ md: "w-10 h-10 text-sm",
1107
+ lg: "w-12 h-12 text-base",
1108
+ xl: "w-16 h-16 text-lg"
1109
+ };
1110
+ const getInitials = (name) => {
1111
+ return name.split(" ").map((word) => word[0]).join("").toUpperCase().slice(0, 2);
1112
+ };
1113
+ const renderFallback = () => {
1114
+ if (fallback) {
1115
+ return /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center w-full h-full bg-surface-3 text-neutral-400 font-medium", children: getInitials(fallback) });
1116
+ }
1117
+ return /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center w-full h-full bg-surface-3 text-neutral-400", children: /* @__PURE__ */ jsx("svg", { className: "w-1/2 h-1/2", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ jsx(
1118
+ "path",
1119
+ {
1120
+ fillRule: "evenodd",
1121
+ d: "M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z",
1122
+ clipRule: "evenodd"
1123
+ }
1124
+ ) }) });
1125
+ };
1126
+ const handleImgError = useCallback(() => {
1127
+ setImgError(true);
1128
+ }, []);
1129
+ const isSrcAvailable = typeof src === "string" && src.trim() !== "";
1130
+ return /* @__PURE__ */ jsx(
1131
+ "div",
1132
+ {
1133
+ className: cn(
1134
+ "relative rounded-full overflow-hidden bg-surface-3",
1135
+ sizeClasses[size],
1136
+ className
1137
+ ),
1138
+ onClick,
1139
+ style: onClick ? { cursor: "pointer" } : void 0,
1140
+ children: isSrcAvailable && !imgError ? (
1141
+ // eslint-disable-next-line @next/next/no-img-element
1142
+ /* @__PURE__ */ jsx(
1143
+ "img",
1144
+ {
1145
+ src,
1146
+ alt,
1147
+ className: "object-cover",
1148
+ sizes: size === "sm" ? "32px" : size === "md" ? "40px" : size === "lg" ? "48px" : "64px",
1149
+ onError: handleImgError
1150
+ }
1151
+ )
1152
+ ) : renderFallback()
1153
+ }
1154
+ );
1155
+ };
1156
+ var Avatar_default = Avatar;
1157
+ var Divider = ({
1158
+ orientation = "horizontal",
1159
+ variant = "solid",
1160
+ size = "md",
1161
+ className
1162
+ }) => {
1163
+ const variantClasses = {
1164
+ solid: "border-solid",
1165
+ dashed: "border-dashed",
1166
+ dotted: "border-dotted"
1167
+ };
1168
+ const sizeClasses = {
1169
+ sm: orientation === "horizontal" ? "border-t" : "border-l",
1170
+ md: orientation === "horizontal" ? "border-t-2" : "border-l-2",
1171
+ lg: orientation === "horizontal" ? "border-t-4" : "border-l-4"
1172
+ };
1173
+ const orientationClasses = {
1174
+ horizontal: "w-full",
1175
+ vertical: "h-full"
1176
+ };
1177
+ return /* @__PURE__ */ jsx(
1178
+ "div",
1179
+ {
1180
+ className: cn(
1181
+ "border-surface-1",
1182
+ variantClasses[variant],
1183
+ sizeClasses[size],
1184
+ orientationClasses[orientation],
1185
+ className
1186
+ )
1187
+ }
1188
+ );
1189
+ };
1190
+ var Divider_default = Divider;
1191
+ var Tooltip = ({
1192
+ content,
1193
+ children,
1194
+ position = "top",
1195
+ delay = 200,
1196
+ className
1197
+ }) => {
1198
+ const [isVisible, setIsVisible] = useState(false);
1199
+ const [timeoutId, setTimeoutId] = useState(null);
1200
+ const showTooltip = () => {
1201
+ const id = setTimeout(() => setIsVisible(true), delay);
1202
+ setTimeoutId(id);
1203
+ };
1204
+ const hideTooltip = () => {
1205
+ if (timeoutId) {
1206
+ clearTimeout(timeoutId);
1207
+ }
1208
+ setIsVisible(false);
1209
+ };
1210
+ const positionClasses = {
1211
+ top: "bottom-full left-1/2 transform -translate-x-1/2 mb-2",
1212
+ bottom: "top-full left-1/2 transform -translate-x-1/2 mt-2",
1213
+ left: "right-full top-1/2 transform -translate-y-1/2 mr-2",
1214
+ right: "left-full top-1/2 transform -translate-y-1/2 ml-2"
1215
+ };
1216
+ const arrowClasses = {
1217
+ top: "top-full left-1/2 transform -translate-x-1/2 border-t-surface-1",
1218
+ bottom: "bottom-full left-1/2 transform -translate-x-1/2 border-b-surface-1",
1219
+ left: "left-full top-1/2 transform -translate-y-1/2 border-l-surface-1",
1220
+ right: "right-full top-1/2 transform -translate-y-1/2 border-r-surface-1"
1221
+ };
1222
+ return /* @__PURE__ */ jsxs(
1223
+ "div",
1224
+ {
1225
+ className: "relative inline-block",
1226
+ onMouseEnter: showTooltip,
1227
+ onMouseLeave: hideTooltip,
1228
+ children: [
1229
+ children,
1230
+ isVisible && /* @__PURE__ */ jsxs(
1231
+ "div",
1232
+ {
1233
+ className: cn(
1234
+ "absolute z-50 px-2 py-1 text-xs text-white bg-surface-1 rounded shadow-lg whitespace-nowrap",
1235
+ positionClasses[position],
1236
+ className
1237
+ ),
1238
+ children: [
1239
+ content,
1240
+ /* @__PURE__ */ jsx(
1241
+ "div",
1242
+ {
1243
+ className: cn(
1244
+ "absolute w-0 h-0 border-4 border-transparent",
1245
+ arrowClasses[position]
1246
+ )
1247
+ }
1248
+ )
1249
+ ]
1250
+ }
1251
+ )
1252
+ ]
1253
+ }
1254
+ );
1255
+ };
1256
+ var Tooltip_default = Tooltip;
1257
+ var globalKeyboardShortcuts = [
1258
+ { command: "focus_search", shortcut: ["ctrl", "k"] },
1259
+ { command: "escape_button_action", shortcut: ["escape"] }
1260
+ ];
1261
+ var keyMap = {
1262
+ windows: {
1263
+ ctrl: "Ctrl",
1264
+ alt: "Alt",
1265
+ shift: "Shift",
1266
+ meta: "Win",
1267
+ escape: "Esc",
1268
+ enter: "Enter",
1269
+ k: "K"
1270
+ },
1271
+ mac: {
1272
+ ctrl: "Ctrl",
1273
+ alt: "\u2325",
1274
+ shift: "\u21E7",
1275
+ meta: "\u2318",
1276
+ escape: "Esc",
1277
+ enter: "Enter",
1278
+ k: "K"
1279
+ },
1280
+ linux: {
1281
+ ctrl: "Ctrl",
1282
+ alt: "Alt",
1283
+ shift: "Shift",
1284
+ meta: "Meta",
1285
+ escape: "Esc",
1286
+ enter: "Enter",
1287
+ k: "K"
1288
+ }
1289
+ };
1290
+ var detectOS = () => {
1291
+ if (typeof navigator === "undefined") {
1292
+ return "windows";
1293
+ }
1294
+ const userAgent = navigator.userAgent.toLowerCase();
1295
+ if (userAgent.includes("mac")) return "mac";
1296
+ if (userAgent.includes("win")) return "windows";
1297
+ return "linux";
1298
+ };
1299
+ var matchShortcut = (event, shortcut, os) => {
1300
+ const normalizedShortcut = shortcut.map((key) => key.toLowerCase());
1301
+ const hasModifier = normalizedShortcut.includes("ctrl") ? event.ctrlKey : normalizedShortcut.includes("meta") ? event.metaKey : normalizedShortcut.includes("alt") ? event.altKey : true;
1302
+ if (!hasModifier) return false;
1303
+ const primaryKey = normalizedShortcut.find((key) => !["ctrl", "meta", "alt", "shift"].includes(key));
1304
+ if (!primaryKey) return normalizedShortcut.every((key) => {
1305
+ if (key === "ctrl") return event.ctrlKey;
1306
+ if (key === "meta") return event.metaKey;
1307
+ if (key === "alt") return event.altKey;
1308
+ if (key === "shift") return event.shiftKey;
1309
+ return false;
1310
+ });
1311
+ const matchesPrimaryKey = event.key.toLowerCase() === primaryKey;
1312
+ const shiftRequired = normalizedShortcut.includes("shift");
1313
+ const shiftMatches = shiftRequired ? event.shiftKey : true;
1314
+ return matchesPrimaryKey && shiftMatches;
1315
+ };
1316
+ var useShortcutFormatter = () => {
1317
+ const [os, setOS] = useState("windows");
1318
+ const listenersRef = useRef(/* @__PURE__ */ new Map());
1319
+ useEffect(() => {
1320
+ setOS(detectOS());
1321
+ }, []);
1322
+ useEffect(() => {
1323
+ const handleKeyDown = (event) => {
1324
+ for (const shortcut of globalKeyboardShortcuts) {
1325
+ if (matchShortcut(event, shortcut.shortcut)) {
1326
+ const listeners = listenersRef.current.get(shortcut.command);
1327
+ if (listeners) {
1328
+ event.preventDefault();
1329
+ listeners.forEach((cb) => cb(event));
1330
+ }
1331
+ }
1332
+ }
1333
+ };
1334
+ window.addEventListener("keydown", handleKeyDown);
1335
+ return () => {
1336
+ window.removeEventListener("keydown", handleKeyDown);
1337
+ };
1338
+ }, [os]);
1339
+ const formatKeys = (keys = []) => {
1340
+ return keys.map((key) => keyMap[os][key.toLowerCase()] || key.toUpperCase()).join(" + ");
1341
+ };
1342
+ const getShortcutByCommand = (command) => {
1343
+ const found = globalKeyboardShortcuts.find((shortcut) => shortcut.command === command);
1344
+ return found ? found.shortcut : [""];
1345
+ };
1346
+ const addShortcutListener = (command, listener) => {
1347
+ if (!listenersRef.current.has(command)) {
1348
+ listenersRef.current.set(command, /* @__PURE__ */ new Set());
1349
+ }
1350
+ listenersRef.current.get(command).add(listener);
1351
+ };
1352
+ const removeShortcutListener = (command, listener) => {
1353
+ if (listenersRef.current.has(command)) {
1354
+ listenersRef.current.get(command).delete(listener);
1355
+ }
1356
+ };
1357
+ return {
1358
+ formatKeys,
1359
+ getShortcutByCommand,
1360
+ addShortcutListener,
1361
+ removeShortcutListener
1362
+ };
1363
+ };
1364
+ var useShortcutFormatter_default = useShortcutFormatter;
1365
+ var SearchInput = React20__default.forwardRef(
1366
+ ({
1367
+ onSearch,
1368
+ placeholder = "Search...",
1369
+ variant = "default",
1370
+ size = "md",
1371
+ showClearButton = true,
1372
+ className,
1373
+ value,
1374
+ onChange,
1375
+ enableKeyboardShortcuts = false,
1376
+ isActive = true,
1377
+ ...props
1378
+ }, ref) => {
1379
+ const [searchValue, setSearchValue] = React20__default.useState(value || "");
1380
+ const inputRef = useRef(null);
1381
+ useImperativeHandle(ref, () => inputRef.current);
1382
+ const { addShortcutListener, removeShortcutListener, formatKeys, getShortcutByCommand } = useShortcutFormatter_default();
1383
+ const handleChange = (e) => {
1384
+ const newValue = e.target.value;
1385
+ setSearchValue(newValue);
1386
+ onChange?.(e);
1387
+ onSearch?.(newValue);
1388
+ };
1389
+ const handleClear = useCallback(() => {
1390
+ setSearchValue("");
1391
+ onSearch?.("");
1392
+ const syntheticEvent = {
1393
+ target: { value: "" }
1394
+ };
1395
+ onChange?.(syntheticEvent);
1396
+ }, [onChange, onSearch]);
1397
+ useEffect(() => {
1398
+ if (!enableKeyboardShortcuts || !isActive) return;
1399
+ const handleFocusSearch = (e) => {
1400
+ e?.preventDefault();
1401
+ inputRef.current?.focus();
1402
+ };
1403
+ const handleClearShortcut = (e) => {
1404
+ e?.preventDefault();
1405
+ handleClear();
1406
+ inputRef.current?.blur();
1407
+ };
1408
+ addShortcutListener("focus_search", handleFocusSearch);
1409
+ addShortcutListener("escape_button_action", handleClearShortcut);
1410
+ return () => {
1411
+ removeShortcutListener("focus_search", handleFocusSearch);
1412
+ removeShortcutListener("escape_button_action", handleClearShortcut);
1413
+ };
1414
+ }, [enableKeyboardShortcuts, isActive, handleClear, addShortcutListener, removeShortcutListener]);
1415
+ const displayPlaceholder = enableKeyboardShortcuts ? `${placeholder} (${formatKeys(getShortcutByCommand("focus_search"))})` : placeholder;
1416
+ const baseClasses = "transition-all duration-200 focus:outline-none placeholder:text-neutral-300 rounded-[6px]";
1417
+ const variantClasses = {
1418
+ default: "bg-primary border border-surface-1 focus:border-brand-color focus:ring-1 focus:ring-brand-color/50",
1419
+ filled: "bg-surface-4 border border-surface-4 focus:border-brand-color focus:ring-1 focus:ring-brand-color/50",
1420
+ outline: "bg-transparent border border-surface-1 focus:border-brand-color focus:ring-1 focus:ring-brand-color/50"
1421
+ };
1422
+ const sizeClasses = {
1423
+ sm: "h-8 px-2 pl-8 text-sm",
1424
+ md: "h-10 px-3 pl-10 text-base",
1425
+ lg: "h-12 px-4 pl-12 text-lg"
1426
+ };
1427
+ const iconSizeClasses = {
1428
+ sm: "w-4 h-4",
1429
+ md: "w-5 h-5",
1430
+ lg: "w-6 h-6"
1431
+ };
1432
+ return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
1433
+ /* @__PURE__ */ jsx("div", { className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-neutral-400", children: /* @__PURE__ */ jsx(MagnifyingGlassIcon, { className: iconSizeClasses[size] }) }),
1434
+ /* @__PURE__ */ jsx(
1435
+ "input",
1436
+ {
1437
+ ref: inputRef,
1438
+ type: "text",
1439
+ placeholder: displayPlaceholder,
1440
+ value: searchValue,
1441
+ onChange: handleChange,
1442
+ className: cn(
1443
+ baseClasses,
1444
+ variantClasses[variant],
1445
+ sizeClasses[size],
1446
+ showClearButton && searchValue ? "pr-10" : "",
1447
+ className
1448
+ ),
1449
+ ...props
1450
+ }
1451
+ ),
1452
+ showClearButton && searchValue && /* @__PURE__ */ jsx(
1453
+ "button",
1454
+ {
1455
+ onClick: handleClear,
1456
+ className: "absolute right-3 top-1/2 transform -translate-y-1/2 text-neutral-400 hover:text-neutral-600 transition-colors",
1457
+ children: /* @__PURE__ */ jsx("svg", { className: iconSizeClasses[size], fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
1458
+ }
1459
+ )
1460
+ ] });
1461
+ }
1462
+ );
1463
+ SearchInput.displayName = "SearchInput";
1464
+ var SearchInput_default = SearchInput;
1465
+ var FileUpload = ({
1466
+ onFileSelect,
1467
+ accept,
1468
+ multiple = false,
1469
+ maxSize,
1470
+ variant = "default",
1471
+ size = "md",
1472
+ disabled = false,
1473
+ className,
1474
+ children,
1475
+ dragAndDrop = false
1476
+ }) => {
1477
+ const fileInputRef = useRef(null);
1478
+ const [isDragOver, setIsDragOver] = React20__default.useState(false);
1479
+ const handleFileSelect = (files) => {
1480
+ if (!files) return;
1481
+ const fileArray = Array.from(files);
1482
+ if (maxSize) {
1483
+ const validFiles = fileArray.filter((file) => file.size <= maxSize);
1484
+ if (validFiles.length !== fileArray.length) {
1485
+ console.warn("Some files were too large and were skipped");
1486
+ }
1487
+ onFileSelect?.(validFiles);
1488
+ } else {
1489
+ onFileSelect?.(fileArray);
1490
+ }
1491
+ };
1492
+ const handleInputChange = (e) => {
1493
+ handleFileSelect(e.target.files);
1494
+ };
1495
+ const handleClick = () => {
1496
+ if (!disabled) {
1497
+ fileInputRef.current?.click();
1498
+ }
1499
+ };
1500
+ const handleDragOver = (e) => {
1501
+ e.preventDefault();
1502
+ if (dragAndDrop && !disabled) {
1503
+ setIsDragOver(true);
1504
+ }
1505
+ };
1506
+ const handleDragLeave = (e) => {
1507
+ e.preventDefault();
1508
+ setIsDragOver(false);
1509
+ };
1510
+ const handleDrop = (e) => {
1511
+ e.preventDefault();
1512
+ setIsDragOver(false);
1513
+ if (dragAndDrop && !disabled) {
1514
+ handleFileSelect(e.dataTransfer.files);
1515
+ }
1516
+ };
1517
+ const baseClasses = "transition-all duration-200 focus:outline-none cursor-pointer rounded-[6px]";
1518
+ const variantClasses = {
1519
+ default: "bg-primary border border-surface-1 focus:border-brand-color focus:ring-1 focus:ring-brand-color/50",
1520
+ filled: "bg-surface-4 border border-surface-4 focus:border-brand-color focus:ring-1 focus:ring-brand-color/50",
1521
+ outline: "bg-transparent border border-surface-1 focus:border-brand-color focus:ring-1 focus:ring-brand-color/50"
1522
+ };
1523
+ const sizeClasses = {
1524
+ sm: "h-20 px-3 text-sm",
1525
+ md: "h-24 px-4 text-base",
1526
+ lg: "h-32 px-6 text-lg"
1527
+ };
1528
+ const defaultContent = /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center h-full text-center", children: [
1529
+ /* @__PURE__ */ jsx(UploadIcon, { size: 24, className: "text-neutral-400 mb-2" }),
1530
+ /* @__PURE__ */ jsx(Typography_default, { variant: "p", className: "text-sm text-neutral-400", children: dragAndDrop ? "Drag and drop files here" : "Click to upload files" }),
1531
+ accept && /* @__PURE__ */ jsxs(Typography_default, { variant: "p", className: "text-xs text-neutral-300 mt-1", children: [
1532
+ "Accepted: ",
1533
+ accept
1534
+ ] })
1535
+ ] });
1536
+ return /* @__PURE__ */ jsxs(
1537
+ "div",
1538
+ {
1539
+ onClick: handleClick,
1540
+ onDragOver: handleDragOver,
1541
+ onDragLeave: handleDragLeave,
1542
+ onDrop: handleDrop,
1543
+ className: cn(
1544
+ baseClasses,
1545
+ variantClasses[variant],
1546
+ sizeClasses[size],
1547
+ "w-full rounded-[6px] border-2 border-dashed flex items-center justify-center",
1548
+ isDragOver && "border-brand-color bg-brand-color/10",
1549
+ disabled && "opacity-50 cursor-not-allowed",
1550
+ className
1551
+ ),
1552
+ children: [
1553
+ /* @__PURE__ */ jsx(
1554
+ "input",
1555
+ {
1556
+ ref: fileInputRef,
1557
+ type: "file",
1558
+ accept,
1559
+ multiple,
1560
+ onChange: handleInputChange,
1561
+ className: "hidden",
1562
+ disabled
1563
+ }
1564
+ ),
1565
+ children || defaultContent
1566
+ ]
1567
+ }
1568
+ );
1569
+ };
1570
+ var FileUpload_default = FileUpload;
1571
+ var Progress = ({
1572
+ value,
1573
+ max = 100,
1574
+ variant = "default",
1575
+ size = "md",
1576
+ showLabel = false,
1577
+ animated = false,
1578
+ className
1579
+ }) => {
1580
+ const percentage = Math.min(Math.max(value / max * 100, 0), 100);
1581
+ const variantClasses = {
1582
+ default: "bg-brand-color",
1583
+ success: "bg-green-500",
1584
+ warning: "bg-yellow-500",
1585
+ danger: "bg-red-500"
1586
+ };
1587
+ const sizeClasses = {
1588
+ sm: "h-1",
1589
+ md: "h-2",
1590
+ lg: "h-3"
1591
+ };
1592
+ const labelSizeClasses = {
1593
+ sm: "text-xs",
1594
+ md: "text-sm",
1595
+ lg: "text-base"
1596
+ };
1597
+ return /* @__PURE__ */ jsx("div", { className: cn("w-full", className), children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1598
+ /* @__PURE__ */ jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsx(
1599
+ "div",
1600
+ {
1601
+ className: cn(
1602
+ "w-full bg-surface-3 rounded-[6px] overflow-hidden",
1603
+ sizeClasses[size]
1604
+ ),
1605
+ children: /* @__PURE__ */ jsx(
1606
+ "div",
1607
+ {
1608
+ className: cn(
1609
+ "h-full rounded-[6px] transition-all duration-300",
1610
+ variantClasses[variant],
1611
+ animated && "animate-pulse"
1612
+ ),
1613
+ style: { width: `${percentage}%` }
1614
+ }
1615
+ )
1616
+ }
1617
+ ) }),
1618
+ showLabel && /* @__PURE__ */ jsxs("span", { className: cn("text-neutral-400 font-medium", labelSizeClasses[size]), children: [
1619
+ Math.round(percentage),
1620
+ "%"
1621
+ ] })
1622
+ ] }) });
1623
+ };
1624
+ var Progress_default = Progress;
1625
+ var Pagination = ({
1626
+ currentPage,
1627
+ totalPages,
1628
+ onPageChange,
1629
+ showFirstLast = true,
1630
+ showPrevNext = true,
1631
+ maxVisiblePages = 5,
1632
+ size = "md",
1633
+ variant = "default",
1634
+ className
1635
+ }) => {
1636
+ const getVisiblePages = () => {
1637
+ const pages = [];
1638
+ const halfVisible = Math.floor(maxVisiblePages / 2);
1639
+ if (totalPages <= maxVisiblePages) {
1640
+ for (let i = 1; i <= totalPages; i++) {
1641
+ pages.push(i);
1642
+ }
1643
+ } else {
1644
+ let start = Math.max(1, currentPage - halfVisible);
1645
+ const end = Math.min(totalPages, start + maxVisiblePages - 1);
1646
+ if (end - start + 1 < maxVisiblePages) {
1647
+ start = Math.max(1, end - maxVisiblePages + 1);
1648
+ }
1649
+ if (start > 1) {
1650
+ pages.push(1);
1651
+ if (start > 2) {
1652
+ pages.push("...");
1653
+ }
1654
+ }
1655
+ for (let i = start; i <= end; i++) {
1656
+ pages.push(i);
1657
+ }
1658
+ if (end < totalPages) {
1659
+ if (end < totalPages - 1) {
1660
+ pages.push("...");
1661
+ }
1662
+ pages.push(totalPages);
1663
+ }
1664
+ }
1665
+ return pages;
1666
+ };
1667
+ const handlePageClick = (page) => {
1668
+ if (typeof page === "number") {
1669
+ onPageChange(page);
1670
+ }
1671
+ };
1672
+ const sizeClasses = {
1673
+ sm: "h-8 px-2 text-sm",
1674
+ md: "h-10 px-3 text-base",
1675
+ lg: "h-12 px-4 text-lg"
1676
+ };
1677
+ const variantClasses = {
1678
+ default: "bg-primary border border-surface-1 hover:bg-surface-3",
1679
+ outline: "bg-transparent border border-surface-1 hover:bg-surface-3"
1680
+ };
1681
+ const activeClasses = {
1682
+ default: "bg-brand-color text-neutral-500 border-brand-color",
1683
+ outline: "bg-brand-color text-neutral-500 border-brand-color"
1684
+ };
1685
+ const renderPageButton = (page, index) => {
1686
+ if (page === "...") {
1687
+ return /* @__PURE__ */ jsx(
1688
+ "span",
1689
+ {
1690
+ className: cn(
1691
+ "flex items-center justify-center",
1692
+ sizeClasses[size],
1693
+ "text-neutral-400"
1694
+ ),
1695
+ children: "..."
1696
+ },
1697
+ `ellipsis-${index}`
1698
+ );
1699
+ }
1700
+ const isActive = page === currentPage;
1701
+ return /* @__PURE__ */ jsx(
1702
+ "button",
1703
+ {
1704
+ onClick: () => handlePageClick(page),
1705
+ className: cn(
1706
+ "flex items-center justify-center font-medium transition-all duration-200 rounded-[6px]",
1707
+ sizeClasses[size],
1708
+ variantClasses[variant],
1709
+ isActive ? activeClasses[variant] : "text-neutral-400",
1710
+ !isActive && "hover:text-neutral-500"
1711
+ ),
1712
+ children: page
1713
+ },
1714
+ page
1715
+ );
1716
+ };
1717
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center justify-center gap-1", className), children: [
1718
+ showFirstLast && currentPage > 1 && /* @__PURE__ */ jsx(
1719
+ "button",
1720
+ {
1721
+ onClick: () => onPageChange(1),
1722
+ className: cn(
1723
+ "flex items-center justify-center font-medium transition-all duration-200 rounded-[6px]",
1724
+ sizeClasses[size],
1725
+ variantClasses[variant],
1726
+ "text-neutral-400 hover:text-neutral-500"
1727
+ ),
1728
+ children: "First"
1729
+ }
1730
+ ),
1731
+ showPrevNext && currentPage > 1 && /* @__PURE__ */ jsx(
1732
+ "button",
1733
+ {
1734
+ onClick: () => onPageChange(currentPage - 1),
1735
+ className: cn(
1736
+ "flex items-center justify-center font-medium transition-all duration-200 rounded-[6px]",
1737
+ sizeClasses[size],
1738
+ variantClasses[variant],
1739
+ "text-neutral-400 hover:text-neutral-500"
1740
+ ),
1741
+ children: /* @__PURE__ */ jsx(CaretLeftIcon, { size: 16 })
1742
+ }
1743
+ ),
1744
+ getVisiblePages().map((page, index) => renderPageButton(page, index)),
1745
+ showPrevNext && currentPage < totalPages && /* @__PURE__ */ jsx(
1746
+ "button",
1747
+ {
1748
+ onClick: () => onPageChange(currentPage + 1),
1749
+ className: cn(
1750
+ "flex items-center justify-center font-medium transition-all duration-200 rounded-[6px]",
1751
+ sizeClasses[size],
1752
+ variantClasses[variant],
1753
+ "text-neutral-400 hover:text-neutral-500"
1754
+ ),
1755
+ children: /* @__PURE__ */ jsx(CaretRightIcon, { size: 16 })
1756
+ }
1757
+ ),
1758
+ showFirstLast && currentPage < totalPages && /* @__PURE__ */ jsx(
1759
+ "button",
1760
+ {
1761
+ onClick: () => onPageChange(totalPages),
1762
+ className: cn(
1763
+ "flex items-center justify-center font-medium transition-all duration-200 rounded-[6px]",
1764
+ sizeClasses[size],
1765
+ variantClasses[variant],
1766
+ "text-neutral-400 hover:text-neutral-500"
1767
+ ),
1768
+ children: "Last"
1769
+ }
1770
+ )
1771
+ ] });
1772
+ };
1773
+ var Pagination_default = Pagination;
1774
+ var Radio = React20__default.forwardRef(
1775
+ ({
1776
+ className,
1777
+ label,
1778
+ size = "md",
1779
+ variant = "default",
1780
+ error,
1781
+ helperText,
1782
+ ...props
1783
+ }, ref) => {
1784
+ const baseClasses = "transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 cursor-pointer rounded-[6px]";
1785
+ const variantClasses = {
1786
+ default: "bg-primary border border-surface-1 focus:border-brand-color focus:ring-brand-color/50 checked:bg-brand-color checked:border-brand-color",
1787
+ filled: "bg-surface-4 border border-surface-4 focus:border-brand-color focus:ring-brand-color/50 checked:bg-brand-color checked:border-brand-color"
1788
+ };
1789
+ const sizeClasses = {
1790
+ sm: "w-4 h-4",
1791
+ md: "w-5 h-5",
1792
+ lg: "w-6 h-6"
1793
+ };
1794
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
1795
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2", children: [
1796
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
1797
+ /* @__PURE__ */ jsx(
1798
+ "input",
1799
+ {
1800
+ ref,
1801
+ type: "radio",
1802
+ className: cn(
1803
+ baseClasses,
1804
+ variantClasses[variant],
1805
+ sizeClasses[size],
1806
+ "appearance-none",
1807
+ error && "border-red-500 focus:border-red-500 focus:ring-red-500/50",
1808
+ className
1809
+ ),
1810
+ ...props
1811
+ }
1812
+ ),
1813
+ /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center pointer-events-none", children: /* @__PURE__ */ jsx("div", { className: "w-1/2 h-1/2 bg-white rounded-full opacity-0 checked:opacity-100" }) })
1814
+ ] }),
1815
+ label && /* @__PURE__ */ jsx("label", { className: "text-sm text-neutral-400 cursor-pointer select-none", children: label })
1816
+ ] }),
1817
+ (error || helperText) && /* @__PURE__ */ jsxs("div", { className: "mt-1 ml-6", children: [
1818
+ error && /* @__PURE__ */ jsx(Typography_default, { variant: "p", className: "text-xs text-red-500", children: error }),
1819
+ helperText && !error && /* @__PURE__ */ jsx(Typography_default, { variant: "p", className: "text-xs text-neutral-400", children: helperText })
1820
+ ] })
1821
+ ] });
1822
+ }
1823
+ );
1824
+ Radio.displayName = "Radio";
1825
+ var Radio_default = Radio;
1826
+ var Accordion = ({ items, active = -1 }) => {
1827
+ const [activeIndex, setActiveIndex] = useState(active);
1828
+ const toggleAccordion = (index) => {
1829
+ setActiveIndex(activeIndex === index ? null : index);
1830
+ };
1831
+ return /* @__PURE__ */ jsx("div", { className: "w-full space-y-[12px]", children: items.map((item, index) => /* @__PURE__ */ jsxs(
1832
+ "div",
1833
+ {
1834
+ className: "border border-surface-1 mx-[10px] rounded-[6px]",
1835
+ children: [
1836
+ /* @__PURE__ */ jsxs(
1837
+ "button",
1838
+ {
1839
+ onClick: () => toggleAccordion(index),
1840
+ className: "w-full text-left px-[12px] py-[10px] bg-surface-4 flex justify-between items-center focus:outline-none",
1841
+ children: [
1842
+ /* @__PURE__ */ jsx("span", { className: "font-medium text-neutral-400 text-[13px]", children: item.title }),
1843
+ /* @__PURE__ */ jsx("span", { className: "flex flex-row gap-[16px]", children: activeIndex === index ? /* @__PURE__ */ jsx(CaretUpIcon, { size: 18 }) : /* @__PURE__ */ jsx(CaretDownIcon, { size: 18 }) })
1844
+ ]
1845
+ }
1846
+ ),
1847
+ /* @__PURE__ */ jsx(
1848
+ "div",
1849
+ {
1850
+ className: `overflow-hidden transition-all duration-300 ${activeIndex === index ? "px-[12px] py-[12px]" : "max-h-0"}`,
1851
+ children: item.content
1852
+ }
1853
+ )
1854
+ ]
1855
+ },
1856
+ index
1857
+ )) });
1858
+ };
1859
+ var Accordion_default = Accordion;
1860
+ var Tabs = ({
1861
+ tabs,
1862
+ defaultActiveTab = 0,
1863
+ onTabChange,
1864
+ containerClassName = "flex w-full border border-border-1 rounded-[6px] mt-[16px]",
1865
+ buttonClassName = "flex items-center gap-1 px-[8px] py-[2px] text-[13px] cursor-pointer transition-all duration-300 text-neutral-300 rounded-[6px] m-[8px]",
1866
+ activeButtonClassName = "bg-surface-3 text-neutral-400"
1867
+ }) => {
1868
+ const [activeTab, setActiveTab] = useState(defaultActiveTab);
1869
+ useEffect(() => {
1870
+ setActiveTab(defaultActiveTab);
1871
+ }, [defaultActiveTab]);
1872
+ const handleTabClick = (index) => {
1873
+ setActiveTab(index);
1874
+ if (onTabChange) {
1875
+ onTabChange(index);
1876
+ }
1877
+ };
1878
+ return /* @__PURE__ */ jsxs("div", { className: "w-full", children: [
1879
+ /* @__PURE__ */ jsx("div", { className: containerClassName, children: tabs.map((tab, index) => /* @__PURE__ */ jsxs(
1880
+ "div",
1881
+ {
1882
+ className: `${buttonClassName} ${activeTab === index ? activeButtonClassName : ""}`,
1883
+ onClick: () => handleTabClick(index),
1884
+ children: [
1885
+ tab.icon,
1886
+ /* @__PURE__ */ jsx("span", { children: tab.label })
1887
+ ]
1888
+ },
1889
+ index
1890
+ )) }),
1891
+ /* @__PURE__ */ jsx("div", { className: "w-full mt-4 flex flex-col gap-4", children: tabs[activeTab].content })
1892
+ ] });
1893
+ };
1894
+ var Tabs_default = Tabs;
1895
+ var Table = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsx(
1896
+ "table",
1897
+ {
1898
+ ref,
1899
+ className: cn("w-full caption-bottom text-[13px]", className),
1900
+ ...props
1901
+ }
1902
+ ) }));
1903
+ Table.displayName = "Table";
1904
+ var TableHeader = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("thead", { ref, className: cn("[&_tr]:border-b text-neutral-400 bg-surface-2", className), ...props }));
1905
+ TableHeader.displayName = "TableHeader";
1906
+ var TableBody = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1907
+ "tbody",
1908
+ {
1909
+ ref,
1910
+ className: cn("[&_tr:last-child]:border-0 text-neutral-300", className),
1911
+ ...props
1912
+ }
1913
+ ));
1914
+ TableBody.displayName = "TableBody";
1915
+ var TableFooter = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1916
+ "tfoot",
1917
+ {
1918
+ ref,
1919
+ className: cn(
1920
+ "border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
1921
+ className
1922
+ ),
1923
+ ...props
1924
+ }
1925
+ ));
1926
+ TableFooter.displayName = "TableFooter";
1927
+ var TableRow = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1928
+ "tr",
1929
+ {
1930
+ ref,
1931
+ className: cn(
1932
+ "border-t border-surface-1 group hover:bg-surface-4 hover:text-neutral-500 cursor-pointer",
1933
+ className
1934
+ ),
1935
+ ...props
1936
+ }
1937
+ ));
1938
+ TableRow.displayName = "TableRow";
1939
+ var TableHead = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1940
+ "th",
1941
+ {
1942
+ ref,
1943
+ className: cn(
1944
+ "py-[4px] px-[8px] font-medium",
1945
+ className
1946
+ ),
1947
+ ...props
1948
+ }
1949
+ ));
1950
+ TableHead.displayName = "TableHead";
1951
+ var TableCell = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1952
+ "td",
1953
+ {
1954
+ ref,
1955
+ className: cn("py-[6px] px-[8px]", className),
1956
+ ...props
1957
+ }
1958
+ ));
1959
+ TableCell.displayName = "TableCell";
1960
+ var TableCaption = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1961
+ "caption",
1962
+ {
1963
+ ref,
1964
+ className: cn("mt-4 text-sm text-muted-foreground", className),
1965
+ ...props
1966
+ }
1967
+ ));
1968
+ TableCaption.displayName = "TableCaption";
1969
+
1970
+ export { Accordion_default as Accordion, Alert_default as Alert, Avatar_default as Avatar, Badge_default as Badge, Button_default as Button, Card_default as Card, Checkbox_default as Checkbox, Divider_default as Divider, Dropdown_default as Dropdown, FileUpload_default as FileUpload, ImageWithPlaceholder_default as ImageWithPlaceholder, Input_default as Input, Loading_default as Loading, Modal_default as Modal, Pagination_default as Pagination, Progress_default as Progress, Radio_default as Radio, SearchInput_default as SearchInput, Select_default as Select, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs_default as Tabs, TextArea_default as TextArea, Toast_default as Toast, Toggle_default as Toggle, Tooltip_default as Tooltip, Typography_default as Typography, cn, useShortcutFormatter_default as useShortcutFormatter };
1971
+ //# sourceMappingURL=index.js.map
1972
+ //# sourceMappingURL=index.js.map