@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.js
CHANGED
|
@@ -51,6 +51,7 @@ __export(src_exports, {
|
|
|
51
51
|
Image: () => Image_default,
|
|
52
52
|
Modal: () => Modal,
|
|
53
53
|
MultiCheckbox: () => MultiCheckbox_default,
|
|
54
|
+
MultiSelect: () => MultiSelect_default,
|
|
54
55
|
Navbar: () => Navbar,
|
|
55
56
|
NumberInput: () => NumberInput_default,
|
|
56
57
|
Pagination: () => Pagination_default,
|
|
@@ -28363,21 +28364,340 @@ var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
|
|
|
28363
28364
|
};
|
|
28364
28365
|
var TextInputGroup_default = TextInputGroup;
|
|
28365
28366
|
|
|
28366
|
-
// src/components/
|
|
28367
|
+
// src/components/Inputs/Multiselect/MultiSelect.tsx
|
|
28367
28368
|
var React7 = __toESM(require("react"));
|
|
28369
|
+
|
|
28370
|
+
// src/components/ui/command.tsx
|
|
28371
|
+
var import_cmdk = require("cmdk");
|
|
28372
|
+
|
|
28373
|
+
// src/components/ui/dialog.tsx
|
|
28374
|
+
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
|
|
28375
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
28376
|
+
function Dialog({
|
|
28377
|
+
...props
|
|
28378
|
+
}) {
|
|
28379
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
28380
|
+
}
|
|
28381
|
+
function DialogPortal({
|
|
28382
|
+
...props
|
|
28383
|
+
}) {
|
|
28384
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
|
|
28385
|
+
}
|
|
28386
|
+
function DialogOverlay({
|
|
28387
|
+
className,
|
|
28388
|
+
...props
|
|
28389
|
+
}) {
|
|
28390
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
28391
|
+
DialogPrimitive.Overlay,
|
|
28392
|
+
{
|
|
28393
|
+
"data-slot": "dialog-overlay",
|
|
28394
|
+
className: cn(
|
|
28395
|
+
"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",
|
|
28396
|
+
className
|
|
28397
|
+
),
|
|
28398
|
+
...props
|
|
28399
|
+
}
|
|
28400
|
+
);
|
|
28401
|
+
}
|
|
28402
|
+
function DialogContent({
|
|
28403
|
+
className,
|
|
28404
|
+
children,
|
|
28405
|
+
showCloseButton = true,
|
|
28406
|
+
...props
|
|
28407
|
+
}) {
|
|
28408
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(DialogPortal, { "data-slot": "dialog-portal", children: [
|
|
28409
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(DialogOverlay, {}),
|
|
28410
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
28411
|
+
DialogPrimitive.Content,
|
|
28412
|
+
{
|
|
28413
|
+
"data-slot": "dialog-content",
|
|
28414
|
+
className: cn(
|
|
28415
|
+
"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",
|
|
28416
|
+
className
|
|
28417
|
+
),
|
|
28418
|
+
...props,
|
|
28419
|
+
children: [
|
|
28420
|
+
children,
|
|
28421
|
+
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
28422
|
+
DialogPrimitive.Close,
|
|
28423
|
+
{
|
|
28424
|
+
"data-slot": "dialog-close",
|
|
28425
|
+
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",
|
|
28426
|
+
children: [
|
|
28427
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(X, {}),
|
|
28428
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "sr-only", children: "Close" })
|
|
28429
|
+
]
|
|
28430
|
+
}
|
|
28431
|
+
)
|
|
28432
|
+
]
|
|
28433
|
+
}
|
|
28434
|
+
)
|
|
28435
|
+
] });
|
|
28436
|
+
}
|
|
28437
|
+
function DialogHeader({ className, ...props }) {
|
|
28438
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
28439
|
+
"div",
|
|
28440
|
+
{
|
|
28441
|
+
"data-slot": "dialog-header",
|
|
28442
|
+
className: cn("flex flex-col gap-2 text-center sm:text-left", className),
|
|
28443
|
+
...props
|
|
28444
|
+
}
|
|
28445
|
+
);
|
|
28446
|
+
}
|
|
28447
|
+
function DialogFooter({ className, ...props }) {
|
|
28448
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
28449
|
+
"div",
|
|
28450
|
+
{
|
|
28451
|
+
"data-slot": "dialog-footer",
|
|
28452
|
+
className: cn(
|
|
28453
|
+
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
28454
|
+
className
|
|
28455
|
+
),
|
|
28456
|
+
...props
|
|
28457
|
+
}
|
|
28458
|
+
);
|
|
28459
|
+
}
|
|
28460
|
+
function DialogTitle({
|
|
28461
|
+
className,
|
|
28462
|
+
...props
|
|
28463
|
+
}) {
|
|
28464
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
28465
|
+
DialogPrimitive.Title,
|
|
28466
|
+
{
|
|
28467
|
+
"data-slot": "dialog-title",
|
|
28468
|
+
className: cn("text-lg leading-none font-semibold", className),
|
|
28469
|
+
...props
|
|
28470
|
+
}
|
|
28471
|
+
);
|
|
28472
|
+
}
|
|
28473
|
+
function DialogDescription({
|
|
28474
|
+
className,
|
|
28475
|
+
...props
|
|
28476
|
+
}) {
|
|
28477
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
28478
|
+
DialogPrimitive.Description,
|
|
28479
|
+
{
|
|
28480
|
+
"data-slot": "dialog-description",
|
|
28481
|
+
className: cn("text-muted-foreground text-sm", className),
|
|
28482
|
+
...props
|
|
28483
|
+
}
|
|
28484
|
+
);
|
|
28485
|
+
}
|
|
28486
|
+
|
|
28487
|
+
// src/components/ui/command.tsx
|
|
28488
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
28489
|
+
function Command2({
|
|
28490
|
+
className,
|
|
28491
|
+
...props
|
|
28492
|
+
}) {
|
|
28493
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
28494
|
+
import_cmdk.Command,
|
|
28495
|
+
{
|
|
28496
|
+
"data-slot": "command",
|
|
28497
|
+
className: cn(
|
|
28498
|
+
"bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",
|
|
28499
|
+
className
|
|
28500
|
+
),
|
|
28501
|
+
...props
|
|
28502
|
+
}
|
|
28503
|
+
);
|
|
28504
|
+
}
|
|
28505
|
+
function CommandInput({
|
|
28506
|
+
className,
|
|
28507
|
+
...props
|
|
28508
|
+
}) {
|
|
28509
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
28510
|
+
"div",
|
|
28511
|
+
{
|
|
28512
|
+
"data-slot": "command-input-wrapper",
|
|
28513
|
+
className: "flex h-9 items-center gap-2 border-b px-3",
|
|
28514
|
+
children: [
|
|
28515
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Search, { className: "size-4 shrink-0 opacity-50" }),
|
|
28516
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
28517
|
+
import_cmdk.Command.Input,
|
|
28518
|
+
{
|
|
28519
|
+
"data-slot": "command-input",
|
|
28520
|
+
className: cn(
|
|
28521
|
+
"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",
|
|
28522
|
+
className
|
|
28523
|
+
),
|
|
28524
|
+
...props
|
|
28525
|
+
}
|
|
28526
|
+
)
|
|
28527
|
+
]
|
|
28528
|
+
}
|
|
28529
|
+
);
|
|
28530
|
+
}
|
|
28531
|
+
function CommandList({
|
|
28532
|
+
className,
|
|
28533
|
+
...props
|
|
28534
|
+
}) {
|
|
28535
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
28536
|
+
import_cmdk.Command.List,
|
|
28537
|
+
{
|
|
28538
|
+
"data-slot": "command-list",
|
|
28539
|
+
className: cn(
|
|
28540
|
+
"max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",
|
|
28541
|
+
className
|
|
28542
|
+
),
|
|
28543
|
+
...props
|
|
28544
|
+
}
|
|
28545
|
+
);
|
|
28546
|
+
}
|
|
28547
|
+
function CommandEmpty({
|
|
28548
|
+
...props
|
|
28549
|
+
}) {
|
|
28550
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
28551
|
+
import_cmdk.Command.Empty,
|
|
28552
|
+
{
|
|
28553
|
+
"data-slot": "command-empty",
|
|
28554
|
+
className: "py-6 text-center text-sm",
|
|
28555
|
+
...props
|
|
28556
|
+
}
|
|
28557
|
+
);
|
|
28558
|
+
}
|
|
28559
|
+
function CommandGroup({
|
|
28560
|
+
className,
|
|
28561
|
+
...props
|
|
28562
|
+
}) {
|
|
28563
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
28564
|
+
import_cmdk.Command.Group,
|
|
28565
|
+
{
|
|
28566
|
+
"data-slot": "command-group",
|
|
28567
|
+
className: cn(
|
|
28568
|
+
"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",
|
|
28569
|
+
className
|
|
28570
|
+
),
|
|
28571
|
+
...props
|
|
28572
|
+
}
|
|
28573
|
+
);
|
|
28574
|
+
}
|
|
28575
|
+
function CommandItem({
|
|
28576
|
+
className,
|
|
28577
|
+
...props
|
|
28578
|
+
}) {
|
|
28579
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
28580
|
+
import_cmdk.Command.Item,
|
|
28581
|
+
{
|
|
28582
|
+
"data-slot": "command-item",
|
|
28583
|
+
className: cn(
|
|
28584
|
+
"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",
|
|
28585
|
+
className
|
|
28586
|
+
),
|
|
28587
|
+
...props
|
|
28588
|
+
}
|
|
28589
|
+
);
|
|
28590
|
+
}
|
|
28591
|
+
|
|
28592
|
+
// src/components/Inputs/Multiselect/MultiSelect.tsx
|
|
28593
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
28594
|
+
var MultiSelect = ({
|
|
28595
|
+
value = [],
|
|
28596
|
+
onChange,
|
|
28597
|
+
data = [],
|
|
28598
|
+
placeholder = "Select...",
|
|
28599
|
+
disabled,
|
|
28600
|
+
searchable = true,
|
|
28601
|
+
className = "",
|
|
28602
|
+
dataKey = "value",
|
|
28603
|
+
dataLabel = "label",
|
|
28604
|
+
...props
|
|
28605
|
+
}) => {
|
|
28606
|
+
const [open, setOpen] = React7.useState(false);
|
|
28607
|
+
React7.useEffect(() => {
|
|
28608
|
+
if (value) {
|
|
28609
|
+
onChange(value);
|
|
28610
|
+
}
|
|
28611
|
+
}, []);
|
|
28612
|
+
const toggleOption = (val) => {
|
|
28613
|
+
onChange(
|
|
28614
|
+
value?.includes(val) ? value.filter((v) => v !== val) : [...value || [], val]
|
|
28615
|
+
);
|
|
28616
|
+
};
|
|
28617
|
+
const selectedLabels = React7.useMemo(
|
|
28618
|
+
() => data.filter((opt) => value.includes(opt.value)).map((opt) => opt.label),
|
|
28619
|
+
[data, value]
|
|
28620
|
+
);
|
|
28621
|
+
const options = data.map((item) => ({
|
|
28622
|
+
value: item[dataKey],
|
|
28623
|
+
label: item[dataLabel]
|
|
28624
|
+
}));
|
|
28625
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Popover, { open, onOpenChange: setOpen, children: [
|
|
28626
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
28627
|
+
Button,
|
|
28628
|
+
{
|
|
28629
|
+
variant: "outline",
|
|
28630
|
+
role: "combobox",
|
|
28631
|
+
className: `w-full justify-between ${className} ${props.errorMessage ? "border-red-500" : ""}`,
|
|
28632
|
+
disabled,
|
|
28633
|
+
type: "button",
|
|
28634
|
+
children: [
|
|
28635
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "truncate", children: selectedLabels.length > 0 ? selectedLabels.join(", ") : placeholder }),
|
|
28636
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ChevronsUpDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
28637
|
+
]
|
|
28638
|
+
}
|
|
28639
|
+
) }),
|
|
28640
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
28641
|
+
PopoverContent,
|
|
28642
|
+
{
|
|
28643
|
+
align: "start",
|
|
28644
|
+
className: "w-[var(--radix-popover-trigger-width)] p-0",
|
|
28645
|
+
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
28646
|
+
onInteractOutside: (e) => {
|
|
28647
|
+
if (e.target.closest(".keep-open")) e.preventDefault();
|
|
28648
|
+
},
|
|
28649
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Command2, { shouldFilter: searchable, children: [
|
|
28650
|
+
searchable && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(CommandInput, { placeholder: "Search..." }),
|
|
28651
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(CommandList, { children: [
|
|
28652
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(CommandEmpty, { children: "No options found." }),
|
|
28653
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(CommandGroup, { children: options.map((opt) => {
|
|
28654
|
+
const isSelected = value.includes(opt.value);
|
|
28655
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
28656
|
+
"div",
|
|
28657
|
+
{
|
|
28658
|
+
className: "keep-open",
|
|
28659
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
28660
|
+
CommandItem,
|
|
28661
|
+
{
|
|
28662
|
+
onMouseDown: (e) => {
|
|
28663
|
+
e.preventDefault();
|
|
28664
|
+
toggleOption(opt.value);
|
|
28665
|
+
},
|
|
28666
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
28667
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Checkbox, { checked: isSelected }),
|
|
28668
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { children: opt.label })
|
|
28669
|
+
] })
|
|
28670
|
+
},
|
|
28671
|
+
opt.value
|
|
28672
|
+
)
|
|
28673
|
+
},
|
|
28674
|
+
opt.value
|
|
28675
|
+
);
|
|
28676
|
+
}) })
|
|
28677
|
+
] })
|
|
28678
|
+
] })
|
|
28679
|
+
}
|
|
28680
|
+
),
|
|
28681
|
+
props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
28682
|
+
] });
|
|
28683
|
+
};
|
|
28684
|
+
var MultiSelect_default = MultiSelect;
|
|
28685
|
+
|
|
28686
|
+
// src/components/ui/data-table.tsx
|
|
28687
|
+
var React8 = __toESM(require("react"));
|
|
28368
28688
|
var import_free_solid_svg_icons2 = require("@fortawesome/free-solid-svg-icons");
|
|
28369
28689
|
var import_react_fontawesome3 = require("@fortawesome/react-fontawesome");
|
|
28370
28690
|
var import_react_table = require("@tanstack/react-table");
|
|
28371
28691
|
|
|
28372
28692
|
// src/components/ui/table.tsx
|
|
28373
|
-
var
|
|
28693
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
28374
28694
|
function Table3({ className, ...props }) {
|
|
28375
|
-
return /* @__PURE__ */ (0,
|
|
28695
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
28376
28696
|
"div",
|
|
28377
28697
|
{
|
|
28378
28698
|
"data-slot": "table-container",
|
|
28379
28699
|
className: "relative w-full overflow-x-auto rounded-md border border-gray-200 bg-white",
|
|
28380
|
-
children: /* @__PURE__ */ (0,
|
|
28700
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
28381
28701
|
"table",
|
|
28382
28702
|
{
|
|
28383
28703
|
"data-slot": "table",
|
|
@@ -28389,7 +28709,7 @@ function Table3({ className, ...props }) {
|
|
|
28389
28709
|
);
|
|
28390
28710
|
}
|
|
28391
28711
|
function TableHeader({ className, ...props }) {
|
|
28392
|
-
return /* @__PURE__ */ (0,
|
|
28712
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
28393
28713
|
"thead",
|
|
28394
28714
|
{
|
|
28395
28715
|
"data-slot": "table-header",
|
|
@@ -28402,7 +28722,7 @@ function TableHeader({ className, ...props }) {
|
|
|
28402
28722
|
);
|
|
28403
28723
|
}
|
|
28404
28724
|
function TableBody({ className, ...props }) {
|
|
28405
|
-
return /* @__PURE__ */ (0,
|
|
28725
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
28406
28726
|
"tbody",
|
|
28407
28727
|
{
|
|
28408
28728
|
"data-slot": "table-body",
|
|
@@ -28415,7 +28735,7 @@ function TableBody({ className, ...props }) {
|
|
|
28415
28735
|
);
|
|
28416
28736
|
}
|
|
28417
28737
|
function TableRow({ className, ...props }) {
|
|
28418
|
-
return /* @__PURE__ */ (0,
|
|
28738
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
28419
28739
|
"tr",
|
|
28420
28740
|
{
|
|
28421
28741
|
"data-slot": "table-row",
|
|
@@ -28428,7 +28748,7 @@ function TableRow({ className, ...props }) {
|
|
|
28428
28748
|
);
|
|
28429
28749
|
}
|
|
28430
28750
|
function TableHead({ className, ...props }) {
|
|
28431
|
-
return /* @__PURE__ */ (0,
|
|
28751
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
28432
28752
|
"th",
|
|
28433
28753
|
{
|
|
28434
28754
|
"data-slot": "table-head",
|
|
@@ -28441,7 +28761,7 @@ function TableHead({ className, ...props }) {
|
|
|
28441
28761
|
);
|
|
28442
28762
|
}
|
|
28443
28763
|
function TableCell({ className, ...props }) {
|
|
28444
|
-
return /* @__PURE__ */ (0,
|
|
28764
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
28445
28765
|
"td",
|
|
28446
28766
|
{
|
|
28447
28767
|
"data-slot": "table-cell",
|
|
@@ -28455,7 +28775,7 @@ function TableCell({ className, ...props }) {
|
|
|
28455
28775
|
}
|
|
28456
28776
|
|
|
28457
28777
|
// src/components/ui/data-table.tsx
|
|
28458
|
-
var
|
|
28778
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
28459
28779
|
function DataTable({
|
|
28460
28780
|
columns,
|
|
28461
28781
|
data,
|
|
@@ -28472,10 +28792,10 @@ function DataTable({
|
|
|
28472
28792
|
globalSearch,
|
|
28473
28793
|
onCellClick
|
|
28474
28794
|
}) {
|
|
28475
|
-
const [columnFilters, setColumnFilters] =
|
|
28476
|
-
const [columnVisibility, setColumnVisibility] =
|
|
28477
|
-
const [manualSort, setManualSort] =
|
|
28478
|
-
const [searchTerm, setSearchTerm] =
|
|
28795
|
+
const [columnFilters, setColumnFilters] = React8.useState([]);
|
|
28796
|
+
const [columnVisibility, setColumnVisibility] = React8.useState({});
|
|
28797
|
+
const [manualSort, setManualSort] = React8.useState(null);
|
|
28798
|
+
const [searchTerm, setSearchTerm] = React8.useState("");
|
|
28479
28799
|
const table = (0, import_react_table.useReactTable)({
|
|
28480
28800
|
data,
|
|
28481
28801
|
columns,
|
|
@@ -28523,11 +28843,11 @@ function DataTable({
|
|
|
28523
28843
|
}
|
|
28524
28844
|
return [];
|
|
28525
28845
|
};
|
|
28526
|
-
return /* @__PURE__ */ (0,
|
|
28527
|
-
/* @__PURE__ */ (0,
|
|
28528
|
-
globalSearch && /* @__PURE__ */ (0,
|
|
28529
|
-
/* @__PURE__ */ (0,
|
|
28530
|
-
/* @__PURE__ */ (0,
|
|
28846
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "overflow-hidden rounded-md w-full", children: [
|
|
28847
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: `flex ${globalSearch ? "justify-between" : "justify-end"} p-2 bg-gray-50`, children: [
|
|
28848
|
+
globalSearch && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex items-center gap-2 w-full max-w-sm", children: [
|
|
28849
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "relative w-full", children: [
|
|
28850
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
28531
28851
|
"input",
|
|
28532
28852
|
{
|
|
28533
28853
|
type: "text",
|
|
@@ -28542,9 +28862,9 @@ function DataTable({
|
|
|
28542
28862
|
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]"
|
|
28543
28863
|
}
|
|
28544
28864
|
),
|
|
28545
|
-
/* @__PURE__ */ (0,
|
|
28865
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Search, { className: "absolute left-2 top-2.5 text-gray-400", size: 16 })
|
|
28546
28866
|
] }),
|
|
28547
|
-
/* @__PURE__ */ (0,
|
|
28867
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
28548
28868
|
Button,
|
|
28549
28869
|
{
|
|
28550
28870
|
size: "sm",
|
|
@@ -28554,8 +28874,8 @@ function DataTable({
|
|
|
28554
28874
|
}
|
|
28555
28875
|
)
|
|
28556
28876
|
] }),
|
|
28557
|
-
/* @__PURE__ */ (0,
|
|
28558
|
-
/* @__PURE__ */ (0,
|
|
28877
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Popover, { children: [
|
|
28878
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
28559
28879
|
Button,
|
|
28560
28880
|
{
|
|
28561
28881
|
variant: "outline",
|
|
@@ -28564,10 +28884,10 @@ function DataTable({
|
|
|
28564
28884
|
children: "Manage Columns"
|
|
28565
28885
|
}
|
|
28566
28886
|
) }),
|
|
28567
|
-
/* @__PURE__ */ (0,
|
|
28568
|
-
/* @__PURE__ */ (0,
|
|
28569
|
-
/* @__PURE__ */ (0,
|
|
28570
|
-
/* @__PURE__ */ (0,
|
|
28887
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(PopoverContent, { align: "end", className: "w-48 p-3 space-y-2", children: [
|
|
28888
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "text-sm font-medium mb-2", children: "Show / Hide Columns" }),
|
|
28889
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("label", { className: "flex items-center gap-2 text-sm font-semibold border-b pb-2 mb-2", children: [
|
|
28890
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
28571
28891
|
"input",
|
|
28572
28892
|
{
|
|
28573
28893
|
type: "checkbox",
|
|
@@ -28586,8 +28906,8 @@ function DataTable({
|
|
|
28586
28906
|
),
|
|
28587
28907
|
"Toggle All"
|
|
28588
28908
|
] }),
|
|
28589
|
-
table.getAllLeafColumns().map((column) => /* @__PURE__ */ (0,
|
|
28590
|
-
/* @__PURE__ */ (0,
|
|
28909
|
+
table.getAllLeafColumns().map((column) => /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("label", { className: "flex items-center gap-2 text-sm", children: [
|
|
28910
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
28591
28911
|
"input",
|
|
28592
28912
|
{
|
|
28593
28913
|
type: "checkbox",
|
|
@@ -28600,13 +28920,13 @@ function DataTable({
|
|
|
28600
28920
|
] })
|
|
28601
28921
|
] })
|
|
28602
28922
|
] }),
|
|
28603
|
-
/* @__PURE__ */ (0,
|
|
28604
|
-
/* @__PURE__ */ (0,
|
|
28923
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Table3, { children: [
|
|
28924
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(TableHeader, { children: table.getHeaderGroups().map((hg) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(TableRow, { children: hg.headers.map((header) => {
|
|
28605
28925
|
const canSort = header.column.getCanSort();
|
|
28606
28926
|
const canFilter = header.column.getCanFilter();
|
|
28607
28927
|
const sortDir = manualSort?.key === header.column.id ? manualSort.dir : null;
|
|
28608
|
-
return /* @__PURE__ */ (0,
|
|
28609
|
-
/* @__PURE__ */ (0,
|
|
28928
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(TableHead, { className: "relative select-none", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
28929
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
28610
28930
|
"span",
|
|
28611
28931
|
{
|
|
28612
28932
|
className: `flex items-center gap-1 ${canSort ? "cursor-pointer" : ""}`,
|
|
@@ -28618,32 +28938,32 @@ function DataTable({
|
|
|
28618
28938
|
},
|
|
28619
28939
|
children: [
|
|
28620
28940
|
(0, import_react_table.flexRender)(header.column.columnDef.header, header.getContext()),
|
|
28621
|
-
canSort && /* @__PURE__ */ (0,
|
|
28622
|
-
sortDir === "asc" && /* @__PURE__ */ (0,
|
|
28623
|
-
sortDir === "desc" && /* @__PURE__ */ (0,
|
|
28624
|
-
!sortDir && /* @__PURE__ */ (0,
|
|
28941
|
+
canSort && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
|
|
28942
|
+
sortDir === "asc" && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ArrowUp, { size: 14, className: "text-gray-500" }),
|
|
28943
|
+
sortDir === "desc" && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ArrowDown, { size: 14, className: "text-gray-500" }),
|
|
28944
|
+
!sortDir && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ArrowUpDown, { size: 14, className: "text-gray-400" })
|
|
28625
28945
|
] })
|
|
28626
28946
|
]
|
|
28627
28947
|
}
|
|
28628
28948
|
),
|
|
28629
|
-
canFilter && /* @__PURE__ */ (0,
|
|
28630
|
-
/* @__PURE__ */ (0,
|
|
28949
|
+
canFilter && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Popover, { children: [
|
|
28950
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
28631
28951
|
"span",
|
|
28632
28952
|
{
|
|
28633
28953
|
role: "presentation",
|
|
28634
28954
|
className: "pl-5 cursor-pointer",
|
|
28635
28955
|
onClick: (e) => e.stopPropagation(),
|
|
28636
|
-
children: /* @__PURE__ */ (0,
|
|
28956
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_react_fontawesome3.FontAwesomeIcon, { icon: import_free_solid_svg_icons2.faEllipsisH, className: "w-5 h-5 text-gray-500" })
|
|
28637
28957
|
}
|
|
28638
28958
|
) }),
|
|
28639
|
-
/* @__PURE__ */ (0,
|
|
28959
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
28640
28960
|
PopoverContent,
|
|
28641
28961
|
{
|
|
28642
28962
|
align: "center",
|
|
28643
28963
|
sideOffset: 14,
|
|
28644
28964
|
className: "w-50 p-3 z-[200] border-gray-300",
|
|
28645
28965
|
avoidCollisions: true,
|
|
28646
|
-
children: /* @__PURE__ */ (0,
|
|
28966
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
28647
28967
|
"form",
|
|
28648
28968
|
{
|
|
28649
28969
|
onSubmit: (e) => {
|
|
@@ -28656,8 +28976,8 @@ function DataTable({
|
|
|
28656
28976
|
},
|
|
28657
28977
|
className: "space-y-2",
|
|
28658
28978
|
children: [
|
|
28659
|
-
/* @__PURE__ */ (0,
|
|
28660
|
-
/* @__PURE__ */ (0,
|
|
28979
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("label", { htmlFor: "filter", className: "text-xs text-gray-500 font-normal", children: "Filter by value:" }),
|
|
28980
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
28661
28981
|
"input",
|
|
28662
28982
|
{
|
|
28663
28983
|
name: "filter",
|
|
@@ -28667,7 +28987,7 @@ function DataTable({
|
|
|
28667
28987
|
autoComplete: "off"
|
|
28668
28988
|
}
|
|
28669
28989
|
),
|
|
28670
|
-
/* @__PURE__ */ (0,
|
|
28990
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "justify-end flex", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
28671
28991
|
Button,
|
|
28672
28992
|
{
|
|
28673
28993
|
type: "submit",
|
|
@@ -28683,10 +29003,10 @@ function DataTable({
|
|
|
28683
29003
|
] })
|
|
28684
29004
|
] }) }, header.id);
|
|
28685
29005
|
}) }, hg.id)) }),
|
|
28686
|
-
/* @__PURE__ */ (0,
|
|
29006
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(TableBody, { children: loading ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(TableCell, { colSpan: columns.length, className: "h-24 text-center", children: "Loading..." }) }) : table.getRowModel().rows.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(TableRow, { children: row.getVisibleCells().map((cell) => {
|
|
28687
29007
|
const meta = cell.column.columnDef.meta || {};
|
|
28688
29008
|
const isClickable = meta?.isClickable;
|
|
28689
|
-
return /* @__PURE__ */ (0,
|
|
29009
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
28690
29010
|
TableCell,
|
|
28691
29011
|
{
|
|
28692
29012
|
className: `${meta?.cellClass ?? ""} ${isClickable ? "cursor-pointer hover:bg-gray-100 underline" : ""}`,
|
|
@@ -28700,17 +29020,17 @@ function DataTable({
|
|
|
28700
29020
|
},
|
|
28701
29021
|
cell.id
|
|
28702
29022
|
);
|
|
28703
|
-
}) }, row.id)) : /* @__PURE__ */ (0,
|
|
29023
|
+
}) }, row.id)) : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(TableCell, { colSpan: columns.length, className: "h-24 text-center", children: "No results." }) }) })
|
|
28704
29024
|
] }),
|
|
28705
|
-
pagination && /* @__PURE__ */ (0,
|
|
28706
|
-
/* @__PURE__ */ (0,
|
|
29025
|
+
pagination && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex items-center justify-between py-3 px-2 text-sm w-full", children: [
|
|
29026
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { children: [
|
|
28707
29027
|
"Page ",
|
|
28708
29028
|
table.getState().pagination.pageIndex + 1,
|
|
28709
29029
|
" of ",
|
|
28710
29030
|
table.getPageCount()
|
|
28711
29031
|
] }),
|
|
28712
|
-
/* @__PURE__ */ (0,
|
|
28713
|
-
/* @__PURE__ */ (0,
|
|
29032
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
29033
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
28714
29034
|
"button",
|
|
28715
29035
|
{
|
|
28716
29036
|
onClick: () => table.previousPage(),
|
|
@@ -28723,7 +29043,7 @@ function DataTable({
|
|
|
28723
29043
|
table.getState().pagination.pageIndex + 1,
|
|
28724
29044
|
table.getPageCount(),
|
|
28725
29045
|
5
|
|
28726
|
-
).map((pageNum, index) => /* @__PURE__ */ (0,
|
|
29046
|
+
).map((pageNum, index) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
28727
29047
|
"button",
|
|
28728
29048
|
{
|
|
28729
29049
|
disabled: pageNum === "...",
|
|
@@ -28733,7 +29053,7 @@ function DataTable({
|
|
|
28733
29053
|
},
|
|
28734
29054
|
index
|
|
28735
29055
|
)),
|
|
28736
|
-
/* @__PURE__ */ (0,
|
|
29056
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
28737
29057
|
"button",
|
|
28738
29058
|
{
|
|
28739
29059
|
onClick: () => table.nextPage(),
|
|
@@ -28748,7 +29068,7 @@ function DataTable({
|
|
|
28748
29068
|
}
|
|
28749
29069
|
|
|
28750
29070
|
// src/components/DataDisplay/Table/Table.tsx
|
|
28751
|
-
var
|
|
29071
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
28752
29072
|
var Table4 = ({
|
|
28753
29073
|
columns,
|
|
28754
29074
|
data,
|
|
@@ -28771,7 +29091,7 @@ var Table4 = ({
|
|
|
28771
29091
|
const rawColumns = Array.isArray(columns) ? columns : [];
|
|
28772
29092
|
const rawData = Array.isArray(data) ? data : [];
|
|
28773
29093
|
const isControlled = typeof page === "number";
|
|
28774
|
-
return /* @__PURE__ */ (0,
|
|
29094
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: `${className || ""} space-y-3`, style, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
28775
29095
|
DataTable,
|
|
28776
29096
|
{
|
|
28777
29097
|
...props,
|
|
@@ -28800,9 +29120,9 @@ var Table4 = ({
|
|
|
28800
29120
|
var Table_default = Table4;
|
|
28801
29121
|
|
|
28802
29122
|
// src/components/ui/pagination.tsx
|
|
28803
|
-
var
|
|
29123
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
28804
29124
|
function Pagination({ className, ...props }) {
|
|
28805
|
-
return /* @__PURE__ */ (0,
|
|
29125
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
28806
29126
|
"nav",
|
|
28807
29127
|
{
|
|
28808
29128
|
role: "navigation",
|
|
@@ -28817,7 +29137,7 @@ function PaginationContent({
|
|
|
28817
29137
|
className,
|
|
28818
29138
|
...props
|
|
28819
29139
|
}) {
|
|
28820
|
-
return /* @__PURE__ */ (0,
|
|
29140
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
28821
29141
|
"ul",
|
|
28822
29142
|
{
|
|
28823
29143
|
"data-slot": "pagination-content",
|
|
@@ -28827,7 +29147,7 @@ function PaginationContent({
|
|
|
28827
29147
|
);
|
|
28828
29148
|
}
|
|
28829
29149
|
function PaginationItem({ ...props }) {
|
|
28830
|
-
return /* @__PURE__ */ (0,
|
|
29150
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("li", { "data-slot": "pagination-item", ...props });
|
|
28831
29151
|
}
|
|
28832
29152
|
function PaginationLink({
|
|
28833
29153
|
className,
|
|
@@ -28835,7 +29155,7 @@ function PaginationLink({
|
|
|
28835
29155
|
size = "icon",
|
|
28836
29156
|
...props
|
|
28837
29157
|
}) {
|
|
28838
|
-
return /* @__PURE__ */ (0,
|
|
29158
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
28839
29159
|
"a",
|
|
28840
29160
|
{
|
|
28841
29161
|
"aria-current": isActive ? "page" : void 0,
|
|
@@ -28856,7 +29176,7 @@ function PaginationPrevious({
|
|
|
28856
29176
|
className,
|
|
28857
29177
|
...props
|
|
28858
29178
|
}) {
|
|
28859
|
-
return /* @__PURE__ */ (0,
|
|
29179
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
28860
29180
|
PaginationLink,
|
|
28861
29181
|
{
|
|
28862
29182
|
"aria-label": "Go to previous page",
|
|
@@ -28864,8 +29184,8 @@ function PaginationPrevious({
|
|
|
28864
29184
|
className: cn("gap-1 px-2.5 sm:pl-2.5", className),
|
|
28865
29185
|
...props,
|
|
28866
29186
|
children: [
|
|
28867
|
-
/* @__PURE__ */ (0,
|
|
28868
|
-
/* @__PURE__ */ (0,
|
|
29187
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ChevronLeft, {}),
|
|
29188
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "hidden sm:block", children: "Previous" })
|
|
28869
29189
|
]
|
|
28870
29190
|
}
|
|
28871
29191
|
);
|
|
@@ -28874,7 +29194,7 @@ function PaginationNext({
|
|
|
28874
29194
|
className,
|
|
28875
29195
|
...props
|
|
28876
29196
|
}) {
|
|
28877
|
-
return /* @__PURE__ */ (0,
|
|
29197
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
28878
29198
|
PaginationLink,
|
|
28879
29199
|
{
|
|
28880
29200
|
"aria-label": "Go to next page",
|
|
@@ -28882,8 +29202,8 @@ function PaginationNext({
|
|
|
28882
29202
|
className: cn("gap-1 px-2.5 sm:pr-2.5", className),
|
|
28883
29203
|
...props,
|
|
28884
29204
|
children: [
|
|
28885
|
-
/* @__PURE__ */ (0,
|
|
28886
|
-
/* @__PURE__ */ (0,
|
|
29205
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "hidden sm:block", children: "Next" }),
|
|
29206
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ChevronRight, {})
|
|
28887
29207
|
]
|
|
28888
29208
|
}
|
|
28889
29209
|
);
|
|
@@ -28892,7 +29212,7 @@ function PaginationEllipsis({
|
|
|
28892
29212
|
className,
|
|
28893
29213
|
...props
|
|
28894
29214
|
}) {
|
|
28895
|
-
return /* @__PURE__ */ (0,
|
|
29215
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
28896
29216
|
"span",
|
|
28897
29217
|
{
|
|
28898
29218
|
"aria-hidden": true,
|
|
@@ -28900,15 +29220,15 @@ function PaginationEllipsis({
|
|
|
28900
29220
|
className: cn("flex size-9 items-center justify-center", className),
|
|
28901
29221
|
...props,
|
|
28902
29222
|
children: [
|
|
28903
|
-
/* @__PURE__ */ (0,
|
|
28904
|
-
/* @__PURE__ */ (0,
|
|
29223
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Ellipsis, { className: "size-4" }),
|
|
29224
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "sr-only", children: "More pages" })
|
|
28905
29225
|
]
|
|
28906
29226
|
}
|
|
28907
29227
|
);
|
|
28908
29228
|
}
|
|
28909
29229
|
|
|
28910
29230
|
// src/components/DataDisplay/Pagination/Pagination.tsx
|
|
28911
|
-
var
|
|
29231
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
28912
29232
|
var CustomPagination = ({
|
|
28913
29233
|
totalPages,
|
|
28914
29234
|
currentPage,
|
|
@@ -28954,10 +29274,10 @@ var CustomPagination = ({
|
|
|
28954
29274
|
}
|
|
28955
29275
|
};
|
|
28956
29276
|
const pageNumbers = getPageNumbers();
|
|
28957
|
-
return /* @__PURE__ */ (0,
|
|
28958
|
-
/* @__PURE__ */ (0,
|
|
28959
|
-
/* @__PURE__ */ (0,
|
|
28960
|
-
/* @__PURE__ */ (0,
|
|
29277
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex flex-row gap-1 w-full items-center justify-between", children: [
|
|
29278
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
29279
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "text-sm text-muted-foreground whitespace-nowrap", children: "Items per page:" }),
|
|
29280
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
28961
29281
|
Select,
|
|
28962
29282
|
{
|
|
28963
29283
|
defaultValue: String(perPage),
|
|
@@ -28965,26 +29285,26 @@ var CustomPagination = ({
|
|
|
28965
29285
|
onPageChange({ page: 1, itemsPerPage: Number(value) });
|
|
28966
29286
|
},
|
|
28967
29287
|
children: [
|
|
28968
|
-
/* @__PURE__ */ (0,
|
|
28969
|
-
/* @__PURE__ */ (0,
|
|
28970
|
-
/* @__PURE__ */ (0,
|
|
28971
|
-
/* @__PURE__ */ (0,
|
|
28972
|
-
/* @__PURE__ */ (0,
|
|
28973
|
-
/* @__PURE__ */ (0,
|
|
29288
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(SelectTrigger, { className: "w-[100px]", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(SelectValue, { placeholder: "Select" }) }),
|
|
29289
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(SelectContent, { children: [
|
|
29290
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(SelectItem, { value: "5", children: "5" }),
|
|
29291
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(SelectItem, { value: "10", children: "10" }),
|
|
29292
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(SelectItem, { value: "20", children: "20" }),
|
|
29293
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(SelectItem, { value: "50", children: "50" })
|
|
28974
29294
|
] })
|
|
28975
29295
|
]
|
|
28976
29296
|
}
|
|
28977
29297
|
)
|
|
28978
29298
|
] }),
|
|
28979
|
-
/* @__PURE__ */ (0,
|
|
28980
|
-
/* @__PURE__ */ (0,
|
|
29299
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Pagination, { className: "justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(PaginationContent, { children: [
|
|
29300
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(PaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
28981
29301
|
PaginationPrevious,
|
|
28982
29302
|
{
|
|
28983
29303
|
onClick: () => handlePageChange(currentPage - 1),
|
|
28984
29304
|
className: currentPage === 1 ? "pointer-events-none opacity-50" : "cursor-pointer"
|
|
28985
29305
|
}
|
|
28986
29306
|
) }),
|
|
28987
|
-
pageNumbers.map((pageNumber, index) => /* @__PURE__ */ (0,
|
|
29307
|
+
pageNumbers.map((pageNumber, index) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(PaginationItem, { children: pageNumber === "..." ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(PaginationEllipsis, {}) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
28988
29308
|
PaginationLink,
|
|
28989
29309
|
{
|
|
28990
29310
|
onClick: () => handlePageChange(pageNumber),
|
|
@@ -28993,7 +29313,7 @@ var CustomPagination = ({
|
|
|
28993
29313
|
children: pageNumber
|
|
28994
29314
|
}
|
|
28995
29315
|
) }, index)),
|
|
28996
|
-
/* @__PURE__ */ (0,
|
|
29316
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(PaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
28997
29317
|
PaginationNext,
|
|
28998
29318
|
{
|
|
28999
29319
|
onClick: () => handlePageChange(currentPage + 1),
|
|
@@ -29008,124 +29328,8 @@ var Pagination_default = CustomPagination;
|
|
|
29008
29328
|
// src/components/Navigation/Tabs/Tabs.tsx
|
|
29009
29329
|
var import_link5 = __toESM(require("next/link"));
|
|
29010
29330
|
var import_navigation3 = require("next/navigation");
|
|
29011
|
-
|
|
29012
|
-
// src/components/ui/dialog.tsx
|
|
29013
|
-
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
|
|
29014
|
-
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
29015
|
-
function Dialog({
|
|
29016
|
-
...props
|
|
29017
|
-
}) {
|
|
29018
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
29019
|
-
}
|
|
29020
|
-
function DialogPortal({
|
|
29021
|
-
...props
|
|
29022
|
-
}) {
|
|
29023
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
|
|
29024
|
-
}
|
|
29025
|
-
function DialogOverlay({
|
|
29026
|
-
className,
|
|
29027
|
-
...props
|
|
29028
|
-
}) {
|
|
29029
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
29030
|
-
DialogPrimitive.Overlay,
|
|
29031
|
-
{
|
|
29032
|
-
"data-slot": "dialog-overlay",
|
|
29033
|
-
className: cn(
|
|
29034
|
-
"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",
|
|
29035
|
-
className
|
|
29036
|
-
),
|
|
29037
|
-
...props
|
|
29038
|
-
}
|
|
29039
|
-
);
|
|
29040
|
-
}
|
|
29041
|
-
function DialogContent({
|
|
29042
|
-
className,
|
|
29043
|
-
children,
|
|
29044
|
-
showCloseButton = true,
|
|
29045
|
-
...props
|
|
29046
|
-
}) {
|
|
29047
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(DialogPortal, { "data-slot": "dialog-portal", children: [
|
|
29048
|
-
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(DialogOverlay, {}),
|
|
29049
|
-
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
29050
|
-
DialogPrimitive.Content,
|
|
29051
|
-
{
|
|
29052
|
-
"data-slot": "dialog-content",
|
|
29053
|
-
className: cn(
|
|
29054
|
-
"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",
|
|
29055
|
-
className
|
|
29056
|
-
),
|
|
29057
|
-
...props,
|
|
29058
|
-
children: [
|
|
29059
|
-
children,
|
|
29060
|
-
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
29061
|
-
DialogPrimitive.Close,
|
|
29062
|
-
{
|
|
29063
|
-
"data-slot": "dialog-close",
|
|
29064
|
-
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",
|
|
29065
|
-
children: [
|
|
29066
|
-
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(X, {}),
|
|
29067
|
-
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "sr-only", children: "Close" })
|
|
29068
|
-
]
|
|
29069
|
-
}
|
|
29070
|
-
)
|
|
29071
|
-
]
|
|
29072
|
-
}
|
|
29073
|
-
)
|
|
29074
|
-
] });
|
|
29075
|
-
}
|
|
29076
|
-
function DialogHeader({ className, ...props }) {
|
|
29077
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
29078
|
-
"div",
|
|
29079
|
-
{
|
|
29080
|
-
"data-slot": "dialog-header",
|
|
29081
|
-
className: cn("flex flex-col gap-2 text-center sm:text-left", className),
|
|
29082
|
-
...props
|
|
29083
|
-
}
|
|
29084
|
-
);
|
|
29085
|
-
}
|
|
29086
|
-
function DialogFooter({ className, ...props }) {
|
|
29087
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
29088
|
-
"div",
|
|
29089
|
-
{
|
|
29090
|
-
"data-slot": "dialog-footer",
|
|
29091
|
-
className: cn(
|
|
29092
|
-
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
29093
|
-
className
|
|
29094
|
-
),
|
|
29095
|
-
...props
|
|
29096
|
-
}
|
|
29097
|
-
);
|
|
29098
|
-
}
|
|
29099
|
-
function DialogTitle({
|
|
29100
|
-
className,
|
|
29101
|
-
...props
|
|
29102
|
-
}) {
|
|
29103
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
29104
|
-
DialogPrimitive.Title,
|
|
29105
|
-
{
|
|
29106
|
-
"data-slot": "dialog-title",
|
|
29107
|
-
className: cn("text-lg leading-none font-semibold", className),
|
|
29108
|
-
...props
|
|
29109
|
-
}
|
|
29110
|
-
);
|
|
29111
|
-
}
|
|
29112
|
-
function DialogDescription({
|
|
29113
|
-
className,
|
|
29114
|
-
...props
|
|
29115
|
-
}) {
|
|
29116
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
29117
|
-
DialogPrimitive.Description,
|
|
29118
|
-
{
|
|
29119
|
-
"data-slot": "dialog-description",
|
|
29120
|
-
className: cn("text-muted-foreground text-sm", className),
|
|
29121
|
-
...props
|
|
29122
|
-
}
|
|
29123
|
-
);
|
|
29124
|
-
}
|
|
29125
|
-
|
|
29126
|
-
// src/components/Navigation/Tabs/Tabs.tsx
|
|
29127
29331
|
var import_react26 = require("react");
|
|
29128
|
-
var
|
|
29332
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
29129
29333
|
var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuilder = true }) => {
|
|
29130
29334
|
const rawTabs = Array.isArray(tabs) ? tabs : [];
|
|
29131
29335
|
const baseClasses = "text-[12px] text-foreground p-2 text-center rounded-md transition-colors";
|
|
@@ -29157,23 +29361,23 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
29157
29361
|
const renderDesktopTab = (tab, index) => {
|
|
29158
29362
|
const finalClasses = [baseClasses, isActive(tab.url) ? activeClasses : hoverClasses, tab.className || ""].join(" ");
|
|
29159
29363
|
if (Array.isArray(tab.children) && tab.children.length > 0 && tab.isDropDown) {
|
|
29160
|
-
return /* @__PURE__ */ (0,
|
|
29161
|
-
/* @__PURE__ */ (0,
|
|
29364
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(DropdownMenu, { children: [
|
|
29365
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(DropdownMenuTrigger, { className: `${finalClasses} inline-flex items-center gap-1`, children: [
|
|
29162
29366
|
tab.header,
|
|
29163
|
-
/* @__PURE__ */ (0,
|
|
29367
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ChevronDown, { className: "h-4 w-4 opacity-80" })
|
|
29164
29368
|
] }),
|
|
29165
|
-
/* @__PURE__ */ (0,
|
|
29369
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
29166
29370
|
DropdownMenuContent,
|
|
29167
29371
|
{
|
|
29168
29372
|
align: "start",
|
|
29169
29373
|
sideOffset: 6,
|
|
29170
29374
|
className: "z-50 min-w-[160px] rounded-md border border-gray-200 bg-white p-1 shadow-lg",
|
|
29171
|
-
children: tab.children.map((item) => /* @__PURE__ */ (0,
|
|
29375
|
+
children: tab.children.map((item) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
29172
29376
|
DropdownMenuItem,
|
|
29173
29377
|
{
|
|
29174
29378
|
asChild: true,
|
|
29175
29379
|
className: "cursor-pointer rounded-sm px-3 py-2 text-[12px] text-gray-800 hover:bg-gray-100 focus:bg-gray-100",
|
|
29176
|
-
children: /* @__PURE__ */ (0,
|
|
29380
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_link5.default, { href: item.url || "#", onClick: (e) => handleBuilderExit(e, item.url || "#"), children: item.header })
|
|
29177
29381
|
},
|
|
29178
29382
|
item.id
|
|
29179
29383
|
))
|
|
@@ -29181,7 +29385,7 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
29181
29385
|
)
|
|
29182
29386
|
] }, index);
|
|
29183
29387
|
}
|
|
29184
|
-
return tab.url ? /* @__PURE__ */ (0,
|
|
29388
|
+
return tab.url ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
29185
29389
|
import_link5.default,
|
|
29186
29390
|
{
|
|
29187
29391
|
href: tab.url,
|
|
@@ -29191,14 +29395,14 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
29191
29395
|
children: tab.header
|
|
29192
29396
|
},
|
|
29193
29397
|
index
|
|
29194
|
-
) : /* @__PURE__ */ (0,
|
|
29398
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: finalClasses, style: tab.style, role: "button", tabIndex: 0, children: tab.header }, index);
|
|
29195
29399
|
};
|
|
29196
|
-
const renderMobileMenu = () => /* @__PURE__ */ (0,
|
|
29197
|
-
/* @__PURE__ */ (0,
|
|
29198
|
-
/* @__PURE__ */ (0,
|
|
29400
|
+
const renderMobileMenu = () => /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(DropdownMenu, { children: [
|
|
29401
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(DropdownMenuTrigger, { className: "flex items-center gap-2 px-3 py-2 rounded-md bg-white/10 text-white text-sm", children: [
|
|
29402
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Menu, { className: "h-4 w-4" }),
|
|
29199
29403
|
"Menu"
|
|
29200
29404
|
] }),
|
|
29201
|
-
/* @__PURE__ */ (0,
|
|
29405
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
29202
29406
|
DropdownMenuContent,
|
|
29203
29407
|
{
|
|
29204
29408
|
align: "start",
|
|
@@ -29207,25 +29411,25 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
29207
29411
|
children: rawTabs.map((tab, i) => {
|
|
29208
29412
|
const hasChildren = Array.isArray(tab.children) && tab.children.length > 0 && tab.isDropDown;
|
|
29209
29413
|
if (hasChildren) {
|
|
29210
|
-
return /* @__PURE__ */ (0,
|
|
29211
|
-
/* @__PURE__ */ (0,
|
|
29212
|
-
/* @__PURE__ */ (0,
|
|
29414
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(DropdownMenuSub, { children: [
|
|
29415
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(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 }),
|
|
29416
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(DropdownMenuSubContent, { className: "bg-white border shadow-lg rounded-md p-1", children: tab.children.map((item) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
29213
29417
|
DropdownMenuItem,
|
|
29214
29418
|
{
|
|
29215
29419
|
asChild: true,
|
|
29216
29420
|
className: "cursor-pointer rounded-sm px-3 py-2 text-[12px] text-gray-800 hover:bg-gray-100",
|
|
29217
|
-
children: /* @__PURE__ */ (0,
|
|
29421
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_link5.default, { href: item.url || "#", onClick: (e) => handleBuilderExit(e, item.url || "#"), children: item.header })
|
|
29218
29422
|
},
|
|
29219
29423
|
item.id
|
|
29220
29424
|
)) })
|
|
29221
29425
|
] }, i);
|
|
29222
29426
|
}
|
|
29223
|
-
return /* @__PURE__ */ (0,
|
|
29427
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
29224
29428
|
DropdownMenuItem,
|
|
29225
29429
|
{
|
|
29226
29430
|
asChild: true,
|
|
29227
29431
|
className: "cursor-pointer rounded-sm px-3 py-2 text-[13px] text-gray-800 hover:bg-gray-100",
|
|
29228
|
-
children: /* @__PURE__ */ (0,
|
|
29432
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_link5.default, { href: tab.url || "#", onClick: (e) => handleBuilderExit(e, tab.url || "#"), children: tab.header })
|
|
29229
29433
|
},
|
|
29230
29434
|
i
|
|
29231
29435
|
);
|
|
@@ -29235,19 +29439,19 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
29235
29439
|
] });
|
|
29236
29440
|
const forceMobile = canvasMode ? canvasMode === "mobile" || canvasMode === "tablet" : void 0;
|
|
29237
29441
|
const forceDesktop = canvasMode ? canvasMode === "desktop" : void 0;
|
|
29238
|
-
return /* @__PURE__ */ (0,
|
|
29239
|
-
/* @__PURE__ */ (0,
|
|
29240
|
-
forceDesktop !== void 0 ? forceDesktop && /* @__PURE__ */ (0,
|
|
29241
|
-
forceMobile !== void 0 ? forceMobile && /* @__PURE__ */ (0,
|
|
29442
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_jsx_runtime54.Fragment, { children: [
|
|
29443
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className, style, children: [
|
|
29444
|
+
forceDesktop !== void 0 ? forceDesktop && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "hidden md:flex", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "hidden md:flex", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }),
|
|
29445
|
+
forceMobile !== void 0 ? forceMobile && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { children: renderMobileMenu() }) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "flex md:hidden", children: renderMobileMenu() })
|
|
29242
29446
|
] }),
|
|
29243
|
-
/* @__PURE__ */ (0,
|
|
29244
|
-
/* @__PURE__ */ (0,
|
|
29245
|
-
/* @__PURE__ */ (0,
|
|
29246
|
-
/* @__PURE__ */ (0,
|
|
29447
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Dialog, { open: showExitDialog, onOpenChange: setShowExitDialog, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(DialogContent, { className: "bg-[#fff]", children: [
|
|
29448
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(DialogHeader, { children: [
|
|
29449
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(DialogTitle, { children: "Exit Builder?" }),
|
|
29450
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(DialogDescription, { children: "You are about to leave the builder. Any unsaved changes may be lost." })
|
|
29247
29451
|
] }),
|
|
29248
|
-
/* @__PURE__ */ (0,
|
|
29249
|
-
/* @__PURE__ */ (0,
|
|
29250
|
-
/* @__PURE__ */ (0,
|
|
29452
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(DialogFooter, { children: [
|
|
29453
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Button, { className: "cursor-pointer bg-[#12715b] text-[#fff]", variant: "outline", onClick: () => setShowExitDialog(false), children: "Cancel" }),
|
|
29454
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Button, { className: "cursor-pointer border-[#12715b] border", onClick: confirmExit, children: "Yes, Exit" })
|
|
29251
29455
|
] })
|
|
29252
29456
|
] }) })
|
|
29253
29457
|
] });
|
|
@@ -29256,12 +29460,12 @@ var Tabs_default = Tabs;
|
|
|
29256
29460
|
|
|
29257
29461
|
// src/components/Navigation/Stages/Stages.tsx
|
|
29258
29462
|
var import_react27 = __toESM(require("react"));
|
|
29259
|
-
var
|
|
29463
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
29260
29464
|
var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStageChange }) => {
|
|
29261
|
-
return /* @__PURE__ */ (0,
|
|
29262
|
-
/* @__PURE__ */ (0,
|
|
29263
|
-
/* @__PURE__ */ (0,
|
|
29264
|
-
/* @__PURE__ */ (0,
|
|
29465
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className, style, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex items-center justify-between bg-red p-2 rounded-lg border border-gray-200 w-full", children: [
|
|
29466
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("button", { className: "p-2 hover:bg-gray-100 rounded", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("svg", { className: "w-4 h-4 text-gray-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) }) }),
|
|
29467
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "flex items-center flex-1 px-2 flex-wrap gap-2", children: stages?.length > 0 && stages?.map((stage, index) => /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_react27.default.Fragment, { children: [
|
|
29468
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
29265
29469
|
"button",
|
|
29266
29470
|
{
|
|
29267
29471
|
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"}`,
|
|
@@ -29273,9 +29477,9 @@ var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStag
|
|
|
29273
29477
|
children: stage.header
|
|
29274
29478
|
}
|
|
29275
29479
|
),
|
|
29276
|
-
index < stages.length - 1 && /* @__PURE__ */ (0,
|
|
29480
|
+
index < stages.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "flex-shrink-0 w-3 h-px bg-gray-300" })
|
|
29277
29481
|
] }, stage.id)) }),
|
|
29278
|
-
isShowBtn && /* @__PURE__ */ (0,
|
|
29482
|
+
isShowBtn && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
29279
29483
|
"button",
|
|
29280
29484
|
{
|
|
29281
29485
|
className: "bg-[#034486] text-white px-6 py-2 rounded-lg text-sm font-medium transition-colors duration-200 shadow-sm",
|
|
@@ -29293,26 +29497,26 @@ var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStag
|
|
|
29293
29497
|
var Stages_default = StagesComponent;
|
|
29294
29498
|
|
|
29295
29499
|
// src/components/Navigation/Spacer/Spacer.tsx
|
|
29296
|
-
var
|
|
29500
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
29297
29501
|
var Spacer = ({ className, style }) => {
|
|
29298
|
-
return /* @__PURE__ */ (0,
|
|
29502
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: `${className}`, style });
|
|
29299
29503
|
};
|
|
29300
29504
|
var Spacer_default = Spacer;
|
|
29301
29505
|
|
|
29302
29506
|
// src/components/Navigation/Profile/Profile.tsx
|
|
29303
|
-
var
|
|
29507
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
29304
29508
|
|
|
29305
29509
|
// src/components/Navigation/Notification/Notification.tsx
|
|
29306
|
-
var
|
|
29510
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
29307
29511
|
|
|
29308
29512
|
// src/components/Navigation/Logo/Logo.tsx
|
|
29309
|
-
var
|
|
29513
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
29310
29514
|
|
|
29311
29515
|
// src/components/ui/avatar.tsx
|
|
29312
|
-
var
|
|
29516
|
+
var React10 = __toESM(require("react"));
|
|
29313
29517
|
var AvatarPrimitive = __toESM(require("@radix-ui/react-avatar"));
|
|
29314
|
-
var
|
|
29315
|
-
var Avatar =
|
|
29518
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
29519
|
+
var Avatar = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
29316
29520
|
AvatarPrimitive.Root,
|
|
29317
29521
|
{
|
|
29318
29522
|
ref,
|
|
@@ -29324,7 +29528,7 @@ var Avatar = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
29324
29528
|
}
|
|
29325
29529
|
));
|
|
29326
29530
|
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
29327
|
-
var AvatarImage =
|
|
29531
|
+
var AvatarImage = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
29328
29532
|
AvatarPrimitive.Image,
|
|
29329
29533
|
{
|
|
29330
29534
|
ref,
|
|
@@ -29333,7 +29537,7 @@ var AvatarImage = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
29333
29537
|
}
|
|
29334
29538
|
));
|
|
29335
29539
|
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
29336
|
-
var AvatarFallback =
|
|
29540
|
+
var AvatarFallback = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
29337
29541
|
AvatarPrimitive.Fallback,
|
|
29338
29542
|
{
|
|
29339
29543
|
ref,
|
|
@@ -29352,7 +29556,7 @@ var import_image3 = __toESM(require("next/image"));
|
|
|
29352
29556
|
var import_navigation4 = require("next/navigation");
|
|
29353
29557
|
var import_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
|
|
29354
29558
|
var import_react28 = require("react");
|
|
29355
|
-
var
|
|
29559
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
29356
29560
|
function Navbar({
|
|
29357
29561
|
style,
|
|
29358
29562
|
badgeType,
|
|
@@ -29396,23 +29600,23 @@ function Navbar({
|
|
|
29396
29600
|
}
|
|
29397
29601
|
return list || [];
|
|
29398
29602
|
}, [source, navList]);
|
|
29399
|
-
return /* @__PURE__ */ (0,
|
|
29400
|
-
/* @__PURE__ */ (0,
|
|
29603
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_jsx_runtime61.Fragment, { children: [
|
|
29604
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
29401
29605
|
"nav",
|
|
29402
29606
|
{
|
|
29403
29607
|
className: "w-full border-b border-b-white dark:border-b-gray-800 dark:bg-gray-800 bg-white shadow-sm",
|
|
29404
29608
|
style,
|
|
29405
|
-
children: /* @__PURE__ */ (0,
|
|
29406
|
-
/* @__PURE__ */ (0,
|
|
29609
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "mx-auto flex max-w-[90%] items-center justify-between px-4 py-4", children: [
|
|
29610
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
29407
29611
|
import_link6.default,
|
|
29408
29612
|
{
|
|
29409
29613
|
href: "/",
|
|
29410
29614
|
onClick: (e) => handleBuilderExit(e, "/"),
|
|
29411
29615
|
className: "flex items-center space-x-2",
|
|
29412
|
-
children: imageUrl ? /* @__PURE__ */ (0,
|
|
29616
|
+
children: imageUrl ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_image3.default, { src: imageUrl, alt: altText, width: 200, height: 200 }) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { className: "font-semibold text-blue-700", children: "Logo" })
|
|
29413
29617
|
}
|
|
29414
29618
|
),
|
|
29415
|
-
!isMobileView && /* @__PURE__ */ (0,
|
|
29619
|
+
!isMobileView && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "flex items-center space-x-6 sm:hidden md:flex", children: formatedMenu.map((item) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
29416
29620
|
import_link6.default,
|
|
29417
29621
|
{
|
|
29418
29622
|
href: item.url || "#",
|
|
@@ -29422,39 +29626,39 @@ function Navbar({
|
|
|
29422
29626
|
},
|
|
29423
29627
|
item.id
|
|
29424
29628
|
)) }),
|
|
29425
|
-
/* @__PURE__ */ (0,
|
|
29426
|
-
!isMobileView ? /* @__PURE__ */ (0,
|
|
29427
|
-
/* @__PURE__ */ (0,
|
|
29428
|
-
/* @__PURE__ */ (0,
|
|
29429
|
-
] }) }) : /* @__PURE__ */ (0,
|
|
29430
|
-
/* @__PURE__ */ (0,
|
|
29431
|
-
/* @__PURE__ */ (0,
|
|
29432
|
-
badgeType === "number" && !(hideBadgeWhenZero && badgeCount === 0) && Number(badgeCount) > 0 ? /* @__PURE__ */ (0,
|
|
29629
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex items-center space-x-3", children: [
|
|
29630
|
+
!isMobileView ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "flex-1 px-6", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "relative w-full max-w-md border border-gray-300 rounded-md", children: [
|
|
29631
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 dark:text-white text-gray-400" }),
|
|
29632
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Input, { placeholder: "Search", className: "pl-9 text-gray-400" })
|
|
29633
|
+
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Button, { variant: "ghost", size: "icon", className: "border border-gray-400", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Search, { className: "h-5 w-5 text-gray-400" }) }),
|
|
29634
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "relative bg-[#E9E9E9] dark:bg-gray-700 rounded-md", children: [
|
|
29635
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Button, { variant: "ghost", size: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Bell, { className: "h-5 w-5 text-[#1C1B1F] dark:text-gray-400" }) }),
|
|
29636
|
+
badgeType === "number" && !(hideBadgeWhenZero && badgeCount === 0) && Number(badgeCount) > 0 ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("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__ */ (0, import_jsx_runtime61.jsx)("span", { className: "absolute -top-1 -right-1 flex h-2 w-2 items-center justify-center rounded-full bg-red-500" })
|
|
29433
29637
|
] }),
|
|
29434
|
-
/* @__PURE__ */ (0,
|
|
29435
|
-
/* @__PURE__ */ (0,
|
|
29436
|
-
!isMobileView && showName && /* @__PURE__ */ (0,
|
|
29437
|
-
!isMobileView ? /* @__PURE__ */ (0,
|
|
29438
|
-
/* @__PURE__ */ (0,
|
|
29638
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(DropdownMenu, { children: [
|
|
29639
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex items-center space-x-2", children: [
|
|
29640
|
+
!isMobileView && showName && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("h4", { className: "text-[#000000] dark:text-gray-300 text-[13px] font-[500] mb-0", children: userName }),
|
|
29641
|
+
!isMobileView ? /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_jsx_runtime61.Fragment, { children: [
|
|
29642
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Avatar, { className: "cursor-pointer h-8 w-8 text-gray-900", children: profileType === "avatar" ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
29439
29643
|
AvatarImage,
|
|
29440
29644
|
{
|
|
29441
29645
|
src: "/images/appbuilder/toolset/profile.svg",
|
|
29442
29646
|
alt: "Profile"
|
|
29443
29647
|
}
|
|
29444
|
-
) : /* @__PURE__ */ (0,
|
|
29445
|
-
/* @__PURE__ */ (0,
|
|
29648
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("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) }) }),
|
|
29649
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
29446
29650
|
Button,
|
|
29447
29651
|
{
|
|
29448
29652
|
variant: "ghost",
|
|
29449
29653
|
size: "icon",
|
|
29450
29654
|
className: "text-gray-900 md:hidden dark:invert",
|
|
29451
|
-
children: /* @__PURE__ */ (0,
|
|
29655
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Menu, { className: "h-6 w-6" })
|
|
29452
29656
|
}
|
|
29453
29657
|
)
|
|
29454
|
-
] }) : /* @__PURE__ */ (0,
|
|
29658
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Button, { variant: "ghost", size: "icon", className: "text-gray-900 dark:invert", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Menu, { className: "h-6 w-6" }) })
|
|
29455
29659
|
] }) }),
|
|
29456
|
-
/* @__PURE__ */ (0,
|
|
29457
|
-
profileMenu && profileMenu.length > 0 && /* @__PURE__ */ (0,
|
|
29660
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(DropdownMenuContent, { align: "end", className: "bg-white dark:bg-gray-800", children: [
|
|
29661
|
+
profileMenu && profileMenu.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_jsx_runtime61.Fragment, { children: profileMenu.map((item) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(DropdownMenuItem, { className: "text-black dark:invert", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
29458
29662
|
import_link6.default,
|
|
29459
29663
|
{
|
|
29460
29664
|
href: item.url || "#",
|
|
@@ -29462,9 +29666,9 @@ function Navbar({
|
|
|
29462
29666
|
children: item.header
|
|
29463
29667
|
}
|
|
29464
29668
|
) }, item.id)) }),
|
|
29465
|
-
/* @__PURE__ */ (0,
|
|
29466
|
-
/* @__PURE__ */ (0,
|
|
29467
|
-
formatedMenu && formatedMenu.length > 0 && /* @__PURE__ */ (0,
|
|
29669
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "md:hidden", children: [
|
|
29670
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_react_dropdown_menu.DropdownMenuSeparator, {}),
|
|
29671
|
+
formatedMenu && formatedMenu.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_jsx_runtime61.Fragment, { children: formatedMenu.map((item) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(DropdownMenuItem, { className: "text-black dark:invert", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
29468
29672
|
import_link6.default,
|
|
29469
29673
|
{
|
|
29470
29674
|
href: item.url || "#",
|
|
@@ -29479,14 +29683,14 @@ function Navbar({
|
|
|
29479
29683
|
] })
|
|
29480
29684
|
}
|
|
29481
29685
|
),
|
|
29482
|
-
/* @__PURE__ */ (0,
|
|
29483
|
-
/* @__PURE__ */ (0,
|
|
29484
|
-
/* @__PURE__ */ (0,
|
|
29485
|
-
/* @__PURE__ */ (0,
|
|
29686
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Dialog, { open: showExitDialog, onOpenChange: setShowExitDialog, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(DialogContent, { className: "bg-[#fff]", children: [
|
|
29687
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(DialogHeader, { children: [
|
|
29688
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(DialogTitle, { children: "Exit Builder?" }),
|
|
29689
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(DialogDescription, { children: "You are about to leave the builder. Any unsaved changes may be lost." })
|
|
29486
29690
|
] }),
|
|
29487
|
-
/* @__PURE__ */ (0,
|
|
29488
|
-
/* @__PURE__ */ (0,
|
|
29489
|
-
/* @__PURE__ */ (0,
|
|
29691
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(DialogFooter, { children: [
|
|
29692
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Button, { className: "cursor-pointer bg-[#12715b] text-[#fff]", variant: "outline", onClick: () => setShowExitDialog(false), children: "Cancel" }),
|
|
29693
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Button, { className: "cursor-pointer border-[#12715b] border", onClick: confirmExit, children: "Yes, Exit" })
|
|
29490
29694
|
] })
|
|
29491
29695
|
] }) })
|
|
29492
29696
|
] });
|
|
@@ -29495,35 +29699,35 @@ function Navbar({
|
|
|
29495
29699
|
// src/components/Chart/BarChart.tsx
|
|
29496
29700
|
var import_react29 = __toESM(require("react"));
|
|
29497
29701
|
var import_recharts = require("recharts");
|
|
29498
|
-
var
|
|
29702
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
29499
29703
|
var ChartComponent = ({ className, style, loading, ...props }) => {
|
|
29500
29704
|
const data = Array.isArray(props.data) ? props.data : [];
|
|
29501
29705
|
const chartType = props.chartType || "bar";
|
|
29502
29706
|
const legendsPosition = props.legendsPosition === "middle" || props.legendsPosition === "bottom" ? props.legendsPosition : "top";
|
|
29503
29707
|
if (loading || data.length === 0) {
|
|
29504
|
-
return /* @__PURE__ */ (0,
|
|
29708
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
29505
29709
|
"div",
|
|
29506
29710
|
{
|
|
29507
29711
|
className: `flex items-center justify-center w-full h-[300px] md:h-[400px] bg-gray-50 animate-pulse rounded-lg ${className}`,
|
|
29508
29712
|
style,
|
|
29509
|
-
children: /* @__PURE__ */ (0,
|
|
29713
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "text-gray-400 text-sm md:text-base", children: loading ? "Loading chart report..." : "No data available to display the chart." })
|
|
29510
29714
|
}
|
|
29511
29715
|
);
|
|
29512
29716
|
}
|
|
29513
|
-
return /* @__PURE__ */ (0,
|
|
29514
|
-
/* @__PURE__ */ (0,
|
|
29515
|
-
/* @__PURE__ */ (0,
|
|
29516
|
-
/* @__PURE__ */ (0,
|
|
29517
|
-
/* @__PURE__ */ (0,
|
|
29518
|
-
/* @__PURE__ */ (0,
|
|
29519
|
-
/* @__PURE__ */ (0,
|
|
29717
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: `${className} h-[400px]`, style, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_recharts.ResponsiveContainer, { width: "100%", height: "100%", children: chartType === "bar" ? /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_recharts.BarChart, { data, title: "Leads", desc: "content", children: [
|
|
29718
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_recharts.CartesianGrid, { strokeDasharray: "3 3" }),
|
|
29719
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_recharts.XAxis, { dataKey: "name" }),
|
|
29720
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_recharts.YAxis, {}),
|
|
29721
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_recharts.Tooltip, { formatter: (value) => `${value}k` }),
|
|
29722
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_recharts.Legend, { verticalAlign: legendsPosition, align: "center" }),
|
|
29723
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
29520
29724
|
import_recharts.Bar,
|
|
29521
29725
|
{
|
|
29522
29726
|
dataKey: "value",
|
|
29523
29727
|
fill: "#00695C",
|
|
29524
29728
|
radius: [6, 6, 0, 0],
|
|
29525
29729
|
isAnimationActive: false,
|
|
29526
|
-
children: data.map((entry, index) => /* @__PURE__ */ (0,
|
|
29730
|
+
children: data.map((entry, index) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
29527
29731
|
"rect",
|
|
29528
29732
|
{
|
|
29529
29733
|
fill: entry.color || "#00695C"
|
|
@@ -29532,16 +29736,16 @@ var ChartComponent = ({ className, style, loading, ...props }) => {
|
|
|
29532
29736
|
))
|
|
29533
29737
|
}
|
|
29534
29738
|
)
|
|
29535
|
-
] }) : /* @__PURE__ */ (0,
|
|
29536
|
-
/* @__PURE__ */ (0,
|
|
29537
|
-
/* @__PURE__ */ (0,
|
|
29538
|
-
/* @__PURE__ */ (0,
|
|
29739
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_recharts.AreaChart, { data, children: [
|
|
29740
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("linearGradient", { id: "colorCount", x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
29741
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("stop", { offset: "5%", stopColor: "#00695C", stopOpacity: 0.8 }),
|
|
29742
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("stop", { offset: "95%", stopColor: "#00695C", stopOpacity: 0 })
|
|
29539
29743
|
] }) }),
|
|
29540
|
-
/* @__PURE__ */ (0,
|
|
29541
|
-
/* @__PURE__ */ (0,
|
|
29542
|
-
/* @__PURE__ */ (0,
|
|
29543
|
-
/* @__PURE__ */ (0,
|
|
29544
|
-
/* @__PURE__ */ (0,
|
|
29744
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_recharts.CartesianGrid, { strokeDasharray: "3 3" }),
|
|
29745
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_recharts.XAxis, { dataKey: "name" }),
|
|
29746
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_recharts.YAxis, {}),
|
|
29747
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_recharts.Tooltip, { formatter: (value) => `${value}k` }),
|
|
29748
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
29545
29749
|
import_recharts.Area,
|
|
29546
29750
|
{
|
|
29547
29751
|
type: "monotone",
|
|
@@ -29559,7 +29763,7 @@ var BarChart_default = import_react29.default.memo(ChartComponent);
|
|
|
29559
29763
|
// src/components/Chart/PieChart.tsx
|
|
29560
29764
|
var import_react30 = __toESM(require("react"));
|
|
29561
29765
|
var import_recharts2 = require("recharts");
|
|
29562
|
-
var
|
|
29766
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
29563
29767
|
var getRandomColor = () => {
|
|
29564
29768
|
const palette = [
|
|
29565
29769
|
"#2563eb",
|
|
@@ -29592,19 +29796,19 @@ var DonutChart = ({ className, style, loading, ...props }) => {
|
|
|
29592
29796
|
}, []);
|
|
29593
29797
|
const renderLegends = (0, import_react30.useMemo)(() => {
|
|
29594
29798
|
if (!showLegends) return null;
|
|
29595
|
-
return /* @__PURE__ */ (0,
|
|
29799
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_jsx_runtime63.Fragment, { children: data.map((d) => /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
29596
29800
|
"div",
|
|
29597
29801
|
{
|
|
29598
29802
|
className: "flex items-center space-x-2 rounded-md border border-gray-200 px-3 py-2 w-[48%] md:w-auto",
|
|
29599
29803
|
children: [
|
|
29600
|
-
/* @__PURE__ */ (0,
|
|
29804
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
29601
29805
|
"span",
|
|
29602
29806
|
{
|
|
29603
29807
|
className: "inline-block w-[16px] h-[16px] rounded",
|
|
29604
29808
|
style: { backgroundColor: d.color }
|
|
29605
29809
|
}
|
|
29606
29810
|
),
|
|
29607
|
-
/* @__PURE__ */ (0,
|
|
29811
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "text-[#000000] text-[12px] md:text-[13px] font-[500]", children: d.name })
|
|
29608
29812
|
]
|
|
29609
29813
|
},
|
|
29610
29814
|
d.name
|
|
@@ -29612,24 +29816,24 @@ var DonutChart = ({ className, style, loading, ...props }) => {
|
|
|
29612
29816
|
}, [data, showLegends]);
|
|
29613
29817
|
if (!mounted) return null;
|
|
29614
29818
|
if (loading || data.length === 0) {
|
|
29615
|
-
return /* @__PURE__ */ (0,
|
|
29819
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
29616
29820
|
"div",
|
|
29617
29821
|
{
|
|
29618
29822
|
className: `flex items-center justify-center w-full h-[300px] md:h-[400px] bg-gray-50 animate-pulse rounded-lg ${className}`,
|
|
29619
29823
|
style,
|
|
29620
|
-
children: /* @__PURE__ */ (0,
|
|
29824
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "text-gray-400 text-sm md:text-base", children: loading ? "Loading chart report..." : "No data available to display the chart." })
|
|
29621
29825
|
}
|
|
29622
29826
|
);
|
|
29623
29827
|
}
|
|
29624
|
-
return /* @__PURE__ */ (0,
|
|
29828
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
29625
29829
|
"div",
|
|
29626
29830
|
{
|
|
29627
29831
|
className: `relative flex flex-col items-center ${className}`,
|
|
29628
29832
|
style,
|
|
29629
29833
|
children: [
|
|
29630
|
-
/* @__PURE__ */ (0,
|
|
29631
|
-
/* @__PURE__ */ (0,
|
|
29632
|
-
/* @__PURE__ */ (0,
|
|
29834
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "relative w-full md:w-[70%] h-[300px] md:h-[400px] flex items-center justify-center", children: [
|
|
29835
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_recharts2.ResponsiveContainer, { width: "99%", height: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_recharts2.PieChart, { children: [
|
|
29836
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
29633
29837
|
import_recharts2.Pie,
|
|
29634
29838
|
{
|
|
29635
29839
|
data,
|
|
@@ -29641,8 +29845,8 @@ var DonutChart = ({ className, style, loading, ...props }) => {
|
|
|
29641
29845
|
labelLine: false,
|
|
29642
29846
|
isAnimationActive: false,
|
|
29643
29847
|
children: [
|
|
29644
|
-
data.map((entry, index) => /* @__PURE__ */ (0,
|
|
29645
|
-
/* @__PURE__ */ (0,
|
|
29848
|
+
data.map((entry, index) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_recharts2.Cell, { fill: entry.color }, `cell-${index}`)),
|
|
29849
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
29646
29850
|
import_recharts2.LabelList,
|
|
29647
29851
|
{
|
|
29648
29852
|
dataKey: "value",
|
|
@@ -29655,14 +29859,14 @@ var DonutChart = ({ className, style, loading, ...props }) => {
|
|
|
29655
29859
|
]
|
|
29656
29860
|
}
|
|
29657
29861
|
),
|
|
29658
|
-
/* @__PURE__ */ (0,
|
|
29862
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
29659
29863
|
import_recharts2.Tooltip,
|
|
29660
29864
|
{
|
|
29661
29865
|
formatter: (value, name) => [`${value}k`, name]
|
|
29662
29866
|
}
|
|
29663
29867
|
)
|
|
29664
29868
|
] }) }),
|
|
29665
|
-
/* @__PURE__ */ (0,
|
|
29869
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
29666
29870
|
"div",
|
|
29667
29871
|
{
|
|
29668
29872
|
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]`,
|
|
@@ -29673,7 +29877,7 @@ var DonutChart = ({ className, style, loading, ...props }) => {
|
|
|
29673
29877
|
}
|
|
29674
29878
|
)
|
|
29675
29879
|
] }),
|
|
29676
|
-
/* @__PURE__ */ (0,
|
|
29880
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "flex flex-wrap justify-center gap-2 mt-6 w-full md:w-auto", children: renderLegends })
|
|
29677
29881
|
]
|
|
29678
29882
|
}
|
|
29679
29883
|
);
|
|
@@ -29681,10 +29885,10 @@ var DonutChart = ({ className, style, loading, ...props }) => {
|
|
|
29681
29885
|
var PieChart_default = import_react30.default.memo(DonutChart);
|
|
29682
29886
|
|
|
29683
29887
|
// src/components/Blocks/EmailComposer.tsx
|
|
29684
|
-
var
|
|
29888
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
29685
29889
|
function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc, setShowBcc, cc, setCc, bcc, setBcc, subject, setSubject, body, setBody }) {
|
|
29686
|
-
return /* @__PURE__ */ (0,
|
|
29687
|
-
/* @__PURE__ */ (0,
|
|
29890
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className, style, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "border rounded-md shadow bg-[#fff] p-4 mx-auto z-[50] relative", children: [
|
|
29891
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
29688
29892
|
"input",
|
|
29689
29893
|
{
|
|
29690
29894
|
type: "email",
|
|
@@ -29693,8 +29897,8 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
29693
29897
|
required: true
|
|
29694
29898
|
}
|
|
29695
29899
|
) }),
|
|
29696
|
-
/* @__PURE__ */ (0,
|
|
29697
|
-
/* @__PURE__ */ (0,
|
|
29900
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
29901
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
29698
29902
|
"input",
|
|
29699
29903
|
{
|
|
29700
29904
|
type: "email",
|
|
@@ -29705,7 +29909,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
29705
29909
|
required: true
|
|
29706
29910
|
}
|
|
29707
29911
|
),
|
|
29708
|
-
!showCc && /* @__PURE__ */ (0,
|
|
29912
|
+
!showCc && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
29709
29913
|
"button",
|
|
29710
29914
|
{
|
|
29711
29915
|
onClick: () => setShowCc?.(true),
|
|
@@ -29713,7 +29917,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
29713
29917
|
children: "Cc"
|
|
29714
29918
|
}
|
|
29715
29919
|
),
|
|
29716
|
-
!showBcc && /* @__PURE__ */ (0,
|
|
29920
|
+
!showBcc && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
29717
29921
|
"button",
|
|
29718
29922
|
{
|
|
29719
29923
|
onClick: () => setShowBcc?.(true),
|
|
@@ -29722,7 +29926,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
29722
29926
|
}
|
|
29723
29927
|
)
|
|
29724
29928
|
] }) }),
|
|
29725
|
-
showCc && /* @__PURE__ */ (0,
|
|
29929
|
+
showCc && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
29726
29930
|
"input",
|
|
29727
29931
|
{
|
|
29728
29932
|
type: "text",
|
|
@@ -29732,7 +29936,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
29732
29936
|
className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
|
|
29733
29937
|
}
|
|
29734
29938
|
) }),
|
|
29735
|
-
showBcc && /* @__PURE__ */ (0,
|
|
29939
|
+
showBcc && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
29736
29940
|
"input",
|
|
29737
29941
|
{
|
|
29738
29942
|
type: "text",
|
|
@@ -29742,7 +29946,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
29742
29946
|
className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
|
|
29743
29947
|
}
|
|
29744
29948
|
) }),
|
|
29745
|
-
/* @__PURE__ */ (0,
|
|
29949
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
29746
29950
|
"input",
|
|
29747
29951
|
{
|
|
29748
29952
|
type: "text",
|
|
@@ -29752,11 +29956,11 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
29752
29956
|
className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
|
|
29753
29957
|
}
|
|
29754
29958
|
) }),
|
|
29755
|
-
/* @__PURE__ */ (0,
|
|
29756
|
-
/* @__PURE__ */ (0,
|
|
29757
|
-
/* @__PURE__ */ (0,
|
|
29758
|
-
/* @__PURE__ */ (0,
|
|
29759
|
-
/* @__PURE__ */ (0,
|
|
29959
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(MyEditor, { value: body, onChange: setBody }) }),
|
|
29960
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "flex justify-end gap-2", children: [
|
|
29961
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("button", { className: "px-4 py-2 rounded-md text-gray-600 hover:bg-gray-100", children: "Discard" }),
|
|
29962
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("button", { className: "px-4 py-2 rounded-md border text-[#12715B] border-[#12715B]", children: "Reset" }),
|
|
29963
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("button", { className: "px-4 py-2 rounded-md bg-[#12715B] text-white", children: "Send" })
|
|
29760
29964
|
] })
|
|
29761
29965
|
] }) });
|
|
29762
29966
|
}
|
|
@@ -29801,10 +30005,10 @@ function showSonnerToast({
|
|
|
29801
30005
|
// src/components/ui/sonner.tsx
|
|
29802
30006
|
var import_next_themes = require("next-themes");
|
|
29803
30007
|
var import_sonner2 = require("sonner");
|
|
29804
|
-
var
|
|
30008
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
29805
30009
|
var Toaster = ({ ...props }) => {
|
|
29806
30010
|
const { theme = "system" } = (0, import_next_themes.useTheme)();
|
|
29807
|
-
return /* @__PURE__ */ (0,
|
|
30011
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
29808
30012
|
import_sonner2.Toaster,
|
|
29809
30013
|
{
|
|
29810
30014
|
theme,
|
|
@@ -29840,6 +30044,7 @@ var Toaster = ({ ...props }) => {
|
|
|
29840
30044
|
Image,
|
|
29841
30045
|
Modal,
|
|
29842
30046
|
MultiCheckbox,
|
|
30047
|
+
MultiSelect,
|
|
29843
30048
|
Navbar,
|
|
29844
30049
|
NumberInput,
|
|
29845
30050
|
Pagination,
|