@algorithm-shift/design-system 1.2.73 → 1.2.75
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/client.d.mts +4 -4
- package/dist/client.d.ts +4 -4
- package/dist/index.css +116 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +31 -8
- package/dist/index.d.ts +31 -8
- package/dist/index.js +539 -337
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +555 -354
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
package/dist/index.mjs
CHANGED
|
@@ -28268,8 +28268,321 @@ var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
|
|
|
28268
28268
|
};
|
|
28269
28269
|
var TextInputGroup_default = TextInputGroup;
|
|
28270
28270
|
|
|
28271
|
-
// src/components/
|
|
28271
|
+
// src/components/Inputs/Multiselect/MultiSelect.tsx
|
|
28272
28272
|
import * as React7 from "react";
|
|
28273
|
+
|
|
28274
|
+
// src/components/ui/command.tsx
|
|
28275
|
+
import { Command as CommandPrimitive } from "cmdk";
|
|
28276
|
+
|
|
28277
|
+
// src/components/ui/dialog.tsx
|
|
28278
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
28279
|
+
import { jsx as jsx46, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
28280
|
+
function Dialog({
|
|
28281
|
+
...props
|
|
28282
|
+
}) {
|
|
28283
|
+
return /* @__PURE__ */ jsx46(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
28284
|
+
}
|
|
28285
|
+
function DialogPortal({
|
|
28286
|
+
...props
|
|
28287
|
+
}) {
|
|
28288
|
+
return /* @__PURE__ */ jsx46(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
|
|
28289
|
+
}
|
|
28290
|
+
function DialogOverlay({
|
|
28291
|
+
className,
|
|
28292
|
+
...props
|
|
28293
|
+
}) {
|
|
28294
|
+
return /* @__PURE__ */ jsx46(
|
|
28295
|
+
DialogPrimitive.Overlay,
|
|
28296
|
+
{
|
|
28297
|
+
"data-slot": "dialog-overlay",
|
|
28298
|
+
className: cn(
|
|
28299
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-[60] bg-black/50",
|
|
28300
|
+
className
|
|
28301
|
+
),
|
|
28302
|
+
...props
|
|
28303
|
+
}
|
|
28304
|
+
);
|
|
28305
|
+
}
|
|
28306
|
+
function DialogContent({
|
|
28307
|
+
className,
|
|
28308
|
+
children,
|
|
28309
|
+
showCloseButton = true,
|
|
28310
|
+
...props
|
|
28311
|
+
}) {
|
|
28312
|
+
return /* @__PURE__ */ jsxs26(DialogPortal, { "data-slot": "dialog-portal", children: [
|
|
28313
|
+
/* @__PURE__ */ jsx46(DialogOverlay, {}),
|
|
28314
|
+
/* @__PURE__ */ jsxs26(
|
|
28315
|
+
DialogPrimitive.Content,
|
|
28316
|
+
{
|
|
28317
|
+
"data-slot": "dialog-content",
|
|
28318
|
+
className: cn(
|
|
28319
|
+
"bg-background 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 fixed top-[50%] left-[50%] z-[70] grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
|
|
28320
|
+
className
|
|
28321
|
+
),
|
|
28322
|
+
...props,
|
|
28323
|
+
children: [
|
|
28324
|
+
children,
|
|
28325
|
+
showCloseButton && /* @__PURE__ */ jsxs26(
|
|
28326
|
+
DialogPrimitive.Close,
|
|
28327
|
+
{
|
|
28328
|
+
"data-slot": "dialog-close",
|
|
28329
|
+
className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
28330
|
+
children: [
|
|
28331
|
+
/* @__PURE__ */ jsx46(X, {}),
|
|
28332
|
+
/* @__PURE__ */ jsx46("span", { className: "sr-only", children: "Close" })
|
|
28333
|
+
]
|
|
28334
|
+
}
|
|
28335
|
+
)
|
|
28336
|
+
]
|
|
28337
|
+
}
|
|
28338
|
+
)
|
|
28339
|
+
] });
|
|
28340
|
+
}
|
|
28341
|
+
function DialogHeader({ className, ...props }) {
|
|
28342
|
+
return /* @__PURE__ */ jsx46(
|
|
28343
|
+
"div",
|
|
28344
|
+
{
|
|
28345
|
+
"data-slot": "dialog-header",
|
|
28346
|
+
className: cn("flex flex-col gap-2 text-center sm:text-left", className),
|
|
28347
|
+
...props
|
|
28348
|
+
}
|
|
28349
|
+
);
|
|
28350
|
+
}
|
|
28351
|
+
function DialogFooter({ className, ...props }) {
|
|
28352
|
+
return /* @__PURE__ */ jsx46(
|
|
28353
|
+
"div",
|
|
28354
|
+
{
|
|
28355
|
+
"data-slot": "dialog-footer",
|
|
28356
|
+
className: cn(
|
|
28357
|
+
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
28358
|
+
className
|
|
28359
|
+
),
|
|
28360
|
+
...props
|
|
28361
|
+
}
|
|
28362
|
+
);
|
|
28363
|
+
}
|
|
28364
|
+
function DialogTitle({
|
|
28365
|
+
className,
|
|
28366
|
+
...props
|
|
28367
|
+
}) {
|
|
28368
|
+
return /* @__PURE__ */ jsx46(
|
|
28369
|
+
DialogPrimitive.Title,
|
|
28370
|
+
{
|
|
28371
|
+
"data-slot": "dialog-title",
|
|
28372
|
+
className: cn("text-lg leading-none font-semibold", className),
|
|
28373
|
+
...props
|
|
28374
|
+
}
|
|
28375
|
+
);
|
|
28376
|
+
}
|
|
28377
|
+
function DialogDescription({
|
|
28378
|
+
className,
|
|
28379
|
+
...props
|
|
28380
|
+
}) {
|
|
28381
|
+
return /* @__PURE__ */ jsx46(
|
|
28382
|
+
DialogPrimitive.Description,
|
|
28383
|
+
{
|
|
28384
|
+
"data-slot": "dialog-description",
|
|
28385
|
+
className: cn("text-muted-foreground text-sm", className),
|
|
28386
|
+
...props
|
|
28387
|
+
}
|
|
28388
|
+
);
|
|
28389
|
+
}
|
|
28390
|
+
|
|
28391
|
+
// src/components/ui/command.tsx
|
|
28392
|
+
import { jsx as jsx47, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
28393
|
+
function Command2({
|
|
28394
|
+
className,
|
|
28395
|
+
...props
|
|
28396
|
+
}) {
|
|
28397
|
+
return /* @__PURE__ */ jsx47(
|
|
28398
|
+
CommandPrimitive,
|
|
28399
|
+
{
|
|
28400
|
+
"data-slot": "command",
|
|
28401
|
+
className: cn(
|
|
28402
|
+
"bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",
|
|
28403
|
+
className
|
|
28404
|
+
),
|
|
28405
|
+
...props
|
|
28406
|
+
}
|
|
28407
|
+
);
|
|
28408
|
+
}
|
|
28409
|
+
function CommandInput({
|
|
28410
|
+
className,
|
|
28411
|
+
...props
|
|
28412
|
+
}) {
|
|
28413
|
+
return /* @__PURE__ */ jsxs27(
|
|
28414
|
+
"div",
|
|
28415
|
+
{
|
|
28416
|
+
"data-slot": "command-input-wrapper",
|
|
28417
|
+
className: "flex h-9 items-center gap-2 border-b px-3",
|
|
28418
|
+
children: [
|
|
28419
|
+
/* @__PURE__ */ jsx47(Search, { className: "size-4 shrink-0 opacity-50" }),
|
|
28420
|
+
/* @__PURE__ */ jsx47(
|
|
28421
|
+
CommandPrimitive.Input,
|
|
28422
|
+
{
|
|
28423
|
+
"data-slot": "command-input",
|
|
28424
|
+
className: cn(
|
|
28425
|
+
"placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",
|
|
28426
|
+
className
|
|
28427
|
+
),
|
|
28428
|
+
...props
|
|
28429
|
+
}
|
|
28430
|
+
)
|
|
28431
|
+
]
|
|
28432
|
+
}
|
|
28433
|
+
);
|
|
28434
|
+
}
|
|
28435
|
+
function CommandList({
|
|
28436
|
+
className,
|
|
28437
|
+
...props
|
|
28438
|
+
}) {
|
|
28439
|
+
return /* @__PURE__ */ jsx47(
|
|
28440
|
+
CommandPrimitive.List,
|
|
28441
|
+
{
|
|
28442
|
+
"data-slot": "command-list",
|
|
28443
|
+
className: cn(
|
|
28444
|
+
"max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",
|
|
28445
|
+
className
|
|
28446
|
+
),
|
|
28447
|
+
...props
|
|
28448
|
+
}
|
|
28449
|
+
);
|
|
28450
|
+
}
|
|
28451
|
+
function CommandEmpty({
|
|
28452
|
+
...props
|
|
28453
|
+
}) {
|
|
28454
|
+
return /* @__PURE__ */ jsx47(
|
|
28455
|
+
CommandPrimitive.Empty,
|
|
28456
|
+
{
|
|
28457
|
+
"data-slot": "command-empty",
|
|
28458
|
+
className: "py-6 text-center text-sm",
|
|
28459
|
+
...props
|
|
28460
|
+
}
|
|
28461
|
+
);
|
|
28462
|
+
}
|
|
28463
|
+
function CommandGroup({
|
|
28464
|
+
className,
|
|
28465
|
+
...props
|
|
28466
|
+
}) {
|
|
28467
|
+
return /* @__PURE__ */ jsx47(
|
|
28468
|
+
CommandPrimitive.Group,
|
|
28469
|
+
{
|
|
28470
|
+
"data-slot": "command-group",
|
|
28471
|
+
className: cn(
|
|
28472
|
+
"text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",
|
|
28473
|
+
className
|
|
28474
|
+
),
|
|
28475
|
+
...props
|
|
28476
|
+
}
|
|
28477
|
+
);
|
|
28478
|
+
}
|
|
28479
|
+
function CommandItem({
|
|
28480
|
+
className,
|
|
28481
|
+
...props
|
|
28482
|
+
}) {
|
|
28483
|
+
return /* @__PURE__ */ jsx47(
|
|
28484
|
+
CommandPrimitive.Item,
|
|
28485
|
+
{
|
|
28486
|
+
"data-slot": "command-item",
|
|
28487
|
+
className: cn(
|
|
28488
|
+
"data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_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=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
28489
|
+
className
|
|
28490
|
+
),
|
|
28491
|
+
...props
|
|
28492
|
+
}
|
|
28493
|
+
);
|
|
28494
|
+
}
|
|
28495
|
+
|
|
28496
|
+
// src/components/Inputs/Multiselect/MultiSelect.tsx
|
|
28497
|
+
import { jsx as jsx48, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
28498
|
+
var MultiSelect = ({
|
|
28499
|
+
value = [],
|
|
28500
|
+
onChange,
|
|
28501
|
+
data = [],
|
|
28502
|
+
placeholder = "Select...",
|
|
28503
|
+
disabled,
|
|
28504
|
+
searchable = true,
|
|
28505
|
+
className = "",
|
|
28506
|
+
...props
|
|
28507
|
+
}) => {
|
|
28508
|
+
const [open, setOpen] = React7.useState(false);
|
|
28509
|
+
React7.useEffect(() => {
|
|
28510
|
+
if (value) {
|
|
28511
|
+
onChange(value);
|
|
28512
|
+
}
|
|
28513
|
+
}, []);
|
|
28514
|
+
const toggleOption = (val) => {
|
|
28515
|
+
onChange(
|
|
28516
|
+
value?.includes(val) ? value.filter((v) => v !== val) : [...value || [], val]
|
|
28517
|
+
);
|
|
28518
|
+
};
|
|
28519
|
+
const selectedLabels = React7.useMemo(
|
|
28520
|
+
() => data.filter((opt) => value.includes(opt.value)).map((opt) => opt.label),
|
|
28521
|
+
[data, value]
|
|
28522
|
+
);
|
|
28523
|
+
return /* @__PURE__ */ jsxs28(Popover, { open, onOpenChange: setOpen, children: [
|
|
28524
|
+
/* @__PURE__ */ jsx48(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs28(
|
|
28525
|
+
Button,
|
|
28526
|
+
{
|
|
28527
|
+
variant: "outline",
|
|
28528
|
+
role: "combobox",
|
|
28529
|
+
className: `w-full justify-between ${className} ${props.errorMessage ? "border-red-500" : ""}`,
|
|
28530
|
+
disabled,
|
|
28531
|
+
type: "button",
|
|
28532
|
+
children: [
|
|
28533
|
+
/* @__PURE__ */ jsx48("span", { className: "truncate", children: selectedLabels.length > 0 ? selectedLabels.join(", ") : placeholder }),
|
|
28534
|
+
/* @__PURE__ */ jsx48(ChevronsUpDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
28535
|
+
]
|
|
28536
|
+
}
|
|
28537
|
+
) }),
|
|
28538
|
+
/* @__PURE__ */ jsx48(
|
|
28539
|
+
PopoverContent,
|
|
28540
|
+
{
|
|
28541
|
+
align: "start",
|
|
28542
|
+
className: "w-[var(--radix-popover-trigger-width)] p-0",
|
|
28543
|
+
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
28544
|
+
onInteractOutside: (e) => {
|
|
28545
|
+
if (e.target.closest(".keep-open")) e.preventDefault();
|
|
28546
|
+
},
|
|
28547
|
+
children: /* @__PURE__ */ jsxs28(Command2, { shouldFilter: searchable, children: [
|
|
28548
|
+
searchable && /* @__PURE__ */ jsx48(CommandInput, { placeholder: "Search..." }),
|
|
28549
|
+
/* @__PURE__ */ jsxs28(CommandList, { children: [
|
|
28550
|
+
/* @__PURE__ */ jsx48(CommandEmpty, { children: "No options found." }),
|
|
28551
|
+
/* @__PURE__ */ jsx48(CommandGroup, { children: data.map((opt) => {
|
|
28552
|
+
const isSelected = value.includes(opt.value);
|
|
28553
|
+
return /* @__PURE__ */ jsx48(
|
|
28554
|
+
"div",
|
|
28555
|
+
{
|
|
28556
|
+
className: "keep-open",
|
|
28557
|
+
children: /* @__PURE__ */ jsx48(
|
|
28558
|
+
CommandItem,
|
|
28559
|
+
{
|
|
28560
|
+
onMouseDown: (e) => {
|
|
28561
|
+
e.preventDefault();
|
|
28562
|
+
toggleOption(opt.value);
|
|
28563
|
+
},
|
|
28564
|
+
children: /* @__PURE__ */ jsxs28("div", { className: "flex items-center gap-2", children: [
|
|
28565
|
+
/* @__PURE__ */ jsx48(Checkbox, { checked: isSelected }),
|
|
28566
|
+
/* @__PURE__ */ jsx48("span", { children: opt.label })
|
|
28567
|
+
] })
|
|
28568
|
+
},
|
|
28569
|
+
opt.value
|
|
28570
|
+
)
|
|
28571
|
+
},
|
|
28572
|
+
opt.value
|
|
28573
|
+
);
|
|
28574
|
+
}) })
|
|
28575
|
+
] })
|
|
28576
|
+
] })
|
|
28577
|
+
}
|
|
28578
|
+
),
|
|
28579
|
+
props.errorMessage && /* @__PURE__ */ jsx48("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
28580
|
+
] });
|
|
28581
|
+
};
|
|
28582
|
+
var MultiSelect_default = MultiSelect;
|
|
28583
|
+
|
|
28584
|
+
// src/components/ui/data-table.tsx
|
|
28585
|
+
import * as React8 from "react";
|
|
28273
28586
|
import { faEllipsisH } from "@fortawesome/free-solid-svg-icons";
|
|
28274
28587
|
import { FontAwesomeIcon as FontAwesomeIcon3 } from "@fortawesome/react-fontawesome";
|
|
28275
28588
|
import {
|
|
@@ -28281,14 +28594,14 @@ import {
|
|
|
28281
28594
|
} from "@tanstack/react-table";
|
|
28282
28595
|
|
|
28283
28596
|
// src/components/ui/table.tsx
|
|
28284
|
-
import { jsx as
|
|
28597
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
28285
28598
|
function Table3({ className, ...props }) {
|
|
28286
|
-
return /* @__PURE__ */
|
|
28599
|
+
return /* @__PURE__ */ jsx49(
|
|
28287
28600
|
"div",
|
|
28288
28601
|
{
|
|
28289
28602
|
"data-slot": "table-container",
|
|
28290
28603
|
className: "relative w-full overflow-x-auto rounded-md border border-gray-200 bg-white",
|
|
28291
|
-
children: /* @__PURE__ */
|
|
28604
|
+
children: /* @__PURE__ */ jsx49(
|
|
28292
28605
|
"table",
|
|
28293
28606
|
{
|
|
28294
28607
|
"data-slot": "table",
|
|
@@ -28300,7 +28613,7 @@ function Table3({ className, ...props }) {
|
|
|
28300
28613
|
);
|
|
28301
28614
|
}
|
|
28302
28615
|
function TableHeader({ className, ...props }) {
|
|
28303
|
-
return /* @__PURE__ */
|
|
28616
|
+
return /* @__PURE__ */ jsx49(
|
|
28304
28617
|
"thead",
|
|
28305
28618
|
{
|
|
28306
28619
|
"data-slot": "table-header",
|
|
@@ -28313,7 +28626,7 @@ function TableHeader({ className, ...props }) {
|
|
|
28313
28626
|
);
|
|
28314
28627
|
}
|
|
28315
28628
|
function TableBody({ className, ...props }) {
|
|
28316
|
-
return /* @__PURE__ */
|
|
28629
|
+
return /* @__PURE__ */ jsx49(
|
|
28317
28630
|
"tbody",
|
|
28318
28631
|
{
|
|
28319
28632
|
"data-slot": "table-body",
|
|
@@ -28326,7 +28639,7 @@ function TableBody({ className, ...props }) {
|
|
|
28326
28639
|
);
|
|
28327
28640
|
}
|
|
28328
28641
|
function TableRow({ className, ...props }) {
|
|
28329
|
-
return /* @__PURE__ */
|
|
28642
|
+
return /* @__PURE__ */ jsx49(
|
|
28330
28643
|
"tr",
|
|
28331
28644
|
{
|
|
28332
28645
|
"data-slot": "table-row",
|
|
@@ -28339,7 +28652,7 @@ function TableRow({ className, ...props }) {
|
|
|
28339
28652
|
);
|
|
28340
28653
|
}
|
|
28341
28654
|
function TableHead({ className, ...props }) {
|
|
28342
|
-
return /* @__PURE__ */
|
|
28655
|
+
return /* @__PURE__ */ jsx49(
|
|
28343
28656
|
"th",
|
|
28344
28657
|
{
|
|
28345
28658
|
"data-slot": "table-head",
|
|
@@ -28352,7 +28665,7 @@ function TableHead({ className, ...props }) {
|
|
|
28352
28665
|
);
|
|
28353
28666
|
}
|
|
28354
28667
|
function TableCell({ className, ...props }) {
|
|
28355
|
-
return /* @__PURE__ */
|
|
28668
|
+
return /* @__PURE__ */ jsx49(
|
|
28356
28669
|
"td",
|
|
28357
28670
|
{
|
|
28358
28671
|
"data-slot": "table-cell",
|
|
@@ -28366,7 +28679,7 @@ function TableCell({ className, ...props }) {
|
|
|
28366
28679
|
}
|
|
28367
28680
|
|
|
28368
28681
|
// src/components/ui/data-table.tsx
|
|
28369
|
-
import { Fragment as Fragment17, jsx as
|
|
28682
|
+
import { Fragment as Fragment17, jsx as jsx50, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
28370
28683
|
function DataTable({
|
|
28371
28684
|
columns,
|
|
28372
28685
|
data,
|
|
@@ -28383,10 +28696,10 @@ function DataTable({
|
|
|
28383
28696
|
globalSearch,
|
|
28384
28697
|
onCellClick
|
|
28385
28698
|
}) {
|
|
28386
|
-
const [columnFilters, setColumnFilters] =
|
|
28387
|
-
const [columnVisibility, setColumnVisibility] =
|
|
28388
|
-
const [manualSort, setManualSort] =
|
|
28389
|
-
const [searchTerm, setSearchTerm] =
|
|
28699
|
+
const [columnFilters, setColumnFilters] = React8.useState([]);
|
|
28700
|
+
const [columnVisibility, setColumnVisibility] = React8.useState({});
|
|
28701
|
+
const [manualSort, setManualSort] = React8.useState(null);
|
|
28702
|
+
const [searchTerm, setSearchTerm] = React8.useState("");
|
|
28390
28703
|
const table = useReactTable({
|
|
28391
28704
|
data,
|
|
28392
28705
|
columns,
|
|
@@ -28434,11 +28747,11 @@ function DataTable({
|
|
|
28434
28747
|
}
|
|
28435
28748
|
return [];
|
|
28436
28749
|
};
|
|
28437
|
-
return /* @__PURE__ */
|
|
28438
|
-
/* @__PURE__ */
|
|
28439
|
-
globalSearch && /* @__PURE__ */
|
|
28440
|
-
/* @__PURE__ */
|
|
28441
|
-
/* @__PURE__ */
|
|
28750
|
+
return /* @__PURE__ */ jsxs29("div", { className: "overflow-hidden rounded-md w-full", children: [
|
|
28751
|
+
/* @__PURE__ */ jsxs29("div", { className: `flex ${globalSearch ? "justify-between" : "justify-end"} p-2 bg-gray-50`, children: [
|
|
28752
|
+
globalSearch && /* @__PURE__ */ jsxs29("div", { className: "flex items-center gap-2 w-full max-w-sm", children: [
|
|
28753
|
+
/* @__PURE__ */ jsxs29("div", { className: "relative w-full", children: [
|
|
28754
|
+
/* @__PURE__ */ jsx50(
|
|
28442
28755
|
"input",
|
|
28443
28756
|
{
|
|
28444
28757
|
type: "text",
|
|
@@ -28453,9 +28766,9 @@ function DataTable({
|
|
|
28453
28766
|
className: "border border-gray-300 rounded-md text-sm px-3 py-2 pl-8 w-full focus:outline-none focus:ring-1 focus:ring-[#12715B]"
|
|
28454
28767
|
}
|
|
28455
28768
|
),
|
|
28456
|
-
/* @__PURE__ */
|
|
28769
|
+
/* @__PURE__ */ jsx50(Search, { className: "absolute left-2 top-2.5 text-gray-400", size: 16 })
|
|
28457
28770
|
] }),
|
|
28458
|
-
/* @__PURE__ */
|
|
28771
|
+
/* @__PURE__ */ jsx50(
|
|
28459
28772
|
Button,
|
|
28460
28773
|
{
|
|
28461
28774
|
size: "sm",
|
|
@@ -28465,8 +28778,8 @@ function DataTable({
|
|
|
28465
28778
|
}
|
|
28466
28779
|
)
|
|
28467
28780
|
] }),
|
|
28468
|
-
/* @__PURE__ */
|
|
28469
|
-
/* @__PURE__ */
|
|
28781
|
+
/* @__PURE__ */ jsxs29(Popover, { children: [
|
|
28782
|
+
/* @__PURE__ */ jsx50(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx50(
|
|
28470
28783
|
Button,
|
|
28471
28784
|
{
|
|
28472
28785
|
variant: "outline",
|
|
@@ -28475,10 +28788,10 @@ function DataTable({
|
|
|
28475
28788
|
children: "Manage Columns"
|
|
28476
28789
|
}
|
|
28477
28790
|
) }),
|
|
28478
|
-
/* @__PURE__ */
|
|
28479
|
-
/* @__PURE__ */
|
|
28480
|
-
/* @__PURE__ */
|
|
28481
|
-
/* @__PURE__ */
|
|
28791
|
+
/* @__PURE__ */ jsxs29(PopoverContent, { align: "end", className: "w-48 p-3 space-y-2", children: [
|
|
28792
|
+
/* @__PURE__ */ jsx50("div", { className: "text-sm font-medium mb-2", children: "Show / Hide Columns" }),
|
|
28793
|
+
/* @__PURE__ */ jsxs29("label", { className: "flex items-center gap-2 text-sm font-semibold border-b pb-2 mb-2", children: [
|
|
28794
|
+
/* @__PURE__ */ jsx50(
|
|
28482
28795
|
"input",
|
|
28483
28796
|
{
|
|
28484
28797
|
type: "checkbox",
|
|
@@ -28497,8 +28810,8 @@ function DataTable({
|
|
|
28497
28810
|
),
|
|
28498
28811
|
"Toggle All"
|
|
28499
28812
|
] }),
|
|
28500
|
-
table.getAllLeafColumns().map((column) => /* @__PURE__ */
|
|
28501
|
-
/* @__PURE__ */
|
|
28813
|
+
table.getAllLeafColumns().map((column) => /* @__PURE__ */ jsxs29("label", { className: "flex items-center gap-2 text-sm", children: [
|
|
28814
|
+
/* @__PURE__ */ jsx50(
|
|
28502
28815
|
"input",
|
|
28503
28816
|
{
|
|
28504
28817
|
type: "checkbox",
|
|
@@ -28511,13 +28824,13 @@ function DataTable({
|
|
|
28511
28824
|
] })
|
|
28512
28825
|
] })
|
|
28513
28826
|
] }),
|
|
28514
|
-
/* @__PURE__ */
|
|
28515
|
-
/* @__PURE__ */
|
|
28827
|
+
/* @__PURE__ */ jsxs29(Table3, { children: [
|
|
28828
|
+
/* @__PURE__ */ jsx50(TableHeader, { children: table.getHeaderGroups().map((hg) => /* @__PURE__ */ jsx50(TableRow, { children: hg.headers.map((header) => {
|
|
28516
28829
|
const canSort = header.column.getCanSort();
|
|
28517
28830
|
const canFilter = header.column.getCanFilter();
|
|
28518
28831
|
const sortDir = manualSort?.key === header.column.id ? manualSort.dir : null;
|
|
28519
|
-
return /* @__PURE__ */
|
|
28520
|
-
/* @__PURE__ */
|
|
28832
|
+
return /* @__PURE__ */ jsx50(TableHead, { className: "relative select-none", children: /* @__PURE__ */ jsxs29("div", { className: "flex items-center justify-between", children: [
|
|
28833
|
+
/* @__PURE__ */ jsxs29(
|
|
28521
28834
|
"span",
|
|
28522
28835
|
{
|
|
28523
28836
|
className: `flex items-center gap-1 ${canSort ? "cursor-pointer" : ""}`,
|
|
@@ -28529,32 +28842,32 @@ function DataTable({
|
|
|
28529
28842
|
},
|
|
28530
28843
|
children: [
|
|
28531
28844
|
flexRender(header.column.columnDef.header, header.getContext()),
|
|
28532
|
-
canSort && /* @__PURE__ */
|
|
28533
|
-
sortDir === "asc" && /* @__PURE__ */
|
|
28534
|
-
sortDir === "desc" && /* @__PURE__ */
|
|
28535
|
-
!sortDir && /* @__PURE__ */
|
|
28845
|
+
canSort && /* @__PURE__ */ jsxs29(Fragment17, { children: [
|
|
28846
|
+
sortDir === "asc" && /* @__PURE__ */ jsx50(ArrowUp, { size: 14, className: "text-gray-500" }),
|
|
28847
|
+
sortDir === "desc" && /* @__PURE__ */ jsx50(ArrowDown, { size: 14, className: "text-gray-500" }),
|
|
28848
|
+
!sortDir && /* @__PURE__ */ jsx50(ArrowUpDown, { size: 14, className: "text-gray-400" })
|
|
28536
28849
|
] })
|
|
28537
28850
|
]
|
|
28538
28851
|
}
|
|
28539
28852
|
),
|
|
28540
|
-
canFilter && /* @__PURE__ */
|
|
28541
|
-
/* @__PURE__ */
|
|
28853
|
+
canFilter && /* @__PURE__ */ jsxs29(Popover, { children: [
|
|
28854
|
+
/* @__PURE__ */ jsx50(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx50(
|
|
28542
28855
|
"span",
|
|
28543
28856
|
{
|
|
28544
28857
|
role: "presentation",
|
|
28545
28858
|
className: "pl-5 cursor-pointer",
|
|
28546
28859
|
onClick: (e) => e.stopPropagation(),
|
|
28547
|
-
children: /* @__PURE__ */
|
|
28860
|
+
children: /* @__PURE__ */ jsx50(FontAwesomeIcon3, { icon: faEllipsisH, className: "w-5 h-5 text-gray-500" })
|
|
28548
28861
|
}
|
|
28549
28862
|
) }),
|
|
28550
|
-
/* @__PURE__ */
|
|
28863
|
+
/* @__PURE__ */ jsx50(
|
|
28551
28864
|
PopoverContent,
|
|
28552
28865
|
{
|
|
28553
28866
|
align: "center",
|
|
28554
28867
|
sideOffset: 14,
|
|
28555
28868
|
className: "w-50 p-3 z-[200] border-gray-300",
|
|
28556
28869
|
avoidCollisions: true,
|
|
28557
|
-
children: /* @__PURE__ */
|
|
28870
|
+
children: /* @__PURE__ */ jsxs29(
|
|
28558
28871
|
"form",
|
|
28559
28872
|
{
|
|
28560
28873
|
onSubmit: (e) => {
|
|
@@ -28567,8 +28880,8 @@ function DataTable({
|
|
|
28567
28880
|
},
|
|
28568
28881
|
className: "space-y-2",
|
|
28569
28882
|
children: [
|
|
28570
|
-
/* @__PURE__ */
|
|
28571
|
-
/* @__PURE__ */
|
|
28883
|
+
/* @__PURE__ */ jsx50("label", { htmlFor: "filter", className: "text-xs text-gray-500 font-normal", children: "Filter by value:" }),
|
|
28884
|
+
/* @__PURE__ */ jsx50(
|
|
28572
28885
|
"input",
|
|
28573
28886
|
{
|
|
28574
28887
|
name: "filter",
|
|
@@ -28578,7 +28891,7 @@ function DataTable({
|
|
|
28578
28891
|
autoComplete: "off"
|
|
28579
28892
|
}
|
|
28580
28893
|
),
|
|
28581
|
-
/* @__PURE__ */
|
|
28894
|
+
/* @__PURE__ */ jsx50("div", { className: "justify-end flex", children: /* @__PURE__ */ jsx50(
|
|
28582
28895
|
Button,
|
|
28583
28896
|
{
|
|
28584
28897
|
type: "submit",
|
|
@@ -28594,10 +28907,10 @@ function DataTable({
|
|
|
28594
28907
|
] })
|
|
28595
28908
|
] }) }, header.id);
|
|
28596
28909
|
}) }, hg.id)) }),
|
|
28597
|
-
/* @__PURE__ */
|
|
28910
|
+
/* @__PURE__ */ jsx50(TableBody, { children: loading ? /* @__PURE__ */ jsx50(TableRow, { children: /* @__PURE__ */ jsx50(TableCell, { colSpan: columns.length, className: "h-24 text-center", children: "Loading..." }) }) : table.getRowModel().rows.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx50(TableRow, { children: row.getVisibleCells().map((cell) => {
|
|
28598
28911
|
const meta = cell.column.columnDef.meta || {};
|
|
28599
28912
|
const isClickable = meta?.isClickable;
|
|
28600
|
-
return /* @__PURE__ */
|
|
28913
|
+
return /* @__PURE__ */ jsx50(
|
|
28601
28914
|
TableCell,
|
|
28602
28915
|
{
|
|
28603
28916
|
className: `${meta?.cellClass ?? ""} ${isClickable ? "cursor-pointer hover:bg-gray-100 underline" : ""}`,
|
|
@@ -28611,17 +28924,17 @@ function DataTable({
|
|
|
28611
28924
|
},
|
|
28612
28925
|
cell.id
|
|
28613
28926
|
);
|
|
28614
|
-
}) }, row.id)) : /* @__PURE__ */
|
|
28927
|
+
}) }, row.id)) : /* @__PURE__ */ jsx50(TableRow, { children: /* @__PURE__ */ jsx50(TableCell, { colSpan: columns.length, className: "h-24 text-center", children: "No results." }) }) })
|
|
28615
28928
|
] }),
|
|
28616
|
-
pagination && /* @__PURE__ */
|
|
28617
|
-
/* @__PURE__ */
|
|
28929
|
+
pagination && /* @__PURE__ */ jsxs29("div", { className: "flex items-center justify-between py-3 px-2 text-sm w-full", children: [
|
|
28930
|
+
/* @__PURE__ */ jsxs29("div", { children: [
|
|
28618
28931
|
"Page ",
|
|
28619
28932
|
table.getState().pagination.pageIndex + 1,
|
|
28620
28933
|
" of ",
|
|
28621
28934
|
table.getPageCount()
|
|
28622
28935
|
] }),
|
|
28623
|
-
/* @__PURE__ */
|
|
28624
|
-
/* @__PURE__ */
|
|
28936
|
+
/* @__PURE__ */ jsxs29("div", { className: "flex items-center gap-2", children: [
|
|
28937
|
+
/* @__PURE__ */ jsx50(
|
|
28625
28938
|
"button",
|
|
28626
28939
|
{
|
|
28627
28940
|
onClick: () => table.previousPage(),
|
|
@@ -28634,7 +28947,7 @@ function DataTable({
|
|
|
28634
28947
|
table.getState().pagination.pageIndex + 1,
|
|
28635
28948
|
table.getPageCount(),
|
|
28636
28949
|
5
|
|
28637
|
-
).map((pageNum, index) => /* @__PURE__ */
|
|
28950
|
+
).map((pageNum, index) => /* @__PURE__ */ jsx50(
|
|
28638
28951
|
"button",
|
|
28639
28952
|
{
|
|
28640
28953
|
disabled: pageNum === "...",
|
|
@@ -28644,7 +28957,7 @@ function DataTable({
|
|
|
28644
28957
|
},
|
|
28645
28958
|
index
|
|
28646
28959
|
)),
|
|
28647
|
-
/* @__PURE__ */
|
|
28960
|
+
/* @__PURE__ */ jsx50(
|
|
28648
28961
|
"button",
|
|
28649
28962
|
{
|
|
28650
28963
|
onClick: () => table.nextPage(),
|
|
@@ -28659,7 +28972,7 @@ function DataTable({
|
|
|
28659
28972
|
}
|
|
28660
28973
|
|
|
28661
28974
|
// src/components/DataDisplay/Table/Table.tsx
|
|
28662
|
-
import { jsx as
|
|
28975
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
28663
28976
|
var Table4 = ({
|
|
28664
28977
|
columns,
|
|
28665
28978
|
data,
|
|
@@ -28682,7 +28995,7 @@ var Table4 = ({
|
|
|
28682
28995
|
const rawColumns = Array.isArray(columns) ? columns : [];
|
|
28683
28996
|
const rawData = Array.isArray(data) ? data : [];
|
|
28684
28997
|
const isControlled = typeof page === "number";
|
|
28685
|
-
return /* @__PURE__ */
|
|
28998
|
+
return /* @__PURE__ */ jsx51("div", { className: `${className || ""} space-y-3`, style, children: /* @__PURE__ */ jsx51(
|
|
28686
28999
|
DataTable,
|
|
28687
29000
|
{
|
|
28688
29001
|
...props,
|
|
@@ -28701,16 +29014,19 @@ var Table4 = ({
|
|
|
28701
29014
|
onSortChange: (col, dir) => onSortChange?.({ sort_by: col, sort_order: dir }),
|
|
28702
29015
|
onFilterChange: (filters) => onFilterChange?.({ columnKey: filters.columnKey, columnTerm: filters.columnTerm }),
|
|
28703
29016
|
onGlobalSearch: (term) => onGlobalSearch?.({ searchTerm: term }),
|
|
28704
|
-
globalSearch
|
|
29017
|
+
globalSearch,
|
|
29018
|
+
onCellClick: (cell) => {
|
|
29019
|
+
props.onCellClick?.({ id: cell.id, column: cell });
|
|
29020
|
+
}
|
|
28705
29021
|
}
|
|
28706
29022
|
) });
|
|
28707
29023
|
};
|
|
28708
29024
|
var Table_default = Table4;
|
|
28709
29025
|
|
|
28710
29026
|
// src/components/ui/pagination.tsx
|
|
28711
|
-
import { jsx as
|
|
29027
|
+
import { jsx as jsx52, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
28712
29028
|
function Pagination({ className, ...props }) {
|
|
28713
|
-
return /* @__PURE__ */
|
|
29029
|
+
return /* @__PURE__ */ jsx52(
|
|
28714
29030
|
"nav",
|
|
28715
29031
|
{
|
|
28716
29032
|
role: "navigation",
|
|
@@ -28725,7 +29041,7 @@ function PaginationContent({
|
|
|
28725
29041
|
className,
|
|
28726
29042
|
...props
|
|
28727
29043
|
}) {
|
|
28728
|
-
return /* @__PURE__ */
|
|
29044
|
+
return /* @__PURE__ */ jsx52(
|
|
28729
29045
|
"ul",
|
|
28730
29046
|
{
|
|
28731
29047
|
"data-slot": "pagination-content",
|
|
@@ -28735,7 +29051,7 @@ function PaginationContent({
|
|
|
28735
29051
|
);
|
|
28736
29052
|
}
|
|
28737
29053
|
function PaginationItem({ ...props }) {
|
|
28738
|
-
return /* @__PURE__ */
|
|
29054
|
+
return /* @__PURE__ */ jsx52("li", { "data-slot": "pagination-item", ...props });
|
|
28739
29055
|
}
|
|
28740
29056
|
function PaginationLink({
|
|
28741
29057
|
className,
|
|
@@ -28743,7 +29059,7 @@ function PaginationLink({
|
|
|
28743
29059
|
size = "icon",
|
|
28744
29060
|
...props
|
|
28745
29061
|
}) {
|
|
28746
|
-
return /* @__PURE__ */
|
|
29062
|
+
return /* @__PURE__ */ jsx52(
|
|
28747
29063
|
"a",
|
|
28748
29064
|
{
|
|
28749
29065
|
"aria-current": isActive ? "page" : void 0,
|
|
@@ -28764,7 +29080,7 @@ function PaginationPrevious({
|
|
|
28764
29080
|
className,
|
|
28765
29081
|
...props
|
|
28766
29082
|
}) {
|
|
28767
|
-
return /* @__PURE__ */
|
|
29083
|
+
return /* @__PURE__ */ jsxs30(
|
|
28768
29084
|
PaginationLink,
|
|
28769
29085
|
{
|
|
28770
29086
|
"aria-label": "Go to previous page",
|
|
@@ -28772,8 +29088,8 @@ function PaginationPrevious({
|
|
|
28772
29088
|
className: cn("gap-1 px-2.5 sm:pl-2.5", className),
|
|
28773
29089
|
...props,
|
|
28774
29090
|
children: [
|
|
28775
|
-
/* @__PURE__ */
|
|
28776
|
-
/* @__PURE__ */
|
|
29091
|
+
/* @__PURE__ */ jsx52(ChevronLeft, {}),
|
|
29092
|
+
/* @__PURE__ */ jsx52("span", { className: "hidden sm:block", children: "Previous" })
|
|
28777
29093
|
]
|
|
28778
29094
|
}
|
|
28779
29095
|
);
|
|
@@ -28782,7 +29098,7 @@ function PaginationNext({
|
|
|
28782
29098
|
className,
|
|
28783
29099
|
...props
|
|
28784
29100
|
}) {
|
|
28785
|
-
return /* @__PURE__ */
|
|
29101
|
+
return /* @__PURE__ */ jsxs30(
|
|
28786
29102
|
PaginationLink,
|
|
28787
29103
|
{
|
|
28788
29104
|
"aria-label": "Go to next page",
|
|
@@ -28790,8 +29106,8 @@ function PaginationNext({
|
|
|
28790
29106
|
className: cn("gap-1 px-2.5 sm:pr-2.5", className),
|
|
28791
29107
|
...props,
|
|
28792
29108
|
children: [
|
|
28793
|
-
/* @__PURE__ */
|
|
28794
|
-
/* @__PURE__ */
|
|
29109
|
+
/* @__PURE__ */ jsx52("span", { className: "hidden sm:block", children: "Next" }),
|
|
29110
|
+
/* @__PURE__ */ jsx52(ChevronRight, {})
|
|
28795
29111
|
]
|
|
28796
29112
|
}
|
|
28797
29113
|
);
|
|
@@ -28800,7 +29116,7 @@ function PaginationEllipsis({
|
|
|
28800
29116
|
className,
|
|
28801
29117
|
...props
|
|
28802
29118
|
}) {
|
|
28803
|
-
return /* @__PURE__ */
|
|
29119
|
+
return /* @__PURE__ */ jsxs30(
|
|
28804
29120
|
"span",
|
|
28805
29121
|
{
|
|
28806
29122
|
"aria-hidden": true,
|
|
@@ -28808,15 +29124,15 @@ function PaginationEllipsis({
|
|
|
28808
29124
|
className: cn("flex size-9 items-center justify-center", className),
|
|
28809
29125
|
...props,
|
|
28810
29126
|
children: [
|
|
28811
|
-
/* @__PURE__ */
|
|
28812
|
-
/* @__PURE__ */
|
|
29127
|
+
/* @__PURE__ */ jsx52(Ellipsis, { className: "size-4" }),
|
|
29128
|
+
/* @__PURE__ */ jsx52("span", { className: "sr-only", children: "More pages" })
|
|
28813
29129
|
]
|
|
28814
29130
|
}
|
|
28815
29131
|
);
|
|
28816
29132
|
}
|
|
28817
29133
|
|
|
28818
29134
|
// src/components/DataDisplay/Pagination/Pagination.tsx
|
|
28819
|
-
import { jsx as
|
|
29135
|
+
import { jsx as jsx53, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
28820
29136
|
var CustomPagination = ({
|
|
28821
29137
|
totalPages,
|
|
28822
29138
|
currentPage,
|
|
@@ -28862,10 +29178,10 @@ var CustomPagination = ({
|
|
|
28862
29178
|
}
|
|
28863
29179
|
};
|
|
28864
29180
|
const pageNumbers = getPageNumbers();
|
|
28865
|
-
return /* @__PURE__ */
|
|
28866
|
-
/* @__PURE__ */
|
|
28867
|
-
/* @__PURE__ */
|
|
28868
|
-
/* @__PURE__ */
|
|
29181
|
+
return /* @__PURE__ */ jsxs31("div", { className: "flex flex-row gap-1 w-full items-center justify-between", children: [
|
|
29182
|
+
/* @__PURE__ */ jsxs31("div", { className: "flex items-center gap-2", children: [
|
|
29183
|
+
/* @__PURE__ */ jsx53("p", { className: "text-sm text-muted-foreground whitespace-nowrap", children: "Items per page:" }),
|
|
29184
|
+
/* @__PURE__ */ jsxs31(
|
|
28869
29185
|
Select,
|
|
28870
29186
|
{
|
|
28871
29187
|
defaultValue: String(perPage),
|
|
@@ -28873,26 +29189,26 @@ var CustomPagination = ({
|
|
|
28873
29189
|
onPageChange({ page: 1, itemsPerPage: Number(value) });
|
|
28874
29190
|
},
|
|
28875
29191
|
children: [
|
|
28876
|
-
/* @__PURE__ */
|
|
28877
|
-
/* @__PURE__ */
|
|
28878
|
-
/* @__PURE__ */
|
|
28879
|
-
/* @__PURE__ */
|
|
28880
|
-
/* @__PURE__ */
|
|
28881
|
-
/* @__PURE__ */
|
|
29192
|
+
/* @__PURE__ */ jsx53(SelectTrigger, { className: "w-[100px]", children: /* @__PURE__ */ jsx53(SelectValue, { placeholder: "Select" }) }),
|
|
29193
|
+
/* @__PURE__ */ jsxs31(SelectContent, { children: [
|
|
29194
|
+
/* @__PURE__ */ jsx53(SelectItem, { value: "5", children: "5" }),
|
|
29195
|
+
/* @__PURE__ */ jsx53(SelectItem, { value: "10", children: "10" }),
|
|
29196
|
+
/* @__PURE__ */ jsx53(SelectItem, { value: "20", children: "20" }),
|
|
29197
|
+
/* @__PURE__ */ jsx53(SelectItem, { value: "50", children: "50" })
|
|
28882
29198
|
] })
|
|
28883
29199
|
]
|
|
28884
29200
|
}
|
|
28885
29201
|
)
|
|
28886
29202
|
] }),
|
|
28887
|
-
/* @__PURE__ */
|
|
28888
|
-
/* @__PURE__ */
|
|
29203
|
+
/* @__PURE__ */ jsx53(Pagination, { className: "justify-end", children: /* @__PURE__ */ jsxs31(PaginationContent, { children: [
|
|
29204
|
+
/* @__PURE__ */ jsx53(PaginationItem, { children: /* @__PURE__ */ jsx53(
|
|
28889
29205
|
PaginationPrevious,
|
|
28890
29206
|
{
|
|
28891
29207
|
onClick: () => handlePageChange(currentPage - 1),
|
|
28892
29208
|
className: currentPage === 1 ? "pointer-events-none opacity-50" : "cursor-pointer"
|
|
28893
29209
|
}
|
|
28894
29210
|
) }),
|
|
28895
|
-
pageNumbers.map((pageNumber, index) => /* @__PURE__ */
|
|
29211
|
+
pageNumbers.map((pageNumber, index) => /* @__PURE__ */ jsx53(PaginationItem, { children: pageNumber === "..." ? /* @__PURE__ */ jsx53(PaginationEllipsis, {}) : /* @__PURE__ */ jsx53(
|
|
28896
29212
|
PaginationLink,
|
|
28897
29213
|
{
|
|
28898
29214
|
onClick: () => handlePageChange(pageNumber),
|
|
@@ -28901,7 +29217,7 @@ var CustomPagination = ({
|
|
|
28901
29217
|
children: pageNumber
|
|
28902
29218
|
}
|
|
28903
29219
|
) }, index)),
|
|
28904
|
-
/* @__PURE__ */
|
|
29220
|
+
/* @__PURE__ */ jsx53(PaginationItem, { children: /* @__PURE__ */ jsx53(
|
|
28905
29221
|
PaginationNext,
|
|
28906
29222
|
{
|
|
28907
29223
|
onClick: () => handlePageChange(currentPage + 1),
|
|
@@ -28916,124 +29232,8 @@ var Pagination_default = CustomPagination;
|
|
|
28916
29232
|
// src/components/Navigation/Tabs/Tabs.tsx
|
|
28917
29233
|
import Link5 from "next/link";
|
|
28918
29234
|
import { useRouter } from "next/navigation";
|
|
28919
|
-
|
|
28920
|
-
|
|
28921
|
-
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
28922
|
-
import { jsx as jsx51, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
28923
|
-
function Dialog({
|
|
28924
|
-
...props
|
|
28925
|
-
}) {
|
|
28926
|
-
return /* @__PURE__ */ jsx51(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
28927
|
-
}
|
|
28928
|
-
function DialogPortal({
|
|
28929
|
-
...props
|
|
28930
|
-
}) {
|
|
28931
|
-
return /* @__PURE__ */ jsx51(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
|
|
28932
|
-
}
|
|
28933
|
-
function DialogOverlay({
|
|
28934
|
-
className,
|
|
28935
|
-
...props
|
|
28936
|
-
}) {
|
|
28937
|
-
return /* @__PURE__ */ jsx51(
|
|
28938
|
-
DialogPrimitive.Overlay,
|
|
28939
|
-
{
|
|
28940
|
-
"data-slot": "dialog-overlay",
|
|
28941
|
-
className: cn(
|
|
28942
|
-
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-[60] bg-black/50",
|
|
28943
|
-
className
|
|
28944
|
-
),
|
|
28945
|
-
...props
|
|
28946
|
-
}
|
|
28947
|
-
);
|
|
28948
|
-
}
|
|
28949
|
-
function DialogContent({
|
|
28950
|
-
className,
|
|
28951
|
-
children,
|
|
28952
|
-
showCloseButton = true,
|
|
28953
|
-
...props
|
|
28954
|
-
}) {
|
|
28955
|
-
return /* @__PURE__ */ jsxs29(DialogPortal, { "data-slot": "dialog-portal", children: [
|
|
28956
|
-
/* @__PURE__ */ jsx51(DialogOverlay, {}),
|
|
28957
|
-
/* @__PURE__ */ jsxs29(
|
|
28958
|
-
DialogPrimitive.Content,
|
|
28959
|
-
{
|
|
28960
|
-
"data-slot": "dialog-content",
|
|
28961
|
-
className: cn(
|
|
28962
|
-
"bg-background 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 fixed top-[50%] left-[50%] z-[70] grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
|
|
28963
|
-
className
|
|
28964
|
-
),
|
|
28965
|
-
...props,
|
|
28966
|
-
children: [
|
|
28967
|
-
children,
|
|
28968
|
-
showCloseButton && /* @__PURE__ */ jsxs29(
|
|
28969
|
-
DialogPrimitive.Close,
|
|
28970
|
-
{
|
|
28971
|
-
"data-slot": "dialog-close",
|
|
28972
|
-
className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
28973
|
-
children: [
|
|
28974
|
-
/* @__PURE__ */ jsx51(X, {}),
|
|
28975
|
-
/* @__PURE__ */ jsx51("span", { className: "sr-only", children: "Close" })
|
|
28976
|
-
]
|
|
28977
|
-
}
|
|
28978
|
-
)
|
|
28979
|
-
]
|
|
28980
|
-
}
|
|
28981
|
-
)
|
|
28982
|
-
] });
|
|
28983
|
-
}
|
|
28984
|
-
function DialogHeader({ className, ...props }) {
|
|
28985
|
-
return /* @__PURE__ */ jsx51(
|
|
28986
|
-
"div",
|
|
28987
|
-
{
|
|
28988
|
-
"data-slot": "dialog-header",
|
|
28989
|
-
className: cn("flex flex-col gap-2 text-center sm:text-left", className),
|
|
28990
|
-
...props
|
|
28991
|
-
}
|
|
28992
|
-
);
|
|
28993
|
-
}
|
|
28994
|
-
function DialogFooter({ className, ...props }) {
|
|
28995
|
-
return /* @__PURE__ */ jsx51(
|
|
28996
|
-
"div",
|
|
28997
|
-
{
|
|
28998
|
-
"data-slot": "dialog-footer",
|
|
28999
|
-
className: cn(
|
|
29000
|
-
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
29001
|
-
className
|
|
29002
|
-
),
|
|
29003
|
-
...props
|
|
29004
|
-
}
|
|
29005
|
-
);
|
|
29006
|
-
}
|
|
29007
|
-
function DialogTitle({
|
|
29008
|
-
className,
|
|
29009
|
-
...props
|
|
29010
|
-
}) {
|
|
29011
|
-
return /* @__PURE__ */ jsx51(
|
|
29012
|
-
DialogPrimitive.Title,
|
|
29013
|
-
{
|
|
29014
|
-
"data-slot": "dialog-title",
|
|
29015
|
-
className: cn("text-lg leading-none font-semibold", className),
|
|
29016
|
-
...props
|
|
29017
|
-
}
|
|
29018
|
-
);
|
|
29019
|
-
}
|
|
29020
|
-
function DialogDescription({
|
|
29021
|
-
className,
|
|
29022
|
-
...props
|
|
29023
|
-
}) {
|
|
29024
|
-
return /* @__PURE__ */ jsx51(
|
|
29025
|
-
DialogPrimitive.Description,
|
|
29026
|
-
{
|
|
29027
|
-
"data-slot": "dialog-description",
|
|
29028
|
-
className: cn("text-muted-foreground text-sm", className),
|
|
29029
|
-
...props
|
|
29030
|
-
}
|
|
29031
|
-
);
|
|
29032
|
-
}
|
|
29033
|
-
|
|
29034
|
-
// src/components/Navigation/Tabs/Tabs.tsx
|
|
29035
|
-
import { useCallback as useCallback2, useState as useState5 } from "react";
|
|
29036
|
-
import { Fragment as Fragment18, jsx as jsx52, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
29235
|
+
import { useCallback as useCallback2, useState as useState6 } from "react";
|
|
29236
|
+
import { Fragment as Fragment18, jsx as jsx54, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
29037
29237
|
var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuilder = true }) => {
|
|
29038
29238
|
const rawTabs = Array.isArray(tabs) ? tabs : [];
|
|
29039
29239
|
const baseClasses = "text-[12px] text-foreground p-2 text-center rounded-md transition-colors";
|
|
@@ -29044,8 +29244,8 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
29044
29244
|
return pathname === path || path !== "/" && pathname?.startsWith(path);
|
|
29045
29245
|
};
|
|
29046
29246
|
const router = useRouter();
|
|
29047
|
-
const [showExitDialog, setShowExitDialog] =
|
|
29048
|
-
const [pendingUrl, setPendingUrl] =
|
|
29247
|
+
const [showExitDialog, setShowExitDialog] = useState6(false);
|
|
29248
|
+
const [pendingUrl, setPendingUrl] = useState6(null);
|
|
29049
29249
|
const handleBuilderExit = useCallback2(
|
|
29050
29250
|
(e, url) => {
|
|
29051
29251
|
if (isBuilder) {
|
|
@@ -29065,23 +29265,23 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
29065
29265
|
const renderDesktopTab = (tab, index) => {
|
|
29066
29266
|
const finalClasses = [baseClasses, isActive(tab.url) ? activeClasses : hoverClasses, tab.className || ""].join(" ");
|
|
29067
29267
|
if (Array.isArray(tab.children) && tab.children.length > 0 && tab.isDropDown) {
|
|
29068
|
-
return /* @__PURE__ */
|
|
29069
|
-
/* @__PURE__ */
|
|
29268
|
+
return /* @__PURE__ */ jsxs32(DropdownMenu, { children: [
|
|
29269
|
+
/* @__PURE__ */ jsxs32(DropdownMenuTrigger, { className: `${finalClasses} inline-flex items-center gap-1`, children: [
|
|
29070
29270
|
tab.header,
|
|
29071
|
-
/* @__PURE__ */
|
|
29271
|
+
/* @__PURE__ */ jsx54(ChevronDown, { className: "h-4 w-4 opacity-80" })
|
|
29072
29272
|
] }),
|
|
29073
|
-
/* @__PURE__ */
|
|
29273
|
+
/* @__PURE__ */ jsx54(
|
|
29074
29274
|
DropdownMenuContent,
|
|
29075
29275
|
{
|
|
29076
29276
|
align: "start",
|
|
29077
29277
|
sideOffset: 6,
|
|
29078
29278
|
className: "z-50 min-w-[160px] rounded-md border border-gray-200 bg-white p-1 shadow-lg",
|
|
29079
|
-
children: tab.children.map((item) => /* @__PURE__ */
|
|
29279
|
+
children: tab.children.map((item) => /* @__PURE__ */ jsx54(
|
|
29080
29280
|
DropdownMenuItem,
|
|
29081
29281
|
{
|
|
29082
29282
|
asChild: true,
|
|
29083
29283
|
className: "cursor-pointer rounded-sm px-3 py-2 text-[12px] text-gray-800 hover:bg-gray-100 focus:bg-gray-100",
|
|
29084
|
-
children: /* @__PURE__ */
|
|
29284
|
+
children: /* @__PURE__ */ jsx54(Link5, { href: item.url || "#", onClick: (e) => handleBuilderExit(e, item.url || "#"), children: item.header })
|
|
29085
29285
|
},
|
|
29086
29286
|
item.id
|
|
29087
29287
|
))
|
|
@@ -29089,7 +29289,7 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
29089
29289
|
)
|
|
29090
29290
|
] }, index);
|
|
29091
29291
|
}
|
|
29092
|
-
return tab.url ? /* @__PURE__ */
|
|
29292
|
+
return tab.url ? /* @__PURE__ */ jsx54(
|
|
29093
29293
|
Link5,
|
|
29094
29294
|
{
|
|
29095
29295
|
href: tab.url,
|
|
@@ -29099,14 +29299,14 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
29099
29299
|
children: tab.header
|
|
29100
29300
|
},
|
|
29101
29301
|
index
|
|
29102
|
-
) : /* @__PURE__ */
|
|
29302
|
+
) : /* @__PURE__ */ jsx54("div", { className: finalClasses, style: tab.style, role: "button", tabIndex: 0, children: tab.header }, index);
|
|
29103
29303
|
};
|
|
29104
|
-
const renderMobileMenu = () => /* @__PURE__ */
|
|
29105
|
-
/* @__PURE__ */
|
|
29106
|
-
/* @__PURE__ */
|
|
29304
|
+
const renderMobileMenu = () => /* @__PURE__ */ jsxs32(DropdownMenu, { children: [
|
|
29305
|
+
/* @__PURE__ */ jsxs32(DropdownMenuTrigger, { className: "flex items-center gap-2 px-3 py-2 rounded-md bg-white/10 text-white text-sm", children: [
|
|
29306
|
+
/* @__PURE__ */ jsx54(Menu, { className: "h-4 w-4" }),
|
|
29107
29307
|
"Menu"
|
|
29108
29308
|
] }),
|
|
29109
|
-
/* @__PURE__ */
|
|
29309
|
+
/* @__PURE__ */ jsx54(
|
|
29110
29310
|
DropdownMenuContent,
|
|
29111
29311
|
{
|
|
29112
29312
|
align: "start",
|
|
@@ -29115,25 +29315,25 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
29115
29315
|
children: rawTabs.map((tab, i) => {
|
|
29116
29316
|
const hasChildren = Array.isArray(tab.children) && tab.children.length > 0 && tab.isDropDown;
|
|
29117
29317
|
if (hasChildren) {
|
|
29118
|
-
return /* @__PURE__ */
|
|
29119
|
-
/* @__PURE__ */
|
|
29120
|
-
/* @__PURE__ */
|
|
29318
|
+
return /* @__PURE__ */ jsxs32(DropdownMenuSub, { children: [
|
|
29319
|
+
/* @__PURE__ */ jsx54(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 }),
|
|
29320
|
+
/* @__PURE__ */ jsx54(DropdownMenuSubContent, { className: "bg-white border shadow-lg rounded-md p-1", children: tab.children.map((item) => /* @__PURE__ */ jsx54(
|
|
29121
29321
|
DropdownMenuItem,
|
|
29122
29322
|
{
|
|
29123
29323
|
asChild: true,
|
|
29124
29324
|
className: "cursor-pointer rounded-sm px-3 py-2 text-[12px] text-gray-800 hover:bg-gray-100",
|
|
29125
|
-
children: /* @__PURE__ */
|
|
29325
|
+
children: /* @__PURE__ */ jsx54(Link5, { href: item.url || "#", onClick: (e) => handleBuilderExit(e, item.url || "#"), children: item.header })
|
|
29126
29326
|
},
|
|
29127
29327
|
item.id
|
|
29128
29328
|
)) })
|
|
29129
29329
|
] }, i);
|
|
29130
29330
|
}
|
|
29131
|
-
return /* @__PURE__ */
|
|
29331
|
+
return /* @__PURE__ */ jsx54(
|
|
29132
29332
|
DropdownMenuItem,
|
|
29133
29333
|
{
|
|
29134
29334
|
asChild: true,
|
|
29135
29335
|
className: "cursor-pointer rounded-sm px-3 py-2 text-[13px] text-gray-800 hover:bg-gray-100",
|
|
29136
|
-
children: /* @__PURE__ */
|
|
29336
|
+
children: /* @__PURE__ */ jsx54(Link5, { href: tab.url || "#", onClick: (e) => handleBuilderExit(e, tab.url || "#"), children: tab.header })
|
|
29137
29337
|
},
|
|
29138
29338
|
i
|
|
29139
29339
|
);
|
|
@@ -29143,19 +29343,19 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
29143
29343
|
] });
|
|
29144
29344
|
const forceMobile = canvasMode ? canvasMode === "mobile" || canvasMode === "tablet" : void 0;
|
|
29145
29345
|
const forceDesktop = canvasMode ? canvasMode === "desktop" : void 0;
|
|
29146
|
-
return /* @__PURE__ */
|
|
29147
|
-
/* @__PURE__ */
|
|
29148
|
-
forceDesktop !== void 0 ? forceDesktop && /* @__PURE__ */
|
|
29149
|
-
forceMobile !== void 0 ? forceMobile && /* @__PURE__ */
|
|
29346
|
+
return /* @__PURE__ */ jsxs32(Fragment18, { children: [
|
|
29347
|
+
/* @__PURE__ */ jsxs32("div", { className, style, children: [
|
|
29348
|
+
forceDesktop !== void 0 ? forceDesktop && /* @__PURE__ */ jsx54("div", { className: "hidden md:flex", children: /* @__PURE__ */ jsx54("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }) : /* @__PURE__ */ jsx54("div", { className: "hidden md:flex", children: /* @__PURE__ */ jsx54("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }),
|
|
29349
|
+
forceMobile !== void 0 ? forceMobile && /* @__PURE__ */ jsx54("div", { children: renderMobileMenu() }) : /* @__PURE__ */ jsx54("div", { className: "flex md:hidden", children: renderMobileMenu() })
|
|
29150
29350
|
] }),
|
|
29151
|
-
/* @__PURE__ */
|
|
29152
|
-
/* @__PURE__ */
|
|
29153
|
-
/* @__PURE__ */
|
|
29154
|
-
/* @__PURE__ */
|
|
29351
|
+
/* @__PURE__ */ jsx54(Dialog, { open: showExitDialog, onOpenChange: setShowExitDialog, children: /* @__PURE__ */ jsxs32(DialogContent, { className: "bg-[#fff]", children: [
|
|
29352
|
+
/* @__PURE__ */ jsxs32(DialogHeader, { children: [
|
|
29353
|
+
/* @__PURE__ */ jsx54(DialogTitle, { children: "Exit Builder?" }),
|
|
29354
|
+
/* @__PURE__ */ jsx54(DialogDescription, { children: "You are about to leave the builder. Any unsaved changes may be lost." })
|
|
29155
29355
|
] }),
|
|
29156
|
-
/* @__PURE__ */
|
|
29157
|
-
/* @__PURE__ */
|
|
29158
|
-
/* @__PURE__ */
|
|
29356
|
+
/* @__PURE__ */ jsxs32(DialogFooter, { children: [
|
|
29357
|
+
/* @__PURE__ */ jsx54(Button, { className: "cursor-pointer bg-[#12715b] text-[#fff]", variant: "outline", onClick: () => setShowExitDialog(false), children: "Cancel" }),
|
|
29358
|
+
/* @__PURE__ */ jsx54(Button, { className: "cursor-pointer border-[#12715b] border", onClick: confirmExit, children: "Yes, Exit" })
|
|
29159
29359
|
] })
|
|
29160
29360
|
] }) })
|
|
29161
29361
|
] });
|
|
@@ -29163,13 +29363,13 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
29163
29363
|
var Tabs_default = Tabs;
|
|
29164
29364
|
|
|
29165
29365
|
// src/components/Navigation/Stages/Stages.tsx
|
|
29166
|
-
import
|
|
29167
|
-
import { jsx as
|
|
29366
|
+
import React9 from "react";
|
|
29367
|
+
import { jsx as jsx55, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
29168
29368
|
var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStageChange }) => {
|
|
29169
|
-
return /* @__PURE__ */
|
|
29170
|
-
/* @__PURE__ */
|
|
29171
|
-
/* @__PURE__ */
|
|
29172
|
-
/* @__PURE__ */
|
|
29369
|
+
return /* @__PURE__ */ jsx55("div", { className, style, children: /* @__PURE__ */ jsxs33("div", { className: "flex items-center justify-between bg-red p-2 rounded-lg border border-gray-200 w-full", children: [
|
|
29370
|
+
/* @__PURE__ */ jsx55("div", { className: "flex items-center", children: /* @__PURE__ */ jsx55("button", { className: "p-2 hover:bg-gray-100 rounded", children: /* @__PURE__ */ jsx55("svg", { className: "w-4 h-4 text-gray-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx55("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) }) }),
|
|
29371
|
+
/* @__PURE__ */ jsx55("div", { className: "flex items-center flex-1 px-2 flex-wrap gap-2", children: stages?.length > 0 && stages?.map((stage, index) => /* @__PURE__ */ jsxs33(React9.Fragment, { children: [
|
|
29372
|
+
/* @__PURE__ */ jsx55(
|
|
29173
29373
|
"button",
|
|
29174
29374
|
{
|
|
29175
29375
|
className: `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"}`,
|
|
@@ -29181,9 +29381,9 @@ var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStag
|
|
|
29181
29381
|
children: stage.header
|
|
29182
29382
|
}
|
|
29183
29383
|
),
|
|
29184
|
-
index < stages.length - 1 && /* @__PURE__ */
|
|
29384
|
+
index < stages.length - 1 && /* @__PURE__ */ jsx55("div", { className: "flex-shrink-0 w-3 h-px bg-gray-300" })
|
|
29185
29385
|
] }, stage.id)) }),
|
|
29186
|
-
isShowBtn && /* @__PURE__ */
|
|
29386
|
+
isShowBtn && /* @__PURE__ */ jsx55("div", { className: "flex items-center", children: /* @__PURE__ */ jsx55(
|
|
29187
29387
|
"button",
|
|
29188
29388
|
{
|
|
29189
29389
|
className: "bg-[#034486] text-white px-6 py-2 rounded-lg text-sm font-medium transition-colors duration-200 shadow-sm",
|
|
@@ -29201,26 +29401,26 @@ var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStag
|
|
|
29201
29401
|
var Stages_default = StagesComponent;
|
|
29202
29402
|
|
|
29203
29403
|
// src/components/Navigation/Spacer/Spacer.tsx
|
|
29204
|
-
import { jsx as
|
|
29404
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
29205
29405
|
var Spacer = ({ className, style }) => {
|
|
29206
|
-
return /* @__PURE__ */
|
|
29406
|
+
return /* @__PURE__ */ jsx56("div", { className: `${className}`, style });
|
|
29207
29407
|
};
|
|
29208
29408
|
var Spacer_default = Spacer;
|
|
29209
29409
|
|
|
29210
29410
|
// src/components/Navigation/Profile/Profile.tsx
|
|
29211
|
-
import { jsx as
|
|
29411
|
+
import { jsx as jsx57, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
29212
29412
|
|
|
29213
29413
|
// src/components/Navigation/Notification/Notification.tsx
|
|
29214
|
-
import { jsx as
|
|
29414
|
+
import { jsx as jsx58, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
29215
29415
|
|
|
29216
29416
|
// src/components/Navigation/Logo/Logo.tsx
|
|
29217
|
-
import { jsx as
|
|
29417
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
29218
29418
|
|
|
29219
29419
|
// src/components/ui/avatar.tsx
|
|
29220
|
-
import * as
|
|
29420
|
+
import * as React10 from "react";
|
|
29221
29421
|
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
29222
|
-
import { jsx as
|
|
29223
|
-
var Avatar =
|
|
29422
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
29423
|
+
var Avatar = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx60(
|
|
29224
29424
|
AvatarPrimitive.Root,
|
|
29225
29425
|
{
|
|
29226
29426
|
ref,
|
|
@@ -29232,7 +29432,7 @@ var Avatar = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
29232
29432
|
}
|
|
29233
29433
|
));
|
|
29234
29434
|
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
29235
|
-
var AvatarImage =
|
|
29435
|
+
var AvatarImage = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx60(
|
|
29236
29436
|
AvatarPrimitive.Image,
|
|
29237
29437
|
{
|
|
29238
29438
|
ref,
|
|
@@ -29241,7 +29441,7 @@ var AvatarImage = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
29241
29441
|
}
|
|
29242
29442
|
));
|
|
29243
29443
|
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
29244
|
-
var AvatarFallback =
|
|
29444
|
+
var AvatarFallback = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx60(
|
|
29245
29445
|
AvatarPrimitive.Fallback,
|
|
29246
29446
|
{
|
|
29247
29447
|
ref,
|
|
@@ -29259,8 +29459,8 @@ import Link6 from "next/link";
|
|
|
29259
29459
|
import Image3 from "next/image";
|
|
29260
29460
|
import { useRouter as useRouter2 } from "next/navigation";
|
|
29261
29461
|
import { DropdownMenuSeparator } from "@radix-ui/react-dropdown-menu";
|
|
29262
|
-
import { useCallback as useCallback3, useMemo as
|
|
29263
|
-
import { Fragment as Fragment19, jsx as
|
|
29462
|
+
import { useCallback as useCallback3, useMemo as useMemo4, useState as useState7 } from "react";
|
|
29463
|
+
import { Fragment as Fragment19, jsx as jsx61, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
29264
29464
|
function Navbar({
|
|
29265
29465
|
style,
|
|
29266
29466
|
badgeType,
|
|
@@ -29280,8 +29480,8 @@ function Navbar({
|
|
|
29280
29480
|
}) {
|
|
29281
29481
|
const isMobileView = canvasMode === "mobile" || canvasMode === "tablet";
|
|
29282
29482
|
const router = useRouter2();
|
|
29283
|
-
const [showExitDialog, setShowExitDialog] =
|
|
29284
|
-
const [pendingUrl, setPendingUrl] =
|
|
29483
|
+
const [showExitDialog, setShowExitDialog] = useState7(false);
|
|
29484
|
+
const [pendingUrl, setPendingUrl] = useState7(null);
|
|
29285
29485
|
const handleBuilderExit = useCallback3(
|
|
29286
29486
|
(e, url) => {
|
|
29287
29487
|
if (isBuilder) {
|
|
@@ -29298,29 +29498,29 @@ function Navbar({
|
|
|
29298
29498
|
router.push(pendingUrl);
|
|
29299
29499
|
}
|
|
29300
29500
|
};
|
|
29301
|
-
const formatedMenu =
|
|
29501
|
+
const formatedMenu = useMemo4(() => {
|
|
29302
29502
|
if (source === "state" && navList && navList.length) {
|
|
29303
29503
|
return navList.map((i) => ({ ...i, header: i.name || "Menu" }));
|
|
29304
29504
|
}
|
|
29305
29505
|
return list || [];
|
|
29306
29506
|
}, [source, navList]);
|
|
29307
|
-
return /* @__PURE__ */
|
|
29308
|
-
/* @__PURE__ */
|
|
29507
|
+
return /* @__PURE__ */ jsxs36(Fragment19, { children: [
|
|
29508
|
+
/* @__PURE__ */ jsx61(
|
|
29309
29509
|
"nav",
|
|
29310
29510
|
{
|
|
29311
29511
|
className: "w-full border-b border-b-white dark:border-b-gray-800 dark:bg-gray-800 bg-white shadow-sm",
|
|
29312
29512
|
style,
|
|
29313
|
-
children: /* @__PURE__ */
|
|
29314
|
-
/* @__PURE__ */
|
|
29513
|
+
children: /* @__PURE__ */ jsxs36("div", { className: "mx-auto flex max-w-[90%] items-center justify-between px-4 py-4", children: [
|
|
29514
|
+
/* @__PURE__ */ jsx61(
|
|
29315
29515
|
Link6,
|
|
29316
29516
|
{
|
|
29317
29517
|
href: "/",
|
|
29318
29518
|
onClick: (e) => handleBuilderExit(e, "/"),
|
|
29319
29519
|
className: "flex items-center space-x-2",
|
|
29320
|
-
children: imageUrl ? /* @__PURE__ */
|
|
29520
|
+
children: imageUrl ? /* @__PURE__ */ jsx61(Image3, { src: imageUrl, alt: altText, width: 200, height: 200 }) : /* @__PURE__ */ jsx61("span", { className: "font-semibold text-blue-700", children: "Logo" })
|
|
29321
29521
|
}
|
|
29322
29522
|
),
|
|
29323
|
-
!isMobileView && /* @__PURE__ */
|
|
29523
|
+
!isMobileView && /* @__PURE__ */ jsx61("div", { className: "flex items-center space-x-6 sm:hidden md:flex", children: formatedMenu.map((item) => /* @__PURE__ */ jsx61(
|
|
29324
29524
|
Link6,
|
|
29325
29525
|
{
|
|
29326
29526
|
href: item.url || "#",
|
|
@@ -29330,39 +29530,39 @@ function Navbar({
|
|
|
29330
29530
|
},
|
|
29331
29531
|
item.id
|
|
29332
29532
|
)) }),
|
|
29333
|
-
/* @__PURE__ */
|
|
29334
|
-
!isMobileView ? /* @__PURE__ */
|
|
29335
|
-
/* @__PURE__ */
|
|
29336
|
-
/* @__PURE__ */
|
|
29337
|
-
] }) }) : /* @__PURE__ */
|
|
29338
|
-
/* @__PURE__ */
|
|
29339
|
-
/* @__PURE__ */
|
|
29340
|
-
badgeType === "number" && !(hideBadgeWhenZero && badgeCount === 0) && Number(badgeCount) > 0 ? /* @__PURE__ */
|
|
29533
|
+
/* @__PURE__ */ jsxs36("div", { className: "flex items-center space-x-3", children: [
|
|
29534
|
+
!isMobileView ? /* @__PURE__ */ jsx61("div", { className: "flex-1 px-6", children: /* @__PURE__ */ jsxs36("div", { className: "relative w-full max-w-md border border-gray-300 rounded-md", children: [
|
|
29535
|
+
/* @__PURE__ */ jsx61(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 dark:text-white text-gray-400" }),
|
|
29536
|
+
/* @__PURE__ */ jsx61(Input, { placeholder: "Search", className: "pl-9 text-gray-400" })
|
|
29537
|
+
] }) }) : /* @__PURE__ */ jsx61(Button, { variant: "ghost", size: "icon", className: "border border-gray-400", children: /* @__PURE__ */ jsx61(Search, { className: "h-5 w-5 text-gray-400" }) }),
|
|
29538
|
+
/* @__PURE__ */ jsxs36("div", { className: "relative bg-[#E9E9E9] dark:bg-gray-700 rounded-md", children: [
|
|
29539
|
+
/* @__PURE__ */ jsx61(Button, { variant: "ghost", size: "icon", children: /* @__PURE__ */ jsx61(Bell, { className: "h-5 w-5 text-[#1C1B1F] dark:text-gray-400" }) }),
|
|
29540
|
+
badgeType === "number" && !(hideBadgeWhenZero && badgeCount === 0) && Number(badgeCount) > 0 ? /* @__PURE__ */ jsx61("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__ */ jsx61("span", { className: "absolute -top-1 -right-1 flex h-2 w-2 items-center justify-center rounded-full bg-red-500" })
|
|
29341
29541
|
] }),
|
|
29342
|
-
/* @__PURE__ */
|
|
29343
|
-
/* @__PURE__ */
|
|
29344
|
-
!isMobileView && showName && /* @__PURE__ */
|
|
29345
|
-
!isMobileView ? /* @__PURE__ */
|
|
29346
|
-
/* @__PURE__ */
|
|
29542
|
+
/* @__PURE__ */ jsxs36(DropdownMenu, { children: [
|
|
29543
|
+
/* @__PURE__ */ jsx61(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs36("div", { className: "flex items-center space-x-2", children: [
|
|
29544
|
+
!isMobileView && showName && /* @__PURE__ */ jsx61("h4", { className: "text-[#000000] dark:text-gray-300 text-[13px] font-[500] mb-0", children: userName }),
|
|
29545
|
+
!isMobileView ? /* @__PURE__ */ jsxs36(Fragment19, { children: [
|
|
29546
|
+
/* @__PURE__ */ jsx61(Avatar, { className: "cursor-pointer h-8 w-8 text-gray-900", children: profileType === "avatar" ? /* @__PURE__ */ jsx61(
|
|
29347
29547
|
AvatarImage,
|
|
29348
29548
|
{
|
|
29349
29549
|
src: "/images/appbuilder/toolset/profile.svg",
|
|
29350
29550
|
alt: "Profile"
|
|
29351
29551
|
}
|
|
29352
|
-
) : /* @__PURE__ */
|
|
29353
|
-
/* @__PURE__ */
|
|
29552
|
+
) : /* @__PURE__ */ jsx61("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) }) }),
|
|
29553
|
+
/* @__PURE__ */ jsx61(
|
|
29354
29554
|
Button,
|
|
29355
29555
|
{
|
|
29356
29556
|
variant: "ghost",
|
|
29357
29557
|
size: "icon",
|
|
29358
29558
|
className: "text-gray-900 md:hidden dark:invert",
|
|
29359
|
-
children: /* @__PURE__ */
|
|
29559
|
+
children: /* @__PURE__ */ jsx61(Menu, { className: "h-6 w-6" })
|
|
29360
29560
|
}
|
|
29361
29561
|
)
|
|
29362
|
-
] }) : /* @__PURE__ */
|
|
29562
|
+
] }) : /* @__PURE__ */ jsx61(Button, { variant: "ghost", size: "icon", className: "text-gray-900 dark:invert", children: /* @__PURE__ */ jsx61(Menu, { className: "h-6 w-6" }) })
|
|
29363
29563
|
] }) }),
|
|
29364
|
-
/* @__PURE__ */
|
|
29365
|
-
profileMenu && profileMenu.length > 0 && /* @__PURE__ */
|
|
29564
|
+
/* @__PURE__ */ jsxs36(DropdownMenuContent, { align: "end", className: "bg-white dark:bg-gray-800", children: [
|
|
29565
|
+
profileMenu && profileMenu.length > 0 && /* @__PURE__ */ jsx61(Fragment19, { children: profileMenu.map((item) => /* @__PURE__ */ jsx61(DropdownMenuItem, { className: "text-black dark:invert", children: /* @__PURE__ */ jsx61(
|
|
29366
29566
|
Link6,
|
|
29367
29567
|
{
|
|
29368
29568
|
href: item.url || "#",
|
|
@@ -29370,9 +29570,9 @@ function Navbar({
|
|
|
29370
29570
|
children: item.header
|
|
29371
29571
|
}
|
|
29372
29572
|
) }, item.id)) }),
|
|
29373
|
-
/* @__PURE__ */
|
|
29374
|
-
/* @__PURE__ */
|
|
29375
|
-
formatedMenu && formatedMenu.length > 0 && /* @__PURE__ */
|
|
29573
|
+
/* @__PURE__ */ jsxs36("div", { className: "md:hidden", children: [
|
|
29574
|
+
/* @__PURE__ */ jsx61(DropdownMenuSeparator, {}),
|
|
29575
|
+
formatedMenu && formatedMenu.length > 0 && /* @__PURE__ */ jsx61(Fragment19, { children: formatedMenu.map((item) => /* @__PURE__ */ jsx61(DropdownMenuItem, { className: "text-black dark:invert", children: /* @__PURE__ */ jsx61(
|
|
29376
29576
|
Link6,
|
|
29377
29577
|
{
|
|
29378
29578
|
href: item.url || "#",
|
|
@@ -29387,21 +29587,21 @@ function Navbar({
|
|
|
29387
29587
|
] })
|
|
29388
29588
|
}
|
|
29389
29589
|
),
|
|
29390
|
-
/* @__PURE__ */
|
|
29391
|
-
/* @__PURE__ */
|
|
29392
|
-
/* @__PURE__ */
|
|
29393
|
-
/* @__PURE__ */
|
|
29590
|
+
/* @__PURE__ */ jsx61(Dialog, { open: showExitDialog, onOpenChange: setShowExitDialog, children: /* @__PURE__ */ jsxs36(DialogContent, { className: "bg-[#fff]", children: [
|
|
29591
|
+
/* @__PURE__ */ jsxs36(DialogHeader, { children: [
|
|
29592
|
+
/* @__PURE__ */ jsx61(DialogTitle, { children: "Exit Builder?" }),
|
|
29593
|
+
/* @__PURE__ */ jsx61(DialogDescription, { children: "You are about to leave the builder. Any unsaved changes may be lost." })
|
|
29394
29594
|
] }),
|
|
29395
|
-
/* @__PURE__ */
|
|
29396
|
-
/* @__PURE__ */
|
|
29397
|
-
/* @__PURE__ */
|
|
29595
|
+
/* @__PURE__ */ jsxs36(DialogFooter, { children: [
|
|
29596
|
+
/* @__PURE__ */ jsx61(Button, { className: "cursor-pointer bg-[#12715b] text-[#fff]", variant: "outline", onClick: () => setShowExitDialog(false), children: "Cancel" }),
|
|
29597
|
+
/* @__PURE__ */ jsx61(Button, { className: "cursor-pointer border-[#12715b] border", onClick: confirmExit, children: "Yes, Exit" })
|
|
29398
29598
|
] })
|
|
29399
29599
|
] }) })
|
|
29400
29600
|
] });
|
|
29401
29601
|
}
|
|
29402
29602
|
|
|
29403
29603
|
// src/components/Chart/BarChart.tsx
|
|
29404
|
-
import
|
|
29604
|
+
import React11 from "react";
|
|
29405
29605
|
import {
|
|
29406
29606
|
BarChart,
|
|
29407
29607
|
Bar,
|
|
@@ -29414,35 +29614,35 @@ import {
|
|
|
29414
29614
|
ResponsiveContainer,
|
|
29415
29615
|
Legend
|
|
29416
29616
|
} from "recharts";
|
|
29417
|
-
import { jsx as
|
|
29617
|
+
import { jsx as jsx62, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
29418
29618
|
var ChartComponent = ({ className, style, loading, ...props }) => {
|
|
29419
29619
|
const data = Array.isArray(props.data) ? props.data : [];
|
|
29420
29620
|
const chartType = props.chartType || "bar";
|
|
29421
29621
|
const legendsPosition = props.legendsPosition === "middle" || props.legendsPosition === "bottom" ? props.legendsPosition : "top";
|
|
29422
29622
|
if (loading || data.length === 0) {
|
|
29423
|
-
return /* @__PURE__ */
|
|
29623
|
+
return /* @__PURE__ */ jsx62(
|
|
29424
29624
|
"div",
|
|
29425
29625
|
{
|
|
29426
29626
|
className: `flex items-center justify-center w-full h-[300px] md:h-[400px] bg-gray-50 animate-pulse rounded-lg ${className}`,
|
|
29427
29627
|
style,
|
|
29428
|
-
children: /* @__PURE__ */
|
|
29628
|
+
children: /* @__PURE__ */ jsx62("div", { className: "text-gray-400 text-sm md:text-base", children: loading ? "Loading chart report..." : "No data available to display the chart." })
|
|
29429
29629
|
}
|
|
29430
29630
|
);
|
|
29431
29631
|
}
|
|
29432
|
-
return /* @__PURE__ */
|
|
29433
|
-
/* @__PURE__ */
|
|
29434
|
-
/* @__PURE__ */
|
|
29435
|
-
/* @__PURE__ */
|
|
29436
|
-
/* @__PURE__ */
|
|
29437
|
-
/* @__PURE__ */
|
|
29438
|
-
/* @__PURE__ */
|
|
29632
|
+
return /* @__PURE__ */ jsx62("div", { className: `${className} h-[400px]`, style, children: /* @__PURE__ */ jsx62(ResponsiveContainer, { width: "100%", height: "100%", children: chartType === "bar" ? /* @__PURE__ */ jsxs37(BarChart, { data, title: "Leads", desc: "content", children: [
|
|
29633
|
+
/* @__PURE__ */ jsx62(CartesianGrid, { strokeDasharray: "3 3" }),
|
|
29634
|
+
/* @__PURE__ */ jsx62(XAxis, { dataKey: "name" }),
|
|
29635
|
+
/* @__PURE__ */ jsx62(YAxis, {}),
|
|
29636
|
+
/* @__PURE__ */ jsx62(Tooltip, { formatter: (value) => `${value}k` }),
|
|
29637
|
+
/* @__PURE__ */ jsx62(Legend, { verticalAlign: legendsPosition, align: "center" }),
|
|
29638
|
+
/* @__PURE__ */ jsx62(
|
|
29439
29639
|
Bar,
|
|
29440
29640
|
{
|
|
29441
29641
|
dataKey: "value",
|
|
29442
29642
|
fill: "#00695C",
|
|
29443
29643
|
radius: [6, 6, 0, 0],
|
|
29444
29644
|
isAnimationActive: false,
|
|
29445
|
-
children: data.map((entry, index) => /* @__PURE__ */
|
|
29645
|
+
children: data.map((entry, index) => /* @__PURE__ */ jsx62(
|
|
29446
29646
|
"rect",
|
|
29447
29647
|
{
|
|
29448
29648
|
fill: entry.color || "#00695C"
|
|
@@ -29451,16 +29651,16 @@ var ChartComponent = ({ className, style, loading, ...props }) => {
|
|
|
29451
29651
|
))
|
|
29452
29652
|
}
|
|
29453
29653
|
)
|
|
29454
|
-
] }) : /* @__PURE__ */
|
|
29455
|
-
/* @__PURE__ */
|
|
29456
|
-
/* @__PURE__ */
|
|
29457
|
-
/* @__PURE__ */
|
|
29654
|
+
] }) : /* @__PURE__ */ jsxs37(AreaChart, { data, children: [
|
|
29655
|
+
/* @__PURE__ */ jsx62("defs", { children: /* @__PURE__ */ jsxs37("linearGradient", { id: "colorCount", x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
29656
|
+
/* @__PURE__ */ jsx62("stop", { offset: "5%", stopColor: "#00695C", stopOpacity: 0.8 }),
|
|
29657
|
+
/* @__PURE__ */ jsx62("stop", { offset: "95%", stopColor: "#00695C", stopOpacity: 0 })
|
|
29458
29658
|
] }) }),
|
|
29459
|
-
/* @__PURE__ */
|
|
29460
|
-
/* @__PURE__ */
|
|
29461
|
-
/* @__PURE__ */
|
|
29462
|
-
/* @__PURE__ */
|
|
29463
|
-
/* @__PURE__ */
|
|
29659
|
+
/* @__PURE__ */ jsx62(CartesianGrid, { strokeDasharray: "3 3" }),
|
|
29660
|
+
/* @__PURE__ */ jsx62(XAxis, { dataKey: "name" }),
|
|
29661
|
+
/* @__PURE__ */ jsx62(YAxis, {}),
|
|
29662
|
+
/* @__PURE__ */ jsx62(Tooltip, { formatter: (value) => `${value}k` }),
|
|
29663
|
+
/* @__PURE__ */ jsx62(
|
|
29464
29664
|
Area,
|
|
29465
29665
|
{
|
|
29466
29666
|
type: "monotone",
|
|
@@ -29473,10 +29673,10 @@ var ChartComponent = ({ className, style, loading, ...props }) => {
|
|
|
29473
29673
|
)
|
|
29474
29674
|
] }) }) });
|
|
29475
29675
|
};
|
|
29476
|
-
var BarChart_default =
|
|
29676
|
+
var BarChart_default = React11.memo(ChartComponent);
|
|
29477
29677
|
|
|
29478
29678
|
// src/components/Chart/PieChart.tsx
|
|
29479
|
-
import
|
|
29679
|
+
import React12, { useEffect as useEffect23, useMemo as useMemo5, useState as useState8 } from "react";
|
|
29480
29680
|
import {
|
|
29481
29681
|
PieChart,
|
|
29482
29682
|
Pie,
|
|
@@ -29485,7 +29685,7 @@ import {
|
|
|
29485
29685
|
Tooltip as Tooltip2,
|
|
29486
29686
|
LabelList
|
|
29487
29687
|
} from "recharts";
|
|
29488
|
-
import { Fragment as Fragment20, jsx as
|
|
29688
|
+
import { Fragment as Fragment20, jsx as jsx63, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
29489
29689
|
var getRandomColor = () => {
|
|
29490
29690
|
const palette = [
|
|
29491
29691
|
"#2563eb",
|
|
@@ -29505,32 +29705,32 @@ var DonutChart = ({ className, style, loading, ...props }) => {
|
|
|
29505
29705
|
const showLegends = props.showLegends ?? true;
|
|
29506
29706
|
const labelType = props.labelType || "inside";
|
|
29507
29707
|
const canvasMode = props.canvasMode;
|
|
29508
|
-
const data =
|
|
29708
|
+
const data = useMemo5(() => {
|
|
29509
29709
|
if (!Array.isArray(props.data)) return [];
|
|
29510
29710
|
return props.data.map((item) => ({ ...item, color: getRandomColor() }));
|
|
29511
29711
|
}, [props.data]);
|
|
29512
|
-
const total =
|
|
29712
|
+
const total = useMemo5(() => data.reduce((sum, d) => sum + d.value, 0), [data]);
|
|
29513
29713
|
const forceMobile = canvasMode === "mobile" || canvasMode === "tablet";
|
|
29514
|
-
const [mounted, setMounted] =
|
|
29515
|
-
|
|
29714
|
+
const [mounted, setMounted] = useState8(false);
|
|
29715
|
+
useEffect23(() => {
|
|
29516
29716
|
const timeout = setTimeout(() => setMounted(true), 100);
|
|
29517
29717
|
return () => clearTimeout(timeout);
|
|
29518
29718
|
}, []);
|
|
29519
|
-
const renderLegends =
|
|
29719
|
+
const renderLegends = useMemo5(() => {
|
|
29520
29720
|
if (!showLegends) return null;
|
|
29521
|
-
return /* @__PURE__ */
|
|
29721
|
+
return /* @__PURE__ */ jsx63(Fragment20, { children: data.map((d) => /* @__PURE__ */ jsxs38(
|
|
29522
29722
|
"div",
|
|
29523
29723
|
{
|
|
29524
29724
|
className: "flex items-center space-x-2 rounded-md border border-gray-200 px-3 py-2 w-[48%] md:w-auto",
|
|
29525
29725
|
children: [
|
|
29526
|
-
/* @__PURE__ */
|
|
29726
|
+
/* @__PURE__ */ jsx63(
|
|
29527
29727
|
"span",
|
|
29528
29728
|
{
|
|
29529
29729
|
className: "inline-block w-[16px] h-[16px] rounded",
|
|
29530
29730
|
style: { backgroundColor: d.color }
|
|
29531
29731
|
}
|
|
29532
29732
|
),
|
|
29533
|
-
/* @__PURE__ */
|
|
29733
|
+
/* @__PURE__ */ jsx63("span", { className: "text-[#000000] text-[12px] md:text-[13px] font-[500]", children: d.name })
|
|
29534
29734
|
]
|
|
29535
29735
|
},
|
|
29536
29736
|
d.name
|
|
@@ -29538,24 +29738,24 @@ var DonutChart = ({ className, style, loading, ...props }) => {
|
|
|
29538
29738
|
}, [data, showLegends]);
|
|
29539
29739
|
if (!mounted) return null;
|
|
29540
29740
|
if (loading || data.length === 0) {
|
|
29541
|
-
return /* @__PURE__ */
|
|
29741
|
+
return /* @__PURE__ */ jsx63(
|
|
29542
29742
|
"div",
|
|
29543
29743
|
{
|
|
29544
29744
|
className: `flex items-center justify-center w-full h-[300px] md:h-[400px] bg-gray-50 animate-pulse rounded-lg ${className}`,
|
|
29545
29745
|
style,
|
|
29546
|
-
children: /* @__PURE__ */
|
|
29746
|
+
children: /* @__PURE__ */ jsx63("div", { className: "text-gray-400 text-sm md:text-base", children: loading ? "Loading chart report..." : "No data available to display the chart." })
|
|
29547
29747
|
}
|
|
29548
29748
|
);
|
|
29549
29749
|
}
|
|
29550
|
-
return /* @__PURE__ */
|
|
29750
|
+
return /* @__PURE__ */ jsxs38(
|
|
29551
29751
|
"div",
|
|
29552
29752
|
{
|
|
29553
29753
|
className: `relative flex flex-col items-center ${className}`,
|
|
29554
29754
|
style,
|
|
29555
29755
|
children: [
|
|
29556
|
-
/* @__PURE__ */
|
|
29557
|
-
/* @__PURE__ */
|
|
29558
|
-
/* @__PURE__ */
|
|
29756
|
+
/* @__PURE__ */ jsxs38("div", { className: "relative w-full md:w-[70%] h-[300px] md:h-[400px] flex items-center justify-center", children: [
|
|
29757
|
+
/* @__PURE__ */ jsx63(ResponsiveContainer2, { width: "99%", height: "100%", children: /* @__PURE__ */ jsxs38(PieChart, { children: [
|
|
29758
|
+
/* @__PURE__ */ jsxs38(
|
|
29559
29759
|
Pie,
|
|
29560
29760
|
{
|
|
29561
29761
|
data,
|
|
@@ -29567,8 +29767,8 @@ var DonutChart = ({ className, style, loading, ...props }) => {
|
|
|
29567
29767
|
labelLine: false,
|
|
29568
29768
|
isAnimationActive: false,
|
|
29569
29769
|
children: [
|
|
29570
|
-
data.map((entry, index) => /* @__PURE__ */
|
|
29571
|
-
/* @__PURE__ */
|
|
29770
|
+
data.map((entry, index) => /* @__PURE__ */ jsx63(Cell, { fill: entry.color }, `cell-${index}`)),
|
|
29771
|
+
/* @__PURE__ */ jsx63(
|
|
29572
29772
|
LabelList,
|
|
29573
29773
|
{
|
|
29574
29774
|
dataKey: "value",
|
|
@@ -29581,14 +29781,14 @@ var DonutChart = ({ className, style, loading, ...props }) => {
|
|
|
29581
29781
|
]
|
|
29582
29782
|
}
|
|
29583
29783
|
),
|
|
29584
|
-
/* @__PURE__ */
|
|
29784
|
+
/* @__PURE__ */ jsx63(
|
|
29585
29785
|
Tooltip2,
|
|
29586
29786
|
{
|
|
29587
29787
|
formatter: (value, name) => [`${value}k`, name]
|
|
29588
29788
|
}
|
|
29589
29789
|
)
|
|
29590
29790
|
] }) }),
|
|
29591
|
-
/* @__PURE__ */
|
|
29791
|
+
/* @__PURE__ */ jsxs38(
|
|
29592
29792
|
"div",
|
|
29593
29793
|
{
|
|
29594
29794
|
className: `absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 ${forceMobile ? "text-2xl" : "text-4xl"} font-bold text-[#000]`,
|
|
@@ -29599,18 +29799,18 @@ var DonutChart = ({ className, style, loading, ...props }) => {
|
|
|
29599
29799
|
}
|
|
29600
29800
|
)
|
|
29601
29801
|
] }),
|
|
29602
|
-
/* @__PURE__ */
|
|
29802
|
+
/* @__PURE__ */ jsx63("div", { className: "flex flex-wrap justify-center gap-2 mt-6 w-full md:w-auto", children: renderLegends })
|
|
29603
29803
|
]
|
|
29604
29804
|
}
|
|
29605
29805
|
);
|
|
29606
29806
|
};
|
|
29607
|
-
var PieChart_default =
|
|
29807
|
+
var PieChart_default = React12.memo(DonutChart);
|
|
29608
29808
|
|
|
29609
29809
|
// src/components/Blocks/EmailComposer.tsx
|
|
29610
|
-
import { jsx as
|
|
29810
|
+
import { jsx as jsx64, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
29611
29811
|
function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc, setShowBcc, cc, setCc, bcc, setBcc, subject, setSubject, body, setBody }) {
|
|
29612
|
-
return /* @__PURE__ */
|
|
29613
|
-
/* @__PURE__ */
|
|
29812
|
+
return /* @__PURE__ */ jsx64("div", { className, style, children: /* @__PURE__ */ jsxs39("div", { className: "border rounded-md shadow bg-[#fff] p-4 mx-auto z-[50] relative", children: [
|
|
29813
|
+
/* @__PURE__ */ jsx64("div", { className: "mb-3", children: /* @__PURE__ */ jsx64(
|
|
29614
29814
|
"input",
|
|
29615
29815
|
{
|
|
29616
29816
|
type: "email",
|
|
@@ -29619,8 +29819,8 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
29619
29819
|
required: true
|
|
29620
29820
|
}
|
|
29621
29821
|
) }),
|
|
29622
|
-
/* @__PURE__ */
|
|
29623
|
-
/* @__PURE__ */
|
|
29822
|
+
/* @__PURE__ */ jsx64("div", { className: "mb-3", children: /* @__PURE__ */ jsxs39("div", { className: "flex items-center gap-2", children: [
|
|
29823
|
+
/* @__PURE__ */ jsx64(
|
|
29624
29824
|
"input",
|
|
29625
29825
|
{
|
|
29626
29826
|
type: "email",
|
|
@@ -29631,7 +29831,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
29631
29831
|
required: true
|
|
29632
29832
|
}
|
|
29633
29833
|
),
|
|
29634
|
-
!showCc && /* @__PURE__ */
|
|
29834
|
+
!showCc && /* @__PURE__ */ jsx64(
|
|
29635
29835
|
"button",
|
|
29636
29836
|
{
|
|
29637
29837
|
onClick: () => setShowCc?.(true),
|
|
@@ -29639,7 +29839,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
29639
29839
|
children: "Cc"
|
|
29640
29840
|
}
|
|
29641
29841
|
),
|
|
29642
|
-
!showBcc && /* @__PURE__ */
|
|
29842
|
+
!showBcc && /* @__PURE__ */ jsx64(
|
|
29643
29843
|
"button",
|
|
29644
29844
|
{
|
|
29645
29845
|
onClick: () => setShowBcc?.(true),
|
|
@@ -29648,7 +29848,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
29648
29848
|
}
|
|
29649
29849
|
)
|
|
29650
29850
|
] }) }),
|
|
29651
|
-
showCc && /* @__PURE__ */
|
|
29851
|
+
showCc && /* @__PURE__ */ jsx64("div", { className: "mb-3", children: /* @__PURE__ */ jsx64(
|
|
29652
29852
|
"input",
|
|
29653
29853
|
{
|
|
29654
29854
|
type: "text",
|
|
@@ -29658,7 +29858,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
29658
29858
|
className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
|
|
29659
29859
|
}
|
|
29660
29860
|
) }),
|
|
29661
|
-
showBcc && /* @__PURE__ */
|
|
29861
|
+
showBcc && /* @__PURE__ */ jsx64("div", { className: "mb-3", children: /* @__PURE__ */ jsx64(
|
|
29662
29862
|
"input",
|
|
29663
29863
|
{
|
|
29664
29864
|
type: "text",
|
|
@@ -29668,7 +29868,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
29668
29868
|
className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
|
|
29669
29869
|
}
|
|
29670
29870
|
) }),
|
|
29671
|
-
/* @__PURE__ */
|
|
29871
|
+
/* @__PURE__ */ jsx64("div", { className: "mb-3", children: /* @__PURE__ */ jsx64(
|
|
29672
29872
|
"input",
|
|
29673
29873
|
{
|
|
29674
29874
|
type: "text",
|
|
@@ -29678,11 +29878,11 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
29678
29878
|
className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
|
|
29679
29879
|
}
|
|
29680
29880
|
) }),
|
|
29681
|
-
/* @__PURE__ */
|
|
29682
|
-
/* @__PURE__ */
|
|
29683
|
-
/* @__PURE__ */
|
|
29684
|
-
/* @__PURE__ */
|
|
29685
|
-
/* @__PURE__ */
|
|
29881
|
+
/* @__PURE__ */ jsx64("div", { className: "mb-4", children: /* @__PURE__ */ jsx64(MyEditor, { value: body, onChange: setBody }) }),
|
|
29882
|
+
/* @__PURE__ */ jsxs39("div", { className: "flex justify-end gap-2", children: [
|
|
29883
|
+
/* @__PURE__ */ jsx64("button", { className: "px-4 py-2 rounded-md text-gray-600 hover:bg-gray-100", children: "Discard" }),
|
|
29884
|
+
/* @__PURE__ */ jsx64("button", { className: "px-4 py-2 rounded-md border text-[#12715B] border-[#12715B]", children: "Reset" }),
|
|
29885
|
+
/* @__PURE__ */ jsx64("button", { className: "px-4 py-2 rounded-md bg-[#12715B] text-white", children: "Send" })
|
|
29686
29886
|
] })
|
|
29687
29887
|
] }) });
|
|
29688
29888
|
}
|
|
@@ -29727,10 +29927,10 @@ function showSonnerToast({
|
|
|
29727
29927
|
// src/components/ui/sonner.tsx
|
|
29728
29928
|
import { useTheme } from "next-themes";
|
|
29729
29929
|
import { Toaster as Sonner } from "sonner";
|
|
29730
|
-
import { jsx as
|
|
29930
|
+
import { jsx as jsx65 } from "react/jsx-runtime";
|
|
29731
29931
|
var Toaster = ({ ...props }) => {
|
|
29732
29932
|
const { theme = "system" } = useTheme();
|
|
29733
|
-
return /* @__PURE__ */
|
|
29933
|
+
return /* @__PURE__ */ jsx65(
|
|
29734
29934
|
Sonner,
|
|
29735
29935
|
{
|
|
29736
29936
|
theme,
|
|
@@ -29765,6 +29965,7 @@ export {
|
|
|
29765
29965
|
Image_default as Image,
|
|
29766
29966
|
Modal,
|
|
29767
29967
|
MultiCheckbox_default as MultiCheckbox,
|
|
29968
|
+
MultiSelect_default as MultiSelect,
|
|
29768
29969
|
Navbar,
|
|
29769
29970
|
NumberInput_default as NumberInput,
|
|
29770
29971
|
Pagination_default as Pagination,
|