atomos_next_genesis 0.0.3-alpha → 0.0.5

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 CHANGED
@@ -1,20 +1,47 @@
1
- // app/components/Accordian.tsx
2
- import React2, { useState } from "react";
1
+ // app/components/Accordion.tsx
2
+ import React2, { useState, useEffect } from "react";
3
+ import { RiArrowDownSLine } from "@remixicon/react";
3
4
 
4
5
  // app/utils/utils.tsx
5
6
  import clsx from "clsx";
6
7
  import { twMerge } from "tailwind-merge";
7
8
  var cn = (...classes) => twMerge(clsx(...classes));
8
9
 
9
- // app/components/Accordian.tsx
10
- import { RiArrowDownSLine } from "@remixicon/react";
10
+ // app/components/Accordion.tsx
11
11
  function Accordion({
12
12
  type = "single",
13
13
  collapsible = true,
14
14
  className,
15
- children
15
+ children,
16
+ expanded
16
17
  }) {
17
- const [openItems, setOpenItems] = useState([]);
18
+ const [openItems, setOpenItems] = useState(() => {
19
+ const defaultOpen = [];
20
+ React2.Children.forEach(children, (child) => {
21
+ if (React2.isValidElement(child)) {
22
+ const triggerChild = React2.Children.toArray(child.props.children)[0];
23
+ if (React2.isValidElement(triggerChild) && triggerChild.props.defaultOpen) {
24
+ defaultOpen.push(child.props.value);
25
+ }
26
+ }
27
+ });
28
+ return defaultOpen;
29
+ });
30
+ useEffect(() => {
31
+ if (expanded !== void 0) {
32
+ if (expanded) {
33
+ const allValues = [];
34
+ React2.Children.forEach(children, (child) => {
35
+ if (React2.isValidElement(child)) {
36
+ allValues.push(child.props.value);
37
+ }
38
+ });
39
+ setOpenItems(allValues);
40
+ } else {
41
+ setOpenItems([]);
42
+ }
43
+ }
44
+ }, [expanded, children]);
18
45
  const handleToggle = (value) => {
19
46
  if (type === "single") {
20
47
  setOpenItems(
@@ -26,7 +53,7 @@ function Accordion({
26
53
  );
27
54
  }
28
55
  };
29
- return /* @__PURE__ */ React2.createElement("div", { className }, React2.Children.map(children, (child) => {
56
+ return /* @__PURE__ */ React2.createElement("div", { className, role: "region", "aria-label": "Accordion" }, React2.Children.map(children, (child) => {
30
57
  if (React2.isValidElement(child)) {
31
58
  return React2.cloneElement(
32
59
  child,
@@ -48,6 +75,8 @@ function AccordionItem({
48
75
  className
49
76
  }) {
50
77
  const isOpen = openItems == null ? void 0 : openItems.includes(value);
78
+ const headerId = `accordion-header-${value}`;
79
+ const contentId = `accordion-content-${value}`;
51
80
  const toggle = () => {
52
81
  if (!disabled && handleToggle) {
53
82
  handleToggle(value);
@@ -57,55 +86,79 @@ function AccordionItem({
57
86
  "div",
58
87
  {
59
88
  className: cn(
60
- "bg-white hover:bg-gray-50 rounded-lg shadow transition-all duration-300 ease-in-out",
61
- disabled ? "opacity-50 pointer-events-none select-none" : "cursor-pointer",
62
- isOpen ? "border border-gray-300" : "border",
89
+ "bg-white rounded-lg shadow transition-all duration-300 ease-in-out border",
90
+ disabled && "opacity-50 pointer-events-none select-none",
91
+ isOpen && "border-gray-300",
63
92
  className
64
93
  )
65
94
  },
66
- /* @__PURE__ */ React2.createElement(
95
+ children && Array.isArray(children) ? /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(
67
96
  "div",
68
97
  {
69
- className: "font-semibold transition-all duration-300 ease-in-out",
70
- onClick: toggle
71
- },
72
- children && Array.isArray(children) ? /* @__PURE__ */ React2.createElement(React2.Fragment, null, React2.cloneElement(children[0], { isOpen }), /* @__PURE__ */ React2.createElement(
73
- "div",
74
- {
75
- className: cn(
76
- "grid transition-all duration-300 ease-in-out",
77
- isOpen ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0"
78
- )
98
+ onClick: toggle,
99
+ onKeyDown: (e) => {
100
+ if (e.key === "Enter" || e.key === " ") {
101
+ e.preventDefault();
102
+ toggle();
103
+ }
79
104
  },
80
- /* @__PURE__ */ React2.createElement("div", { className: "overflow-hidden" }, /* @__PURE__ */ React2.createElement("div", { className: cn("") }, children[1]))
81
- )) : children
82
- )
105
+ role: "button",
106
+ tabIndex: disabled ? -1 : 0,
107
+ "aria-expanded": isOpen,
108
+ "aria-disabled": disabled,
109
+ "aria-controls": contentId,
110
+ id: headerId,
111
+ className: "cursor-pointer"
112
+ },
113
+ React2.cloneElement(children[0], { isOpen })
114
+ ), /* @__PURE__ */ React2.createElement(
115
+ "div",
116
+ {
117
+ id: contentId,
118
+ role: "region",
119
+ "aria-labelledby": headerId,
120
+ className: cn(
121
+ "transition-all duration-300 ease-in-out overflow-hidden",
122
+ isOpen ? "max-h-[1000px] opacity-100" : "max-h-0 opacity-0"
123
+ ),
124
+ onClick: (e) => e.stopPropagation()
125
+ },
126
+ /* @__PURE__ */ React2.createElement("div", { className: "p-3.5" }, children[1])
127
+ )) : children
83
128
  );
84
129
  }
85
- function AccordionTrigger({ isOpen, children }) {
86
- return /* @__PURE__ */ React2.createElement("div", { className: "flex p-3.5 justify-between items-center text-sm font-semibold transition-all delay-150 ease-in" }, children, /* @__PURE__ */ React2.createElement(
87
- "span",
88
- {
89
- className: cn(
90
- "transition-transform duration-300 transform",
91
- isOpen ? "rotate-180" : "rotate-0"
92
- )
93
- },
94
- /* @__PURE__ */ React2.createElement(RiArrowDownSLine, { size: 18 })
95
- ));
96
- }
97
- function AccordionContent({ isOpen, children }) {
130
+ function AccordionTrigger({
131
+ isOpen,
132
+ children,
133
+ className,
134
+ triggerIcon = /* @__PURE__ */ React2.createElement(RiArrowDownSLine, { size: 18 })
135
+ }) {
98
136
  return /* @__PURE__ */ React2.createElement(
99
137
  "div",
100
138
  {
101
139
  className: cn(
102
- "w-full font-normal px-3.5 pb-3.5 text-sm overflow-hidden transition-all duration-500 ease-in",
103
- !isOpen ? "max-h-full opacity-100" : "max-h-0 opacity-0"
140
+ "flex p-3.5 text-lg rounded-lg bg-white hover:bg-gray-50 justify-between items-center font-semibold transition-all delay-150 ease-in",
141
+ isOpen && "bg-gray-100",
142
+ className
104
143
  )
105
144
  },
106
- children
145
+ children,
146
+ /* @__PURE__ */ React2.createElement(
147
+ "span",
148
+ {
149
+ className: cn(
150
+ "transition-transform duration-300",
151
+ isOpen ? "rotate-180" : "rotate-0"
152
+ ),
153
+ "aria-hidden": "true"
154
+ },
155
+ triggerIcon
156
+ )
107
157
  );
108
158
  }
159
+ function AccordionContent({ children }) {
160
+ return /* @__PURE__ */ React2.createElement("div", { className: "text-gray-700" }, children);
161
+ }
109
162
 
110
163
  // app/components/Avatar.tsx
111
164
  import Image from "next/image";
@@ -296,7 +349,7 @@ var Breadcrumb_default = Breadcrumbs;
296
349
  import React6 from "react";
297
350
  import { cva } from "class-variance-authority";
298
351
  var buttonVariants = cva(
299
- "rounded-lg disabled:select-none font-semibold cursor-pointer transition-colors duration-300 ease-in-out",
352
+ "rounded-lg disabled:select-none font-semibold cursor-pointer transition-colors duration-300 ease-in-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2",
300
353
  {
301
354
  variants: {
302
355
  variant: {
@@ -309,11 +362,29 @@ var buttonVariants = cva(
309
362
  error: "bg-error-700 border-error-700 active:bg-error-900 active:border-error-900 hover:bg-error-800 hover:border-error-800",
310
363
  warning: "bg-warning-600 border-warning-600 active:bg-warning-900 active:border-warning-900 hover:bg-warning-700 hover:border-warning-700",
311
364
  default: "bg-gray-600 border-gray-600 active:bg-gray-900 active:border-gray-900 hover:bg-gray-700 hover:border-gray-700",
365
+ blue: "bg-blue-600 border-blue-600 active:bg-blue-900 active:border-blue-900 hover:bg-blue-700 hover:border-blue-700",
366
+ bluegray: "bg-bluegray-600 border-bluegray-600 active:bg-bluegray-900 active:border-bluegray-900 hover:bg-bluegray-700 hover:border-bluegray-700",
367
+ bluelight: "bg-bluelight-600 border-bluelight-600 active:bg-bluelight-900 active:border-bluelight-900 hover:bg-bluelight-700 hover:border-bluelight-700",
368
+ indigo: "bg-indigo-600 border-indigo-600 active:bg-indigo-900 active:border-indigo-900 hover:bg-indigo-700 hover:border-indigo-700",
369
+ purple: "bg-purple-600 border-purple-600 active:bg-purple-900 active:border-purple-900 hover:bg-purple-700 hover:border-purple-700",
370
+ violet: "bg-violet-600 border-violet-600 active:bg-violet-900 active:border-violet-900 hover:bg-violet-700 hover:border-violet-700",
371
+ pink: "bg-pink-600 border-pink-600 active:bg-pink-900 active:border-pink-900 hover:bg-pink-700 hover:border-pink-700",
372
+ rose: "bg-rose-600 border-rose-600 active:bg-rose-900 active:border-rose-900 hover:bg-rose-700 hover:border-rose-700",
373
+ orange: "bg-orange-600 border-orange-600 active:bg-orange-900 active:border-orange-900 hover:bg-orange-700 hover:border-orange-700",
312
374
  "primary-outlined": "border-primary-600 text-primary-600 hover:bg-primary-100 active:bg-primary-200 active:border-primary-700",
313
375
  "success-outlined": "border-success-600 text-success-600 hover:bg-success-50 hover:border-success-700 hover:text-success-700 active:bg-success-100 active:text-success-900 active:border-success-900",
314
376
  "error-outlined": "border-error-700 text-error-700 hover:bg-error-100 hover:border-error-700 hover:text-error-700 active:bg-error-200 active:text-error-700 active:border-error-800",
315
377
  "warning-outlined": "border-warning-500 text-warning-500 hover:bg-warning-50 hover:border-warning-600 hover:text-warning-600 active:bg-warning-100 active:text-warning-700 active:border-warning-700",
316
- "default-outlined": "border-gray-700 text-gray-700 hover:bg-gray-100 hover:border-gray-700 hover:text-gray-700 active:bg-gray-300 active:text-gray-800 active:border-gray-800"
378
+ "default-outlined": "border-gray-700 text-gray-700 hover:bg-gray-100 hover:border-gray-700 hover:text-gray-700 active:bg-gray-300 active:text-gray-800 active:border-gray-800",
379
+ "blue-outlined": "border-blue-600 text-blue-600 hover:bg-blue-50 hover:border-blue-700 hover:text-blue-700 active:bg-blue-100 active:text-blue-900 active:border-blue-900",
380
+ "bluegray-outlined": "border-bluegray-600 text-bluegray-600 hover:bg-bluegray-50 hover:border-bluegray-700 hover:text-bluegray-700 active:bg-bluegray-100 active:text-bluegray-900 active:border-bluegray-900",
381
+ "bluelight-outlined": "border-bluelight-600 text-bluelight-600 hover:bg-bluelight-50 hover:border-bluelight-700 hover:text-bluelight-700 active:bg-bluelight-100 active:text-bluelight-900 active:border-bluelight-900",
382
+ "indigo-outlined": "border-indigo-600 text-indigo-600 hover:bg-indigo-50 hover:border-indigo-700 hover:text-indigo-700 active:bg-indigo-100 active:text-indigo-900 active:border-indigo-900",
383
+ "purple-outlined": "border-purple-600 text-purple-600 hover:bg-purple-50 hover:border-purple-700 hover:text-purple-700 active:bg-purple-100 active:text-purple-900 active:border-purple-900",
384
+ "violet-outlined": "border-violet-600 text-violet-600 hover:bg-violet-50 hover:border-violet-700 hover:text-violet-700 active:bg-violet-100 active:text-violet-900 active:border-violet-900",
385
+ "pink-outlined": "border-pink-600 text-pink-600 hover:bg-pink-50 hover:border-pink-700 hover:text-pink-700 active:bg-pink-100 active:text-pink-900 active:border-pink-900",
386
+ "rose-outlined": "border-rose-600 text-rose-600 hover:bg-rose-50 hover:border-rose-700 hover:text-rose-700 active:bg-rose-100 active:text-rose-900 active:border-rose-900",
387
+ "orange-outlined": "border-orange-600 text-orange-600 hover:bg-orange-50 hover:border-orange-700 hover:text-orange-700 active:bg-orange-100 active:text-orange-900 active:border-orange-900"
317
388
  },
318
389
  size: {
319
390
  sm: "text-sm px-3.5 py-2",
@@ -323,7 +394,7 @@ var buttonVariants = cva(
323
394
  },
324
395
  defaultVariants: {
325
396
  variant: "filled",
326
- size: "md"
397
+ size: "sm"
327
398
  }
328
399
  }
329
400
  );
@@ -337,36 +408,187 @@ var Button = ({
337
408
  disabled,
338
409
  endIcon,
339
410
  size,
411
+ type = "button",
340
412
  ...props
341
413
  }) => {
342
- return /* @__PURE__ */ React6.createElement(
343
- "button",
414
+ return (
415
+ // <button
416
+ // {...props}
417
+ // disabled={disabled}
418
+ // type={type}
419
+ // aria-disabled={disabled}
420
+ // className={cn(
421
+ // fullWidth && "w-full",
422
+ // buttonVariants({ intent, className, variant, size }),
423
+ // "flex items-center text-center justify-center gap-2"
424
+ // )}
425
+ // >
426
+ // {startIcon}
427
+ // {children}
428
+ // {endIcon}
429
+ // </button>
430
+ /* @__PURE__ */ React6.createElement(
431
+ "button",
432
+ {
433
+ ...props,
434
+ disabled,
435
+ "aria-disabled": disabled,
436
+ type,
437
+ className: cn(
438
+ fullWidth && "w-full",
439
+ buttonVariants({ intent, className, variant, size }),
440
+ "flex items-center text-center justify-center gap-2"
441
+ )
442
+ },
443
+ startIcon && /* @__PURE__ */ React6.createElement("span", { "aria-hidden": "true" }, startIcon),
444
+ children,
445
+ endIcon && /* @__PURE__ */ React6.createElement("span", { "aria-hidden": "true" }, endIcon)
446
+ )
447
+ );
448
+ };
449
+ var Button_default = Button;
450
+
451
+ // app/components/Callout.tsx
452
+ import { cva as cva2 } from "class-variance-authority";
453
+ import React7 from "react";
454
+ var calloutVariants = cva2("py-3 px-4 font-medium rounded-md", {
455
+ variants: {
456
+ variant: {
457
+ filled: "",
458
+ outlined: "border"
459
+ },
460
+ intent: {
461
+ primary: "",
462
+ warning: "",
463
+ error: "",
464
+ success: "",
465
+ default: ""
466
+ },
467
+ size: {
468
+ xs: "text-xs",
469
+ sm: "text-sm",
470
+ md: "text-base",
471
+ lg: "text-lg"
472
+ }
473
+ },
474
+ compoundVariants: [
344
475
  {
345
- ...props,
346
- disabled,
476
+ variant: "filled",
477
+ intent: "primary",
478
+ className: "bg-primary-50 text-primary-600"
479
+ },
480
+ {
481
+ variant: "outlined",
482
+ intent: "primary",
483
+ className: "border-primary-200 text-primary-600 bg-transparent"
484
+ },
485
+ {
486
+ variant: "filled",
487
+ intent: "warning",
488
+ className: "bg-warning-50 text-warning-600"
489
+ },
490
+ {
491
+ variant: "outlined",
492
+ intent: "warning",
493
+ className: "border-warning-200 text-warning-600 bg-transparent"
494
+ },
495
+ {
496
+ variant: "filled",
497
+ intent: "error",
498
+ className: "bg-error-50 text-error-600"
499
+ },
500
+ {
501
+ variant: "outlined",
502
+ intent: "error",
503
+ className: "border-error-200 text-error-600 bg-transparent"
504
+ },
505
+ {
506
+ variant: "filled",
507
+ intent: "success",
508
+ className: "bg-success-50 text-success-600"
509
+ },
510
+ {
511
+ variant: "outlined",
512
+ intent: "success",
513
+ className: "border-success-200 text-success-600 bg-transparent"
514
+ },
515
+ {
516
+ variant: "filled",
517
+ intent: "default",
518
+ className: "bg-gray-50 text-gray-600"
519
+ },
520
+ {
521
+ variant: "outlined",
522
+ intent: "default",
523
+ className: "border-gray-300 text-gray-600 bg-transparent"
524
+ }
525
+ ],
526
+ defaultVariants: {
527
+ variant: "filled",
528
+ intent: "primary",
529
+ size: "sm"
530
+ }
531
+ });
532
+ var Callout = ({
533
+ children,
534
+ variant,
535
+ intent,
536
+ size,
537
+ startIcon,
538
+ endIcon,
539
+ className
540
+ }) => {
541
+ return /* @__PURE__ */ React7.createElement(
542
+ "div",
543
+ {
544
+ role: "alert",
347
545
  className: cn(
348
- fullWidth && "w-full",
349
- buttonVariants({ intent, className, variant, size }),
350
- "flex items-center text-center justify-center gap-2"
546
+ calloutVariants({ variant, intent, size }),
547
+ "flex items-center justify-between gap-2",
548
+ className
351
549
  )
352
550
  },
353
- startIcon,
354
- children,
355
- endIcon
551
+ /* @__PURE__ */ React7.createElement("div", { className: "flex items-center gap-2" }, startIcon && /* @__PURE__ */ React7.createElement("span", null, startIcon), children),
552
+ endIcon && /* @__PURE__ */ React7.createElement("span", null, endIcon)
356
553
  );
357
554
  };
358
- var Button_default = Button;
555
+ var Callout_default = Callout;
556
+
557
+ // app/components/Card.tsx
558
+ import React8 from "react";
559
+ function Card_default({ children, className }) {
560
+ return /* @__PURE__ */ React8.createElement("div", { className: cn("bg-white rounded-lg border border-gray-200 shadow-sm", className) }, children);
561
+ }
562
+ var CardHeader = ({ children, className }) => {
563
+ return /* @__PURE__ */ React8.createElement("div", { className: cn("p-4 pb-4", className) }, children);
564
+ };
565
+ var CardTitle = ({ children, className }) => {
566
+ return /* @__PURE__ */ React8.createElement("h3", { className: cn("text-lg font-semibold text-gray-900 mb-2", className) }, children);
567
+ };
568
+ var CardDescription = ({ children, className }) => {
569
+ return /* @__PURE__ */ React8.createElement("p", { className: cn("text-sm text-gray-600 mb-4", className) }, children);
570
+ };
571
+ var CardAction = ({ children, className }) => {
572
+ return /* @__PURE__ */ React8.createElement("div", { className: cn("mt-4", className) }, children);
573
+ };
574
+ var CardContent = ({ children, className }) => {
575
+ return /* @__PURE__ */ React8.createElement("div", { className: cn("p-6 pt-0", className) }, children);
576
+ };
577
+ var CardFooter = ({ children, className }) => {
578
+ return /* @__PURE__ */ React8.createElement("div", { className: cn("p-6 pt-0", className) }, children);
579
+ };
359
580
 
360
581
  // app/components/Checkbox.tsx
361
- import React7, { forwardRef as forwardRef3 } from "react";
362
- import { cva as cva2 } from "class-variance-authority";
363
- var checkboxVariant = cva2(
582
+ import React9, { forwardRef as forwardRef3 } from "react";
583
+ import { cva as cva3 } from "class-variance-authority";
584
+ var checkboxVariant = cva3(
364
585
  "peer relative cursor-pointer appearance-none rounded-[4px] border border-gray-300 transition-all checked:border-primary-600 checked:bg-primary-50 hover:bg-primary-50 disabled:opacity-30 disabled:pointer-events-none",
365
586
  {
366
587
  variants: {
367
588
  size: {
368
589
  sm: "h-3 w-3",
369
- lg: "h-3.5 w-3.5"
590
+ lg: "h-3.5 w-3.5",
591
+ xl: "h-4 w-4"
370
592
  }
371
593
  },
372
594
  defaultVariants: {
@@ -375,46 +597,58 @@ var checkboxVariant = cva2(
375
597
  }
376
598
  );
377
599
  var Checkbox = forwardRef3(
378
- ({ disabled, checked, size, className, children, ...props }, ref) => {
379
- return /* @__PURE__ */ React7.createElement("div", { className: "inline-flex relative items-center" }, /* @__PURE__ */ React7.createElement(
600
+ ({ disabled, checked, size, className, children, id, ...props }, ref) => {
601
+ return /* @__PURE__ */ React9.createElement("div", { className: "inline-flex relative items-center" }, /* @__PURE__ */ React9.createElement(
380
602
  "input",
381
603
  {
382
604
  type: "checkbox",
383
605
  ref,
606
+ id,
384
607
  ...props,
385
608
  disabled,
386
609
  checked,
387
- className: cn(checkboxVariant({ className, size }))
610
+ className: cn(
611
+ "peer",
612
+ checkboxVariant({ className, size }),
613
+ "focus-visible:ring-2 focus-visible:ring-primary-600 focus-visible:ring-offset-2"
614
+ )
388
615
  }
389
- ), /* @__PURE__ */ React7.createElement("span", { className: "absolute text-primary-600 transition-opacity opacity-0 pointer-events-none top-2/4 left-2/4 -translate-y-2/4 -translate-x-2/4 peer-checked:opacity-100" }, /* @__PURE__ */ React7.createElement(
390
- "svg",
616
+ ), /* @__PURE__ */ React9.createElement(
617
+ "span",
391
618
  {
392
- xmlns: "http://www.w3.org/2000/svg",
393
- className: "w-2.5 h-2.5",
394
- viewBox: "0 0 20 20",
395
- fill: "currentColor",
396
- stroke: "currentColor",
397
- strokeWidth: "1"
619
+ "aria-hidden": "true",
620
+ className: "absolute text-primary-600 transition-opacity opacity-0 pointer-events-none top-2/4 left-2/4 -translate-y-2/4 -translate-x-2/4 peer-checked:opacity-100"
398
621
  },
399
- /* @__PURE__ */ React7.createElement(
400
- "path",
622
+ /* @__PURE__ */ React9.createElement(
623
+ "svg",
401
624
  {
402
- fillRule: "evenodd",
403
- d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
404
- clipRule: "evenodd"
405
- }
625
+ xmlns: "http://www.w3.org/2000/svg",
626
+ className: "w-2.5 h-2.5",
627
+ viewBox: "0 0 20 20",
628
+ fill: "currentColor",
629
+ stroke: "currentColor",
630
+ strokeWidth: "1"
631
+ },
632
+ /* @__PURE__ */ React9.createElement(
633
+ "path",
634
+ {
635
+ fillRule: "evenodd",
636
+ d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
637
+ clipRule: "evenodd"
638
+ }
639
+ )
406
640
  )
407
- )));
641
+ ));
408
642
  }
409
643
  );
410
644
  Checkbox.displayName = "Checkbox";
411
645
  var Checkbox_default = Checkbox;
412
646
 
413
647
  // app/components/Chip.tsx
414
- import React8 from "react";
415
- import { cva as cva3 } from "class-variance-authority";
416
- var chipVariants = cva3(
417
- "rounded-full capitalize flex items-center w-fit gap-2",
648
+ import React10 from "react";
649
+ import { cva as cva4 } from "class-variance-authority";
650
+ var chipVariants = cva4(
651
+ "inline-flex items-center w-fit gap-2 rounded-full capitalize",
418
652
  {
419
653
  variants: {
420
654
  intent: {
@@ -422,6 +656,7 @@ var chipVariants = cva3(
422
656
  success: "bg-success-50 text-success-600",
423
657
  warning: "bg-warning-50 text-warning-500",
424
658
  error: "bg-error-50 text-error-600",
659
+ blue: "bg-blue-100 text-blue-700",
425
660
  primary: "bg-primary-100 text-primary-700",
426
661
  bluegray: "bg-bluegray-100 text-bluegray-500",
427
662
  bluelight: "bg-bluelight-100 text-bluelight-600",
@@ -435,7 +670,7 @@ var chipVariants = cva3(
435
670
  size: {
436
671
  sm: "text-xs px-2 py-0.5",
437
672
  md: "text-sm px-2.5 py-0.5",
438
- lg: "text-sm px-3 py-1"
673
+ lg: "text-base px-3 py-1"
439
674
  }
440
675
  },
441
676
  defaultVariants: {
@@ -449,6 +684,7 @@ var dotColorVariants = {
449
684
  success: "bg-success-600",
450
685
  warning: "bg-warning-600",
451
686
  error: "bg-error-600",
687
+ blue: "bg-blue-600",
452
688
  primary: "bg-primary-600",
453
689
  bluegray: "bg-bluegray-500",
454
690
  bluelight: "bg-bluelight-600",
@@ -465,23 +701,37 @@ var Chip = ({
465
701
  size,
466
702
  intent = "default",
467
703
  dot,
468
- dotColor
704
+ dotColor,
705
+ startIcon,
706
+ endIcon,
707
+ ...rest
469
708
  }) => {
470
709
  const resolvedIntent = intent ?? "default";
471
- return /* @__PURE__ */ React8.createElement("div", { className: cn(chipVariants({ intent: resolvedIntent, size }), className) }, dot && /* @__PURE__ */ React8.createElement(
710
+ return /* @__PURE__ */ React10.createElement(
472
711
  "span",
473
712
  {
474
- className: cn(
475
- "w-1.5 h-1.5 rounded-full",
476
- dotColor || dotColorVariants[resolvedIntent] || "bg-primary-600"
477
- // Default fallback
478
- )
479
- }
480
- ), /* @__PURE__ */ React8.createElement("span", null, children));
713
+ className: cn(chipVariants({ intent: resolvedIntent, size }), className),
714
+ ...rest
715
+ },
716
+ startIcon && /* @__PURE__ */ React10.createElement("span", { "aria-hidden": "true" }, startIcon),
717
+ !startIcon && dot && /* @__PURE__ */ React10.createElement(
718
+ "span",
719
+ {
720
+ "aria-hidden": "true",
721
+ className: cn(
722
+ "w-1.5 h-1.5 rounded-full",
723
+ dotColor || dotColorVariants[resolvedIntent] || "bg-primary-600"
724
+ )
725
+ }
726
+ ),
727
+ children,
728
+ endIcon && /* @__PURE__ */ React10.createElement("span", { "aria-hidden": "true" }, endIcon)
729
+ );
481
730
  };
482
731
  var Chip_default = Chip;
483
732
 
484
733
  // app/components/CircularProgress.tsx
734
+ import React11 from "react";
485
735
  var CircularProgressBar = ({
486
736
  percentage,
487
737
  size = 160,
@@ -493,7 +743,7 @@ var CircularProgressBar = ({
493
743
  const viewBox = `0 0 ${size} ${size}`;
494
744
  const dashArray = radius * Math.PI * 2;
495
745
  const dashOffset = dashArray - dashArray * (percentage || 0) / 100;
496
- return /* @__PURE__ */ React.createElement("svg", { width: size, height: size, viewBox }, /* @__PURE__ */ React.createElement(
746
+ return /* @__PURE__ */ React11.createElement("svg", { width: size, height: size, viewBox }, /* @__PURE__ */ React11.createElement(
497
747
  "circle",
498
748
  {
499
749
  className: "fill-none stroke-gray-200",
@@ -502,7 +752,7 @@ var CircularProgressBar = ({
502
752
  r: radius,
503
753
  strokeWidth: `${strokeWidth}px`
504
754
  }
505
- ), /* @__PURE__ */ React.createElement(
755
+ ), /* @__PURE__ */ React11.createElement(
506
756
  "circle",
507
757
  {
508
758
  className: "fill-none stroke-primary-600 transition-all delay-200 ease-in",
@@ -517,7 +767,7 @@ var CircularProgressBar = ({
517
767
  strokeDashoffset: dashOffset
518
768
  }
519
769
  }
520
- ), /* @__PURE__ */ React.createElement(
770
+ ), /* @__PURE__ */ React11.createElement(
521
771
  "text",
522
772
  {
523
773
  x: "50%",
@@ -533,14 +783,14 @@ var CircularProgressBar = ({
533
783
  var CircularProgress_default = CircularProgressBar;
534
784
 
535
785
  // app/components/Divider.tsx
536
- import React9 from "react";
786
+ import React12 from "react";
537
787
  var Divider = ({
538
788
  width,
539
789
  height,
540
790
  position = "horizontal",
541
791
  className
542
792
  }) => {
543
- return /* @__PURE__ */ React9.createElement(
793
+ return /* @__PURE__ */ React12.createElement(
544
794
  "div",
545
795
  {
546
796
  style: {
@@ -557,64 +807,153 @@ var Divider = ({
557
807
  };
558
808
  var Divider_default = Divider;
559
809
 
810
+ // app/components/Drawer.tsx
811
+ import {
812
+ useCallback,
813
+ useEffect as useEffect2
814
+ } from "react";
815
+ import { RiCloseLine } from "@remixicon/react";
816
+ var Drawer = ({
817
+ isOpen,
818
+ setIsOpen,
819
+ children,
820
+ position = "right",
821
+ width = "w-80",
822
+ height = "h-64",
823
+ className,
824
+ showCloseButton = true,
825
+ closeOnOutsideClick = true
826
+ }) => {
827
+ const handleClose = useCallback(() => {
828
+ setIsOpen(false);
829
+ }, [setIsOpen]);
830
+ useEffect2(() => {
831
+ document.body.style.overflow = isOpen ? "hidden" : "";
832
+ }, [isOpen]);
833
+ useEffect2(() => {
834
+ const handleKeyDown = (e) => {
835
+ if (e.key === "Escape" && isOpen) {
836
+ handleClose();
837
+ }
838
+ };
839
+ window.addEventListener("keydown", handleKeyDown);
840
+ return () => window.removeEventListener("keydown", handleKeyDown);
841
+ }, [isOpen, handleClose]);
842
+ return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(
843
+ "div",
844
+ {
845
+ className: cn(
846
+ "fixed inset-0 bg-black/50 transition-opacity duration-300 z-[10000000000000000]",
847
+ isOpen ? "opacity-100" : "opacity-0 pointer-events-none"
848
+ ),
849
+ onClick: () => closeOnOutsideClick && handleClose()
850
+ }
851
+ ), /* @__PURE__ */ React.createElement(
852
+ "div",
853
+ {
854
+ className: cn(
855
+ "fixed bg-white shadow-xl p-4 transition-transform duration-300 z-[100000000000000000]",
856
+ position === "right" && `top-0 right-0 ${width} h-full`,
857
+ position === "left" && `top-0 left-0 ${width} h-full`,
858
+ position === "top" && `top-0 left-0 w-full ${height}`,
859
+ position === "bottom" && `bottom-0 left-0 w-full ${height}`,
860
+ !isOpen && (position === "right" ? "translate-x-full" : position === "left" ? "-translate-x-full" : position === "top" ? "-translate-y-full" : "translate-y-full"),
861
+ isOpen && "translate-x-0 translate-y-0",
862
+ className
863
+ ),
864
+ onClick: (e) => e.stopPropagation()
865
+ },
866
+ showCloseButton && /* @__PURE__ */ React.createElement(
867
+ Button_default,
868
+ {
869
+ size: "sm",
870
+ variant: "outlined",
871
+ intent: "default-outlined",
872
+ onClick: handleClose,
873
+ startIcon: /* @__PURE__ */ React.createElement(RiCloseLine, { size: 20 }),
874
+ "aria-label": "Close drawer",
875
+ className: "absolute border-none p-1 transition-colors top-3 right-4"
876
+ }
877
+ ),
878
+ /* @__PURE__ */ React.createElement("div", { className: "overflow-y-auto h-full" }, children)
879
+ ));
880
+ };
881
+ var Drawer_default = Drawer;
882
+
560
883
  // app/components/Dropdown.tsx
561
- import React13, {
562
- useEffect,
884
+ import React15, {
885
+ useEffect as useEffect3,
563
886
  useState as useState2,
564
887
  useMemo,
565
- useCallback,
888
+ useCallback as useCallback2,
566
889
  forwardRef as forwardRef5,
567
890
  useRef,
568
891
  useImperativeHandle
569
892
  } from "react";
570
- import {
571
- RiArrowDownSLine as RiArrowDownSLine2,
572
- RiSearchLine,
573
- RiErrorWarningLine
574
- } from "@remixicon/react";
893
+ import { RiArrowDownSLine as RiArrowDownSLine2, RiSearchLine } from "@remixicon/react";
575
894
 
576
895
  // app/components/Input.tsx
577
- import React10, { forwardRef as forwardRef4 } from "react";
896
+ import React13, { forwardRef as forwardRef4 } from "react";
578
897
  var Input = forwardRef4(
579
- ({ size, startIcon, endIcon, className, type, disabled, ...props }, ref) => {
580
- return /* @__PURE__ */ React10.createElement(
898
+ ({
899
+ size,
900
+ startIcon,
901
+ endIcon,
902
+ className,
903
+ type,
904
+ error,
905
+ disabled,
906
+ id,
907
+ "aria-label": ariaLabel,
908
+ "aria-describedby": ariaDescribedby,
909
+ ...props
910
+ }, ref) => {
911
+ return /* @__PURE__ */ React13.createElement(
581
912
  "div",
582
913
  {
583
914
  className: cn(
584
- "group flex items-center gap-2 p-3.5 border border-gray-200 rounded-lg bg-white shadow-xs hover:bg-gray-50 hover:border-gray-300 focus-within:border-gray-800 focus-within:bg-gray-25 focus-within:hover:bg-gray-50 focus-within:hover:border-gray-800 has-[:disabled]:opacity-30 has-[:disabled]:bg-gray-300 has-[:disabled]:select-none has-[:disabled]:pointer-events-none",
915
+ "group flex items-center gap-2 p-3.5 border border-gray-200 rounded-lg bg-white shadow-[0px_1px_2px_0px_#1018280D] hover:bg-gray-50 hover:border-gray-300 focus-within:border-gray-800 focus-within:bg-gray-25 focus-within:hover:bg-gray-50 focus-within:hover:border-gray-800 has-[:disabled]:opacity-30 has-[:disabled]:bg-gray-300 has-[:disabled]:select-none has-[:disabled]:pointer-events-none",
585
916
  size === "sm" ? "w-[320px] h-10" : size === "lg" ? "w-[313px] h-11" : "w-full h-10",
917
+ error && "border-error-500 hover:border-error-600 focus-within:border-error-500 focus-within:hover:border-error-500",
586
918
  className
587
919
  )
588
920
  },
589
- /* @__PURE__ */ React10.createElement(
921
+ startIcon && /* @__PURE__ */ React13.createElement(
590
922
  "span",
591
923
  {
924
+ "aria-hidden": "true",
592
925
  className: cn(
593
- startIcon ? "group-hover:text-gray-600 group-focus-within:text-gray-600" : "hidden",
594
- disabled === true && "text-gray-900"
926
+ "group-hover:text-gray-600 group-focus-within:text-gray-600",
927
+ disabled && "text-gray-900",
928
+ error && "text-error-500"
595
929
  )
596
930
  },
597
931
  startIcon
598
932
  ),
599
- /* @__PURE__ */ React10.createElement(
933
+ /* @__PURE__ */ React13.createElement(
600
934
  "input",
601
935
  {
602
936
  ...props,
603
937
  ref,
938
+ id,
604
939
  disabled,
605
940
  type,
941
+ "aria-label": ariaLabel,
942
+ "aria-describedby": ariaDescribedby,
943
+ "aria-disabled": disabled,
606
944
  className: cn(
607
- "w-full text-sm focus:outline-none bg-transparent disabled:text-gray-900 placeholder:text-gray-500 group-hover:placeholder:text-gray-500",
945
+ "w-full text-sm focus:outline-none focus:ring-offset-0 bg-transparent disabled:text-gray-900 placeholder:text-gray-500 group-hover:placeholder:text-gray-500 rounded-md",
608
946
  size
609
947
  )
610
948
  }
611
949
  ),
612
- /* @__PURE__ */ React10.createElement(
950
+ endIcon && /* @__PURE__ */ React13.createElement(
613
951
  "span",
614
952
  {
953
+ "aria-hidden": "true",
615
954
  className: cn(
616
- endIcon ? "group-hover:text-gray-600 group-focus-within:text-gray-600" : "hidden",
617
- disabled === true && "text-gray-900"
955
+ "group-hover:text-gray-600 group-focus-within:text-gray-600",
956
+ disabled && "text-gray-900"
618
957
  )
619
958
  },
620
959
  endIcon
@@ -626,9 +965,9 @@ Input.displayName = "Input";
626
965
  var Input_default = Input;
627
966
 
628
967
  // app/components/Label.tsx
629
- import { cva as cva4 } from "class-variance-authority";
630
- import React11 from "react";
631
- var labelVariants = cva4("flex item-start", {
968
+ import { cva as cva5 } from "class-variance-authority";
969
+ import React14 from "react";
970
+ var labelVariants = cva5("flex item-start", {
632
971
  variants: {
633
972
  size: {
634
973
  sm: "text-xs",
@@ -649,52 +988,39 @@ var Label = ({
649
988
  className,
650
989
  ...props
651
990
  }) => {
652
- return /* @__PURE__ */ React11.createElement(
991
+ return /* @__PURE__ */ React14.createElement(
653
992
  "label",
654
993
  {
655
994
  htmlFor,
656
- className: cn("cursor-pointer", labelVariants({ className, size }), disabled === true ? "opacity-30 select-none" : "opacity-100"),
995
+ className: cn(
996
+ "cursor-pointer",
997
+ labelVariants({ className, size }),
998
+ disabled === true ? "opacity-30 select-none pointer-events-none" : "opacity-100"
999
+ ),
1000
+ "aria-disabled": disabled,
657
1001
  ...props
658
1002
  },
659
- children,
660
- /* @__PURE__ */ React11.createElement("span", { className: cn(required === true ? "block text-red-500" : "hidden") }, "*")
1003
+ /* @__PURE__ */ React14.createElement("span", { className: "flex items-center gap-1" }, children, required && /* @__PURE__ */ React14.createElement(
1004
+ "span",
1005
+ {
1006
+ "aria-label": "required field",
1007
+ role: "presentation",
1008
+ className: "text-red-500",
1009
+ "aria-hidden": "true"
1010
+ },
1011
+ "*"
1012
+ ))
661
1013
  );
662
1014
  };
663
1015
  var Label_default = Label;
664
1016
 
665
- // app/components/Tooltip.tsx
666
- import { cva as cva5 } from "class-variance-authority";
667
- import React12 from "react";
668
- var tooltipVariants = cva5(
669
- "bg-white shadow-lg rounded-lg absolute hidden group-hover:block p-3 z-10 max-w-[328px] w-max whitespace-normal opacity-0 group-hover:opacity-100 transform transition-all duration-1000 ease-in-out group-hover:delay-[2000ms]",
670
- {
671
- variants: {
672
- position: {
673
- top: "bottom-[calc(100%+0px)] group-hover:translate-y-0 delay-1000 translate-y-[-10px]",
674
- right: "top-1/2 -translate-y-1/2 left-[calc(100%+0px)] group-hover:translate-x-0 translate-x-[-10px]",
675
- bottom: "top-[calc(100%+0px)] group-hover:translate-y-0 translate-y-[10px]",
676
- left: "top-1/2 -translate-y-1/2 right-[calc(100%+0px)] group-hover:translate-x-0 translate-x-[10px]"
677
- }
678
- }
679
- }
680
- );
681
- var Tooltip = ({
682
- position,
683
- content,
684
- children,
685
- className,
686
- ...props
687
- }) => {
688
- return /* @__PURE__ */ React12.createElement("div", { ...props, className: "relative cursor-pointer text-sm group" }, /* @__PURE__ */ React12.createElement("div", null, children), /* @__PURE__ */ React12.createElement("span", { className: cn(tooltipVariants({ position }), className) }, content));
689
- };
690
- var Tooltip_default = Tooltip;
691
-
692
1017
  // app/components/Dropdown.tsx
693
1018
  var defaultRenderItem = (option) => {
694
- return /* @__PURE__ */ React13.createElement(MenuItem, { label: option.label, value: option.value });
1019
+ return /* @__PURE__ */ React15.createElement(MenuItem, { label: option.label, value: option.value });
695
1020
  };
696
1021
  var Dropdown = forwardRef5(
697
1022
  ({
1023
+ id = `dropdown-${Math.random().toString(36).substring(2, 11)}`,
698
1024
  options,
699
1025
  selected,
700
1026
  setSelected,
@@ -707,11 +1033,11 @@ var Dropdown = forwardRef5(
707
1033
  position = "top",
708
1034
  width,
709
1035
  info,
710
- dropDownTooltip = false,
711
1036
  dropdownFooter = false,
712
1037
  onApply,
713
1038
  disabled = false,
714
- onReset
1039
+ onReset,
1040
+ footerAction
715
1041
  }, ref) => {
716
1042
  var _a, _b;
717
1043
  const [searchQuery, setSearchQuery] = useState2("");
@@ -721,7 +1047,7 @@ var Dropdown = forwardRef5(
721
1047
  const [dropdownMenu, setDropdownMenu] = useState2(false);
722
1048
  const dropdownRef = useRef(null);
723
1049
  useImperativeHandle(ref, () => dropdownRef.current);
724
- useEffect(() => {
1050
+ useEffect3(() => {
725
1051
  if (options) {
726
1052
  setFilteredOptions(options);
727
1053
  }
@@ -729,17 +1055,20 @@ var Dropdown = forwardRef5(
729
1055
  const memoizedFilteredOptions = useMemo(() => {
730
1056
  if (!search)
731
1057
  return filteredOptions;
732
- return filteredOptions.filter(
733
- (option) => option.label.toLowerCase().includes(searchQuery.toLowerCase())
734
- );
1058
+ return filteredOptions.filter((option) => {
1059
+ if (typeof option.label === "string") {
1060
+ return option.label.toLowerCase().includes(searchQuery.toLowerCase());
1061
+ }
1062
+ return option.label.toString().includes(searchQuery.toLowerCase());
1063
+ });
735
1064
  }, [search, searchQuery, filteredOptions]);
736
- const handleSearchChange = useCallback(
1065
+ const handleSearchChange = useCallback2(
737
1066
  (e) => {
738
1067
  setSearchQuery(e.target.value);
739
1068
  },
740
1069
  []
741
1070
  );
742
- const toggleOption = useCallback(
1071
+ const toggleOption = useCallback2(
743
1072
  (option) => {
744
1073
  if (multiple && setSelected) {
745
1074
  setSelected(
@@ -752,7 +1081,7 @@ var Dropdown = forwardRef5(
752
1081
  },
753
1082
  [multiple, setSelected]
754
1083
  );
755
- const handleCheckboxChange = useCallback(
1084
+ const handleCheckboxChange = useCallback2(
756
1085
  (option) => {
757
1086
  if (multiple && setSelected) {
758
1087
  setSelected(
@@ -778,7 +1107,7 @@ var Dropdown = forwardRef5(
778
1107
  setSelected == null ? void 0 : setSelected([]);
779
1108
  setDropdownMenu(false);
780
1109
  };
781
- useEffect(() => {
1110
+ useEffect3(() => {
782
1111
  document.addEventListener("mousedown", handleClickOutside);
783
1112
  return () => {
784
1113
  document.removeEventListener("mousedown", handleClickOutside);
@@ -789,12 +1118,13 @@ var Dropdown = forwardRef5(
789
1118
  setDropdownMenu(false);
790
1119
  }
791
1120
  };
792
- return /* @__PURE__ */ React13.createElement(
1121
+ return /* @__PURE__ */ React15.createElement(
793
1122
  "div",
794
1123
  {
1124
+ id,
795
1125
  ref: dropdownRef,
796
1126
  className: cn(
797
- "relative ",
1127
+ "relative bg-gray-25 shadow-[0px_1px_2px_0px_#1018280D] rounded-lg",
798
1128
  !width && "w-full",
799
1129
  disabled && "cursor-not-allowed opacity-50"
800
1130
  ),
@@ -802,110 +1132,143 @@ var Dropdown = forwardRef5(
802
1132
  width
803
1133
  }
804
1134
  },
805
- /* @__PURE__ */ React13.createElement(
806
- "div",
1135
+ /* @__PURE__ */ React15.createElement(
1136
+ "button",
807
1137
  {
1138
+ type: "button",
1139
+ "aria-haspopup": "listbox",
1140
+ "aria-expanded": dropdownMenu,
1141
+ "aria-labelledby": `${id}-label`,
1142
+ disabled,
808
1143
  onClick: () => !disabled && setDropdownMenu((prev) => !prev),
1144
+ onKeyDown: (e) => {
1145
+ if (e.key === "Enter" || e.key === " ") {
1146
+ e.preventDefault();
1147
+ !disabled && setDropdownMenu((prev) => !prev);
1148
+ }
1149
+ },
809
1150
  className: cn(
810
- "hover:bg-gray-50 py-2 px-[14px] rounded-lg flex justify-between items-center text-gray-900 bg-gray-25 text-text-sm cursor-pointer",
811
- dropdownMenu ? "border border-gray-800" : "border border-gray-200",
1151
+ "w-full hover:bg-gray-50 py-2 px-[14px] rounded-lg flex justify-between items-center text-gray-900 bg-gray-25 text-text-sm cursor-pointer",
1152
+ dropdownMenu ? "border border-primary-600" : "border border-gray-200",
812
1153
  disabled && "bg-gray-300 hover:bg-gray-300 cursor-not-allowed"
813
1154
  )
814
1155
  },
815
- /* @__PURE__ */ React13.createElement(
816
- "section",
817
- {
818
- className: cn(
819
- "flex items-center gap-2 text-ellipsis overflow-hidden"
820
- )
821
- },
822
- icon && /* @__PURE__ */ React13.createElement("span", null, icon),
823
- /* @__PURE__ */ React13.createElement("p", { className: "line-clamp-1 w-full" }, multiple ? ((selected == null ? void 0 : selected.length) ?? 0) > 0 ? `${selected == null ? void 0 : selected.length} Selected` : dropdownText : ((_a = selected == null ? void 0 : selected[0]) == null ? void 0 : _a.label) ? (_b = selected == null ? void 0 : selected[0]) == null ? void 0 : _b.label : dropdownText)
824
- ),
825
- /* @__PURE__ */ React13.createElement(RiArrowDownSLine2, { size: 18 })
1156
+ /* @__PURE__ */ React15.createElement("section", { className: "flex items-center gap-2 text-ellipsis overflow-hidden" }, icon && /* @__PURE__ */ React15.createElement("span", { "aria-hidden": "true" }, icon), /* @__PURE__ */ React15.createElement("span", { id: `${id}-label`, className: "line-clamp-1 w-full" }, multiple ? ((selected == null ? void 0 : selected.length) ?? 0) > 0 ? `${selected == null ? void 0 : selected.length} Selected` : dropdownText : ((_a = selected == null ? void 0 : selected[0]) == null ? void 0 : _a.label) ? (_b = selected == null ? void 0 : selected[0]) == null ? void 0 : _b.label : dropdownText)),
1157
+ /* @__PURE__ */ React15.createElement(RiArrowDownSLine2, { "aria-hidden": "true", size: 18 })
826
1158
  ),
827
- /* @__PURE__ */ React13.createElement(
1159
+ /* @__PURE__ */ React15.createElement(
828
1160
  "ul",
829
1161
  {
1162
+ role: "listbox",
1163
+ "aria-multiselectable": multiple,
1164
+ "aria-labelledby": `${id}-label`,
830
1165
  className: cn(
831
1166
  "max-h-0 opacity-0 overflow-hidden shadow-sm mt-1 rounded absolute text-[16px] bg-white z-[1000] w-full transition-all duration-75 delay-100 ease-in",
832
1167
  position === "top" ? "top-10" : "bottom-10",
833
- dropdownMenu && "max-h-[320px] opacity-[1] transition-all ease-in duration-150"
1168
+ dropdownMenu ? "border border-primary-600" : "border border-gray-200",
1169
+ dropdownMenu && "max-h-[360px] h-fit opacity-[1] transition-all ease-in duration-150"
834
1170
  )
835
1171
  },
836
- search && /* @__PURE__ */ React13.createElement(
1172
+ search && /* @__PURE__ */ React15.createElement(
837
1173
  Input_default,
838
1174
  {
1175
+ id: `${id}-search`,
839
1176
  type: "text",
840
1177
  placeholder: "Search...",
1178
+ "aria-label": "Search options",
841
1179
  value: searchQuery,
842
1180
  onChange: handleSearchChange,
843
- className: "rounded rounded-b-none text-gray-800 bg-white w-full h-[35px] pl-3",
844
- endIcon: /* @__PURE__ */ React13.createElement(RiSearchLine, { size: 18 })
1181
+ className: "rounded rounded-b-none text-gray-800 bg-white w-full h-[35px] pl-3 border-none",
1182
+ endIcon: /* @__PURE__ */ React15.createElement(RiSearchLine, { size: 18 })
845
1183
  }
846
1184
  ),
847
- multiple && /* @__PURE__ */ React13.createElement("section", { className: "py-[6px] px-[14px] flex justify-between items-center" }, /* @__PURE__ */ React13.createElement(
848
- "p",
1185
+ multiple && /* @__PURE__ */ React15.createElement("section", { className: "py-[6px] px-[14px] flex justify-between items-center" }, /* @__PURE__ */ React15.createElement(
1186
+ "button",
849
1187
  {
1188
+ type: "button",
1189
+ "aria-label": "Select all",
850
1190
  onClick: handleSelectAll,
851
1191
  className: "text-text-sm hover:text-primary-700 text-primary-600 cursor-pointer"
852
1192
  },
853
1193
  "Select all"
854
- ), /* @__PURE__ */ React13.createElement(
1194
+ ), /* @__PURE__ */ React15.createElement(
855
1195
  "button",
856
1196
  {
1197
+ "aria-label": "Reset",
1198
+ type: "button",
857
1199
  className: "text-text-sm text-warning-500 hover:text-warning-600",
858
1200
  onClick: handleReset
859
1201
  },
860
1202
  "Reset"
861
1203
  )),
862
- /* @__PURE__ */ React13.createElement("section", { className: "max-h-[200px] transition-all duration-75 delay-100 ease-in-out overflow-y-scroll" }, options ? memoizedFilteredOptions.map((option, i) => {
1204
+ /* @__PURE__ */ React15.createElement("section", { className: "max-h-[200px] transition-all duration-75 delay-100 ease-in-out overflow-y-scroll" }, options ? memoizedFilteredOptions == null ? void 0 : memoizedFilteredOptions.map((option, i) => {
863
1205
  var _a2;
864
- return /* @__PURE__ */ React13.createElement(React13.Fragment, { key: i }, multiple ? /* @__PURE__ */ React13.createElement(
1206
+ return /* @__PURE__ */ React15.createElement(React15.Fragment, { key: i }, multiple ? /* @__PURE__ */ React15.createElement(
865
1207
  Label_default,
866
1208
  {
867
- className: "has-[:checked]:bg-primary-50 has-[:checked]:border-primary-600 hover:bg-gray-50 flex flex-col py-[6px] px-[14px] cursor-pointer border-l-4 border-transparent",
868
- htmlFor: `checkbox-${option.value}`,
1209
+ className: cn(
1210
+ "has-[:checked]:bg-primary-50 has-[:checked]:border-primary-600 hover:bg-gray-50 flex flex-col py-[6px] px-[14px] cursor-pointer border-l-4 border-transparent",
1211
+ (option == null ? void 0 : option.disabledOption) && "opacity-50 cursor-not-allowed hover:bg-white text-gray-300 select-none"
1212
+ ),
1213
+ htmlFor: `${id}-checkbox-${option.value}`,
869
1214
  key: i
870
1215
  },
871
- /* @__PURE__ */ React13.createElement("section", { className: "flex items-center justify-between gap-2 w-full" }, /* @__PURE__ */ React13.createElement("div", { className: "flex gap-2" }, /* @__PURE__ */ React13.createElement(
1216
+ /* @__PURE__ */ React15.createElement("section", { className: "flex items-center justify-between gap-2 w-full" }, /* @__PURE__ */ React15.createElement("div", { className: "flex gap-2" }, /* @__PURE__ */ React15.createElement(
872
1217
  Checkbox_default,
873
1218
  {
874
- id: `checkbox-${option.value}`,
1219
+ id: `${id}-checkbox-${option.value}`,
875
1220
  checked: (selected == null ? void 0 : selected.some(
876
1221
  (item) => item.value === option.value
877
1222
  )) ?? false,
878
- onChange: () => handleCheckboxChange(option)
1223
+ onChange: () => handleCheckboxChange(option),
1224
+ disabled: option == null ? void 0 : option.disabledOption
879
1225
  }
880
- ), /* @__PURE__ */ React13.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ React13.createElement("span", null, renderItem(option)), dropDownTooltip && /* @__PURE__ */ React13.createElement(
881
- DropdownTooltip,
1226
+ ), /* @__PURE__ */ React15.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ React15.createElement(
1227
+ "div",
882
1228
  {
883
- tooltipContent: option == null ? void 0 : option.tooltipContent
884
- }
885
- ))), /* @__PURE__ */ React13.createElement("span", { className: "text-gray-500" }, option == null ? void 0 : option.info)),
886
- /* @__PURE__ */ React13.createElement("span", { className: "pt-[2px] text-text-sm text-gray-500" }, option == null ? void 0 : option.addInfo)
887
- ) : /* @__PURE__ */ React13.createElement(
1229
+ style: {
1230
+ color: (option == null ? void 0 : option.disabledOption) ? "#D1D5DB" : option.labelTextColor
1231
+ },
1232
+ className: cn(
1233
+ "break-words",
1234
+ (option == null ? void 0 : option.disabledOption) && "text-gray-300"
1235
+ )
1236
+ },
1237
+ renderItem(option)
1238
+ ))), /* @__PURE__ */ React15.createElement("span", { className: "text-gray-500" }, option == null ? void 0 : option.info)),
1239
+ /* @__PURE__ */ React15.createElement("span", { className: "pt-[2px] text-text-sm text-gray-500" }, option == null ? void 0 : option.addInfo)
1240
+ ) : /* @__PURE__ */ React15.createElement(
888
1241
  Label_default,
889
1242
  {
890
1243
  key: i,
1244
+ htmlFor: `${id}-checkbox-${option.value}`,
891
1245
  className: cn(
892
1246
  "flex justify-between py-[6px] px-[14px] hover:bg-gray-50 gap-2 items-center border-l-4 border-transparent cursor-pointer",
893
1247
  {
894
- "bg-primary-50 border-primary-600": selected && ((_a2 = selected[0]) == null ? void 0 : _a2.value) === option.value
1248
+ "bg-primary-50 border-primary-600": selected && ((_a2 = selected[0]) == null ? void 0 : _a2.value) === option.value,
1249
+ "opacity-50 cursor-not-allowed hover:bg-white text-gray-500": option == null ? void 0 : option.disabledOption
895
1250
  }
896
1251
  ),
897
- onClick: () => toggleOption(option)
1252
+ onClick: () => !(option == null ? void 0 : option.disabledOption) && toggleOption(option)
898
1253
  },
899
- /* @__PURE__ */ React13.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ React13.createElement("span", null, renderItem(option)), dropDownTooltip && /* @__PURE__ */ React13.createElement(
900
- DropdownTooltip,
1254
+ /* @__PURE__ */ React15.createElement(
1255
+ "div",
901
1256
  {
902
- tooltipContent: option == null ? void 0 : option.tooltipContent
903
- }
904
- )),
905
- /* @__PURE__ */ React13.createElement("span", { className: "text-gray-500" }, info)
1257
+ style: {
1258
+ color: (option == null ? void 0 : option.disabledOption) ? "#D1D5DB" : option.labelTextColor
1259
+ },
1260
+ className: cn(
1261
+ "break-words",
1262
+ (option == null ? void 0 : option.disabledOption) && "text-gray-300"
1263
+ )
1264
+ },
1265
+ renderItem(option)
1266
+ ),
1267
+ /* @__PURE__ */ React15.createElement("span", { className: "text-gray-500" }, info)
906
1268
  ));
907
1269
  }) : children),
908
- dropdownFooter && /* @__PURE__ */ React13.createElement(
1270
+ footerAction && /* @__PURE__ */ React15.createElement("div", { className: "py-2 mt-1 px-2 border-t" }, footerAction),
1271
+ dropdownFooter && /* @__PURE__ */ React15.createElement(
909
1272
  DropdownFooter,
910
1273
  {
911
1274
  setDropdownMenu,
@@ -917,28 +1280,24 @@ var Dropdown = forwardRef5(
917
1280
  }
918
1281
  );
919
1282
  var MenuItem = ({ label, children }) => {
920
- return /* @__PURE__ */ React13.createElement("p", { className: "break-all" }, label || children);
921
- };
922
- var DropdownTooltip = ({
923
- tooltipContent
924
- }) => {
925
- const content = tooltipContent || "";
926
- return content ? /* @__PURE__ */ React13.createElement(Tooltip_default, { position: "right", content }, /* @__PURE__ */ React13.createElement(RiErrorWarningLine, { color: "#98A2B3", size: 14 })) : null;
1283
+ return /* @__PURE__ */ React15.createElement("p", { className: "break-all" }, label || children);
927
1284
  };
928
1285
  var DropdownFooter = ({
929
- // onReset,
930
1286
  onApply,
931
1287
  setDropdownMenu
932
1288
  }) => {
933
- return /* @__PURE__ */ React13.createElement("div", { className: "flex justify-end border-t border-gray-200 px-[14px] py-[8px] text-text-sm" }, /* @__PURE__ */ React13.createElement(
1289
+ return /* @__PURE__ */ React15.createElement("div", { className: "flex justify-end border-t border-gray-200 px-[14px] py-[8px] text-text-sm" }, /* @__PURE__ */ React15.createElement(
934
1290
  "button",
935
1291
  {
1292
+ type: "button",
936
1293
  className: "text-primary-600 hover:text-primary-700",
937
1294
  onClick: () => {
938
1295
  if (onApply) {
939
1296
  onApply();
940
1297
  }
941
- setDropdownMenu(false);
1298
+ if (setDropdownMenu) {
1299
+ setDropdownMenu(false);
1300
+ }
942
1301
  }
943
1302
  },
944
1303
  "Apply"
@@ -947,44 +1306,330 @@ var DropdownFooter = ({
947
1306
  Dropdown.displayName = "Dropdown";
948
1307
  var Dropdown_default = Dropdown;
949
1308
 
1309
+ // app/components/DropdownMenu.tsx
1310
+ import { RiArrowDownSLine as RiArrowDownSLine3 } from "@remixicon/react";
1311
+ import React16, { useState as useState3, useRef as useRef2, useEffect as useEffect4, useCallback as useCallback3 } from "react";
1312
+ var DropdownContext = React16.createContext(null);
1313
+ function DropdownMenu({ children }) {
1314
+ const [isOpen, setIsOpen] = useState3(false);
1315
+ const [focusedIndex, setFocusedIndex] = useState3(-1);
1316
+ const triggerRef = useRef2(null);
1317
+ const contentRef = useRef2(null);
1318
+ const menuItemsRef = useRef2([]);
1319
+ const itemsCountRef = useRef2(0);
1320
+ const registerItem = useCallback3(() => {
1321
+ const idx = itemsCountRef.current;
1322
+ itemsCountRef.current += 1;
1323
+ return idx;
1324
+ }, []);
1325
+ const closeMenu = () => {
1326
+ setIsOpen(false);
1327
+ setFocusedIndex(-1);
1328
+ };
1329
+ useEffect4(() => {
1330
+ if (!isOpen)
1331
+ return;
1332
+ const handleClickOutside = (e) => {
1333
+ if (triggerRef.current && contentRef.current && !triggerRef.current.contains(e.target) && !contentRef.current.contains(e.target)) {
1334
+ closeMenu();
1335
+ }
1336
+ };
1337
+ document.addEventListener("mousedown", handleClickOutside);
1338
+ return () => document.removeEventListener("mousedown", handleClickOutside);
1339
+ }, [isOpen]);
1340
+ useEffect4(() => {
1341
+ if (!isOpen)
1342
+ return;
1343
+ const handleKey = (event) => {
1344
+ var _a;
1345
+ switch (event.key) {
1346
+ case "Escape":
1347
+ event.preventDefault();
1348
+ closeMenu();
1349
+ (_a = triggerRef.current) == null ? void 0 : _a.focus();
1350
+ break;
1351
+ case "ArrowDown":
1352
+ event.preventDefault();
1353
+ setFocusedIndex(
1354
+ (prev) => prev < itemsCountRef.current - 1 ? prev + 1 : 0
1355
+ );
1356
+ break;
1357
+ case "ArrowUp":
1358
+ event.preventDefault();
1359
+ setFocusedIndex(
1360
+ (prev) => prev > 0 ? prev - 1 : itemsCountRef.current - 1
1361
+ );
1362
+ break;
1363
+ case "Home":
1364
+ event.preventDefault();
1365
+ setFocusedIndex(0);
1366
+ break;
1367
+ case "End":
1368
+ event.preventDefault();
1369
+ setFocusedIndex(itemsCountRef.current - 1);
1370
+ break;
1371
+ }
1372
+ };
1373
+ document.addEventListener("keydown", handleKey);
1374
+ setFocusedIndex(0);
1375
+ return () => document.removeEventListener("keydown", handleKey);
1376
+ }, [isOpen]);
1377
+ useEffect4(() => {
1378
+ if (!isOpen)
1379
+ return;
1380
+ const el = menuItemsRef.current[focusedIndex];
1381
+ if (el)
1382
+ el.focus();
1383
+ }, [focusedIndex, isOpen]);
1384
+ const contextValue = {
1385
+ isOpen,
1386
+ setIsOpen,
1387
+ triggerRef,
1388
+ contentRef,
1389
+ focusedIndex,
1390
+ setFocusedIndex,
1391
+ itemsCount: itemsCountRef.current,
1392
+ registerItem,
1393
+ menuItemsRef
1394
+ };
1395
+ return /* @__PURE__ */ React16.createElement(DropdownContext.Provider, { value: contextValue }, /* @__PURE__ */ React16.createElement("div", { className: "relative inline-block text-left" }, children));
1396
+ }
1397
+ function DropdownMenuTrigger({
1398
+ children,
1399
+ isOpen,
1400
+ setIsOpen
1401
+ }) {
1402
+ const ctx = React16.useContext(DropdownContext);
1403
+ const actualIsOpen = (ctx == null ? void 0 : ctx.isOpen) ?? isOpen;
1404
+ const actualSetIsOpen = (ctx == null ? void 0 : ctx.setIsOpen) ?? setIsOpen;
1405
+ const handleKey = (e) => {
1406
+ switch (e.key) {
1407
+ case "Enter":
1408
+ case " ":
1409
+ e.preventDefault();
1410
+ actualSetIsOpen == null ? void 0 : actualSetIsOpen(!actualIsOpen);
1411
+ break;
1412
+ case "ArrowDown":
1413
+ e.preventDefault();
1414
+ actualSetIsOpen == null ? void 0 : actualSetIsOpen(true);
1415
+ break;
1416
+ case "ArrowUp":
1417
+ e.preventDefault();
1418
+ actualSetIsOpen == null ? void 0 : actualSetIsOpen(true);
1419
+ break;
1420
+ }
1421
+ };
1422
+ return /* @__PURE__ */ React16.createElement(
1423
+ "div",
1424
+ {
1425
+ ref: ctx == null ? void 0 : ctx.triggerRef,
1426
+ tabIndex: 0,
1427
+ role: "button",
1428
+ "aria-haspopup": "menu",
1429
+ "aria-expanded": actualIsOpen,
1430
+ onClick: () => actualSetIsOpen == null ? void 0 : actualSetIsOpen(!actualIsOpen),
1431
+ onKeyDown: handleKey,
1432
+ className: "cursor-pointer outline-none focus:ring-2 focus:ring-primary-500 rounded"
1433
+ },
1434
+ children
1435
+ );
1436
+ }
1437
+ function DropdownMenuContent({
1438
+ children,
1439
+ isOpen,
1440
+ align = "right",
1441
+ className = ""
1442
+ }) {
1443
+ const ctx = React16.useContext(DropdownContext);
1444
+ const actualIsOpen = (ctx == null ? void 0 : ctx.isOpen) ?? isOpen;
1445
+ const [visible, setVisible] = useState3(actualIsOpen);
1446
+ useEffect4(() => {
1447
+ if (actualIsOpen)
1448
+ setVisible(true);
1449
+ else
1450
+ setTimeout(() => setVisible(false), 150);
1451
+ }, [actualIsOpen]);
1452
+ if (!visible)
1453
+ return null;
1454
+ const pos = align === "left" || align === "start" ? "right-0" : align === "right" || align === "end" ? "left-0" : align === "center" ? "left-1/2 -translate-x-1/2" : "";
1455
+ return /* @__PURE__ */ React16.createElement(
1456
+ "div",
1457
+ {
1458
+ ref: ctx == null ? void 0 : ctx.contentRef,
1459
+ role: "menu",
1460
+ className: cn(
1461
+ "absolute w-56 mt-2 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 z-50 transition-all",
1462
+ actualIsOpen ? "opacity-100" : "opacity-0 -translate-y-2",
1463
+ pos,
1464
+ className
1465
+ )
1466
+ },
1467
+ children
1468
+ );
1469
+ }
1470
+ function DropdownMenuItemWrapper({
1471
+ children,
1472
+ onClick,
1473
+ onKeyDown,
1474
+ disabled,
1475
+ isSubTrigger,
1476
+ className,
1477
+ "aria-expanded": ariaExpanded
1478
+ }) {
1479
+ const ctx = React16.useContext(DropdownContext);
1480
+ const [index] = useState3(() => (ctx == null ? void 0 : ctx.registerItem()) ?? -1);
1481
+ const ref = useRef2(null);
1482
+ useEffect4(() => {
1483
+ if (ctx && index >= 0) {
1484
+ ctx.menuItemsRef.current[index] = ref.current;
1485
+ }
1486
+ }, [index, ctx]);
1487
+ const handleKey = (e) => {
1488
+ if (onKeyDown)
1489
+ onKeyDown(e);
1490
+ if (e.key === "Enter" || e.key === " ") {
1491
+ e.preventDefault();
1492
+ if (!disabled)
1493
+ onClick == null ? void 0 : onClick();
1494
+ }
1495
+ };
1496
+ return /* @__PURE__ */ React16.createElement(
1497
+ "div",
1498
+ {
1499
+ ref,
1500
+ role: "menuitem",
1501
+ tabIndex: disabled ? -1 : 0,
1502
+ "aria-disabled": disabled,
1503
+ "aria-expanded": ariaExpanded,
1504
+ onClick: () => !disabled && (onClick == null ? void 0 : onClick()),
1505
+ onKeyDown: handleKey,
1506
+ className: cn(
1507
+ "px-4 py-2 flex items-center justify-between text-sm cursor-pointer rounded",
1508
+ disabled ? "text-gray-400 cursor-not-allowed" : "hover:bg-gray-100",
1509
+ className
1510
+ )
1511
+ },
1512
+ children
1513
+ );
1514
+ }
1515
+ function DropdownMenuItem({
1516
+ children,
1517
+ className = "",
1518
+ onClick,
1519
+ disabled,
1520
+ shortcut
1521
+ }) {
1522
+ const ctx = React16.useContext(DropdownContext);
1523
+ return /* @__PURE__ */ React16.createElement(
1524
+ DropdownMenuItemWrapper,
1525
+ {
1526
+ disabled,
1527
+ onClick: () => {
1528
+ if (!disabled) {
1529
+ onClick == null ? void 0 : onClick();
1530
+ ctx == null ? void 0 : ctx.setIsOpen(false);
1531
+ }
1532
+ },
1533
+ className
1534
+ },
1535
+ /* @__PURE__ */ React16.createElement("span", null, children),
1536
+ shortcut && /* @__PURE__ */ React16.createElement("kbd", { className: "text-xs text-gray-400" }, shortcut)
1537
+ );
1538
+ }
1539
+ function DropdownMenuLabel({ children }) {
1540
+ return /* @__PURE__ */ React16.createElement("div", { className: "px-4 py-2 text-sm font-semibold text-gray-700" }, children);
1541
+ }
1542
+ function DropdownMenuSeparator() {
1543
+ return /* @__PURE__ */ React16.createElement("div", { className: "border-t border-gray-100 my-1" });
1544
+ }
1545
+ var SubmenuContext = React16.createContext(null);
1546
+ function DropdownMenuSub({ children }) {
1547
+ const [isSubOpen, setIsSubOpen] = useState3(false);
1548
+ return /* @__PURE__ */ React16.createElement(SubmenuContext.Provider, { value: { isSubOpen, setIsSubOpen } }, /* @__PURE__ */ React16.createElement("div", { className: "relative" }, children));
1549
+ }
1550
+ function DropdownMenuSubTrigger({ children }) {
1551
+ const sub = React16.useContext(SubmenuContext);
1552
+ const handleKey = (e) => {
1553
+ if (e.key === "ArrowRight") {
1554
+ e.preventDefault();
1555
+ sub.setIsSubOpen(true);
1556
+ } else if (e.key === "ArrowLeft") {
1557
+ e.preventDefault();
1558
+ sub.setIsSubOpen(false);
1559
+ }
1560
+ };
1561
+ return /* @__PURE__ */ React16.createElement(
1562
+ DropdownMenuItemWrapper,
1563
+ {
1564
+ isSubTrigger: true,
1565
+ "aria-expanded": sub.isSubOpen,
1566
+ onClick: () => sub.setIsSubOpen(!sub.isSubOpen),
1567
+ onKeyDown: handleKey
1568
+ },
1569
+ /* @__PURE__ */ React16.createElement("span", { className: "flex-1" }, children),
1570
+ /* @__PURE__ */ React16.createElement(
1571
+ RiArrowDownSLine3,
1572
+ {
1573
+ className: cn(
1574
+ "w-4 h-4 transition-transform",
1575
+ sub.isSubOpen && "rotate-180"
1576
+ )
1577
+ }
1578
+ )
1579
+ );
1580
+ }
1581
+ function DropdownMenuSubContent({ children }) {
1582
+ const sub = React16.useContext(SubmenuContext);
1583
+ return /* @__PURE__ */ React16.createElement(
1584
+ "div",
1585
+ {
1586
+ className: cn(
1587
+ "overflow-hidden bg-gray-50 transition-all",
1588
+ sub.isSubOpen ? "max-h-[300px] opacity-100" : "max-h-0 opacity-0"
1589
+ )
1590
+ },
1591
+ children
1592
+ );
1593
+ }
1594
+
950
1595
  // app/components/DropdownWithIcon.tsx
951
- import React14, {
952
- useEffect as useEffect2,
953
- useState as useState3,
1596
+ import React17, {
1597
+ useEffect as useEffect5,
1598
+ useState as useState4,
954
1599
  useMemo as useMemo2,
955
1600
  forwardRef as forwardRef6,
956
- useCallback as useCallback2,
957
- useRef as useRef2,
1601
+ useCallback as useCallback4,
1602
+ useRef as useRef3,
958
1603
  useImperativeHandle as useImperativeHandle2
959
1604
  } from "react";
960
- import { RiErrorWarningLine as RiErrorWarningLine2, RiSearchLine as RiSearchLine2 } from "@remixicon/react";
1605
+ import { RiSearchLine as RiSearchLine2 } from "@remixicon/react";
961
1606
  var defaultRenderItem2 = (option) => {
962
- return /* @__PURE__ */ React14.createElement(MenuItem2, { label: option.label, value: option.value });
1607
+ return /* @__PURE__ */ React17.createElement(MenuItem2, { label: option.label, value: option.value });
963
1608
  };
964
1609
  var DropdownWithIcon = forwardRef6(
965
1610
  ({
1611
+ id = `dropdown-${Math.random().toString(36).substring(2, 11)}`,
966
1612
  options,
967
1613
  selected = [],
968
1614
  setSelected,
969
1615
  search = false,
970
1616
  multiple = false,
1617
+ dropdownText,
971
1618
  renderItem = defaultRenderItem2,
972
1619
  children,
973
1620
  trigger,
974
- // dropdownMenu = false,
975
1621
  position = "top",
976
- // setDropdownMenu = () => {},
977
1622
  width,
978
1623
  info,
979
- dropDownTooltip = false,
980
1624
  dropdownFooter = false,
981
1625
  onApply,
982
1626
  disabled = false,
983
- onReset
1627
+ onReset,
1628
+ footerAction
984
1629
  }, ref) => {
985
- const [searchQuery, setSearchQuery] = useState3("");
986
- const localDropdownRef = useRef2(null);
987
- const [dropdownMenu, setDropdownMenu] = useState3(false);
1630
+ const [searchQuery, setSearchQuery] = useState4("");
1631
+ const localDropdownRef = useRef3(null);
1632
+ const [dropdownMenu, setDropdownMenu] = useState4(false);
988
1633
  useImperativeHandle2(ref, () => localDropdownRef.current);
989
1634
  const memoizedFilteredOptions = useMemo2(() => {
990
1635
  if (!search)
@@ -996,14 +1641,14 @@ var DropdownWithIcon = forwardRef6(
996
1641
  }
997
1642
  );
998
1643
  }, [search, searchQuery, options]);
999
- const handleSearchChange = useCallback2(
1644
+ const handleSearchChange = useCallback4(
1000
1645
  (e) => {
1001
1646
  var _a;
1002
1647
  setSearchQuery((_a = e == null ? void 0 : e.target) == null ? void 0 : _a.value);
1003
1648
  },
1004
1649
  []
1005
1650
  );
1006
- const toggleOption = useCallback2(
1651
+ const toggleOption = useCallback4(
1007
1652
  (option) => {
1008
1653
  if (multiple && setSelected) {
1009
1654
  setSelected(
@@ -1016,7 +1661,7 @@ var DropdownWithIcon = forwardRef6(
1016
1661
  },
1017
1662
  [multiple, setSelected, setDropdownMenu]
1018
1663
  );
1019
- const handleCheckboxChange = useCallback2(
1664
+ const handleCheckboxChange = useCallback4(
1020
1665
  (option) => {
1021
1666
  if (multiple && setSelected) {
1022
1667
  setSelected(
@@ -1042,7 +1687,7 @@ var DropdownWithIcon = forwardRef6(
1042
1687
  setSelected == null ? void 0 : setSelected([]);
1043
1688
  setDropdownMenu(false);
1044
1689
  };
1045
- useEffect2(() => {
1690
+ useEffect5(() => {
1046
1691
  const handleClickOutside = (event) => {
1047
1692
  var _a;
1048
1693
  if ((localDropdownRef == null ? void 0 : localDropdownRef.current) && !((_a = localDropdownRef == null ? void 0 : localDropdownRef.current) == null ? void 0 : _a.contains(event == null ? void 0 : event.target))) {
@@ -1054,9 +1699,10 @@ var DropdownWithIcon = forwardRef6(
1054
1699
  document == null ? void 0 : document.removeEventListener("mousedown", handleClickOutside);
1055
1700
  };
1056
1701
  }, [setDropdownMenu]);
1057
- return /* @__PURE__ */ React14.createElement(
1702
+ return /* @__PURE__ */ React17.createElement(
1058
1703
  "div",
1059
1704
  {
1705
+ id,
1060
1706
  ref: localDropdownRef,
1061
1707
  className: cn(
1062
1708
  "relative",
@@ -1067,14 +1713,42 @@ var DropdownWithIcon = forwardRef6(
1067
1713
  width
1068
1714
  }
1069
1715
  },
1070
- /* @__PURE__ */ React14.createElement("div", { onClick: () => !disabled && setDropdownMenu((prev) => !prev) }, trigger),
1071
- /* @__PURE__ */ React14.createElement(
1716
+ /* @__PURE__ */ React17.createElement(
1717
+ "button",
1718
+ {
1719
+ type: "button",
1720
+ "aria-haspopup": "listbox",
1721
+ "aria-expanded": dropdownMenu,
1722
+ "aria-labelledby": `${id}-label`,
1723
+ disabled,
1724
+ onClick: () => !disabled && setDropdownMenu((prev) => !prev),
1725
+ onKeyDown: (e) => {
1726
+ if (e.key === "Enter" || e.key === " ") {
1727
+ e.preventDefault();
1728
+ !disabled && setDropdownMenu((prev) => !prev);
1729
+ }
1730
+ },
1731
+ className: cn(
1732
+ "w-full",
1733
+ disabled && "cursor-not-allowed opacity-50",
1734
+ dropdownText && "flex items-center gap-2"
1735
+ )
1736
+ },
1737
+ trigger,
1738
+ dropdownText && /* @__PURE__ */ React17.createElement("span", { id: `${id}-label`, className: "text-sm text-gray-800" }, dropdownText)
1739
+ ),
1740
+ /* @__PURE__ */ React17.createElement(
1072
1741
  "ul",
1073
1742
  {
1743
+ role: "listbox",
1744
+ "aria-multiselectable": multiple,
1745
+ "aria-labelledby": `${id}-label`,
1746
+ tabIndex: -1,
1074
1747
  className: cn(
1075
1748
  "max-h-0 opacity-0 overflow-hidden shadow-sm mt-1 rounded absolute text-[16px] bg-white z-[1000] w-full transition-all duration-75 delay-100 ease-in",
1749
+ dropdownMenu ? "border border-primary-600" : "border border-gray-200",
1076
1750
  position === "top" ? "top-10" : position === "bottom" ? "bottom-10" : position === "left" ? "left-0" : position === "right" ? "right-[90%]" : "top-10",
1077
- dropdownMenu && "max-h-[320px] opacity-[1] transition-all ease-in duration-150"
1751
+ dropdownMenu && "max-h-[360px] h-fit opacity-[1] transition-all ease-in duration-150"
1078
1752
  ),
1079
1753
  style: {
1080
1754
  width,
@@ -1082,104 +1756,135 @@ var DropdownWithIcon = forwardRef6(
1082
1756
  top: "calc(100% + 4px)"
1083
1757
  }
1084
1758
  },
1085
- search && /* @__PURE__ */ React14.createElement(
1759
+ search && /* @__PURE__ */ React17.createElement(
1086
1760
  Input_default,
1087
1761
  {
1762
+ id: `${id}-search`,
1088
1763
  type: "text",
1089
1764
  placeholder: "Search...",
1765
+ "aria-label": "Search options",
1090
1766
  value: searchQuery,
1091
1767
  onChange: handleSearchChange,
1092
- className: "rounded rounded-b-none text-gray-800 bg-white w-full h-[35px] pl-3",
1093
- endIcon: /* @__PURE__ */ React14.createElement(RiSearchLine2, { size: 18 })
1768
+ className: "rounded rounded-b-none text-gray-800 bg-white w-full h-[35px] pl-3 border-none",
1769
+ endIcon: /* @__PURE__ */ React17.createElement(RiSearchLine2, { size: 18 })
1094
1770
  }
1095
1771
  ),
1096
- multiple && /* @__PURE__ */ React14.createElement("section", { className: "py-[6px] px-[14px] flex justify-between items-center" }, /* @__PURE__ */ React14.createElement(
1097
- "p",
1772
+ multiple && /* @__PURE__ */ React17.createElement("section", { className: "py-[6px] px-[14px] flex justify-between items-center" }, /* @__PURE__ */ React17.createElement(
1773
+ "button",
1098
1774
  {
1775
+ type: "button",
1776
+ "aria-label": "Select all",
1099
1777
  onClick: handleSelectAll,
1100
- className: "text-text-sm hover:text-primary-700 text-primary-600 cursor-pointer"
1778
+ className: "text-text-sm hover:text-primary-700 text-primary-600 cursor-pointer"
1101
1779
  },
1102
1780
  "Select all"
1103
- ), /* @__PURE__ */ React14.createElement(
1781
+ ), /* @__PURE__ */ React17.createElement(
1104
1782
  "button",
1105
1783
  {
1784
+ "aria-label": "Reset",
1785
+ type: "button",
1106
1786
  className: "text-text-sm text-warning-500 hover:text-warning-600",
1107
1787
  onClick: handleReset
1108
1788
  },
1109
1789
  "Reset"
1110
1790
  )),
1111
- /* @__PURE__ */ React14.createElement("section", { className: "max-h-[200px] z-[1000] transition-all duration-75 delay-100 ease-in-out overflow-y-scroll" }, options ? memoizedFilteredOptions == null ? void 0 : memoizedFilteredOptions.map((option, i) => {
1791
+ /* @__PURE__ */ React17.createElement("section", { className: "max-h-[200px] z-[1000] transition-all duration-75 delay-100 ease-in-out overflow-y-scroll" }, options ? memoizedFilteredOptions == null ? void 0 : memoizedFilteredOptions.map((option, i) => {
1112
1792
  var _a;
1113
- return /* @__PURE__ */ React14.createElement(React14.Fragment, { key: i }, multiple ? /* @__PURE__ */ React14.createElement(
1793
+ return /* @__PURE__ */ React17.createElement(React17.Fragment, { key: i }, multiple ? /* @__PURE__ */ React17.createElement(
1114
1794
  Label_default,
1115
1795
  {
1116
- className: "has-[:checked]:bg-primary-50 has-[:checked]:border-primary-600 hover:bg-gray-50 flex flex-col py-[6px] px-[14px] break-words cursor-pointer border-l-4 border-transparent",
1117
- htmlFor: `checkbox-${option == null ? void 0 : option.value}`,
1796
+ className: cn(
1797
+ "has-[:checked]:bg-primary-50 has-[:checked]:border-primary-600 hover:bg-gray-50 flex flex-col py-[6px] px-[14px] break-words cursor-pointer border-l-4 border-transparent",
1798
+ (option == null ? void 0 : option.disabledOption) && "opacity-50 cursor-not-allowed hover:bg-white text-gray-300 select-none"
1799
+ ),
1800
+ htmlFor: `${id}-checkbox-${option.value}`,
1118
1801
  key: i
1119
1802
  },
1120
- /* @__PURE__ */ React14.createElement("section", { className: "flex items-center justify-between gap-2 w-full" }, /* @__PURE__ */ React14.createElement("div", { className: "flex gap-2" }, /* @__PURE__ */ React14.createElement(
1803
+ /* @__PURE__ */ React17.createElement("section", { className: "flex items-center justify-between gap-2 w-full" }, /* @__PURE__ */ React17.createElement("div", { className: "flex gap-2" }, /* @__PURE__ */ React17.createElement(
1121
1804
  Checkbox_default,
1122
1805
  {
1123
- id: `checkbox-${option == null ? void 0 : option.value}`,
1806
+ id: `${id}-checkbox-${option.value}`,
1124
1807
  checked: selected == null ? void 0 : selected.some(
1125
1808
  (item) => (item == null ? void 0 : item.value) === (option == null ? void 0 : option.value)
1126
1809
  ),
1127
- onChange: () => handleCheckboxChange(option)
1810
+ onChange: () => handleCheckboxChange(option),
1811
+ disabled: option == null ? void 0 : option.disabledOption
1128
1812
  }
1129
- ), /* @__PURE__ */ React14.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ React14.createElement("div", { className: "break-words" }, renderItem(option)), dropDownTooltip && /* @__PURE__ */ React14.createElement(
1130
- DropdownTooltip2,
1813
+ ), /* @__PURE__ */ React17.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ React17.createElement(
1814
+ "div",
1131
1815
  {
1132
- tooltipContent: option == null ? void 0 : option.tooltipContent
1133
- }
1134
- ))), /* @__PURE__ */ React14.createElement("span", { className: "text-gray-500" }, option == null ? void 0 : option.info)),
1135
- /* @__PURE__ */ React14.createElement("span", { className: "pt-[2px] text-text-sm text-gray-500" }, option == null ? void 0 : option.addInfo)
1136
- ) : /* @__PURE__ */ React14.createElement(
1816
+ style: {
1817
+ color: (option == null ? void 0 : option.disabledOption) ? "#D1D5DB" : option.labelTextColor
1818
+ },
1819
+ className: cn(
1820
+ "break-words",
1821
+ (option == null ? void 0 : option.disabledOption) && "text-gray-300"
1822
+ )
1823
+ },
1824
+ renderItem(option)
1825
+ ))), /* @__PURE__ */ React17.createElement("span", { className: "text-gray-500" }, option == null ? void 0 : option.info)),
1826
+ /* @__PURE__ */ React17.createElement("span", { className: "pt-[2px] text-text-sm text-gray-500" }, option == null ? void 0 : option.addInfo)
1827
+ ) : /* @__PURE__ */ React17.createElement(
1137
1828
  Label_default,
1138
1829
  {
1830
+ htmlFor: `${id}-checkbox-${option.value}`,
1139
1831
  key: i,
1140
1832
  className: cn(
1141
1833
  "flex justify-between py-[6px] px-[14px] hover:bg-gray-50 gap-2 items-center border-l-4 border-transparent cursor-pointer",
1142
1834
  {
1143
- "bg-primary-50 border-primary-600": selected && ((_a = selected[0]) == null ? void 0 : _a.value) === (option == null ? void 0 : option.value)
1835
+ "bg-primary-50 border-primary-600": selected && ((_a = selected[0]) == null ? void 0 : _a.value) === (option == null ? void 0 : option.value),
1836
+ "opacity-50 cursor-not-allowed hover:bg-white text-gray-500": option == null ? void 0 : option.disabledOption
1144
1837
  }
1145
1838
  ),
1146
- onClick: () => toggleOption(option)
1839
+ onClick: () => !(option == null ? void 0 : option.disabledOption) && toggleOption(option)
1147
1840
  },
1148
- /* @__PURE__ */ React14.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ React14.createElement("span", null, renderItem(option)), dropDownTooltip && /* @__PURE__ */ React14.createElement(
1149
- DropdownTooltip2,
1841
+ /* @__PURE__ */ React17.createElement(
1842
+ "div",
1150
1843
  {
1151
- tooltipContent: option == null ? void 0 : option.tooltipContent
1152
- }
1153
- )),
1154
- /* @__PURE__ */ React14.createElement("span", { className: "text-gray-500" }, info)
1844
+ style: {
1845
+ color: (option == null ? void 0 : option.disabledOption) ? "#D1D5DB" : option.labelTextColor
1846
+ },
1847
+ className: cn(
1848
+ "break-words",
1849
+ (option == null ? void 0 : option.disabledOption) && "text-gray-300"
1850
+ )
1851
+ },
1852
+ renderItem(option)
1853
+ ),
1854
+ /* @__PURE__ */ React17.createElement("span", { className: "text-gray-500" }, info)
1155
1855
  ));
1156
1856
  }) : children),
1157
- dropdownFooter && /* @__PURE__ */ React14.createElement(DropdownFooter2, { onApply })
1857
+ footerAction && /* @__PURE__ */ React17.createElement("div", { className: "py-2 mt-1 px-2 border-t" }, footerAction),
1858
+ dropdownFooter && /* @__PURE__ */ React17.createElement(
1859
+ DropdownFooter2,
1860
+ {
1861
+ setDropdownMenu,
1862
+ onApply
1863
+ }
1864
+ )
1158
1865
  )
1159
1866
  );
1160
1867
  }
1161
1868
  );
1162
1869
  var MenuItem2 = ({ label, children }) => {
1163
- return /* @__PURE__ */ React14.createElement("p", { className: "break-all" }, label || children);
1164
- };
1165
- var DropdownTooltip2 = ({
1166
- tooltipContent
1167
- }) => {
1168
- return tooltipContent ? /* @__PURE__ */ React14.createElement(Tooltip_default, { position: "right", content: tooltipContent }, /* @__PURE__ */ React14.createElement(RiErrorWarningLine2, { color: "#98A2B3", size: 14 })) : null;
1870
+ return /* @__PURE__ */ React17.createElement("p", { className: "break-all" }, label || children);
1169
1871
  };
1170
1872
  var DropdownFooter2 = ({
1171
1873
  onApply,
1172
1874
  setDropdownMenu
1173
1875
  }) => {
1174
- return /* @__PURE__ */ React14.createElement("div", { className: "flex justify-between border-t border-gray-200 px-[14px] py-[8px] text-text-sm" }, /* @__PURE__ */ React14.createElement(
1876
+ return /* @__PURE__ */ React17.createElement("div", { className: "flex justify-end border-t border-gray-200 px-[14px] py-[8px] text-text-sm" }, /* @__PURE__ */ React17.createElement(
1175
1877
  "button",
1176
1878
  {
1879
+ type: "button",
1177
1880
  className: "text-primary-600 hover:text-primary-700",
1178
1881
  onClick: () => {
1179
1882
  if (onApply) {
1180
1883
  onApply();
1181
1884
  }
1182
- setDropdownMenu(false);
1885
+ if (setDropdownMenu) {
1886
+ setDropdownMenu(false);
1887
+ }
1183
1888
  }
1184
1889
  },
1185
1890
  "Apply"
@@ -1188,21 +1893,56 @@ var DropdownFooter2 = ({
1188
1893
  DropdownWithIcon.displayName = "DropdownWithIcon";
1189
1894
  var DropdownWithIcon_default = DropdownWithIcon;
1190
1895
 
1896
+ // app/components/FileSelector.tsx
1897
+ import React18, { forwardRef as forwardRef7, useRef as useRef4 } from "react";
1898
+ var FileSelector = forwardRef7(
1899
+ ({ component, ...props }, ref) => {
1900
+ const internalRef = useRef4(null);
1901
+ const inputRef = ref || internalRef;
1902
+ const handleClick = () => {
1903
+ var _a;
1904
+ (_a = inputRef.current) == null ? void 0 : _a.click();
1905
+ };
1906
+ return /* @__PURE__ */ React18.createElement(
1907
+ "div",
1908
+ {
1909
+ onClick: handleClick,
1910
+ style: { display: "inline-block", cursor: "pointer" }
1911
+ },
1912
+ /* @__PURE__ */ React18.createElement(
1913
+ "input",
1914
+ {
1915
+ type: "file",
1916
+ ref: inputRef,
1917
+ ...props,
1918
+ style: { display: "none" }
1919
+ }
1920
+ ),
1921
+ component
1922
+ );
1923
+ }
1924
+ );
1925
+ FileSelector.displayName = "FileSelector";
1926
+ var FileSelector_default = FileSelector;
1927
+
1191
1928
  // app/components/FileUpload.tsx
1192
- import React15, { forwardRef as forwardRef7 } from "react";
1929
+ import React20, { forwardRef as forwardRef8, useState as useState5 } from "react";
1930
+ import { RiUpload2Line } from "@remixicon/react";
1931
+
1932
+ // app/components/FileUploadPreview.tsx
1193
1933
  import {
1194
- RiFileLine,
1195
- RiUpload2Line,
1196
1934
  RiDeleteBinLine,
1197
- RiMusic2Line,
1198
- RiVideoLine,
1199
- RiImageLine,
1200
1935
  RiFileExcel2Line,
1201
- RiFileWord2Line,
1936
+ RiFileLine,
1937
+ RiFilePdf2Line,
1202
1938
  RiFilePpt2Line,
1939
+ RiFileWord2Line,
1203
1940
  RiFileZipLine,
1204
- RiFilePdf2Line
1941
+ RiImageLine,
1942
+ RiMusic2Line,
1943
+ RiVideoLine
1205
1944
  } from "@remixicon/react";
1945
+ import React19 from "react";
1206
1946
  var getIconForMimeType = (file) => {
1207
1947
  var _a;
1208
1948
  const fileName = typeof file === "string" ? file : file.name;
@@ -1215,65 +1955,109 @@ var getIconForMimeType = (file) => {
1215
1955
  case "gif":
1216
1956
  case "svg":
1217
1957
  case "webp":
1218
- iconComponent = /* @__PURE__ */ React15.createElement(RiImageLine, { className: "text-primary-600 bg-primary-100 border-4 border-primary-50 w-8 h-8 p-1 rounded-full" });
1958
+ iconComponent = /* @__PURE__ */ React19.createElement(RiImageLine, { className: "text-primary-600 bg-primary-100 border-4 border-primary-50 w-8 h-8 p-1 rounded-full" });
1219
1959
  break;
1220
1960
  case "mp3":
1221
1961
  case "wav":
1222
1962
  case "ogg":
1223
- iconComponent = /* @__PURE__ */ React15.createElement(RiMusic2Line, { className: "text-primary-600 bg-primary-100 border-4 border-primary-50 w-8 h-8 p-1 rounded-full" });
1963
+ iconComponent = /* @__PURE__ */ React19.createElement(RiMusic2Line, { className: "text-primary-600 bg-primary-100 border-4 border-primary-50 w-8 h-8 p-1 rounded-full" });
1224
1964
  break;
1225
1965
  case "mp4":
1226
1966
  case "avi":
1227
1967
  case "mkv":
1228
- iconComponent = /* @__PURE__ */ React15.createElement(RiVideoLine, { className: "text-primary-600 bg-primary-100 border-4 border-primary-50 w-8 h-8 p-1 rounded-full" });
1968
+ iconComponent = /* @__PURE__ */ React19.createElement(RiVideoLine, { className: "text-primary-600 bg-primary-100 border-4 border-primary-50 w-8 h-8 p-1 rounded-full" });
1229
1969
  break;
1230
1970
  case "xls":
1231
1971
  case "xlsx":
1232
1972
  case "csv":
1233
1973
  case "txt":
1234
1974
  case "ods":
1235
- iconComponent = /* @__PURE__ */ React15.createElement(RiFileExcel2Line, { className: "text-primary-600 bg-primary-100 border-4 border-primary-50 w-8 h-8 p-1 rounded-full" });
1975
+ iconComponent = /* @__PURE__ */ React19.createElement(RiFileExcel2Line, { className: "text-primary-600 bg-primary-100 border-4 border-primary-50 w-8 h-8 p-1 rounded-full" });
1236
1976
  break;
1237
1977
  case "doc":
1238
1978
  case "docx":
1239
1979
  case "odt":
1240
1980
  case "xml":
1241
- iconComponent = /* @__PURE__ */ React15.createElement(RiFileWord2Line, { className: "text-primary-600 bg-primary-100 border-4 border-primary-50 w-8 h-8 p-1 rounded-full" });
1981
+ iconComponent = /* @__PURE__ */ React19.createElement(RiFileWord2Line, { className: "text-primary-600 bg-primary-100 border-4 border-primary-50 w-8 h-8 p-1 rounded-full" });
1242
1982
  break;
1243
1983
  case "pptx":
1244
1984
  case "pptm":
1245
1985
  case "xps":
1246
1986
  case "ppsx":
1247
- iconComponent = /* @__PURE__ */ React15.createElement(RiFilePpt2Line, { className: "text-primary-600 bg-primary-100 border-4 border-primary-50 w-8 h-8 p-1 rounded-full" });
1987
+ iconComponent = /* @__PURE__ */ React19.createElement(RiFilePpt2Line, { className: "text-primary-600 bg-primary-100 border-4 border-primary-50 w-8 h-8 p-1 rounded-full" });
1248
1988
  break;
1249
1989
  case "rar":
1250
1990
  case "zip":
1251
- iconComponent = /* @__PURE__ */ React15.createElement(RiFileZipLine, { className: "text-primary-600 bg-primary-100 border-4 border-primary-50 w-8 h-8 p-1 rounded-full" });
1991
+ iconComponent = /* @__PURE__ */ React19.createElement(RiFileZipLine, { className: "text-primary-600 bg-primary-100 border-4 border-primary-50 w-8 h-8 p-1 rounded-full" });
1252
1992
  break;
1253
1993
  case "pdf":
1254
- iconComponent = /* @__PURE__ */ React15.createElement(RiFilePdf2Line, { className: "text-primary-600 bg-primary-100 border-4 border-primary-50 w-8 h-8 p-1 rounded-full" });
1994
+ iconComponent = /* @__PURE__ */ React19.createElement(RiFilePdf2Line, { className: "text-primary-600 bg-primary-100 border-4 border-primary-50 w-8 h-8 p-1 rounded-full" });
1255
1995
  break;
1256
1996
  default:
1257
- iconComponent = /* @__PURE__ */ React15.createElement(RiFileLine, { className: "text-primary-600 bg-primary-100 border-4 border-primary-50 w-8 h-8 p-1 rounded-full" });
1997
+ iconComponent = /* @__PURE__ */ React19.createElement(RiFileLine, { className: "text-primary-600 bg-primary-100 border-4 border-primary-50 w-8 h-8 p-1 rounded-full" });
1258
1998
  break;
1259
1999
  }
1260
2000
  return iconComponent;
1261
2001
  };
1262
- var FileUpload = forwardRef7(
2002
+ var FileUploadPreview = ({
2003
+ index,
2004
+ file,
2005
+ children,
2006
+ onDelete
2007
+ }) => {
2008
+ return /* @__PURE__ */ React19.createElement(
2009
+ "div",
2010
+ {
2011
+ key: index,
2012
+ className: "p-4 border border-gray-200 rounded-lg flex items-center justify-between gap-5"
2013
+ },
2014
+ /* @__PURE__ */ React19.createElement("div", { className: "flex items-center gap-2 w-full" }, getIconForMimeType(file), /* @__PURE__ */ React19.createElement("div", { className: "flex flex-col gap-1 w-full" }, /* @__PURE__ */ React19.createElement("p", { className: "text-sm line-clamp-2 break-all" }, typeof file === "string" ? file : file.name, " "), children && /* @__PURE__ */ React19.createElement("div", { className: "w-full" }, children))),
2015
+ /* @__PURE__ */ React19.createElement("button", { type: "button", onClick: () => onDelete == null ? void 0 : onDelete(index) }, /* @__PURE__ */ React19.createElement(RiDeleteBinLine, { className: "text-gray-500 w-5 h-5 cursor-pointer" }))
2016
+ );
2017
+ };
2018
+ var FileUploadPreview_default = FileUploadPreview;
2019
+
2020
+ // app/components/FileUpload.tsx
2021
+ var FileUpload = forwardRef8(
1263
2022
  ({
1264
2023
  selectedFile,
2024
+ setSelectedFile,
1265
2025
  onChange,
1266
2026
  multiple,
1267
2027
  onDelete,
1268
2028
  children,
1269
2029
  disabled,
1270
2030
  title,
2031
+ filePreviewClassName,
1271
2032
  id,
1272
2033
  className,
1273
2034
  accept,
1274
2035
  ...props
1275
2036
  }, ref) => {
1276
- return /* @__PURE__ */ React15.createElement("div", { className: "flex flex-col gap-2 " }, /* @__PURE__ */ React15.createElement(
2037
+ const [isDragging, setIsDragging] = useState5(false);
2038
+ const handleDragOver = (e) => {
2039
+ e.preventDefault();
2040
+ if (!disabled)
2041
+ setIsDragging(true);
2042
+ };
2043
+ const handleDragLeave = () => {
2044
+ setIsDragging(false);
2045
+ };
2046
+ const handleDrop = (e) => {
2047
+ e.preventDefault();
2048
+ setIsDragging(false);
2049
+ if (disabled)
2050
+ return;
2051
+ const files = Array.from(e.dataTransfer.files);
2052
+ if (files.length === 0)
2053
+ return;
2054
+ if (multiple) {
2055
+ setSelectedFile && setSelectedFile([...selectedFile || [], ...files]);
2056
+ } else {
2057
+ setSelectedFile && setSelectedFile([files[0]]);
2058
+ }
2059
+ };
2060
+ return /* @__PURE__ */ React20.createElement("div", { className: "flex flex-col gap-2" }, /* @__PURE__ */ React20.createElement(
1277
2061
  "input",
1278
2062
  {
1279
2063
  type: "file",
@@ -1286,33 +2070,40 @@ var FileUpload = forwardRef7(
1286
2070
  hidden: true,
1287
2071
  ref
1288
2072
  }
1289
- ), /* @__PURE__ */ React15.createElement(
2073
+ ), /* @__PURE__ */ React20.createElement(
1290
2074
  Label_default,
1291
2075
  {
1292
2076
  htmlFor: id,
1293
2077
  disabled,
2078
+ role: "button",
2079
+ "aria-label": `Upload ${multiple ? "files" : "file"}`,
2080
+ tabIndex: 0,
2081
+ onKeyDown: (e) => {
2082
+ if (e.key === "Enter" || e.key === " ") {
2083
+ e.preventDefault();
2084
+ e.currentTarget.click();
2085
+ }
2086
+ },
2087
+ onDragOver: handleDragOver,
2088
+ onDragLeave: handleDragLeave,
2089
+ onDrop: handleDrop,
1294
2090
  className: cn(
1295
- "w-full h-[126px] border-2 border-dashed border-gray-200 hover:bg-gray-200 cursor-pointer rounded-lg px-6 py-4 flex flex-col items-center gap-2",
2091
+ "w-full h-[126px] border-2 border-dashed border-gray-200 hover:bg-gray-200 cursor-pointer rounded-lg px-6 py-4 flex items-center justify-center transition-all",
2092
+ isDragging && "border-primary-500 bg-primary-50",
1296
2093
  disabled && "pointer-events-none",
1297
2094
  className
1298
2095
  )
1299
2096
  },
1300
- /* @__PURE__ */ React15.createElement("div", { className: "w-10 h-10 border-[6px] border-gray-50 bg-gray-200 rounded-full p-1 flex justify-center items-center" }, /* @__PURE__ */ React15.createElement(RiUpload2Line, { className: "w-5 h-5" })),
1301
- /* @__PURE__ */ React15.createElement("p", { className: "text-center text-sm text-gray-600" }, /* @__PURE__ */ React15.createElement("span", { className: "text-primary-600 font-semibold" }, "Click to upload"), " ", /* @__PURE__ */ React15.createElement("br", null), " ", title)
1302
- ), /* @__PURE__ */ React15.createElement("div", { className: "flex flex-col gap-2" }, selectedFile == null ? void 0 : selectedFile.map((file, index) => /* @__PURE__ */ React15.createElement(
1303
- "div",
2097
+ /* @__PURE__ */ React20.createElement("div", { className: cn("grid grid-cols-1 place-items-center gap-2") }, /* @__PURE__ */ React20.createElement("div", { className: "w-10 h-10 border-[6px] border-gray-50 bg-gray-200 rounded-full p-1 flex justify-center items-center" }, /* @__PURE__ */ React20.createElement(RiUpload2Line, { className: "w-5 h-5" })), /* @__PURE__ */ React20.createElement("div", null, /* @__PURE__ */ React20.createElement("p", { className: "text-center text-sm text-gray-600" }, /* @__PURE__ */ React20.createElement("span", { className: "text-primary-600 font-semibold" }, "Click to upload or drag and drop"), " ", /* @__PURE__ */ React20.createElement("br", null), " ", title)))
2098
+ ), /* @__PURE__ */ React20.createElement("section", { className: cn(`grid gap-2`, filePreviewClassName) }, selectedFile == null ? void 0 : selectedFile.map((file, index) => /* @__PURE__ */ React20.createElement(
2099
+ FileUploadPreview_default,
1304
2100
  {
1305
- key: index,
1306
- className: "p-4 border border-gray-200 rounded-lg flex items-center justify-between gap-5"
2101
+ key: file.name || index,
2102
+ file,
2103
+ index,
2104
+ onDelete
1307
2105
  },
1308
- /* @__PURE__ */ React15.createElement("div", { className: "flex items-center gap-2 w-full" }, getIconForMimeType(file), /* @__PURE__ */ React15.createElement("div", { className: "flex flex-col gap-1 w-full" }, /* @__PURE__ */ React15.createElement("p", { className: "text-sm line-clamp-2 break-all" }, typeof file === "string" ? file : file.name, " "), /* @__PURE__ */ React15.createElement("div", { className: "w-full" }, children))),
1309
- /* @__PURE__ */ React15.createElement(
1310
- RiDeleteBinLine,
1311
- {
1312
- onClick: onDelete,
1313
- className: "text-gray-500 w-5 h-5 cursor-pointer"
1314
- }
1315
- )
2106
+ children
1316
2107
  ))));
1317
2108
  }
1318
2109
  );
@@ -1320,8 +2111,8 @@ FileUpload.displayName = "FileUpload";
1320
2111
  var FileUpload_default = FileUpload;
1321
2112
 
1322
2113
  // app/components/GlobalNavigation.tsx
1323
- import React16, { useEffect as useEffect3, useRef as useRef3, forwardRef as forwardRef8 } from "react";
1324
- var GlobalNavigation = forwardRef8(
2114
+ import React21, { useEffect as useEffect6, useRef as useRef5, forwardRef as forwardRef9 } from "react";
2115
+ var GlobalNavigation = forwardRef9(
1325
2116
  ({
1326
2117
  isOpen,
1327
2118
  setIsOpen,
@@ -1330,27 +2121,30 @@ var GlobalNavigation = forwardRef8(
1330
2121
  className,
1331
2122
  postion = "bottom-right"
1332
2123
  }, ref) => {
1333
- const popoverRef = useRef3(null);
1334
- useEffect3(() => {
2124
+ const triggerRef = useRef5(null);
2125
+ const contentRef = useRef5(null);
2126
+ useEffect6(() => {
1335
2127
  const handleClickOutside = (event) => {
1336
- if (popoverRef.current && !popoverRef.current.contains(event.target)) {
2128
+ var _a, _b;
2129
+ if (!((_a = triggerRef.current) == null ? void 0 : _a.contains(event.target)) && !((_b = contentRef.current) == null ? void 0 : _b.contains(event.target))) {
1337
2130
  setIsOpen(false);
1338
2131
  }
1339
2132
  };
1340
2133
  document.addEventListener("mousedown", handleClickOutside);
1341
2134
  return () => document.removeEventListener("mousedown", handleClickOutside);
1342
- }, []);
1343
- return /* @__PURE__ */ React16.createElement("div", { className: "relative w-max", ref }, /* @__PURE__ */ React16.createElement(
2135
+ }, [setIsOpen]);
2136
+ return /* @__PURE__ */ React21.createElement("div", { className: "relative w-max", ref }, /* @__PURE__ */ React21.createElement(
1344
2137
  "div",
1345
2138
  {
1346
2139
  className: "cursor-pointer",
1347
- ref: popoverRef,
2140
+ ref: triggerRef,
1348
2141
  onClick: () => setIsOpen(!isOpen)
1349
2142
  },
1350
2143
  trigger
1351
- ), isOpen && /* @__PURE__ */ React16.createElement(
2144
+ ), isOpen && /* @__PURE__ */ React21.createElement(
1352
2145
  "div",
1353
2146
  {
2147
+ ref: contentRef,
1354
2148
  className: cn(
1355
2149
  "absolute z-10 bg-white rounded-lg shadow-sm border min-w-[200px] p-4 transition-all duration-300 ease-in-out",
1356
2150
  postion === "bottom-left" && "left-0 top-4/4",
@@ -1368,9 +2162,9 @@ GlobalNavigation.displayName = "GlobalNavigation";
1368
2162
  var GlobalNavigation_default = GlobalNavigation;
1369
2163
 
1370
2164
  // app/components/HelperText.tsx
1371
- import React17 from "react";
2165
+ import React22 from "react";
1372
2166
  var HelperText = ({ children, className, size, error }) => {
1373
- return /* @__PURE__ */ React17.createElement(
2167
+ return /* @__PURE__ */ React22.createElement(
1374
2168
  "span",
1375
2169
  {
1376
2170
  className: cn(
@@ -1387,42 +2181,134 @@ var HelperText_default = HelperText;
1387
2181
 
1388
2182
  // app/components/ListItem.tsx
1389
2183
  import Link from "next/link";
1390
- import React18 from "react";
1391
- var ListItem = React18.forwardRef(({ className, title, href, onClick, as = "link", icon }, ref) => {
2184
+ import React23 from "react";
2185
+ var ListItem = React23.forwardRef(({ className, title, href, onClick, as = "link", icon }, ref) => {
2186
+ const commonClasses = cn(
2187
+ "px-4 py-[8px] w-full flex items-center gap-2 focus:outline-none focus:ring-2 focus:ring-primary-600 focus-visible:ring-2 rounded",
2188
+ className
2189
+ );
1392
2190
  if (as === "button") {
1393
- return /* @__PURE__ */ React18.createElement(
2191
+ return /* @__PURE__ */ React23.createElement(
1394
2192
  "button",
1395
2193
  {
1396
- className: cn(
1397
- "px-4 py-[8px] w-full text-left flex items-center gap-2",
1398
- className
1399
- ),
2194
+ className: commonClasses,
1400
2195
  onClick,
1401
- ref
2196
+ ref,
2197
+ type: "button",
2198
+ role: "menuitem"
1402
2199
  },
1403
- /* @__PURE__ */ React18.createElement("h1", null, title),
1404
- icon && /* @__PURE__ */ React18.createElement("span", null, icon)
2200
+ /* @__PURE__ */ React23.createElement("span", { className: "text-base font-normal" }, title),
2201
+ icon && /* @__PURE__ */ React23.createElement("span", { className: "flex-shrink-0", "aria-hidden": "true" }, icon)
1405
2202
  );
1406
2203
  }
1407
- return /* @__PURE__ */ React18.createElement(
2204
+ return /* @__PURE__ */ React23.createElement(
1408
2205
  Link,
1409
2206
  {
1410
2207
  href: href ?? "",
1411
- passHref: true,
1412
- className: cn("px-4 py-[8px] w-full flex items-center gap-2", className),
1413
- ref
2208
+ className: commonClasses,
2209
+ ref,
2210
+ role: "menuitem",
2211
+ onClick: (e) => {
2212
+ if (!href) {
2213
+ e.preventDefault();
2214
+ }
2215
+ }
1414
2216
  },
1415
- /* @__PURE__ */ React18.createElement("h1", null, title),
1416
- icon && /* @__PURE__ */ React18.createElement("p", null, icon)
2217
+ /* @__PURE__ */ React23.createElement("span", { className: "text-base font-normal" }, title),
2218
+ icon && /* @__PURE__ */ React23.createElement("span", { className: "flex-shrink-0", "aria-hidden": "true" }, icon)
1417
2219
  );
1418
2220
  });
1419
2221
  ListItem.displayName = "ListItem";
1420
2222
  var ListItem_default = ListItem;
1421
2223
 
2224
+ // app/components/ListPagination.tsx
2225
+ import React24, { useState as useState6 } from "react";
2226
+ import { RiArrowLeftSLine, RiArrowRightSLine } from "@remixicon/react";
2227
+ var ListPagination = ({
2228
+ count,
2229
+ page,
2230
+ rowsPerPage,
2231
+ onPageChange,
2232
+ className
2233
+ }) => {
2234
+ const totalPages = Math.ceil(count / rowsPerPage);
2235
+ const [expanded, setExpanded] = useState6(false);
2236
+ const renderPages = () => {
2237
+ if (totalPages <= 6 || expanded) {
2238
+ return [...Array(totalPages)].map((_, i) => /* @__PURE__ */ React24.createElement(PageBtn, { key: i, i, page, onPageChange }));
2239
+ }
2240
+ const start = [0, 1];
2241
+ const mid = [page - 1, page, page + 1].filter(
2242
+ (i) => i > 1 && i < totalPages - 2
2243
+ );
2244
+ const end = [totalPages - 2, totalPages - 1];
2245
+ const range = Array.from(/* @__PURE__ */ new Set([...start, ...mid, ...end]));
2246
+ return range.map(
2247
+ (i, idx) => typeof range[idx - 1] === "number" && i - range[idx - 1] > 1 ? /* @__PURE__ */ React24.createElement(
2248
+ Button_default,
2249
+ {
2250
+ key: `dots-${i}`,
2251
+ size: "sm",
2252
+ variant: "outlined",
2253
+ onClick: () => setExpanded(true)
2254
+ },
2255
+ "..."
2256
+ ) : /* @__PURE__ */ React24.createElement(PageBtn, { key: i, i, page, onPageChange })
2257
+ );
2258
+ };
2259
+ return /* @__PURE__ */ React24.createElement("section", { className: cn("flex items-center gap-1", className) }, /* @__PURE__ */ React24.createElement(
2260
+ NavBtn,
2261
+ {
2262
+ icon: /* @__PURE__ */ React24.createElement(RiArrowLeftSLine, { size: 22 }),
2263
+ onClick: () => onPageChange(page - 1),
2264
+ disabled: page === 0
2265
+ }
2266
+ ), /* @__PURE__ */ React24.createElement("div", { className: "max-w-[90vw] w-max overflow-auto flex items-center gap-2 p-2" }, renderPages()), /* @__PURE__ */ React24.createElement(
2267
+ NavBtn,
2268
+ {
2269
+ icon: /* @__PURE__ */ React24.createElement(RiArrowRightSLine, { size: 22 }),
2270
+ onClick: () => onPageChange(page + 1),
2271
+ disabled: page === totalPages - 1
2272
+ }
2273
+ ));
2274
+ };
2275
+ var PageBtn = ({
2276
+ i,
2277
+ page,
2278
+ onPageChange
2279
+ }) => /* @__PURE__ */ React24.createElement(
2280
+ Button_default,
2281
+ {
2282
+ size: "sm",
2283
+ variant: "outlined",
2284
+ className: cn(
2285
+ i === page && "bg-primary-50 shadow-[0px_0px_0px_2px] shadow-primary-700 hover:shadow-[0px_0px_0px_2px] hover:shadow-primary-700"
2286
+ ),
2287
+ onClick: () => onPageChange(i)
2288
+ },
2289
+ i + 1
2290
+ );
2291
+ var NavBtn = ({
2292
+ icon,
2293
+ onClick,
2294
+ disabled
2295
+ }) => /* @__PURE__ */ React24.createElement(
2296
+ Button_default,
2297
+ {
2298
+ size: "sm",
2299
+ variant: "outlined",
2300
+ startIcon: icon,
2301
+ onClick,
2302
+ disabled,
2303
+ className: "p-2"
2304
+ }
2305
+ );
2306
+ var ListPagination_default = ListPagination;
2307
+
1422
2308
  // app/components/Loading.tsx
1423
- import React19 from "react";
2309
+ import React25 from "react";
1424
2310
  var Loading = ({ width, height, loaderColor, variant }) => {
1425
- return /* @__PURE__ */ React19.createElement(
2311
+ return /* @__PURE__ */ React25.createElement(
1426
2312
  "div",
1427
2313
  {
1428
2314
  className: cn(
@@ -1441,17 +2327,18 @@ var Loading = ({ width, height, loaderColor, variant }) => {
1441
2327
  var Loading_default = Loading;
1442
2328
 
1443
2329
  // app/components/Modal.tsx
1444
- import React20, { useEffect as useEffect4 } from "react";
1445
- import { RiCloseLine } from "@remixicon/react";
2330
+ import React26, { useEffect as useEffect7 } from "react";
2331
+ import { RiCloseLine as RiCloseLine2 } from "@remixicon/react";
1446
2332
  function Modal({
1447
2333
  children,
1448
2334
  showModal,
1449
2335
  setShowModal,
1450
2336
  closeModal = true,
1451
2337
  closeOnOutsideClick = true,
1452
- className = ""
2338
+ className = "",
2339
+ width = "50%"
1453
2340
  }) {
1454
- useEffect4(() => {
2341
+ useEffect7(() => {
1455
2342
  if (showModal) {
1456
2343
  document.body.style.overflow = "hidden";
1457
2344
  } else {
@@ -1466,121 +2353,41 @@ function Modal({
1466
2353
  setShowModal(false);
1467
2354
  }
1468
2355
  };
1469
- return /* @__PURE__ */ React20.createElement(React20.Fragment, null, showModal && /* @__PURE__ */ React20.createElement(
2356
+ return /* @__PURE__ */ React26.createElement(React26.Fragment, null, showModal && /* @__PURE__ */ React26.createElement(
1470
2357
  "div",
1471
2358
  {
1472
2359
  onClick: handleClickOutside,
1473
2360
  className: "w-full h-full bg-backdrop bg-blend-overlay fixed top-0 bottom-0 left-0 right-0 flex justify-center items-center z-[1000000] overflow-hidden"
1474
2361
  },
1475
- /* @__PURE__ */ React20.createElement(
2362
+ /* @__PURE__ */ React26.createElement(
1476
2363
  "div",
1477
2364
  {
1478
- className: `relative bg-white shadow-boxShadow rounded-xl p-[18px] transition-all duration-150 fade-in-grow w-[50%] mx-4 ${className}`
2365
+ style: { width },
2366
+ className: cn(
2367
+ "relative bg-white shadow-boxShadow rounded-xl p-[18px] transition-all duration-150 fade-in-grow mx-4",
2368
+ className
2369
+ )
1479
2370
  },
1480
- /* @__PURE__ */ React20.createElement("div", null, children),
1481
- closeModal && /* @__PURE__ */ React20.createElement(
2371
+ /* @__PURE__ */ React26.createElement("div", null, children),
2372
+ closeModal && /* @__PURE__ */ React26.createElement(
1482
2373
  "div",
1483
2374
  {
1484
- className: "absolute top-4 ml-5 right-5 z-10 shadow-backdrop rounded-full text-primary cursor-pointer hover:bg-primaryLight",
2375
+ className: "absolute top-4 ml-5 right-5 z-10 shadow-backdrop rounded-md cursor-pointer hover:bg-gray-100",
1485
2376
  onClick: () => setShowModal(false)
1486
2377
  },
1487
- /* @__PURE__ */ React20.createElement(RiCloseLine, { size: 24 })
2378
+ /* @__PURE__ */ React26.createElement(RiCloseLine2, { size: 24 })
1488
2379
  )
1489
2380
  )
1490
2381
  ));
1491
2382
  }
1492
2383
 
1493
- // app/components/MenuItem.tsx
1494
- import React21, { useState as useState4, useRef as useRef4, useEffect as useEffect5 } from "react";
1495
- import { RiArrowDownSLine as RiArrowDownSLine3, RiArrowUpSLine } from "@remixicon/react";
1496
- function MenuDropdown({
1497
- trigger,
1498
- children,
1499
- width = "250px",
1500
- className
1501
- }) {
1502
- const [isOpen, setIsOpen] = useState4(false);
1503
- const dropdownRef = useRef4(null);
1504
- useEffect5(() => {
1505
- const handleClickOutside = (event) => {
1506
- if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
1507
- setIsOpen(false);
1508
- }
1509
- };
1510
- document.addEventListener("mousedown", handleClickOutside);
1511
- return () => {
1512
- document.removeEventListener("mousedown", handleClickOutside);
1513
- };
1514
- }, []);
1515
- return /* @__PURE__ */ React21.createElement("div", { className: "relative w-full", ref: dropdownRef }, /* @__PURE__ */ React21.createElement(
1516
- "div",
1517
- {
1518
- className: "cursor-pointer",
1519
- onClick: () => setIsOpen(!isOpen),
1520
- "aria-label": "Open menu"
1521
- },
1522
- trigger
1523
- ), isOpen && /* @__PURE__ */ React21.createElement(
1524
- "div",
1525
- {
1526
- style: { width },
1527
- className: cn(
1528
- "border border-gray-200 rounded-lg absolute left-0 mt-1 z-[100000] w-full bg-white shadow-sm",
1529
- className
1530
- )
1531
- },
1532
- children
1533
- ));
1534
- }
1535
- var MenuSubItem = ({
1536
- label,
1537
- onClick,
1538
- disabled,
1539
- children,
1540
- className = ""
1541
- }) => /* @__PURE__ */ React21.createElement(
1542
- "button",
1543
- {
1544
- className: cn(
1545
- "w-full text-left p-4 text-sm border-y-[0.5px] last:border-y first:rounded-t hover:bg-primary-50 hover:rounded",
1546
- disabled ? "opacity-50 cursor-not-allowed" : "",
1547
- className
1548
- ),
1549
- onClick,
1550
- disabled
1551
- },
1552
- label,
1553
- children && /* @__PURE__ */ React21.createElement(React21.Fragment, null, children)
1554
- );
1555
- var MenuItem3 = ({
1556
- content,
1557
- children,
1558
- className = "",
1559
- sectionClassName = "",
1560
- menuClassName = ""
1561
- }) => {
1562
- const [isSubOpen, setIsSubOpen] = useState4(false);
1563
- return /* @__PURE__ */ React21.createElement("div", { className: cn("relative", className) }, /* @__PURE__ */ React21.createElement(
1564
- "section",
1565
- {
1566
- onClick: () => setIsSubOpen(!isSubOpen),
1567
- className: cn(
1568
- "cursor-pointer hover:bg-primary-50 p-4 flex text-sm border-y-[0.5px] justify-between items-center gap-1 w-full text-left",
1569
- sectionClassName
1570
- )
1571
- },
1572
- content,
1573
- isSubOpen ? /* @__PURE__ */ React21.createElement(RiArrowUpSLine, { size: 20 }) : /* @__PURE__ */ React21.createElement(RiArrowDownSLine3, { size: 20 })
1574
- ), isSubOpen && /* @__PURE__ */ React21.createElement("div", { className: cn(" border-primary-100 bg-gray-50", menuClassName) }, children));
1575
- };
1576
-
1577
2384
  // app/components/Notice.tsx
1578
2385
  import { cva as cva6 } from "class-variance-authority";
1579
- import React22 from "react";
2386
+ import React27 from "react";
1580
2387
  import {
1581
2388
  RiAlertFill,
1582
- RiCloseLine as RiCloseLine2,
1583
- RiErrorWarningLine as RiErrorWarningLine3,
2389
+ RiCloseLine as RiCloseLine3,
2390
+ RiErrorWarningLine as RiErrorWarningLine2,
1584
2391
  RiQuestionLine,
1585
2392
  RiThumbUpLine,
1586
2393
  RiShieldCheckLine
@@ -1588,15 +2395,15 @@ import {
1588
2395
  var VariantIcon = ({ variant }) => {
1589
2396
  switch (variant) {
1590
2397
  case "success":
1591
- return /* @__PURE__ */ React22.createElement("span", null, /* @__PURE__ */ React22.createElement(RiThumbUpLine, { size: 20, color: "#039855" }));
2398
+ return /* @__PURE__ */ React27.createElement("span", null, /* @__PURE__ */ React27.createElement(RiThumbUpLine, { size: 20, color: "#039855" }));
1592
2399
  case "warning":
1593
- return /* @__PURE__ */ React22.createElement("span", null, /* @__PURE__ */ React22.createElement(RiQuestionLine, { color: "#F79009", size: 20 }));
2400
+ return /* @__PURE__ */ React27.createElement("span", null, /* @__PURE__ */ React27.createElement(RiQuestionLine, { color: "#F79009", size: 20 }));
1594
2401
  case "info":
1595
- return /* @__PURE__ */ React22.createElement("span", null, /* @__PURE__ */ React22.createElement(RiErrorWarningLine3, { color: "#1570EF", size: 20 }));
2402
+ return /* @__PURE__ */ React27.createElement("span", null, /* @__PURE__ */ React27.createElement(RiErrorWarningLine2, { color: "#1570EF", size: 20 }));
1596
2403
  case "error":
1597
- return /* @__PURE__ */ React22.createElement("span", null, /* @__PURE__ */ React22.createElement(RiAlertFill, { color: "#F04438", size: 20 }));
2404
+ return /* @__PURE__ */ React27.createElement("span", null, /* @__PURE__ */ React27.createElement(RiAlertFill, { color: "#F04438", size: 20 }));
1598
2405
  default:
1599
- return /* @__PURE__ */ React22.createElement("span", null, /* @__PURE__ */ React22.createElement(RiShieldCheckLine, { color: "#475467", size: 20 }));
2406
+ return /* @__PURE__ */ React27.createElement("span", null, /* @__PURE__ */ React27.createElement(RiShieldCheckLine, { color: "#475467", size: 20 }));
1600
2407
  }
1601
2408
  };
1602
2409
  var noticeVariants = cva6("p-4 w-fit rounded-[6px]", {
@@ -1610,7 +2417,8 @@ var noticeVariants = cva6("p-4 w-fit rounded-[6px]", {
1610
2417
  },
1611
2418
  position: {
1612
2419
  top: "top-4 transition-all duration-700 m-auto left-0 right-0",
1613
- bottom: "bottom-4 transition-all duration-700 right-4"
2420
+ bottom: "bottom-4 transition-all duration-700 right-4",
2421
+ center: "top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 test"
1614
2422
  }
1615
2423
  }
1616
2424
  });
@@ -1624,42 +2432,112 @@ var Notice = ({
1624
2432
  showIcon = true
1625
2433
  }) => {
1626
2434
  const handleClose = () => setOpen(false);
1627
- return /* @__PURE__ */ React22.createElement(React22.Fragment, null, open && /* @__PURE__ */ React22.createElement(
2435
+ return /* @__PURE__ */ React27.createElement(React27.Fragment, null, open && /* @__PURE__ */ React27.createElement(
1628
2436
  "div",
1629
2437
  {
1630
2438
  className: cn(
1631
2439
  noticeVariants({ variant, position }),
1632
2440
  `fixed z-10`,
1633
2441
  position === "top" && open && `animate-slide-in-top`,
1634
- position === "bottom" && open && `animate-slide-in-right`
2442
+ position === "bottom" && open && `animate-slide-in-right`,
2443
+ position === "center" && open && `animate-fade-in`
1635
2444
  )
1636
2445
  },
1637
- /* @__PURE__ */ React22.createElement("div", { className: "relative" }, showIcon ? noticeTitle == "" ? /* @__PURE__ */ React22.createElement("div", { className: "flex items-start" }, /* @__PURE__ */ React22.createElement(VariantIcon, { variant }), /* @__PURE__ */ React22.createElement("span", { className: "ml-2 mr-8 text-text-sm" }, children), /* @__PURE__ */ React22.createElement("span", { onClick: handleClose }, /* @__PURE__ */ React22.createElement(RiCloseLine2, { size: 20 }))) : /* @__PURE__ */ React22.createElement("div", { className: "" }, /* @__PURE__ */ React22.createElement("section", { className: "flex items-start" }, /* @__PURE__ */ React22.createElement(VariantIcon, { variant }), /* @__PURE__ */ React22.createElement("div", { className: "ml-2 mr-8 -mt-[3px]" }, /* @__PURE__ */ React22.createElement("span", { className: "font-bold text-gray-800 mb-1" }, noticeTitle), /* @__PURE__ */ React22.createElement("p", { className: "text-text-sm text-gray-700" }, children))), /* @__PURE__ */ React22.createElement(
2446
+ /* @__PURE__ */ React27.createElement("div", { className: "relative" }, showIcon ? noticeTitle == "" ? /* @__PURE__ */ React27.createElement("div", { className: "flex items-start" }, /* @__PURE__ */ React27.createElement(VariantIcon, { variant }), /* @__PURE__ */ React27.createElement("span", { className: "ml-2 mr-8 text-text-sm" }, children), /* @__PURE__ */ React27.createElement("span", { onClick: handleClose }, /* @__PURE__ */ React27.createElement(RiCloseLine3, { size: 20 }))) : /* @__PURE__ */ React27.createElement("div", { className: "" }, /* @__PURE__ */ React27.createElement("section", { className: "flex items-start" }, /* @__PURE__ */ React27.createElement(VariantIcon, { variant }), /* @__PURE__ */ React27.createElement("div", { className: "ml-2 mr-8 -mt-[3px]" }, /* @__PURE__ */ React27.createElement("span", { className: "font-bold text-gray-800 mb-1" }, noticeTitle), /* @__PURE__ */ React27.createElement("p", { className: "text-text-sm text-gray-700" }, children))), /* @__PURE__ */ React27.createElement(
1638
2447
  "span",
1639
2448
  {
1640
2449
  className: cn("absolute top-0 right-0 cursor-pointer"),
1641
2450
  onClick: handleClose
1642
2451
  },
1643
- /* @__PURE__ */ React22.createElement(RiCloseLine2, { size: 20 })
1644
- )) : /* @__PURE__ */ React22.createElement("div", { className: "mr-8" }, /* @__PURE__ */ React22.createElement("section", { className: "flex items-center" }, /* @__PURE__ */ React22.createElement("p", { className: "font-bold text-gray-800 mb-1" }, noticeTitle)), /* @__PURE__ */ React22.createElement(
2452
+ /* @__PURE__ */ React27.createElement(RiCloseLine3, { size: 20 })
2453
+ )) : /* @__PURE__ */ React27.createElement("div", { className: "mr-8" }, /* @__PURE__ */ React27.createElement("section", { className: "flex items-center" }, /* @__PURE__ */ React27.createElement("p", { className: "font-bold text-gray-800 mb-1" }, noticeTitle)), /* @__PURE__ */ React27.createElement(
1645
2454
  "span",
1646
2455
  {
1647
2456
  className: cn("absolute top-0 right-0 cursor-pointer"),
1648
2457
  onClick: handleClose
1649
2458
  },
1650
- /* @__PURE__ */ React22.createElement(RiCloseLine2, { size: 20 })
1651
- ), /* @__PURE__ */ React22.createElement("p", { className: "text-text-sm" }, children)))
2459
+ /* @__PURE__ */ React27.createElement(RiCloseLine3, { size: 20 })
2460
+ ), /* @__PURE__ */ React27.createElement("p", { className: "text-text-sm" }, children)))
1652
2461
  ));
1653
2462
  };
1654
2463
  var Notice_default = Notice;
1655
2464
 
2465
+ // app/components/OTPInput.tsx
2466
+ import React28, { useRef as useRef6, useState as useState7 } from "react";
2467
+ var OTPInput = ({
2468
+ length,
2469
+ onChange,
2470
+ type = "text"
2471
+ }) => {
2472
+ const [otpValues, setOtpValues] = useState7(Array(length).fill(""));
2473
+ const inputsRef = useRef6([]);
2474
+ const handleChange = (e, idx) => {
2475
+ var _a;
2476
+ let value = e.target.value;
2477
+ if (type === "number")
2478
+ value = value.replace(/\D/g, "");
2479
+ if (!value)
2480
+ return;
2481
+ const newOtp = [...otpValues];
2482
+ newOtp[idx] = value[0];
2483
+ setOtpValues(newOtp);
2484
+ onChange(newOtp.join(""));
2485
+ if (idx < length - 1)
2486
+ (_a = inputsRef.current[idx + 1]) == null ? void 0 : _a.focus();
2487
+ };
2488
+ const handleKeyDown = (e, idx) => {
2489
+ var _a;
2490
+ if (e.key === "Backspace") {
2491
+ if (otpValues[idx]) {
2492
+ const newOtp = [...otpValues];
2493
+ newOtp[idx] = "";
2494
+ setOtpValues(newOtp);
2495
+ onChange(newOtp.join(""));
2496
+ } else if (idx > 0) {
2497
+ (_a = inputsRef.current[idx - 1]) == null ? void 0 : _a.focus();
2498
+ }
2499
+ }
2500
+ };
2501
+ const handlePaste = (e) => {
2502
+ var _a;
2503
+ e.preventDefault();
2504
+ let pasteData = e.clipboardData.getData("Text");
2505
+ if (type === "number")
2506
+ pasteData = pasteData.replace(/\D/g, "");
2507
+ const newOtp = pasteData.split("").concat(Array(length).fill("")).slice(0, length);
2508
+ setOtpValues(newOtp);
2509
+ onChange(newOtp.join(""));
2510
+ (_a = inputsRef.current[Math.min(pasteData.length, length - 1)]) == null ? void 0 : _a.focus();
2511
+ };
2512
+ return /* @__PURE__ */ React28.createElement("div", { className: "flex items-center gap-2" }, Array.from({ length }).map((_, idx) => /* @__PURE__ */ React28.createElement(
2513
+ Input_default,
2514
+ {
2515
+ key: idx,
2516
+ type,
2517
+ inputMode: type === "number" ? "numeric" : "text",
2518
+ maxLength: 1,
2519
+ value: otpValues[idx],
2520
+ onChange: (e) => handleChange(e, idx),
2521
+ onKeyDown: (e) => handleKeyDown(e, idx),
2522
+ onPaste: handlePaste,
2523
+ ref: (el) => {
2524
+ inputsRef.current[idx] = el ?? null;
2525
+ },
2526
+ className: "w-[40px] p-3.5"
2527
+ }
2528
+ )));
2529
+ };
2530
+ var OTPInput_default = OTPInput;
2531
+
1656
2532
  // app/components/Pagination.tsx
1657
- import React23, { useState as useState5 } from "react";
2533
+ import React29, { useState as useState8 } from "react";
1658
2534
  import {
1659
2535
  RiArrowLeftLine,
1660
2536
  RiArrowRightLine,
1661
2537
  RiArrowDownSLine as RiArrowDownSLine4,
1662
- RiArrowUpSLine as RiArrowUpSLine2
2538
+ RiArrowUpSLine,
2539
+ RiArrowRightSLine as RiArrowRightSLine2,
2540
+ RiArrowLeftSLine as RiArrowLeftSLine2
1663
2541
  } from "@remixicon/react";
1664
2542
  var Pagination = ({
1665
2543
  count,
@@ -1668,7 +2546,10 @@ var Pagination = ({
1668
2546
  rowsPerPageOptions,
1669
2547
  onPageChange,
1670
2548
  onRowsPerPageChange,
1671
- className
2549
+ className,
2550
+ variant = "primary",
2551
+ countVariable,
2552
+ itemsPerPage = true
1672
2553
  }) => {
1673
2554
  const totalPages = Math.ceil(count / rowsPerPage);
1674
2555
  const handlePrevPageClick = () => {
@@ -1677,7 +2558,7 @@ var Pagination = ({
1677
2558
  const handleNextPageClick = () => {
1678
2559
  onPageChange(page + 1);
1679
2560
  };
1680
- const [showOptions, setShowOptions] = useState5(false);
2561
+ const [showOptions, setShowOptions] = useState8(false);
1681
2562
  const handleOptionClick = (option) => {
1682
2563
  if (typeof option === "number") {
1683
2564
  onRowsPerPageChange(option);
@@ -1686,15 +2567,16 @@ var Pagination = ({
1686
2567
  }
1687
2568
  setShowOptions(false);
1688
2569
  };
1689
- return /* @__PURE__ */ React23.createElement(
2570
+ return /* @__PURE__ */ React29.createElement(
1690
2571
  "div",
1691
2572
  {
1692
2573
  className: cn(
1693
- "border border-gray-200 px-6 py-4 flex justify-between items-center w-full",
2574
+ "px-3 py-4 flex justify-between items-center w-full",
2575
+ variant === "primary" && "border border-gray-200 px-6 py-4",
1694
2576
  className
1695
2577
  )
1696
2578
  },
1697
- /* @__PURE__ */ React23.createElement("section", { className: "flex gap-1.5 items-center" }, /* @__PURE__ */ React23.createElement("span", { className: "text-gray-800 text-text-sm font-medium" }, "Items per page"), /* @__PURE__ */ React23.createElement("div", { className: "relative z-[100]" }, /* @__PURE__ */ React23.createElement(
2579
+ /* @__PURE__ */ React29.createElement("section", { className: "flex gap-1.5 items-center" }, countVariable && /* @__PURE__ */ React29.createElement("p", { className: "text-text-sm text-gray-800 font-medium" }, count, " ", countVariable ?? "Items"), itemsPerPage && /* @__PURE__ */ React29.createElement("div", { className: "flex gap-1.5 items-center" }, /* @__PURE__ */ React29.createElement("span", { className: "text-gray-800 text-text-sm font-medium" }, "Items per page"), /* @__PURE__ */ React29.createElement("div", { className: "relative z-[100]" }, /* @__PURE__ */ React29.createElement(
1698
2580
  "div",
1699
2581
  {
1700
2582
  className: "border border-gray-600 w-[88px] rounded text-sm px-1.5 py-1 cursor-pointer flex items-center justify-between gap-1 text-gray-600",
@@ -1702,8 +2584,8 @@ var Pagination = ({
1702
2584
  },
1703
2585
  rowsPerPage,
1704
2586
  " ",
1705
- !showOptions ? /* @__PURE__ */ React23.createElement(RiArrowDownSLine4, { size: 14 }) : /* @__PURE__ */ React23.createElement(RiArrowUpSLine2, { size: 14 })
1706
- ), showOptions && /* @__PURE__ */ React23.createElement("div", { className: "absolute top-full left-0 shadow bg-white rounded-md text-sm mt-1 z-50" }, rowsPerPageOptions == null ? void 0 : rowsPerPageOptions.map((option, index) => /* @__PURE__ */ React23.createElement(
2587
+ !showOptions ? /* @__PURE__ */ React29.createElement(RiArrowDownSLine4, { size: 14 }) : /* @__PURE__ */ React29.createElement(RiArrowUpSLine, { size: 14 })
2588
+ ), showOptions && /* @__PURE__ */ React29.createElement("div", { className: "absolute top-full left-0 shadow bg-white rounded-md text-sm mt-1 z-50" }, rowsPerPageOptions == null ? void 0 : rowsPerPageOptions.map((option, index) => /* @__PURE__ */ React29.createElement(
1707
2589
  "div",
1708
2590
  {
1709
2591
  key: index,
@@ -1711,42 +2593,62 @@ var Pagination = ({
1711
2593
  onClick: () => handleOptionClick(option)
1712
2594
  },
1713
2595
  typeof option === "number" ? option : option.label
1714
- ))))),
1715
- /* @__PURE__ */ React23.createElement("section", { className: "flex items-center gap-2 font-medium" }, /* @__PURE__ */ React23.createElement("div", { className: "flex items-center gap-2 text-gray-800 text-text-sm" }, /* @__PURE__ */ React23.createElement("span", null, "page"), /* @__PURE__ */ React23.createElement(
2596
+ )))))),
2597
+ /* @__PURE__ */ React29.createElement("section", { className: "flex items-center gap-2 font-medium" }, variant === "primary" ? /* @__PURE__ */ React29.createElement("div", { className: "flex items-center gap-2 text-gray-800 text-text-sm" }, /* @__PURE__ */ React29.createElement("span", null, "page"), /* @__PURE__ */ React29.createElement(
1716
2598
  "select",
1717
2599
  {
1718
2600
  value: page + 1,
1719
2601
  onChange: (e) => onPageChange(parseInt(e.target.value, 10) - 1),
1720
2602
  className: "bg-gray-25 text-gray-500 px-3.5 py-1 border border-gray-200 rounded-md text-sm focus:outline-none focus:border-gray-600"
1721
2603
  },
1722
- totalPages > 0 && [...Array(totalPages)].map((_, index) => /* @__PURE__ */ React23.createElement("option", { key: index + 1, value: index + 1 }, index + 1))
1723
- ), /* @__PURE__ */ React23.createElement("span", null, "of ", totalPages > 0 ? totalPages : 0)), /* @__PURE__ */ React23.createElement("div", { className: "flex items-center" }, /* @__PURE__ */ React23.createElement(
2604
+ totalPages > 0 && [...Array(totalPages)].map((_, index) => /* @__PURE__ */ React29.createElement("option", { key: index + 1, value: index + 1 }, index + 1))
2605
+ ), /* @__PURE__ */ React29.createElement("span", null, "of ", totalPages > 0 ? totalPages : 0)) : /* @__PURE__ */ React29.createElement("div", { className: "flex items-center gap-2 text-gray-800 text-text-sm mx-3" }, /* @__PURE__ */ React29.createElement("span", null, page + 1, " of ", totalPages > 0 ? totalPages : 0)), variant === "primary" ? /* @__PURE__ */ React29.createElement("div", { className: "flex items-center" }, /* @__PURE__ */ React29.createElement(
1724
2606
  Button_default,
1725
2607
  {
1726
2608
  variant: "outlined",
1727
2609
  intent: "default-outlined",
1728
- startIcon: /* @__PURE__ */ React23.createElement(RiArrowLeftLine, { size: 20 }),
2610
+ startIcon: /* @__PURE__ */ React29.createElement(RiArrowLeftLine, { size: 20 }),
1729
2611
  onClick: handlePrevPageClick,
1730
2612
  disabled: page === 0,
1731
2613
  className: "rounded-none h-8 rounded-l-lg"
1732
2614
  }
1733
- ), /* @__PURE__ */ React23.createElement(
2615
+ ), /* @__PURE__ */ React29.createElement(
1734
2616
  Button_default,
1735
2617
  {
1736
2618
  variant: "outlined",
1737
2619
  intent: "default-outlined",
1738
- startIcon: /* @__PURE__ */ React23.createElement(RiArrowRightLine, { size: 20 }),
2620
+ startIcon: /* @__PURE__ */ React29.createElement(RiArrowRightLine, { size: 20 }),
1739
2621
  onClick: handleNextPageClick,
1740
2622
  disabled: page === totalPages - 1,
1741
2623
  className: "rounded-none h-8 rounded-r-lg"
1742
2624
  }
2625
+ )) : /* @__PURE__ */ React29.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ React29.createElement(
2626
+ RiArrowLeftSLine2,
2627
+ {
2628
+ size: 22,
2629
+ cursor: "pointer",
2630
+ onClick: handlePrevPageClick,
2631
+ className: cn(
2632
+ page === 0 && "pointer-events-none select-none opacity-30"
2633
+ )
2634
+ }
2635
+ ), /* @__PURE__ */ React29.createElement(
2636
+ RiArrowRightSLine2,
2637
+ {
2638
+ size: 22,
2639
+ cursor: "pointer",
2640
+ onClick: handleNextPageClick,
2641
+ className: cn(
2642
+ page === totalPages - 1 && "pointer-events-none select-none opacity-30"
2643
+ )
2644
+ }
1743
2645
  )))
1744
2646
  );
1745
2647
  };
1746
2648
  var Pagination_default = Pagination;
1747
2649
 
1748
2650
  // app/components/Progress.tsx
1749
- import React24 from "react";
2651
+ import React30 from "react";
1750
2652
  var ProgressBar = ({
1751
2653
  progress,
1752
2654
  progressText = "",
@@ -1754,7 +2656,7 @@ var ProgressBar = ({
1754
2656
  progressTextPosition
1755
2657
  }) => {
1756
2658
  const _progress = Math == null ? void 0 : Math.min(Math == null ? void 0 : Math.max(0, progress), 100);
1757
- return /* @__PURE__ */ React24.createElement(
2659
+ return /* @__PURE__ */ React30.createElement(
1758
2660
  "div",
1759
2661
  {
1760
2662
  className: cn(
@@ -1762,7 +2664,7 @@ var ProgressBar = ({
1762
2664
  progressTextPosition === "right" ? "flex items-center gap-1" : progressTextPosition === "left" ? "flex items-center gap-1" : ""
1763
2665
  )
1764
2666
  },
1765
- /* @__PURE__ */ React24.createElement(
2667
+ /* @__PURE__ */ React30.createElement(
1766
2668
  "span",
1767
2669
  {
1768
2670
  className: cn(
@@ -1772,7 +2674,7 @@ var ProgressBar = ({
1772
2674
  },
1773
2675
  progressText
1774
2676
  ),
1775
- /* @__PURE__ */ React24.createElement(
2677
+ /* @__PURE__ */ React30.createElement(
1776
2678
  "div",
1777
2679
  {
1778
2680
  className: "w-full h-2 rounded bg-gray-200",
@@ -1781,15 +2683,15 @@ var ProgressBar = ({
1781
2683
  "aria-valuemin": 0,
1782
2684
  "aria-valuemax": 100
1783
2685
  },
1784
- /* @__PURE__ */ React24.createElement(
2686
+ /* @__PURE__ */ React30.createElement(
1785
2687
  "div",
1786
2688
  {
1787
- className: `${progressColor} h-full transition-all delay-1000 duration-700 rounded ease-in`,
2689
+ className: `${progressColor} h-full transition-all delay-100 duration-300 rounded ease-in`,
1788
2690
  style: { width: `${_progress}%` }
1789
2691
  }
1790
2692
  )
1791
2693
  ),
1792
- /* @__PURE__ */ React24.createElement(
2694
+ /* @__PURE__ */ React30.createElement(
1793
2695
  "span",
1794
2696
  {
1795
2697
  className: cn(
@@ -1804,7 +2706,7 @@ var ProgressBar = ({
1804
2706
  var Progress_default = ProgressBar;
1805
2707
 
1806
2708
  // app/components/Radio.tsx
1807
- import React25, { forwardRef as forwardRef9 } from "react";
2709
+ import React31, { forwardRef as forwardRef10 } from "react";
1808
2710
  import { cva as cva7 } from "class-variance-authority";
1809
2711
  var radioVariants = cva7("", {
1810
2712
  variants: {
@@ -1817,27 +2719,32 @@ var radioVariants = cva7("", {
1817
2719
  size: "sm"
1818
2720
  }
1819
2721
  });
1820
- var Radio = forwardRef9(
1821
- ({ size, disabled, checked, className, children, ...props }, ref) => {
1822
- return /* @__PURE__ */ React25.createElement("div", { className: "relative inline-flex items-center cursor-pointer" }, /* @__PURE__ */ React25.createElement(
2722
+ var Radio = forwardRef10(
2723
+ ({ size, disabled, checked, className, children, id, name, ...props }, ref) => {
2724
+ return /* @__PURE__ */ React31.createElement("div", { className: "relative inline-flex items-center cursor-pointer" }, /* @__PURE__ */ React31.createElement(
1823
2725
  "input",
1824
2726
  {
1825
2727
  ...props,
1826
2728
  ref,
2729
+ id,
2730
+ name,
1827
2731
  checked,
1828
2732
  disabled,
2733
+ role: "radio",
2734
+ "aria-checked": checked,
1829
2735
  type: "radio",
1830
2736
  className: cn(
1831
- "peer relative cursor-pointer appearance-none rounded-full border border-gray-300 hover:border-primary-600 hover:bg-primary-50 transition-all checked:border-primary-600 checked:bg-primary-50 disabled:opacity-30 disabled:pointer-events-none",
2737
+ "peer relative cursor-pointer appearance-none rounded-full border border-gray-300 hover:border-primary-600 hover:bg-primary-50 transition-all checked:border-primary-600 checked:bg-primary-50 disabled:opacity-30 disabled:pointer-events-none focus-visible:ring-2 focus-visible:ring-primary-600 focus-visible:ring-offset-2",
1832
2738
  radioVariants({ size, className })
1833
2739
  )
1834
2740
  }
1835
- ), /* @__PURE__ */ React25.createElement(
2741
+ ), /* @__PURE__ */ React31.createElement(
1836
2742
  "span",
1837
2743
  {
2744
+ "aria-hidden": "true",
1838
2745
  className: cn(
1839
2746
  "absolute transition-opacity opacity-0 ease-in-out pointer-events-none top-2/4 left-2/4 -translate-y-2/4 -translate-x-2/4 peer-checked:opacity-100 h-1.5 w-1.5 bg-primary-600 rounded-full duration-300",
1840
- size == "sm" && "h-[4.5px] w-[4.5px]"
2747
+ size === "sm" && "h-[4.5px] w-[4.5px]"
1841
2748
  )
1842
2749
  }
1843
2750
  ));
@@ -1846,159 +2753,706 @@ var Radio = forwardRef9(
1846
2753
  Radio.displayName = "Radio";
1847
2754
  var Radio_default = Radio;
1848
2755
 
2756
+ // app/components/RazorPayFileUpload.tsx
2757
+ import React33, { useRef as useRef7, useState as useState9 } from "react";
2758
+ import {
2759
+ RiDeleteBin6Line,
2760
+ RiRefreshLine,
2761
+ RiFileLine as RiFileLine2,
2762
+ RiImageLine as RiImageLine2,
2763
+ RiVideoLine as RiVideoLine2,
2764
+ RiFileZipLine as RiFileZipLine2,
2765
+ RiCheckLine,
2766
+ RiCloseLine as RiCloseLine4,
2767
+ RiFilePdf2Line as RiFilePdf2Line2,
2768
+ RiFilePpt2Line as RiFilePpt2Line2,
2769
+ RiFileWord2Line as RiFileWord2Line2,
2770
+ RiFileExcel2Line as RiFileExcel2Line2,
2771
+ RiMusic2Line as RiMusic2Line2,
2772
+ RiEyeLine
2773
+ } from "@remixicon/react";
2774
+
2775
+ // app/components/Spinner.tsx
2776
+ import React32 from "react";
2777
+ var colorVars = {
2778
+ primary: {
2779
+ c1: "var(--primary-500)",
2780
+ c2: "var(--primary-200)"
2781
+ },
2782
+ black: {
2783
+ c1: "rgba(0, 0, 0, 1)",
2784
+ c2: "rgba(0, 0, 0, 0.5)"
2785
+ },
2786
+ gray: {
2787
+ c1: "var(--gray-500)",
2788
+ c2: "var(--gray-300)"
2789
+ }
2790
+ };
2791
+ var Spinner = ({ size = "md", color = "primary" }) => {
2792
+ const sizeClass = cn({
2793
+ "w-4 h-4": size === "xs",
2794
+ "w-6 h-6": size === "sm",
2795
+ "w-10 h-10": size === "md",
2796
+ "w-16 h-16": size === "lg"
2797
+ });
2798
+ const getColorValues = (color2) => {
2799
+ if (colorVars[color2]) {
2800
+ return colorVars[color2];
2801
+ }
2802
+ if (color2.startsWith("#")) {
2803
+ return {
2804
+ c1: color2,
2805
+ c2: `${color2}80`
2806
+ };
2807
+ }
2808
+ return colorVars.primary;
2809
+ };
2810
+ const colorValues = getColorValues(color);
2811
+ return /* @__PURE__ */ React32.createElement("div", { className: cn("relative", sizeClass) }, /* @__PURE__ */ React32.createElement(
2812
+ "div",
2813
+ {
2814
+ className: "spinner",
2815
+ style: {
2816
+ ["--spinner-color-1"]: colorValues.c1,
2817
+ ["--spinner-color-2"]: colorValues.c2
2818
+ }
2819
+ }
2820
+ ));
2821
+ };
2822
+ var Spinner_default = Spinner;
2823
+
2824
+ // app/components/RazorPayFileUpload.tsx
2825
+ import Image2 from "next/image";
2826
+ var defaultGetFileIcon = (fileName, fileType) => {
2827
+ var _a;
2828
+ const extension = ((_a = fileName.split(".").pop()) == null ? void 0 : _a.toLowerCase()) || "";
2829
+ if (fileType.startsWith("image/") || ["jpg", "jpeg", "png", "gif", "svg", "webp", "bmp"].includes(extension)) {
2830
+ return /* @__PURE__ */ React33.createElement(RiImageLine2, { className: "w-6 h-6 text-white" });
2831
+ }
2832
+ if (fileType.startsWith("audio/") || ["mp3", "wav", "ogg", "m4a"].includes(extension)) {
2833
+ return /* @__PURE__ */ React33.createElement(RiMusic2Line2, { className: "w-6 h-6 text-white" });
2834
+ }
2835
+ if (fileType.startsWith("video/") || ["mp4", "avi", "mkv", "mov", "wmv"].includes(extension)) {
2836
+ return /* @__PURE__ */ React33.createElement(RiVideoLine2, { className: "w-6 h-6 text-white" });
2837
+ }
2838
+ if (fileType.includes("excel") || ["xls", "xlsx", "csv", "txt", "ods"].includes(extension)) {
2839
+ return /* @__PURE__ */ React33.createElement(RiFileExcel2Line2, { className: "w-6 h-6 text-white" });
2840
+ }
2841
+ if (fileType.includes("word") || ["doc", "docx", "odt", "xml"].includes(extension)) {
2842
+ return /* @__PURE__ */ React33.createElement(RiFileWord2Line2, { className: "w-6 h-6 text-white" });
2843
+ }
2844
+ if (["pptx", "pptm", "xps", "ppsx"].includes(extension)) {
2845
+ return /* @__PURE__ */ React33.createElement(RiFilePpt2Line2, { className: "w-6 h-6 text-white" });
2846
+ }
2847
+ if (fileType.includes("zip") || ["zip", "rar", "7z", "tar", "gz"].includes(extension)) {
2848
+ return /* @__PURE__ */ React33.createElement(RiFileZipLine2, { className: "w-6 h-6 text-white" });
2849
+ }
2850
+ if (fileType === "application/pdf" || extension === "pdf") {
2851
+ return /* @__PURE__ */ React33.createElement(RiFilePdf2Line2, { className: "w-6 h-6 text-white" });
2852
+ }
2853
+ return /* @__PURE__ */ React33.createElement(RiFileLine2, { className: "w-6 h-6 text-white" });
2854
+ };
2855
+ function ImageUploadControlled({
2856
+ items,
2857
+ onAddFiles,
2858
+ onUpdateItem,
2859
+ onDelete,
2860
+ onRetry,
2861
+ onPreview,
2862
+ onUpload,
2863
+ multiple = true,
2864
+ accept = "image/*",
2865
+ maxSizeMB = 15,
2866
+ className = "",
2867
+ hintText,
2868
+ showSizeText = true,
2869
+ getFileIcon = defaultGetFileIcon,
2870
+ autoUpload = true,
2871
+ disabled
2872
+ }) {
2873
+ var _a;
2874
+ const inputRef = useRef7(null);
2875
+ const [isDragging, setIsDragging] = useState9(false);
2876
+ const localPreviews = useRef7(/* @__PURE__ */ new Map());
2877
+ const uploadProgress = useRef7(/* @__PURE__ */ new Map());
2878
+ const formatSize = (bytes) => {
2879
+ if (!bytes)
2880
+ return "0 KB";
2881
+ return `${Math.round(bytes / 1024)} KB`;
2882
+ };
2883
+ const getPreviewUrl = (item) => {
2884
+ if (item.previewUrl)
2885
+ return item.previewUrl;
2886
+ if (item.file && !localPreviews.current.has(item.id)) {
2887
+ const url = URL.createObjectURL(item.file);
2888
+ localPreviews.current.set(item.id, url);
2889
+ }
2890
+ return localPreviews.current.get(item.id);
2891
+ };
2892
+ const getStatusDisplay = (status) => {
2893
+ switch (status) {
2894
+ case "uploading":
2895
+ return {
2896
+ text: "Uploading",
2897
+ color: "text-blue-600",
2898
+ showSpinner: true,
2899
+ icon: /* @__PURE__ */ React33.createElement(Spinner_default, { size: "xs", color: "gray" }),
2900
+ canPreview: false
2901
+ };
2902
+ case "success":
2903
+ return {
2904
+ text: "Completed",
2905
+ color: "text-green-600",
2906
+ showSpinner: false,
2907
+ icon: /* @__PURE__ */ React33.createElement(RiCheckLine, { className: "w-3 h-3 text-white" }),
2908
+ canPreview: true
2909
+ };
2910
+ case "error":
2911
+ return {
2912
+ text: "Failed",
2913
+ color: "text-red-600",
2914
+ showSpinner: false,
2915
+ icon: /* @__PURE__ */ React33.createElement(RiCloseLine4, { className: "w-3 h-3 text-white" }),
2916
+ canPreview: false
2917
+ };
2918
+ default:
2919
+ return {
2920
+ text: "",
2921
+ color: "",
2922
+ showSpinner: false,
2923
+ icon: null,
2924
+ canPreview: false
2925
+ };
2926
+ }
2927
+ };
2928
+ const getProgressColor = (status) => {
2929
+ switch (status) {
2930
+ case "uploading":
2931
+ return "bg-blue-500";
2932
+ case "success":
2933
+ return "bg-green-600";
2934
+ case "error":
2935
+ return "bg-red-500";
2936
+ default:
2937
+ return "bg-gray-300";
2938
+ }
2939
+ };
2940
+ const getItemFileIcon = (item) => {
2941
+ var _a2, _b;
2942
+ const fileName = item.name || ((_a2 = item.file) == null ? void 0 : _a2.name) || "";
2943
+ const fileType = ((_b = item.file) == null ? void 0 : _b.type) || "";
2944
+ return getFileIcon(fileName, fileType);
2945
+ };
2946
+ const handleUpload = React33.useCallback(
2947
+ async (item) => {
2948
+ if (!item.file || !onUpload)
2949
+ return;
2950
+ try {
2951
+ if (onUpdateItem) {
2952
+ onUpdateItem(item.id, { status: "uploading", progress: 0 });
2953
+ }
2954
+ const previewUrl = await onUpload(item.file, (progress) => {
2955
+ uploadProgress.current.set(item.id, progress);
2956
+ if (onUpdateItem) {
2957
+ onUpdateItem(item.id, { progress, status: "uploading" });
2958
+ }
2959
+ });
2960
+ if (onUpdateItem) {
2961
+ onUpdateItem(item.id, {
2962
+ progress: 100,
2963
+ status: "success",
2964
+ previewUrl
2965
+ });
2966
+ }
2967
+ } catch (error) {
2968
+ if (onUpdateItem) {
2969
+ onUpdateItem(item.id, { progress: 0, status: "error" });
2970
+ }
2971
+ }
2972
+ },
2973
+ [onUpload, onUpdateItem]
2974
+ );
2975
+ const getCurrentProgress = (item) => {
2976
+ return uploadProgress.current.get(item.id) ?? item.progress ?? 0;
2977
+ };
2978
+ const handleRetry = (id) => {
2979
+ const item = items.find((item2) => item2.id === id);
2980
+ if (item && onUpload) {
2981
+ handleUpload(item);
2982
+ } else if (onRetry) {
2983
+ onRetry(id);
2984
+ }
2985
+ };
2986
+ const handleDelete = (id) => {
2987
+ if (localPreviews.current.has(id)) {
2988
+ const url = localPreviews.current.get(id);
2989
+ if (url)
2990
+ URL.revokeObjectURL(url);
2991
+ localPreviews.current.delete(id);
2992
+ }
2993
+ uploadProgress.current.delete(id);
2994
+ if (onDelete) {
2995
+ onDelete(id);
2996
+ }
2997
+ };
2998
+ const triggerInput = () => {
2999
+ var _a2;
3000
+ return (_a2 = inputRef.current) == null ? void 0 : _a2.click();
3001
+ };
3002
+ const handleInputChange = (e) => {
3003
+ const files = Array.from(e.target.files || []);
3004
+ if (files.length === 0)
3005
+ return;
3006
+ const validFiles = files.filter(
3007
+ (file) => file.size <= maxSizeMB * 1024 * 1024
3008
+ );
3009
+ if (validFiles.length === 0)
3010
+ return;
3011
+ onAddFiles(multiple ? validFiles : [validFiles[0]]);
3012
+ e.target.value = "";
3013
+ };
3014
+ const handleDragOver = (e) => {
3015
+ e.preventDefault();
3016
+ if (!disabled)
3017
+ setIsDragging(true);
3018
+ };
3019
+ const handleDragLeave = () => {
3020
+ setIsDragging(false);
3021
+ };
3022
+ const handleDrop = (e) => {
3023
+ e.preventDefault();
3024
+ setIsDragging(false);
3025
+ if (disabled)
3026
+ return;
3027
+ const files = Array.from(e.dataTransfer.files);
3028
+ if (files.length === 0)
3029
+ return;
3030
+ const validFiles = files.filter(
3031
+ (file) => file.size <= maxSizeMB * 1024 * 1024
3032
+ );
3033
+ if (validFiles.length > 0) {
3034
+ onAddFiles(multiple ? validFiles : [validFiles[0]]);
3035
+ }
3036
+ };
3037
+ const handleKeyDown = (e) => {
3038
+ if (e.key === "Enter" || e.key === " ") {
3039
+ e.preventDefault();
3040
+ triggerInput();
3041
+ }
3042
+ };
3043
+ React33.useEffect(() => {
3044
+ if (autoUpload && onUpload) {
3045
+ items.forEach((item) => {
3046
+ if (item.status === "idle" && item.file) {
3047
+ handleUpload(item);
3048
+ }
3049
+ });
3050
+ }
3051
+ }, [items, autoUpload, onUpload, handleUpload]);
3052
+ React33.useEffect(() => {
3053
+ const previews = localPreviews == null ? void 0 : localPreviews.current;
3054
+ return () => {
3055
+ previews == null ? void 0 : previews.forEach((url) => URL == null ? void 0 : URL.revokeObjectURL(url));
3056
+ };
3057
+ }, []);
3058
+ return /* @__PURE__ */ React33.createElement("div", { className: `w-full ${className}` }, /* @__PURE__ */ React33.createElement(
3059
+ "input",
3060
+ {
3061
+ ref: inputRef,
3062
+ type: "file",
3063
+ accept,
3064
+ multiple,
3065
+ hidden: true,
3066
+ onChange: handleInputChange,
3067
+ disabled
3068
+ }
3069
+ ), /* @__PURE__ */ React33.createElement(
3070
+ Label_default,
3071
+ {
3072
+ htmlFor: (_a = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _a.id,
3073
+ onDragOver: handleDragOver,
3074
+ onDragLeave: handleDragLeave,
3075
+ onDrop: handleDrop,
3076
+ onClick: triggerInput,
3077
+ onKeyDown: handleKeyDown,
3078
+ tabIndex: 0,
3079
+ role: "button",
3080
+ disabled,
3081
+ "aria-label": `Upload ${multiple ? "images" : "an image"}`,
3082
+ className: cn(
3083
+ "max-w-[564px] w-full bg-white py-4 flex items-center justify-center rounded-lg border cursor-pointer transition-all",
3084
+ isDragging ? "border-blue-500 bg-blue-50" : "border-gray-300 bg-white hover:bg-gray-50",
3085
+ disabled && "pointer-events-none cursor-not-allowed"
3086
+ )
3087
+ },
3088
+ /* @__PURE__ */ React33.createElement("div", { className: "flex items-center gap-3 text-center" }, /* @__PURE__ */ React33.createElement("div", null, /* @__PURE__ */ React33.createElement("p", { className: "text-sm text-gray-600" }, "Drag files here or", /* @__PURE__ */ React33.createElement("span", { className: "text-primary-600 font-semibold ml-1" }, "Upload"), " ", /* @__PURE__ */ React33.createElement("br", null))))
3089
+ ), /* @__PURE__ */ React33.createElement("span", { className: "text-xs" }, hintText ?? `Only PNG, JPG, GIF. Max file size ${maxSizeMB}MB`), /* @__PURE__ */ React33.createElement("div", { className: "flex flex-col gap-4 mt-4" }, items == null ? void 0 : items.map((item) => {
3090
+ var _a2, _b;
3091
+ const previewUrl = getPreviewUrl(item);
3092
+ const progress = getCurrentProgress(item);
3093
+ const statusInfo = getStatusDisplay(item.status);
3094
+ const progressColor = getProgressColor(item == null ? void 0 : item.status);
3095
+ const fileIcon = getItemFileIcon(item);
3096
+ return /* @__PURE__ */ React33.createElement(
3097
+ "div",
3098
+ {
3099
+ key: item == null ? void 0 : item.id,
3100
+ className: "flex items-center gap-4 bg-white max-w-[564px] w-full p-4 rounded-lg border border-gray-200"
3101
+ },
3102
+ /* @__PURE__ */ React33.createElement("div", { className: "w-14 h-14 flex-shrink-0 rounded-md overflow-hidden relative" }, /* @__PURE__ */ React33.createElement(
3103
+ Image2,
3104
+ {
3105
+ src: "/fileImg.svg",
3106
+ className: "absolute inset-0 w-full h-full object-contain",
3107
+ fill: true,
3108
+ alt: "file"
3109
+ }
3110
+ ), /* @__PURE__ */ React33.createElement("div", { className: "relative z-10 mt-2 -ml-[2px] flex items-center justify-center w-full h-full text-white" }, fileIcon)),
3111
+ /* @__PURE__ */ React33.createElement("div", { className: "flex-1 min-w-0" }, /* @__PURE__ */ React33.createElement("div", { className: "flex items-start justify-between gap-2 mb-3" }, /* @__PURE__ */ React33.createElement("div", { className: "min-w-0" }, /* @__PURE__ */ React33.createElement("h4", { className: "text-sm font-medium text-gray-900 truncate" }, (item == null ? void 0 : item.name) || ((_a2 = item.file) == null ? void 0 : _a2.name) || "Unnamed file"), showSizeText && /* @__PURE__ */ React33.createElement("div", { className: "text-xs text-gray-500 mt-1 flex items-center gap-1" }, formatSize((item == null ? void 0 : item.size) || ((_b = item.file) == null ? void 0 : _b.size)), statusInfo.text && /* @__PURE__ */ React33.createElement("div", { className: "ml-2 font-medium flex items-center gap-1" }, (statusInfo == null ? void 0 : statusInfo.showSpinner) ? (
3112
+ // For uploading - just show spinner without circle
3113
+ /* @__PURE__ */ React33.createElement(React33.Fragment, null, statusInfo.icon, /* @__PURE__ */ React33.createElement("span", { className: statusInfo.color }, statusInfo.text))
3114
+ ) : (
3115
+ // For completed/failed - show circle with icon
3116
+ /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement(
3117
+ "div",
3118
+ {
3119
+ className: `w-4 h-4 rounded-full flex justify-center items-center ${(statusInfo == null ? void 0 : statusInfo.color) === "text-red-600" ? "bg-red-600" : (statusInfo == null ? void 0 : statusInfo.color) === "text-green-600" ? "bg-green-600" : "bg-gray-400"}`
3120
+ },
3121
+ statusInfo == null ? void 0 : statusInfo.icon
3122
+ ), /* @__PURE__ */ React33.createElement("span", { className: statusInfo.color }, statusInfo == null ? void 0 : statusInfo.text))
3123
+ )))), /* @__PURE__ */ React33.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React33.createElement("div", { className: "flex items-center gap-2" }, onPreview && (item == null ? void 0 : item.status) === "success" && /* @__PURE__ */ React33.createElement(
3124
+ "button",
3125
+ {
3126
+ type: "button",
3127
+ onClick: () => onPreview(item.id),
3128
+ className: "p-2 rounded-md hover:bg-gray-100 transition-colors text-gray-600",
3129
+ title: "Preview"
3130
+ },
3131
+ /* @__PURE__ */ React33.createElement(RiEyeLine, { size: 16 })
3132
+ ), (item == null ? void 0 : item.status) === "error" && /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement("span", { className: "hidden sm:inline-block" }, /* @__PURE__ */ React33.createElement(
3133
+ Button_default,
3134
+ {
3135
+ variant: "outlined",
3136
+ intent: "primary-outlined",
3137
+ type: "button",
3138
+ size: "sm",
3139
+ onClick: () => handleRetry(item == null ? void 0 : item.id),
3140
+ className: "whitespace-nowrap h-[30px]"
3141
+ },
3142
+ /* @__PURE__ */ React33.createElement(RiRefreshLine, { size: 16 }),
3143
+ "Try Again"
3144
+ )), /* @__PURE__ */ React33.createElement("span", { className: "sm:hidden" }, /* @__PURE__ */ React33.createElement(
3145
+ Button_default,
3146
+ {
3147
+ variant: "outlined",
3148
+ intent: "primary-outlined",
3149
+ type: "button",
3150
+ size: "sm",
3151
+ onClick: () => handleRetry(item == null ? void 0 : item.id),
3152
+ className: "h-[30px] px-1 py-1"
3153
+ },
3154
+ /* @__PURE__ */ React33.createElement(RiRefreshLine, { size: 16 })
3155
+ ))), /* @__PURE__ */ React33.createElement(
3156
+ "button",
3157
+ {
3158
+ type: "button",
3159
+ onClick: () => handleDelete(item.id),
3160
+ className: "p-2 rounded-md hover:bg-gray-100 transition-colors text-gray-600",
3161
+ title: "Delete"
3162
+ },
3163
+ /* @__PURE__ */ React33.createElement(RiDeleteBin6Line, { size: 16 })
3164
+ )))), /* @__PURE__ */ React33.createElement("div", { className: "flex items-center gap-4" }, /* @__PURE__ */ React33.createElement("div", { className: "flex-1" }, /* @__PURE__ */ React33.createElement(
3165
+ Progress_default,
3166
+ {
3167
+ progressColor,
3168
+ progress
3169
+ }
3170
+ )), /* @__PURE__ */ React33.createElement("div", { className: "text-xs text-gray-500 w-12 text-right" }, item.status === "error" ? "--%" : `${Math.round(progress)}%`)))
3171
+ );
3172
+ })));
3173
+ }
3174
+
1849
3175
  // app/components/Sidebar.tsx
1850
- import React26 from "react";
3176
+ import React34, { useState as useState10 } from "react";
1851
3177
  import Link2 from "next/link";
3178
+ import {
3179
+ RiArrowDownSLine as RiArrowDownSLine5,
3180
+ RiArrowRightSLine as RiArrowRightSLine3
3181
+ } from "@remixicon/react";
1852
3182
  import { usePathname } from "next/navigation";
1853
- var Sidebar = ({ children, collapsed, setCollapsed }) => {
1854
- return /* @__PURE__ */ React26.createElement(
3183
+ var Sidebar = ({ children, collapsed, setCollapsed, dense = false }) => {
3184
+ return /* @__PURE__ */ React34.createElement(
1855
3185
  "div",
1856
3186
  {
1857
3187
  onMouseEnter: () => setCollapsed(true),
1858
3188
  onMouseLeave: () => setCollapsed(false),
1859
3189
  className: cn(
1860
3190
  "border border-gray-200 shadow-sm relative flex flex-col min-h-screen transition-all duration-300 ease-in-out cursor-pointer",
1861
- !collapsed ? "w-[80px] py-[21px] px-[17px]" : "w-[308px] py-[22px] px-6"
3191
+ !collapsed ? dense ? "w-[76px] py-[19px] px-[15px]" : "w-[80px] py-[21px] px-[17px]" : dense ? "w-[304px] py-[20px] px-5" : "w-[308px] py-[22px] px-6"
1862
3192
  )
1863
3193
  },
1864
- /* @__PURE__ */ React26.createElement("div", { className: "" }, children)
3194
+ /* @__PURE__ */ React34.createElement("div", null, children)
1865
3195
  );
1866
3196
  };
1867
3197
  var SidebarHeader = ({
1868
- collapsed,
1869
- setCollapsed,
1870
- children
3198
+ children,
3199
+ dense = false
1871
3200
  }) => {
1872
- return /* @__PURE__ */ React26.createElement(
1873
- "div",
1874
- {
1875
- className: cn({
1876
- "z-20": true
1877
- })
1878
- },
1879
- /* @__PURE__ */ React26.createElement("div", { className: "flex justify-between items-center mb-4" }, /* @__PURE__ */ React26.createElement("span", { className: "whitespace-nowrap" }, children))
1880
- );
3201
+ return /* @__PURE__ */ React34.createElement("div", { className: cn("z-20", dense ? "mb-3" : "mb-4") }, /* @__PURE__ */ React34.createElement("div", { className: "flex justify-between items-center" }, /* @__PURE__ */ React34.createElement("span", { className: "whitespace-nowrap" }, children)));
1881
3202
  };
1882
3203
  var SidebarMenu = ({
1883
3204
  collapsed,
1884
3205
  navItems,
1885
- scroll = false
3206
+ scroll = false,
3207
+ dense = false
1886
3208
  }) => {
3209
+ const [openMenus, setOpenMenus] = useState10({});
1887
3210
  const currentPath = usePathname();
1888
- return /* @__PURE__ */ React26.createElement("nav", { className: `max-h-[60vh] ${scroll && "overflow-y-auto customScroll"}` }, /* @__PURE__ */ React26.createElement("ul", { className: "my-2 flex flex-col gap-2 items-stretch" }, navItems == null ? void 0 : navItems.map((parentItem, parentIndex) => /* @__PURE__ */ React26.createElement(
1889
- "li",
3211
+ const toggleMenu = (label) => {
3212
+ setOpenMenus((prev) => ({ ...prev, [label]: !prev[label] }));
3213
+ };
3214
+ React34.useEffect(() => {
3215
+ if (!collapsed) {
3216
+ setOpenMenus({});
3217
+ }
3218
+ }, [collapsed]);
3219
+ const getMenuHeight = () => {
3220
+ const footerItemsLength = (navItems == null ? void 0 : navItems.reduce((acc, item) => acc + item.items.length, 0)) || 0;
3221
+ if (footerItemsLength <= 1) {
3222
+ return "max-h-[80vh]";
3223
+ } else if (footerItemsLength === 2) {
3224
+ return "max-h-[70vh]";
3225
+ } else {
3226
+ return "max-h-[60vh]";
3227
+ }
3228
+ };
3229
+ const renderMenuItems = (items, level = 0) => {
3230
+ return /* @__PURE__ */ React34.createElement("ul", { className: level > 0 ? "ml-5 border-l border-gray-200" : "" }, items == null ? void 0 : items.map((item, index) => {
3231
+ const hasSubItems = item.subItems && item.subItems.length > 0;
3232
+ const isActive = item.href === currentPath;
3233
+ const isOpen = openMenus[item.label];
3234
+ const paddingLeft = level === 0 ? dense ? "10px" : "12px" : `${level * 5 + (dense ? 10 : 12)}px`;
3235
+ return /* @__PURE__ */ React34.createElement("li", { key: index }, hasSubItems ? /* @__PURE__ */ React34.createElement(
3236
+ Link2,
3237
+ {
3238
+ href: item.href || "#",
3239
+ className: cn(
3240
+ "flex items-center justify-between rounded-md cursor-pointer transition-colors duration-300 font-semibold whitespace-nowrap overflow-hidden",
3241
+ dense ? "px-3 py-1.5 mb-1" : "px-3 py-2 mb-[6px]",
3242
+ isActive ? "bg-primary-600 text-white" : "text-gray-700",
3243
+ isOpen ? "bg-gray-100" : "",
3244
+ "hover:bg-gray-100",
3245
+ level > 0 ? "text-sm font-medium" : ""
3246
+ ),
3247
+ style: { paddingLeft },
3248
+ onClick: (e) => {
3249
+ if (collapsed) {
3250
+ toggleMenu(item.label);
3251
+ }
3252
+ if (!item.href)
3253
+ e.preventDefault();
3254
+ }
3255
+ },
3256
+ /* @__PURE__ */ React34.createElement("div", { className: "flex items-center gap-2" }, item.icon && level === 0 && /* @__PURE__ */ React34.createElement("span", { className: dense ? "text-xs" : "text-text-sm" }, item.icon), /* @__PURE__ */ React34.createElement("span", { className: cn(!collapsed ? "opacity-0" : "") }, item.label)),
3257
+ collapsed && hasSubItems && /* @__PURE__ */ React34.createElement("span", null, isOpen ? /* @__PURE__ */ React34.createElement(
3258
+ RiArrowDownSLine5,
3259
+ {
3260
+ size: dense ? 16 : 18,
3261
+ color: "#475467"
3262
+ }
3263
+ ) : /* @__PURE__ */ React34.createElement(
3264
+ RiArrowRightSLine3,
3265
+ {
3266
+ size: dense ? 16 : 18,
3267
+ color: "#475467"
3268
+ }
3269
+ ))
3270
+ ) : /* @__PURE__ */ React34.createElement(
3271
+ Link2,
3272
+ {
3273
+ href: item.href || "#",
3274
+ className: cn(
3275
+ "flex items-center gap-2 rounded-md cursor-pointer transition-colors duration-300 whitespace-nowrap overflow-hidden",
3276
+ "hover:bg-gray-100",
3277
+ dense ? "px-3 py-1 mb-1" : "px-3 py-2 mb-[6px]",
3278
+ isActive ? "bg-primary-600 hover:bg-primary-700 text-white" : "text-gray-700",
3279
+ level > 0 ? "text-sm font-medium" : "font-semibold"
3280
+ )
3281
+ },
3282
+ item.icon && level === 0 && /* @__PURE__ */ React34.createElement("span", { className: dense ? "text-xs" : "text-text-sm" }, item.icon),
3283
+ /* @__PURE__ */ React34.createElement("span", { className: cn(!collapsed ? "opacity-0" : "") }, item.label)
3284
+ ), hasSubItems && isOpen && /* @__PURE__ */ React34.createElement("div", { className: dense ? "mt-0.5" : "mt-1" }, renderMenuItems(item.subItems, level + 1)));
3285
+ }));
3286
+ };
3287
+ return /* @__PURE__ */ React34.createElement(
3288
+ "nav",
1890
3289
  {
1891
- key: parentIndex,
1892
- className: "flex flex-col gap-3 mb-1 whitespace-nowrap overflow-hidden"
3290
+ className: cn(
3291
+ getMenuHeight(),
3292
+ "",
3293
+ scroll && collapsed ? "overflow-y-auto customScroll" : "overflow-hidden"
3294
+ )
1893
3295
  },
1894
- /* @__PURE__ */ React26.createElement(
1895
- "p",
1896
- {
1897
- className: cn({
1898
- "text-[14px] text-gray-500": true,
1899
- "w-[37px] text-ellipsis text-white whitespace-nowrap overflow-hidden": !collapsed
1900
- })
1901
- },
1902
- parentItem.label
1903
- ),
1904
- /* @__PURE__ */ React26.createElement("ul", null, parentItem == null ? void 0 : parentItem.items.map((item, index) => /* @__PURE__ */ React26.createElement("li", { key: index }, /* @__PURE__ */ React26.createElement(
1905
- Link2,
3296
+ /* @__PURE__ */ React34.createElement(
3297
+ "ul",
1906
3298
  {
1907
- className: cn({
1908
- "hover:bg-gray-100 px-3 py-2 flex items-center mb-[6px] cursor-pointer rounded-md transition-colors duration-300 font-semibold whitespace-nowrap overflow-hidden": true,
1909
- "text-white bg-primary-600": currentPath === (item == null ? void 0 : item.href),
1910
- "text-gray-700": currentPath !== (item == null ? void 0 : item.href),
1911
- "hover:bg-primary-600": currentPath === (item == null ? void 0 : item.href)
1912
- }),
1913
- href: item.href,
1914
- passHref: true
3299
+ className: cn(
3300
+ "flex flex-col gap-2 items-stretch",
3301
+ dense ? "my-1.5" : "my-2"
3302
+ )
1915
3303
  },
1916
- /* @__PURE__ */ React26.createElement(
1917
- "div",
3304
+ navItems == null ? void 0 : navItems.map((parentItem, parentIndex) => /* @__PURE__ */ React34.createElement(
3305
+ "li",
1918
3306
  {
1919
- className: `flex items-center gap-2 whitespace-nowrap`
3307
+ key: parentIndex,
3308
+ className: "flex flex-col gap-3 mb-1 whitespace-nowrap overflow-hidden"
1920
3309
  },
1921
- /* @__PURE__ */ React26.createElement("span", { className: "text-text-sm" }, " ", item.icon),
1922
- /* @__PURE__ */ React26.createElement("span", { className: cn(!collapsed ? "opacity-0" : "") }, item.label)
1923
- )
1924
- ))))
1925
- ))));
3310
+ /* @__PURE__ */ React34.createElement(
3311
+ "p",
3312
+ {
3313
+ className: cn(
3314
+ "text-gray-500 font-medium",
3315
+ dense ? "text-[12px]" : "text-[14px]",
3316
+ !collapsed ? "opacity-0" : ""
3317
+ )
3318
+ },
3319
+ parentItem.label
3320
+ ),
3321
+ renderMenuItems(parentItem.items)
3322
+ ))
3323
+ )
3324
+ );
1926
3325
  };
1927
- var Footer = ({
3326
+ var SidebarFooter = ({
1928
3327
  children,
1929
3328
  setCollapsed,
1930
3329
  collapsed,
1931
- navItems
3330
+ navItems,
3331
+ dense = false
1932
3332
  }) => {
1933
3333
  const currentPath = usePathname();
1934
- return /* @__PURE__ */ React26.createElement(
3334
+ return /* @__PURE__ */ React34.createElement(
1935
3335
  "div",
1936
3336
  {
1937
3337
  className: cn({
1938
- "absolute bottom-0 max-h-[230px] overflow-auto bg-white z-10 py-3 w-[85%]": true,
1939
- "w-[55%]": !collapsed
3338
+ "absolute bottom-0 overflow-auto bg-white z-10": true,
3339
+ "max-h-[226px] py-2.5 w-[85%]": dense,
3340
+ "max-h-[230px] py-3 w-[85%]": !dense,
3341
+ "w-[53%]": !collapsed && dense,
3342
+ "w-[55%]": !collapsed && !dense
1940
3343
  }),
1941
3344
  onClick: () => setCollapsed(true)
1942
3345
  },
1943
- collapsed && /* @__PURE__ */ React26.createElement("div", { className: "shadow-md" }, /* @__PURE__ */ React26.createElement(Divider_default, null)),
1944
- navItems && navItems.length > 0 && /* @__PURE__ */ React26.createElement("nav", { className: "flex-grow w-full" }, /* @__PURE__ */ React26.createElement("ul", { className: "my-2 flex flex-col gap-2 items-stretch" }, navItems == null ? void 0 : navItems.map((parentItem, parentIndex) => {
1945
- var _a;
1946
- return /* @__PURE__ */ React26.createElement(
1947
- "li",
1948
- {
1949
- key: parentIndex,
1950
- className: "flex flex-col gap-3 mb-1 whitespace-nowrap overflow-hidden"
1951
- },
1952
- /* @__PURE__ */ React26.createElement(
1953
- "p",
1954
- {
1955
- className: cn({
1956
- "text-[14px] text-gray-500": true,
1957
- "w-[37px] text-ellipsis text-white whitespace-nowrap overflow-hidden": !collapsed
1958
- })
1959
- },
1960
- parentItem.label
1961
- ),
1962
- /* @__PURE__ */ React26.createElement("ul", null, (_a = parentItem == null ? void 0 : parentItem.items) == null ? void 0 : _a.map((item, index) => /* @__PURE__ */ React26.createElement("li", { key: index }, /* @__PURE__ */ React26.createElement(
1963
- Link2,
3346
+ collapsed && /* @__PURE__ */ React34.createElement("div", { className: "shadow-md" }, /* @__PURE__ */ React34.createElement(Divider_default, null)),
3347
+ navItems && navItems.length > 0 && /* @__PURE__ */ React34.createElement("nav", { className: "flex-grow w-full" }, /* @__PURE__ */ React34.createElement(
3348
+ "ul",
3349
+ {
3350
+ className: cn(
3351
+ "flex flex-col gap-2 items-stretch",
3352
+ dense ? "my-1.5" : "my-2"
3353
+ )
3354
+ },
3355
+ navItems == null ? void 0 : navItems.map((parentItem, parentIndex) => {
3356
+ var _a;
3357
+ return /* @__PURE__ */ React34.createElement(
3358
+ "li",
1964
3359
  {
1965
- className: cn({
1966
- "hover:bg-gray-100 px-3 py-2 flex items-center mb-[6px] cursor-pointer rounded-md transition-colors duration-300 font-semibold whitespace-nowrap overflow-hidden": true,
1967
- "text-white bg-primary-600": currentPath === (item == null ? void 0 : item.href),
1968
- "text-gray-700": currentPath !== (item == null ? void 0 : item.href),
1969
- "hover:bg-primary-600": currentPath === (item == null ? void 0 : item.href)
1970
- }),
1971
- href: item.href,
1972
- passHref: true
3360
+ key: parentIndex,
3361
+ className: "flex flex-col gap-3 mb-1 whitespace-nowrap overflow-hidden"
1973
3362
  },
1974
- /* @__PURE__ */ React26.createElement(
1975
- "div",
3363
+ /* @__PURE__ */ React34.createElement(
3364
+ "p",
1976
3365
  {
1977
- className: `flex items-center gap-2 whitespace-nowrap`
3366
+ className: cn({
3367
+ "text-gray-500": true,
3368
+ "text-[12px]": dense,
3369
+ "text-[14px]": !dense,
3370
+ "w-[35px] text-ellipsis text-white whitespace-nowrap overflow-hidden": !collapsed && dense,
3371
+ "w-[37px] text-ellipsis text-white whitespace-nowrap overflow-hidden": !collapsed && !dense
3372
+ })
1978
3373
  },
1979
- /* @__PURE__ */ React26.createElement("span", { className: "text-text-sm" }, " ", item.icon),
1980
- /* @__PURE__ */ React26.createElement("span", { className: cn(!collapsed ? "opacity-0" : "") }, item.label)
1981
- )
1982
- ))))
1983
- );
1984
- }))),
3374
+ parentItem.label
3375
+ ),
3376
+ /* @__PURE__ */ React34.createElement("ul", null, (_a = parentItem == null ? void 0 : parentItem.items) == null ? void 0 : _a.map((item, index) => /* @__PURE__ */ React34.createElement("li", { key: index }, /* @__PURE__ */ React34.createElement(
3377
+ Link2,
3378
+ {
3379
+ className: cn({
3380
+ "hover:bg-gray-100 flex items-center cursor-pointer rounded-md transition-colors duration-300 font-semibold whitespace-nowrap overflow-hidden": true,
3381
+ "px-2 py-1.5 mb-1": dense,
3382
+ "px-3 py-2 mb-[6px]": !dense,
3383
+ "text-white bg-primary-600": currentPath === (item == null ? void 0 : item.href),
3384
+ "text-gray-700": currentPath !== (item == null ? void 0 : item.href),
3385
+ "hover:bg-primary-600": currentPath === (item == null ? void 0 : item.href)
3386
+ }),
3387
+ href: (item == null ? void 0 : item.href) || "#",
3388
+ passHref: true
3389
+ },
3390
+ /* @__PURE__ */ React34.createElement(
3391
+ "div",
3392
+ {
3393
+ className: `flex items-center gap-2 whitespace-nowrap`
3394
+ },
3395
+ /* @__PURE__ */ React34.createElement(
3396
+ "span",
3397
+ {
3398
+ className: dense ? "text-xs" : "text-text-sm"
3399
+ },
3400
+ " ",
3401
+ item.icon
3402
+ ),
3403
+ /* @__PURE__ */ React34.createElement("span", { className: cn(!collapsed ? "opacity-0" : "") }, item.label)
3404
+ )
3405
+ ))))
3406
+ );
3407
+ })
3408
+ )),
1985
3409
  children
1986
3410
  );
1987
3411
  };
1988
3412
  Sidebar.Header = SidebarHeader;
1989
3413
  Sidebar.Menu = SidebarMenu;
1990
- Sidebar.Footer = Footer;
3414
+ Sidebar.Footer = SidebarFooter;
1991
3415
  var Sidebar_default = Sidebar;
1992
3416
 
1993
- // app/components/Slider.tsx
1994
- import React27, { forwardRef as forwardRef10 } from "react";
1995
- var Slider = forwardRef10(
1996
- ({ value, min = 0, max = 100, size = "sm", ...props }, ref) => {
1997
- const progress = (value - min) / (max - min) * 100;
1998
- return /* @__PURE__ */ React27.createElement(React27.Fragment, null, /* @__PURE__ */ React27.createElement(
1999
- "input",
2000
- {
2001
- ref,
3417
+ // app/components/Skeleton.tsx
3418
+ import React35 from "react";
3419
+ var Skeleton = ({
3420
+ width = "100%",
3421
+ height = "100%",
3422
+ circle = false,
3423
+ animation = "shimmer"
3424
+ }) => {
3425
+ const style = {
3426
+ width: typeof width === "number" ? `${width}px` : width,
3427
+ height: typeof height === "number" ? `${height}px` : height,
3428
+ borderRadius: circle ? "50%" : void 0,
3429
+ display: "block"
3430
+ };
3431
+ return /* @__PURE__ */ React35.createElement(
3432
+ "span",
3433
+ {
3434
+ className: cn(
3435
+ "skeleton rounded-lg",
3436
+ circle ? "circle" : "",
3437
+ animation === "shimmer" && "skeleton-shimmer",
3438
+ animation === "wave" && "skeleton-wave",
3439
+ animation === "pulse" && "skeleton-pulse"
3440
+ ),
3441
+ style
3442
+ }
3443
+ );
3444
+ };
3445
+ var Skeleton_default = Skeleton;
3446
+
3447
+ // app/components/Slider.tsx
3448
+ import React36, { forwardRef as forwardRef11 } from "react";
3449
+ var Slider = forwardRef11(
3450
+ ({ value, min = 0, max = 100, size = "sm", ...props }, ref) => {
3451
+ const progress = (value - min) / (max - min) * 100;
3452
+ return /* @__PURE__ */ React36.createElement(React36.Fragment, null, /* @__PURE__ */ React36.createElement(
3453
+ "input",
3454
+ {
3455
+ ref,
2002
3456
  type: "range",
2003
3457
  min,
2004
3458
  max,
@@ -2018,25 +3472,27 @@ var Slider = forwardRef10(
2018
3472
  Slider.displayName = "Slider";
2019
3473
  var Slider_default = Slider;
2020
3474
 
2021
- // app/components/Skeleton.tsx
2022
- import React28 from "react";
2023
- var Skeleton = ({
2024
- width = "100%",
2025
- height = "100%",
2026
- circle = false
2027
- }) => {
2028
- const style = {
2029
- width: typeof width === "number" ? `${width}px` : width,
2030
- height: typeof height === "number" ? `${height}px` : height,
2031
- borderRadius: circle ? "50%" : void 0
2032
- };
2033
- return /* @__PURE__ */ React28.createElement("span", { className: `skeleton rounded-lg ${circle ? "circle" : ""}`, style });
2034
- };
2035
- var Skeleton_default = Skeleton;
3475
+ // app/components/SplitButton.tsx
3476
+ import React37, { forwardRef as forwardRef12 } from "react";
3477
+ var SplitButton = forwardRef12(
3478
+ ({ children, className = "", size = "md", appearance = "primary", compact = false, ...props }, ref) => {
3479
+ return /* @__PURE__ */ React37.createElement(
3480
+ "div",
3481
+ {
3482
+ ref,
3483
+ className: `inline-flex ${compact ? "gap-0" : ""} ${className}`,
3484
+ ...props
3485
+ },
3486
+ children
3487
+ );
3488
+ }
3489
+ );
3490
+ SplitButton.displayName = "SplitButton";
3491
+ var SplitButton_default = SplitButton;
2036
3492
 
2037
3493
  // app/components/Stepper.tsx
2038
- import React29, { useRef as useRef5 } from "react";
2039
- import { RiCheckLine } from "@remixicon/react";
3494
+ import React38, { useRef as useRef8 } from "react";
3495
+ import { RiCheckLine as RiCheckLine2 } from "@remixicon/react";
2040
3496
  var Stepper = ({
2041
3497
  stepsConfig,
2042
3498
  currentStep,
@@ -2045,82 +3501,126 @@ var Stepper = ({
2045
3501
  setIsComplete,
2046
3502
  position = "horizontal"
2047
3503
  }) => {
2048
- var _a;
2049
- const stepRef = useRef5([]);
3504
+ var _a, _b;
3505
+ const stepRef = useRef8([]);
2050
3506
  if (!stepsConfig.length) {
2051
3507
  return null;
2052
3508
  }
2053
3509
  const ActiveComponent = (_a = stepsConfig[currentStep - 1]) == null ? void 0 : _a.Component;
2054
- return /* @__PURE__ */ React29.createElement("div", { className: cn(position !== "horizontal" && "flex") }, /* @__PURE__ */ React29.createElement(
3510
+ return /* @__PURE__ */ React38.createElement(
2055
3511
  "div",
2056
3512
  {
2057
- className: cn(
2058
- "relative",
2059
- position === "horizontal" ? "flex justify-between items-start" : "flex flex-col"
2060
- )
3513
+ role: "region",
3514
+ "aria-label": "Step Progress",
3515
+ className: cn(position !== "horizontal" && "flex")
2061
3516
  },
2062
- stepsConfig.map((step, index) => /* @__PURE__ */ React29.createElement(
3517
+ /* @__PURE__ */ React38.createElement(
2063
3518
  "div",
2064
3519
  {
2065
- key: index,
2066
- ref: (el) => stepRef.current[index] = el,
2067
- className: `w-full ${position === "horizontal" ? "flex gap-4 flex-col" : "flex gap-6 justify-start"} ${currentStep > index + 1 || isComplete ? "complete" : ""} ${currentStep === index + 1 ? "" : ""}`
3520
+ className: cn(
3521
+ "relative",
3522
+ position === "horizontal" ? "flex justify-center items-start" : "flex flex-col"
3523
+ ),
3524
+ role: "list",
3525
+ "aria-label": `Progress: ${currentStep} of ${stepsConfig.length} steps`
2068
3526
  },
2069
- /* @__PURE__ */ React29.createElement(
3527
+ stepsConfig == null ? void 0 : stepsConfig.map((step, index) => /* @__PURE__ */ React38.createElement(
2070
3528
  "div",
2071
3529
  {
3530
+ key: index,
3531
+ ref: (el) => stepRef.current[index] = el,
2072
3532
  className: cn(
2073
- "",
2074
- position === "horizontal" ? "flex items-center" : "flex flex-col"
2075
- )
3533
+ position === "horizontal" ? "flex gap-4 flex-col" : "flex gap-6 justify-start",
3534
+ index === stepsConfig.length - 1 ? "w-auto" : "w-full",
3535
+ currentStep > index + 1 || isComplete ? "complete" : "",
3536
+ currentStep === index + 1 ? "" : ""
3537
+ ),
3538
+ role: "listitem",
3539
+ "aria-current": currentStep === index + 1 ? "step" : void 0,
3540
+ "aria-label": `${step.name}${step.helperName ? `, ${step.helperName}` : ""}, ${currentStep > index + 1 || isComplete ? "completed" : currentStep === index + 1 ? "current step" : "pending"}`
2076
3541
  },
2077
- /* @__PURE__ */ React29.createElement(
3542
+ /* @__PURE__ */ React38.createElement(
2078
3543
  "div",
2079
3544
  {
2080
- className: `w-[20px] h-[20px] rounded-full bg-gray-100 flex justify-center items-center ${currentStep === index + 1 ? "border border-primary-600" : "border border-gray-200"} ${currentStep > index + 1 || isComplete ? "bg-primary-600 border-none" : ""}`
3545
+ className: cn(
3546
+ "",
3547
+ position === "horizontal" ? "flex items-center" : "flex flex-col"
3548
+ )
2081
3549
  },
2082
- currentStep === index + 1 && !isComplete && /* @__PURE__ */ React29.createElement("span", { className: "w-[10px] h-[10px] rounded-full bg-primary-600" }),
2083
- (currentStep > index + 1 || isComplete) && /* @__PURE__ */ React29.createElement("span", null, /* @__PURE__ */ React29.createElement(RiCheckLine, { size: 12, color: "#fff" }))
3550
+ /* @__PURE__ */ React38.createElement(
3551
+ "div",
3552
+ {
3553
+ className: `w-[20px] h-[20px] rounded-full bg-gray-100 flex justify-center items-center ${currentStep === index + 1 ? "border border-primary-600" : "border border-gray-200"} ${currentStep > index + 1 || isComplete ? "bg-primary-600 border-none" : ""}`,
3554
+ role: "status",
3555
+ "aria-label": `Step ${index + 1} ${currentStep > index + 1 || isComplete ? "completed" : currentStep === index + 1 ? "current" : "pending"}`
3556
+ },
3557
+ currentStep === index + 1 && !isComplete && /* @__PURE__ */ React38.createElement(
3558
+ "span",
3559
+ {
3560
+ "aria-hidden": "true",
3561
+ className: "w-[10px] h-[10px] rounded-full bg-primary-600"
3562
+ }
3563
+ ),
3564
+ (currentStep > index + 1 || isComplete) && /* @__PURE__ */ React38.createElement("span", { "aria-hidden": "true" }, /* @__PURE__ */ React38.createElement(RiCheckLine2, { size: 12, color: "#fff" }))
3565
+ ),
3566
+ index !== stepsConfig.length - 1 && /* @__PURE__ */ React38.createElement(
3567
+ "div",
3568
+ {
3569
+ className: cn(
3570
+ "mx-auto rounded-lg bg-gray-200",
3571
+ position === "horizontal" ? "w-[80%] h-1" : "h-[100px] w-1 my-2"
3572
+ ),
3573
+ "aria-hidden": "true"
3574
+ },
3575
+ /* @__PURE__ */ React38.createElement(
3576
+ "p",
3577
+ {
3578
+ className: cn(
3579
+ "h-full rounded-lg",
3580
+ currentStep > index + 1 ? "bg-primary-600" : ""
3581
+ )
3582
+ }
3583
+ )
3584
+ )
2084
3585
  ),
2085
- index !== stepsConfig.length - 1 && /* @__PURE__ */ React29.createElement(
3586
+ /* @__PURE__ */ React38.createElement(
2086
3587
  "div",
2087
3588
  {
3589
+ "aria-hidden": currentStep !== index + 1,
2088
3590
  className: cn(
2089
- "mx-auto rounded-lg bg-gray-200",
2090
- position === "horizontal" ? "w-[80%] h-1" : "h-[100px] w-1 my-2"
3591
+ "whitespace-nowrap",
3592
+ position === "vertical" || (step == null ? void 0 : step.helperName) ? "-mt-1" : ""
2091
3593
  )
2092
3594
  },
2093
- /* @__PURE__ */ React29.createElement(
2094
- "p",
3595
+ /* @__PURE__ */ React38.createElement(
3596
+ "span",
2095
3597
  {
2096
- className: cn(
2097
- "h-full rounded-lg ",
2098
- currentStep > index + 1 ? "bg-primary-600" : ""
2099
- )
2100
- }
2101
- )
3598
+ "aria-label": "Helper text",
3599
+ className: "text-gray-400 text-text-xs"
3600
+ },
3601
+ step == null ? void 0 : step.helperName
3602
+ ),
3603
+ /* @__PURE__ */ React38.createElement("p", null, step == null ? void 0 : step.name)
2102
3604
  )
2103
- ),
2104
- /* @__PURE__ */ React29.createElement(
2105
- "div",
2106
- {
2107
- className: cn(
2108
- "whitespace-nowrap",
2109
- position === "vertical" || (step == null ? void 0 : step.helperName) ? "-mt-1" : ""
2110
- )
2111
- },
2112
- /* @__PURE__ */ React29.createElement("span", { className: "text-gray-400 text-text-xs" }, step == null ? void 0 : step.helperName),
2113
- /* @__PURE__ */ React29.createElement("p", null, step == null ? void 0 : step.name)
2114
- )
2115
- ))
2116
- ), ActiveComponent && /* @__PURE__ */ React29.createElement(ActiveComponent, null));
3605
+ ))
3606
+ ),
3607
+ ActiveComponent && /* @__PURE__ */ React38.createElement(
3608
+ "div",
3609
+ {
3610
+ role: "tabpanel",
3611
+ "aria-label": `Current step: ${(_b = stepsConfig[currentStep - 1]) == null ? void 0 : _b.name}`,
3612
+ tabIndex: 0
3613
+ },
3614
+ /* @__PURE__ */ React38.createElement(ActiveComponent, null)
3615
+ )
3616
+ );
2117
3617
  };
2118
3618
  var Stepper_default = Stepper;
2119
3619
 
2120
3620
  // app/components/TableComponents.tsx
2121
- import React30 from "react";
3621
+ import React39 from "react";
2122
3622
  var Table = ({ children, className, dense, ...props }) => {
2123
- return /* @__PURE__ */ React30.createElement(
3623
+ return /* @__PURE__ */ React39.createElement(
2124
3624
  "table",
2125
3625
  {
2126
3626
  ...props,
@@ -2138,7 +3638,7 @@ var TableHead = ({
2138
3638
  className,
2139
3639
  ...props
2140
3640
  }) => {
2141
- return /* @__PURE__ */ React30.createElement(
3641
+ return /* @__PURE__ */ React39.createElement(
2142
3642
  "thead",
2143
3643
  {
2144
3644
  ...props,
@@ -2152,7 +3652,7 @@ var TableBody = ({
2152
3652
  className,
2153
3653
  ...props
2154
3654
  }) => {
2155
- return /* @__PURE__ */ React30.createElement("tbody", { ...props, className: cn(className) }, children);
3655
+ return /* @__PURE__ */ React39.createElement("tbody", { ...props, className: cn(className) }, children);
2156
3656
  };
2157
3657
  var TableRow = ({
2158
3658
  children,
@@ -2160,7 +3660,7 @@ var TableRow = ({
2160
3660
  indent,
2161
3661
  ...props
2162
3662
  }) => {
2163
- return /* @__PURE__ */ React30.createElement(
3663
+ return /* @__PURE__ */ React39.createElement(
2164
3664
  "tr",
2165
3665
  {
2166
3666
  ...props,
@@ -2180,9 +3680,11 @@ var TableHeadCell = ({
2180
3680
  sticky,
2181
3681
  shadow,
2182
3682
  left,
3683
+ shadowRight,
3684
+ right,
2183
3685
  ...props
2184
3686
  }) => {
2185
- return /* @__PURE__ */ React30.createElement(
3687
+ return /* @__PURE__ */ React39.createElement(
2186
3688
  "th",
2187
3689
  {
2188
3690
  ...props,
@@ -2190,14 +3692,17 @@ var TableHeadCell = ({
2190
3692
  "px-6 py-3 text-left group-has-[th]/dense:py-2",
2191
3693
  sticky && `sticky bg-gray-50`,
2192
3694
  sticky && shadow && "shadow-table",
3695
+ sticky && shadowRight && "shadow-tableRight",
2193
3696
  left,
3697
+ right,
2194
3698
  className
2195
3699
  ),
2196
3700
  style: {
2197
- left
3701
+ left,
3702
+ right
2198
3703
  }
2199
3704
  },
2200
- /* @__PURE__ */ React30.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ React30.createElement("span", { className: "font-medium text-xs" }, children), icon && /* @__PURE__ */ React30.createElement(
3705
+ /* @__PURE__ */ React39.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ React39.createElement("span", { className: "font-medium text-xs" }, children), icon && /* @__PURE__ */ React39.createElement(
2201
3706
  "span",
2202
3707
  {
2203
3708
  className: "hover:bg-gray-200 w-5 h-5 flex items-center justify-center p-1 rounded focus:bg-gray-300 active:bg-gray-300"
@@ -2212,10 +3717,12 @@ var TableDataCell = ({
2212
3717
  icon,
2213
3718
  sticky,
2214
3719
  shadow,
3720
+ shadowRight,
2215
3721
  left,
3722
+ right,
2216
3723
  ...props
2217
3724
  }) => {
2218
- return /* @__PURE__ */ React30.createElement(
3725
+ return /* @__PURE__ */ React39.createElement(
2219
3726
  "td",
2220
3727
  {
2221
3728
  ...props,
@@ -2223,15 +3730,18 @@ var TableDataCell = ({
2223
3730
  "px-6 py-4 text-sm font-medium group-has-[td]/dense:py-2 first:group-has-[td]/indent:pl-[60px]",
2224
3731
  sticky && `sticky bg-white`,
2225
3732
  sticky && shadow && "shadow-table",
3733
+ sticky && shadowRight && "shadow-tableRight",
2226
3734
  left,
3735
+ right,
2227
3736
  className
2228
3737
  ),
2229
3738
  style: {
2230
- left
3739
+ left,
3740
+ right
2231
3741
  }
2232
3742
  },
2233
- /* @__PURE__ */ React30.createElement("span", { className: "font-medium text-sm" }, children),
2234
- icon && /* @__PURE__ */ React30.createElement(
3743
+ /* @__PURE__ */ React39.createElement("span", { className: "font-medium text-sm" }, children),
3744
+ icon && /* @__PURE__ */ React39.createElement(
2235
3745
  "span",
2236
3746
  {
2237
3747
  className: "hover:bg-gray-200 w-5 h-5 flex items-center justify-center p-1 rounded focus:bg-gray-300 active:bg-gray-300"
@@ -2243,96 +3753,217 @@ var TableDataCell = ({
2243
3753
  var TableComponents_default = Table;
2244
3754
 
2245
3755
  // app/components/Tabs.tsx
2246
- import React31 from "react";
3756
+ import React40 from "react";
2247
3757
  var TabsContainer = ({
2248
3758
  children,
2249
- className
3759
+ className,
3760
+ position = "horizontal"
2250
3761
  }) => {
2251
- return /* @__PURE__ */ React31.createElement("div", { className }, children);
3762
+ return /* @__PURE__ */ React40.createElement("div", { className: cn(position === "vertical" ? "flex" : "block", className) }, children);
2252
3763
  };
2253
3764
  var TabList = ({
2254
3765
  onChange,
2255
3766
  ariaLabel,
2256
3767
  children,
2257
3768
  box = false,
2258
- className
3769
+ pill = false,
3770
+ className,
3771
+ position = "horizontal"
2259
3772
  }) => {
2260
- const handleTabChange = (value) => {
2261
- onChange(value);
3773
+ const [focusIndex, setFocusIndex] = React40.useState(0);
3774
+ const tabRefs = React40.useRef([]);
3775
+ const handleKeyDown = (e, index) => {
3776
+ var _a, _b, _c, _d, _e, _f;
3777
+ const tabCount = React40.Children.count(children);
3778
+ switch (e.key) {
3779
+ case "ArrowRight":
3780
+ if (position === "horizontal") {
3781
+ e.preventDefault();
3782
+ const nextIndex = (index + 1) % tabCount;
3783
+ setFocusIndex(nextIndex);
3784
+ (_a = tabRefs.current[nextIndex]) == null ? void 0 : _a.focus();
3785
+ }
3786
+ break;
3787
+ case "ArrowLeft":
3788
+ if (position === "horizontal") {
3789
+ e.preventDefault();
3790
+ const prevIndex = (index - 1 + tabCount) % tabCount;
3791
+ setFocusIndex(prevIndex);
3792
+ (_b = tabRefs.current[prevIndex]) == null ? void 0 : _b.focus();
3793
+ }
3794
+ break;
3795
+ case "ArrowDown":
3796
+ if (position === "vertical") {
3797
+ e.preventDefault();
3798
+ const nextIndex = (index + 1) % tabCount;
3799
+ setFocusIndex(nextIndex);
3800
+ (_c = tabRefs.current[nextIndex]) == null ? void 0 : _c.focus();
3801
+ }
3802
+ break;
3803
+ case "ArrowUp":
3804
+ if (position === "vertical") {
3805
+ e.preventDefault();
3806
+ const prevIndex = (index - 1 + tabCount) % tabCount;
3807
+ setFocusIndex(prevIndex);
3808
+ (_d = tabRefs.current[prevIndex]) == null ? void 0 : _d.focus();
3809
+ }
3810
+ break;
3811
+ case "Home":
3812
+ e.preventDefault();
3813
+ setFocusIndex(0);
3814
+ (_e = tabRefs.current[0]) == null ? void 0 : _e.focus();
3815
+ break;
3816
+ case "End":
3817
+ e.preventDefault();
3818
+ const lastIndex = tabCount - 1;
3819
+ setFocusIndex(lastIndex);
3820
+ (_f = tabRefs.current[lastIndex]) == null ? void 0 : _f.focus();
3821
+ break;
3822
+ }
2262
3823
  };
2263
- return /* @__PURE__ */ React31.createElement(
3824
+ return /* @__PURE__ */ React40.createElement(
2264
3825
  "div",
2265
3826
  {
2266
3827
  className: cn(
2267
- "flex items-center",
2268
- box ? "bg-gray-50 rounded-lg border border-gray-200" : "border-b border-gray-200",
3828
+ position === "horizontal" ? "flex items-center" : "flex flex-col items-stretch",
3829
+ box ? "bg-gray-50 rounded-lg border border-gray-200" : pill ? position === "horizontal" ? "bg-transparent rounded-lg" : "bg-gray-100 rounded-full p-1" : position === "horizontal" ? "border-b border-gray-200" : "border-r border-gray-200",
2269
3830
  className
2270
3831
  ),
2271
3832
  role: "tablist",
2272
- "aria-label": ariaLabel
3833
+ "aria-label": ariaLabel,
3834
+ "aria-orientation": position
2273
3835
  },
2274
- React31.Children.map(children, (child) => {
2275
- if (React31.isValidElement(child)) {
2276
- return React31.cloneElement(child, {
2277
- onChange: handleTabChange,
2278
- box
3836
+ React40.Children.map(children, (child, index) => {
3837
+ if (React40.isValidElement(child)) {
3838
+ const childProps = {
3839
+ onChange,
3840
+ box,
3841
+ pill,
3842
+ // Add this line to pass pill prop to Tab
3843
+ position,
3844
+ onKeyDown: (e) => handleKeyDown(e, index),
3845
+ tabIndex: index === focusIndex ? 0 : -1
3846
+ };
3847
+ return React40.cloneElement(child, {
3848
+ ...childProps,
3849
+ ref: (el) => {
3850
+ tabRefs.current[index] = el;
3851
+ const originalRef = child.ref;
3852
+ if (originalRef) {
3853
+ if (typeof originalRef === "function") {
3854
+ originalRef(el);
3855
+ } else {
3856
+ originalRef.current = el;
3857
+ }
3858
+ }
3859
+ }
2279
3860
  });
2280
3861
  }
2281
3862
  return null;
2282
3863
  })
2283
3864
  );
2284
3865
  };
2285
- var Tab = ({
2286
- label,
2287
- value,
2288
- onChange,
2289
- icon,
2290
- content,
2291
- box = false,
2292
- selectedTabValue,
2293
- className
2294
- }) => {
2295
- const handleClick = () => {
2296
- onChange(value);
2297
- };
2298
- const isSelected = value === selectedTabValue;
2299
- return /* @__PURE__ */ React31.createElement(
2300
- "button",
2301
- {
2302
- role: "tab",
2303
- className: cn(
2304
- "flex items-center gap-2 px-4 py-3 text-text-sm font-medium cursor-pointer hover:bg-gray-100 hover:rounded-t transition-all ease-linear duration-200 delay-75",
2305
- isSelected && !box ? "text-primary-600 border-b-2 border-primary-600" : "border-b-2 border-transparent text-gray-700",
2306
- isSelected && box ? "bg-white hover:bg-white shadow-md" : "",
2307
- box ? "m-1 rounded-lg hover:rounded-lg" : "m-0",
2308
- className
2309
- ),
2310
- onClick: handleClick
2311
- },
2312
- icon,
2313
- " ",
3866
+ var Tab = React40.forwardRef(
3867
+ ({
2314
3868
  label,
2315
- " ",
2316
- content
2317
- );
2318
- };
3869
+ value,
3870
+ onChange,
3871
+ icon,
3872
+ content,
3873
+ box = false,
3874
+ pill = false,
3875
+ selectedTabValue,
3876
+ className,
3877
+ onKeyDown,
3878
+ tabIndex,
3879
+ position = "horizontal"
3880
+ }, ref) => {
3881
+ const isSelected = value === selectedTabValue;
3882
+ return /* @__PURE__ */ React40.createElement(
3883
+ "button",
3884
+ {
3885
+ ref,
3886
+ role: "tab",
3887
+ "aria-selected": isSelected,
3888
+ "aria-controls": `panel-${value}`,
3889
+ id: `tab-${value}`,
3890
+ tabIndex,
3891
+ onKeyDown,
3892
+ className: cn(
3893
+ "flex items-center gap-2 px-4 py-3 text-text-sm font-medium cursor-pointer",
3894
+ // Default variant (no box, no pill)
3895
+ !box && !pill && [
3896
+ isSelected && position === "horizontal" ? "text-primary-600 border-b-2 border-primary-600" : isSelected && position === "vertical" ? "text-primary-600 border-r-2 border-primary-600" : "border-transparent text-gray-700"
3897
+ ],
3898
+ // Box variant
3899
+ box && [
3900
+ position === "horizontal" ? "m-1 rounded-lg hover:rounded-lg" : "mx-1 my-0.5 rounded-lg hover:rounded-lg",
3901
+ isSelected ? "bg-white hover:bg-white shadow-md" : ""
3902
+ ],
3903
+ // Pill variant - Horizontal
3904
+ pill && position === "horizontal" && [
3905
+ "py-1 px-3 text-sm first:rounded-l-2xl last:rounded-r-2xl border transition-all duration-200",
3906
+ isSelected ? "bg-primary-600 border-primary-600 text-white shadow-sm hover:bg-primary-700" : "bg-white border-gray-300 text-gray-700 hover:bg-gray-100"
3907
+ ],
3908
+ // Pill variant - Vertical
3909
+ pill && position === "vertical" && [
3910
+ "py-2 px-4 rounded-full border transition-all duration-200 my-1",
3911
+ isSelected ? "bg-primary-600 border-primary-600 text-white shadow-sm hover:bg-primary-700" : "bg-gray-100 border-gray-300 text-gray-700 hover:bg-gray-200 hover:border-gray-400"
3912
+ ],
3913
+ // Common hover styles for non-pill variants
3914
+ !pill && [
3915
+ position === "horizontal" ? "hover:bg-gray-100 hover:rounded-t transition-all ease-linear duration-200 delay-75" : "hover:bg-gray-100 hover:rounded-l transition-all ease-linear duration-200 delay-75"
3916
+ ],
3917
+ // Border for vertical non-box, non-pill
3918
+ position === "vertical" && !box && !pill && !isSelected ? "border-r-2" : "",
3919
+ className
3920
+ ),
3921
+ onClick: () => onChange(value)
3922
+ },
3923
+ icon && /* @__PURE__ */ React40.createElement("span", { "aria-hidden": "true" }, icon),
3924
+ label,
3925
+ content && /* @__PURE__ */ React40.createElement("span", { "aria-hidden": "true" }, content)
3926
+ );
3927
+ }
3928
+ );
2319
3929
  var TabPanel = ({
2320
3930
  value,
2321
3931
  currentValue,
2322
3932
  children,
2323
3933
  className
2324
3934
  }) => {
2325
- return value === currentValue ? /* @__PURE__ */ React31.createElement("div", { className }, children) : null;
3935
+ return value === currentValue ? /* @__PURE__ */ React40.createElement(
3936
+ "div",
3937
+ {
3938
+ role: "tabpanel",
3939
+ id: `panel-${value}`,
3940
+ "aria-labelledby": `tab-${value}`,
3941
+ tabIndex: 0,
3942
+ className
3943
+ },
3944
+ children
3945
+ ) : null;
2326
3946
  };
2327
3947
  var Tabs_default = TabsContainer;
3948
+ Tab.displayName = "Tab";
2328
3949
 
2329
3950
  // app/components/Textarea.tsx
2330
- import React32, {
2331
- forwardRef as forwardRef11
3951
+ import React41, {
3952
+ forwardRef as forwardRef13
2332
3953
  } from "react";
2333
- var Textarea = forwardRef11(
2334
- ({ size, className, rows, cols, disabled, children, ...props }, ref) => {
2335
- return /* @__PURE__ */ React32.createElement(
3954
+ var Textarea = forwardRef13(
3955
+ ({
3956
+ size,
3957
+ className,
3958
+ rows,
3959
+ cols,
3960
+ disabled,
3961
+ error,
3962
+ children,
3963
+ id,
3964
+ ...props
3965
+ }, ref) => {
3966
+ return /* @__PURE__ */ React41.createElement(
2336
3967
  "textarea",
2337
3968
  {
2338
3969
  ...props,
@@ -2341,8 +3972,9 @@ var Textarea = forwardRef11(
2341
3972
  rows,
2342
3973
  cols,
2343
3974
  className: cn(
2344
- "group flex items-center gap-2 border border-gray-200 rounded-lg bg-gray-50 shadow-xs hover:bg-gray-50 hover:border-gray-300 text-sm focus-within:border-gray-800 focus-within:bg-gray-25 focus-within:hover:bg-gray-50 focus-within:hover:border-gray-800 outline-none disabled:bg-gray-300 disabled:select-none disabled:pointer-events-none disabled:opacity-30 placeholder:text-gray-500 hover:placeholder:text-gray-500",
3975
+ "group flex items-center gap-2 border border-gray-200 rounded-lg bg-gray-50 shadow-xs hover:bg-gray-50 hover:border-gray-300 text-sm focus-within:border-gray-800 focus-within:bg-gray-25 focus-within:hover:bg-gray-50 focus-within:hover:border-gray-800 outline-none disabled:bg-gray-300 disabled:select-none disabled:pointer-events-none disabled:opacity-30 w-full placeholder:text-gray-500 hover:placeholder:text-gray-500 shadow-[0px_1px_2px_0px_#1018280D]",
2345
3976
  size === "sm" ? "py-2.5 px-3.5" : "p-2.5",
3977
+ error && "border-error-500 hover:border-error-600 focus-within:hover:border-error-500 focus-within:border-error-500",
2346
3978
  className,
2347
3979
  size
2348
3980
  )
@@ -2354,9 +3986,74 @@ var Textarea = forwardRef11(
2354
3986
  Textarea.displayName = "Textarea";
2355
3987
  var Textarea_default = Textarea;
2356
3988
 
3989
+ // app/components/TextInputWithLabel.tsx
3990
+ import { RiCloseCircleLine } from "@remixicon/react";
3991
+ import React42 from "react";
3992
+ var TextInputWithLabel = ({
3993
+ intent = "primary",
3994
+ placeholder = "Enter tags",
3995
+ type = "text",
3996
+ size,
3997
+ tags,
3998
+ setTags,
3999
+ ...props
4000
+ }) => {
4001
+ const handleAddTags = (inputValue) => {
4002
+ const values = inputValue.split(",").map((v) => v.trim()).filter((v) => v && !tags.includes(v));
4003
+ if (values.length === 0)
4004
+ return;
4005
+ setTags([...tags, ...values]);
4006
+ };
4007
+ const handleRemoveTag = (tag) => {
4008
+ setTags(tags.filter((t) => t !== tag));
4009
+ };
4010
+ const handleKeyDown = (e) => {
4011
+ if (e.key === "Enter") {
4012
+ e.preventDefault();
4013
+ const target = e.target;
4014
+ handleAddTags(target.value);
4015
+ target.value = "";
4016
+ }
4017
+ };
4018
+ const handlePaste = (e) => {
4019
+ e.preventDefault();
4020
+ const pasteData = e.clipboardData.getData("text");
4021
+ handleAddTags(pasteData);
4022
+ };
4023
+ return /* @__PURE__ */ React42.createElement("div", null, /* @__PURE__ */ React42.createElement(
4024
+ Input_default,
4025
+ {
4026
+ type,
4027
+ size,
4028
+ onKeyDown: handleKeyDown,
4029
+ onPaste: handlePaste,
4030
+ placeholder,
4031
+ className: "w-full",
4032
+ ...props
4033
+ }
4034
+ ), /* @__PURE__ */ React42.createElement("div", { className: "flex flex-wrap items-center gap-2 mt-2 transition-all duration-300" }, tags == null ? void 0 : tags.map((tag, idx) => /* @__PURE__ */ React42.createElement(
4035
+ Chip_default,
4036
+ {
4037
+ size: "md",
4038
+ intent,
4039
+ key: `${tag}-${idx}`,
4040
+ endIcon: /* @__PURE__ */ React42.createElement(
4041
+ RiCloseCircleLine,
4042
+ {
4043
+ size: 14,
4044
+ className: "cursor-pointer hover:text-red-500",
4045
+ onClick: () => handleRemoveTag(tag)
4046
+ }
4047
+ )
4048
+ },
4049
+ tag
4050
+ ))));
4051
+ };
4052
+ var TextInputWithLabel_default = TextInputWithLabel;
4053
+
2357
4054
  // app/components/Toggle.tsx
2358
4055
  import { cva as cva8 } from "class-variance-authority";
2359
- import React33, { forwardRef as forwardRef12 } from "react";
4056
+ import React43, { forwardRef as forwardRef14 } from "react";
2360
4057
  var toggleVariants = cva8("", {
2361
4058
  variants: {
2362
4059
  size: {
@@ -2374,37 +4071,42 @@ var toggleVariants = cva8("", {
2374
4071
  intent: "primary"
2375
4072
  }
2376
4073
  });
2377
- var Toggle = forwardRef12(
2378
- ({ size, className, intent, disabled, children, ...props }, ref) => {
2379
- return /* @__PURE__ */ React33.createElement(
4074
+ var Toggle = forwardRef14(
4075
+ ({ size, className, intent, disabled, children, id, ...props }, ref) => {
4076
+ return /* @__PURE__ */ React43.createElement(
2380
4077
  "label",
2381
4078
  {
2382
4079
  className: cn(
2383
4080
  "inline-flex items-center cursor-pointer",
2384
4081
  disabled && "opacity-30 pointer-events-none"
2385
- )
4082
+ ),
4083
+ htmlFor: id
2386
4084
  },
2387
- /* @__PURE__ */ React33.createElement(
4085
+ /* @__PURE__ */ React43.createElement(
2388
4086
  "input",
2389
4087
  {
2390
4088
  type: "checkbox",
2391
4089
  disabled,
2392
4090
  ref,
4091
+ id,
4092
+ role: "switch",
4093
+ "aria-checked": props == null ? void 0 : props.checked,
2393
4094
  ...props,
2394
- className: "sr-only flex justify-center peer"
4095
+ className: "sr-only peer"
2395
4096
  }
2396
4097
  ),
2397
- /* @__PURE__ */ React33.createElement(
4098
+ /* @__PURE__ */ React43.createElement(
2398
4099
  "span",
2399
4100
  {
2400
4101
  className: cn(
2401
- "relative w-11 h-7 bg-gray-300 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:rounded-full after:h-5 after:w-5 after:transition-all",
4102
+ "relative w-11 h-7 bg-gray-300 rounded-full peer peer-focus:ring-2 peer-focus:ring-primary-600 peer-focus:ring-offset-2 peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:rounded-full after:h-5 after:w-5 after:transition-all",
2402
4103
  toggleVariants({
2403
4104
  intent,
2404
- className,
2405
4105
  size
2406
- })
2407
- )
4106
+ }),
4107
+ className
4108
+ ),
4109
+ "aria-hidden": "true"
2408
4110
  },
2409
4111
  children
2410
4112
  )
@@ -2413,6 +4115,288 @@ var Toggle = forwardRef12(
2413
4115
  );
2414
4116
  Toggle.displayName = "Toggle";
2415
4117
  var Toggle_default = Toggle;
4118
+
4119
+ // app/components/Tooltip.tsx
4120
+ import { cva as cva9 } from "class-variance-authority";
4121
+ import React44 from "react";
4122
+ var tooltipVariants = cva9(
4123
+ "bg-white shadow-lg rounded-lg absolute hidden group-hover:block p-3 z-10 max-w-[328px] w-max whitespace-normal opacity-0 group-hover:opacity-100 transform transition-all duration-1000 ease-in-out group-hover:delay-[2000ms]",
4124
+ {
4125
+ variants: {
4126
+ position: {
4127
+ top: "bottom-[calc(100%+8px)] group-hover:translate-y-0 delay-1000 translate-y-[-10px]",
4128
+ right: "top-1/2 -translate-y-1/2 left-[calc(100%+8px)] group-hover:translate-x-0 translate-x-[-10px]",
4129
+ bottom: "top-[calc(100%+8px)] group-hover:translate-y-0 translate-y-[10px]",
4130
+ left: "top-1/2 -translate-y-1/2 right-[calc(100%+8px)] group-hover:translate-x-0 translate-x-[10px]"
4131
+ }
4132
+ }
4133
+ }
4134
+ );
4135
+ var arrowVariants = cva9(
4136
+ "absolute w-0 h-0 border-transparent border-solid",
4137
+ {
4138
+ variants: {
4139
+ position: {
4140
+ top: "top-full left-5 -translate-x-1/2 border-t-white border-t-[6px] border-x-[6px] border-x-transparent border-b-0",
4141
+ right: "right-full top-1/2 -translate-y-1/2 border-r-white border-r-[6px] border-y-[6px] border-y-transparent border-l-0",
4142
+ bottom: "bottom-full left-4 -translate-x-1/2 border-b-white border-b-[6px] border-x-[6px] border-x-transparent border-t-0",
4143
+ left: "left-full top-1/2 -translate-y-1/2 border-l-white border-l-[6px] border-y-[6px] border-y-transparent border-r-0"
4144
+ }
4145
+ }
4146
+ }
4147
+ );
4148
+ var Tooltip = ({
4149
+ position,
4150
+ content,
4151
+ children,
4152
+ className,
4153
+ ...props
4154
+ }) => {
4155
+ return /* @__PURE__ */ React44.createElement("div", { ...props, className: "relative cursor-pointer text-sm group w-fit" }, /* @__PURE__ */ React44.createElement("div", null, children), /* @__PURE__ */ React44.createElement("div", { className: cn(tooltipVariants({ position }), className) }, content, /* @__PURE__ */ React44.createElement("div", { className: cn(arrowVariants({ position })) })));
4156
+ };
4157
+ var Tooltip_default = Tooltip;
4158
+
4159
+ // app/components/TreeView.tsx
4160
+ import React45, { useState as useState11 } from "react";
4161
+ import { RiArrowDownSFill, RiArrowRightSFill } from "@remixicon/react";
4162
+ var TreeView = ({
4163
+ children,
4164
+ "aria-label": ariaLabel,
4165
+ flat = false,
4166
+ className,
4167
+ defaultExpandedIds = [],
4168
+ expandedIds,
4169
+ onExpandedChange,
4170
+ allowMultiple = true,
4171
+ expandTopLevelByDefault = false
4172
+ }) => {
4173
+ const topLevelIds = React45.Children.toArray(children).map(
4174
+ (child) => React45.isValidElement(child) ? child.props.id : null
4175
+ ).filter(Boolean);
4176
+ const [internalExpanded, setInternalExpanded] = useState11(
4177
+ () => new Set(
4178
+ defaultExpandedIds.length ? defaultExpandedIds : expandTopLevelByDefault ? topLevelIds : []
4179
+ )
4180
+ );
4181
+ const expandedNodes = expandedIds ? new Set(expandedIds) : internalExpanded;
4182
+ const [selectedId, setSelectedId] = useState11(null);
4183
+ const toggleNode = (id) => {
4184
+ const updateSet = (set) => {
4185
+ const next = new Set(set);
4186
+ if (allowMultiple) {
4187
+ next.has(id) ? next.delete(id) : next.add(id);
4188
+ } else {
4189
+ next.clear();
4190
+ next.add(id);
4191
+ }
4192
+ return next;
4193
+ };
4194
+ if (expandedIds && onExpandedChange) {
4195
+ const newExpanded = updateSet(expandedNodes);
4196
+ onExpandedChange(Array.from(newExpanded));
4197
+ } else {
4198
+ setInternalExpanded((prev) => updateSet(prev));
4199
+ }
4200
+ };
4201
+ const handleSelect = (id) => setSelectedId(id);
4202
+ const enhanceChildren = (nodes, level = 0) => React45.Children.map(nodes, (child) => {
4203
+ if (React45.isValidElement(child)) {
4204
+ return React45.cloneElement(child, {
4205
+ level,
4206
+ expanded: expandedNodes.has(child.props.id),
4207
+ onToggle: toggleNode,
4208
+ onSelect: handleSelect,
4209
+ selected: selectedId === child.props.id,
4210
+ flat,
4211
+ children: enhanceChildren(child.props.children, level + 1)
4212
+ });
4213
+ }
4214
+ return child;
4215
+ });
4216
+ return /* @__PURE__ */ React45.createElement(
4217
+ "ul",
4218
+ {
4219
+ role: "tree",
4220
+ "aria-label": ariaLabel,
4221
+ className: cn("list-none p-0 m-0 text-sm", className)
4222
+ },
4223
+ enhanceChildren(children)
4224
+ );
4225
+ };
4226
+ var DefaultExpandIcon = ({ expanded }) => /* @__PURE__ */ React45.createElement("span", { className: "transition-transform duration-200" }, expanded ? /* @__PURE__ */ React45.createElement(RiArrowDownSFill, { size: 18 }) : /* @__PURE__ */ React45.createElement(RiArrowRightSFill, { size: 18 }));
4227
+ var TreeViewItem = ({
4228
+ id,
4229
+ children,
4230
+ current = false,
4231
+ className,
4232
+ onSelect,
4233
+ expanded = false,
4234
+ onToggle,
4235
+ selected = false,
4236
+ level = 0,
4237
+ flat = false
4238
+ }) => {
4239
+ const leading = [];
4240
+ const trailing = [];
4241
+ const content = [];
4242
+ let subTree = null;
4243
+ React45.Children.forEach(children, (child) => {
4244
+ if (React45.isValidElement(child)) {
4245
+ if (child.type === TreeViewLeadingVisual)
4246
+ leading.push(child);
4247
+ else if (child.type === TreeViewTrailingVisual)
4248
+ trailing.push(child);
4249
+ else if (child.type === TreeViewSubTree)
4250
+ subTree = child;
4251
+ else
4252
+ content.push(child);
4253
+ } else
4254
+ content.push(child);
4255
+ });
4256
+ const hasSubTree = !!subTree;
4257
+ const handleClick = (e) => {
4258
+ e.stopPropagation();
4259
+ if (hasSubTree && !flat && onToggle)
4260
+ onToggle(id);
4261
+ if (onSelect)
4262
+ onSelect(id);
4263
+ };
4264
+ const handleKeyDown = (e) => {
4265
+ switch (e.key) {
4266
+ case "Enter":
4267
+ case " ":
4268
+ e.preventDefault();
4269
+ handleClick(e);
4270
+ break;
4271
+ case "ArrowRight":
4272
+ if (hasSubTree && !expanded && !flat && onToggle) {
4273
+ e.preventDefault();
4274
+ onToggle(id);
4275
+ }
4276
+ break;
4277
+ case "ArrowLeft":
4278
+ if (hasSubTree && expanded && !flat && onToggle) {
4279
+ e.preventDefault();
4280
+ onToggle(id);
4281
+ }
4282
+ break;
4283
+ }
4284
+ };
4285
+ const processedSubTree = subTree && React45.isValidElement(subTree) ? React45.cloneElement(subTree, { expanded, flat }) : null;
4286
+ return /* @__PURE__ */ React45.createElement(React45.Fragment, null, /* @__PURE__ */ React45.createElement(
4287
+ "li",
4288
+ {
4289
+ role: "treeitem",
4290
+ "aria-expanded": hasSubTree && !flat ? expanded : void 0,
4291
+ "aria-selected": selected,
4292
+ "aria-current": current ? "true" : void 0,
4293
+ className: cn(
4294
+ "flex items-center gap-2 px-2 py-1 cursor-pointer select-none rounded transition-colors duration-150",
4295
+ selected && "bg-blue-50 text-blue-600 font-medium",
4296
+ "hover:bg-gray-100",
4297
+ className
4298
+ ),
4299
+ style: { paddingLeft: `${level * 16 + 8}px` },
4300
+ onClick: handleClick,
4301
+ onKeyDown: handleKeyDown,
4302
+ tabIndex: 0
4303
+ },
4304
+ /* @__PURE__ */ React45.createElement("span", { className: "flex items-center gap-1" }, !leading.length && hasSubTree && !flat && /* @__PURE__ */ React45.createElement(DefaultExpandIcon, { expanded }), leading),
4305
+ /* @__PURE__ */ React45.createElement("span", { className: "flex-1" }, content),
4306
+ trailing
4307
+ ), processedSubTree);
4308
+ };
4309
+ var TreeViewSubTree = ({
4310
+ children,
4311
+ state,
4312
+ count,
4313
+ className,
4314
+ expanded = false,
4315
+ flat = false
4316
+ }) => {
4317
+ if (flat)
4318
+ return null;
4319
+ if (state === "loading") {
4320
+ return /* @__PURE__ */ React45.createElement("ul", { role: "group", className: cn("list-none m-0", className) }, /* @__PURE__ */ React45.createElement("li", { className: "text-gray-500 italic p-1 pl-6" }, "Loading", count ? ` ${count} items...` : "..."));
4321
+ }
4322
+ return /* @__PURE__ */ React45.createElement(
4323
+ "ul",
4324
+ {
4325
+ role: "group",
4326
+ className: cn(
4327
+ "list-none m-0 pl-0 overflow-hidden transition-all duration-300 ease-in-out",
4328
+ expanded ? "max-h-96 opacity-100" : "max-h-0 opacity-0",
4329
+ className
4330
+ )
4331
+ },
4332
+ children
4333
+ );
4334
+ };
4335
+ var TreeViewLeadingVisual = ({ children, className }) => /* @__PURE__ */ React45.createElement("span", { className: cn("flex items-center flex-shrink-0", className) }, children);
4336
+ var TreeViewTrailingVisual = ({ children, label, className }) => /* @__PURE__ */ React45.createElement(
4337
+ "span",
4338
+ {
4339
+ className: cn("flex items-center ml-auto flex-shrink-0", className),
4340
+ "aria-label": label
4341
+ },
4342
+ children
4343
+ );
4344
+ TreeView.Item = TreeViewItem;
4345
+ TreeView.SubTree = TreeViewSubTree;
4346
+ TreeView.LeadingVisual = TreeViewLeadingVisual;
4347
+ TreeView.TrailingVisual = TreeViewTrailingVisual;
4348
+ var TreeView_default = TreeView;
4349
+
4350
+ // app/components/Typography.tsx
4351
+ import { cva as cva10 } from "class-variance-authority";
4352
+ import React46 from "react";
4353
+ var typographyVariant = cva10("text-dark", {
4354
+ variants: {
4355
+ variant: {
4356
+ h1: "text-8xl font-bold",
4357
+ h2: "text-7xl font-bold",
4358
+ h3: "text-5xl font-bold",
4359
+ h4: "text-[32px] font-bold",
4360
+ h5: "text-2xl font-bold",
4361
+ h6: "text-xl font-semibold",
4362
+ b1: "text-xl font-normal",
4363
+ b2: "text-lg font-normal",
4364
+ b3: "text-base font-normal",
4365
+ b4: "text-sm font-normal",
4366
+ b5: "text-xs font-normal"
4367
+ },
4368
+ intent: {
4369
+ primary: "text-primary-600",
4370
+ success: "text-success-600",
4371
+ error: "text-error-600",
4372
+ warning: "text-warning-600",
4373
+ default: "text-black"
4374
+ }
4375
+ },
4376
+ defaultVariants: {
4377
+ variant: "h1",
4378
+ intent: "default"
4379
+ }
4380
+ });
4381
+ var Typography = ({
4382
+ as,
4383
+ variant = "h1",
4384
+ intent = "default",
4385
+ children,
4386
+ className,
4387
+ ...props
4388
+ }) => {
4389
+ const Component = as || ((variant == null ? void 0 : variant.startsWith("b")) ? "p" : variant);
4390
+ return /* @__PURE__ */ React46.createElement(
4391
+ Component,
4392
+ {
4393
+ className: cn(typographyVariant({ variant, intent, className })),
4394
+ ...props
4395
+ },
4396
+ children
4397
+ );
4398
+ };
4399
+ var Typography_default = Typography;
2416
4400
  export {
2417
4401
  Accordion,
2418
4402
  AccordionContent,
@@ -2422,30 +4406,52 @@ export {
2422
4406
  AvatarGroup_default as AvatarGroup,
2423
4407
  Breadcrumb_default as BreadCrumb,
2424
4408
  Button_default as Button,
4409
+ Callout_default as Callout,
4410
+ Card_default as Card,
4411
+ CardAction,
4412
+ CardContent,
4413
+ CardDescription,
4414
+ CardFooter,
4415
+ CardHeader,
4416
+ CardTitle,
2425
4417
  Checkbox_default as Checkbox,
2426
4418
  Chip_default as Chip,
2427
4419
  CircularProgress_default as CircularProgress,
2428
4420
  Divider_default as Divider,
4421
+ Drawer_default as Drawer,
2429
4422
  Dropdown_default as Dropdown,
4423
+ DropdownMenu,
4424
+ DropdownMenuContent,
4425
+ DropdownMenuItem,
4426
+ DropdownMenuLabel,
4427
+ DropdownMenuSeparator,
4428
+ DropdownMenuSub,
4429
+ DropdownMenuSubContent,
4430
+ DropdownMenuSubTrigger,
4431
+ DropdownMenuTrigger,
2430
4432
  DropdownWithIcon_default as DropdownWithIcon,
4433
+ FileSelector_default as FileSelector,
2431
4434
  FileUpload_default as FileUpload,
4435
+ FileUploadPreview_default as FileUploadPreview,
2432
4436
  GlobalNavigation_default as GlobalNavigation,
2433
4437
  HelperText_default as HelperText,
2434
4438
  Input_default as Input,
2435
4439
  Label_default as Label,
2436
4440
  ListItem_default as ListItem,
4441
+ ListPagination_default as ListPagination,
2437
4442
  Loading_default as Loading,
2438
- MenuDropdown,
2439
- MenuItem3 as MenuItem,
2440
- MenuSubItem,
2441
4443
  Modal,
2442
4444
  Notice_default as Notice,
4445
+ OTPInput_default as OTPInput,
2443
4446
  Pagination_default as Pagination,
2444
4447
  Progress_default as ProgressBar,
2445
4448
  Radio_default as Radio,
4449
+ ImageUploadControlled as RazorPayFileUpload,
2446
4450
  Sidebar_default as Sidebar,
2447
4451
  Skeleton_default as Skeleton,
2448
4452
  Slider_default as Slider,
4453
+ Spinner_default as Spinner,
4454
+ SplitButton_default as SplitButton,
2449
4455
  Stepper_default as Stepper,
2450
4456
  Tab,
2451
4457
  TabList,
@@ -2457,8 +4463,12 @@ export {
2457
4463
  TableHeadCell,
2458
4464
  TableRow,
2459
4465
  Tabs_default as TabsContainer,
4466
+ TextInputWithLabel_default as TextInputWithLabel,
2460
4467
  Textarea_default as Textarea,
2461
4468
  Toggle_default as Toggle,
2462
- Tooltip_default as Tooltip
4469
+ Tooltip_default as Tooltip,
4470
+ TreeView_default as TreeView,
4471
+ Typography_default as Typography,
4472
+ defaultGetFileIcon
2463
4473
  };
2464
4474
  //# sourceMappingURL=index.js.map