@algorithm-shift/design-system 1.2.42 → 1.2.44

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.
@@ -0,0 +1,3130 @@
1
+ // src/components/Layout/Modal.tsx
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ var Modal = ({
4
+ children,
5
+ onClose,
6
+ label,
7
+ className,
8
+ style
9
+ }) => {
10
+ return /* @__PURE__ */ jsx("div", { className, style, children: /* @__PURE__ */ jsxs("div", { className: "min-h-80", children: [
11
+ /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center p-4 border-b border-gray-300 bg-gray-100", children: [
12
+ /* @__PURE__ */ jsx("h4", { className: "text-[#000]", children: label || "Modal Title" }),
13
+ /* @__PURE__ */ jsx(
14
+ "span",
15
+ {
16
+ className: "cursor-pointer text-[#000]",
17
+ role: "presentation",
18
+ onClick: onClose,
19
+ children: "X"
20
+ }
21
+ )
22
+ ] }),
23
+ /* @__PURE__ */ jsx("div", { className: "h-90 overflow-y-auto p-4 custom-scroll", children })
24
+ ] }) });
25
+ };
26
+ var Modal_default = Modal;
27
+
28
+ // src/components/Layout/Flex.tsx
29
+ import { jsx as jsx2 } from "react/jsx-runtime";
30
+ var Flex = ({
31
+ children,
32
+ className,
33
+ style,
34
+ ...props
35
+ }) => {
36
+ return /* @__PURE__ */ jsx2("div", { ...props, className, style, children });
37
+ };
38
+ var Flex_default = Flex;
39
+
40
+ // src/components/Layout/Grid.tsx
41
+ import { jsx as jsx3 } from "react/jsx-runtime";
42
+ var Grid = ({
43
+ children,
44
+ className,
45
+ style,
46
+ ...props
47
+ }) => {
48
+ return /* @__PURE__ */ jsx3("div", { ...props, className, style, children });
49
+ };
50
+ var Grid_default = Grid;
51
+
52
+ // src/components/Layout/Container.tsx
53
+ import { jsx as jsx4 } from "react/jsx-runtime";
54
+ var Container = ({
55
+ children,
56
+ className,
57
+ style,
58
+ ...props
59
+ }) => {
60
+ return /* @__PURE__ */ jsx4("div", { ...props, className, style, children });
61
+ };
62
+ var Container_default = Container;
63
+
64
+ // src/lib/utils.ts
65
+ import { clsx } from "clsx";
66
+ import { twMerge } from "tailwind-merge";
67
+ function cn(...inputs) {
68
+ return twMerge(clsx(inputs));
69
+ }
70
+ function getInitials(name) {
71
+ const words = name.split(" ");
72
+ if (words.length === 0) {
73
+ return "";
74
+ }
75
+ if (words.length === 1) {
76
+ return words[0].charAt(0);
77
+ }
78
+ return words[0].charAt(0) + words[1].charAt(0);
79
+ }
80
+
81
+ // src/components/ui/button.tsx
82
+ import { Slot } from "@radix-ui/react-slot";
83
+ import { cva } from "class-variance-authority";
84
+ import { jsx as jsx5 } from "react/jsx-runtime";
85
+ var buttonVariants = cva(
86
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
87
+ {
88
+ variants: {
89
+ variant: {
90
+ default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
91
+ destructive: "bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
92
+ outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
93
+ secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
94
+ ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
95
+ link: "text-primary underline-offset-4 hover:underline"
96
+ },
97
+ size: {
98
+ default: "h-9 px-4 py-2 has-[>svg]:px-3",
99
+ sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
100
+ lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
101
+ icon: "size-9"
102
+ }
103
+ },
104
+ defaultVariants: {
105
+ variant: "default",
106
+ size: "default"
107
+ }
108
+ }
109
+ );
110
+ function Button({
111
+ className,
112
+ variant,
113
+ size,
114
+ asChild = false,
115
+ ...props
116
+ }) {
117
+ const Comp = asChild ? Slot : "button";
118
+ return /* @__PURE__ */ jsx5(
119
+ Comp,
120
+ {
121
+ "data-slot": "button",
122
+ className: cn(buttonVariants({ variant, size, className })),
123
+ ...props
124
+ }
125
+ );
126
+ }
127
+
128
+ // src/components/Basic/Button/Button.tsx
129
+ import { jsx as jsx6 } from "react/jsx-runtime";
130
+ var ButtonWrapper = ({
131
+ className,
132
+ style,
133
+ textContent = "Button",
134
+ ...props
135
+ }) => {
136
+ return /* @__PURE__ */ jsx6(
137
+ Button,
138
+ {
139
+ ...props,
140
+ className,
141
+ style,
142
+ children: textContent
143
+ }
144
+ );
145
+ };
146
+ var Button_default = ButtonWrapper;
147
+
148
+ // src/assets/image-placeholder.png
149
+ var image_placeholder_default = "data:image/png;base64,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";
150
+
151
+ // src/components/Basic/Image/Image.tsx
152
+ import { jsx as jsx7 } from "react/jsx-runtime";
153
+ var ImageControl = ({
154
+ className,
155
+ style,
156
+ imageUrl,
157
+ imageUrlExternal,
158
+ altText = "Preview"
159
+ }) => {
160
+ const imageClass = cn(
161
+ "h-[200px] w-[200px] border-1",
162
+ "border-2 border-dashed border-gray-400 flex items-center justify-center cursor-pointer hover:border-blue-500 transition"
163
+ );
164
+ const defaultImgClass = cn(
165
+ "w-full h-full",
166
+ className
167
+ );
168
+ if (!imageUrl && !imageUrlExternal) {
169
+ return /* @__PURE__ */ jsx7("div", { className: imageClass, children: /* @__PURE__ */ jsx7("img", { src: image_placeholder_default, alt: altText, className: "opacity-50", width: 50, height: 50 }) });
170
+ }
171
+ const url = imageUrlExternal || imageUrl;
172
+ return /* @__PURE__ */ jsx7("img", { src: url, alt: altText, className: defaultImgClass, style });
173
+ };
174
+ var Image_default = ImageControl;
175
+
176
+ // src/components/Basic/Shape/Shape.tsx
177
+ import { jsx as jsx8 } from "react/jsx-runtime";
178
+ var Shape = ({
179
+ children,
180
+ className,
181
+ style
182
+ }) => {
183
+ return /* @__PURE__ */ jsx8("div", { className, style, children });
184
+ };
185
+ var Shape_default = Shape;
186
+
187
+ // src/components/Basic/Typography/Typography.tsx
188
+ import React from "react";
189
+ var Typography = ({
190
+ className,
191
+ style,
192
+ tagName,
193
+ textContent
194
+ }) => {
195
+ const Tag = tagName || "h1";
196
+ return React.createElement(
197
+ Tag,
198
+ {
199
+ style,
200
+ className: cn(className, "pointer-events-auto")
201
+ },
202
+ [
203
+ React.createElement("span", {
204
+ key: "html",
205
+ className: "pointer-events-none",
206
+ dangerouslySetInnerHTML: { __html: textContent }
207
+ })
208
+ ]
209
+ );
210
+ };
211
+ var Typography_default = Typography;
212
+
213
+ // node_modules/lucide-react/dist/esm/createLucideIcon.js
214
+ import { forwardRef as forwardRef2, createElement as createElement2 } from "react";
215
+
216
+ // node_modules/lucide-react/dist/esm/shared/src/utils.js
217
+ var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
218
+ var toCamelCase = (string) => string.replace(
219
+ /^([A-Z])|[\s-_]+(\w)/g,
220
+ (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()
221
+ );
222
+ var toPascalCase = (string) => {
223
+ const camelCase = toCamelCase(string);
224
+ return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
225
+ };
226
+ var mergeClasses = (...classes) => classes.filter((className, index, array) => {
227
+ return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
228
+ }).join(" ").trim();
229
+ var hasA11yProp = (props) => {
230
+ for (const prop in props) {
231
+ if (prop.startsWith("aria-") || prop === "role" || prop === "title") {
232
+ return true;
233
+ }
234
+ }
235
+ };
236
+
237
+ // node_modules/lucide-react/dist/esm/Icon.js
238
+ import { forwardRef, createElement } from "react";
239
+
240
+ // node_modules/lucide-react/dist/esm/defaultAttributes.js
241
+ var defaultAttributes = {
242
+ xmlns: "http://www.w3.org/2000/svg",
243
+ width: 24,
244
+ height: 24,
245
+ viewBox: "0 0 24 24",
246
+ fill: "none",
247
+ stroke: "currentColor",
248
+ strokeWidth: 2,
249
+ strokeLinecap: "round",
250
+ strokeLinejoin: "round"
251
+ };
252
+
253
+ // node_modules/lucide-react/dist/esm/Icon.js
254
+ var Icon = forwardRef(
255
+ ({
256
+ color = "currentColor",
257
+ size = 24,
258
+ strokeWidth = 2,
259
+ absoluteStrokeWidth,
260
+ className = "",
261
+ children,
262
+ iconNode,
263
+ ...rest
264
+ }, ref) => createElement(
265
+ "svg",
266
+ {
267
+ ref,
268
+ ...defaultAttributes,
269
+ width: size,
270
+ height: size,
271
+ stroke: color,
272
+ strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
273
+ className: mergeClasses("lucide", className),
274
+ ...!children && !hasA11yProp(rest) && { "aria-hidden": "true" },
275
+ ...rest
276
+ },
277
+ [
278
+ ...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),
279
+ ...Array.isArray(children) ? children : [children]
280
+ ]
281
+ )
282
+ );
283
+
284
+ // node_modules/lucide-react/dist/esm/createLucideIcon.js
285
+ var createLucideIcon = (iconName, iconNode) => {
286
+ const Component = forwardRef2(
287
+ ({ className, ...props }, ref) => createElement2(Icon, {
288
+ ref,
289
+ iconNode,
290
+ className: mergeClasses(
291
+ `lucide-${toKebabCase(toPascalCase(iconName))}`,
292
+ `lucide-${iconName}`,
293
+ className
294
+ ),
295
+ ...props
296
+ })
297
+ );
298
+ Component.displayName = toPascalCase(iconName);
299
+ return Component;
300
+ };
301
+
302
+ // node_modules/lucide-react/dist/esm/icons/bell.js
303
+ var __iconNode = [
304
+ ["path", { d: "M10.268 21a2 2 0 0 0 3.464 0", key: "vwvbt9" }],
305
+ [
306
+ "path",
307
+ {
308
+ d: "M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",
309
+ key: "11g9vi"
310
+ }
311
+ ]
312
+ ];
313
+ var Bell = createLucideIcon("bell", __iconNode);
314
+
315
+ // node_modules/lucide-react/dist/esm/icons/calculator.js
316
+ var __iconNode2 = [
317
+ ["rect", { width: "16", height: "20", x: "4", y: "2", rx: "2", key: "1nb95v" }],
318
+ ["line", { x1: "8", x2: "16", y1: "6", y2: "6", key: "x4nwl0" }],
319
+ ["line", { x1: "16", x2: "16", y1: "14", y2: "18", key: "wjye3r" }],
320
+ ["path", { d: "M16 10h.01", key: "1m94wz" }],
321
+ ["path", { d: "M12 10h.01", key: "1nrarc" }],
322
+ ["path", { d: "M8 10h.01", key: "19clt8" }],
323
+ ["path", { d: "M12 14h.01", key: "1etili" }],
324
+ ["path", { d: "M8 14h.01", key: "6423bh" }],
325
+ ["path", { d: "M12 18h.01", key: "mhygvu" }],
326
+ ["path", { d: "M8 18h.01", key: "lrp35t" }]
327
+ ];
328
+ var Calculator = createLucideIcon("calculator", __iconNode2);
329
+
330
+ // node_modules/lucide-react/dist/esm/icons/calendar.js
331
+ var __iconNode3 = [
332
+ ["path", { d: "M8 2v4", key: "1cmpym" }],
333
+ ["path", { d: "M16 2v4", key: "4m81vk" }],
334
+ ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
335
+ ["path", { d: "M3 10h18", key: "8toen8" }]
336
+ ];
337
+ var Calendar = createLucideIcon("calendar", __iconNode3);
338
+
339
+ // node_modules/lucide-react/dist/esm/icons/check.js
340
+ var __iconNode4 = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
341
+ var Check = createLucideIcon("check", __iconNode4);
342
+
343
+ // node_modules/lucide-react/dist/esm/icons/chevron-down.js
344
+ var __iconNode5 = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
345
+ var ChevronDown = createLucideIcon("chevron-down", __iconNode5);
346
+
347
+ // node_modules/lucide-react/dist/esm/icons/chevron-left.js
348
+ var __iconNode6 = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]];
349
+ var ChevronLeft = createLucideIcon("chevron-left", __iconNode6);
350
+
351
+ // node_modules/lucide-react/dist/esm/icons/chevron-right.js
352
+ var __iconNode7 = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
353
+ var ChevronRight = createLucideIcon("chevron-right", __iconNode7);
354
+
355
+ // node_modules/lucide-react/dist/esm/icons/chevron-up.js
356
+ var __iconNode8 = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
357
+ var ChevronUp = createLucideIcon("chevron-up", __iconNode8);
358
+
359
+ // node_modules/lucide-react/dist/esm/icons/circle.js
360
+ var __iconNode9 = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]];
361
+ var Circle = createLucideIcon("circle", __iconNode9);
362
+
363
+ // node_modules/lucide-react/dist/esm/icons/ellipsis.js
364
+ var __iconNode10 = [
365
+ ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
366
+ ["circle", { cx: "19", cy: "12", r: "1", key: "1wjl8i" }],
367
+ ["circle", { cx: "5", cy: "12", r: "1", key: "1pcz8c" }]
368
+ ];
369
+ var Ellipsis = createLucideIcon("ellipsis", __iconNode10);
370
+
371
+ // node_modules/lucide-react/dist/esm/icons/mail.js
372
+ var __iconNode11 = [
373
+ ["path", { d: "m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7", key: "132q7q" }],
374
+ ["rect", { x: "2", y: "4", width: "20", height: "16", rx: "2", key: "izxlao" }]
375
+ ];
376
+ var Mail = createLucideIcon("mail", __iconNode11);
377
+
378
+ // node_modules/lucide-react/dist/esm/icons/menu.js
379
+ var __iconNode12 = [
380
+ ["path", { d: "M4 12h16", key: "1lakjw" }],
381
+ ["path", { d: "M4 18h16", key: "19g7jn" }],
382
+ ["path", { d: "M4 6h16", key: "1o0s65" }]
383
+ ];
384
+ var Menu = createLucideIcon("menu", __iconNode12);
385
+
386
+ // node_modules/lucide-react/dist/esm/icons/scan-eye.js
387
+ var __iconNode13 = [
388
+ ["path", { d: "M3 7V5a2 2 0 0 1 2-2h2", key: "aa7l1z" }],
389
+ ["path", { d: "M17 3h2a2 2 0 0 1 2 2v2", key: "4qcy5o" }],
390
+ ["path", { d: "M21 17v2a2 2 0 0 1-2 2h-2", key: "6vwrx8" }],
391
+ ["path", { d: "M7 21H5a2 2 0 0 1-2-2v-2", key: "ioqczr" }],
392
+ ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
393
+ [
394
+ "path",
395
+ {
396
+ d: "M18.944 12.33a1 1 0 0 0 0-.66 7.5 7.5 0 0 0-13.888 0 1 1 0 0 0 0 .66 7.5 7.5 0 0 0 13.888 0",
397
+ key: "11ak4c"
398
+ }
399
+ ]
400
+ ];
401
+ var ScanEye = createLucideIcon("scan-eye", __iconNode13);
402
+
403
+ // node_modules/lucide-react/dist/esm/icons/search.js
404
+ var __iconNode14 = [
405
+ ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
406
+ ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
407
+ ];
408
+ var Search = createLucideIcon("search", __iconNode14);
409
+
410
+ // src/components/Basic/Breadcrumb/Breadcrumb.tsx
411
+ import { jsx as jsx9, jsxs as jsxs2 } from "react/jsx-runtime";
412
+ var Breadcrumb = ({ list = [], className, style, LinkComponent }) => {
413
+ return /* @__PURE__ */ jsx9(
414
+ "nav",
415
+ {
416
+ "aria-label": "breadcrumb",
417
+ className: cn("flex items-center text-sm text-muted-foreground", className),
418
+ style,
419
+ children: list.map((item, index) => {
420
+ const isLast = index === list.length - 1;
421
+ return /* @__PURE__ */ jsxs2("div", { className: "flex items-center", children: [
422
+ item.url && !isLast && LinkComponent ? /* @__PURE__ */ jsx9(
423
+ LinkComponent,
424
+ {
425
+ href: item.url,
426
+ className: "hover:text-foreground transition-colors",
427
+ children: item.header
428
+ }
429
+ ) : /* @__PURE__ */ jsx9("span", { className: "text-foreground font-medium", children: item.header }),
430
+ !isLast && /* @__PURE__ */ jsx9(ChevronRight, { className: "mx-2 h-4 w-4 text-muted-foreground" })
431
+ ] }, item.id);
432
+ })
433
+ }
434
+ );
435
+ };
436
+ var Breadcrumb_default = Breadcrumb;
437
+
438
+ // src/components/ui/dropdown-menu.tsx
439
+ import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
440
+ import { jsx as jsx10, jsxs as jsxs3 } from "react/jsx-runtime";
441
+ function DropdownMenu({
442
+ ...props
443
+ }) {
444
+ return /* @__PURE__ */ jsx10(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
445
+ }
446
+ function DropdownMenuTrigger({
447
+ ...props
448
+ }) {
449
+ return /* @__PURE__ */ jsx10(
450
+ DropdownMenuPrimitive.Trigger,
451
+ {
452
+ "data-slot": "dropdown-menu-trigger",
453
+ ...props
454
+ }
455
+ );
456
+ }
457
+ function DropdownMenuContent({
458
+ className,
459
+ sideOffset = 4,
460
+ ...props
461
+ }) {
462
+ return /* @__PURE__ */ jsx10(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx10(
463
+ DropdownMenuPrimitive.Content,
464
+ {
465
+ "data-slot": "dropdown-menu-content",
466
+ sideOffset,
467
+ className: cn(
468
+ "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
469
+ className
470
+ ),
471
+ ...props
472
+ }
473
+ ) });
474
+ }
475
+ function DropdownMenuItem({
476
+ className,
477
+ inset,
478
+ variant = "default",
479
+ ...props
480
+ }) {
481
+ return /* @__PURE__ */ jsx10(
482
+ DropdownMenuPrimitive.Item,
483
+ {
484
+ "data-slot": "dropdown-menu-item",
485
+ "data-inset": inset,
486
+ "data-variant": variant,
487
+ className: cn(
488
+ "focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
489
+ className
490
+ ),
491
+ ...props
492
+ }
493
+ );
494
+ }
495
+ function DropdownMenuLabel({
496
+ className,
497
+ inset,
498
+ ...props
499
+ }) {
500
+ return /* @__PURE__ */ jsx10(
501
+ DropdownMenuPrimitive.Label,
502
+ {
503
+ "data-slot": "dropdown-menu-label",
504
+ "data-inset": inset,
505
+ className: cn(
506
+ "px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
507
+ className
508
+ ),
509
+ ...props
510
+ }
511
+ );
512
+ }
513
+ function DropdownMenuSeparator({
514
+ className,
515
+ ...props
516
+ }) {
517
+ return /* @__PURE__ */ jsx10(
518
+ DropdownMenuPrimitive.Separator,
519
+ {
520
+ "data-slot": "dropdown-menu-separator",
521
+ className: cn("bg-border -mx-1 my-1 h-px", className),
522
+ ...props
523
+ }
524
+ );
525
+ }
526
+ function DropdownMenuSub({
527
+ ...props
528
+ }) {
529
+ return /* @__PURE__ */ jsx10(DropdownMenuPrimitive.Sub, { "data-slot": "dropdown-menu-sub", ...props });
530
+ }
531
+ function DropdownMenuSubTrigger({
532
+ className,
533
+ inset,
534
+ children,
535
+ ...props
536
+ }) {
537
+ return /* @__PURE__ */ jsxs3(
538
+ DropdownMenuPrimitive.SubTrigger,
539
+ {
540
+ "data-slot": "dropdown-menu-sub-trigger",
541
+ "data-inset": inset,
542
+ className: cn(
543
+ "focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",
544
+ className
545
+ ),
546
+ ...props,
547
+ children: [
548
+ children,
549
+ /* @__PURE__ */ jsx10(ChevronRight, { className: "ml-auto size-4" })
550
+ ]
551
+ }
552
+ );
553
+ }
554
+ function DropdownMenuSubContent({
555
+ className,
556
+ ...props
557
+ }) {
558
+ return /* @__PURE__ */ jsx10(
559
+ DropdownMenuPrimitive.SubContent,
560
+ {
561
+ "data-slot": "dropdown-menu-sub-content",
562
+ className: cn(
563
+ "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
564
+ className
565
+ ),
566
+ ...props
567
+ }
568
+ );
569
+ }
570
+
571
+ // src/components/Basic/ButtonGroup/ButtonGroup.tsx
572
+ import { jsx as jsx11, jsxs as jsxs4 } from "react/jsx-runtime";
573
+ function SplitButton({ style, textContent, className, list = [], LinkComponent }) {
574
+ const bgColor = style?.backgroundColor || "";
575
+ return /* @__PURE__ */ jsxs4("div", { className: "inline-flex rounded-md overflow-hidden border border-teal-200 bg-teal-700 items-center focus:ring-0", style: { backgroundColor: bgColor }, children: [
576
+ /* @__PURE__ */ jsx11(
577
+ Button,
578
+ {
579
+ className: `rounded-none border-r px-4 py-2 text-whit focus:ring-0 ${className || ""}`,
580
+ style: { backgroundColor: bgColor },
581
+ children: textContent || "Button"
582
+ }
583
+ ),
584
+ /* @__PURE__ */ jsxs4(DropdownMenu, { children: [
585
+ /* @__PURE__ */ jsx11(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx11(
586
+ Button,
587
+ {
588
+ className: "rounded-none bg-teal-700 px-4 py-2 text-white ring-0 shadow-none hover:bg-teal-600 focus:ring-0",
589
+ "aria-label": "Open Dropdown",
590
+ style: { backgroundColor: bgColor },
591
+ children: /* @__PURE__ */ jsx11(ChevronDown, { className: "w-4 h-4" })
592
+ }
593
+ ) }),
594
+ /* @__PURE__ */ jsx11(DropdownMenuContent, { align: "end", className: "bg-white min-w-[120px]", children: list.map((item) => /* @__PURE__ */ jsx11(DropdownMenuItem, { className: "text-black", children: LinkComponent ? /* @__PURE__ */ jsx11(LinkComponent, { href: item.url || "#", children: item.header }) : item.header }, item.id)) })
595
+ ] })
596
+ ] });
597
+ }
598
+
599
+ // src/components/ui/input.tsx
600
+ import { jsx as jsx12 } from "react/jsx-runtime";
601
+ function Input({ className, type, ...props }) {
602
+ return /* @__PURE__ */ jsx12(
603
+ "input",
604
+ {
605
+ type,
606
+ "data-slot": "input",
607
+ className: cn(
608
+ "file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
609
+ "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
610
+ "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
611
+ className
612
+ ),
613
+ ...props
614
+ }
615
+ );
616
+ }
617
+
618
+ // src/components/Inputs/TextInput/TextInput.tsx
619
+ import { Fragment, jsx as jsx13, jsxs as jsxs5 } from "react/jsx-runtime";
620
+ var TextInput = ({ className, style, ...props }) => {
621
+ const placeholder = props.placeholder || "Placeholder text";
622
+ const isEditable = props.isEditable ?? true;
623
+ const isDisabled = props.isDisabled ?? false;
624
+ const isReadonly = props.isReadonly ?? false;
625
+ const isAutocomplete = props.isAutocomplete ?? false;
626
+ const handleChange = (e) => {
627
+ props.onChange?.(e);
628
+ };
629
+ return /* @__PURE__ */ jsxs5(Fragment, { children: [
630
+ /* @__PURE__ */ jsx13(
631
+ Input,
632
+ {
633
+ type: "text",
634
+ name: props.name,
635
+ className: cn(className, props.errorMessage ? "border-red-500" : ""),
636
+ style: {
637
+ ...style,
638
+ borderColor: props.errorMessage ? "#f87171" : style?.borderColor
639
+ },
640
+ value: props.value,
641
+ autoComplete: isAutocomplete ? "on" : "off",
642
+ placeholder,
643
+ onChange: handleChange,
644
+ disabled: isDisabled || !isEditable,
645
+ readOnly: isReadonly
646
+ }
647
+ ),
648
+ props.errorMessage && /* @__PURE__ */ jsx13("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
649
+ ] });
650
+ };
651
+ var TextInput_default = TextInput;
652
+
653
+ // src/components/Inputs/NumberInput/NumberInput.tsx
654
+ import { Fragment as Fragment2, jsx as jsx14, jsxs as jsxs6 } from "react/jsx-runtime";
655
+ var NumberInput = ({ className, style, ...props }) => {
656
+ const placeholder = props.placeholder ?? "Placeholder text";
657
+ const isEditable = props.isEditable ?? true;
658
+ const isDisabled = props.isDisabled ?? false;
659
+ const isReadonly = props.isReadonly ?? false;
660
+ const isAutocomplete = props.isAutocomplete ?? false;
661
+ const handleChange = (e) => {
662
+ props.onChange?.(e);
663
+ };
664
+ return /* @__PURE__ */ jsxs6(Fragment2, { children: [
665
+ /* @__PURE__ */ jsxs6("div", { className: "flex justify-start items-center relative", children: [
666
+ /* @__PURE__ */ jsx14(Calculator, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[#BDBDBD]" }),
667
+ /* @__PURE__ */ jsx14(
668
+ Input,
669
+ {
670
+ type: "number",
671
+ id: props.name || "number-field",
672
+ name: props.name,
673
+ value: props.value,
674
+ className: cn(className, props.errorMessage ? "border-red-500" : ""),
675
+ style: {
676
+ ...style,
677
+ borderColor: props.errorMessage ? "#f87171" : style?.borderColor
678
+ },
679
+ autoComplete: isAutocomplete ? "on" : "off",
680
+ placeholder,
681
+ onChange: handleChange,
682
+ disabled: isDisabled || !isEditable,
683
+ readOnly: isReadonly
684
+ }
685
+ )
686
+ ] }),
687
+ props.errorMessage && /* @__PURE__ */ jsx14("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
688
+ ] });
689
+ };
690
+ var NumberInput_default = NumberInput;
691
+
692
+ // src/components/Inputs/EmailInput/EmailInput.tsx
693
+ import { Fragment as Fragment3, jsx as jsx15, jsxs as jsxs7 } from "react/jsx-runtime";
694
+ var EmailInput = ({ className, style, ...props }) => {
695
+ const placeholder = props.placeholder ?? "Placeholder text";
696
+ const isEditable = props.isEditable ?? true;
697
+ const isDisabled = props.isDisabled ?? false;
698
+ const isReadonly = props.isReadonly ?? false;
699
+ const isAutocomplete = props.isAutocomplete ?? false;
700
+ const handleChange = (e) => {
701
+ props.onChange?.(e);
702
+ };
703
+ return /* @__PURE__ */ jsxs7(Fragment3, { children: [
704
+ /* @__PURE__ */ jsxs7("div", { className: "flex justify-start items-center relative", children: [
705
+ /* @__PURE__ */ jsx15(Mail, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[#BDBDBD]" }),
706
+ /* @__PURE__ */ jsx15(
707
+ Input,
708
+ {
709
+ type: "email",
710
+ name: props.name,
711
+ value: props.value,
712
+ className: cn(className, props.errorMessage ? "border-red-500" : ""),
713
+ style: {
714
+ ...style,
715
+ borderColor: props.errorMessage ? "#f87171" : style?.borderColor
716
+ },
717
+ autoComplete: isAutocomplete ? "on" : "off",
718
+ placeholder,
719
+ onChange: handleChange,
720
+ disabled: isDisabled || !isEditable,
721
+ readOnly: isReadonly
722
+ }
723
+ )
724
+ ] }),
725
+ props.errorMessage && /* @__PURE__ */ jsx15("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
726
+ ] });
727
+ };
728
+ var EmailInput_default = EmailInput;
729
+
730
+ // src/components/Inputs/PasswordInput/PasswordInput.tsx
731
+ import { Fragment as Fragment4, jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
732
+ var PasswordInput = ({ className, style, ...props }) => {
733
+ const placeholder = props.placeholder ?? "Placeholder text";
734
+ const isEditable = props.isEditable ?? true;
735
+ const isDisabled = props.isDisabled ?? false;
736
+ const isReadonly = props.isReadonly ?? false;
737
+ const isAutocomplete = props.isAutocomplete ?? false;
738
+ const handleChange = (e) => {
739
+ props.onChange?.(e);
740
+ };
741
+ return /* @__PURE__ */ jsxs8(Fragment4, { children: [
742
+ /* @__PURE__ */ jsxs8("div", { className: "flex justify-start items-center relative", children: [
743
+ /* @__PURE__ */ jsx16(ScanEye, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[#BDBDBD]" }),
744
+ /* @__PURE__ */ jsx16(
745
+ Input,
746
+ {
747
+ type: "password",
748
+ id: props.name || "password-field",
749
+ name: props.name,
750
+ value: props.value,
751
+ className: cn(className, props.errorMessage ? "border-red-500" : ""),
752
+ style: {
753
+ ...style,
754
+ borderColor: props.errorMessage ? "#f87171" : style?.borderColor
755
+ },
756
+ autoComplete: isAutocomplete ? "on" : "off",
757
+ placeholder,
758
+ onChange: handleChange,
759
+ disabled: isDisabled || !isEditable,
760
+ readOnly: isReadonly
761
+ }
762
+ )
763
+ ] }),
764
+ props.errorMessage && /* @__PURE__ */ jsx16("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
765
+ ] });
766
+ };
767
+ var PasswordInput_default = PasswordInput;
768
+
769
+ // src/components/ui/textarea.tsx
770
+ import { jsx as jsx17 } from "react/jsx-runtime";
771
+ function Textarea({ className, ...props }) {
772
+ return /* @__PURE__ */ jsx17(
773
+ "textarea",
774
+ {
775
+ "data-slot": "textarea",
776
+ className: cn(
777
+ "border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
778
+ className
779
+ ),
780
+ ...props
781
+ }
782
+ );
783
+ }
784
+
785
+ // src/components/Inputs/Textarea/Textarea.tsx
786
+ import { Fragment as Fragment5, jsx as jsx18, jsxs as jsxs9 } from "react/jsx-runtime";
787
+ var Textarea2 = ({ className, style, ...props }) => {
788
+ const placeholder = props.placeholder ?? "Placeholder text";
789
+ const isEditable = props.isEditable ?? true;
790
+ const isDisabled = props.isDisabled ?? false;
791
+ const isReadonly = props.isReadonly ?? false;
792
+ const isAutocomplete = props.isAutocomplete ?? false;
793
+ const handleChange = (e) => {
794
+ props.onChange?.(e);
795
+ };
796
+ return /* @__PURE__ */ jsxs9(Fragment5, { children: [
797
+ /* @__PURE__ */ jsx18(
798
+ Textarea,
799
+ {
800
+ id: "textarea-field",
801
+ name: props.name,
802
+ value: props.value,
803
+ className: cn(className, props.errorMessage ? "border-red-500" : ""),
804
+ style: {
805
+ ...style,
806
+ borderColor: props.errorMessage ? "#f87171" : style?.borderColor
807
+ },
808
+ autoComplete: isAutocomplete ? "on" : "off",
809
+ placeholder,
810
+ onChange: handleChange,
811
+ disabled: isDisabled || !isEditable,
812
+ readOnly: isReadonly
813
+ }
814
+ ),
815
+ props.errorMessage && /* @__PURE__ */ jsx18("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
816
+ ] });
817
+ };
818
+ var Textarea_default = Textarea2;
819
+
820
+ // src/components/Inputs/UrlInput/UrlInput.tsx
821
+ import { Fragment as Fragment6, jsx as jsx19, jsxs as jsxs10 } from "react/jsx-runtime";
822
+ var UrlInput = ({ className, style, ...props }) => {
823
+ const placeholder = props.placeholder ?? "Placeholder text";
824
+ const isEditable = props.isEditable ?? true;
825
+ const isDisabled = props.isDisabled ?? false;
826
+ const isReadonly = props.isReadonly ?? false;
827
+ const isAutocomplete = props.isAutocomplete ?? false;
828
+ const handleChange = (e) => {
829
+ props.onChange?.(e);
830
+ };
831
+ return /* @__PURE__ */ jsxs10(Fragment6, { children: [
832
+ /* @__PURE__ */ jsxs10("div", { className: "flex justify-start items-center relative", children: [
833
+ /* @__PURE__ */ jsx19("div", { className: "bg-[#E9E9E9] absolute px-10 text-center top-1/2 h-full justify-center items-center flex w-10 -translate-y-1/2 text-[#383838] font-[500] text-[12px]", children: "https://" }),
834
+ /* @__PURE__ */ jsx19(
835
+ Input,
836
+ {
837
+ id: "url-field",
838
+ type: "url",
839
+ name: props.name,
840
+ value: props.value,
841
+ className: cn(className, props.errorMessage ? "border-red-500" : ""),
842
+ style: {
843
+ ...style,
844
+ borderColor: props.errorMessage ? "#f87171" : style?.borderColor
845
+ },
846
+ autoComplete: isAutocomplete ? "on" : "off",
847
+ placeholder,
848
+ onChange: handleChange,
849
+ disabled: isDisabled || !isEditable,
850
+ readOnly: isReadonly
851
+ }
852
+ )
853
+ ] }),
854
+ props.errorMessage && /* @__PURE__ */ jsx19("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
855
+ ] });
856
+ };
857
+ var UrlInput_default = UrlInput;
858
+
859
+ // src/components/ui/checkbox.tsx
860
+ import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
861
+ import { jsx as jsx20 } from "react/jsx-runtime";
862
+ function Checkbox({
863
+ className,
864
+ ...props
865
+ }) {
866
+ return /* @__PURE__ */ jsx20(
867
+ CheckboxPrimitive.Root,
868
+ {
869
+ "data-slot": "checkbox",
870
+ className: cn(
871
+ "peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
872
+ className
873
+ ),
874
+ ...props,
875
+ children: /* @__PURE__ */ jsx20(
876
+ CheckboxPrimitive.Indicator,
877
+ {
878
+ "data-slot": "checkbox-indicator",
879
+ className: "flex items-center justify-center text-current transition-none",
880
+ children: /* @__PURE__ */ jsx20(Check, { className: "size-3.5" })
881
+ }
882
+ )
883
+ }
884
+ );
885
+ }
886
+
887
+ // src/components/ui/label.tsx
888
+ import * as LabelPrimitive from "@radix-ui/react-label";
889
+ import { jsx as jsx21 } from "react/jsx-runtime";
890
+ function Label2({
891
+ className,
892
+ ...props
893
+ }) {
894
+ return /* @__PURE__ */ jsx21(
895
+ LabelPrimitive.Root,
896
+ {
897
+ "data-slot": "label",
898
+ className: cn(
899
+ "flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
900
+ className
901
+ ),
902
+ ...props
903
+ }
904
+ );
905
+ }
906
+
907
+ // src/components/Inputs/Checkbox/Checkbox.tsx
908
+ import { Fragment as Fragment7, jsx as jsx22, jsxs as jsxs11 } from "react/jsx-runtime";
909
+ var CheckboxInput = ({ className, style, ...props }) => {
910
+ const isEditable = props.isEditable ?? true;
911
+ const isDisabled = props.isDisabled ?? false;
912
+ const text = props.text ? props.text : "Subscribe";
913
+ const handleChange = (value) => {
914
+ props.onChange?.(value);
915
+ };
916
+ return /* @__PURE__ */ jsxs11(Fragment7, { children: [
917
+ /* @__PURE__ */ jsx22("div", { className, style, children: /* @__PURE__ */ jsxs11("div", { className: "flex items-center space-x-2", children: [
918
+ /* @__PURE__ */ jsx22(
919
+ Checkbox,
920
+ {
921
+ id: props.name || "checkbox",
922
+ checked: !!props.value,
923
+ onCheckedChange: handleChange,
924
+ disabled: !isEditable || isDisabled
925
+ }
926
+ ),
927
+ /* @__PURE__ */ jsx22(Label2, { htmlFor: props.name || "checkbox", children: text })
928
+ ] }) }),
929
+ props.errorMessage && /* @__PURE__ */ jsx22("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
930
+ ] });
931
+ };
932
+ var Checkbox_default = CheckboxInput;
933
+
934
+ // src/components/ui/radio-group.tsx
935
+ import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
936
+ import { jsx as jsx23 } from "react/jsx-runtime";
937
+ function RadioGroup2({
938
+ className,
939
+ ...props
940
+ }) {
941
+ return /* @__PURE__ */ jsx23(
942
+ RadioGroupPrimitive.Root,
943
+ {
944
+ "data-slot": "radio-group",
945
+ className: cn("grid gap-3", className),
946
+ ...props
947
+ }
948
+ );
949
+ }
950
+ function RadioGroupItem({
951
+ className,
952
+ ...props
953
+ }) {
954
+ return /* @__PURE__ */ jsx23(
955
+ RadioGroupPrimitive.Item,
956
+ {
957
+ "data-slot": "radio-group-item",
958
+ className: cn(
959
+ "border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
960
+ className
961
+ ),
962
+ ...props,
963
+ children: /* @__PURE__ */ jsx23(
964
+ RadioGroupPrimitive.Indicator,
965
+ {
966
+ "data-slot": "radio-group-indicator",
967
+ className: "relative flex items-center justify-center",
968
+ children: /* @__PURE__ */ jsx23(Circle, { className: "fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2" })
969
+ }
970
+ )
971
+ }
972
+ );
973
+ }
974
+
975
+ // src/components/Inputs/RadioInput/RadioInput.tsx
976
+ import { Fragment as Fragment8, jsx as jsx24, jsxs as jsxs12 } from "react/jsx-runtime";
977
+ var RadioInput = ({
978
+ className,
979
+ style,
980
+ defaultValue,
981
+ onChange,
982
+ data = [],
983
+ dataKey,
984
+ dataLabel,
985
+ ...props
986
+ }) => {
987
+ const options = (data || []).map((item) => ({
988
+ value: item[dataKey || "value"],
989
+ label: item[dataLabel || "label"]
990
+ }));
991
+ const handleChange = (value) => {
992
+ onChange?.(value);
993
+ };
994
+ const resolvedDefaultValue = (typeof defaultValue === "string" ? defaultValue : void 0) ?? options[0]?.value;
995
+ return /* @__PURE__ */ jsxs12(Fragment8, { children: [
996
+ /* @__PURE__ */ jsx24("div", { className, style, children: /* @__PURE__ */ jsxs12(
997
+ RadioGroup2,
998
+ {
999
+ defaultValue: resolvedDefaultValue,
1000
+ onValueChange: handleChange,
1001
+ children: [
1002
+ options.length === 0 && /* @__PURE__ */ jsx24("div", { className: "text-sm text-gray-500", children: "No options available" }),
1003
+ options.map((item) => /* @__PURE__ */ jsxs12("div", { className: "flex items-center space-x-2", children: [
1004
+ /* @__PURE__ */ jsx24(RadioGroupItem, { value: item.value, id: `radio-${item.value}` }),
1005
+ /* @__PURE__ */ jsx24(Label2, { htmlFor: `radio-${item.value}`, children: item.label })
1006
+ ] }, item.value))
1007
+ ]
1008
+ }
1009
+ ) }),
1010
+ props.errorMessage && /* @__PURE__ */ jsx24("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
1011
+ ] });
1012
+ };
1013
+ var RadioInput_default = RadioInput;
1014
+
1015
+ // src/components/Inputs/MultiCheckbox/MultiCheckbox.tsx
1016
+ import { useCallback, useState } from "react";
1017
+ import { jsx as jsx25, jsxs as jsxs13 } from "react/jsx-runtime";
1018
+ var MultiCheckbox = ({
1019
+ className,
1020
+ style,
1021
+ data = [],
1022
+ dataKey = "value",
1023
+ dataLabel = "label",
1024
+ value: propValue = {},
1025
+ onChange,
1026
+ isEditable = true,
1027
+ isDisabled = false
1028
+ }) => {
1029
+ const [value, setValue] = useState(propValue);
1030
+ const options = (data || []).map((item) => ({
1031
+ value: item[dataKey || "value"],
1032
+ label: item[dataLabel || "label"]
1033
+ }));
1034
+ const handleChange = useCallback(
1035
+ (key, checked) => {
1036
+ setValue((prev) => {
1037
+ const newValue = { ...prev, [key]: checked };
1038
+ onChange?.(newValue);
1039
+ return newValue;
1040
+ });
1041
+ },
1042
+ [onChange]
1043
+ );
1044
+ return /* @__PURE__ */ jsxs13(
1045
+ "div",
1046
+ {
1047
+ className: cn("flex flex-col gap-3", className),
1048
+ style,
1049
+ children: [
1050
+ options.length === 0 && /* @__PURE__ */ jsx25("p", { className: "text-sm text-gray-500", children: "No options available." }),
1051
+ options.map((opt) => /* @__PURE__ */ jsxs13("div", { className: "flex items-center space-x-2", children: [
1052
+ /* @__PURE__ */ jsx25(
1053
+ Checkbox,
1054
+ {
1055
+ id: opt.value,
1056
+ checked: !!value[opt.value],
1057
+ onCheckedChange: (checked) => handleChange(opt.value, checked === true),
1058
+ disabled: !isEditable || isDisabled
1059
+ }
1060
+ ),
1061
+ /* @__PURE__ */ jsx25(Label2, { htmlFor: opt.value, children: opt.label })
1062
+ ] }, opt.value))
1063
+ ]
1064
+ }
1065
+ );
1066
+ };
1067
+ var MultiCheckbox_default = MultiCheckbox;
1068
+
1069
+ // src/components/Global/TinyMceEditor.tsx
1070
+ import { useMemo, useRef } from "react";
1071
+ import { Editor } from "@tinymce/tinymce-react";
1072
+ import { jsx as jsx26 } from "react/jsx-runtime";
1073
+ function MyEditor({
1074
+ value,
1075
+ onChange,
1076
+ isDefault
1077
+ }) {
1078
+ const editorRef = useRef(null);
1079
+ function stripOuterP(html) {
1080
+ const trimmedHtml = html.trim();
1081
+ if (!trimmedHtml) return "";
1082
+ const div = document.createElement("div");
1083
+ div.innerHTML = trimmedHtml;
1084
+ const firstChild = div.firstElementChild;
1085
+ if (div.childElementCount === 1 && firstChild?.tagName === "P") {
1086
+ return firstChild.innerHTML;
1087
+ }
1088
+ return trimmedHtml;
1089
+ }
1090
+ const isDefaultToolbar = useMemo(() => {
1091
+ let toolbar = "undo redo | formatselect | bold italic forecolor";
1092
+ if (isDefault) {
1093
+ toolbar = "undo redo | blocks | bold italic forecolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | removeformat | help";
1094
+ }
1095
+ return toolbar;
1096
+ }, [isDefault]);
1097
+ return /* @__PURE__ */ jsx26(
1098
+ Editor,
1099
+ {
1100
+ apiKey: process.env.NEXT_PUBLIC_TINYMCE_API_KEY,
1101
+ tinymceScriptSrc: process.env.NEXT_PUBLIC_TINYMCE_SCRIPT_SRC,
1102
+ onInit: (_evt, editor) => editorRef.current = editor,
1103
+ value,
1104
+ licenseKey: "gpl",
1105
+ init: {
1106
+ height: 300,
1107
+ menubar: false,
1108
+ forced_root_block: false,
1109
+ plugins: [
1110
+ "advlist",
1111
+ "autolink",
1112
+ "lists",
1113
+ "link",
1114
+ "image",
1115
+ "charmap",
1116
+ "preview",
1117
+ "anchor",
1118
+ "searchreplace",
1119
+ "visualblocks",
1120
+ "code",
1121
+ "fullscreen",
1122
+ "insertdatetime",
1123
+ "media",
1124
+ "table",
1125
+ "help",
1126
+ "wordcount"
1127
+ ],
1128
+ toolbar: isDefaultToolbar,
1129
+ content_style: `
1130
+ body {
1131
+ outline: none;
1132
+ }
1133
+ `
1134
+ },
1135
+ onEditorChange: (content) => onChange?.(stripOuterP(content))
1136
+ }
1137
+ );
1138
+ }
1139
+
1140
+ // src/components/Inputs/RichText/RichText.tsx
1141
+ import { jsx as jsx27, jsxs as jsxs14 } from "react/jsx-runtime";
1142
+ function RichText({ className, style, ...props }) {
1143
+ return /* @__PURE__ */ jsxs14(
1144
+ "div",
1145
+ {
1146
+ className: cn(className, props.errorMessage ? "border-red-500" : ""),
1147
+ style: {
1148
+ ...style,
1149
+ borderColor: props.errorMessage ? "#f87171" : style?.borderColor
1150
+ },
1151
+ children: [
1152
+ /* @__PURE__ */ jsx27(MyEditor, { onChange: (content) => props.onChange?.(content), value: props.value, isDefault: true }),
1153
+ props.errorMessage && /* @__PURE__ */ jsx27("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
1154
+ ]
1155
+ }
1156
+ );
1157
+ }
1158
+
1159
+ // src/components/ui/select.tsx
1160
+ import * as SelectPrimitive from "@radix-ui/react-select";
1161
+ import { jsx as jsx28, jsxs as jsxs15 } from "react/jsx-runtime";
1162
+ function Select({
1163
+ ...props
1164
+ }) {
1165
+ return /* @__PURE__ */ jsx28(SelectPrimitive.Root, { "data-slot": "select", ...props });
1166
+ }
1167
+ function SelectValue({
1168
+ ...props
1169
+ }) {
1170
+ return /* @__PURE__ */ jsx28(SelectPrimitive.Value, { "data-slot": "select-value", ...props });
1171
+ }
1172
+ function SelectTrigger({
1173
+ className,
1174
+ size = "default",
1175
+ children,
1176
+ ...props
1177
+ }) {
1178
+ return /* @__PURE__ */ jsxs15(
1179
+ SelectPrimitive.Trigger,
1180
+ {
1181
+ "data-slot": "select-trigger",
1182
+ "data-size": size,
1183
+ className: cn(
1184
+ "border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
1185
+ className
1186
+ ),
1187
+ ...props,
1188
+ children: [
1189
+ children,
1190
+ /* @__PURE__ */ jsx28(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx28(ChevronDown, { className: "size-4 opacity-50" }) })
1191
+ ]
1192
+ }
1193
+ );
1194
+ }
1195
+ function SelectContent({
1196
+ className,
1197
+ children,
1198
+ position = "popper",
1199
+ ...props
1200
+ }) {
1201
+ return /* @__PURE__ */ jsx28(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs15(
1202
+ SelectPrimitive.Content,
1203
+ {
1204
+ "data-slot": "select-content",
1205
+ className: cn(
1206
+ "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",
1207
+ position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
1208
+ className
1209
+ ),
1210
+ position,
1211
+ ...props,
1212
+ children: [
1213
+ /* @__PURE__ */ jsx28(SelectScrollUpButton, {}),
1214
+ /* @__PURE__ */ jsx28(
1215
+ SelectPrimitive.Viewport,
1216
+ {
1217
+ className: cn(
1218
+ "p-1",
1219
+ position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
1220
+ ),
1221
+ children
1222
+ }
1223
+ ),
1224
+ /* @__PURE__ */ jsx28(SelectScrollDownButton, {})
1225
+ ]
1226
+ }
1227
+ ) });
1228
+ }
1229
+ function SelectItem({
1230
+ className,
1231
+ children,
1232
+ ...props
1233
+ }) {
1234
+ return /* @__PURE__ */ jsxs15(
1235
+ SelectPrimitive.Item,
1236
+ {
1237
+ "data-slot": "select-item",
1238
+ className: cn(
1239
+ "focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
1240
+ className
1241
+ ),
1242
+ ...props,
1243
+ children: [
1244
+ /* @__PURE__ */ jsx28("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx28(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx28(Check, { className: "size-4" }) }) }),
1245
+ /* @__PURE__ */ jsx28(SelectPrimitive.ItemText, { children })
1246
+ ]
1247
+ }
1248
+ );
1249
+ }
1250
+ function SelectScrollUpButton({
1251
+ className,
1252
+ ...props
1253
+ }) {
1254
+ return /* @__PURE__ */ jsx28(
1255
+ SelectPrimitive.ScrollUpButton,
1256
+ {
1257
+ "data-slot": "select-scroll-up-button",
1258
+ className: cn(
1259
+ "flex cursor-default items-center justify-center py-1",
1260
+ className
1261
+ ),
1262
+ ...props,
1263
+ children: /* @__PURE__ */ jsx28(ChevronUp, { className: "size-4" })
1264
+ }
1265
+ );
1266
+ }
1267
+ function SelectScrollDownButton({
1268
+ className,
1269
+ ...props
1270
+ }) {
1271
+ return /* @__PURE__ */ jsx28(
1272
+ SelectPrimitive.ScrollDownButton,
1273
+ {
1274
+ "data-slot": "select-scroll-down-button",
1275
+ className: cn(
1276
+ "flex cursor-default items-center justify-center py-1",
1277
+ className
1278
+ ),
1279
+ ...props,
1280
+ children: /* @__PURE__ */ jsx28(ChevronDown, { className: "size-4" })
1281
+ }
1282
+ );
1283
+ }
1284
+
1285
+ // src/components/Inputs/Dropdown/Dropdown.tsx
1286
+ import { Fragment as Fragment9, jsx as jsx29, jsxs as jsxs16 } from "react/jsx-runtime";
1287
+ var Dropdown = ({ className, style, ...props }) => {
1288
+ const list = props.data || [];
1289
+ const placeholder = props.placeholder ? props.placeholder : "Placeholder text";
1290
+ const isEditable = props.isEditable ?? true;
1291
+ const isDisabled = props.isDisabled ?? false;
1292
+ const isReadonly = props.isReadonly ?? false;
1293
+ const handleChange = (value) => {
1294
+ props.onChange?.(value);
1295
+ };
1296
+ const dataKey = props.dataKey || "value";
1297
+ const dataLabel = props.dataLabel || "label";
1298
+ const options = list.map((item) => ({
1299
+ value: item[dataKey],
1300
+ label: item[dataLabel]
1301
+ }));
1302
+ return /* @__PURE__ */ jsxs16(Fragment9, { children: [
1303
+ /* @__PURE__ */ jsxs16(Select, { name: props.name, value: props.value, onValueChange: handleChange, disabled: isDisabled || !isEditable, children: [
1304
+ /* @__PURE__ */ jsx29(
1305
+ SelectTrigger,
1306
+ {
1307
+ id: props.name || "select-field",
1308
+ className: cn(className, props.errorMessage ? "border-red-500" : ""),
1309
+ style: {
1310
+ ...style,
1311
+ borderColor: props.errorMessage ? "#f87171" : style?.borderColor
1312
+ },
1313
+ "aria-readonly": isReadonly,
1314
+ children: /* @__PURE__ */ jsx29(SelectValue, { placeholder })
1315
+ }
1316
+ ),
1317
+ /* @__PURE__ */ jsx29(SelectContent, { children: options.map((opt) => /* @__PURE__ */ jsx29(SelectItem, { value: opt.value, children: opt.label }, opt.value)) })
1318
+ ] }),
1319
+ props.errorMessage && /* @__PURE__ */ jsx29("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
1320
+ ] });
1321
+ };
1322
+ var Dropdown_default = Dropdown;
1323
+
1324
+ // src/components/ui/switch.tsx
1325
+ import * as SwitchPrimitive from "@radix-ui/react-switch";
1326
+ import { jsx as jsx30 } from "react/jsx-runtime";
1327
+ function Switch({
1328
+ className,
1329
+ ...props
1330
+ }) {
1331
+ return /* @__PURE__ */ jsx30(
1332
+ SwitchPrimitive.Root,
1333
+ {
1334
+ "data-slot": "switch",
1335
+ className: cn(
1336
+ "peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
1337
+ className
1338
+ ),
1339
+ ...props,
1340
+ children: /* @__PURE__ */ jsx30(
1341
+ SwitchPrimitive.Thumb,
1342
+ {
1343
+ "data-slot": "switch-thumb",
1344
+ className: cn(
1345
+ "bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0"
1346
+ )
1347
+ }
1348
+ )
1349
+ }
1350
+ );
1351
+ }
1352
+
1353
+ // src/components/Inputs/SwitchToggle/SwitchToggle.tsx
1354
+ import { Fragment as Fragment10, jsx as jsx31, jsxs as jsxs17 } from "react/jsx-runtime";
1355
+ var SwitchToggle = ({ className, style, ...props }) => {
1356
+ const isEditable = props.isEditable ?? true;
1357
+ const isDisabled = props.isDisabled ?? false;
1358
+ const handleChange = (value) => {
1359
+ props.onChange?.(value);
1360
+ };
1361
+ return /* @__PURE__ */ jsxs17(Fragment10, { children: [
1362
+ /* @__PURE__ */ jsx31("div", { className, style, children: /* @__PURE__ */ jsxs17("div", { className: "flex items-center space-x-2 mb-2", children: [
1363
+ /* @__PURE__ */ jsx31(
1364
+ Switch,
1365
+ {
1366
+ id: props.name || "switch",
1367
+ checked: !!props.value,
1368
+ onCheckedChange: handleChange,
1369
+ disabled: isDisabled || !isEditable
1370
+ }
1371
+ ),
1372
+ /* @__PURE__ */ jsx31(Label2, { htmlFor: props.name || "switch", children: props.text })
1373
+ ] }) }),
1374
+ props.errorMessage && /* @__PURE__ */ jsx31("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
1375
+ ] });
1376
+ };
1377
+ var SwitchToggle_default = SwitchToggle;
1378
+
1379
+ // src/components/Inputs/PhoneInput/PhoneInput.tsx
1380
+ import { PhoneInput as PhoneInputField } from "react-international-phone";
1381
+ import "react-international-phone/style.css";
1382
+ import { Fragment as Fragment11, jsx as jsx32, jsxs as jsxs18 } from "react/jsx-runtime";
1383
+ var PhoneInput = ({ className, style, ...props }) => {
1384
+ const placeholder = props.placeholder ?? "Enter phone number";
1385
+ const isEditable = props.isEditable ?? true;
1386
+ const isDisabled = props.isDisabled ?? false;
1387
+ const handleChange = (val) => {
1388
+ props.onChange?.(val);
1389
+ };
1390
+ return /* @__PURE__ */ jsxs18(Fragment11, { children: [
1391
+ /* @__PURE__ */ jsx32(
1392
+ PhoneInputField,
1393
+ {
1394
+ defaultCountry: "in",
1395
+ name: props.name,
1396
+ value: props.value,
1397
+ className: cn(className, props.errorMessage ? "border-red-500" : ""),
1398
+ style: {
1399
+ ...style,
1400
+ borderColor: props.errorMessage ? "#f87171" : style?.borderColor
1401
+ },
1402
+ onChange: (phone) => handleChange(phone),
1403
+ inputProps: {
1404
+ id: "phone-field"
1405
+ },
1406
+ placeholder,
1407
+ disabled: isDisabled || !isEditable
1408
+ }
1409
+ ),
1410
+ props.errorMessage && /* @__PURE__ */ jsx32("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
1411
+ ] });
1412
+ };
1413
+ var PhoneInput_default = PhoneInput;
1414
+
1415
+ // src/components/Inputs/SearchInput/SearchInput.tsx
1416
+ import { Fragment as Fragment12, jsx as jsx33, jsxs as jsxs19 } from "react/jsx-runtime";
1417
+ var SearchInput = ({ className, style, ...props }) => {
1418
+ const placeholder = props.placeholder ?? "Placeholder text";
1419
+ const isEditable = props.isEditable ?? true;
1420
+ const isDisabled = props.isDisabled ?? false;
1421
+ const isReadonly = props.isReadonly ?? false;
1422
+ const isAutocomplete = props.isAutocomplete ?? false;
1423
+ const handleChange = (e) => {
1424
+ props.onChange?.(e);
1425
+ };
1426
+ return /* @__PURE__ */ jsxs19(Fragment12, { children: [
1427
+ /* @__PURE__ */ jsxs19("div", { className: "flex justify-start items-center relative", children: [
1428
+ /* @__PURE__ */ jsx33(Search, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[#BDBDBD]" }),
1429
+ /* @__PURE__ */ jsx33(
1430
+ Input,
1431
+ {
1432
+ type: "text",
1433
+ id: props.name || "text-field",
1434
+ name: props.name,
1435
+ value: props.value,
1436
+ className: cn(className, props.errorMessage ? "border-red-500" : ""),
1437
+ style: {
1438
+ ...style,
1439
+ borderColor: props.errorMessage ? "#f87171" : style?.borderColor
1440
+ },
1441
+ autoComplete: isAutocomplete ? "on" : "off",
1442
+ placeholder,
1443
+ onChange: handleChange,
1444
+ disabled: isDisabled || !isEditable,
1445
+ readOnly: isReadonly
1446
+ }
1447
+ )
1448
+ ] }),
1449
+ props.errorMessage && /* @__PURE__ */ jsx33("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
1450
+ ] });
1451
+ };
1452
+ var SearchInput_default = SearchInput;
1453
+
1454
+ // src/components/Inputs/FileInput/FileInput.tsx
1455
+ import { jsx as jsx34, jsxs as jsxs20 } from "react/jsx-runtime";
1456
+ var FileInput = ({ className, style, ...props }) => {
1457
+ const placeholder = props.placeholder ?? "Placeholder text";
1458
+ return /* @__PURE__ */ jsxs20("div", { className: "d-flex items-center relative align-middle", children: [
1459
+ /* @__PURE__ */ jsx34(
1460
+ Input,
1461
+ {
1462
+ type: "file",
1463
+ id: "file",
1464
+ name: props.name,
1465
+ value: props.value,
1466
+ className: cn(className, props.errorMessage ? "border-red-500" : ""),
1467
+ style: {
1468
+ ...style,
1469
+ borderColor: props.errorMessage ? "#f87171" : style?.borderColor
1470
+ },
1471
+ autoComplete: "off",
1472
+ placeholder,
1473
+ onChange: (e) => {
1474
+ props.onChange?.(e);
1475
+ }
1476
+ }
1477
+ ),
1478
+ props.errorMessage && /* @__PURE__ */ jsx34("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
1479
+ ] });
1480
+ };
1481
+ var FileInput_default = FileInput;
1482
+
1483
+ // src/components/Inputs/DatePicker/DatePicker.tsx
1484
+ import { Fragment as Fragment13, jsx as jsx35, jsxs as jsxs21 } from "react/jsx-runtime";
1485
+ function DatePicker({ className, style, ...props }) {
1486
+ const placeholder = props.placeholder ?? "Placeholder text";
1487
+ const minimumDate = props.minimumDate ?? "none";
1488
+ const customMinimumDate = props.customMinimumDate ?? "";
1489
+ const maximumDate = props.maximumDate ?? "none";
1490
+ const customMaximumDate = props.customMaximumDate ?? "";
1491
+ const isEditable = props.isEditable ?? true;
1492
+ const isDisabled = props.isDisabled ?? false;
1493
+ const isReadonly = props.isReadonly ?? false;
1494
+ const isAutocomplete = props.isAutocomplete ?? false;
1495
+ const resolveDate = (option, customOption) => {
1496
+ if (!option) return void 0;
1497
+ switch (option) {
1498
+ case "today":
1499
+ return (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
1500
+ case "custom":
1501
+ return customOption ?? void 0;
1502
+ case "none":
1503
+ default:
1504
+ return void 0;
1505
+ }
1506
+ };
1507
+ const minDate = resolveDate(minimumDate, customMinimumDate);
1508
+ const maxDate = resolveDate(maximumDate, customMaximumDate);
1509
+ const handleChange = (e) => {
1510
+ props.onChange?.(e);
1511
+ };
1512
+ return /* @__PURE__ */ jsxs21(Fragment13, { children: [
1513
+ /* @__PURE__ */ jsxs21("div", { className: "flex justify-start items-center relative", children: [
1514
+ /* @__PURE__ */ jsx35(Calendar, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[#BDBDBD]" }),
1515
+ /* @__PURE__ */ jsx35(
1516
+ Input,
1517
+ {
1518
+ type: "date",
1519
+ id: "date",
1520
+ autoComplete: isAutocomplete ? "on" : "off",
1521
+ onChange: handleChange,
1522
+ disabled: isDisabled || !isEditable,
1523
+ name: props.name,
1524
+ value: props.value,
1525
+ className: cn(
1526
+ className,
1527
+ props.errorMessage ? "border-red-500" : "",
1528
+ "appearance-auto"
1529
+ ),
1530
+ style: {
1531
+ ...style,
1532
+ borderColor: props.errorMessage ? "#f87171" : style?.borderColor
1533
+ },
1534
+ readOnly: isReadonly,
1535
+ placeholder,
1536
+ min: minDate,
1537
+ max: maxDate
1538
+ }
1539
+ )
1540
+ ] }),
1541
+ props.errorMessage && /* @__PURE__ */ jsx35("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
1542
+ ] });
1543
+ }
1544
+
1545
+ // src/components/Inputs/DateRange/DateRange.tsx
1546
+ import * as React3 from "react";
1547
+ import { addDays, format } from "date-fns";
1548
+
1549
+ // src/components/ui/calendar.tsx
1550
+ import * as React2 from "react";
1551
+ import { DayPicker, getDefaultClassNames } from "react-day-picker";
1552
+ import { jsx as jsx36 } from "react/jsx-runtime";
1553
+ function Calendar2({
1554
+ className,
1555
+ classNames,
1556
+ showOutsideDays = true,
1557
+ captionLayout = "label",
1558
+ buttonVariant = "ghost",
1559
+ formatters,
1560
+ components,
1561
+ ...props
1562
+ }) {
1563
+ const defaultClassNames = getDefaultClassNames();
1564
+ return /* @__PURE__ */ jsx36(
1565
+ DayPicker,
1566
+ {
1567
+ showOutsideDays,
1568
+ className: cn(
1569
+ "bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
1570
+ String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
1571
+ String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
1572
+ className
1573
+ ),
1574
+ captionLayout,
1575
+ formatters: {
1576
+ formatMonthDropdown: (date) => date.toLocaleString("default", { month: "short" }),
1577
+ ...formatters
1578
+ },
1579
+ classNames: {
1580
+ root: cn("w-fit", defaultClassNames.root),
1581
+ months: cn(
1582
+ "flex gap-4 flex-col md:flex-row relative",
1583
+ defaultClassNames.months
1584
+ ),
1585
+ month: cn("flex flex-col w-full gap-4", defaultClassNames.month),
1586
+ nav: cn(
1587
+ "flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",
1588
+ defaultClassNames.nav
1589
+ ),
1590
+ button_previous: cn(
1591
+ buttonVariants({ variant: buttonVariant }),
1592
+ "size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
1593
+ defaultClassNames.button_previous
1594
+ ),
1595
+ button_next: cn(
1596
+ buttonVariants({ variant: buttonVariant }),
1597
+ "size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
1598
+ defaultClassNames.button_next
1599
+ ),
1600
+ month_caption: cn(
1601
+ "flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",
1602
+ defaultClassNames.month_caption
1603
+ ),
1604
+ dropdowns: cn(
1605
+ "w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",
1606
+ defaultClassNames.dropdowns
1607
+ ),
1608
+ dropdown_root: cn(
1609
+ "relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",
1610
+ defaultClassNames.dropdown_root
1611
+ ),
1612
+ dropdown: cn(
1613
+ "absolute bg-popover inset-0 opacity-0",
1614
+ defaultClassNames.dropdown
1615
+ ),
1616
+ caption_label: cn(
1617
+ "select-none font-medium",
1618
+ captionLayout === "label" ? "text-sm" : "rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5",
1619
+ defaultClassNames.caption_label
1620
+ ),
1621
+ table: "w-full border-collapse",
1622
+ weekdays: cn("flex", defaultClassNames.weekdays),
1623
+ weekday: cn(
1624
+ "text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",
1625
+ defaultClassNames.weekday
1626
+ ),
1627
+ week: cn("flex w-full mt-2", defaultClassNames.week),
1628
+ week_number_header: cn(
1629
+ "select-none w-(--cell-size)",
1630
+ defaultClassNames.week_number_header
1631
+ ),
1632
+ week_number: cn(
1633
+ "text-[0.8rem] select-none text-muted-foreground",
1634
+ defaultClassNames.week_number
1635
+ ),
1636
+ day: cn(
1637
+ "relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none",
1638
+ defaultClassNames.day
1639
+ ),
1640
+ range_start: cn(
1641
+ "rounded-l-md bg-accent",
1642
+ defaultClassNames.range_start
1643
+ ),
1644
+ range_middle: cn("rounded-none", defaultClassNames.range_middle),
1645
+ range_end: cn("rounded-r-md bg-accent", defaultClassNames.range_end),
1646
+ today: cn(
1647
+ "bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",
1648
+ defaultClassNames.today
1649
+ ),
1650
+ outside: cn(
1651
+ "text-muted-foreground aria-selected:text-muted-foreground",
1652
+ defaultClassNames.outside
1653
+ ),
1654
+ disabled: cn(
1655
+ "text-muted-foreground opacity-50",
1656
+ defaultClassNames.disabled
1657
+ ),
1658
+ hidden: cn("invisible", defaultClassNames.hidden),
1659
+ ...classNames
1660
+ },
1661
+ components: {
1662
+ Root: ({ className: className2, rootRef, ...props2 }) => {
1663
+ return /* @__PURE__ */ jsx36(
1664
+ "div",
1665
+ {
1666
+ "data-slot": "calendar",
1667
+ ref: rootRef,
1668
+ className: cn(className2),
1669
+ ...props2
1670
+ }
1671
+ );
1672
+ },
1673
+ Chevron: ({ className: className2, orientation, ...props2 }) => {
1674
+ if (orientation === "left") {
1675
+ return /* @__PURE__ */ jsx36(ChevronLeft, { className: cn("size-4", className2), ...props2 });
1676
+ }
1677
+ if (orientation === "right") {
1678
+ return /* @__PURE__ */ jsx36(
1679
+ ChevronRight,
1680
+ {
1681
+ className: cn("size-4", className2),
1682
+ ...props2
1683
+ }
1684
+ );
1685
+ }
1686
+ return /* @__PURE__ */ jsx36(ChevronDown, { className: cn("size-4", className2), ...props2 });
1687
+ },
1688
+ DayButton: CalendarDayButton,
1689
+ WeekNumber: ({ children, ...props2 }) => {
1690
+ return /* @__PURE__ */ jsx36("td", { ...props2, children: /* @__PURE__ */ jsx36("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children }) });
1691
+ },
1692
+ ...components
1693
+ },
1694
+ ...props
1695
+ }
1696
+ );
1697
+ }
1698
+ function CalendarDayButton({
1699
+ className,
1700
+ day,
1701
+ modifiers,
1702
+ ...props
1703
+ }) {
1704
+ const defaultClassNames = getDefaultClassNames();
1705
+ const ref = React2.useRef(null);
1706
+ React2.useEffect(() => {
1707
+ if (modifiers.focused) ref.current?.focus();
1708
+ }, [modifiers.focused]);
1709
+ return /* @__PURE__ */ jsx36(
1710
+ Button,
1711
+ {
1712
+ ref,
1713
+ variant: "ghost",
1714
+ size: "icon",
1715
+ "data-day": day.date.toLocaleDateString(),
1716
+ "data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
1717
+ "data-range-start": modifiers.range_start,
1718
+ "data-range-end": modifiers.range_end,
1719
+ "data-range-middle": modifiers.range_middle,
1720
+ className: cn(
1721
+ "data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",
1722
+ defaultClassNames.day,
1723
+ className
1724
+ ),
1725
+ ...props
1726
+ }
1727
+ );
1728
+ }
1729
+
1730
+ // src/components/ui/popover.tsx
1731
+ import * as PopoverPrimitive from "@radix-ui/react-popover";
1732
+ import { jsx as jsx37 } from "react/jsx-runtime";
1733
+ function Popover({
1734
+ ...props
1735
+ }) {
1736
+ return /* @__PURE__ */ jsx37(PopoverPrimitive.Root, { "data-slot": "popover", ...props });
1737
+ }
1738
+ function PopoverTrigger({
1739
+ ...props
1740
+ }) {
1741
+ return /* @__PURE__ */ jsx37(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
1742
+ }
1743
+ function PopoverContent({
1744
+ className,
1745
+ align = "center",
1746
+ sideOffset = 4,
1747
+ ...props
1748
+ }) {
1749
+ return /* @__PURE__ */ jsx37(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx37(
1750
+ PopoverPrimitive.Content,
1751
+ {
1752
+ "data-slot": "popover-content",
1753
+ align,
1754
+ sideOffset,
1755
+ className: cn(
1756
+ "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
1757
+ className
1758
+ ),
1759
+ ...props
1760
+ }
1761
+ ) });
1762
+ }
1763
+
1764
+ // src/components/Inputs/DateRange/DateRange.tsx
1765
+ import { Fragment as Fragment14, jsx as jsx38, jsxs as jsxs22 } from "react/jsx-runtime";
1766
+ var DateRange = ({ className, style, ...props }) => {
1767
+ const isDateRange = (val) => !!val && val.from instanceof Date;
1768
+ const [date, setDate] = React3.useState(
1769
+ isDateRange(props.value) ? props.value : {
1770
+ from: /* @__PURE__ */ new Date(),
1771
+ to: addDays(/* @__PURE__ */ new Date(), 7)
1772
+ }
1773
+ );
1774
+ const handleChange = (value) => {
1775
+ setDate(value);
1776
+ if (value) {
1777
+ props.onChange?.(value);
1778
+ }
1779
+ };
1780
+ return /* @__PURE__ */ jsxs22(Fragment14, { children: [
1781
+ /* @__PURE__ */ jsx38("div", { className, style, children: /* @__PURE__ */ jsxs22(Popover, { children: [
1782
+ /* @__PURE__ */ jsx38(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx38(
1783
+ Button,
1784
+ {
1785
+ id: "date",
1786
+ variant: "outline",
1787
+ className: cn(
1788
+ "w-[300px] justify-start text-left font-normal text-[11px]",
1789
+ !date && "text-muted-foreground"
1790
+ ),
1791
+ children: date?.from ? date.to ? /* @__PURE__ */ jsxs22(Fragment14, { children: [
1792
+ format(date.from, "LLL dd, y"),
1793
+ " -",
1794
+ " ",
1795
+ format(date.to, "LLL dd, y")
1796
+ ] }) : format(date.from, "LLL dd, y") : /* @__PURE__ */ jsx38("span", { children: "Pick a date range" })
1797
+ }
1798
+ ) }),
1799
+ /* @__PURE__ */ jsx38(PopoverContent, { className: "w-auto p-0", align: "start", children: /* @__PURE__ */ jsx38(
1800
+ Calendar2,
1801
+ {
1802
+ mode: "range",
1803
+ defaultMonth: date?.from,
1804
+ selected: date,
1805
+ onSelect: handleChange,
1806
+ numberOfMonths: 2
1807
+ }
1808
+ ) })
1809
+ ] }) }),
1810
+ props.errorMessage && /* @__PURE__ */ jsx38("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
1811
+ ] });
1812
+ };
1813
+ var DateRange_default = DateRange;
1814
+
1815
+ // src/components/Inputs/TextInputGroup/TextInputGroup.tsx
1816
+ import { Fragment as Fragment15, jsx as jsx39, jsxs as jsxs23 } from "react/jsx-runtime";
1817
+ var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
1818
+ const placeholder = props.placeholder ?? "Placeholder text";
1819
+ const isEditable = props.isEditable ?? true;
1820
+ const isDisabled = props.isDisabled ?? false;
1821
+ const isReadonly = props.isReadonly ?? false;
1822
+ const isAutocomplete = props.isAutocomplete ?? false;
1823
+ const handleChange = (e) => {
1824
+ props.onChange?.(e);
1825
+ };
1826
+ return /* @__PURE__ */ jsxs23(Fragment15, { children: [
1827
+ /* @__PURE__ */ jsxs23(
1828
+ "div",
1829
+ {
1830
+ className: cn(
1831
+ "flex justify-start items-center relative border border-input rounded-md bg-transparent focus-within:ring-2 focus-within:ring-ring focus-within:border-primary",
1832
+ className,
1833
+ "p-0 m-0",
1834
+ props.errorMessage ? "border-red-500" : ""
1835
+ ),
1836
+ children: [
1837
+ prepend && /* @__PURE__ */ jsx39("div", { className: "px-3 flex items-center bg-gray-500 text-white h-10 rounded-l-md", children: prepend }),
1838
+ /* @__PURE__ */ jsx39(
1839
+ Input,
1840
+ {
1841
+ id: props.name || "prepend-input",
1842
+ type: "url",
1843
+ name: props.name,
1844
+ value: props.value,
1845
+ className: cn(
1846
+ className,
1847
+ "rounded-none flex-1 border-none focus:ring-0"
1848
+ ),
1849
+ style: {
1850
+ ...style,
1851
+ borderColor: props.errorMessage ? "#f87171" : style?.borderColor
1852
+ },
1853
+ autoComplete: isAutocomplete ? "on" : "off",
1854
+ placeholder,
1855
+ onChange: handleChange,
1856
+ disabled: isDisabled || !isEditable,
1857
+ readOnly: isReadonly
1858
+ }
1859
+ ),
1860
+ append && /* @__PURE__ */ jsx39("div", { className: "px-3 flex items-center bg-gray-500 text-white h-10 rounded-r-md", children: append })
1861
+ ]
1862
+ }
1863
+ ),
1864
+ props.errorMessage && /* @__PURE__ */ jsx39("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
1865
+ ] });
1866
+ };
1867
+ var TextInputGroup_default = TextInputGroup;
1868
+
1869
+ // src/components/ui/pagination.tsx
1870
+ import { jsx as jsx40, jsxs as jsxs24 } from "react/jsx-runtime";
1871
+ function Pagination({ className, ...props }) {
1872
+ return /* @__PURE__ */ jsx40(
1873
+ "nav",
1874
+ {
1875
+ role: "navigation",
1876
+ "aria-label": "pagination",
1877
+ "data-slot": "pagination",
1878
+ className: cn("mx-auto flex w-full justify-center", className),
1879
+ ...props
1880
+ }
1881
+ );
1882
+ }
1883
+ function PaginationContent({
1884
+ className,
1885
+ ...props
1886
+ }) {
1887
+ return /* @__PURE__ */ jsx40(
1888
+ "ul",
1889
+ {
1890
+ "data-slot": "pagination-content",
1891
+ className: cn("flex flex-row items-center gap-1", className),
1892
+ ...props
1893
+ }
1894
+ );
1895
+ }
1896
+ function PaginationItem({ ...props }) {
1897
+ return /* @__PURE__ */ jsx40("li", { "data-slot": "pagination-item", ...props });
1898
+ }
1899
+ function PaginationLink({
1900
+ className,
1901
+ isActive,
1902
+ size = "icon",
1903
+ ...props
1904
+ }) {
1905
+ return /* @__PURE__ */ jsx40(
1906
+ "a",
1907
+ {
1908
+ "aria-current": isActive ? "page" : void 0,
1909
+ "data-slot": "pagination-link",
1910
+ "data-active": isActive,
1911
+ className: cn(
1912
+ buttonVariants({
1913
+ variant: isActive ? "outline" : "ghost",
1914
+ size
1915
+ }),
1916
+ className
1917
+ ),
1918
+ ...props
1919
+ }
1920
+ );
1921
+ }
1922
+ function PaginationPrevious({
1923
+ className,
1924
+ ...props
1925
+ }) {
1926
+ return /* @__PURE__ */ jsxs24(
1927
+ PaginationLink,
1928
+ {
1929
+ "aria-label": "Go to previous page",
1930
+ size: "default",
1931
+ className: cn("gap-1 px-2.5 sm:pl-2.5", className),
1932
+ ...props,
1933
+ children: [
1934
+ /* @__PURE__ */ jsx40(ChevronLeft, {}),
1935
+ /* @__PURE__ */ jsx40("span", { className: "hidden sm:block", children: "Previous" })
1936
+ ]
1937
+ }
1938
+ );
1939
+ }
1940
+ function PaginationNext({
1941
+ className,
1942
+ ...props
1943
+ }) {
1944
+ return /* @__PURE__ */ jsxs24(
1945
+ PaginationLink,
1946
+ {
1947
+ "aria-label": "Go to next page",
1948
+ size: "default",
1949
+ className: cn("gap-1 px-2.5 sm:pr-2.5", className),
1950
+ ...props,
1951
+ children: [
1952
+ /* @__PURE__ */ jsx40("span", { className: "hidden sm:block", children: "Next" }),
1953
+ /* @__PURE__ */ jsx40(ChevronRight, {})
1954
+ ]
1955
+ }
1956
+ );
1957
+ }
1958
+ function PaginationEllipsis({
1959
+ className,
1960
+ ...props
1961
+ }) {
1962
+ return /* @__PURE__ */ jsxs24(
1963
+ "span",
1964
+ {
1965
+ "aria-hidden": true,
1966
+ "data-slot": "pagination-ellipsis",
1967
+ className: cn("flex size-9 items-center justify-center", className),
1968
+ ...props,
1969
+ children: [
1970
+ /* @__PURE__ */ jsx40(Ellipsis, { className: "size-4" }),
1971
+ /* @__PURE__ */ jsx40("span", { className: "sr-only", children: "More pages" })
1972
+ ]
1973
+ }
1974
+ );
1975
+ }
1976
+
1977
+ // src/components/DataDisplay/Pagination/Pagination.tsx
1978
+ import { jsx as jsx41, jsxs as jsxs25 } from "react/jsx-runtime";
1979
+ var CustomPagination = ({
1980
+ totalPages,
1981
+ currentPage,
1982
+ onPageChange,
1983
+ maxVisiblePages = 5
1984
+ }) => {
1985
+ const getPageNumbers = () => {
1986
+ const pages = [];
1987
+ if (totalPages <= maxVisiblePages) {
1988
+ return Array.from({ length: totalPages }, (_, i) => i + 1);
1989
+ }
1990
+ const leftSiblingIndex = Math.max(currentPage - 1, 1);
1991
+ const rightSiblingIndex = Math.min(currentPage + 1, totalPages);
1992
+ const shouldShowLeftDots = leftSiblingIndex > 2;
1993
+ const shouldShowRightDots = rightSiblingIndex < totalPages - 1;
1994
+ if (!shouldShowLeftDots && shouldShowRightDots) {
1995
+ const leftRange = Array.from({ length: 3 }, (_, i) => i + 1);
1996
+ return [...leftRange, "...", totalPages];
1997
+ }
1998
+ if (shouldShowLeftDots && !shouldShowRightDots) {
1999
+ const rightRange = Array.from(
2000
+ { length: 3 },
2001
+ (_, i) => totalPages - 2 + i
2002
+ );
2003
+ return [1, "...", ...rightRange];
2004
+ }
2005
+ if (shouldShowLeftDots && shouldShowRightDots) {
2006
+ const middleRange = Array.from(
2007
+ { length: 3 },
2008
+ (_, i) => leftSiblingIndex + i
2009
+ );
2010
+ return [1, "...", ...middleRange, "...", totalPages];
2011
+ }
2012
+ return pages;
2013
+ };
2014
+ const handlePageChange = (page) => {
2015
+ if (page >= 1 && page <= totalPages && page !== currentPage) {
2016
+ onPageChange(page);
2017
+ }
2018
+ };
2019
+ const pageNumbers = getPageNumbers();
2020
+ return /* @__PURE__ */ jsx41(Pagination, { children: /* @__PURE__ */ jsxs25(PaginationContent, { children: [
2021
+ /* @__PURE__ */ jsx41(PaginationItem, { children: /* @__PURE__ */ jsx41(
2022
+ PaginationPrevious,
2023
+ {
2024
+ onClick: () => handlePageChange(currentPage - 1),
2025
+ className: currentPage === 1 ? "pointer-events-none opacity-50" : "cursor-pointer"
2026
+ }
2027
+ ) }),
2028
+ pageNumbers.map((pageNumber, index) => /* @__PURE__ */ jsx41(PaginationItem, { children: pageNumber === "..." ? /* @__PURE__ */ jsx41(PaginationEllipsis, {}) : /* @__PURE__ */ jsx41(
2029
+ PaginationLink,
2030
+ {
2031
+ onClick: () => handlePageChange(pageNumber),
2032
+ isActive: currentPage === pageNumber,
2033
+ className: "cursor-pointer",
2034
+ children: pageNumber
2035
+ }
2036
+ ) }, index)),
2037
+ /* @__PURE__ */ jsx41(PaginationItem, { children: /* @__PURE__ */ jsx41(
2038
+ PaginationNext,
2039
+ {
2040
+ onClick: () => handlePageChange(currentPage + 1),
2041
+ className: currentPage === totalPages ? "pointer-events-none opacity-50" : "cursor-pointer"
2042
+ }
2043
+ ) })
2044
+ ] }) });
2045
+ };
2046
+ var Pagination_default = CustomPagination;
2047
+
2048
+ // src/components/ui/data-table.tsx
2049
+ import {
2050
+ flexRender,
2051
+ getCoreRowModel,
2052
+ useReactTable
2053
+ } from "@tanstack/react-table";
2054
+
2055
+ // src/components/ui/table.tsx
2056
+ import { jsx as jsx42 } from "react/jsx-runtime";
2057
+ function Table({ className, ...props }) {
2058
+ return /* @__PURE__ */ jsx42(
2059
+ "div",
2060
+ {
2061
+ "data-slot": "table-container",
2062
+ className: "relative w-full overflow-x-auto rounded-md border border-gray-200 bg-white",
2063
+ children: /* @__PURE__ */ jsx42(
2064
+ "table",
2065
+ {
2066
+ "data-slot": "table",
2067
+ className: cn("w-full text-sm", className),
2068
+ ...props
2069
+ }
2070
+ )
2071
+ }
2072
+ );
2073
+ }
2074
+ function TableHeader({ className, ...props }) {
2075
+ return /* @__PURE__ */ jsx42(
2076
+ "thead",
2077
+ {
2078
+ "data-slot": "table-header",
2079
+ className: cn(
2080
+ "bg-gray-100 text-gray-700 [&>tr]:border-b [&>tr]:border-gray-200 [&>tr>th]:border-r [&>tr>th]:border-gray-200 [&>tr>th]:last:border-r-0",
2081
+ className
2082
+ ),
2083
+ ...props
2084
+ }
2085
+ );
2086
+ }
2087
+ function TableBody({ className, ...props }) {
2088
+ return /* @__PURE__ */ jsx42(
2089
+ "tbody",
2090
+ {
2091
+ "data-slot": "table-body",
2092
+ className: cn(
2093
+ "[&>tr]:border-b [&>tr]:border-gray-200 [&>tr:last-child]:border-0 [&>tr>td]:border-r [&>tr>td]:border-gray-200 [&>tr>td]:last:border-r-0",
2094
+ className
2095
+ ),
2096
+ ...props
2097
+ }
2098
+ );
2099
+ }
2100
+ function TableRow({ className, ...props }) {
2101
+ return /* @__PURE__ */ jsx42(
2102
+ "tr",
2103
+ {
2104
+ "data-slot": "table-row",
2105
+ className: cn(
2106
+ "border-b border-gray-200 hover:bg-gray-50 transition-colors",
2107
+ className
2108
+ ),
2109
+ ...props
2110
+ }
2111
+ );
2112
+ }
2113
+ function TableHead({ className, ...props }) {
2114
+ return /* @__PURE__ */ jsx42(
2115
+ "th",
2116
+ {
2117
+ "data-slot": "table-head",
2118
+ className: cn(
2119
+ "h-12 px-6 text-left align-middle font-semibold whitespace-nowrap",
2120
+ className
2121
+ ),
2122
+ ...props
2123
+ }
2124
+ );
2125
+ }
2126
+ function TableCell({ className, ...props }) {
2127
+ return /* @__PURE__ */ jsx42(
2128
+ "td",
2129
+ {
2130
+ "data-slot": "table-cell",
2131
+ className: cn(
2132
+ "px-6 py-4 align-middle text-gray-700",
2133
+ className
2134
+ ),
2135
+ ...props
2136
+ }
2137
+ );
2138
+ }
2139
+
2140
+ // src/components/ui/data-table.tsx
2141
+ import { Fragment as Fragment16, jsx as jsx43, jsxs as jsxs26 } from "react/jsx-runtime";
2142
+ function DataTable({
2143
+ columns,
2144
+ rowActions,
2145
+ data,
2146
+ loading,
2147
+ getRowSelection,
2148
+ onCellClick,
2149
+ cellClickEnabled = () => false
2150
+ }) {
2151
+ const table = useReactTable({
2152
+ data,
2153
+ columns,
2154
+ enableRowSelection: true,
2155
+ onRowSelectionChange: getRowSelection ? (updaterOrValue) => {
2156
+ const value = typeof updaterOrValue === "function" ? updaterOrValue(table.getState().rowSelection) : updaterOrValue;
2157
+ getRowSelection(value);
2158
+ } : void 0,
2159
+ getCoreRowModel: getCoreRowModel()
2160
+ });
2161
+ const handleCellClick = (rowData, columnId) => {
2162
+ if (onCellClick) {
2163
+ onCellClick(rowData, columnId);
2164
+ }
2165
+ };
2166
+ return /* @__PURE__ */ jsx43("div", { className: "overflow-hidden rounded-md border w-full", children: /* @__PURE__ */ jsxs26(Table, { children: [
2167
+ /* @__PURE__ */ jsx43(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx43(TableRow, { children: headerGroup.headers.map((header) => {
2168
+ return /* @__PURE__ */ jsx43(TableHead, { children: header.isPlaceholder ? null : flexRender(
2169
+ header.column.columnDef.header,
2170
+ header.getContext()
2171
+ ) }, header.id);
2172
+ }) }, headerGroup.id)) }),
2173
+ /* @__PURE__ */ jsx43(TableBody, { children: loading ? /* @__PURE__ */ jsx43(TableRow, { children: /* @__PURE__ */ jsx43(TableCell, { colSpan: columns.length, className: "h-24 text-center", children: "Loading..." }) }) : /* @__PURE__ */ jsx43(Fragment16, { children: table.getRowModel().rows?.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsxs26(
2174
+ TableRow,
2175
+ {
2176
+ "data-state": row.getIsSelected() && "selected",
2177
+ className: "relative group",
2178
+ children: [
2179
+ row.getVisibleCells().map((cell) => {
2180
+ const isCellClickable = cellClickEnabled(row.original, cell.column.id);
2181
+ const dynamicClass = cell.column.columnDef.meta?.cellClass || "";
2182
+ const dynamicStyle = cell.column.columnDef.meta?.cellStyle || {};
2183
+ return /* @__PURE__ */ jsx43(
2184
+ TableCell,
2185
+ {
2186
+ className: `${dynamicClass} ${isCellClickable ? "underline cursor-pointer" : ""}`,
2187
+ style: dynamicStyle,
2188
+ onClick: () => {
2189
+ if (isCellClickable) {
2190
+ handleCellClick(row.original, cell.column.id);
2191
+ }
2192
+ },
2193
+ children: flexRender(cell.column.columnDef.cell, cell.getContext())
2194
+ },
2195
+ cell.id
2196
+ );
2197
+ }),
2198
+ rowActions.length > 0 && /* @__PURE__ */ jsx43("div", { className: "absolute top-0 right-0 bg-white py-3 min-w-[100px] z-50 shadow-md flex items-center justify-center gap-3 p-2 opacity-0 group-hover:opacity-100 duration-300 h-full", children: rowActions.map((action, index) => /* @__PURE__ */ jsx43("p", { className: "text-[#383838] text-[12px] cursor-pointer font-[400]", children: action.header }, index)) })
2199
+ ]
2200
+ },
2201
+ row.id
2202
+ )) : /* @__PURE__ */ jsx43(TableRow, { children: /* @__PURE__ */ jsx43(TableCell, { colSpan: columns.length, className: "h-24 text-center", children: "No results." }) }) }) })
2203
+ ] }) });
2204
+ }
2205
+
2206
+ // src/components/DataDisplay/Table/Table.tsx
2207
+ import { useState as useState3 } from "react";
2208
+ import { jsx as jsx44, jsxs as jsxs27 } from "react/jsx-runtime";
2209
+ var Table2 = ({
2210
+ columns,
2211
+ data,
2212
+ rowActions,
2213
+ className,
2214
+ style,
2215
+ pagination = false,
2216
+ itemsPerPage = 10,
2217
+ onPageChange,
2218
+ loading = false,
2219
+ ...props
2220
+ }) => {
2221
+ const rawColumns = Array.isArray(columns) ? columns : [];
2222
+ const rawData = Array.isArray(data) ? data : [];
2223
+ const rawRowActions = Array.isArray(rowActions) ? rowActions : [];
2224
+ const [currentPage, setCurrentPage] = useState3(1);
2225
+ const enablePagination = pagination && rawData.length > itemsPerPage;
2226
+ const handlePageChange = (page) => {
2227
+ setCurrentPage(page);
2228
+ onPageChange?.(page);
2229
+ };
2230
+ const paginatedData = enablePagination ? rawData.slice((currentPage - 1) * itemsPerPage, currentPage * itemsPerPage) : rawData;
2231
+ return /* @__PURE__ */ jsxs27("div", { className: `${className} space-y-3`, style, children: [
2232
+ /* @__PURE__ */ jsx44(
2233
+ DataTable,
2234
+ {
2235
+ ...props,
2236
+ columns: rawColumns,
2237
+ data: paginatedData,
2238
+ rowActions: rawRowActions,
2239
+ loading
2240
+ }
2241
+ ),
2242
+ enablePagination && /* @__PURE__ */ jsx44(
2243
+ Pagination_default,
2244
+ {
2245
+ totalPages: Math.ceil(rawData.length / itemsPerPage),
2246
+ currentPage,
2247
+ onPageChange: handlePageChange
2248
+ }
2249
+ )
2250
+ ] });
2251
+ };
2252
+ var Table_default = Table2;
2253
+
2254
+ // src/components/Navigation/Tabs/Tabs.tsx
2255
+ import { jsx as jsx45, jsxs as jsxs28 } from "react/jsx-runtime";
2256
+ var Tabs = ({ className, style, tabs, verticalMenu, LinkComponent, pathname, canvasMode }) => {
2257
+ const rawTabs = Array.isArray(tabs) ? tabs : [];
2258
+ const baseClasses = "text-[12px] text-foreground p-2 text-center rounded-md transition-colors";
2259
+ const activeClasses = "bg-white/10 text-white";
2260
+ const hoverClasses = "hover:bg-white/5";
2261
+ const isActive = (path) => {
2262
+ if (!path) return false;
2263
+ return pathname === path || path !== "/" && pathname?.startsWith(path);
2264
+ };
2265
+ const renderDesktopTab = (tab, index) => {
2266
+ const finalClasses = [baseClasses, isActive(tab.url) ? activeClasses : hoverClasses, tab.className || ""].join(" ");
2267
+ if (Array.isArray(tab.children) && tab.children.length > 0 && tab.isDropDown) {
2268
+ return /* @__PURE__ */ jsxs28(DropdownMenu, { children: [
2269
+ /* @__PURE__ */ jsxs28(DropdownMenuTrigger, { className: `${finalClasses} inline-flex items-center gap-1`, children: [
2270
+ tab.header,
2271
+ /* @__PURE__ */ jsx45(ChevronDown, { className: "h-4 w-4 opacity-80" })
2272
+ ] }),
2273
+ /* @__PURE__ */ jsx45(
2274
+ DropdownMenuContent,
2275
+ {
2276
+ align: "start",
2277
+ sideOffset: 6,
2278
+ className: "z-50 min-w-[160px] rounded-md border border-gray-200 bg-white p-1 shadow-lg",
2279
+ children: tab.children.map((item) => /* @__PURE__ */ jsx45(
2280
+ DropdownMenuItem,
2281
+ {
2282
+ asChild: true,
2283
+ className: "cursor-pointer rounded-sm px-3 py-2 text-[12px] text-gray-800 hover:bg-gray-100 focus:bg-gray-100",
2284
+ children: LinkComponent ? /* @__PURE__ */ jsx45(LinkComponent, { href: item.url || "#", children: item.header }) : item.header
2285
+ },
2286
+ item.id
2287
+ ))
2288
+ }
2289
+ )
2290
+ ] }, index);
2291
+ }
2292
+ return tab.url && LinkComponent ? /* @__PURE__ */ jsx45(LinkComponent, { href: tab.url, className: finalClasses, style: tab.style, children: tab.header }, index) : /* @__PURE__ */ jsx45("div", { className: finalClasses, style: tab.style, role: "button", tabIndex: 0, children: tab.header }, index);
2293
+ };
2294
+ const renderMobileMenu = () => /* @__PURE__ */ jsxs28(DropdownMenu, { children: [
2295
+ /* @__PURE__ */ jsxs28(DropdownMenuTrigger, { className: "flex items-center gap-2 px-3 py-2 rounded-md bg-white/10 text-white text-sm", children: [
2296
+ /* @__PURE__ */ jsx45(Menu, { className: "h-4 w-4" }),
2297
+ "Menu"
2298
+ ] }),
2299
+ /* @__PURE__ */ jsx45(
2300
+ DropdownMenuContent,
2301
+ {
2302
+ align: "start",
2303
+ sideOffset: 6,
2304
+ className: "z-50 w-56 rounded-md border border-gray-200 bg-white p-1 shadow-lg",
2305
+ children: rawTabs.map((tab, i) => {
2306
+ const hasChildren = Array.isArray(tab.children) && tab.children.length > 0 && tab.isDropDown;
2307
+ if (hasChildren) {
2308
+ return /* @__PURE__ */ jsxs28(DropdownMenuSub, { children: [
2309
+ /* @__PURE__ */ jsx45(DropdownMenuSubTrigger, { className: "flex items-center justify-between cursor-pointer rounded-sm px-3 py-2 text-[13px] text-foreground hover:text-foreground", children: tab.header }),
2310
+ /* @__PURE__ */ jsx45(DropdownMenuSubContent, { className: "bg-white border shadow-lg rounded-md p-1", children: tab.children.map((item) => /* @__PURE__ */ jsx45(
2311
+ DropdownMenuItem,
2312
+ {
2313
+ asChild: true,
2314
+ className: "cursor-pointer rounded-sm px-3 py-2 text-[12px] text-gray-800 hover:bg-gray-100",
2315
+ children: LinkComponent && item.url ? /* @__PURE__ */ jsx45(LinkComponent, { href: item.url || "#", children: item.header }) : item.header
2316
+ },
2317
+ item.id
2318
+ )) })
2319
+ ] }, i);
2320
+ }
2321
+ return /* @__PURE__ */ jsx45(
2322
+ DropdownMenuItem,
2323
+ {
2324
+ asChild: true,
2325
+ className: "cursor-pointer rounded-sm px-3 py-2 text-[13px] text-gray-800 hover:bg-gray-100",
2326
+ children: LinkComponent && tab.url ? /* @__PURE__ */ jsx45(LinkComponent, { href: tab.url || "#", children: tab.header }) : tab.header
2327
+ },
2328
+ i
2329
+ );
2330
+ })
2331
+ }
2332
+ )
2333
+ ] });
2334
+ const forceMobile = canvasMode === "mobile" || canvasMode === "tablet";
2335
+ const forceDesktop = canvasMode === "desktop";
2336
+ return /* @__PURE__ */ jsxs28("div", { className, style, children: [
2337
+ forceDesktop && /* @__PURE__ */ jsx45("div", { className: "hidden md:flex", children: /* @__PURE__ */ jsx45("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }),
2338
+ forceMobile && /* @__PURE__ */ jsx45("div", { children: renderMobileMenu() }),
2339
+ /* @__PURE__ */ jsx45("div", { className: "md:hidden", children: renderMobileMenu() })
2340
+ ] });
2341
+ };
2342
+ var Tabs_default = Tabs;
2343
+
2344
+ // src/components/Navigation/Stages/Stages.tsx
2345
+ import React4 from "react";
2346
+ import { jsx as jsx46, jsxs as jsxs29 } from "react/jsx-runtime";
2347
+ var StagesComponent = ({ stages, isShowBtn, buttonText, className, style }) => {
2348
+ return /* @__PURE__ */ jsx46("div", { className, style, children: /* @__PURE__ */ jsxs29("div", { className: "flex items-center justify-between bg-gray-50 p-2 rounded-lg border border-gray-200 w-full", children: [
2349
+ /* @__PURE__ */ jsx46("div", { className: "flex items-center", children: /* @__PURE__ */ jsx46("button", { className: "p-2 hover:bg-gray-100 rounded", children: /* @__PURE__ */ jsx46("svg", { className: "w-4 h-4 text-gray-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx46("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) }) }),
2350
+ /* @__PURE__ */ jsx46("div", { className: "flex items-center flex-1 px-2", children: stages?.length > 0 && stages?.map((stage, index) => /* @__PURE__ */ jsxs29(React4.Fragment, { children: [
2351
+ /* @__PURE__ */ jsx46(
2352
+ "button",
2353
+ {
2354
+ className: `
2355
+ min-w-[120px] px-4 py-2 rounded-full text-sm font-medium transition-colors duration-200 whitespace-nowrap ${stage.isActive ? "bg-[#034486] text-white shadow-md" : "bg-white text-gray-700 hover:bg-gray-100 border border-gray-200"}`,
2356
+ children: stage.header
2357
+ }
2358
+ ),
2359
+ index < stages.length - 1 && /* @__PURE__ */ jsx46("div", { className: "flex-shrink-0 w-3 h-px bg-gray-300" })
2360
+ ] }, stage.id)) }),
2361
+ isShowBtn && /* @__PURE__ */ jsx46("div", { className: "flex items-center", children: /* @__PURE__ */ jsx46("button", { className: "bg-[#034486] text-white px-6 py-2 rounded-lg text-sm font-medium transition-colors duration-200 shadow-sm", children: buttonText }) })
2362
+ ] }) });
2363
+ };
2364
+ var Stages_default = StagesComponent;
2365
+
2366
+ // src/components/Navigation/Spacer/Spacer.tsx
2367
+ import { jsx as jsx47 } from "react/jsx-runtime";
2368
+ var Spacer = ({ className, style }) => {
2369
+ return /* @__PURE__ */ jsx47("div", { className: `${className}`, style });
2370
+ };
2371
+ var Spacer_default = Spacer;
2372
+
2373
+ // src/components/ui/avatar.tsx
2374
+ import * as React5 from "react";
2375
+ import * as AvatarPrimitive from "@radix-ui/react-avatar";
2376
+ import { jsx as jsx48 } from "react/jsx-runtime";
2377
+ var Avatar = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx48(
2378
+ AvatarPrimitive.Root,
2379
+ {
2380
+ ref,
2381
+ className: cn(
2382
+ "relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
2383
+ className
2384
+ ),
2385
+ ...props
2386
+ }
2387
+ ));
2388
+ Avatar.displayName = AvatarPrimitive.Root.displayName;
2389
+ var AvatarImage = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx48(
2390
+ AvatarPrimitive.Image,
2391
+ {
2392
+ ref,
2393
+ className: cn("aspect-square h-full w-full", className),
2394
+ ...props
2395
+ }
2396
+ ));
2397
+ AvatarImage.displayName = AvatarPrimitive.Image.displayName;
2398
+ var AvatarFallback = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx48(
2399
+ AvatarPrimitive.Fallback,
2400
+ {
2401
+ ref,
2402
+ className: cn(
2403
+ "flex h-full w-full items-center justify-center rounded-full bg-muted",
2404
+ className
2405
+ ),
2406
+ ...props
2407
+ }
2408
+ ));
2409
+ AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
2410
+
2411
+ // src/components/Navigation/Navbar/Navbar.tsx
2412
+ import { Fragment as Fragment17, jsx as jsx49, jsxs as jsxs30 } from "react/jsx-runtime";
2413
+ function Navbar({
2414
+ style,
2415
+ badgeType,
2416
+ badgeCount = 0,
2417
+ hideBadgeWhenZero,
2418
+ profileType,
2419
+ showName,
2420
+ imageUrl,
2421
+ altText = "Logo",
2422
+ canvasMode = "desktop",
2423
+ LinkComponent,
2424
+ ImageComponent,
2425
+ list = [],
2426
+ userName = "Guest User"
2427
+ }) {
2428
+ const isMobileView = canvasMode === "mobile" || canvasMode === "tablet";
2429
+ return /* @__PURE__ */ jsx49("nav", { className: "w-full border-b bg-white shadow-sm", style, children: /* @__PURE__ */ jsxs30("div", { className: "mx-auto flex max-w-7xl items-center justify-between px-4 py-2", children: [
2430
+ LinkComponent && ImageComponent ? /* @__PURE__ */ jsx49(LinkComponent, { href: "/", className: "flex items-center space-x-2", children: imageUrl ? /* @__PURE__ */ jsx49(ImageComponent, { src: imageUrl, alt: altText, width: 200, height: 200 }) : /* @__PURE__ */ jsx49("span", { className: "font-semibold text-blue-700", children: "Logo" }) }) : /* @__PURE__ */ jsx49("span", { className: "font-semibold text-blue-700", children: "Logo" }),
2431
+ !isMobileView && LinkComponent && /* @__PURE__ */ jsx49("div", { className: "flex items-center space-x-6 sm:hidden md:flex", children: list.map((item) => /* @__PURE__ */ jsx49(
2432
+ LinkComponent,
2433
+ {
2434
+ href: item.url || "#",
2435
+ className: "text-sm font-medium text-gray-600 hover:text-gray-900 transition-colors",
2436
+ children: item.header
2437
+ },
2438
+ item.id
2439
+ )) }),
2440
+ /* @__PURE__ */ jsxs30("div", { className: "flex items-center space-x-3", children: [
2441
+ !isMobileView ? /* @__PURE__ */ jsx49("div", { className: "flex-1 px-6", children: /* @__PURE__ */ jsxs30("div", { className: "relative w-full max-w-md border border-gray-300 rounded-md", children: [
2442
+ /* @__PURE__ */ jsx49(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" }),
2443
+ /* @__PURE__ */ jsx49(Input, { placeholder: "Search", className: "pl-9 text-gray-400" })
2444
+ ] }) }) : /* @__PURE__ */ jsx49(
2445
+ Button,
2446
+ {
2447
+ variant: "ghost",
2448
+ size: "icon",
2449
+ className: "border border-gray-400",
2450
+ children: /* @__PURE__ */ jsx49(Search, { className: "h-5 w-5 text-gray-400" })
2451
+ }
2452
+ ),
2453
+ /* @__PURE__ */ jsxs30("div", { className: "relative bg-[#E9E9E9] rounded-md", children: [
2454
+ /* @__PURE__ */ jsx49(Button, { variant: "ghost", size: "icon", children: /* @__PURE__ */ jsx49(Bell, { className: "h-5 w-5 text-[#1C1B1F]" }) }),
2455
+ badgeType === "number" && !(hideBadgeWhenZero && badgeCount === 0) && badgeCount > 0 ? /* @__PURE__ */ jsx49("span", { className: "absolute -top-1 -right-1 flex h-4 w-4 items-center justify-center rounded-full bg-red-500 text-[10px] text-white leading-8", children: badgeCount }) : /* @__PURE__ */ jsx49("span", { className: "absolute -top-1 -right-1 flex h-2 w-2 items-center justify-center rounded-full bg-red-500" })
2456
+ ] }),
2457
+ /* @__PURE__ */ jsxs30(DropdownMenu, { children: [
2458
+ /* @__PURE__ */ jsx49(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs30("div", { className: "flex items-center space-x-2", children: [
2459
+ !isMobileView && showName && /* @__PURE__ */ jsx49("h4", { className: "text-[#000000] text-[13px] font-[500] mb-0", children: userName }),
2460
+ !isMobileView ? /* @__PURE__ */ jsxs30(Fragment17, { children: [
2461
+ /* @__PURE__ */ jsx49(Avatar, { className: "cursor-pointer h-8 w-8 text-gray-900", children: profileType === "avatar" ? /* @__PURE__ */ jsx49(
2462
+ AvatarImage,
2463
+ {
2464
+ src: "/images/appbuilder/toolset/profile.svg",
2465
+ alt: "Profile"
2466
+ }
2467
+ ) : /* @__PURE__ */ jsx49("div", { className: "w-8 h-8 bg-[#12715b] rounded-full text-[#fff] text-center text-[11px] flex items-center justify-center", children: userName && getInitials(userName) }) }),
2468
+ /* @__PURE__ */ jsx49(
2469
+ Button,
2470
+ {
2471
+ variant: "ghost",
2472
+ size: "icon",
2473
+ className: "text-gray-900 md:hidden",
2474
+ children: /* @__PURE__ */ jsx49(Menu, { className: "h-6 w-6" })
2475
+ }
2476
+ )
2477
+ ] }) : /* @__PURE__ */ jsx49(
2478
+ Button,
2479
+ {
2480
+ variant: "ghost",
2481
+ size: "icon",
2482
+ className: "text-gray-900",
2483
+ children: /* @__PURE__ */ jsx49(Menu, { className: "h-6 w-6" })
2484
+ }
2485
+ )
2486
+ ] }) }),
2487
+ /* @__PURE__ */ jsxs30(DropdownMenuContent, { align: "end", className: "bg-white", children: [
2488
+ /* @__PURE__ */ jsx49(DropdownMenuLabel, { className: "text-black", children: "My Account" }),
2489
+ /* @__PURE__ */ jsx49(DropdownMenuSeparator, {}),
2490
+ LinkComponent && /* @__PURE__ */ jsxs30(Fragment17, { children: [
2491
+ /* @__PURE__ */ jsx49(DropdownMenuItem, { className: "text-black", children: /* @__PURE__ */ jsx49(LinkComponent, { href: "/profile", children: "Profile" }) }),
2492
+ /* @__PURE__ */ jsx49(DropdownMenuItem, { className: "text-black", children: /* @__PURE__ */ jsx49(LinkComponent, { href: "/settings", children: "Settings" }) }),
2493
+ /* @__PURE__ */ jsx49(DropdownMenuItem, { className: "text-black", children: /* @__PURE__ */ jsx49(LinkComponent, { href: "/logout", children: "Logout" }) }),
2494
+ list && list.length > 0 && /* @__PURE__ */ jsxs30(Fragment17, { children: [
2495
+ /* @__PURE__ */ jsx49("div", { className: "w-full bg-[#656565] opacity-30 h-[1px] my-2" }),
2496
+ /* @__PURE__ */ jsx49(DropdownMenuLabel, { className: "text-black", children: "Main Menu" }),
2497
+ list.map((item) => /* @__PURE__ */ jsx49(DropdownMenuItem, { className: "text-black", children: /* @__PURE__ */ jsx49(LinkComponent, { href: item.url || "#", children: item.header }) }, item.id))
2498
+ ] })
2499
+ ] })
2500
+ ] })
2501
+ ] })
2502
+ ] })
2503
+ ] }) });
2504
+ }
2505
+
2506
+ // src/components/Navigation/Profile/Profile.tsx
2507
+ import { jsx as jsx50, jsxs as jsxs31 } from "react/jsx-runtime";
2508
+
2509
+ // src/components/Navigation/Notification/Notification.tsx
2510
+ import { jsx as jsx51, jsxs as jsxs32 } from "react/jsx-runtime";
2511
+
2512
+ // src/components/Navigation/Logo/Logo.tsx
2513
+ import { jsx as jsx52 } from "react/jsx-runtime";
2514
+
2515
+ // src/components/Chart/BarChart.tsx
2516
+ import { BarChart, Bar, Area, AreaChart, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, Legend } from "recharts";
2517
+ import { jsx as jsx53, jsxs as jsxs33 } from "react/jsx-runtime";
2518
+ var ChartComponent = ({ className, style, ...props }) => {
2519
+ const data = Array.isArray(props?.data) ? props.data : [];
2520
+ const chartType = props.chartType || "bar";
2521
+ const legendsPosition = props.legendsPosition === "middle" || props.legendsPosition === "bottom" ? props.legendsPosition : "top";
2522
+ return /* @__PURE__ */ jsx53("div", { className: `${className} h-[400px]`, style, children: data.length > 0 && /* @__PURE__ */ jsx53(ResponsiveContainer, { width: "100%", height: "100%", children: chartType === "bar" ? /* @__PURE__ */ jsxs33(BarChart, { data, children: [
2523
+ /* @__PURE__ */ jsx53(CartesianGrid, { strokeDasharray: "3 3" }),
2524
+ /* @__PURE__ */ jsx53(XAxis, { dataKey: "name" }),
2525
+ /* @__PURE__ */ jsx53(YAxis, {}),
2526
+ /* @__PURE__ */ jsx53(Tooltip, {}),
2527
+ /* @__PURE__ */ jsx53(Legend, { verticalAlign: legendsPosition, align: "center" }),
2528
+ /* @__PURE__ */ jsx53(Bar, { dataKey: "value", fill: "#00695C" })
2529
+ ] }) : /* @__PURE__ */ jsxs33(AreaChart, { data, children: [
2530
+ /* @__PURE__ */ jsx53("defs", { children: /* @__PURE__ */ jsxs33("linearGradient", { id: "colorCount", x1: "0", y1: "0", x2: "0", y2: "1", children: [
2531
+ /* @__PURE__ */ jsx53("stop", { offset: "5%", stopColor: "#00695C", stopOpacity: 0.8 }),
2532
+ /* @__PURE__ */ jsx53("stop", { offset: "95%", stopColor: "#00695C", stopOpacity: 0 })
2533
+ ] }) }),
2534
+ /* @__PURE__ */ jsx53(CartesianGrid, { strokeDasharray: "3 3" }),
2535
+ /* @__PURE__ */ jsx53(XAxis, { dataKey: "name" }),
2536
+ /* @__PURE__ */ jsx53(YAxis, {}),
2537
+ /* @__PURE__ */ jsx53(Tooltip, {}),
2538
+ /* @__PURE__ */ jsx53(
2539
+ Area,
2540
+ {
2541
+ type: "monotone",
2542
+ dataKey: "value",
2543
+ stroke: "#00695C",
2544
+ fillOpacity: 1,
2545
+ fill: "url(#colorCount)"
2546
+ }
2547
+ )
2548
+ ] }) }) });
2549
+ };
2550
+ var BarChart_default = ChartComponent;
2551
+
2552
+ // src/components/Chart/PieChart.tsx
2553
+ import { PieChart, Pie, Cell, ResponsiveContainer as ResponsiveContainer2, Tooltip as Tooltip2, LabelList } from "recharts";
2554
+ import { Fragment as Fragment18, jsx as jsx54, jsxs as jsxs34 } from "react/jsx-runtime";
2555
+ var DonutChart = ({ className, style, ...props }) => {
2556
+ const data = Array.isArray(props?.data) ? props.data : [];
2557
+ const total = data.reduce((sum, d) => sum + d.value, 0);
2558
+ const showPercentage = props.showPercentage ?? true;
2559
+ const showLegends = props.showLegends ?? true;
2560
+ const labelType = props.labelType || "inside";
2561
+ const canvasMode = props.canvasMode;
2562
+ const renderLabel = ({ value, x, y }) => {
2563
+ if (value == null) return null;
2564
+ const percentage = (Number(value) / total * 100).toFixed(0);
2565
+ return /* @__PURE__ */ jsxs34(
2566
+ "text",
2567
+ {
2568
+ x,
2569
+ y,
2570
+ textAnchor: "middle",
2571
+ dominantBaseline: "central",
2572
+ className: "text-[10px] font-semibold",
2573
+ fill: labelType === "inside" ? "#fff" : "#000",
2574
+ children: [
2575
+ value,
2576
+ "k ",
2577
+ showPercentage ? `(${percentage}%)` : ""
2578
+ ]
2579
+ }
2580
+ );
2581
+ };
2582
+ const forceMobile = canvasMode === "mobile" || canvasMode === "tablet";
2583
+ const forceDesktop = canvasMode === "desktop";
2584
+ const wrapperClass = canvasMode ? forceDesktop ? "flex-row" : "flex-col" : "flex-col md:flex-row";
2585
+ const renderLegends = () => {
2586
+ if (!showLegends) return null;
2587
+ return /* @__PURE__ */ jsx54(Fragment18, { children: data.map((d) => /* @__PURE__ */ jsxs34(
2588
+ "div",
2589
+ {
2590
+ className: "flex items-center space-x-2 rounded-md border border-gray-200 px-3 py-2 w-[48%] md:w-auto",
2591
+ children: [
2592
+ /* @__PURE__ */ jsx54(
2593
+ "span",
2594
+ {
2595
+ className: "inline-block w-[16px] h-[16px] rounded",
2596
+ style: { backgroundColor: d.color }
2597
+ }
2598
+ ),
2599
+ /* @__PURE__ */ jsx54("span", { className: "text-[#000000] text-[12px] md:text-[13px] font-[500]", children: d.name })
2600
+ ]
2601
+ },
2602
+ d.name
2603
+ )) });
2604
+ };
2605
+ return /* @__PURE__ */ jsxs34(
2606
+ "div",
2607
+ {
2608
+ className: `relative flex items-center ${wrapperClass} ${className}`,
2609
+ style,
2610
+ children: [
2611
+ /* @__PURE__ */ jsxs34("div", { className: "relative w-full md:w-[70%] h-[300px] md:h-[400px] flex items-center justify-center", children: [
2612
+ data.length > 0 && /* @__PURE__ */ jsx54(ResponsiveContainer2, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs34(PieChart, { children: [
2613
+ /* @__PURE__ */ jsxs34(
2614
+ Pie,
2615
+ {
2616
+ data,
2617
+ cx: "50%",
2618
+ cy: "50%",
2619
+ innerRadius: 70,
2620
+ outerRadius: 120,
2621
+ dataKey: "value",
2622
+ labelLine: false,
2623
+ isAnimationActive: false,
2624
+ children: [
2625
+ data.map((entry, index) => /* @__PURE__ */ jsx54(Cell, { fill: entry.color }, `cell-${index}`)),
2626
+ /* @__PURE__ */ jsx54(
2627
+ LabelList,
2628
+ {
2629
+ dataKey: "value",
2630
+ position: labelType === "inside" ? "inside" : "outside",
2631
+ content: renderLabel
2632
+ }
2633
+ )
2634
+ ]
2635
+ }
2636
+ ),
2637
+ /* @__PURE__ */ jsx54(Tooltip2, { formatter: (value, name) => [`${value}k`, name] })
2638
+ ] }) }),
2639
+ /* @__PURE__ */ jsxs34("div", { className: "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 text-2xl md:text-4xl font-bold text-[#000]", children: [
2640
+ total,
2641
+ "k"
2642
+ ] })
2643
+ ] }),
2644
+ /* @__PURE__ */ jsx54("div", { className: `flex ${forceDesktop ? "flex-col ml-auto space-y-3" : "flex-wrap justify-center gap-2 mt-4"}
2645
+ w-full md:w-auto`, children: renderLegends() })
2646
+ ]
2647
+ }
2648
+ );
2649
+ };
2650
+ var PieChart_default = DonutChart;
2651
+
2652
+ // src/components/Blocks/EmailComposer.tsx
2653
+ import { jsx as jsx55, jsxs as jsxs35 } from "react/jsx-runtime";
2654
+ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc, setShowBcc, cc, setCc, bcc, setBcc, subject, setSubject, body, setBody }) {
2655
+ return /* @__PURE__ */ jsx55("div", { className, style, children: /* @__PURE__ */ jsxs35("div", { className: "border rounded-md shadow bg-[#fff] p-4 mx-auto z-[50] relative", children: [
2656
+ /* @__PURE__ */ jsx55("div", { className: "mb-3", children: /* @__PURE__ */ jsx55(
2657
+ "input",
2658
+ {
2659
+ type: "email",
2660
+ placeholder: "From",
2661
+ className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]",
2662
+ required: true
2663
+ }
2664
+ ) }),
2665
+ /* @__PURE__ */ jsx55("div", { className: "mb-3", children: /* @__PURE__ */ jsxs35("div", { className: "flex items-center gap-2", children: [
2666
+ /* @__PURE__ */ jsx55(
2667
+ "input",
2668
+ {
2669
+ type: "email",
2670
+ value: to,
2671
+ onChange: (e) => setTo?.(e.target.value),
2672
+ placeholder: "To",
2673
+ className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]",
2674
+ required: true
2675
+ }
2676
+ ),
2677
+ !showCc && /* @__PURE__ */ jsx55(
2678
+ "button",
2679
+ {
2680
+ onClick: () => setShowCc?.(true),
2681
+ className: "px-3 py-1 border rounded-md text-sm hover:bg-gray-100 bg-[#E9E9E9] text-[#383838]",
2682
+ children: "Cc"
2683
+ }
2684
+ ),
2685
+ !showBcc && /* @__PURE__ */ jsx55(
2686
+ "button",
2687
+ {
2688
+ onClick: () => setShowBcc?.(true),
2689
+ className: "px-3 py-1 border rounded-md text-sm hover:bg-gray-100 bg-[#E9E9E9] text-[#383838]",
2690
+ children: "Bcc"
2691
+ }
2692
+ )
2693
+ ] }) }),
2694
+ showCc && /* @__PURE__ */ jsx55("div", { className: "mb-3", children: /* @__PURE__ */ jsx55(
2695
+ "input",
2696
+ {
2697
+ type: "text",
2698
+ value: cc,
2699
+ onChange: (e) => setCc?.(e.target.value),
2700
+ placeholder: "Cc",
2701
+ className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
2702
+ }
2703
+ ) }),
2704
+ showBcc && /* @__PURE__ */ jsx55("div", { className: "mb-3", children: /* @__PURE__ */ jsx55(
2705
+ "input",
2706
+ {
2707
+ type: "text",
2708
+ value: bcc,
2709
+ onChange: (e) => setBcc?.(e.target.value),
2710
+ placeholder: "Bcc",
2711
+ className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
2712
+ }
2713
+ ) }),
2714
+ /* @__PURE__ */ jsx55("div", { className: "mb-3", children: /* @__PURE__ */ jsx55(
2715
+ "input",
2716
+ {
2717
+ type: "text",
2718
+ value: subject,
2719
+ onChange: (e) => setSubject?.(e.target.value),
2720
+ placeholder: "Subject",
2721
+ className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
2722
+ }
2723
+ ) }),
2724
+ /* @__PURE__ */ jsx55("div", { className: "mb-4", children: /* @__PURE__ */ jsx55(MyEditor, { value: body, onChange: setBody }) }),
2725
+ /* @__PURE__ */ jsxs35("div", { className: "flex justify-end gap-2", children: [
2726
+ /* @__PURE__ */ jsx55("button", { className: "px-4 py-2 rounded-md text-gray-600 hover:bg-gray-100", children: "Discard" }),
2727
+ /* @__PURE__ */ jsx55("button", { className: "px-4 py-2 rounded-md border text-[#12715B] border-[#12715B]", children: "Reset" }),
2728
+ /* @__PURE__ */ jsx55("button", { className: "px-4 py-2 rounded-md bg-[#12715B] text-white", children: "Send" })
2729
+ ] })
2730
+ ] }) });
2731
+ }
2732
+
2733
+ // src/components/ui/sonner-toast.tsx
2734
+ import { toast } from "sonner";
2735
+ function showSonnerToast({
2736
+ title,
2737
+ description,
2738
+ variant = "default",
2739
+ duration = 3e3,
2740
+ actionLabel,
2741
+ onAction
2742
+ }) {
2743
+ const options = {
2744
+ description,
2745
+ duration,
2746
+ action: actionLabel ? {
2747
+ label: actionLabel,
2748
+ onClick: onAction || (() => {
2749
+ })
2750
+ } : void 0
2751
+ };
2752
+ switch (variant) {
2753
+ case "success":
2754
+ toast.success(title, options);
2755
+ break;
2756
+ case "error":
2757
+ toast.error(title, options);
2758
+ break;
2759
+ case "info":
2760
+ toast.info(title, options);
2761
+ break;
2762
+ case "warning":
2763
+ toast.warning(title, options);
2764
+ break;
2765
+ default:
2766
+ toast(title, options);
2767
+ }
2768
+ }
2769
+
2770
+ // src/components/StateManagment/stateReducer.ts
2771
+ function stateReducer(state, action) {
2772
+ switch (action.type) {
2773
+ case "SET_STATE":
2774
+ return { ...state, [action.key]: action.value };
2775
+ default:
2776
+ return state;
2777
+ }
2778
+ }
2779
+
2780
+ // src/components/StateManagment/StateContext.tsx
2781
+ import { createContext, useContext, useReducer } from "react";
2782
+ import { jsx as jsx56 } from "react/jsx-runtime";
2783
+ var StateContext = createContext(null);
2784
+ function StateProvider({ children }) {
2785
+ const [state, dispatch] = useReducer(stateReducer, {});
2786
+ return /* @__PURE__ */ jsx56(StateContext.Provider, { value: { state, dispatch }, children });
2787
+ }
2788
+ function useAppState() {
2789
+ return useContext(StateContext);
2790
+ }
2791
+
2792
+ // src/components/Form/Form.tsx
2793
+ import React7, { useMemo as useMemo2 } from "react";
2794
+ import { zodResolver } from "@hookform/resolvers/zod";
2795
+ import { useForm, Controller } from "react-hook-form";
2796
+ import { z } from "zod";
2797
+ import { jsx as jsx57 } from "react/jsx-runtime";
2798
+ function generateZodSchema(data) {
2799
+ const fields = data.reduce((acc, f) => {
2800
+ const name = f.name || "unnamed";
2801
+ const message = f.message || `${name} is invalid`;
2802
+ const passwordLen = f.passwordLength;
2803
+ let fieldSchema = z.string({ message });
2804
+ switch (f.type) {
2805
+ case "Text":
2806
+ case "Search":
2807
+ fieldSchema = z.string({ message });
2808
+ if (f?.min && f?.min !== "") fieldSchema = fieldSchema.min(f.min);
2809
+ else if (f.isRequired) fieldSchema = fieldSchema.min(1, { message: `${message}. Cannot be empty` });
2810
+ if (f?.max && f?.max !== "") fieldSchema = fieldSchema.max(f.max);
2811
+ if (f?.email) fieldSchema = fieldSchema.email();
2812
+ if (f?.url) fieldSchema = fieldSchema.url();
2813
+ if (f?.regex) fieldSchema = fieldSchema.regex(new RegExp(f.regex));
2814
+ break;
2815
+ case "Email":
2816
+ fieldSchema = z.email({ message });
2817
+ break;
2818
+ case "Password":
2819
+ fieldSchema = z.string({ message }).min(passwordLen, { message: `Password must be at least ${passwordLen} characters long` });
2820
+ break;
2821
+ case "Phone":
2822
+ fieldSchema = z.string().transform((val) => val.replace(/\D/g, "")).transform((val) => val.slice(-10)).refine((val) => {
2823
+ return val.length === 10;
2824
+ }, {
2825
+ message: "Phone number must be 10 digits long"
2826
+ });
2827
+ break;
2828
+ case "DatePicker":
2829
+ fieldSchema = z.iso.date({ message });
2830
+ break;
2831
+ case "FileInput":
2832
+ fieldSchema = z.instanceof(File, { message: "Please select a file" });
2833
+ if (f?.maxSize) {
2834
+ fieldSchema = fieldSchema.refine(
2835
+ (file) => file.size <= f.maxSize,
2836
+ { message: `File size must be less than ${f.maxSize / 1024 / 1024}MB` }
2837
+ );
2838
+ }
2839
+ if (f?.acceptedTypes) {
2840
+ fieldSchema = fieldSchema.refine(
2841
+ (file) => f.acceptedTypes.includes(file.type),
2842
+ { message: `File type must be one of: ${f.acceptedTypes.join(", ")}` }
2843
+ );
2844
+ }
2845
+ break;
2846
+ case "Checkbox":
2847
+ fieldSchema = z.boolean({ message });
2848
+ break;
2849
+ case "Dropdown":
2850
+ fieldSchema = z.string({ message });
2851
+ break;
2852
+ case "NumberInput":
2853
+ fieldSchema = z.number({ message });
2854
+ if (f?.min !== void 0) fieldSchema = fieldSchema.min(f.min);
2855
+ if (f?.max !== void 0) fieldSchema = fieldSchema.max(f.max);
2856
+ break;
2857
+ default:
2858
+ fieldSchema = z.any();
2859
+ }
2860
+ if (!f.isRequired) fieldSchema = fieldSchema.optional();
2861
+ acc[name] = fieldSchema;
2862
+ return acc;
2863
+ }, {});
2864
+ return z.object(fields);
2865
+ }
2866
+ var Form = ({
2867
+ validation,
2868
+ defaultValues,
2869
+ children,
2870
+ onSubmit,
2871
+ onReset
2872
+ }) => {
2873
+ const schema = useMemo2(() => {
2874
+ if (!validation || validation.length === 0) return null;
2875
+ return generateZodSchema(validation);
2876
+ }, [validation]);
2877
+ const {
2878
+ handleSubmit,
2879
+ control,
2880
+ formState: { errors },
2881
+ reset
2882
+ } = useForm({
2883
+ resolver: schema ? zodResolver(schema) : void 0,
2884
+ defaultValues
2885
+ });
2886
+ const formSubmit = (data) => {
2887
+ if (onSubmit) onSubmit(data);
2888
+ };
2889
+ const handleReset = () => {
2890
+ reset();
2891
+ if (onReset) onReset();
2892
+ };
2893
+ return /* @__PURE__ */ jsx57(
2894
+ "form",
2895
+ {
2896
+ onSubmit: handleSubmit(formSubmit),
2897
+ onReset: handleReset,
2898
+ className: cn(
2899
+ "space-y-4 min-h-[100px] h-auto flex justify-between flex-col"
2900
+ ),
2901
+ children: /* @__PURE__ */ jsx57("div", { className: "min-h-[50px]", children: React7.Children.map(children, (child) => {
2902
+ const processChild = (child2) => {
2903
+ if (React7.isValidElement(child2)) {
2904
+ const node = child2.props?.node;
2905
+ if (node?.category === "Form Controls") {
2906
+ const name = node.properties?.name || "unnamed";
2907
+ return /* @__PURE__ */ jsx57("div", { className: "flex flex-col", children: /* @__PURE__ */ jsx57(
2908
+ Controller,
2909
+ {
2910
+ name,
2911
+ control,
2912
+ render: ({ field: controllerField }) => {
2913
+ const childElement = child2;
2914
+ return React7.cloneElement(childElement, {
2915
+ input: {
2916
+ ...controllerField,
2917
+ value: controllerField.value || "",
2918
+ hasFormContainer: true,
2919
+ validateOnMount: true,
2920
+ errorMessage: errors[name]?.message || null
2921
+ },
2922
+ children: void 0
2923
+ });
2924
+ }
2925
+ }
2926
+ ) }, node.id);
2927
+ }
2928
+ if (child2.props?.children) {
2929
+ const childElement = child2;
2930
+ return React7.cloneElement(childElement, {
2931
+ children: React7.Children.map(childElement.props.children, processChild)
2932
+ });
2933
+ }
2934
+ return React7.cloneElement(child2);
2935
+ }
2936
+ return child2;
2937
+ };
2938
+ return processChild(child);
2939
+ }) })
2940
+ }
2941
+ );
2942
+ };
2943
+ var Form_default = Form;
2944
+
2945
+ // src/components/Form/Wrapper.tsx
2946
+ import { useMemo as useMemo3 } from "react";
2947
+ import { zodResolver as zodResolver2 } from "@hookform/resolvers/zod";
2948
+ import { useForm as useForm2 } from "react-hook-form";
2949
+ import { z as z2 } from "zod";
2950
+ import { jsx as jsx58 } from "react/jsx-runtime";
2951
+ function generateZodSchema2(data) {
2952
+ const fields = data.reduce((acc, f) => {
2953
+ const name = f.name || "unnamed";
2954
+ const message = f.message || `${name} is invalid`;
2955
+ const passwordLen = f.passwordLength;
2956
+ let fieldSchema = z2.string({ message });
2957
+ switch (f.type) {
2958
+ case "Text":
2959
+ case "Search":
2960
+ fieldSchema = z2.string({ message });
2961
+ if (f?.min && f?.min !== "") fieldSchema = fieldSchema.min(f.min);
2962
+ else if (f.isRequired) fieldSchema = fieldSchema.min(1, { message: `${message}. Cannot be empty` });
2963
+ if (f?.max && f?.max !== "") fieldSchema = fieldSchema.max(f.max);
2964
+ if (f?.email) fieldSchema = fieldSchema.email();
2965
+ if (f?.url) fieldSchema = fieldSchema.url();
2966
+ if (f?.regex) fieldSchema = fieldSchema.regex(new RegExp(f.regex));
2967
+ break;
2968
+ case "Email":
2969
+ fieldSchema = z2.email({ message });
2970
+ break;
2971
+ case "Password":
2972
+ fieldSchema = z2.string({ message }).min(passwordLen, { message: `Password must be at least ${passwordLen} characters long` });
2973
+ break;
2974
+ case "Phone":
2975
+ fieldSchema = z2.string().transform((val) => val.replace(/\D/g, "")).transform((val) => val.slice(-10)).refine((val) => {
2976
+ return val.length === 10;
2977
+ }, {
2978
+ message: "Phone number must be 10 digits long"
2979
+ });
2980
+ break;
2981
+ case "DatePicker":
2982
+ fieldSchema = z2.iso.date({ message });
2983
+ break;
2984
+ case "FileInput":
2985
+ fieldSchema = z2.instanceof(File, { message: "Please select a file" });
2986
+ if (f?.maxSize) {
2987
+ fieldSchema = fieldSchema.refine(
2988
+ (file) => file.size <= f.maxSize,
2989
+ { message: `File size must be less than ${f.maxSize / 1024 / 1024}MB` }
2990
+ );
2991
+ }
2992
+ if (f?.acceptedTypes) {
2993
+ fieldSchema = fieldSchema.refine(
2994
+ (file) => f.acceptedTypes.includes(file.type),
2995
+ { message: `File type must be one of: ${f.acceptedTypes.join(", ")}` }
2996
+ );
2997
+ }
2998
+ break;
2999
+ case "Checkbox":
3000
+ fieldSchema = z2.boolean({ message });
3001
+ break;
3002
+ case "Dropdown":
3003
+ fieldSchema = z2.string({ message });
3004
+ break;
3005
+ case "NumberInput":
3006
+ fieldSchema = z2.number({ message });
3007
+ if (f?.min !== void 0) fieldSchema = fieldSchema.min(f.min);
3008
+ if (f?.max !== void 0) fieldSchema = fieldSchema.max(f.max);
3009
+ break;
3010
+ default:
3011
+ fieldSchema = z2.any();
3012
+ }
3013
+ if (!f.isRequired) fieldSchema = fieldSchema.optional();
3014
+ acc[name] = fieldSchema;
3015
+ return acc;
3016
+ }, {});
3017
+ return z2.object(fields);
3018
+ }
3019
+ var FormWrapper = ({
3020
+ validation,
3021
+ defaultValues,
3022
+ children,
3023
+ onSubmit,
3024
+ onReset
3025
+ }) => {
3026
+ const schema = useMemo3(() => {
3027
+ if (!validation || validation.length === 0) return null;
3028
+ return generateZodSchema2(validation);
3029
+ }, [validation]);
3030
+ const form = useForm2({
3031
+ resolver: schema ? zodResolver2(schema) : void 0,
3032
+ defaultValues
3033
+ });
3034
+ const formSubmit = (data) => {
3035
+ if (onSubmit) onSubmit(data);
3036
+ };
3037
+ const handleReset = () => {
3038
+ form.reset();
3039
+ if (onReset) onReset();
3040
+ };
3041
+ return /* @__PURE__ */ jsx58(
3042
+ "form",
3043
+ {
3044
+ onSubmit: form.handleSubmit(formSubmit),
3045
+ onReset: handleReset,
3046
+ className: cn(
3047
+ "space-y-4 min-h-[100px] h-auto flex justify-between flex-col"
3048
+ ),
3049
+ children: /* @__PURE__ */ jsx58("div", { className: "min-h-[50px]", children: typeof children === "function" ? children(form) : children })
3050
+ }
3051
+ );
3052
+ };
3053
+ var Wrapper_default = FormWrapper;
3054
+
3055
+ export {
3056
+ Modal_default,
3057
+ Flex_default,
3058
+ Grid_default,
3059
+ Container_default,
3060
+ cn,
3061
+ getInitials,
3062
+ Button_default,
3063
+ Image_default,
3064
+ Shape_default,
3065
+ Typography_default,
3066
+ Breadcrumb_default,
3067
+ SplitButton,
3068
+ TextInput_default,
3069
+ NumberInput_default,
3070
+ EmailInput_default,
3071
+ PasswordInput_default,
3072
+ Textarea_default,
3073
+ UrlInput_default,
3074
+ Checkbox_default,
3075
+ RadioInput_default,
3076
+ MultiCheckbox_default,
3077
+ RichText,
3078
+ Dropdown_default,
3079
+ SwitchToggle_default,
3080
+ PhoneInput_default,
3081
+ SearchInput_default,
3082
+ FileInput_default,
3083
+ DatePicker,
3084
+ DateRange_default,
3085
+ TextInputGroup_default,
3086
+ Pagination_default,
3087
+ Table_default,
3088
+ Tabs_default,
3089
+ Stages_default,
3090
+ Spacer_default,
3091
+ Navbar,
3092
+ BarChart_default,
3093
+ PieChart_default,
3094
+ EmailComposer,
3095
+ showSonnerToast,
3096
+ stateReducer,
3097
+ StateProvider,
3098
+ useAppState,
3099
+ Form_default,
3100
+ Wrapper_default
3101
+ };
3102
+ /*! Bundled license information:
3103
+
3104
+ lucide-react/dist/esm/shared/src/utils.js:
3105
+ lucide-react/dist/esm/defaultAttributes.js:
3106
+ lucide-react/dist/esm/Icon.js:
3107
+ lucide-react/dist/esm/createLucideIcon.js:
3108
+ lucide-react/dist/esm/icons/bell.js:
3109
+ lucide-react/dist/esm/icons/calculator.js:
3110
+ lucide-react/dist/esm/icons/calendar.js:
3111
+ lucide-react/dist/esm/icons/check.js:
3112
+ lucide-react/dist/esm/icons/chevron-down.js:
3113
+ lucide-react/dist/esm/icons/chevron-left.js:
3114
+ lucide-react/dist/esm/icons/chevron-right.js:
3115
+ lucide-react/dist/esm/icons/chevron-up.js:
3116
+ lucide-react/dist/esm/icons/circle.js:
3117
+ lucide-react/dist/esm/icons/ellipsis.js:
3118
+ lucide-react/dist/esm/icons/mail.js:
3119
+ lucide-react/dist/esm/icons/menu.js:
3120
+ lucide-react/dist/esm/icons/scan-eye.js:
3121
+ lucide-react/dist/esm/icons/search.js:
3122
+ lucide-react/dist/esm/lucide-react.js:
3123
+ (**
3124
+ * @license lucide-react v0.542.0 - ISC
3125
+ *
3126
+ * This source code is licensed under the ISC license.
3127
+ * See the LICENSE file in the root directory of this source tree.
3128
+ *)
3129
+ */
3130
+ //# sourceMappingURL=chunk-JFDQZCMW.mjs.map