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