@algorithm-shift/design-system 1.2.977 → 1.2.979
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +15 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.js +428 -223
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +403 -199
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -30425,29 +30425,230 @@ var CustomPagination = ({
|
|
|
30425
30425
|
};
|
|
30426
30426
|
var Pagination_default = CustomPagination;
|
|
30427
30427
|
|
|
30428
|
+
// src/components/DataDisplay/HistoryTimeline/HistoryTimeline.tsx
|
|
30429
|
+
import { useMemo as useMemo7 } from "react";
|
|
30430
|
+
|
|
30431
|
+
// src/components/ui/accordion.tsx
|
|
30432
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
30433
|
+
import { jsx as jsx55, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
30434
|
+
function Accordion2({
|
|
30435
|
+
...props
|
|
30436
|
+
}) {
|
|
30437
|
+
return /* @__PURE__ */ jsx55(AccordionPrimitive.Root, { "data-slot": "accordion", ...props });
|
|
30438
|
+
}
|
|
30439
|
+
function AccordionItem({
|
|
30440
|
+
className,
|
|
30441
|
+
...props
|
|
30442
|
+
}) {
|
|
30443
|
+
return /* @__PURE__ */ jsx55(
|
|
30444
|
+
AccordionPrimitive.Item,
|
|
30445
|
+
{
|
|
30446
|
+
"data-slot": "accordion-item",
|
|
30447
|
+
className: cn("border-b last:border-b-0", className),
|
|
30448
|
+
...props
|
|
30449
|
+
}
|
|
30450
|
+
);
|
|
30451
|
+
}
|
|
30452
|
+
function AccordionTrigger({
|
|
30453
|
+
className,
|
|
30454
|
+
children,
|
|
30455
|
+
...props
|
|
30456
|
+
}) {
|
|
30457
|
+
return /* @__PURE__ */ jsx55(AccordionPrimitive.Header, { className: "flex", children: /* @__PURE__ */ jsxs32(
|
|
30458
|
+
AccordionPrimitive.Trigger,
|
|
30459
|
+
{
|
|
30460
|
+
"data-slot": "accordion-trigger",
|
|
30461
|
+
className: cn(
|
|
30462
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",
|
|
30463
|
+
className
|
|
30464
|
+
),
|
|
30465
|
+
...props,
|
|
30466
|
+
children: [
|
|
30467
|
+
children,
|
|
30468
|
+
/* @__PURE__ */ jsx55(ChevronDown, { className: "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200" })
|
|
30469
|
+
]
|
|
30470
|
+
}
|
|
30471
|
+
) });
|
|
30472
|
+
}
|
|
30473
|
+
function AccordionContent({
|
|
30474
|
+
className,
|
|
30475
|
+
children,
|
|
30476
|
+
...props
|
|
30477
|
+
}) {
|
|
30478
|
+
return /* @__PURE__ */ jsx55(
|
|
30479
|
+
AccordionPrimitive.Content,
|
|
30480
|
+
{
|
|
30481
|
+
"data-slot": "accordion-content",
|
|
30482
|
+
className: "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",
|
|
30483
|
+
...props,
|
|
30484
|
+
children: /* @__PURE__ */ jsx55("div", { className: cn("pt-0 pb-4", className), children })
|
|
30485
|
+
}
|
|
30486
|
+
);
|
|
30487
|
+
}
|
|
30488
|
+
|
|
30489
|
+
// src/components/ui/card.tsx
|
|
30490
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
30491
|
+
function Card({ className, ...props }) {
|
|
30492
|
+
return /* @__PURE__ */ jsx56(
|
|
30493
|
+
"div",
|
|
30494
|
+
{
|
|
30495
|
+
"data-slot": "card",
|
|
30496
|
+
className: cn(
|
|
30497
|
+
"bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",
|
|
30498
|
+
className
|
|
30499
|
+
),
|
|
30500
|
+
...props
|
|
30501
|
+
}
|
|
30502
|
+
);
|
|
30503
|
+
}
|
|
30504
|
+
function CardHeader({ className, ...props }) {
|
|
30505
|
+
return /* @__PURE__ */ jsx56(
|
|
30506
|
+
"div",
|
|
30507
|
+
{
|
|
30508
|
+
"data-slot": "card-header",
|
|
30509
|
+
className: cn(
|
|
30510
|
+
"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
|
|
30511
|
+
className
|
|
30512
|
+
),
|
|
30513
|
+
...props
|
|
30514
|
+
}
|
|
30515
|
+
);
|
|
30516
|
+
}
|
|
30517
|
+
function CardTitle({ className, ...props }) {
|
|
30518
|
+
return /* @__PURE__ */ jsx56(
|
|
30519
|
+
"div",
|
|
30520
|
+
{
|
|
30521
|
+
"data-slot": "card-title",
|
|
30522
|
+
className: cn("leading-none font-semibold", className),
|
|
30523
|
+
...props
|
|
30524
|
+
}
|
|
30525
|
+
);
|
|
30526
|
+
}
|
|
30527
|
+
function CardContent({ className, ...props }) {
|
|
30528
|
+
return /* @__PURE__ */ jsx56(
|
|
30529
|
+
"div",
|
|
30530
|
+
{
|
|
30531
|
+
"data-slot": "card-content",
|
|
30532
|
+
className: cn("px-6", className),
|
|
30533
|
+
...props
|
|
30534
|
+
}
|
|
30535
|
+
);
|
|
30536
|
+
}
|
|
30537
|
+
|
|
30538
|
+
// src/components/DataDisplay/HistoryTimeline/HistoryTimeline.tsx
|
|
30539
|
+
import { jsx as jsx57, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
30540
|
+
function getValue(item, key) {
|
|
30541
|
+
if (!key) return void 0;
|
|
30542
|
+
return item[key];
|
|
30543
|
+
}
|
|
30544
|
+
var HistoryTimeline = ({
|
|
30545
|
+
title = "Timeline",
|
|
30546
|
+
className,
|
|
30547
|
+
loading = false,
|
|
30548
|
+
titleKey,
|
|
30549
|
+
descriptionKey,
|
|
30550
|
+
createdAtKey,
|
|
30551
|
+
...props
|
|
30552
|
+
}) => {
|
|
30553
|
+
const data = useMemo7(() => {
|
|
30554
|
+
if (Array.isArray(props.data)) {
|
|
30555
|
+
return props.data;
|
|
30556
|
+
}
|
|
30557
|
+
return [];
|
|
30558
|
+
}, [props.data]);
|
|
30559
|
+
if (loading) {
|
|
30560
|
+
return /* @__PURE__ */ jsx57(Card, { className: cn("w-full", className), children: /* @__PURE__ */ jsxs33(CardContent, { className: "flex items-center justify-center px-4 py-8", children: [
|
|
30561
|
+
/* @__PURE__ */ jsx57(LoaderCircle, { className: "h-5 w-5 animate-spin text-muted-foreground" }),
|
|
30562
|
+
/* @__PURE__ */ jsx57("span", { className: "ml-2 text-sm text-muted-foreground", children: "Loading history\u2026" })
|
|
30563
|
+
] }) });
|
|
30564
|
+
}
|
|
30565
|
+
if (data.length === 0) {
|
|
30566
|
+
return /* @__PURE__ */ jsx57(Card, { className: cn("w-full", className), children: /* @__PURE__ */ jsx57(CardContent, { className: "px-4 py-8 text-center text-muted-foreground", children: "No history available." }) });
|
|
30567
|
+
}
|
|
30568
|
+
return /* @__PURE__ */ jsx57(Card, { className: cn("w-full", className), children: /* @__PURE__ */ jsx57(Accordion2, { type: "single", collapsible: true, defaultValue: "history", children: /* @__PURE__ */ jsxs33(AccordionItem, { value: "history", className: "border-0", children: [
|
|
30569
|
+
/* @__PURE__ */ jsx57(CardHeader, { className: "flex flex-row items-center justify-between gap-2 border-b px-4 py-3", children: /* @__PURE__ */ jsx57(
|
|
30570
|
+
AccordionTrigger,
|
|
30571
|
+
{
|
|
30572
|
+
className: cn(
|
|
30573
|
+
"flex flex-1 items-center justify-between gap-2 p-0 text-left",
|
|
30574
|
+
"hover:no-underline"
|
|
30575
|
+
),
|
|
30576
|
+
children: /* @__PURE__ */ jsx57(CardTitle, { className: "text-base font-semibold", children: title })
|
|
30577
|
+
}
|
|
30578
|
+
) }),
|
|
30579
|
+
/* @__PURE__ */ jsx57(AccordionContent, { asChild: true, children: /* @__PURE__ */ jsx57(CardContent, { className: "px-4 py-3", children: /* @__PURE__ */ jsx57("ol", { className: "relative ml-4 border-l-2 border-[#939393] space-y-4", children: data.map((item, index) => {
|
|
30580
|
+
const id = item.id ?? index;
|
|
30581
|
+
const rawTitle = getValue(item, titleKey);
|
|
30582
|
+
const rawDescription = getValue(item, descriptionKey);
|
|
30583
|
+
const rawCreatedAt = getValue(item, createdAtKey);
|
|
30584
|
+
const titleText = String(rawTitle ?? "");
|
|
30585
|
+
const descriptionText = rawDescription != null ? String(rawDescription) : "";
|
|
30586
|
+
const createdAtDate = rawCreatedAt != null ? new Date(rawCreatedAt) : null;
|
|
30587
|
+
return /* @__PURE__ */ jsxs33("li", { className: "relative pl-4", children: [
|
|
30588
|
+
/* @__PURE__ */ jsx57("span", { className: "absolute left-[-9px] top-2 flex h-4 w-4 items-center justify-center rounded-full bg-primary text-primary-foreground", children: /* @__PURE__ */ jsx57("div", { className: "bg-[#06A59A] text-white rounded-md p-[5px]", children: /* @__PURE__ */ jsx57(
|
|
30589
|
+
Info,
|
|
30590
|
+
{
|
|
30591
|
+
className: cn(
|
|
30592
|
+
"h-5 w-5 text-white"
|
|
30593
|
+
)
|
|
30594
|
+
}
|
|
30595
|
+
) }) }),
|
|
30596
|
+
/* @__PURE__ */ jsx57(
|
|
30597
|
+
Accordion2,
|
|
30598
|
+
{
|
|
30599
|
+
type: "single",
|
|
30600
|
+
collapsible: true,
|
|
30601
|
+
className: "w-full",
|
|
30602
|
+
children: /* @__PURE__ */ jsxs33(AccordionItem, { value: `item-${item.id}`, className: "border-0", children: [
|
|
30603
|
+
/* @__PURE__ */ jsx57(
|
|
30604
|
+
AccordionTrigger,
|
|
30605
|
+
{
|
|
30606
|
+
className: cn(
|
|
30607
|
+
"flex items-center justify-between gap-2 rounded-md px-2 py-1 text-left",
|
|
30608
|
+
"hover:bg-muted/60 hover:no-underline"
|
|
30609
|
+
),
|
|
30610
|
+
children: /* @__PURE__ */ jsxs33("div", { className: "flex flex-col gap-1", children: [
|
|
30611
|
+
/* @__PURE__ */ jsx57("span", { className: "text-sm font-medium leading-none", children: titleText }),
|
|
30612
|
+
/* @__PURE__ */ jsx57("span", { className: "text-[11px] text-muted-foreground", children: new Intl.DateTimeFormat("default", {
|
|
30613
|
+
dateStyle: "medium",
|
|
30614
|
+
timeStyle: "short"
|
|
30615
|
+
}).format(createdAtDate ?? /* @__PURE__ */ new Date()) })
|
|
30616
|
+
] })
|
|
30617
|
+
}
|
|
30618
|
+
),
|
|
30619
|
+
/* @__PURE__ */ jsx57(AccordionContent, { className: "pt-1", children: descriptionText && /* @__PURE__ */ jsx57("p", { className: "rounded-md bg-muted px-2 py-2 text-xs text-muted-foreground", children: descriptionText }) })
|
|
30620
|
+
] })
|
|
30621
|
+
}
|
|
30622
|
+
)
|
|
30623
|
+
] }, id);
|
|
30624
|
+
}) }) }) })
|
|
30625
|
+
] }) }) });
|
|
30626
|
+
};
|
|
30627
|
+
var HistoryTimeline_default = HistoryTimeline;
|
|
30628
|
+
|
|
30428
30629
|
// src/components/Navigation/Tabs/Tabs.tsx
|
|
30429
|
-
import { useCallback as useCallback3, useMemo as
|
|
30630
|
+
import { useCallback as useCallback3, useMemo as useMemo8, useState as useState9 } from "react";
|
|
30430
30631
|
import Link5 from "next/link";
|
|
30431
30632
|
import { usePathname, useRouter } from "next/navigation";
|
|
30432
30633
|
|
|
30433
30634
|
// src/components/ui/dialog.tsx
|
|
30434
30635
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
30435
|
-
import { jsx as
|
|
30636
|
+
import { jsx as jsx58, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
30436
30637
|
function Dialog({
|
|
30437
30638
|
...props
|
|
30438
30639
|
}) {
|
|
30439
|
-
return /* @__PURE__ */
|
|
30640
|
+
return /* @__PURE__ */ jsx58(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
30440
30641
|
}
|
|
30441
30642
|
function DialogPortal({
|
|
30442
30643
|
...props
|
|
30443
30644
|
}) {
|
|
30444
|
-
return /* @__PURE__ */
|
|
30645
|
+
return /* @__PURE__ */ jsx58(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
|
|
30445
30646
|
}
|
|
30446
30647
|
function DialogOverlay({
|
|
30447
30648
|
className,
|
|
30448
30649
|
...props
|
|
30449
30650
|
}) {
|
|
30450
|
-
return /* @__PURE__ */
|
|
30651
|
+
return /* @__PURE__ */ jsx58(
|
|
30451
30652
|
DialogPrimitive.Overlay,
|
|
30452
30653
|
{
|
|
30453
30654
|
"data-slot": "dialog-overlay",
|
|
@@ -30465,9 +30666,9 @@ function DialogContent({
|
|
|
30465
30666
|
showCloseButton = true,
|
|
30466
30667
|
...props
|
|
30467
30668
|
}) {
|
|
30468
|
-
return /* @__PURE__ */
|
|
30469
|
-
/* @__PURE__ */
|
|
30470
|
-
/* @__PURE__ */
|
|
30669
|
+
return /* @__PURE__ */ jsxs34(DialogPortal, { "data-slot": "dialog-portal", children: [
|
|
30670
|
+
/* @__PURE__ */ jsx58(DialogOverlay, {}),
|
|
30671
|
+
/* @__PURE__ */ jsxs34(
|
|
30471
30672
|
DialogPrimitive.Content,
|
|
30472
30673
|
{
|
|
30473
30674
|
"data-slot": "dialog-content",
|
|
@@ -30478,14 +30679,14 @@ function DialogContent({
|
|
|
30478
30679
|
...props,
|
|
30479
30680
|
children: [
|
|
30480
30681
|
children,
|
|
30481
|
-
showCloseButton && /* @__PURE__ */
|
|
30682
|
+
showCloseButton && /* @__PURE__ */ jsxs34(
|
|
30482
30683
|
DialogPrimitive.Close,
|
|
30483
30684
|
{
|
|
30484
30685
|
"data-slot": "dialog-close",
|
|
30485
30686
|
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",
|
|
30486
30687
|
children: [
|
|
30487
|
-
/* @__PURE__ */
|
|
30488
|
-
/* @__PURE__ */
|
|
30688
|
+
/* @__PURE__ */ jsx58(X, {}),
|
|
30689
|
+
/* @__PURE__ */ jsx58("span", { className: "sr-only", children: "Close" })
|
|
30489
30690
|
]
|
|
30490
30691
|
}
|
|
30491
30692
|
)
|
|
@@ -30495,7 +30696,7 @@ function DialogContent({
|
|
|
30495
30696
|
] });
|
|
30496
30697
|
}
|
|
30497
30698
|
function DialogHeader({ className, ...props }) {
|
|
30498
|
-
return /* @__PURE__ */
|
|
30699
|
+
return /* @__PURE__ */ jsx58(
|
|
30499
30700
|
"div",
|
|
30500
30701
|
{
|
|
30501
30702
|
"data-slot": "dialog-header",
|
|
@@ -30505,7 +30706,7 @@ function DialogHeader({ className, ...props }) {
|
|
|
30505
30706
|
);
|
|
30506
30707
|
}
|
|
30507
30708
|
function DialogFooter({ className, ...props }) {
|
|
30508
|
-
return /* @__PURE__ */
|
|
30709
|
+
return /* @__PURE__ */ jsx58(
|
|
30509
30710
|
"div",
|
|
30510
30711
|
{
|
|
30511
30712
|
"data-slot": "dialog-footer",
|
|
@@ -30521,7 +30722,7 @@ function DialogTitle({
|
|
|
30521
30722
|
className,
|
|
30522
30723
|
...props
|
|
30523
30724
|
}) {
|
|
30524
|
-
return /* @__PURE__ */
|
|
30725
|
+
return /* @__PURE__ */ jsx58(
|
|
30525
30726
|
DialogPrimitive.Title,
|
|
30526
30727
|
{
|
|
30527
30728
|
"data-slot": "dialog-title",
|
|
@@ -30534,7 +30735,7 @@ function DialogDescription({
|
|
|
30534
30735
|
className,
|
|
30535
30736
|
...props
|
|
30536
30737
|
}) {
|
|
30537
|
-
return /* @__PURE__ */
|
|
30738
|
+
return /* @__PURE__ */ jsx58(
|
|
30538
30739
|
DialogPrimitive.Description,
|
|
30539
30740
|
{
|
|
30540
30741
|
"data-slot": "dialog-description",
|
|
@@ -30582,7 +30783,7 @@ function showSonnerToast({
|
|
|
30582
30783
|
}
|
|
30583
30784
|
|
|
30584
30785
|
// src/components/Navigation/Tabs/Tabs.tsx
|
|
30585
|
-
import { Fragment as Fragment22, jsx as
|
|
30786
|
+
import { Fragment as Fragment22, jsx as jsx59, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
30586
30787
|
var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuilder = false, source, parentKey, menuNameKey, menuUrlKey, loading, bgActiveColor, textActiveColor }) => {
|
|
30587
30788
|
const [openIndex, setOpenIndex] = useState9(null);
|
|
30588
30789
|
const currentPathname = usePathname();
|
|
@@ -30618,7 +30819,7 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30618
30819
|
});
|
|
30619
30820
|
return sortMenus(rootMenus);
|
|
30620
30821
|
}
|
|
30621
|
-
const rawTabs =
|
|
30822
|
+
const rawTabs = useMemo8(() => {
|
|
30622
30823
|
if (!Array.isArray(tabs)) return [];
|
|
30623
30824
|
if (source === "manual") return Array.isArray(tabs) ? tabs : [];
|
|
30624
30825
|
return groupMenus(tabs);
|
|
@@ -30681,13 +30882,13 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30681
30882
|
border: active && textActiveColor ? `1px solid ${textActiveColor}` : void 0
|
|
30682
30883
|
};
|
|
30683
30884
|
if (Array.isArray(tab.children) && tab.children.length > 0 && tab.isDropDown) {
|
|
30684
|
-
return /* @__PURE__ */
|
|
30885
|
+
return /* @__PURE__ */ jsxs35(
|
|
30685
30886
|
DropdownMenu,
|
|
30686
30887
|
{
|
|
30687
30888
|
open: openIndex === index,
|
|
30688
30889
|
onOpenChange: (open) => setOpenIndex(open ? index : null),
|
|
30689
30890
|
children: [
|
|
30690
|
-
/* @__PURE__ */
|
|
30891
|
+
/* @__PURE__ */ jsxs35(
|
|
30691
30892
|
DropdownMenuTrigger,
|
|
30692
30893
|
{
|
|
30693
30894
|
className: `${finalClasses} inline-flex items-center gap-1`,
|
|
@@ -30701,11 +30902,11 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30701
30902
|
style: finalStyle,
|
|
30702
30903
|
children: [
|
|
30703
30904
|
tab.header,
|
|
30704
|
-
/* @__PURE__ */
|
|
30905
|
+
/* @__PURE__ */ jsx59(ChevronDown, { className: "h-4 w-4 opacity-80" })
|
|
30705
30906
|
]
|
|
30706
30907
|
}
|
|
30707
30908
|
),
|
|
30708
|
-
/* @__PURE__ */
|
|
30909
|
+
/* @__PURE__ */ jsx59(
|
|
30709
30910
|
DropdownMenuContent,
|
|
30710
30911
|
{
|
|
30711
30912
|
align: "start",
|
|
@@ -30718,12 +30919,12 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30718
30919
|
onMouseLeave: () => {
|
|
30719
30920
|
timeout = setTimeout(() => setOpenIndex(null), 150);
|
|
30720
30921
|
},
|
|
30721
|
-
children: tab.children.map((item, index2) => /* @__PURE__ */
|
|
30922
|
+
children: tab.children.map((item, index2) => /* @__PURE__ */ jsx59(
|
|
30722
30923
|
DropdownMenuItem,
|
|
30723
30924
|
{
|
|
30724
30925
|
asChild: true,
|
|
30725
30926
|
className: "cursor-pointer rounded-sm px-3 py-2 text-gray-800 hover:bg-gray-100 focus:bg-gray-100",
|
|
30726
|
-
children: /* @__PURE__ */
|
|
30927
|
+
children: /* @__PURE__ */ jsx59(
|
|
30727
30928
|
Link5,
|
|
30728
30929
|
{
|
|
30729
30930
|
href: item.url || "#",
|
|
@@ -30742,7 +30943,7 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30742
30943
|
index
|
|
30743
30944
|
);
|
|
30744
30945
|
}
|
|
30745
|
-
return tab.url ? /* @__PURE__ */
|
|
30946
|
+
return tab.url ? /* @__PURE__ */ jsx59(
|
|
30746
30947
|
Link5,
|
|
30747
30948
|
{
|
|
30748
30949
|
href: tab.url,
|
|
@@ -30753,14 +30954,14 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30753
30954
|
children: tab.header
|
|
30754
30955
|
},
|
|
30755
30956
|
index
|
|
30756
|
-
) : /* @__PURE__ */
|
|
30957
|
+
) : /* @__PURE__ */ jsx59("div", { className: finalClasses, style: finalStyle, role: "button", tabIndex: 0, children: tab.header }, index);
|
|
30757
30958
|
};
|
|
30758
|
-
const renderMobileMenu = () => /* @__PURE__ */
|
|
30759
|
-
/* @__PURE__ */
|
|
30760
|
-
/* @__PURE__ */
|
|
30959
|
+
const renderMobileMenu = () => /* @__PURE__ */ jsxs35(DropdownMenu, { children: [
|
|
30960
|
+
/* @__PURE__ */ jsxs35(DropdownMenuTrigger, { className: "flex items-center gap-2 px-3 py-2 rounded-md bg-white/10 text-white text-sm", children: [
|
|
30961
|
+
/* @__PURE__ */ jsx59(Menu, { className: "h-4 w-4" }),
|
|
30761
30962
|
"Menu"
|
|
30762
30963
|
] }),
|
|
30763
|
-
/* @__PURE__ */
|
|
30964
|
+
/* @__PURE__ */ jsx59(
|
|
30764
30965
|
DropdownMenuContent,
|
|
30765
30966
|
{
|
|
30766
30967
|
align: "start",
|
|
@@ -30769,25 +30970,25 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30769
30970
|
children: rawTabs.map((tab, i) => {
|
|
30770
30971
|
const hasChildren = Array.isArray(tab.children) && tab.children.length > 0 && tab.isDropDown;
|
|
30771
30972
|
if (hasChildren) {
|
|
30772
|
-
return /* @__PURE__ */
|
|
30773
|
-
/* @__PURE__ */
|
|
30774
|
-
/* @__PURE__ */
|
|
30973
|
+
return /* @__PURE__ */ jsxs35(DropdownMenuSub, { children: [
|
|
30974
|
+
/* @__PURE__ */ jsx59(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 }),
|
|
30975
|
+
/* @__PURE__ */ jsx59(DropdownMenuSubContent, { className: "bg-white border shadow-lg rounded-md p-1", children: tab.children.map((item, index) => /* @__PURE__ */ jsx59(
|
|
30775
30976
|
DropdownMenuItem,
|
|
30776
30977
|
{
|
|
30777
30978
|
asChild: true,
|
|
30778
30979
|
className: "cursor-pointer rounded-sm px-3 py-2 text-gray-800 hover:bg-gray-100",
|
|
30779
|
-
children: /* @__PURE__ */
|
|
30980
|
+
children: /* @__PURE__ */ jsx59(Link5, { href: item.url || "#", onClick: (e) => handleBuilderExit(e, item.url || "#"), children: item.header })
|
|
30780
30981
|
},
|
|
30781
30982
|
item.id || index
|
|
30782
30983
|
)) })
|
|
30783
30984
|
] }, i);
|
|
30784
30985
|
}
|
|
30785
|
-
return /* @__PURE__ */
|
|
30986
|
+
return /* @__PURE__ */ jsx59(
|
|
30786
30987
|
DropdownMenuItem,
|
|
30787
30988
|
{
|
|
30788
30989
|
asChild: true,
|
|
30789
30990
|
className: "cursor-pointer rounded-sm px-3 py-2 text-[13px] text-gray-800 hover:bg-gray-100",
|
|
30790
|
-
children: /* @__PURE__ */
|
|
30991
|
+
children: /* @__PURE__ */ jsx59(Link5, { href: tab.url || "#", onClick: (e) => handleBuilderExit(e, tab.url || "#"), children: tab.header })
|
|
30791
30992
|
},
|
|
30792
30993
|
i
|
|
30793
30994
|
);
|
|
@@ -30797,19 +30998,19 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30797
30998
|
] });
|
|
30798
30999
|
const forceMobile = canvasMode ? canvasMode === "mobile" || canvasMode === "tablet" : void 0;
|
|
30799
31000
|
const forceDesktop = canvasMode ? canvasMode === "desktop" : void 0;
|
|
30800
|
-
return /* @__PURE__ */
|
|
30801
|
-
/* @__PURE__ */
|
|
30802
|
-
forceDesktop !== void 0 ? forceDesktop && /* @__PURE__ */
|
|
30803
|
-
forceMobile !== void 0 ? forceMobile && /* @__PURE__ */
|
|
31001
|
+
return /* @__PURE__ */ jsxs35(Fragment22, { children: [
|
|
31002
|
+
/* @__PURE__ */ jsxs35("div", { className: cn("min-h-10", className), style, children: [
|
|
31003
|
+
forceDesktop !== void 0 ? forceDesktop && /* @__PURE__ */ jsx59("div", { className: "hidden md:flex", children: /* @__PURE__ */ jsx59("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }) : /* @__PURE__ */ jsx59("div", { className: "hidden md:flex", children: /* @__PURE__ */ jsx59("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }),
|
|
31004
|
+
forceMobile !== void 0 ? forceMobile && /* @__PURE__ */ jsx59("div", { children: renderMobileMenu() }) : /* @__PURE__ */ jsx59("div", { className: "flex md:hidden", children: renderMobileMenu() })
|
|
30804
31005
|
] }),
|
|
30805
|
-
/* @__PURE__ */
|
|
30806
|
-
/* @__PURE__ */
|
|
30807
|
-
/* @__PURE__ */
|
|
30808
|
-
/* @__PURE__ */
|
|
31006
|
+
/* @__PURE__ */ jsx59(Dialog, { open: showExitDialog, onOpenChange: setShowExitDialog, children: /* @__PURE__ */ jsxs35(DialogContent, { className: "bg-[#fff]", children: [
|
|
31007
|
+
/* @__PURE__ */ jsxs35(DialogHeader, { children: [
|
|
31008
|
+
/* @__PURE__ */ jsx59(DialogTitle, { children: "Exit Builder?" }),
|
|
31009
|
+
/* @__PURE__ */ jsx59(DialogDescription, { children: "You are about to leave the builder. Any unsaved changes may be lost." })
|
|
30809
31010
|
] }),
|
|
30810
|
-
/* @__PURE__ */
|
|
30811
|
-
/* @__PURE__ */
|
|
30812
|
-
/* @__PURE__ */
|
|
31011
|
+
/* @__PURE__ */ jsxs35(DialogFooter, { children: [
|
|
31012
|
+
/* @__PURE__ */ jsx59(Button, { className: "cursor-pointer bg-[#12715b] text-[#fff]", variant: "outline", onClick: () => setShowExitDialog(false), children: "Cancel" }),
|
|
31013
|
+
/* @__PURE__ */ jsx59(Button, { className: "cursor-pointer border-[#12715b] border", onClick: confirmExit, children: "Yes, Exit" })
|
|
30813
31014
|
] })
|
|
30814
31015
|
] }) })
|
|
30815
31016
|
] });
|
|
@@ -30818,7 +31019,7 @@ var Tabs_default = Tabs;
|
|
|
30818
31019
|
|
|
30819
31020
|
// src/components/Navigation/Stages/Stages.tsx
|
|
30820
31021
|
import React10, { useState as useState10 } from "react";
|
|
30821
|
-
import { jsx as
|
|
31022
|
+
import { jsx as jsx60, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
30822
31023
|
var StagesComponent = ({
|
|
30823
31024
|
stages,
|
|
30824
31025
|
isShowBtn,
|
|
@@ -30866,7 +31067,7 @@ var StagesComponent = ({
|
|
|
30866
31067
|
};
|
|
30867
31068
|
const isAllStagesCompleted = isCompleted || currentStage === lastStage;
|
|
30868
31069
|
const disabled = isAllStagesCompleted || loading || saving;
|
|
30869
|
-
return /* @__PURE__ */
|
|
31070
|
+
return /* @__PURE__ */ jsx60("div", { className, style, children: /* @__PURE__ */ jsxs36(
|
|
30870
31071
|
"div",
|
|
30871
31072
|
{
|
|
30872
31073
|
className: `
|
|
@@ -30876,8 +31077,8 @@ var StagesComponent = ({
|
|
|
30876
31077
|
${isMobile ? "p-3 sm:p-4" : "p-2"}
|
|
30877
31078
|
`,
|
|
30878
31079
|
children: [
|
|
30879
|
-
/* @__PURE__ */
|
|
30880
|
-
/* @__PURE__ */
|
|
31080
|
+
/* @__PURE__ */ jsx60("div", { className: "flex items-center flex-shrink-0 order-1 lg:order-1", children: /* @__PURE__ */ jsx60("button", { className: "p-2 hover:bg-gray-100 rounded flex-shrink-0", children: /* @__PURE__ */ jsx60("svg", { className: "w-4 h-4 text-gray-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx60("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) }) }),
|
|
31081
|
+
/* @__PURE__ */ jsx60(
|
|
30881
31082
|
"div",
|
|
30882
31083
|
{
|
|
30883
31084
|
className: `
|
|
@@ -30885,7 +31086,7 @@ var StagesComponent = ({
|
|
|
30885
31086
|
flex-wrap gap-2 sm:gap-2 lg:gap-3 w-full lg:w-auto
|
|
30886
31087
|
${isMobile ? "order-2 mt-2 lg:mt-0" : "order-2"}
|
|
30887
31088
|
`,
|
|
30888
|
-
children: loading ? Array(6).fill(null).map((_, index) => /* @__PURE__ */
|
|
31089
|
+
children: loading ? Array(6).fill(null).map((_, index) => /* @__PURE__ */ jsx60(
|
|
30889
31090
|
"button",
|
|
30890
31091
|
{
|
|
30891
31092
|
className: `
|
|
@@ -30903,8 +31104,8 @@ var StagesComponent = ({
|
|
|
30903
31104
|
const currentIndex = stages.findIndex((s) => s[dataKey] === activeStage);
|
|
30904
31105
|
const isCompletedStage = isAllStagesCompleted || index <= currentIndex;
|
|
30905
31106
|
const isActive = !isAllStagesCompleted && index === currentIndex;
|
|
30906
|
-
return /* @__PURE__ */
|
|
30907
|
-
/* @__PURE__ */
|
|
31107
|
+
return /* @__PURE__ */ jsxs36(React10.Fragment, { children: [
|
|
31108
|
+
/* @__PURE__ */ jsx60(
|
|
30908
31109
|
"button",
|
|
30909
31110
|
{
|
|
30910
31111
|
className: `
|
|
@@ -30921,19 +31122,19 @@ var StagesComponent = ({
|
|
|
30921
31122
|
children: stage[dataLabel]
|
|
30922
31123
|
}
|
|
30923
31124
|
),
|
|
30924
|
-
!isMobile && index < stages.length - 1 && /* @__PURE__ */
|
|
31125
|
+
!isMobile && index < stages.length - 1 && /* @__PURE__ */ jsx60("div", { className: "hidden sm:flex sm:flex-shrink-0 w-3 h-px bg-gray-300 sm:w-4" })
|
|
30925
31126
|
] }, stage.id);
|
|
30926
31127
|
})
|
|
30927
31128
|
}
|
|
30928
31129
|
),
|
|
30929
|
-
isShowBtn && /* @__PURE__ */
|
|
31130
|
+
isShowBtn && /* @__PURE__ */ jsx60(
|
|
30930
31131
|
"div",
|
|
30931
31132
|
{
|
|
30932
31133
|
className: `
|
|
30933
31134
|
flex items-center flex-shrink-0 w-full lg:w-auto
|
|
30934
31135
|
${isMobile ? "order-3 mt-3 lg:mt-0" : "order-3"}
|
|
30935
31136
|
`,
|
|
30936
|
-
children: /* @__PURE__ */
|
|
31137
|
+
children: /* @__PURE__ */ jsx60(
|
|
30937
31138
|
"button",
|
|
30938
31139
|
{
|
|
30939
31140
|
className: `
|
|
@@ -30955,26 +31156,26 @@ var StagesComponent = ({
|
|
|
30955
31156
|
var Stages_default = StagesComponent;
|
|
30956
31157
|
|
|
30957
31158
|
// src/components/Navigation/Spacer/Spacer.tsx
|
|
30958
|
-
import { jsx as
|
|
31159
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
30959
31160
|
var Spacer = ({ className, style }) => {
|
|
30960
|
-
return /* @__PURE__ */
|
|
31161
|
+
return /* @__PURE__ */ jsx61("div", { className: `${className}`, style });
|
|
30961
31162
|
};
|
|
30962
31163
|
var Spacer_default = Spacer;
|
|
30963
31164
|
|
|
30964
31165
|
// src/components/Navigation/Profile/Profile.tsx
|
|
30965
|
-
import { jsx as
|
|
31166
|
+
import { jsx as jsx62, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
30966
31167
|
|
|
30967
31168
|
// src/components/Navigation/Notification/Notification.tsx
|
|
30968
|
-
import { jsx as
|
|
31169
|
+
import { jsx as jsx63, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
30969
31170
|
|
|
30970
31171
|
// src/components/Navigation/Logo/Logo.tsx
|
|
30971
|
-
import { jsx as
|
|
31172
|
+
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
30972
31173
|
|
|
30973
31174
|
// src/components/ui/avatar.tsx
|
|
30974
31175
|
import * as React11 from "react";
|
|
30975
31176
|
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
30976
|
-
import { jsx as
|
|
30977
|
-
var Avatar = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
31177
|
+
import { jsx as jsx65 } from "react/jsx-runtime";
|
|
31178
|
+
var Avatar = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx65(
|
|
30978
31179
|
AvatarPrimitive.Root,
|
|
30979
31180
|
{
|
|
30980
31181
|
ref,
|
|
@@ -30986,7 +31187,7 @@ var Avatar = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
30986
31187
|
}
|
|
30987
31188
|
));
|
|
30988
31189
|
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
30989
|
-
var AvatarImage = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
31190
|
+
var AvatarImage = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx65(
|
|
30990
31191
|
AvatarPrimitive.Image,
|
|
30991
31192
|
{
|
|
30992
31193
|
ref,
|
|
@@ -30995,7 +31196,7 @@ var AvatarImage = React11.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
30995
31196
|
}
|
|
30996
31197
|
));
|
|
30997
31198
|
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
30998
|
-
var AvatarFallback = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
31199
|
+
var AvatarFallback = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx65(
|
|
30999
31200
|
AvatarPrimitive.Fallback,
|
|
31000
31201
|
{
|
|
31001
31202
|
ref,
|
|
@@ -31013,8 +31214,8 @@ import Link6 from "next/link";
|
|
|
31013
31214
|
import Image4 from "next/image";
|
|
31014
31215
|
import { useRouter as useRouter2 } from "next/navigation";
|
|
31015
31216
|
import { DropdownMenuSeparator } from "@radix-ui/react-dropdown-menu";
|
|
31016
|
-
import { useCallback as useCallback4, useMemo as
|
|
31017
|
-
import { Fragment as Fragment23, jsx as
|
|
31217
|
+
import { useCallback as useCallback4, useMemo as useMemo9, useState as useState11 } from "react";
|
|
31218
|
+
import { Fragment as Fragment23, jsx as jsx66, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
31018
31219
|
function Navbar({
|
|
31019
31220
|
style,
|
|
31020
31221
|
badgeType,
|
|
@@ -31052,29 +31253,29 @@ function Navbar({
|
|
|
31052
31253
|
router.push(pendingUrl);
|
|
31053
31254
|
}
|
|
31054
31255
|
};
|
|
31055
|
-
const formatedMenu =
|
|
31256
|
+
const formatedMenu = useMemo9(() => {
|
|
31056
31257
|
if (source === "state" && navList && navList.length) {
|
|
31057
31258
|
return navList.map((i) => ({ ...i, header: i.name || "Menu" }));
|
|
31058
31259
|
}
|
|
31059
31260
|
return list || [];
|
|
31060
31261
|
}, [source, navList]);
|
|
31061
|
-
return /* @__PURE__ */
|
|
31062
|
-
/* @__PURE__ */
|
|
31262
|
+
return /* @__PURE__ */ jsxs39(Fragment23, { children: [
|
|
31263
|
+
/* @__PURE__ */ jsx66(
|
|
31063
31264
|
"nav",
|
|
31064
31265
|
{
|
|
31065
31266
|
className: "w-full border-b border-b-white dark:border-b-gray-800 dark:bg-gray-800 bg-white shadow-sm",
|
|
31066
31267
|
style,
|
|
31067
|
-
children: /* @__PURE__ */
|
|
31068
|
-
/* @__PURE__ */
|
|
31268
|
+
children: /* @__PURE__ */ jsxs39("div", { className: "mx-auto flex max-w-[90%] items-center justify-between px-4 py-4", children: [
|
|
31269
|
+
/* @__PURE__ */ jsx66(
|
|
31069
31270
|
Link6,
|
|
31070
31271
|
{
|
|
31071
31272
|
href: "/",
|
|
31072
31273
|
onClick: (e) => handleBuilderExit(e, "/"),
|
|
31073
31274
|
className: "flex items-center space-x-2",
|
|
31074
|
-
children: imageUrl ? /* @__PURE__ */
|
|
31275
|
+
children: imageUrl ? /* @__PURE__ */ jsx66(Image4, { src: imageUrl, alt: altText, width: 200, height: 200 }) : /* @__PURE__ */ jsx66("span", { className: "font-semibold text-blue-700", children: "Logo" })
|
|
31075
31276
|
}
|
|
31076
31277
|
),
|
|
31077
|
-
!isMobileView && /* @__PURE__ */
|
|
31278
|
+
!isMobileView && /* @__PURE__ */ jsx66("div", { className: "flex items-center space-x-6 sm:hidden md:flex", children: formatedMenu.map((item) => /* @__PURE__ */ jsx66(
|
|
31078
31279
|
Link6,
|
|
31079
31280
|
{
|
|
31080
31281
|
href: item.url || "#",
|
|
@@ -31084,39 +31285,39 @@ function Navbar({
|
|
|
31084
31285
|
},
|
|
31085
31286
|
item.id
|
|
31086
31287
|
)) }),
|
|
31087
|
-
/* @__PURE__ */
|
|
31088
|
-
!isMobileView ? /* @__PURE__ */
|
|
31089
|
-
/* @__PURE__ */
|
|
31090
|
-
/* @__PURE__ */
|
|
31091
|
-
] }) }) : /* @__PURE__ */
|
|
31092
|
-
/* @__PURE__ */
|
|
31093
|
-
/* @__PURE__ */
|
|
31094
|
-
badgeType === "number" && !(hideBadgeWhenZero && badgeCount === 0) && Number(badgeCount) > 0 ? /* @__PURE__ */
|
|
31288
|
+
/* @__PURE__ */ jsxs39("div", { className: "flex items-center space-x-3", children: [
|
|
31289
|
+
!isMobileView ? /* @__PURE__ */ jsx66("div", { className: "flex-1 px-6", children: /* @__PURE__ */ jsxs39("div", { className: "relative w-full max-w-md border border-gray-300 rounded-md", children: [
|
|
31290
|
+
/* @__PURE__ */ jsx66(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 dark:text-white text-gray-400" }),
|
|
31291
|
+
/* @__PURE__ */ jsx66(Input, { placeholder: "Search", className: "pl-9 text-gray-400" })
|
|
31292
|
+
] }) }) : /* @__PURE__ */ jsx66(Button, { variant: "ghost", size: "icon", className: "border border-gray-400", children: /* @__PURE__ */ jsx66(Search, { className: "h-5 w-5 text-gray-400" }) }),
|
|
31293
|
+
/* @__PURE__ */ jsxs39("div", { className: "relative bg-[#E9E9E9] dark:bg-gray-700 rounded-md", children: [
|
|
31294
|
+
/* @__PURE__ */ jsx66(Button, { variant: "ghost", size: "icon", children: /* @__PURE__ */ jsx66(Bell, { className: "h-5 w-5 text-[#1C1B1F] dark:text-gray-400" }) }),
|
|
31295
|
+
badgeType === "number" && !(hideBadgeWhenZero && badgeCount === 0) && Number(badgeCount) > 0 ? /* @__PURE__ */ jsx66("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__ */ jsx66("span", { className: "absolute -top-1 -right-1 flex h-2 w-2 items-center justify-center rounded-full bg-red-500" })
|
|
31095
31296
|
] }),
|
|
31096
|
-
/* @__PURE__ */
|
|
31097
|
-
/* @__PURE__ */
|
|
31098
|
-
!isMobileView && showName && /* @__PURE__ */
|
|
31099
|
-
!isMobileView ? /* @__PURE__ */
|
|
31100
|
-
/* @__PURE__ */
|
|
31297
|
+
/* @__PURE__ */ jsxs39(DropdownMenu, { children: [
|
|
31298
|
+
/* @__PURE__ */ jsx66(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs39("div", { className: "flex items-center space-x-2", children: [
|
|
31299
|
+
!isMobileView && showName && /* @__PURE__ */ jsx66("h4", { className: "text-[#000000] dark:text-gray-300 text-[13px] font-[500] mb-0", children: userName }),
|
|
31300
|
+
!isMobileView ? /* @__PURE__ */ jsxs39(Fragment23, { children: [
|
|
31301
|
+
/* @__PURE__ */ jsx66(Avatar, { className: "cursor-pointer h-8 w-8 text-gray-900", children: profileType === "avatar" ? /* @__PURE__ */ jsx66(
|
|
31101
31302
|
AvatarImage,
|
|
31102
31303
|
{
|
|
31103
31304
|
src: "/images/appbuilder/toolset/profile.svg",
|
|
31104
31305
|
alt: "Profile"
|
|
31105
31306
|
}
|
|
31106
|
-
) : /* @__PURE__ */
|
|
31107
|
-
/* @__PURE__ */
|
|
31307
|
+
) : /* @__PURE__ */ jsx66("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) }) }),
|
|
31308
|
+
/* @__PURE__ */ jsx66(
|
|
31108
31309
|
Button,
|
|
31109
31310
|
{
|
|
31110
31311
|
variant: "ghost",
|
|
31111
31312
|
size: "icon",
|
|
31112
31313
|
className: "text-gray-900 md:hidden dark:invert",
|
|
31113
|
-
children: /* @__PURE__ */
|
|
31314
|
+
children: /* @__PURE__ */ jsx66(Menu, { className: "h-6 w-6" })
|
|
31114
31315
|
}
|
|
31115
31316
|
)
|
|
31116
|
-
] }) : /* @__PURE__ */
|
|
31317
|
+
] }) : /* @__PURE__ */ jsx66(Button, { variant: "ghost", size: "icon", className: "text-gray-900 dark:invert", children: /* @__PURE__ */ jsx66(Menu, { className: "h-6 w-6" }) })
|
|
31117
31318
|
] }) }),
|
|
31118
|
-
/* @__PURE__ */
|
|
31119
|
-
profileMenu && profileMenu.length > 0 && /* @__PURE__ */
|
|
31319
|
+
/* @__PURE__ */ jsxs39(DropdownMenuContent, { align: "end", className: "bg-white dark:bg-gray-800", children: [
|
|
31320
|
+
profileMenu && profileMenu.length > 0 && /* @__PURE__ */ jsx66(Fragment23, { children: profileMenu.map((item) => /* @__PURE__ */ jsx66(DropdownMenuItem, { className: "text-black dark:invert", children: /* @__PURE__ */ jsx66(
|
|
31120
31321
|
Link6,
|
|
31121
31322
|
{
|
|
31122
31323
|
href: item.url || "#",
|
|
@@ -31124,9 +31325,9 @@ function Navbar({
|
|
|
31124
31325
|
children: item.header
|
|
31125
31326
|
}
|
|
31126
31327
|
) }, item.id)) }),
|
|
31127
|
-
/* @__PURE__ */
|
|
31128
|
-
/* @__PURE__ */
|
|
31129
|
-
formatedMenu && formatedMenu.length > 0 && /* @__PURE__ */
|
|
31328
|
+
/* @__PURE__ */ jsxs39("div", { className: "md:hidden", children: [
|
|
31329
|
+
/* @__PURE__ */ jsx66(DropdownMenuSeparator, {}),
|
|
31330
|
+
formatedMenu && formatedMenu.length > 0 && /* @__PURE__ */ jsx66(Fragment23, { children: formatedMenu.map((item) => /* @__PURE__ */ jsx66(DropdownMenuItem, { className: "text-black dark:invert", children: /* @__PURE__ */ jsx66(
|
|
31130
31331
|
Link6,
|
|
31131
31332
|
{
|
|
31132
31333
|
href: item.url || "#",
|
|
@@ -31141,21 +31342,21 @@ function Navbar({
|
|
|
31141
31342
|
] })
|
|
31142
31343
|
}
|
|
31143
31344
|
),
|
|
31144
|
-
/* @__PURE__ */
|
|
31145
|
-
/* @__PURE__ */
|
|
31146
|
-
/* @__PURE__ */
|
|
31147
|
-
/* @__PURE__ */
|
|
31345
|
+
/* @__PURE__ */ jsx66(Dialog, { open: showExitDialog, onOpenChange: setShowExitDialog, children: /* @__PURE__ */ jsxs39(DialogContent, { className: "bg-[#fff]", children: [
|
|
31346
|
+
/* @__PURE__ */ jsxs39(DialogHeader, { children: [
|
|
31347
|
+
/* @__PURE__ */ jsx66(DialogTitle, { children: "Exit Builder?" }),
|
|
31348
|
+
/* @__PURE__ */ jsx66(DialogDescription, { children: "You are about to leave the builder. Any unsaved changes may be lost." })
|
|
31148
31349
|
] }),
|
|
31149
|
-
/* @__PURE__ */
|
|
31150
|
-
/* @__PURE__ */
|
|
31151
|
-
/* @__PURE__ */
|
|
31350
|
+
/* @__PURE__ */ jsxs39(DialogFooter, { children: [
|
|
31351
|
+
/* @__PURE__ */ jsx66(Button, { className: "cursor-pointer bg-[#12715b] text-[#fff]", variant: "outline", onClick: () => setShowExitDialog(false), children: "Cancel" }),
|
|
31352
|
+
/* @__PURE__ */ jsx66(Button, { className: "cursor-pointer border-[#12715b] border", onClick: confirmExit, children: "Yes, Exit" })
|
|
31152
31353
|
] })
|
|
31153
31354
|
] }) })
|
|
31154
31355
|
] });
|
|
31155
31356
|
}
|
|
31156
31357
|
|
|
31157
31358
|
// src/components/Chart/BarChart.tsx
|
|
31158
|
-
import React12, { useEffect as useEffect25, useMemo as
|
|
31359
|
+
import React12, { useEffect as useEffect25, useMemo as useMemo10, useState as useState12, useCallback as useCallback5 } from "react";
|
|
31159
31360
|
import axios2 from "axios";
|
|
31160
31361
|
import {
|
|
31161
31362
|
BarChart,
|
|
@@ -31169,7 +31370,7 @@ import {
|
|
|
31169
31370
|
ResponsiveContainer,
|
|
31170
31371
|
Legend
|
|
31171
31372
|
} from "recharts";
|
|
31172
|
-
import { jsx as
|
|
31373
|
+
import { jsx as jsx67, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
31173
31374
|
var getRandomColor = () => {
|
|
31174
31375
|
const palette = [
|
|
31175
31376
|
"#2563eb",
|
|
@@ -31247,7 +31448,8 @@ var ChartComponent = ({
|
|
|
31247
31448
|
page: page.toString(),
|
|
31248
31449
|
limit: limit.toString()
|
|
31249
31450
|
});
|
|
31250
|
-
const
|
|
31451
|
+
const axiosClient = props.axiosInstance ?? axios2;
|
|
31452
|
+
const res = await axiosClient.get(`${apiUrl}?${params.toString()}`, {
|
|
31251
31453
|
withCredentials: true
|
|
31252
31454
|
});
|
|
31253
31455
|
if (!cancelled) {
|
|
@@ -31282,7 +31484,7 @@ var ChartComponent = ({
|
|
|
31282
31484
|
if (rawMeta && (newPage < 1 || newPage > rawMeta.pages)) return;
|
|
31283
31485
|
setCurrentPage(newPage);
|
|
31284
31486
|
};
|
|
31285
|
-
const data =
|
|
31487
|
+
const data = useMemo10(() => {
|
|
31286
31488
|
if (!Array.isArray(effectiveData) || effectiveData.length === 0 || !dataKey || !dataLabel) {
|
|
31287
31489
|
return [];
|
|
31288
31490
|
}
|
|
@@ -31295,27 +31497,27 @@ var ChartComponent = ({
|
|
|
31295
31497
|
const chartType = props.chartType || "bar";
|
|
31296
31498
|
const legendsPosition = ["middle", "bottom"].includes(props.legendsPosition) ? props.legendsPosition : "top";
|
|
31297
31499
|
if (effectiveLoading || data.length === 0) {
|
|
31298
|
-
return /* @__PURE__ */
|
|
31500
|
+
return /* @__PURE__ */ jsxs40(
|
|
31299
31501
|
"div",
|
|
31300
31502
|
{
|
|
31301
31503
|
className: `relative flex flex-col w-full h-[300px] md:h-[400px] bg-gradient-to-br from-gray-50 to-gray-100 rounded-xl p-6 ${className}`,
|
|
31302
31504
|
style,
|
|
31303
31505
|
children: [
|
|
31304
|
-
/* @__PURE__ */
|
|
31305
|
-
/* @__PURE__ */
|
|
31306
|
-
/* @__PURE__ */
|
|
31506
|
+
/* @__PURE__ */ jsx67("div", { className: "mb-6 flex justify-center", children: /* @__PURE__ */ jsxs40("div", { className: "inline-flex items-center space-x-2 bg-white/90 px-6 py-2.5 rounded-xl backdrop-blur-sm border border-gray-200 shadow-lg", children: [
|
|
31507
|
+
/* @__PURE__ */ jsx67("div", { className: "w-5 h-5 border-2 border-gray-400 border-t-blue-500 rounded-full animate-spin" }),
|
|
31508
|
+
/* @__PURE__ */ jsx67("span", { className: "text-sm font-medium text-gray-700 bg-gradient-to-r from-gray-300 bg-clip-text animate-pulse", children: "Loading chart data..." })
|
|
31307
31509
|
] }) }),
|
|
31308
|
-
/* @__PURE__ */
|
|
31309
|
-
/* @__PURE__ */
|
|
31510
|
+
/* @__PURE__ */ jsx67("div", { className: "absolute inset-0 bg-gradient-to-r from-transparent via-white/60 to-transparent animate-shimmer rounded-xl" }),
|
|
31511
|
+
/* @__PURE__ */ jsx67("div", { className: "flex-1 relative w-full h-full min-h-[240px] md:min-h-[320px] bg-white/80 rounded-lg border border-gray-200/50 shadow-sm", children: /* @__PURE__ */ jsx67("div", { className: "absolute bottom-0 left-4 right-4 flex gap-2 h-[200px] md:h-[280px] justify-center items-end", children: [...Array(20)].map((_, idx) => {
|
|
31310
31512
|
const randomHeight = `${Math.floor(Math.random() * 76) + 20}%`;
|
|
31311
|
-
return /* @__PURE__ */
|
|
31513
|
+
return /* @__PURE__ */ jsxs40(
|
|
31312
31514
|
"div",
|
|
31313
31515
|
{
|
|
31314
31516
|
className: `relative w-10 md:w-12 flex-1 max-w-[48px] rounded-t-lg bg-gradient-to-t from-gray-100 via-gray-200 to-transparent shadow-lg border border-gray-200/50 animate-slide-up stagger-${idx} overflow-hidden`,
|
|
31315
31517
|
style: { height: randomHeight, animationDelay: `${idx * 0.08}s` },
|
|
31316
31518
|
children: [
|
|
31317
|
-
/* @__PURE__ */
|
|
31318
|
-
/* @__PURE__ */
|
|
31519
|
+
/* @__PURE__ */ jsx67("div", { className: "absolute inset-0 bg-gradient-to-r from-white/40 via-transparent to-white/40 animate-shimmer-bar" }),
|
|
31520
|
+
/* @__PURE__ */ jsx67("div", { className: "absolute bottom-1 left-1/2 w-4 h-1 rounded-full transform -translate-x-1/2 blur-sm" })
|
|
31319
31521
|
]
|
|
31320
31522
|
},
|
|
31321
31523
|
`bar-${idx}`
|
|
@@ -31325,9 +31527,9 @@ var ChartComponent = ({
|
|
|
31325
31527
|
}
|
|
31326
31528
|
);
|
|
31327
31529
|
}
|
|
31328
|
-
return /* @__PURE__ */
|
|
31329
|
-
isPaginationEnabled && rawMeta && /* @__PURE__ */
|
|
31330
|
-
/* @__PURE__ */
|
|
31530
|
+
return /* @__PURE__ */ jsxs40("div", { className: `${className} h-[450px]`, style, children: [
|
|
31531
|
+
isPaginationEnabled && rawMeta && /* @__PURE__ */ jsxs40("div", { className: "flex items-center justify-between mb-4 px-2", children: [
|
|
31532
|
+
/* @__PURE__ */ jsxs40("div", { className: "text-sm text-gray-600 hidden sm:block", children: [
|
|
31331
31533
|
"Page ",
|
|
31332
31534
|
rawMeta.page,
|
|
31333
31535
|
" of ",
|
|
@@ -31336,52 +31538,52 @@ var ChartComponent = ({
|
|
|
31336
31538
|
rawMeta.total.toLocaleString(),
|
|
31337
31539
|
" total records)"
|
|
31338
31540
|
] }),
|
|
31339
|
-
/* @__PURE__ */
|
|
31340
|
-
/* @__PURE__ */
|
|
31541
|
+
/* @__PURE__ */ jsxs40("div", { className: "flex items-center space-x-2 sm:hidden w-full justify-center", children: [
|
|
31542
|
+
/* @__PURE__ */ jsx67(
|
|
31341
31543
|
"button",
|
|
31342
31544
|
{
|
|
31343
31545
|
onClick: () => handlePageChange(currentPage - 1),
|
|
31344
31546
|
disabled: currentPage === 1 || localLoading,
|
|
31345
31547
|
className: "flex-1 px-3 py-2 text-xs font-medium rounded-lg border bg-white shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed transition-all duration-200 flex items-center justify-center space-x-1 min-w-0",
|
|
31346
|
-
children: /* @__PURE__ */
|
|
31548
|
+
children: /* @__PURE__ */ jsx67("span", { children: "\u2190 Prev" })
|
|
31347
31549
|
}
|
|
31348
31550
|
),
|
|
31349
|
-
/* @__PURE__ */
|
|
31350
|
-
/* @__PURE__ */
|
|
31551
|
+
/* @__PURE__ */ jsx67("span", { className: "px-2 py-2 text-xs font-semibold text-gray-700 min-w-[36px] text-center flex-shrink-0", children: currentPage }),
|
|
31552
|
+
/* @__PURE__ */ jsx67(
|
|
31351
31553
|
"button",
|
|
31352
31554
|
{
|
|
31353
31555
|
onClick: () => handlePageChange(currentPage + 1),
|
|
31354
31556
|
disabled: currentPage >= rawMeta.pages || localLoading,
|
|
31355
31557
|
className: "flex-1 px-3 py-2 text-xs font-medium rounded-lg border bg-white shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed transition-all duration-200 flex items-center justify-center space-x-1 min-w-0",
|
|
31356
|
-
children: /* @__PURE__ */
|
|
31558
|
+
children: /* @__PURE__ */ jsx67("span", { children: "Next \u2192" })
|
|
31357
31559
|
}
|
|
31358
31560
|
)
|
|
31359
31561
|
] }),
|
|
31360
|
-
/* @__PURE__ */
|
|
31361
|
-
/* @__PURE__ */
|
|
31562
|
+
/* @__PURE__ */ jsxs40("div", { className: "flex items-center space-x-2 hidden sm:flex", children: [
|
|
31563
|
+
/* @__PURE__ */ jsx67(
|
|
31362
31564
|
"button",
|
|
31363
31565
|
{
|
|
31364
31566
|
onClick: () => handlePageChange(currentPage - 1),
|
|
31365
31567
|
disabled: currentPage === 1 || localLoading,
|
|
31366
31568
|
className: "px-3 py-1.5 text-sm font-medium rounded-lg border bg-white shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed transition-all duration-200 flex items-center space-x-1",
|
|
31367
|
-
children: /* @__PURE__ */
|
|
31569
|
+
children: /* @__PURE__ */ jsx67("span", { children: "\u2190 Prev" })
|
|
31368
31570
|
}
|
|
31369
31571
|
),
|
|
31370
|
-
/* @__PURE__ */
|
|
31371
|
-
/* @__PURE__ */
|
|
31572
|
+
/* @__PURE__ */ jsx67("span", { className: "px-3 py-1 text-sm font-medium text-gray-700", children: currentPage }),
|
|
31573
|
+
/* @__PURE__ */ jsx67(
|
|
31372
31574
|
"button",
|
|
31373
31575
|
{
|
|
31374
31576
|
onClick: () => handlePageChange(currentPage + 1),
|
|
31375
31577
|
disabled: currentPage >= rawMeta.pages || localLoading,
|
|
31376
31578
|
className: "px-3 py-1.5 text-sm font-medium rounded-lg border bg-white shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed transition-all duration-200 flex items-center space-x-1",
|
|
31377
|
-
children: /* @__PURE__ */
|
|
31579
|
+
children: /* @__PURE__ */ jsx67("span", { children: "Next \u2192" })
|
|
31378
31580
|
}
|
|
31379
31581
|
)
|
|
31380
31582
|
] })
|
|
31381
31583
|
] }),
|
|
31382
|
-
/* @__PURE__ */
|
|
31383
|
-
/* @__PURE__ */
|
|
31384
|
-
/* @__PURE__ */
|
|
31584
|
+
/* @__PURE__ */ jsx67(ResponsiveContainer, { width: "100%", height: "100%", children: chartType === "bar" ? /* @__PURE__ */ jsxs40(BarChart, { data, children: [
|
|
31585
|
+
/* @__PURE__ */ jsx67(CartesianGrid, { strokeDasharray: "3 3" }),
|
|
31586
|
+
/* @__PURE__ */ jsx67(
|
|
31385
31587
|
XAxis,
|
|
31386
31588
|
{
|
|
31387
31589
|
dataKey: dataLabel,
|
|
@@ -31399,7 +31601,7 @@ var ChartComponent = ({
|
|
|
31399
31601
|
className: "hidden sm:block"
|
|
31400
31602
|
}
|
|
31401
31603
|
),
|
|
31402
|
-
/* @__PURE__ */
|
|
31604
|
+
/* @__PURE__ */ jsx67(
|
|
31403
31605
|
YAxis,
|
|
31404
31606
|
{
|
|
31405
31607
|
tickFormatter: (value) => `${(value / 1e3).toFixed(0)}k`,
|
|
@@ -31412,9 +31614,9 @@ var ChartComponent = ({
|
|
|
31412
31614
|
width: 60
|
|
31413
31615
|
}
|
|
31414
31616
|
),
|
|
31415
|
-
/* @__PURE__ */
|
|
31416
|
-
/* @__PURE__ */
|
|
31417
|
-
/* @__PURE__ */
|
|
31617
|
+
/* @__PURE__ */ jsx67(Tooltip, { formatter: (value) => [`${value}`, "Count"] }),
|
|
31618
|
+
/* @__PURE__ */ jsx67(Legend, { verticalAlign: legendsPosition, align: "center" }),
|
|
31619
|
+
/* @__PURE__ */ jsx67(
|
|
31418
31620
|
Bar,
|
|
31419
31621
|
{
|
|
31420
31622
|
dataKey,
|
|
@@ -31422,13 +31624,13 @@ var ChartComponent = ({
|
|
|
31422
31624
|
isAnimationActive: false
|
|
31423
31625
|
}
|
|
31424
31626
|
)
|
|
31425
|
-
] }) : /* @__PURE__ */
|
|
31426
|
-
/* @__PURE__ */
|
|
31427
|
-
/* @__PURE__ */
|
|
31428
|
-
/* @__PURE__ */
|
|
31627
|
+
] }) : /* @__PURE__ */ jsxs40(AreaChart, { data, children: [
|
|
31628
|
+
/* @__PURE__ */ jsx67("defs", { children: /* @__PURE__ */ jsxs40("linearGradient", { id: "colorCount", x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
31629
|
+
/* @__PURE__ */ jsx67("stop", { offset: "5%", stopColor: "#00695C", stopOpacity: 0.8 }),
|
|
31630
|
+
/* @__PURE__ */ jsx67("stop", { offset: "95%", stopColor: "#00695C", stopOpacity: 0 })
|
|
31429
31631
|
] }) }),
|
|
31430
|
-
/* @__PURE__ */
|
|
31431
|
-
/* @__PURE__ */
|
|
31632
|
+
/* @__PURE__ */ jsx67(CartesianGrid, { strokeDasharray: "3 3" }),
|
|
31633
|
+
/* @__PURE__ */ jsx67(
|
|
31432
31634
|
XAxis,
|
|
31433
31635
|
{
|
|
31434
31636
|
dataKey: dataLabel,
|
|
@@ -31442,7 +31644,7 @@ var ChartComponent = ({
|
|
|
31442
31644
|
}
|
|
31443
31645
|
}
|
|
31444
31646
|
),
|
|
31445
|
-
/* @__PURE__ */
|
|
31647
|
+
/* @__PURE__ */ jsx67(
|
|
31446
31648
|
YAxis,
|
|
31447
31649
|
{
|
|
31448
31650
|
tickFormatter: (value) => `${(value / 1e3).toFixed(0)}k`,
|
|
@@ -31455,8 +31657,8 @@ var ChartComponent = ({
|
|
|
31455
31657
|
width: 60
|
|
31456
31658
|
}
|
|
31457
31659
|
),
|
|
31458
|
-
/* @__PURE__ */
|
|
31459
|
-
/* @__PURE__ */
|
|
31660
|
+
/* @__PURE__ */ jsx67(Tooltip, { formatter: (value) => `${value}k` }),
|
|
31661
|
+
/* @__PURE__ */ jsx67(
|
|
31460
31662
|
Area,
|
|
31461
31663
|
{
|
|
31462
31664
|
type: "monotone",
|
|
@@ -31473,7 +31675,7 @@ var ChartComponent = ({
|
|
|
31473
31675
|
var BarChart_default = React12.memo(ChartComponent);
|
|
31474
31676
|
|
|
31475
31677
|
// src/components/Chart/PieChart.tsx
|
|
31476
|
-
import React13, { useEffect as useEffect26, useMemo as
|
|
31678
|
+
import React13, { useEffect as useEffect26, useMemo as useMemo11, useState as useState13 } from "react";
|
|
31477
31679
|
import axios3 from "axios";
|
|
31478
31680
|
import {
|
|
31479
31681
|
PieChart,
|
|
@@ -31482,7 +31684,7 @@ import {
|
|
|
31482
31684
|
ResponsiveContainer as ResponsiveContainer2,
|
|
31483
31685
|
Tooltip as Tooltip2
|
|
31484
31686
|
} from "recharts";
|
|
31485
|
-
import { jsx as
|
|
31687
|
+
import { jsx as jsx68, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
31486
31688
|
var getRandomColor2 = () => {
|
|
31487
31689
|
const palette = [
|
|
31488
31690
|
"#2563eb",
|
|
@@ -31569,7 +31771,8 @@ var DonutChart = ({
|
|
|
31569
31771
|
const fetchData = async () => {
|
|
31570
31772
|
try {
|
|
31571
31773
|
setLocalLoading(true);
|
|
31572
|
-
const
|
|
31774
|
+
const axiosClient = props.axiosInstance ?? axios3;
|
|
31775
|
+
const res = await axiosClient.get(apiUrl, {
|
|
31573
31776
|
withCredentials: true
|
|
31574
31777
|
});
|
|
31575
31778
|
if (!cancelled) {
|
|
@@ -31598,7 +31801,7 @@ var DonutChart = ({
|
|
|
31598
31801
|
cancelled = true;
|
|
31599
31802
|
};
|
|
31600
31803
|
}, [apiUrl]);
|
|
31601
|
-
const data =
|
|
31804
|
+
const data = useMemo11(() => {
|
|
31602
31805
|
if (!Array.isArray(effectiveData) || effectiveData.length === 0) return [];
|
|
31603
31806
|
return effectiveData.map((item) => ({
|
|
31604
31807
|
...item,
|
|
@@ -31607,11 +31810,11 @@ var DonutChart = ({
|
|
|
31607
31810
|
[dataLabel]: item[dataLabel] ?? "Unknown"
|
|
31608
31811
|
}));
|
|
31609
31812
|
}, [effectiveData, dataKey, dataLabel]);
|
|
31610
|
-
const total =
|
|
31813
|
+
const total = useMemo11(
|
|
31611
31814
|
() => data.reduce((sum, d) => sum + (d[dataKey] ?? 0), 0),
|
|
31612
31815
|
[data, dataKey]
|
|
31613
31816
|
);
|
|
31614
|
-
const formattedTotal =
|
|
31817
|
+
const formattedTotal = useMemo11(() => {
|
|
31615
31818
|
if (total >= 1e6) {
|
|
31616
31819
|
return `${(total / 1e6).toFixed(1)}M`;
|
|
31617
31820
|
}
|
|
@@ -31620,7 +31823,7 @@ var DonutChart = ({
|
|
|
31620
31823
|
}
|
|
31621
31824
|
return total.toString();
|
|
31622
31825
|
}, [total]);
|
|
31623
|
-
const chartData =
|
|
31826
|
+
const chartData = useMemo11(() => {
|
|
31624
31827
|
if (total === 0) return data;
|
|
31625
31828
|
const sortedData = [...data].sort((a, b) => (b[dataKey] ?? 0) - (a[dataKey] ?? 0));
|
|
31626
31829
|
const minAngle = 360 / Math.max(12, sortedData.length);
|
|
@@ -31648,34 +31851,34 @@ var DonutChart = ({
|
|
|
31648
31851
|
const timeout = setTimeout(() => setMounted(true), 100);
|
|
31649
31852
|
return () => clearTimeout(timeout);
|
|
31650
31853
|
}, []);
|
|
31651
|
-
const renderLegends =
|
|
31854
|
+
const renderLegends = useMemo11(() => {
|
|
31652
31855
|
if (!showLegends) return null;
|
|
31653
|
-
return /* @__PURE__ */
|
|
31856
|
+
return /* @__PURE__ */ jsx68("div", { className: "flex flex-wrap justify-center gap-2 mt-4 w-full max-w-4xl", children: chartData.map((d, index) => {
|
|
31654
31857
|
const actualValue = data.find(
|
|
31655
31858
|
(item) => item[dataLabel] === d[dataLabel]
|
|
31656
31859
|
)?.[dataKey] ?? d[dataKey];
|
|
31657
31860
|
const displayValue = actualValue >= 1e3 ? `${(actualValue / 1e3).toFixed(0)}k` : actualValue.toLocaleString();
|
|
31658
|
-
return /* @__PURE__ */
|
|
31861
|
+
return /* @__PURE__ */ jsxs41(
|
|
31659
31862
|
"div",
|
|
31660
31863
|
{
|
|
31661
31864
|
className: "flex items-center space-x-2 rounded-lg border border-gray-200/50 px-3 py-1.5 w-[48%] sm:w-[32%] md:w-auto bg-white/80 backdrop-blur-sm shadow-sm hover:shadow-md transition-all",
|
|
31662
31865
|
children: [
|
|
31663
|
-
/* @__PURE__ */
|
|
31866
|
+
/* @__PURE__ */ jsx68(
|
|
31664
31867
|
"span",
|
|
31665
31868
|
{
|
|
31666
31869
|
className: "inline-block w-[12px] h-[12px] rounded-full shrink-0 border-2 border-white/50",
|
|
31667
31870
|
style: { backgroundColor: d.color }
|
|
31668
31871
|
}
|
|
31669
31872
|
),
|
|
31670
|
-
/* @__PURE__ */
|
|
31671
|
-
/* @__PURE__ */
|
|
31672
|
-
/* @__PURE__ */
|
|
31673
|
-
/* @__PURE__ */
|
|
31674
|
-
/* @__PURE__ */
|
|
31873
|
+
/* @__PURE__ */ jsxs41("div", { className: "min-w-0 flex-1", children: [
|
|
31874
|
+
/* @__PURE__ */ jsx68("span", { className: "text-gray-900 text-[11px] md:text-[13px] font-semibold block truncate leading-tight", children: d[dataLabel] }),
|
|
31875
|
+
/* @__PURE__ */ jsxs41("div", { className: "flex items-center gap-1 text-xs text-gray-600 font-medium", children: [
|
|
31876
|
+
/* @__PURE__ */ jsx68("span", { children: displayValue }),
|
|
31877
|
+
/* @__PURE__ */ jsxs41("span", { children: [
|
|
31675
31878
|
(actualValue / total * 100).toFixed(1),
|
|
31676
31879
|
"%"
|
|
31677
31880
|
] }),
|
|
31678
|
-
d.isBoosted && /* @__PURE__ */
|
|
31881
|
+
d.isBoosted && /* @__PURE__ */ jsx68("span", { className: "text-[9px] px-1 py-0.5 bg-blue-100 text-blue-700 rounded-full", children: "min" })
|
|
31679
31882
|
] })
|
|
31680
31883
|
] })
|
|
31681
31884
|
]
|
|
@@ -31686,26 +31889,26 @@ var DonutChart = ({
|
|
|
31686
31889
|
}, [chartData, data, dataLabel, dataKey, total, showLegends]);
|
|
31687
31890
|
if (!mounted) return null;
|
|
31688
31891
|
if (effectiveLoading || data.length === 0) {
|
|
31689
|
-
return /* @__PURE__ */
|
|
31892
|
+
return /* @__PURE__ */ jsxs41(
|
|
31690
31893
|
"div",
|
|
31691
31894
|
{
|
|
31692
31895
|
className: `relative flex flex-col items-center w-full h-[300px] md:h-[400px] bg-gradient-to-br from-gray-50 to-gray-100 rounded-xl p-6 ${className}`,
|
|
31693
31896
|
style,
|
|
31694
31897
|
children: [
|
|
31695
|
-
/* @__PURE__ */
|
|
31696
|
-
/* @__PURE__ */
|
|
31697
|
-
/* @__PURE__ */
|
|
31698
|
-
/* @__PURE__ */
|
|
31898
|
+
/* @__PURE__ */ jsx68("div", { className: "absolute inset-0 bg-gradient-to-r from-transparent via-white/60 to-transparent animate-shimmer rounded-xl" }),
|
|
31899
|
+
/* @__PURE__ */ jsx68("div", { className: "mt-6 text-center", children: /* @__PURE__ */ jsxs41("div", { className: "inline-flex items-center space-x-2 bg-white/80 px-6 py-2 rounded-full backdrop-blur-sm border border-gray-200 shadow-lg", children: [
|
|
31900
|
+
/* @__PURE__ */ jsx68("div", { className: "w-5 h-5 border-2 border-gray-300 border-t-blue-400 rounded-full animate-spin" }),
|
|
31901
|
+
/* @__PURE__ */ jsx68("span", { className: "text-sm font-medium text-gray-600 bg-gradient-to-r from-gray-300 bg-clip-text animate-pulse", children: "Loading chart data..." })
|
|
31699
31902
|
] }) }),
|
|
31700
|
-
/* @__PURE__ */
|
|
31903
|
+
/* @__PURE__ */ jsx68("div", { className: "flex flex-wrap justify-center gap-3 mt-8 w-full max-w-4xl", children: [...Array(18)].map((_, idx) => /* @__PURE__ */ jsxs41(
|
|
31701
31904
|
"div",
|
|
31702
31905
|
{
|
|
31703
31906
|
className: `h-10 w-[48%] sm:w-[32%] md:w-32 rounded-xl bg-gradient-to-r from-gray-200 via-gray-300/50 to-gray-200 p-3 flex items-center space-x-3 animate-slide-up stagger-${idx} shadow-sm border border-gray-200/50`,
|
|
31704
31907
|
children: [
|
|
31705
|
-
/* @__PURE__ */
|
|
31706
|
-
/* @__PURE__ */
|
|
31707
|
-
/* @__PURE__ */
|
|
31708
|
-
/* @__PURE__ */
|
|
31908
|
+
/* @__PURE__ */ jsx68("div", { className: "w-4 h-4 rounded-full bg-gradient-to-r from-blue-300 to-purple-300 animate-pulse" }),
|
|
31909
|
+
/* @__PURE__ */ jsxs41("div", { className: "flex-1 space-y-1", children: [
|
|
31910
|
+
/* @__PURE__ */ jsx68("div", { className: "h-3 w-20 bg-gray-300 rounded animate-pulse" }),
|
|
31911
|
+
/* @__PURE__ */ jsx68("div", { className: "h-2.5 w-16 bg-gray-200/60 rounded animate-pulse-delayed" })
|
|
31709
31912
|
] })
|
|
31710
31913
|
]
|
|
31711
31914
|
},
|
|
@@ -31718,10 +31921,10 @@ var DonutChart = ({
|
|
|
31718
31921
|
const { inner, outer } = getDynamicRadius();
|
|
31719
31922
|
const innerRadius = inner;
|
|
31720
31923
|
const outerRadius = outer;
|
|
31721
|
-
return /* @__PURE__ */
|
|
31722
|
-
/* @__PURE__ */
|
|
31723
|
-
/* @__PURE__ */
|
|
31724
|
-
/* @__PURE__ */
|
|
31924
|
+
return /* @__PURE__ */ jsxs41("div", { className: `relative flex flex-col items-center ${className}`, style, children: [
|
|
31925
|
+
/* @__PURE__ */ jsxs41("div", { className: "relative w-full md:w-[75%] h-[280px] md:h-[380px] flex items-center justify-center mb-2", children: [
|
|
31926
|
+
/* @__PURE__ */ jsx68(ResponsiveContainer2, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs41(PieChart, { children: [
|
|
31927
|
+
/* @__PURE__ */ jsx68(
|
|
31725
31928
|
Pie,
|
|
31726
31929
|
{
|
|
31727
31930
|
data: chartData,
|
|
@@ -31734,7 +31937,7 @@ var DonutChart = ({
|
|
|
31734
31937
|
isAnimationActive: true,
|
|
31735
31938
|
animationDuration: 800,
|
|
31736
31939
|
minAngle: 3,
|
|
31737
|
-
children: chartData.map((entry, index) => /* @__PURE__ */
|
|
31940
|
+
children: chartData.map((entry, index) => /* @__PURE__ */ jsx68(
|
|
31738
31941
|
Cell,
|
|
31739
31942
|
{
|
|
31740
31943
|
fill: entry.color,
|
|
@@ -31745,7 +31948,7 @@ var DonutChart = ({
|
|
|
31745
31948
|
))
|
|
31746
31949
|
}
|
|
31747
31950
|
),
|
|
31748
|
-
/* @__PURE__ */
|
|
31951
|
+
/* @__PURE__ */ jsx68(
|
|
31749
31952
|
Tooltip2,
|
|
31750
31953
|
{
|
|
31751
31954
|
formatter: (value, name, payload) => {
|
|
@@ -31768,9 +31971,9 @@ var DonutChart = ({
|
|
|
31768
31971
|
}
|
|
31769
31972
|
)
|
|
31770
31973
|
] }) }),
|
|
31771
|
-
total > 0 && /* @__PURE__ */
|
|
31974
|
+
total > 0 && /* @__PURE__ */ jsx68("div", { className: `absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 text-center pointer-events-none ${forceMobile ? "text-xl px-2" : "text-3xl px-4"} font-bold bg-white/90 backdrop-blur-sm rounded-full py-1 shadow-lg`, children: /* @__PURE__ */ jsxs41("div", { className: "text-[#1f2937] leading-tight", children: [
|
|
31772
31975
|
formattedTotal,
|
|
31773
|
-
/* @__PURE__ */
|
|
31976
|
+
/* @__PURE__ */ jsx68("span", { className: "text-sm md:text-base font-normal text-gray-600 block md:inline-block md:ml-1", children: "total" })
|
|
31774
31977
|
] }) })
|
|
31775
31978
|
] }),
|
|
31776
31979
|
renderLegends
|
|
@@ -31779,10 +31982,10 @@ var DonutChart = ({
|
|
|
31779
31982
|
var PieChart_default = React13.memo(DonutChart);
|
|
31780
31983
|
|
|
31781
31984
|
// src/components/Blocks/EmailComposer.tsx
|
|
31782
|
-
import { jsx as
|
|
31985
|
+
import { jsx as jsx69, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
31783
31986
|
function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc, setShowBcc, cc, setCc, bcc, setBcc, subject, setSubject, body, setBody }) {
|
|
31784
|
-
return /* @__PURE__ */
|
|
31785
|
-
/* @__PURE__ */
|
|
31987
|
+
return /* @__PURE__ */ jsx69("div", { className, style, children: /* @__PURE__ */ jsxs42("div", { className: "border rounded-md shadow bg-[#fff] p-4 mx-auto z-[50] relative", children: [
|
|
31988
|
+
/* @__PURE__ */ jsx69("div", { className: "mb-3", children: /* @__PURE__ */ jsx69(
|
|
31786
31989
|
"input",
|
|
31787
31990
|
{
|
|
31788
31991
|
type: "email",
|
|
@@ -31791,8 +31994,8 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
31791
31994
|
required: true
|
|
31792
31995
|
}
|
|
31793
31996
|
) }),
|
|
31794
|
-
/* @__PURE__ */
|
|
31795
|
-
/* @__PURE__ */
|
|
31997
|
+
/* @__PURE__ */ jsx69("div", { className: "mb-3", children: /* @__PURE__ */ jsxs42("div", { className: "flex items-center gap-2", children: [
|
|
31998
|
+
/* @__PURE__ */ jsx69(
|
|
31796
31999
|
"input",
|
|
31797
32000
|
{
|
|
31798
32001
|
type: "email",
|
|
@@ -31803,7 +32006,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
31803
32006
|
required: true
|
|
31804
32007
|
}
|
|
31805
32008
|
),
|
|
31806
|
-
!showCc && /* @__PURE__ */
|
|
32009
|
+
!showCc && /* @__PURE__ */ jsx69(
|
|
31807
32010
|
"button",
|
|
31808
32011
|
{
|
|
31809
32012
|
onClick: () => setShowCc?.(true),
|
|
@@ -31811,7 +32014,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
31811
32014
|
children: "Cc"
|
|
31812
32015
|
}
|
|
31813
32016
|
),
|
|
31814
|
-
!showBcc && /* @__PURE__ */
|
|
32017
|
+
!showBcc && /* @__PURE__ */ jsx69(
|
|
31815
32018
|
"button",
|
|
31816
32019
|
{
|
|
31817
32020
|
onClick: () => setShowBcc?.(true),
|
|
@@ -31820,7 +32023,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
31820
32023
|
}
|
|
31821
32024
|
)
|
|
31822
32025
|
] }) }),
|
|
31823
|
-
showCc && /* @__PURE__ */
|
|
32026
|
+
showCc && /* @__PURE__ */ jsx69("div", { className: "mb-3", children: /* @__PURE__ */ jsx69(
|
|
31824
32027
|
"input",
|
|
31825
32028
|
{
|
|
31826
32029
|
type: "text",
|
|
@@ -31830,7 +32033,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
31830
32033
|
className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
|
|
31831
32034
|
}
|
|
31832
32035
|
) }),
|
|
31833
|
-
showBcc && /* @__PURE__ */
|
|
32036
|
+
showBcc && /* @__PURE__ */ jsx69("div", { className: "mb-3", children: /* @__PURE__ */ jsx69(
|
|
31834
32037
|
"input",
|
|
31835
32038
|
{
|
|
31836
32039
|
type: "text",
|
|
@@ -31840,7 +32043,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
31840
32043
|
className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
|
|
31841
32044
|
}
|
|
31842
32045
|
) }),
|
|
31843
|
-
/* @__PURE__ */
|
|
32046
|
+
/* @__PURE__ */ jsx69("div", { className: "mb-3", children: /* @__PURE__ */ jsx69(
|
|
31844
32047
|
"input",
|
|
31845
32048
|
{
|
|
31846
32049
|
type: "text",
|
|
@@ -31850,11 +32053,11 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
31850
32053
|
className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
|
|
31851
32054
|
}
|
|
31852
32055
|
) }),
|
|
31853
|
-
/* @__PURE__ */
|
|
31854
|
-
/* @__PURE__ */
|
|
31855
|
-
/* @__PURE__ */
|
|
31856
|
-
/* @__PURE__ */
|
|
31857
|
-
/* @__PURE__ */
|
|
32056
|
+
/* @__PURE__ */ jsx69("div", { className: "mb-4", children: /* @__PURE__ */ jsx69(MyEditor, { value: body, onChange: setBody }) }),
|
|
32057
|
+
/* @__PURE__ */ jsxs42("div", { className: "flex justify-end gap-2", children: [
|
|
32058
|
+
/* @__PURE__ */ jsx69("button", { className: "px-4 py-2 rounded-md text-gray-600 hover:bg-gray-100", children: "Discard" }),
|
|
32059
|
+
/* @__PURE__ */ jsx69("button", { className: "px-4 py-2 rounded-md border text-[#12715B] border-[#12715B]", children: "Reset" }),
|
|
32060
|
+
/* @__PURE__ */ jsx69("button", { className: "px-4 py-2 rounded-md bg-[#12715B] text-white", children: "Send" })
|
|
31858
32061
|
] })
|
|
31859
32062
|
] }) });
|
|
31860
32063
|
}
|
|
@@ -31862,10 +32065,10 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
31862
32065
|
// src/components/ui/sonner.tsx
|
|
31863
32066
|
import { useTheme } from "next-themes";
|
|
31864
32067
|
import { Toaster as Sonner } from "sonner";
|
|
31865
|
-
import { jsx as
|
|
32068
|
+
import { jsx as jsx70 } from "react/jsx-runtime";
|
|
31866
32069
|
var Toaster = ({ ...props }) => {
|
|
31867
32070
|
const { theme = "system" } = useTheme();
|
|
31868
|
-
return /* @__PURE__ */
|
|
32071
|
+
return /* @__PURE__ */ jsx70(
|
|
31869
32072
|
Sonner,
|
|
31870
32073
|
{
|
|
31871
32074
|
theme,
|
|
@@ -31896,6 +32099,7 @@ export {
|
|
|
31896
32099
|
FileInput_default as FileInput,
|
|
31897
32100
|
Flex_default as FlexLayout,
|
|
31898
32101
|
Grid_default as GridLayout,
|
|
32102
|
+
HistoryTimeline_default as HistoryTimeline,
|
|
31899
32103
|
Icon_default as Icon,
|
|
31900
32104
|
Image_default as Image,
|
|
31901
32105
|
Modal,
|