@algorithm-shift/design-system 1.2.74 → 1.2.76
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 +27 -8
- package/dist/index.d.ts +27 -8
- package/dist/index.js +541 -336
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +557 -353
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
package/dist/index.mjs
CHANGED
|
@@ -28268,8 +28268,327 @@ 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
|
+
dataKey = "value",
|
|
28507
|
+
dataLabel = "label",
|
|
28508
|
+
...props
|
|
28509
|
+
}) => {
|
|
28510
|
+
const [open, setOpen] = React7.useState(false);
|
|
28511
|
+
React7.useEffect(() => {
|
|
28512
|
+
if (value) {
|
|
28513
|
+
onChange(value);
|
|
28514
|
+
}
|
|
28515
|
+
}, []);
|
|
28516
|
+
const toggleOption = (val) => {
|
|
28517
|
+
onChange(
|
|
28518
|
+
value?.includes(val) ? value.filter((v) => v !== val) : [...value || [], val]
|
|
28519
|
+
);
|
|
28520
|
+
};
|
|
28521
|
+
const selectedLabels = React7.useMemo(
|
|
28522
|
+
() => data.filter((opt) => value.includes(opt.value)).map((opt) => opt.label),
|
|
28523
|
+
[data, value]
|
|
28524
|
+
);
|
|
28525
|
+
const options = data.map((item) => ({
|
|
28526
|
+
value: item[dataKey],
|
|
28527
|
+
label: item[dataLabel]
|
|
28528
|
+
}));
|
|
28529
|
+
return /* @__PURE__ */ jsxs28(Popover, { open, onOpenChange: setOpen, children: [
|
|
28530
|
+
/* @__PURE__ */ jsx48(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs28(
|
|
28531
|
+
Button,
|
|
28532
|
+
{
|
|
28533
|
+
variant: "outline",
|
|
28534
|
+
role: "combobox",
|
|
28535
|
+
className: `w-full justify-between ${className} ${props.errorMessage ? "border-red-500" : ""}`,
|
|
28536
|
+
disabled,
|
|
28537
|
+
type: "button",
|
|
28538
|
+
children: [
|
|
28539
|
+
/* @__PURE__ */ jsx48("span", { className: "truncate", children: selectedLabels.length > 0 ? selectedLabels.join(", ") : placeholder }),
|
|
28540
|
+
/* @__PURE__ */ jsx48(ChevronsUpDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
28541
|
+
]
|
|
28542
|
+
}
|
|
28543
|
+
) }),
|
|
28544
|
+
/* @__PURE__ */ jsx48(
|
|
28545
|
+
PopoverContent,
|
|
28546
|
+
{
|
|
28547
|
+
align: "start",
|
|
28548
|
+
className: "w-[var(--radix-popover-trigger-width)] p-0",
|
|
28549
|
+
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
28550
|
+
onInteractOutside: (e) => {
|
|
28551
|
+
if (e.target.closest(".keep-open")) e.preventDefault();
|
|
28552
|
+
},
|
|
28553
|
+
children: /* @__PURE__ */ jsxs28(Command2, { shouldFilter: searchable, children: [
|
|
28554
|
+
searchable && /* @__PURE__ */ jsx48(CommandInput, { placeholder: "Search..." }),
|
|
28555
|
+
/* @__PURE__ */ jsxs28(CommandList, { children: [
|
|
28556
|
+
/* @__PURE__ */ jsx48(CommandEmpty, { children: "No options found." }),
|
|
28557
|
+
/* @__PURE__ */ jsx48(CommandGroup, { children: options.map((opt) => {
|
|
28558
|
+
const isSelected = value.includes(opt.value);
|
|
28559
|
+
return /* @__PURE__ */ jsx48(
|
|
28560
|
+
"div",
|
|
28561
|
+
{
|
|
28562
|
+
className: "keep-open",
|
|
28563
|
+
children: /* @__PURE__ */ jsx48(
|
|
28564
|
+
CommandItem,
|
|
28565
|
+
{
|
|
28566
|
+
onMouseDown: (e) => {
|
|
28567
|
+
e.preventDefault();
|
|
28568
|
+
toggleOption(opt.value);
|
|
28569
|
+
},
|
|
28570
|
+
children: /* @__PURE__ */ jsxs28("div", { className: "flex items-center gap-2", children: [
|
|
28571
|
+
/* @__PURE__ */ jsx48(Checkbox, { checked: isSelected }),
|
|
28572
|
+
/* @__PURE__ */ jsx48("span", { children: opt.label })
|
|
28573
|
+
] })
|
|
28574
|
+
},
|
|
28575
|
+
opt.value
|
|
28576
|
+
)
|
|
28577
|
+
},
|
|
28578
|
+
opt.value
|
|
28579
|
+
);
|
|
28580
|
+
}) })
|
|
28581
|
+
] })
|
|
28582
|
+
] })
|
|
28583
|
+
}
|
|
28584
|
+
),
|
|
28585
|
+
props.errorMessage && /* @__PURE__ */ jsx48("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
28586
|
+
] });
|
|
28587
|
+
};
|
|
28588
|
+
var MultiSelect_default = MultiSelect;
|
|
28589
|
+
|
|
28590
|
+
// src/components/ui/data-table.tsx
|
|
28591
|
+
import * as React8 from "react";
|
|
28273
28592
|
import { faEllipsisH } from "@fortawesome/free-solid-svg-icons";
|
|
28274
28593
|
import { FontAwesomeIcon as FontAwesomeIcon3 } from "@fortawesome/react-fontawesome";
|
|
28275
28594
|
import {
|
|
@@ -28281,14 +28600,14 @@ import {
|
|
|
28281
28600
|
} from "@tanstack/react-table";
|
|
28282
28601
|
|
|
28283
28602
|
// src/components/ui/table.tsx
|
|
28284
|
-
import { jsx as
|
|
28603
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
28285
28604
|
function Table3({ className, ...props }) {
|
|
28286
|
-
return /* @__PURE__ */
|
|
28605
|
+
return /* @__PURE__ */ jsx49(
|
|
28287
28606
|
"div",
|
|
28288
28607
|
{
|
|
28289
28608
|
"data-slot": "table-container",
|
|
28290
28609
|
className: "relative w-full overflow-x-auto rounded-md border border-gray-200 bg-white",
|
|
28291
|
-
children: /* @__PURE__ */
|
|
28610
|
+
children: /* @__PURE__ */ jsx49(
|
|
28292
28611
|
"table",
|
|
28293
28612
|
{
|
|
28294
28613
|
"data-slot": "table",
|
|
@@ -28300,7 +28619,7 @@ function Table3({ className, ...props }) {
|
|
|
28300
28619
|
);
|
|
28301
28620
|
}
|
|
28302
28621
|
function TableHeader({ className, ...props }) {
|
|
28303
|
-
return /* @__PURE__ */
|
|
28622
|
+
return /* @__PURE__ */ jsx49(
|
|
28304
28623
|
"thead",
|
|
28305
28624
|
{
|
|
28306
28625
|
"data-slot": "table-header",
|
|
@@ -28313,7 +28632,7 @@ function TableHeader({ className, ...props }) {
|
|
|
28313
28632
|
);
|
|
28314
28633
|
}
|
|
28315
28634
|
function TableBody({ className, ...props }) {
|
|
28316
|
-
return /* @__PURE__ */
|
|
28635
|
+
return /* @__PURE__ */ jsx49(
|
|
28317
28636
|
"tbody",
|
|
28318
28637
|
{
|
|
28319
28638
|
"data-slot": "table-body",
|
|
@@ -28326,7 +28645,7 @@ function TableBody({ className, ...props }) {
|
|
|
28326
28645
|
);
|
|
28327
28646
|
}
|
|
28328
28647
|
function TableRow({ className, ...props }) {
|
|
28329
|
-
return /* @__PURE__ */
|
|
28648
|
+
return /* @__PURE__ */ jsx49(
|
|
28330
28649
|
"tr",
|
|
28331
28650
|
{
|
|
28332
28651
|
"data-slot": "table-row",
|
|
@@ -28339,7 +28658,7 @@ function TableRow({ className, ...props }) {
|
|
|
28339
28658
|
);
|
|
28340
28659
|
}
|
|
28341
28660
|
function TableHead({ className, ...props }) {
|
|
28342
|
-
return /* @__PURE__ */
|
|
28661
|
+
return /* @__PURE__ */ jsx49(
|
|
28343
28662
|
"th",
|
|
28344
28663
|
{
|
|
28345
28664
|
"data-slot": "table-head",
|
|
@@ -28352,7 +28671,7 @@ function TableHead({ className, ...props }) {
|
|
|
28352
28671
|
);
|
|
28353
28672
|
}
|
|
28354
28673
|
function TableCell({ className, ...props }) {
|
|
28355
|
-
return /* @__PURE__ */
|
|
28674
|
+
return /* @__PURE__ */ jsx49(
|
|
28356
28675
|
"td",
|
|
28357
28676
|
{
|
|
28358
28677
|
"data-slot": "table-cell",
|
|
@@ -28366,7 +28685,7 @@ function TableCell({ className, ...props }) {
|
|
|
28366
28685
|
}
|
|
28367
28686
|
|
|
28368
28687
|
// src/components/ui/data-table.tsx
|
|
28369
|
-
import { Fragment as Fragment17, jsx as
|
|
28688
|
+
import { Fragment as Fragment17, jsx as jsx50, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
28370
28689
|
function DataTable({
|
|
28371
28690
|
columns,
|
|
28372
28691
|
data,
|
|
@@ -28383,10 +28702,10 @@ function DataTable({
|
|
|
28383
28702
|
globalSearch,
|
|
28384
28703
|
onCellClick
|
|
28385
28704
|
}) {
|
|
28386
|
-
const [columnFilters, setColumnFilters] =
|
|
28387
|
-
const [columnVisibility, setColumnVisibility] =
|
|
28388
|
-
const [manualSort, setManualSort] =
|
|
28389
|
-
const [searchTerm, setSearchTerm] =
|
|
28705
|
+
const [columnFilters, setColumnFilters] = React8.useState([]);
|
|
28706
|
+
const [columnVisibility, setColumnVisibility] = React8.useState({});
|
|
28707
|
+
const [manualSort, setManualSort] = React8.useState(null);
|
|
28708
|
+
const [searchTerm, setSearchTerm] = React8.useState("");
|
|
28390
28709
|
const table = useReactTable({
|
|
28391
28710
|
data,
|
|
28392
28711
|
columns,
|
|
@@ -28434,11 +28753,11 @@ function DataTable({
|
|
|
28434
28753
|
}
|
|
28435
28754
|
return [];
|
|
28436
28755
|
};
|
|
28437
|
-
return /* @__PURE__ */
|
|
28438
|
-
/* @__PURE__ */
|
|
28439
|
-
globalSearch && /* @__PURE__ */
|
|
28440
|
-
/* @__PURE__ */
|
|
28441
|
-
/* @__PURE__ */
|
|
28756
|
+
return /* @__PURE__ */ jsxs29("div", { className: "overflow-hidden rounded-md w-full", children: [
|
|
28757
|
+
/* @__PURE__ */ jsxs29("div", { className: `flex ${globalSearch ? "justify-between" : "justify-end"} p-2 bg-gray-50`, children: [
|
|
28758
|
+
globalSearch && /* @__PURE__ */ jsxs29("div", { className: "flex items-center gap-2 w-full max-w-sm", children: [
|
|
28759
|
+
/* @__PURE__ */ jsxs29("div", { className: "relative w-full", children: [
|
|
28760
|
+
/* @__PURE__ */ jsx50(
|
|
28442
28761
|
"input",
|
|
28443
28762
|
{
|
|
28444
28763
|
type: "text",
|
|
@@ -28453,9 +28772,9 @@ function DataTable({
|
|
|
28453
28772
|
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
28773
|
}
|
|
28455
28774
|
),
|
|
28456
|
-
/* @__PURE__ */
|
|
28775
|
+
/* @__PURE__ */ jsx50(Search, { className: "absolute left-2 top-2.5 text-gray-400", size: 16 })
|
|
28457
28776
|
] }),
|
|
28458
|
-
/* @__PURE__ */
|
|
28777
|
+
/* @__PURE__ */ jsx50(
|
|
28459
28778
|
Button,
|
|
28460
28779
|
{
|
|
28461
28780
|
size: "sm",
|
|
@@ -28465,8 +28784,8 @@ function DataTable({
|
|
|
28465
28784
|
}
|
|
28466
28785
|
)
|
|
28467
28786
|
] }),
|
|
28468
|
-
/* @__PURE__ */
|
|
28469
|
-
/* @__PURE__ */
|
|
28787
|
+
/* @__PURE__ */ jsxs29(Popover, { children: [
|
|
28788
|
+
/* @__PURE__ */ jsx50(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx50(
|
|
28470
28789
|
Button,
|
|
28471
28790
|
{
|
|
28472
28791
|
variant: "outline",
|
|
@@ -28475,10 +28794,10 @@ function DataTable({
|
|
|
28475
28794
|
children: "Manage Columns"
|
|
28476
28795
|
}
|
|
28477
28796
|
) }),
|
|
28478
|
-
/* @__PURE__ */
|
|
28479
|
-
/* @__PURE__ */
|
|
28480
|
-
/* @__PURE__ */
|
|
28481
|
-
/* @__PURE__ */
|
|
28797
|
+
/* @__PURE__ */ jsxs29(PopoverContent, { align: "end", className: "w-48 p-3 space-y-2", children: [
|
|
28798
|
+
/* @__PURE__ */ jsx50("div", { className: "text-sm font-medium mb-2", children: "Show / Hide Columns" }),
|
|
28799
|
+
/* @__PURE__ */ jsxs29("label", { className: "flex items-center gap-2 text-sm font-semibold border-b pb-2 mb-2", children: [
|
|
28800
|
+
/* @__PURE__ */ jsx50(
|
|
28482
28801
|
"input",
|
|
28483
28802
|
{
|
|
28484
28803
|
type: "checkbox",
|
|
@@ -28497,8 +28816,8 @@ function DataTable({
|
|
|
28497
28816
|
),
|
|
28498
28817
|
"Toggle All"
|
|
28499
28818
|
] }),
|
|
28500
|
-
table.getAllLeafColumns().map((column) => /* @__PURE__ */
|
|
28501
|
-
/* @__PURE__ */
|
|
28819
|
+
table.getAllLeafColumns().map((column) => /* @__PURE__ */ jsxs29("label", { className: "flex items-center gap-2 text-sm", children: [
|
|
28820
|
+
/* @__PURE__ */ jsx50(
|
|
28502
28821
|
"input",
|
|
28503
28822
|
{
|
|
28504
28823
|
type: "checkbox",
|
|
@@ -28511,13 +28830,13 @@ function DataTable({
|
|
|
28511
28830
|
] })
|
|
28512
28831
|
] })
|
|
28513
28832
|
] }),
|
|
28514
|
-
/* @__PURE__ */
|
|
28515
|
-
/* @__PURE__ */
|
|
28833
|
+
/* @__PURE__ */ jsxs29(Table3, { children: [
|
|
28834
|
+
/* @__PURE__ */ jsx50(TableHeader, { children: table.getHeaderGroups().map((hg) => /* @__PURE__ */ jsx50(TableRow, { children: hg.headers.map((header) => {
|
|
28516
28835
|
const canSort = header.column.getCanSort();
|
|
28517
28836
|
const canFilter = header.column.getCanFilter();
|
|
28518
28837
|
const sortDir = manualSort?.key === header.column.id ? manualSort.dir : null;
|
|
28519
|
-
return /* @__PURE__ */
|
|
28520
|
-
/* @__PURE__ */
|
|
28838
|
+
return /* @__PURE__ */ jsx50(TableHead, { className: "relative select-none", children: /* @__PURE__ */ jsxs29("div", { className: "flex items-center justify-between", children: [
|
|
28839
|
+
/* @__PURE__ */ jsxs29(
|
|
28521
28840
|
"span",
|
|
28522
28841
|
{
|
|
28523
28842
|
className: `flex items-center gap-1 ${canSort ? "cursor-pointer" : ""}`,
|
|
@@ -28529,32 +28848,32 @@ function DataTable({
|
|
|
28529
28848
|
},
|
|
28530
28849
|
children: [
|
|
28531
28850
|
flexRender(header.column.columnDef.header, header.getContext()),
|
|
28532
|
-
canSort && /* @__PURE__ */
|
|
28533
|
-
sortDir === "asc" && /* @__PURE__ */
|
|
28534
|
-
sortDir === "desc" && /* @__PURE__ */
|
|
28535
|
-
!sortDir && /* @__PURE__ */
|
|
28851
|
+
canSort && /* @__PURE__ */ jsxs29(Fragment17, { children: [
|
|
28852
|
+
sortDir === "asc" && /* @__PURE__ */ jsx50(ArrowUp, { size: 14, className: "text-gray-500" }),
|
|
28853
|
+
sortDir === "desc" && /* @__PURE__ */ jsx50(ArrowDown, { size: 14, className: "text-gray-500" }),
|
|
28854
|
+
!sortDir && /* @__PURE__ */ jsx50(ArrowUpDown, { size: 14, className: "text-gray-400" })
|
|
28536
28855
|
] })
|
|
28537
28856
|
]
|
|
28538
28857
|
}
|
|
28539
28858
|
),
|
|
28540
|
-
canFilter && /* @__PURE__ */
|
|
28541
|
-
/* @__PURE__ */
|
|
28859
|
+
canFilter && /* @__PURE__ */ jsxs29(Popover, { children: [
|
|
28860
|
+
/* @__PURE__ */ jsx50(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx50(
|
|
28542
28861
|
"span",
|
|
28543
28862
|
{
|
|
28544
28863
|
role: "presentation",
|
|
28545
28864
|
className: "pl-5 cursor-pointer",
|
|
28546
28865
|
onClick: (e) => e.stopPropagation(),
|
|
28547
|
-
children: /* @__PURE__ */
|
|
28866
|
+
children: /* @__PURE__ */ jsx50(FontAwesomeIcon3, { icon: faEllipsisH, className: "w-5 h-5 text-gray-500" })
|
|
28548
28867
|
}
|
|
28549
28868
|
) }),
|
|
28550
|
-
/* @__PURE__ */
|
|
28869
|
+
/* @__PURE__ */ jsx50(
|
|
28551
28870
|
PopoverContent,
|
|
28552
28871
|
{
|
|
28553
28872
|
align: "center",
|
|
28554
28873
|
sideOffset: 14,
|
|
28555
28874
|
className: "w-50 p-3 z-[200] border-gray-300",
|
|
28556
28875
|
avoidCollisions: true,
|
|
28557
|
-
children: /* @__PURE__ */
|
|
28876
|
+
children: /* @__PURE__ */ jsxs29(
|
|
28558
28877
|
"form",
|
|
28559
28878
|
{
|
|
28560
28879
|
onSubmit: (e) => {
|
|
@@ -28567,8 +28886,8 @@ function DataTable({
|
|
|
28567
28886
|
},
|
|
28568
28887
|
className: "space-y-2",
|
|
28569
28888
|
children: [
|
|
28570
|
-
/* @__PURE__ */
|
|
28571
|
-
/* @__PURE__ */
|
|
28889
|
+
/* @__PURE__ */ jsx50("label", { htmlFor: "filter", className: "text-xs text-gray-500 font-normal", children: "Filter by value:" }),
|
|
28890
|
+
/* @__PURE__ */ jsx50(
|
|
28572
28891
|
"input",
|
|
28573
28892
|
{
|
|
28574
28893
|
name: "filter",
|
|
@@ -28578,7 +28897,7 @@ function DataTable({
|
|
|
28578
28897
|
autoComplete: "off"
|
|
28579
28898
|
}
|
|
28580
28899
|
),
|
|
28581
|
-
/* @__PURE__ */
|
|
28900
|
+
/* @__PURE__ */ jsx50("div", { className: "justify-end flex", children: /* @__PURE__ */ jsx50(
|
|
28582
28901
|
Button,
|
|
28583
28902
|
{
|
|
28584
28903
|
type: "submit",
|
|
@@ -28594,10 +28913,10 @@ function DataTable({
|
|
|
28594
28913
|
] })
|
|
28595
28914
|
] }) }, header.id);
|
|
28596
28915
|
}) }, hg.id)) }),
|
|
28597
|
-
/* @__PURE__ */
|
|
28916
|
+
/* @__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
28917
|
const meta = cell.column.columnDef.meta || {};
|
|
28599
28918
|
const isClickable = meta?.isClickable;
|
|
28600
|
-
return /* @__PURE__ */
|
|
28919
|
+
return /* @__PURE__ */ jsx50(
|
|
28601
28920
|
TableCell,
|
|
28602
28921
|
{
|
|
28603
28922
|
className: `${meta?.cellClass ?? ""} ${isClickable ? "cursor-pointer hover:bg-gray-100 underline" : ""}`,
|
|
@@ -28611,17 +28930,17 @@ function DataTable({
|
|
|
28611
28930
|
},
|
|
28612
28931
|
cell.id
|
|
28613
28932
|
);
|
|
28614
|
-
}) }, row.id)) : /* @__PURE__ */
|
|
28933
|
+
}) }, row.id)) : /* @__PURE__ */ jsx50(TableRow, { children: /* @__PURE__ */ jsx50(TableCell, { colSpan: columns.length, className: "h-24 text-center", children: "No results." }) }) })
|
|
28615
28934
|
] }),
|
|
28616
|
-
pagination && /* @__PURE__ */
|
|
28617
|
-
/* @__PURE__ */
|
|
28935
|
+
pagination && /* @__PURE__ */ jsxs29("div", { className: "flex items-center justify-between py-3 px-2 text-sm w-full", children: [
|
|
28936
|
+
/* @__PURE__ */ jsxs29("div", { children: [
|
|
28618
28937
|
"Page ",
|
|
28619
28938
|
table.getState().pagination.pageIndex + 1,
|
|
28620
28939
|
" of ",
|
|
28621
28940
|
table.getPageCount()
|
|
28622
28941
|
] }),
|
|
28623
|
-
/* @__PURE__ */
|
|
28624
|
-
/* @__PURE__ */
|
|
28942
|
+
/* @__PURE__ */ jsxs29("div", { className: "flex items-center gap-2", children: [
|
|
28943
|
+
/* @__PURE__ */ jsx50(
|
|
28625
28944
|
"button",
|
|
28626
28945
|
{
|
|
28627
28946
|
onClick: () => table.previousPage(),
|
|
@@ -28634,7 +28953,7 @@ function DataTable({
|
|
|
28634
28953
|
table.getState().pagination.pageIndex + 1,
|
|
28635
28954
|
table.getPageCount(),
|
|
28636
28955
|
5
|
|
28637
|
-
).map((pageNum, index) => /* @__PURE__ */
|
|
28956
|
+
).map((pageNum, index) => /* @__PURE__ */ jsx50(
|
|
28638
28957
|
"button",
|
|
28639
28958
|
{
|
|
28640
28959
|
disabled: pageNum === "...",
|
|
@@ -28644,7 +28963,7 @@ function DataTable({
|
|
|
28644
28963
|
},
|
|
28645
28964
|
index
|
|
28646
28965
|
)),
|
|
28647
|
-
/* @__PURE__ */
|
|
28966
|
+
/* @__PURE__ */ jsx50(
|
|
28648
28967
|
"button",
|
|
28649
28968
|
{
|
|
28650
28969
|
onClick: () => table.nextPage(),
|
|
@@ -28659,7 +28978,7 @@ function DataTable({
|
|
|
28659
28978
|
}
|
|
28660
28979
|
|
|
28661
28980
|
// src/components/DataDisplay/Table/Table.tsx
|
|
28662
|
-
import { jsx as
|
|
28981
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
28663
28982
|
var Table4 = ({
|
|
28664
28983
|
columns,
|
|
28665
28984
|
data,
|
|
@@ -28682,7 +29001,7 @@ var Table4 = ({
|
|
|
28682
29001
|
const rawColumns = Array.isArray(columns) ? columns : [];
|
|
28683
29002
|
const rawData = Array.isArray(data) ? data : [];
|
|
28684
29003
|
const isControlled = typeof page === "number";
|
|
28685
|
-
return /* @__PURE__ */
|
|
29004
|
+
return /* @__PURE__ */ jsx51("div", { className: `${className || ""} space-y-3`, style, children: /* @__PURE__ */ jsx51(
|
|
28686
29005
|
DataTable,
|
|
28687
29006
|
{
|
|
28688
29007
|
...props,
|
|
@@ -28711,9 +29030,9 @@ var Table4 = ({
|
|
|
28711
29030
|
var Table_default = Table4;
|
|
28712
29031
|
|
|
28713
29032
|
// src/components/ui/pagination.tsx
|
|
28714
|
-
import { jsx as
|
|
29033
|
+
import { jsx as jsx52, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
28715
29034
|
function Pagination({ className, ...props }) {
|
|
28716
|
-
return /* @__PURE__ */
|
|
29035
|
+
return /* @__PURE__ */ jsx52(
|
|
28717
29036
|
"nav",
|
|
28718
29037
|
{
|
|
28719
29038
|
role: "navigation",
|
|
@@ -28728,7 +29047,7 @@ function PaginationContent({
|
|
|
28728
29047
|
className,
|
|
28729
29048
|
...props
|
|
28730
29049
|
}) {
|
|
28731
|
-
return /* @__PURE__ */
|
|
29050
|
+
return /* @__PURE__ */ jsx52(
|
|
28732
29051
|
"ul",
|
|
28733
29052
|
{
|
|
28734
29053
|
"data-slot": "pagination-content",
|
|
@@ -28738,7 +29057,7 @@ function PaginationContent({
|
|
|
28738
29057
|
);
|
|
28739
29058
|
}
|
|
28740
29059
|
function PaginationItem({ ...props }) {
|
|
28741
|
-
return /* @__PURE__ */
|
|
29060
|
+
return /* @__PURE__ */ jsx52("li", { "data-slot": "pagination-item", ...props });
|
|
28742
29061
|
}
|
|
28743
29062
|
function PaginationLink({
|
|
28744
29063
|
className,
|
|
@@ -28746,7 +29065,7 @@ function PaginationLink({
|
|
|
28746
29065
|
size = "icon",
|
|
28747
29066
|
...props
|
|
28748
29067
|
}) {
|
|
28749
|
-
return /* @__PURE__ */
|
|
29068
|
+
return /* @__PURE__ */ jsx52(
|
|
28750
29069
|
"a",
|
|
28751
29070
|
{
|
|
28752
29071
|
"aria-current": isActive ? "page" : void 0,
|
|
@@ -28767,7 +29086,7 @@ function PaginationPrevious({
|
|
|
28767
29086
|
className,
|
|
28768
29087
|
...props
|
|
28769
29088
|
}) {
|
|
28770
|
-
return /* @__PURE__ */
|
|
29089
|
+
return /* @__PURE__ */ jsxs30(
|
|
28771
29090
|
PaginationLink,
|
|
28772
29091
|
{
|
|
28773
29092
|
"aria-label": "Go to previous page",
|
|
@@ -28775,8 +29094,8 @@ function PaginationPrevious({
|
|
|
28775
29094
|
className: cn("gap-1 px-2.5 sm:pl-2.5", className),
|
|
28776
29095
|
...props,
|
|
28777
29096
|
children: [
|
|
28778
|
-
/* @__PURE__ */
|
|
28779
|
-
/* @__PURE__ */
|
|
29097
|
+
/* @__PURE__ */ jsx52(ChevronLeft, {}),
|
|
29098
|
+
/* @__PURE__ */ jsx52("span", { className: "hidden sm:block", children: "Previous" })
|
|
28780
29099
|
]
|
|
28781
29100
|
}
|
|
28782
29101
|
);
|
|
@@ -28785,7 +29104,7 @@ function PaginationNext({
|
|
|
28785
29104
|
className,
|
|
28786
29105
|
...props
|
|
28787
29106
|
}) {
|
|
28788
|
-
return /* @__PURE__ */
|
|
29107
|
+
return /* @__PURE__ */ jsxs30(
|
|
28789
29108
|
PaginationLink,
|
|
28790
29109
|
{
|
|
28791
29110
|
"aria-label": "Go to next page",
|
|
@@ -28793,8 +29112,8 @@ function PaginationNext({
|
|
|
28793
29112
|
className: cn("gap-1 px-2.5 sm:pr-2.5", className),
|
|
28794
29113
|
...props,
|
|
28795
29114
|
children: [
|
|
28796
|
-
/* @__PURE__ */
|
|
28797
|
-
/* @__PURE__ */
|
|
29115
|
+
/* @__PURE__ */ jsx52("span", { className: "hidden sm:block", children: "Next" }),
|
|
29116
|
+
/* @__PURE__ */ jsx52(ChevronRight, {})
|
|
28798
29117
|
]
|
|
28799
29118
|
}
|
|
28800
29119
|
);
|
|
@@ -28803,7 +29122,7 @@ function PaginationEllipsis({
|
|
|
28803
29122
|
className,
|
|
28804
29123
|
...props
|
|
28805
29124
|
}) {
|
|
28806
|
-
return /* @__PURE__ */
|
|
29125
|
+
return /* @__PURE__ */ jsxs30(
|
|
28807
29126
|
"span",
|
|
28808
29127
|
{
|
|
28809
29128
|
"aria-hidden": true,
|
|
@@ -28811,15 +29130,15 @@ function PaginationEllipsis({
|
|
|
28811
29130
|
className: cn("flex size-9 items-center justify-center", className),
|
|
28812
29131
|
...props,
|
|
28813
29132
|
children: [
|
|
28814
|
-
/* @__PURE__ */
|
|
28815
|
-
/* @__PURE__ */
|
|
29133
|
+
/* @__PURE__ */ jsx52(Ellipsis, { className: "size-4" }),
|
|
29134
|
+
/* @__PURE__ */ jsx52("span", { className: "sr-only", children: "More pages" })
|
|
28816
29135
|
]
|
|
28817
29136
|
}
|
|
28818
29137
|
);
|
|
28819
29138
|
}
|
|
28820
29139
|
|
|
28821
29140
|
// src/components/DataDisplay/Pagination/Pagination.tsx
|
|
28822
|
-
import { jsx as
|
|
29141
|
+
import { jsx as jsx53, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
28823
29142
|
var CustomPagination = ({
|
|
28824
29143
|
totalPages,
|
|
28825
29144
|
currentPage,
|
|
@@ -28865,10 +29184,10 @@ var CustomPagination = ({
|
|
|
28865
29184
|
}
|
|
28866
29185
|
};
|
|
28867
29186
|
const pageNumbers = getPageNumbers();
|
|
28868
|
-
return /* @__PURE__ */
|
|
28869
|
-
/* @__PURE__ */
|
|
28870
|
-
/* @__PURE__ */
|
|
28871
|
-
/* @__PURE__ */
|
|
29187
|
+
return /* @__PURE__ */ jsxs31("div", { className: "flex flex-row gap-1 w-full items-center justify-between", children: [
|
|
29188
|
+
/* @__PURE__ */ jsxs31("div", { className: "flex items-center gap-2", children: [
|
|
29189
|
+
/* @__PURE__ */ jsx53("p", { className: "text-sm text-muted-foreground whitespace-nowrap", children: "Items per page:" }),
|
|
29190
|
+
/* @__PURE__ */ jsxs31(
|
|
28872
29191
|
Select,
|
|
28873
29192
|
{
|
|
28874
29193
|
defaultValue: String(perPage),
|
|
@@ -28876,26 +29195,26 @@ var CustomPagination = ({
|
|
|
28876
29195
|
onPageChange({ page: 1, itemsPerPage: Number(value) });
|
|
28877
29196
|
},
|
|
28878
29197
|
children: [
|
|
28879
|
-
/* @__PURE__ */
|
|
28880
|
-
/* @__PURE__ */
|
|
28881
|
-
/* @__PURE__ */
|
|
28882
|
-
/* @__PURE__ */
|
|
28883
|
-
/* @__PURE__ */
|
|
28884
|
-
/* @__PURE__ */
|
|
29198
|
+
/* @__PURE__ */ jsx53(SelectTrigger, { className: "w-[100px]", children: /* @__PURE__ */ jsx53(SelectValue, { placeholder: "Select" }) }),
|
|
29199
|
+
/* @__PURE__ */ jsxs31(SelectContent, { children: [
|
|
29200
|
+
/* @__PURE__ */ jsx53(SelectItem, { value: "5", children: "5" }),
|
|
29201
|
+
/* @__PURE__ */ jsx53(SelectItem, { value: "10", children: "10" }),
|
|
29202
|
+
/* @__PURE__ */ jsx53(SelectItem, { value: "20", children: "20" }),
|
|
29203
|
+
/* @__PURE__ */ jsx53(SelectItem, { value: "50", children: "50" })
|
|
28885
29204
|
] })
|
|
28886
29205
|
]
|
|
28887
29206
|
}
|
|
28888
29207
|
)
|
|
28889
29208
|
] }),
|
|
28890
|
-
/* @__PURE__ */
|
|
28891
|
-
/* @__PURE__ */
|
|
29209
|
+
/* @__PURE__ */ jsx53(Pagination, { className: "justify-end", children: /* @__PURE__ */ jsxs31(PaginationContent, { children: [
|
|
29210
|
+
/* @__PURE__ */ jsx53(PaginationItem, { children: /* @__PURE__ */ jsx53(
|
|
28892
29211
|
PaginationPrevious,
|
|
28893
29212
|
{
|
|
28894
29213
|
onClick: () => handlePageChange(currentPage - 1),
|
|
28895
29214
|
className: currentPage === 1 ? "pointer-events-none opacity-50" : "cursor-pointer"
|
|
28896
29215
|
}
|
|
28897
29216
|
) }),
|
|
28898
|
-
pageNumbers.map((pageNumber, index) => /* @__PURE__ */
|
|
29217
|
+
pageNumbers.map((pageNumber, index) => /* @__PURE__ */ jsx53(PaginationItem, { children: pageNumber === "..." ? /* @__PURE__ */ jsx53(PaginationEllipsis, {}) : /* @__PURE__ */ jsx53(
|
|
28899
29218
|
PaginationLink,
|
|
28900
29219
|
{
|
|
28901
29220
|
onClick: () => handlePageChange(pageNumber),
|
|
@@ -28904,7 +29223,7 @@ var CustomPagination = ({
|
|
|
28904
29223
|
children: pageNumber
|
|
28905
29224
|
}
|
|
28906
29225
|
) }, index)),
|
|
28907
|
-
/* @__PURE__ */
|
|
29226
|
+
/* @__PURE__ */ jsx53(PaginationItem, { children: /* @__PURE__ */ jsx53(
|
|
28908
29227
|
PaginationNext,
|
|
28909
29228
|
{
|
|
28910
29229
|
onClick: () => handlePageChange(currentPage + 1),
|
|
@@ -28919,124 +29238,8 @@ var Pagination_default = CustomPagination;
|
|
|
28919
29238
|
// src/components/Navigation/Tabs/Tabs.tsx
|
|
28920
29239
|
import Link5 from "next/link";
|
|
28921
29240
|
import { useRouter } from "next/navigation";
|
|
28922
|
-
|
|
28923
|
-
|
|
28924
|
-
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
28925
|
-
import { jsx as jsx51, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
28926
|
-
function Dialog({
|
|
28927
|
-
...props
|
|
28928
|
-
}) {
|
|
28929
|
-
return /* @__PURE__ */ jsx51(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
28930
|
-
}
|
|
28931
|
-
function DialogPortal({
|
|
28932
|
-
...props
|
|
28933
|
-
}) {
|
|
28934
|
-
return /* @__PURE__ */ jsx51(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
|
|
28935
|
-
}
|
|
28936
|
-
function DialogOverlay({
|
|
28937
|
-
className,
|
|
28938
|
-
...props
|
|
28939
|
-
}) {
|
|
28940
|
-
return /* @__PURE__ */ jsx51(
|
|
28941
|
-
DialogPrimitive.Overlay,
|
|
28942
|
-
{
|
|
28943
|
-
"data-slot": "dialog-overlay",
|
|
28944
|
-
className: cn(
|
|
28945
|
-
"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",
|
|
28946
|
-
className
|
|
28947
|
-
),
|
|
28948
|
-
...props
|
|
28949
|
-
}
|
|
28950
|
-
);
|
|
28951
|
-
}
|
|
28952
|
-
function DialogContent({
|
|
28953
|
-
className,
|
|
28954
|
-
children,
|
|
28955
|
-
showCloseButton = true,
|
|
28956
|
-
...props
|
|
28957
|
-
}) {
|
|
28958
|
-
return /* @__PURE__ */ jsxs29(DialogPortal, { "data-slot": "dialog-portal", children: [
|
|
28959
|
-
/* @__PURE__ */ jsx51(DialogOverlay, {}),
|
|
28960
|
-
/* @__PURE__ */ jsxs29(
|
|
28961
|
-
DialogPrimitive.Content,
|
|
28962
|
-
{
|
|
28963
|
-
"data-slot": "dialog-content",
|
|
28964
|
-
className: cn(
|
|
28965
|
-
"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",
|
|
28966
|
-
className
|
|
28967
|
-
),
|
|
28968
|
-
...props,
|
|
28969
|
-
children: [
|
|
28970
|
-
children,
|
|
28971
|
-
showCloseButton && /* @__PURE__ */ jsxs29(
|
|
28972
|
-
DialogPrimitive.Close,
|
|
28973
|
-
{
|
|
28974
|
-
"data-slot": "dialog-close",
|
|
28975
|
-
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",
|
|
28976
|
-
children: [
|
|
28977
|
-
/* @__PURE__ */ jsx51(X, {}),
|
|
28978
|
-
/* @__PURE__ */ jsx51("span", { className: "sr-only", children: "Close" })
|
|
28979
|
-
]
|
|
28980
|
-
}
|
|
28981
|
-
)
|
|
28982
|
-
]
|
|
28983
|
-
}
|
|
28984
|
-
)
|
|
28985
|
-
] });
|
|
28986
|
-
}
|
|
28987
|
-
function DialogHeader({ className, ...props }) {
|
|
28988
|
-
return /* @__PURE__ */ jsx51(
|
|
28989
|
-
"div",
|
|
28990
|
-
{
|
|
28991
|
-
"data-slot": "dialog-header",
|
|
28992
|
-
className: cn("flex flex-col gap-2 text-center sm:text-left", className),
|
|
28993
|
-
...props
|
|
28994
|
-
}
|
|
28995
|
-
);
|
|
28996
|
-
}
|
|
28997
|
-
function DialogFooter({ className, ...props }) {
|
|
28998
|
-
return /* @__PURE__ */ jsx51(
|
|
28999
|
-
"div",
|
|
29000
|
-
{
|
|
29001
|
-
"data-slot": "dialog-footer",
|
|
29002
|
-
className: cn(
|
|
29003
|
-
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
29004
|
-
className
|
|
29005
|
-
),
|
|
29006
|
-
...props
|
|
29007
|
-
}
|
|
29008
|
-
);
|
|
29009
|
-
}
|
|
29010
|
-
function DialogTitle({
|
|
29011
|
-
className,
|
|
29012
|
-
...props
|
|
29013
|
-
}) {
|
|
29014
|
-
return /* @__PURE__ */ jsx51(
|
|
29015
|
-
DialogPrimitive.Title,
|
|
29016
|
-
{
|
|
29017
|
-
"data-slot": "dialog-title",
|
|
29018
|
-
className: cn("text-lg leading-none font-semibold", className),
|
|
29019
|
-
...props
|
|
29020
|
-
}
|
|
29021
|
-
);
|
|
29022
|
-
}
|
|
29023
|
-
function DialogDescription({
|
|
29024
|
-
className,
|
|
29025
|
-
...props
|
|
29026
|
-
}) {
|
|
29027
|
-
return /* @__PURE__ */ jsx51(
|
|
29028
|
-
DialogPrimitive.Description,
|
|
29029
|
-
{
|
|
29030
|
-
"data-slot": "dialog-description",
|
|
29031
|
-
className: cn("text-muted-foreground text-sm", className),
|
|
29032
|
-
...props
|
|
29033
|
-
}
|
|
29034
|
-
);
|
|
29035
|
-
}
|
|
29036
|
-
|
|
29037
|
-
// src/components/Navigation/Tabs/Tabs.tsx
|
|
29038
|
-
import { useCallback as useCallback2, useState as useState5 } from "react";
|
|
29039
|
-
import { Fragment as Fragment18, jsx as jsx52, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
29241
|
+
import { useCallback as useCallback2, useState as useState6 } from "react";
|
|
29242
|
+
import { Fragment as Fragment18, jsx as jsx54, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
29040
29243
|
var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuilder = true }) => {
|
|
29041
29244
|
const rawTabs = Array.isArray(tabs) ? tabs : [];
|
|
29042
29245
|
const baseClasses = "text-[12px] text-foreground p-2 text-center rounded-md transition-colors";
|
|
@@ -29047,8 +29250,8 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
29047
29250
|
return pathname === path || path !== "/" && pathname?.startsWith(path);
|
|
29048
29251
|
};
|
|
29049
29252
|
const router = useRouter();
|
|
29050
|
-
const [showExitDialog, setShowExitDialog] =
|
|
29051
|
-
const [pendingUrl, setPendingUrl] =
|
|
29253
|
+
const [showExitDialog, setShowExitDialog] = useState6(false);
|
|
29254
|
+
const [pendingUrl, setPendingUrl] = useState6(null);
|
|
29052
29255
|
const handleBuilderExit = useCallback2(
|
|
29053
29256
|
(e, url) => {
|
|
29054
29257
|
if (isBuilder) {
|
|
@@ -29068,23 +29271,23 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
29068
29271
|
const renderDesktopTab = (tab, index) => {
|
|
29069
29272
|
const finalClasses = [baseClasses, isActive(tab.url) ? activeClasses : hoverClasses, tab.className || ""].join(" ");
|
|
29070
29273
|
if (Array.isArray(tab.children) && tab.children.length > 0 && tab.isDropDown) {
|
|
29071
|
-
return /* @__PURE__ */
|
|
29072
|
-
/* @__PURE__ */
|
|
29274
|
+
return /* @__PURE__ */ jsxs32(DropdownMenu, { children: [
|
|
29275
|
+
/* @__PURE__ */ jsxs32(DropdownMenuTrigger, { className: `${finalClasses} inline-flex items-center gap-1`, children: [
|
|
29073
29276
|
tab.header,
|
|
29074
|
-
/* @__PURE__ */
|
|
29277
|
+
/* @__PURE__ */ jsx54(ChevronDown, { className: "h-4 w-4 opacity-80" })
|
|
29075
29278
|
] }),
|
|
29076
|
-
/* @__PURE__ */
|
|
29279
|
+
/* @__PURE__ */ jsx54(
|
|
29077
29280
|
DropdownMenuContent,
|
|
29078
29281
|
{
|
|
29079
29282
|
align: "start",
|
|
29080
29283
|
sideOffset: 6,
|
|
29081
29284
|
className: "z-50 min-w-[160px] rounded-md border border-gray-200 bg-white p-1 shadow-lg",
|
|
29082
|
-
children: tab.children.map((item) => /* @__PURE__ */
|
|
29285
|
+
children: tab.children.map((item) => /* @__PURE__ */ jsx54(
|
|
29083
29286
|
DropdownMenuItem,
|
|
29084
29287
|
{
|
|
29085
29288
|
asChild: true,
|
|
29086
29289
|
className: "cursor-pointer rounded-sm px-3 py-2 text-[12px] text-gray-800 hover:bg-gray-100 focus:bg-gray-100",
|
|
29087
|
-
children: /* @__PURE__ */
|
|
29290
|
+
children: /* @__PURE__ */ jsx54(Link5, { href: item.url || "#", onClick: (e) => handleBuilderExit(e, item.url || "#"), children: item.header })
|
|
29088
29291
|
},
|
|
29089
29292
|
item.id
|
|
29090
29293
|
))
|
|
@@ -29092,7 +29295,7 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
29092
29295
|
)
|
|
29093
29296
|
] }, index);
|
|
29094
29297
|
}
|
|
29095
|
-
return tab.url ? /* @__PURE__ */
|
|
29298
|
+
return tab.url ? /* @__PURE__ */ jsx54(
|
|
29096
29299
|
Link5,
|
|
29097
29300
|
{
|
|
29098
29301
|
href: tab.url,
|
|
@@ -29102,14 +29305,14 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
29102
29305
|
children: tab.header
|
|
29103
29306
|
},
|
|
29104
29307
|
index
|
|
29105
|
-
) : /* @__PURE__ */
|
|
29308
|
+
) : /* @__PURE__ */ jsx54("div", { className: finalClasses, style: tab.style, role: "button", tabIndex: 0, children: tab.header }, index);
|
|
29106
29309
|
};
|
|
29107
|
-
const renderMobileMenu = () => /* @__PURE__ */
|
|
29108
|
-
/* @__PURE__ */
|
|
29109
|
-
/* @__PURE__ */
|
|
29310
|
+
const renderMobileMenu = () => /* @__PURE__ */ jsxs32(DropdownMenu, { children: [
|
|
29311
|
+
/* @__PURE__ */ jsxs32(DropdownMenuTrigger, { className: "flex items-center gap-2 px-3 py-2 rounded-md bg-white/10 text-white text-sm", children: [
|
|
29312
|
+
/* @__PURE__ */ jsx54(Menu, { className: "h-4 w-4" }),
|
|
29110
29313
|
"Menu"
|
|
29111
29314
|
] }),
|
|
29112
|
-
/* @__PURE__ */
|
|
29315
|
+
/* @__PURE__ */ jsx54(
|
|
29113
29316
|
DropdownMenuContent,
|
|
29114
29317
|
{
|
|
29115
29318
|
align: "start",
|
|
@@ -29118,25 +29321,25 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
29118
29321
|
children: rawTabs.map((tab, i) => {
|
|
29119
29322
|
const hasChildren = Array.isArray(tab.children) && tab.children.length > 0 && tab.isDropDown;
|
|
29120
29323
|
if (hasChildren) {
|
|
29121
|
-
return /* @__PURE__ */
|
|
29122
|
-
/* @__PURE__ */
|
|
29123
|
-
/* @__PURE__ */
|
|
29324
|
+
return /* @__PURE__ */ jsxs32(DropdownMenuSub, { children: [
|
|
29325
|
+
/* @__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 }),
|
|
29326
|
+
/* @__PURE__ */ jsx54(DropdownMenuSubContent, { className: "bg-white border shadow-lg rounded-md p-1", children: tab.children.map((item) => /* @__PURE__ */ jsx54(
|
|
29124
29327
|
DropdownMenuItem,
|
|
29125
29328
|
{
|
|
29126
29329
|
asChild: true,
|
|
29127
29330
|
className: "cursor-pointer rounded-sm px-3 py-2 text-[12px] text-gray-800 hover:bg-gray-100",
|
|
29128
|
-
children: /* @__PURE__ */
|
|
29331
|
+
children: /* @__PURE__ */ jsx54(Link5, { href: item.url || "#", onClick: (e) => handleBuilderExit(e, item.url || "#"), children: item.header })
|
|
29129
29332
|
},
|
|
29130
29333
|
item.id
|
|
29131
29334
|
)) })
|
|
29132
29335
|
] }, i);
|
|
29133
29336
|
}
|
|
29134
|
-
return /* @__PURE__ */
|
|
29337
|
+
return /* @__PURE__ */ jsx54(
|
|
29135
29338
|
DropdownMenuItem,
|
|
29136
29339
|
{
|
|
29137
29340
|
asChild: true,
|
|
29138
29341
|
className: "cursor-pointer rounded-sm px-3 py-2 text-[13px] text-gray-800 hover:bg-gray-100",
|
|
29139
|
-
children: /* @__PURE__ */
|
|
29342
|
+
children: /* @__PURE__ */ jsx54(Link5, { href: tab.url || "#", onClick: (e) => handleBuilderExit(e, tab.url || "#"), children: tab.header })
|
|
29140
29343
|
},
|
|
29141
29344
|
i
|
|
29142
29345
|
);
|
|
@@ -29146,19 +29349,19 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
29146
29349
|
] });
|
|
29147
29350
|
const forceMobile = canvasMode ? canvasMode === "mobile" || canvasMode === "tablet" : void 0;
|
|
29148
29351
|
const forceDesktop = canvasMode ? canvasMode === "desktop" : void 0;
|
|
29149
|
-
return /* @__PURE__ */
|
|
29150
|
-
/* @__PURE__ */
|
|
29151
|
-
forceDesktop !== void 0 ? forceDesktop && /* @__PURE__ */
|
|
29152
|
-
forceMobile !== void 0 ? forceMobile && /* @__PURE__ */
|
|
29352
|
+
return /* @__PURE__ */ jsxs32(Fragment18, { children: [
|
|
29353
|
+
/* @__PURE__ */ jsxs32("div", { className, style, children: [
|
|
29354
|
+
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) }) }),
|
|
29355
|
+
forceMobile !== void 0 ? forceMobile && /* @__PURE__ */ jsx54("div", { children: renderMobileMenu() }) : /* @__PURE__ */ jsx54("div", { className: "flex md:hidden", children: renderMobileMenu() })
|
|
29153
29356
|
] }),
|
|
29154
|
-
/* @__PURE__ */
|
|
29155
|
-
/* @__PURE__ */
|
|
29156
|
-
/* @__PURE__ */
|
|
29157
|
-
/* @__PURE__ */
|
|
29357
|
+
/* @__PURE__ */ jsx54(Dialog, { open: showExitDialog, onOpenChange: setShowExitDialog, children: /* @__PURE__ */ jsxs32(DialogContent, { className: "bg-[#fff]", children: [
|
|
29358
|
+
/* @__PURE__ */ jsxs32(DialogHeader, { children: [
|
|
29359
|
+
/* @__PURE__ */ jsx54(DialogTitle, { children: "Exit Builder?" }),
|
|
29360
|
+
/* @__PURE__ */ jsx54(DialogDescription, { children: "You are about to leave the builder. Any unsaved changes may be lost." })
|
|
29158
29361
|
] }),
|
|
29159
|
-
/* @__PURE__ */
|
|
29160
|
-
/* @__PURE__ */
|
|
29161
|
-
/* @__PURE__ */
|
|
29362
|
+
/* @__PURE__ */ jsxs32(DialogFooter, { children: [
|
|
29363
|
+
/* @__PURE__ */ jsx54(Button, { className: "cursor-pointer bg-[#12715b] text-[#fff]", variant: "outline", onClick: () => setShowExitDialog(false), children: "Cancel" }),
|
|
29364
|
+
/* @__PURE__ */ jsx54(Button, { className: "cursor-pointer border-[#12715b] border", onClick: confirmExit, children: "Yes, Exit" })
|
|
29162
29365
|
] })
|
|
29163
29366
|
] }) })
|
|
29164
29367
|
] });
|
|
@@ -29166,13 +29369,13 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
29166
29369
|
var Tabs_default = Tabs;
|
|
29167
29370
|
|
|
29168
29371
|
// src/components/Navigation/Stages/Stages.tsx
|
|
29169
|
-
import
|
|
29170
|
-
import { jsx as
|
|
29372
|
+
import React9 from "react";
|
|
29373
|
+
import { jsx as jsx55, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
29171
29374
|
var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStageChange }) => {
|
|
29172
|
-
return /* @__PURE__ */
|
|
29173
|
-
/* @__PURE__ */
|
|
29174
|
-
/* @__PURE__ */
|
|
29175
|
-
/* @__PURE__ */
|
|
29375
|
+
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: [
|
|
29376
|
+
/* @__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" }) }) }) }),
|
|
29377
|
+
/* @__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: [
|
|
29378
|
+
/* @__PURE__ */ jsx55(
|
|
29176
29379
|
"button",
|
|
29177
29380
|
{
|
|
29178
29381
|
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"}`,
|
|
@@ -29184,9 +29387,9 @@ var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStag
|
|
|
29184
29387
|
children: stage.header
|
|
29185
29388
|
}
|
|
29186
29389
|
),
|
|
29187
|
-
index < stages.length - 1 && /* @__PURE__ */
|
|
29390
|
+
index < stages.length - 1 && /* @__PURE__ */ jsx55("div", { className: "flex-shrink-0 w-3 h-px bg-gray-300" })
|
|
29188
29391
|
] }, stage.id)) }),
|
|
29189
|
-
isShowBtn && /* @__PURE__ */
|
|
29392
|
+
isShowBtn && /* @__PURE__ */ jsx55("div", { className: "flex items-center", children: /* @__PURE__ */ jsx55(
|
|
29190
29393
|
"button",
|
|
29191
29394
|
{
|
|
29192
29395
|
className: "bg-[#034486] text-white px-6 py-2 rounded-lg text-sm font-medium transition-colors duration-200 shadow-sm",
|
|
@@ -29204,26 +29407,26 @@ var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStag
|
|
|
29204
29407
|
var Stages_default = StagesComponent;
|
|
29205
29408
|
|
|
29206
29409
|
// src/components/Navigation/Spacer/Spacer.tsx
|
|
29207
|
-
import { jsx as
|
|
29410
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
29208
29411
|
var Spacer = ({ className, style }) => {
|
|
29209
|
-
return /* @__PURE__ */
|
|
29412
|
+
return /* @__PURE__ */ jsx56("div", { className: `${className}`, style });
|
|
29210
29413
|
};
|
|
29211
29414
|
var Spacer_default = Spacer;
|
|
29212
29415
|
|
|
29213
29416
|
// src/components/Navigation/Profile/Profile.tsx
|
|
29214
|
-
import { jsx as
|
|
29417
|
+
import { jsx as jsx57, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
29215
29418
|
|
|
29216
29419
|
// src/components/Navigation/Notification/Notification.tsx
|
|
29217
|
-
import { jsx as
|
|
29420
|
+
import { jsx as jsx58, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
29218
29421
|
|
|
29219
29422
|
// src/components/Navigation/Logo/Logo.tsx
|
|
29220
|
-
import { jsx as
|
|
29423
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
29221
29424
|
|
|
29222
29425
|
// src/components/ui/avatar.tsx
|
|
29223
|
-
import * as
|
|
29426
|
+
import * as React10 from "react";
|
|
29224
29427
|
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
29225
|
-
import { jsx as
|
|
29226
|
-
var Avatar =
|
|
29428
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
29429
|
+
var Avatar = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx60(
|
|
29227
29430
|
AvatarPrimitive.Root,
|
|
29228
29431
|
{
|
|
29229
29432
|
ref,
|
|
@@ -29235,7 +29438,7 @@ var Avatar = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
29235
29438
|
}
|
|
29236
29439
|
));
|
|
29237
29440
|
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
29238
|
-
var AvatarImage =
|
|
29441
|
+
var AvatarImage = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx60(
|
|
29239
29442
|
AvatarPrimitive.Image,
|
|
29240
29443
|
{
|
|
29241
29444
|
ref,
|
|
@@ -29244,7 +29447,7 @@ var AvatarImage = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
29244
29447
|
}
|
|
29245
29448
|
));
|
|
29246
29449
|
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
29247
|
-
var AvatarFallback =
|
|
29450
|
+
var AvatarFallback = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx60(
|
|
29248
29451
|
AvatarPrimitive.Fallback,
|
|
29249
29452
|
{
|
|
29250
29453
|
ref,
|
|
@@ -29262,8 +29465,8 @@ import Link6 from "next/link";
|
|
|
29262
29465
|
import Image3 from "next/image";
|
|
29263
29466
|
import { useRouter as useRouter2 } from "next/navigation";
|
|
29264
29467
|
import { DropdownMenuSeparator } from "@radix-ui/react-dropdown-menu";
|
|
29265
|
-
import { useCallback as useCallback3, useMemo as
|
|
29266
|
-
import { Fragment as Fragment19, jsx as
|
|
29468
|
+
import { useCallback as useCallback3, useMemo as useMemo4, useState as useState7 } from "react";
|
|
29469
|
+
import { Fragment as Fragment19, jsx as jsx61, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
29267
29470
|
function Navbar({
|
|
29268
29471
|
style,
|
|
29269
29472
|
badgeType,
|
|
@@ -29283,8 +29486,8 @@ function Navbar({
|
|
|
29283
29486
|
}) {
|
|
29284
29487
|
const isMobileView = canvasMode === "mobile" || canvasMode === "tablet";
|
|
29285
29488
|
const router = useRouter2();
|
|
29286
|
-
const [showExitDialog, setShowExitDialog] =
|
|
29287
|
-
const [pendingUrl, setPendingUrl] =
|
|
29489
|
+
const [showExitDialog, setShowExitDialog] = useState7(false);
|
|
29490
|
+
const [pendingUrl, setPendingUrl] = useState7(null);
|
|
29288
29491
|
const handleBuilderExit = useCallback3(
|
|
29289
29492
|
(e, url) => {
|
|
29290
29493
|
if (isBuilder) {
|
|
@@ -29301,29 +29504,29 @@ function Navbar({
|
|
|
29301
29504
|
router.push(pendingUrl);
|
|
29302
29505
|
}
|
|
29303
29506
|
};
|
|
29304
|
-
const formatedMenu =
|
|
29507
|
+
const formatedMenu = useMemo4(() => {
|
|
29305
29508
|
if (source === "state" && navList && navList.length) {
|
|
29306
29509
|
return navList.map((i) => ({ ...i, header: i.name || "Menu" }));
|
|
29307
29510
|
}
|
|
29308
29511
|
return list || [];
|
|
29309
29512
|
}, [source, navList]);
|
|
29310
|
-
return /* @__PURE__ */
|
|
29311
|
-
/* @__PURE__ */
|
|
29513
|
+
return /* @__PURE__ */ jsxs36(Fragment19, { children: [
|
|
29514
|
+
/* @__PURE__ */ jsx61(
|
|
29312
29515
|
"nav",
|
|
29313
29516
|
{
|
|
29314
29517
|
className: "w-full border-b border-b-white dark:border-b-gray-800 dark:bg-gray-800 bg-white shadow-sm",
|
|
29315
29518
|
style,
|
|
29316
|
-
children: /* @__PURE__ */
|
|
29317
|
-
/* @__PURE__ */
|
|
29519
|
+
children: /* @__PURE__ */ jsxs36("div", { className: "mx-auto flex max-w-[90%] items-center justify-between px-4 py-4", children: [
|
|
29520
|
+
/* @__PURE__ */ jsx61(
|
|
29318
29521
|
Link6,
|
|
29319
29522
|
{
|
|
29320
29523
|
href: "/",
|
|
29321
29524
|
onClick: (e) => handleBuilderExit(e, "/"),
|
|
29322
29525
|
className: "flex items-center space-x-2",
|
|
29323
|
-
children: imageUrl ? /* @__PURE__ */
|
|
29526
|
+
children: imageUrl ? /* @__PURE__ */ jsx61(Image3, { src: imageUrl, alt: altText, width: 200, height: 200 }) : /* @__PURE__ */ jsx61("span", { className: "font-semibold text-blue-700", children: "Logo" })
|
|
29324
29527
|
}
|
|
29325
29528
|
),
|
|
29326
|
-
!isMobileView && /* @__PURE__ */
|
|
29529
|
+
!isMobileView && /* @__PURE__ */ jsx61("div", { className: "flex items-center space-x-6 sm:hidden md:flex", children: formatedMenu.map((item) => /* @__PURE__ */ jsx61(
|
|
29327
29530
|
Link6,
|
|
29328
29531
|
{
|
|
29329
29532
|
href: item.url || "#",
|
|
@@ -29333,39 +29536,39 @@ function Navbar({
|
|
|
29333
29536
|
},
|
|
29334
29537
|
item.id
|
|
29335
29538
|
)) }),
|
|
29336
|
-
/* @__PURE__ */
|
|
29337
|
-
!isMobileView ? /* @__PURE__ */
|
|
29338
|
-
/* @__PURE__ */
|
|
29339
|
-
/* @__PURE__ */
|
|
29340
|
-
] }) }) : /* @__PURE__ */
|
|
29341
|
-
/* @__PURE__ */
|
|
29342
|
-
/* @__PURE__ */
|
|
29343
|
-
badgeType === "number" && !(hideBadgeWhenZero && badgeCount === 0) && Number(badgeCount) > 0 ? /* @__PURE__ */
|
|
29539
|
+
/* @__PURE__ */ jsxs36("div", { className: "flex items-center space-x-3", children: [
|
|
29540
|
+
!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: [
|
|
29541
|
+
/* @__PURE__ */ jsx61(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 dark:text-white text-gray-400" }),
|
|
29542
|
+
/* @__PURE__ */ jsx61(Input, { placeholder: "Search", className: "pl-9 text-gray-400" })
|
|
29543
|
+
] }) }) : /* @__PURE__ */ jsx61(Button, { variant: "ghost", size: "icon", className: "border border-gray-400", children: /* @__PURE__ */ jsx61(Search, { className: "h-5 w-5 text-gray-400" }) }),
|
|
29544
|
+
/* @__PURE__ */ jsxs36("div", { className: "relative bg-[#E9E9E9] dark:bg-gray-700 rounded-md", children: [
|
|
29545
|
+
/* @__PURE__ */ jsx61(Button, { variant: "ghost", size: "icon", children: /* @__PURE__ */ jsx61(Bell, { className: "h-5 w-5 text-[#1C1B1F] dark:text-gray-400" }) }),
|
|
29546
|
+
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" })
|
|
29344
29547
|
] }),
|
|
29345
|
-
/* @__PURE__ */
|
|
29346
|
-
/* @__PURE__ */
|
|
29347
|
-
!isMobileView && showName && /* @__PURE__ */
|
|
29348
|
-
!isMobileView ? /* @__PURE__ */
|
|
29349
|
-
/* @__PURE__ */
|
|
29548
|
+
/* @__PURE__ */ jsxs36(DropdownMenu, { children: [
|
|
29549
|
+
/* @__PURE__ */ jsx61(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs36("div", { className: "flex items-center space-x-2", children: [
|
|
29550
|
+
!isMobileView && showName && /* @__PURE__ */ jsx61("h4", { className: "text-[#000000] dark:text-gray-300 text-[13px] font-[500] mb-0", children: userName }),
|
|
29551
|
+
!isMobileView ? /* @__PURE__ */ jsxs36(Fragment19, { children: [
|
|
29552
|
+
/* @__PURE__ */ jsx61(Avatar, { className: "cursor-pointer h-8 w-8 text-gray-900", children: profileType === "avatar" ? /* @__PURE__ */ jsx61(
|
|
29350
29553
|
AvatarImage,
|
|
29351
29554
|
{
|
|
29352
29555
|
src: "/images/appbuilder/toolset/profile.svg",
|
|
29353
29556
|
alt: "Profile"
|
|
29354
29557
|
}
|
|
29355
|
-
) : /* @__PURE__ */
|
|
29356
|
-
/* @__PURE__ */
|
|
29558
|
+
) : /* @__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) }) }),
|
|
29559
|
+
/* @__PURE__ */ jsx61(
|
|
29357
29560
|
Button,
|
|
29358
29561
|
{
|
|
29359
29562
|
variant: "ghost",
|
|
29360
29563
|
size: "icon",
|
|
29361
29564
|
className: "text-gray-900 md:hidden dark:invert",
|
|
29362
|
-
children: /* @__PURE__ */
|
|
29565
|
+
children: /* @__PURE__ */ jsx61(Menu, { className: "h-6 w-6" })
|
|
29363
29566
|
}
|
|
29364
29567
|
)
|
|
29365
|
-
] }) : /* @__PURE__ */
|
|
29568
|
+
] }) : /* @__PURE__ */ jsx61(Button, { variant: "ghost", size: "icon", className: "text-gray-900 dark:invert", children: /* @__PURE__ */ jsx61(Menu, { className: "h-6 w-6" }) })
|
|
29366
29569
|
] }) }),
|
|
29367
|
-
/* @__PURE__ */
|
|
29368
|
-
profileMenu && profileMenu.length > 0 && /* @__PURE__ */
|
|
29570
|
+
/* @__PURE__ */ jsxs36(DropdownMenuContent, { align: "end", className: "bg-white dark:bg-gray-800", children: [
|
|
29571
|
+
profileMenu && profileMenu.length > 0 && /* @__PURE__ */ jsx61(Fragment19, { children: profileMenu.map((item) => /* @__PURE__ */ jsx61(DropdownMenuItem, { className: "text-black dark:invert", children: /* @__PURE__ */ jsx61(
|
|
29369
29572
|
Link6,
|
|
29370
29573
|
{
|
|
29371
29574
|
href: item.url || "#",
|
|
@@ -29373,9 +29576,9 @@ function Navbar({
|
|
|
29373
29576
|
children: item.header
|
|
29374
29577
|
}
|
|
29375
29578
|
) }, item.id)) }),
|
|
29376
|
-
/* @__PURE__ */
|
|
29377
|
-
/* @__PURE__ */
|
|
29378
|
-
formatedMenu && formatedMenu.length > 0 && /* @__PURE__ */
|
|
29579
|
+
/* @__PURE__ */ jsxs36("div", { className: "md:hidden", children: [
|
|
29580
|
+
/* @__PURE__ */ jsx61(DropdownMenuSeparator, {}),
|
|
29581
|
+
formatedMenu && formatedMenu.length > 0 && /* @__PURE__ */ jsx61(Fragment19, { children: formatedMenu.map((item) => /* @__PURE__ */ jsx61(DropdownMenuItem, { className: "text-black dark:invert", children: /* @__PURE__ */ jsx61(
|
|
29379
29582
|
Link6,
|
|
29380
29583
|
{
|
|
29381
29584
|
href: item.url || "#",
|
|
@@ -29390,21 +29593,21 @@ function Navbar({
|
|
|
29390
29593
|
] })
|
|
29391
29594
|
}
|
|
29392
29595
|
),
|
|
29393
|
-
/* @__PURE__ */
|
|
29394
|
-
/* @__PURE__ */
|
|
29395
|
-
/* @__PURE__ */
|
|
29396
|
-
/* @__PURE__ */
|
|
29596
|
+
/* @__PURE__ */ jsx61(Dialog, { open: showExitDialog, onOpenChange: setShowExitDialog, children: /* @__PURE__ */ jsxs36(DialogContent, { className: "bg-[#fff]", children: [
|
|
29597
|
+
/* @__PURE__ */ jsxs36(DialogHeader, { children: [
|
|
29598
|
+
/* @__PURE__ */ jsx61(DialogTitle, { children: "Exit Builder?" }),
|
|
29599
|
+
/* @__PURE__ */ jsx61(DialogDescription, { children: "You are about to leave the builder. Any unsaved changes may be lost." })
|
|
29397
29600
|
] }),
|
|
29398
|
-
/* @__PURE__ */
|
|
29399
|
-
/* @__PURE__ */
|
|
29400
|
-
/* @__PURE__ */
|
|
29601
|
+
/* @__PURE__ */ jsxs36(DialogFooter, { children: [
|
|
29602
|
+
/* @__PURE__ */ jsx61(Button, { className: "cursor-pointer bg-[#12715b] text-[#fff]", variant: "outline", onClick: () => setShowExitDialog(false), children: "Cancel" }),
|
|
29603
|
+
/* @__PURE__ */ jsx61(Button, { className: "cursor-pointer border-[#12715b] border", onClick: confirmExit, children: "Yes, Exit" })
|
|
29401
29604
|
] })
|
|
29402
29605
|
] }) })
|
|
29403
29606
|
] });
|
|
29404
29607
|
}
|
|
29405
29608
|
|
|
29406
29609
|
// src/components/Chart/BarChart.tsx
|
|
29407
|
-
import
|
|
29610
|
+
import React11 from "react";
|
|
29408
29611
|
import {
|
|
29409
29612
|
BarChart,
|
|
29410
29613
|
Bar,
|
|
@@ -29417,35 +29620,35 @@ import {
|
|
|
29417
29620
|
ResponsiveContainer,
|
|
29418
29621
|
Legend
|
|
29419
29622
|
} from "recharts";
|
|
29420
|
-
import { jsx as
|
|
29623
|
+
import { jsx as jsx62, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
29421
29624
|
var ChartComponent = ({ className, style, loading, ...props }) => {
|
|
29422
29625
|
const data = Array.isArray(props.data) ? props.data : [];
|
|
29423
29626
|
const chartType = props.chartType || "bar";
|
|
29424
29627
|
const legendsPosition = props.legendsPosition === "middle" || props.legendsPosition === "bottom" ? props.legendsPosition : "top";
|
|
29425
29628
|
if (loading || data.length === 0) {
|
|
29426
|
-
return /* @__PURE__ */
|
|
29629
|
+
return /* @__PURE__ */ jsx62(
|
|
29427
29630
|
"div",
|
|
29428
29631
|
{
|
|
29429
29632
|
className: `flex items-center justify-center w-full h-[300px] md:h-[400px] bg-gray-50 animate-pulse rounded-lg ${className}`,
|
|
29430
29633
|
style,
|
|
29431
|
-
children: /* @__PURE__ */
|
|
29634
|
+
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." })
|
|
29432
29635
|
}
|
|
29433
29636
|
);
|
|
29434
29637
|
}
|
|
29435
|
-
return /* @__PURE__ */
|
|
29436
|
-
/* @__PURE__ */
|
|
29437
|
-
/* @__PURE__ */
|
|
29438
|
-
/* @__PURE__ */
|
|
29439
|
-
/* @__PURE__ */
|
|
29440
|
-
/* @__PURE__ */
|
|
29441
|
-
/* @__PURE__ */
|
|
29638
|
+
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: [
|
|
29639
|
+
/* @__PURE__ */ jsx62(CartesianGrid, { strokeDasharray: "3 3" }),
|
|
29640
|
+
/* @__PURE__ */ jsx62(XAxis, { dataKey: "name" }),
|
|
29641
|
+
/* @__PURE__ */ jsx62(YAxis, {}),
|
|
29642
|
+
/* @__PURE__ */ jsx62(Tooltip, { formatter: (value) => `${value}k` }),
|
|
29643
|
+
/* @__PURE__ */ jsx62(Legend, { verticalAlign: legendsPosition, align: "center" }),
|
|
29644
|
+
/* @__PURE__ */ jsx62(
|
|
29442
29645
|
Bar,
|
|
29443
29646
|
{
|
|
29444
29647
|
dataKey: "value",
|
|
29445
29648
|
fill: "#00695C",
|
|
29446
29649
|
radius: [6, 6, 0, 0],
|
|
29447
29650
|
isAnimationActive: false,
|
|
29448
|
-
children: data.map((entry, index) => /* @__PURE__ */
|
|
29651
|
+
children: data.map((entry, index) => /* @__PURE__ */ jsx62(
|
|
29449
29652
|
"rect",
|
|
29450
29653
|
{
|
|
29451
29654
|
fill: entry.color || "#00695C"
|
|
@@ -29454,16 +29657,16 @@ var ChartComponent = ({ className, style, loading, ...props }) => {
|
|
|
29454
29657
|
))
|
|
29455
29658
|
}
|
|
29456
29659
|
)
|
|
29457
|
-
] }) : /* @__PURE__ */
|
|
29458
|
-
/* @__PURE__ */
|
|
29459
|
-
/* @__PURE__ */
|
|
29460
|
-
/* @__PURE__ */
|
|
29660
|
+
] }) : /* @__PURE__ */ jsxs37(AreaChart, { data, children: [
|
|
29661
|
+
/* @__PURE__ */ jsx62("defs", { children: /* @__PURE__ */ jsxs37("linearGradient", { id: "colorCount", x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
29662
|
+
/* @__PURE__ */ jsx62("stop", { offset: "5%", stopColor: "#00695C", stopOpacity: 0.8 }),
|
|
29663
|
+
/* @__PURE__ */ jsx62("stop", { offset: "95%", stopColor: "#00695C", stopOpacity: 0 })
|
|
29461
29664
|
] }) }),
|
|
29462
|
-
/* @__PURE__ */
|
|
29463
|
-
/* @__PURE__ */
|
|
29464
|
-
/* @__PURE__ */
|
|
29465
|
-
/* @__PURE__ */
|
|
29466
|
-
/* @__PURE__ */
|
|
29665
|
+
/* @__PURE__ */ jsx62(CartesianGrid, { strokeDasharray: "3 3" }),
|
|
29666
|
+
/* @__PURE__ */ jsx62(XAxis, { dataKey: "name" }),
|
|
29667
|
+
/* @__PURE__ */ jsx62(YAxis, {}),
|
|
29668
|
+
/* @__PURE__ */ jsx62(Tooltip, { formatter: (value) => `${value}k` }),
|
|
29669
|
+
/* @__PURE__ */ jsx62(
|
|
29467
29670
|
Area,
|
|
29468
29671
|
{
|
|
29469
29672
|
type: "monotone",
|
|
@@ -29476,10 +29679,10 @@ var ChartComponent = ({ className, style, loading, ...props }) => {
|
|
|
29476
29679
|
)
|
|
29477
29680
|
] }) }) });
|
|
29478
29681
|
};
|
|
29479
|
-
var BarChart_default =
|
|
29682
|
+
var BarChart_default = React11.memo(ChartComponent);
|
|
29480
29683
|
|
|
29481
29684
|
// src/components/Chart/PieChart.tsx
|
|
29482
|
-
import
|
|
29685
|
+
import React12, { useEffect as useEffect23, useMemo as useMemo5, useState as useState8 } from "react";
|
|
29483
29686
|
import {
|
|
29484
29687
|
PieChart,
|
|
29485
29688
|
Pie,
|
|
@@ -29488,7 +29691,7 @@ import {
|
|
|
29488
29691
|
Tooltip as Tooltip2,
|
|
29489
29692
|
LabelList
|
|
29490
29693
|
} from "recharts";
|
|
29491
|
-
import { Fragment as Fragment20, jsx as
|
|
29694
|
+
import { Fragment as Fragment20, jsx as jsx63, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
29492
29695
|
var getRandomColor = () => {
|
|
29493
29696
|
const palette = [
|
|
29494
29697
|
"#2563eb",
|
|
@@ -29508,32 +29711,32 @@ var DonutChart = ({ className, style, loading, ...props }) => {
|
|
|
29508
29711
|
const showLegends = props.showLegends ?? true;
|
|
29509
29712
|
const labelType = props.labelType || "inside";
|
|
29510
29713
|
const canvasMode = props.canvasMode;
|
|
29511
|
-
const data =
|
|
29714
|
+
const data = useMemo5(() => {
|
|
29512
29715
|
if (!Array.isArray(props.data)) return [];
|
|
29513
29716
|
return props.data.map((item) => ({ ...item, color: getRandomColor() }));
|
|
29514
29717
|
}, [props.data]);
|
|
29515
|
-
const total =
|
|
29718
|
+
const total = useMemo5(() => data.reduce((sum, d) => sum + d.value, 0), [data]);
|
|
29516
29719
|
const forceMobile = canvasMode === "mobile" || canvasMode === "tablet";
|
|
29517
|
-
const [mounted, setMounted] =
|
|
29518
|
-
|
|
29720
|
+
const [mounted, setMounted] = useState8(false);
|
|
29721
|
+
useEffect23(() => {
|
|
29519
29722
|
const timeout = setTimeout(() => setMounted(true), 100);
|
|
29520
29723
|
return () => clearTimeout(timeout);
|
|
29521
29724
|
}, []);
|
|
29522
|
-
const renderLegends =
|
|
29725
|
+
const renderLegends = useMemo5(() => {
|
|
29523
29726
|
if (!showLegends) return null;
|
|
29524
|
-
return /* @__PURE__ */
|
|
29727
|
+
return /* @__PURE__ */ jsx63(Fragment20, { children: data.map((d) => /* @__PURE__ */ jsxs38(
|
|
29525
29728
|
"div",
|
|
29526
29729
|
{
|
|
29527
29730
|
className: "flex items-center space-x-2 rounded-md border border-gray-200 px-3 py-2 w-[48%] md:w-auto",
|
|
29528
29731
|
children: [
|
|
29529
|
-
/* @__PURE__ */
|
|
29732
|
+
/* @__PURE__ */ jsx63(
|
|
29530
29733
|
"span",
|
|
29531
29734
|
{
|
|
29532
29735
|
className: "inline-block w-[16px] h-[16px] rounded",
|
|
29533
29736
|
style: { backgroundColor: d.color }
|
|
29534
29737
|
}
|
|
29535
29738
|
),
|
|
29536
|
-
/* @__PURE__ */
|
|
29739
|
+
/* @__PURE__ */ jsx63("span", { className: "text-[#000000] text-[12px] md:text-[13px] font-[500]", children: d.name })
|
|
29537
29740
|
]
|
|
29538
29741
|
},
|
|
29539
29742
|
d.name
|
|
@@ -29541,24 +29744,24 @@ var DonutChart = ({ className, style, loading, ...props }) => {
|
|
|
29541
29744
|
}, [data, showLegends]);
|
|
29542
29745
|
if (!mounted) return null;
|
|
29543
29746
|
if (loading || data.length === 0) {
|
|
29544
|
-
return /* @__PURE__ */
|
|
29747
|
+
return /* @__PURE__ */ jsx63(
|
|
29545
29748
|
"div",
|
|
29546
29749
|
{
|
|
29547
29750
|
className: `flex items-center justify-center w-full h-[300px] md:h-[400px] bg-gray-50 animate-pulse rounded-lg ${className}`,
|
|
29548
29751
|
style,
|
|
29549
|
-
children: /* @__PURE__ */
|
|
29752
|
+
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." })
|
|
29550
29753
|
}
|
|
29551
29754
|
);
|
|
29552
29755
|
}
|
|
29553
|
-
return /* @__PURE__ */
|
|
29756
|
+
return /* @__PURE__ */ jsxs38(
|
|
29554
29757
|
"div",
|
|
29555
29758
|
{
|
|
29556
29759
|
className: `relative flex flex-col items-center ${className}`,
|
|
29557
29760
|
style,
|
|
29558
29761
|
children: [
|
|
29559
|
-
/* @__PURE__ */
|
|
29560
|
-
/* @__PURE__ */
|
|
29561
|
-
/* @__PURE__ */
|
|
29762
|
+
/* @__PURE__ */ jsxs38("div", { className: "relative w-full md:w-[70%] h-[300px] md:h-[400px] flex items-center justify-center", children: [
|
|
29763
|
+
/* @__PURE__ */ jsx63(ResponsiveContainer2, { width: "99%", height: "100%", children: /* @__PURE__ */ jsxs38(PieChart, { children: [
|
|
29764
|
+
/* @__PURE__ */ jsxs38(
|
|
29562
29765
|
Pie,
|
|
29563
29766
|
{
|
|
29564
29767
|
data,
|
|
@@ -29570,8 +29773,8 @@ var DonutChart = ({ className, style, loading, ...props }) => {
|
|
|
29570
29773
|
labelLine: false,
|
|
29571
29774
|
isAnimationActive: false,
|
|
29572
29775
|
children: [
|
|
29573
|
-
data.map((entry, index) => /* @__PURE__ */
|
|
29574
|
-
/* @__PURE__ */
|
|
29776
|
+
data.map((entry, index) => /* @__PURE__ */ jsx63(Cell, { fill: entry.color }, `cell-${index}`)),
|
|
29777
|
+
/* @__PURE__ */ jsx63(
|
|
29575
29778
|
LabelList,
|
|
29576
29779
|
{
|
|
29577
29780
|
dataKey: "value",
|
|
@@ -29584,14 +29787,14 @@ var DonutChart = ({ className, style, loading, ...props }) => {
|
|
|
29584
29787
|
]
|
|
29585
29788
|
}
|
|
29586
29789
|
),
|
|
29587
|
-
/* @__PURE__ */
|
|
29790
|
+
/* @__PURE__ */ jsx63(
|
|
29588
29791
|
Tooltip2,
|
|
29589
29792
|
{
|
|
29590
29793
|
formatter: (value, name) => [`${value}k`, name]
|
|
29591
29794
|
}
|
|
29592
29795
|
)
|
|
29593
29796
|
] }) }),
|
|
29594
|
-
/* @__PURE__ */
|
|
29797
|
+
/* @__PURE__ */ jsxs38(
|
|
29595
29798
|
"div",
|
|
29596
29799
|
{
|
|
29597
29800
|
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]`,
|
|
@@ -29602,18 +29805,18 @@ var DonutChart = ({ className, style, loading, ...props }) => {
|
|
|
29602
29805
|
}
|
|
29603
29806
|
)
|
|
29604
29807
|
] }),
|
|
29605
|
-
/* @__PURE__ */
|
|
29808
|
+
/* @__PURE__ */ jsx63("div", { className: "flex flex-wrap justify-center gap-2 mt-6 w-full md:w-auto", children: renderLegends })
|
|
29606
29809
|
]
|
|
29607
29810
|
}
|
|
29608
29811
|
);
|
|
29609
29812
|
};
|
|
29610
|
-
var PieChart_default =
|
|
29813
|
+
var PieChart_default = React12.memo(DonutChart);
|
|
29611
29814
|
|
|
29612
29815
|
// src/components/Blocks/EmailComposer.tsx
|
|
29613
|
-
import { jsx as
|
|
29816
|
+
import { jsx as jsx64, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
29614
29817
|
function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc, setShowBcc, cc, setCc, bcc, setBcc, subject, setSubject, body, setBody }) {
|
|
29615
|
-
return /* @__PURE__ */
|
|
29616
|
-
/* @__PURE__ */
|
|
29818
|
+
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: [
|
|
29819
|
+
/* @__PURE__ */ jsx64("div", { className: "mb-3", children: /* @__PURE__ */ jsx64(
|
|
29617
29820
|
"input",
|
|
29618
29821
|
{
|
|
29619
29822
|
type: "email",
|
|
@@ -29622,8 +29825,8 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
29622
29825
|
required: true
|
|
29623
29826
|
}
|
|
29624
29827
|
) }),
|
|
29625
|
-
/* @__PURE__ */
|
|
29626
|
-
/* @__PURE__ */
|
|
29828
|
+
/* @__PURE__ */ jsx64("div", { className: "mb-3", children: /* @__PURE__ */ jsxs39("div", { className: "flex items-center gap-2", children: [
|
|
29829
|
+
/* @__PURE__ */ jsx64(
|
|
29627
29830
|
"input",
|
|
29628
29831
|
{
|
|
29629
29832
|
type: "email",
|
|
@@ -29634,7 +29837,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
29634
29837
|
required: true
|
|
29635
29838
|
}
|
|
29636
29839
|
),
|
|
29637
|
-
!showCc && /* @__PURE__ */
|
|
29840
|
+
!showCc && /* @__PURE__ */ jsx64(
|
|
29638
29841
|
"button",
|
|
29639
29842
|
{
|
|
29640
29843
|
onClick: () => setShowCc?.(true),
|
|
@@ -29642,7 +29845,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
29642
29845
|
children: "Cc"
|
|
29643
29846
|
}
|
|
29644
29847
|
),
|
|
29645
|
-
!showBcc && /* @__PURE__ */
|
|
29848
|
+
!showBcc && /* @__PURE__ */ jsx64(
|
|
29646
29849
|
"button",
|
|
29647
29850
|
{
|
|
29648
29851
|
onClick: () => setShowBcc?.(true),
|
|
@@ -29651,7 +29854,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
29651
29854
|
}
|
|
29652
29855
|
)
|
|
29653
29856
|
] }) }),
|
|
29654
|
-
showCc && /* @__PURE__ */
|
|
29857
|
+
showCc && /* @__PURE__ */ jsx64("div", { className: "mb-3", children: /* @__PURE__ */ jsx64(
|
|
29655
29858
|
"input",
|
|
29656
29859
|
{
|
|
29657
29860
|
type: "text",
|
|
@@ -29661,7 +29864,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
29661
29864
|
className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
|
|
29662
29865
|
}
|
|
29663
29866
|
) }),
|
|
29664
|
-
showBcc && /* @__PURE__ */
|
|
29867
|
+
showBcc && /* @__PURE__ */ jsx64("div", { className: "mb-3", children: /* @__PURE__ */ jsx64(
|
|
29665
29868
|
"input",
|
|
29666
29869
|
{
|
|
29667
29870
|
type: "text",
|
|
@@ -29671,7 +29874,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
29671
29874
|
className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
|
|
29672
29875
|
}
|
|
29673
29876
|
) }),
|
|
29674
|
-
/* @__PURE__ */
|
|
29877
|
+
/* @__PURE__ */ jsx64("div", { className: "mb-3", children: /* @__PURE__ */ jsx64(
|
|
29675
29878
|
"input",
|
|
29676
29879
|
{
|
|
29677
29880
|
type: "text",
|
|
@@ -29681,11 +29884,11 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
29681
29884
|
className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
|
|
29682
29885
|
}
|
|
29683
29886
|
) }),
|
|
29684
|
-
/* @__PURE__ */
|
|
29685
|
-
/* @__PURE__ */
|
|
29686
|
-
/* @__PURE__ */
|
|
29687
|
-
/* @__PURE__ */
|
|
29688
|
-
/* @__PURE__ */
|
|
29887
|
+
/* @__PURE__ */ jsx64("div", { className: "mb-4", children: /* @__PURE__ */ jsx64(MyEditor, { value: body, onChange: setBody }) }),
|
|
29888
|
+
/* @__PURE__ */ jsxs39("div", { className: "flex justify-end gap-2", children: [
|
|
29889
|
+
/* @__PURE__ */ jsx64("button", { className: "px-4 py-2 rounded-md text-gray-600 hover:bg-gray-100", children: "Discard" }),
|
|
29890
|
+
/* @__PURE__ */ jsx64("button", { className: "px-4 py-2 rounded-md border text-[#12715B] border-[#12715B]", children: "Reset" }),
|
|
29891
|
+
/* @__PURE__ */ jsx64("button", { className: "px-4 py-2 rounded-md bg-[#12715B] text-white", children: "Send" })
|
|
29689
29892
|
] })
|
|
29690
29893
|
] }) });
|
|
29691
29894
|
}
|
|
@@ -29730,10 +29933,10 @@ function showSonnerToast({
|
|
|
29730
29933
|
// src/components/ui/sonner.tsx
|
|
29731
29934
|
import { useTheme } from "next-themes";
|
|
29732
29935
|
import { Toaster as Sonner } from "sonner";
|
|
29733
|
-
import { jsx as
|
|
29936
|
+
import { jsx as jsx65 } from "react/jsx-runtime";
|
|
29734
29937
|
var Toaster = ({ ...props }) => {
|
|
29735
29938
|
const { theme = "system" } = useTheme();
|
|
29736
|
-
return /* @__PURE__ */
|
|
29939
|
+
return /* @__PURE__ */ jsx65(
|
|
29737
29940
|
Sonner,
|
|
29738
29941
|
{
|
|
29739
29942
|
theme,
|
|
@@ -29768,6 +29971,7 @@ export {
|
|
|
29768
29971
|
Image_default as Image,
|
|
29769
29972
|
Modal,
|
|
29770
29973
|
MultiCheckbox_default as MultiCheckbox,
|
|
29974
|
+
MultiSelect_default as MultiSelect,
|
|
29771
29975
|
Navbar,
|
|
29772
29976
|
NumberInput_default as NumberInput,
|
|
29773
29977
|
Pagination_default as Pagination,
|