@algorithm-shift/design-system 1.2.995 → 1.2.997
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.css +56 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +248 -143
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +257 -152
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -7
package/dist/index.js
CHANGED
|
@@ -3331,8 +3331,12 @@ function LazyMultiSelectDropdown({
|
|
|
3331
3331
|
}
|
|
3332
3332
|
};
|
|
3333
3333
|
const selectedOptions = (0, import_react29.useMemo)(() => {
|
|
3334
|
-
return
|
|
3335
|
-
|
|
3334
|
+
return normalizedValue.map((id2) => {
|
|
3335
|
+
const fromLazy = lazyOptions.find((opt) => opt.value === id2);
|
|
3336
|
+
if (fromLazy) return fromLazy;
|
|
3337
|
+
return { value: id2, label: id2 };
|
|
3338
|
+
});
|
|
3339
|
+
}, [normalizedValue, lazyOptions]);
|
|
3336
3340
|
(0, import_react29.useEffect)(() => {
|
|
3337
3341
|
const handleClick = (e) => {
|
|
3338
3342
|
if (dropdownRef.current && !dropdownRef.current.contains(e.target)) {
|
|
@@ -3372,8 +3376,12 @@ function LazyMultiSelectDropdown({
|
|
|
3372
3376
|
onChange?.(convertOutput(updated), id);
|
|
3373
3377
|
};
|
|
3374
3378
|
const handleFocus = () => {
|
|
3375
|
-
if (!disabled)
|
|
3376
|
-
|
|
3379
|
+
if (!disabled) {
|
|
3380
|
+
setIsOpen(true);
|
|
3381
|
+
if (lazyOptions.length === 0) {
|
|
3382
|
+
loadPage(1, "");
|
|
3383
|
+
}
|
|
3384
|
+
}
|
|
3377
3385
|
};
|
|
3378
3386
|
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { ref: dropdownRef, className: "relative w-full", children: [
|
|
3379
3387
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
@@ -4010,9 +4018,9 @@ function DataTable({
|
|
|
4010
4018
|
setLocalPageSize(newSize);
|
|
4011
4019
|
};
|
|
4012
4020
|
const pageSizeOptions = React10.useMemo(() => {
|
|
4013
|
-
const options = [10, 20, 50, 100].filter((size) => size < totalRecords);
|
|
4021
|
+
const options = [5, 10, 20, 50, 100].filter((size) => size < totalRecords);
|
|
4014
4022
|
if (options.length === 0) {
|
|
4015
|
-
options.push(
|
|
4023
|
+
options.push(5);
|
|
4016
4024
|
}
|
|
4017
4025
|
return options;
|
|
4018
4026
|
}, [totalRecords]);
|
|
@@ -5166,7 +5174,59 @@ var Tabs_default = Tabs;
|
|
|
5166
5174
|
|
|
5167
5175
|
// src/components/Navigation/Stages/Stages.tsx
|
|
5168
5176
|
var import_react33 = __toESM(require("react"));
|
|
5177
|
+
|
|
5178
|
+
// src/components/ui/tooltip.tsx
|
|
5179
|
+
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));
|
|
5169
5180
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
5181
|
+
function TooltipProvider({
|
|
5182
|
+
delayDuration = 0,
|
|
5183
|
+
...props
|
|
5184
|
+
}) {
|
|
5185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5186
|
+
TooltipPrimitive.Provider,
|
|
5187
|
+
{
|
|
5188
|
+
"data-slot": "tooltip-provider",
|
|
5189
|
+
delayDuration,
|
|
5190
|
+
...props
|
|
5191
|
+
}
|
|
5192
|
+
);
|
|
5193
|
+
}
|
|
5194
|
+
function Tooltip({
|
|
5195
|
+
...props
|
|
5196
|
+
}) {
|
|
5197
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props }) });
|
|
5198
|
+
}
|
|
5199
|
+
function TooltipTrigger({
|
|
5200
|
+
...props
|
|
5201
|
+
}) {
|
|
5202
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
|
|
5203
|
+
}
|
|
5204
|
+
function TooltipContent({
|
|
5205
|
+
className,
|
|
5206
|
+
sideOffset = 0,
|
|
5207
|
+
children,
|
|
5208
|
+
...props
|
|
5209
|
+
}) {
|
|
5210
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TooltipPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
5211
|
+
TooltipPrimitive.Content,
|
|
5212
|
+
{
|
|
5213
|
+
"data-slot": "tooltip-content",
|
|
5214
|
+
sideOffset,
|
|
5215
|
+
className: cn(
|
|
5216
|
+
"bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",
|
|
5217
|
+
className
|
|
5218
|
+
),
|
|
5219
|
+
...props,
|
|
5220
|
+
children: [
|
|
5221
|
+
children,
|
|
5222
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TooltipPrimitive.Arrow, { className: "bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })
|
|
5223
|
+
]
|
|
5224
|
+
}
|
|
5225
|
+
) });
|
|
5226
|
+
}
|
|
5227
|
+
|
|
5228
|
+
// src/components/Navigation/Stages/Stages.tsx
|
|
5229
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
5170
5230
|
var StagesComponent = ({
|
|
5171
5231
|
stages,
|
|
5172
5232
|
isShowBtn,
|
|
@@ -5184,6 +5244,8 @@ var StagesComponent = ({
|
|
|
5184
5244
|
}) => {
|
|
5185
5245
|
const [activeStage, setActiveStage] = (0, import_react33.useState)("");
|
|
5186
5246
|
const [isCompleted, setIsCompleted] = (0, import_react33.useState)(false);
|
|
5247
|
+
const [activeChildStage, setActiveChildStage] = (0, import_react33.useState)(null);
|
|
5248
|
+
const [activeRootStage, setActiveRootStage] = (0, import_react33.useState)(null);
|
|
5187
5249
|
(0, import_react33.useEffect)(() => {
|
|
5188
5250
|
if (currentStage) {
|
|
5189
5251
|
setActiveStage(currentStage);
|
|
@@ -5194,6 +5256,9 @@ var StagesComponent = ({
|
|
|
5194
5256
|
const updateStage = (stageKey) => {
|
|
5195
5257
|
setActiveStage(stageKey);
|
|
5196
5258
|
onStageChange?.(stageKey);
|
|
5259
|
+
const { activeRoot, activeChild } = findStageContext(stages, stageKey);
|
|
5260
|
+
setActiveRootStage(activeRoot);
|
|
5261
|
+
setActiveChildStage(activeChild);
|
|
5197
5262
|
};
|
|
5198
5263
|
const nextStage = () => {
|
|
5199
5264
|
if (!stages || stages.length === 0) return;
|
|
@@ -5219,9 +5284,41 @@ var StagesComponent = ({
|
|
|
5219
5284
|
onStageChange?.(stageKey);
|
|
5220
5285
|
}
|
|
5221
5286
|
};
|
|
5222
|
-
const
|
|
5287
|
+
const findStageContext = (nodes, curr, root = null) => {
|
|
5288
|
+
if (!nodes || nodes.length === 0) {
|
|
5289
|
+
return { activeRoot: null, activeChild: null };
|
|
5290
|
+
}
|
|
5291
|
+
if (!Array.isArray(nodes)) {
|
|
5292
|
+
return { activeRoot: null, activeChild: null };
|
|
5293
|
+
}
|
|
5294
|
+
for (const node of nodes) {
|
|
5295
|
+
const currentRoot = root ?? node;
|
|
5296
|
+
if (node?.[dataKey] === curr) {
|
|
5297
|
+
return {
|
|
5298
|
+
activeRoot: root ?? node,
|
|
5299
|
+
activeChild: node
|
|
5300
|
+
};
|
|
5301
|
+
}
|
|
5302
|
+
const result = findStageContext(node?.children, curr, currentRoot);
|
|
5303
|
+
if (result.activeChild) {
|
|
5304
|
+
return result;
|
|
5305
|
+
}
|
|
5306
|
+
}
|
|
5307
|
+
return { activeRoot: null, activeChild: null };
|
|
5308
|
+
};
|
|
5309
|
+
(0, import_react33.useEffect)(() => {
|
|
5310
|
+
if (!currentStage || !Array.isArray(stages)) {
|
|
5311
|
+
setActiveRootStage(null);
|
|
5312
|
+
setActiveChildStage(null);
|
|
5313
|
+
return;
|
|
5314
|
+
}
|
|
5315
|
+
const { activeRoot, activeChild } = findStageContext(stages, currentStage);
|
|
5316
|
+
setActiveRootStage(activeRoot);
|
|
5317
|
+
setActiveChildStage(activeChild);
|
|
5318
|
+
}, [currentStage, stages]);
|
|
5319
|
+
const isAllStagesCompleted = isCompleted || activeRootStage?.[dataKey] === lastStage;
|
|
5223
5320
|
const disabled = isAllStagesCompleted || loading || saving;
|
|
5224
|
-
return /* @__PURE__ */ (0,
|
|
5321
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className, style, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
5225
5322
|
"div",
|
|
5226
5323
|
{
|
|
5227
5324
|
className: `
|
|
@@ -5231,8 +5328,8 @@ var StagesComponent = ({
|
|
|
5231
5328
|
${isMobile ? "p-3 sm:p-4" : "p-2"}
|
|
5232
5329
|
`,
|
|
5233
5330
|
children: [
|
|
5234
|
-
/* @__PURE__ */ (0,
|
|
5235
|
-
/* @__PURE__ */ (0,
|
|
5331
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "flex items-center flex-shrink-0 order-1 lg:order-1", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("button", { className: "p-2 hover:bg-gray-100 rounded flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("svg", { className: "w-4 h-4 text-gray-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) }) }),
|
|
5332
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5236
5333
|
"div",
|
|
5237
5334
|
{
|
|
5238
5335
|
className: `
|
|
@@ -5240,7 +5337,7 @@ var StagesComponent = ({
|
|
|
5240
5337
|
flex-wrap gap-2 sm:gap-2 lg:gap-3 w-full lg:w-auto
|
|
5241
5338
|
${isMobile ? "order-2 mt-2 lg:mt-0" : "order-2"}
|
|
5242
5339
|
`,
|
|
5243
|
-
children: loading ? Array(6).fill(null).map((_, index) => /* @__PURE__ */ (0,
|
|
5340
|
+
children: loading ? Array(6).fill(null).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5244
5341
|
"button",
|
|
5245
5342
|
{
|
|
5246
5343
|
className: `
|
|
@@ -5254,41 +5351,49 @@ var StagesComponent = ({
|
|
|
5254
5351
|
disabled: true
|
|
5255
5352
|
},
|
|
5256
5353
|
index
|
|
5257
|
-
)) : stages?.length > 0 && stages?.map((stage, index) => {
|
|
5354
|
+
)) : (stages || [])?.length > 0 && stages?.map((stage, index) => {
|
|
5258
5355
|
const currentIndex = stages.findIndex((s) => s[dataKey] === activeStage);
|
|
5259
5356
|
const isCompletedStage = isAllStagesCompleted || index <= currentIndex;
|
|
5260
5357
|
const isActive = !isAllStagesCompleted && index === currentIndex;
|
|
5261
|
-
|
|
5262
|
-
|
|
5358
|
+
let stageColor = !stage.isSuccess ? "bg-red-50 text-red-700 border-2 border-red-700" : "bg-green-50 text-green-700 border-2 border-green-700";
|
|
5359
|
+
let stageLabel = stage[dataLabel];
|
|
5360
|
+
if (stage[dataKey] !== activeChildStage?.[dataKey] && activeRootStage?.[dataKey] === stage[dataKey]) {
|
|
5361
|
+
stageLabel = activeChildStage?.[dataLabel] || stageLabel;
|
|
5362
|
+
stageColor = activeChildStage?.isSuccess ? "bg-green-50 text-green-700 border-2 border-green-700" : "bg-red-50 text-red-700 border-2 border-red-700";
|
|
5363
|
+
}
|
|
5364
|
+
const stageKey = typeof stage[dataKey] === "string" ? stage[dataKey] : JSON.stringify(stage[dataKey]);
|
|
5365
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_react33.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(Tooltip, { delayDuration: 500, disableHoverableContent: true, children: [
|
|
5366
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5263
5367
|
"button",
|
|
5264
5368
|
{
|
|
5265
5369
|
className: `
|
|
5266
5370
|
min-w-[70px] sm:min-w-[80px] w-full sm:w-auto px-3 sm:px-4 py-1.5 sm:py-2
|
|
5267
5371
|
rounded-full text-xs sm:text-sm font-medium transition-colors duration-200
|
|
5268
|
-
whitespace-normal sm:whitespace-nowrap flex-shrink-0
|
|
5269
|
-
${isActive ? "bg-green-700 text-white shadow-md" : isCompletedStage ?
|
|
5372
|
+
whitespace-normal sm:whitespace-nowrap flex-shrink-0 max-w-[150px] text-ellipsis overflow-hidden
|
|
5373
|
+
${isActive ? "bg-green-700 text-white shadow-md" : isCompletedStage ? stageColor : "bg-white text-gray-700 hover:bg-gray-100 border border-gray-200"}
|
|
5270
5374
|
${isMobile ? "flex-1 text-center py-2.5" : ""}
|
|
5271
5375
|
`,
|
|
5272
5376
|
onClick: () => {
|
|
5273
5377
|
if (isAllStagesCompleted) return;
|
|
5274
5378
|
onStageClick(stage[dataKey]);
|
|
5275
5379
|
},
|
|
5276
|
-
children:
|
|
5380
|
+
children: stageLabel
|
|
5277
5381
|
}
|
|
5278
|
-
),
|
|
5279
|
-
|
|
5280
|
-
|
|
5382
|
+
) }),
|
|
5383
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(TooltipContent, { className: "max-w-[400px] p-3 text-xs text-muted-foreground space-y-2", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("b", { children: stageLabel }) }) }),
|
|
5384
|
+
!isMobile && index < stages.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "hidden sm:flex sm:flex-shrink-0 w-3 h-px bg-gray-300 sm:w-4" })
|
|
5385
|
+
] }, stageKey) }, stageKey);
|
|
5281
5386
|
})
|
|
5282
5387
|
}
|
|
5283
5388
|
),
|
|
5284
|
-
isShowBtn && /* @__PURE__ */ (0,
|
|
5389
|
+
isShowBtn && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5285
5390
|
"div",
|
|
5286
5391
|
{
|
|
5287
5392
|
className: `
|
|
5288
5393
|
flex items-center flex-shrink-0 w-full lg:w-auto
|
|
5289
5394
|
${isMobile ? "order-3 mt-3 lg:mt-0" : "order-3"}
|
|
5290
5395
|
`,
|
|
5291
|
-
children: /* @__PURE__ */ (0,
|
|
5396
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5292
5397
|
"button",
|
|
5293
5398
|
{
|
|
5294
5399
|
className: `
|
|
@@ -5310,20 +5415,20 @@ var StagesComponent = ({
|
|
|
5310
5415
|
var Stages_default = StagesComponent;
|
|
5311
5416
|
|
|
5312
5417
|
// src/components/Navigation/Spacer/Spacer.tsx
|
|
5313
|
-
var
|
|
5418
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
5314
5419
|
var Spacer = ({ className, style }) => {
|
|
5315
|
-
return /* @__PURE__ */ (0,
|
|
5420
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: `${className}`, style });
|
|
5316
5421
|
};
|
|
5317
5422
|
var Spacer_default = Spacer;
|
|
5318
5423
|
|
|
5319
5424
|
// src/components/Navigation/Profile/Profile.tsx
|
|
5320
|
-
var
|
|
5425
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
5321
5426
|
|
|
5322
5427
|
// src/components/Navigation/Notification/Notification.tsx
|
|
5323
|
-
var
|
|
5428
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
5324
5429
|
|
|
5325
5430
|
// src/components/Navigation/Logo/Logo.tsx
|
|
5326
|
-
var
|
|
5431
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
5327
5432
|
|
|
5328
5433
|
// src/components/Navigation/Navbar/Navbar.tsx
|
|
5329
5434
|
var import_react34 = require("react");
|
|
@@ -5335,8 +5440,8 @@ var import_navigation3 = require("next/navigation");
|
|
|
5335
5440
|
// src/components/ui/avatar.tsx
|
|
5336
5441
|
var React12 = __toESM(require("react"));
|
|
5337
5442
|
var AvatarPrimitive = __toESM(require("@radix-ui/react-avatar"));
|
|
5338
|
-
var
|
|
5339
|
-
var Avatar = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
5443
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
5444
|
+
var Avatar = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5340
5445
|
AvatarPrimitive.Root,
|
|
5341
5446
|
{
|
|
5342
5447
|
ref,
|
|
@@ -5348,7 +5453,7 @@ var Avatar = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
5348
5453
|
}
|
|
5349
5454
|
));
|
|
5350
5455
|
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
5351
|
-
var AvatarImage = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
5456
|
+
var AvatarImage = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5352
5457
|
AvatarPrimitive.Image,
|
|
5353
5458
|
{
|
|
5354
5459
|
ref,
|
|
@@ -5357,7 +5462,7 @@ var AvatarImage = React12.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
5357
5462
|
}
|
|
5358
5463
|
));
|
|
5359
5464
|
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
5360
|
-
var AvatarFallback = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
5465
|
+
var AvatarFallback = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5361
5466
|
AvatarPrimitive.Fallback,
|
|
5362
5467
|
{
|
|
5363
5468
|
ref,
|
|
@@ -5371,7 +5476,7 @@ var AvatarFallback = React12.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
5371
5476
|
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
5372
5477
|
|
|
5373
5478
|
// src/components/Navigation/Navbar/Navbar.tsx
|
|
5374
|
-
var
|
|
5479
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
5375
5480
|
function Navbar({
|
|
5376
5481
|
style,
|
|
5377
5482
|
badgeType,
|
|
@@ -5429,9 +5534,9 @@ function Navbar({
|
|
|
5429
5534
|
}
|
|
5430
5535
|
return list;
|
|
5431
5536
|
}, [source, navList, list]);
|
|
5432
|
-
const RenderSearchInput = () => /* @__PURE__ */ (0,
|
|
5433
|
-
/* @__PURE__ */ (0,
|
|
5434
|
-
/* @__PURE__ */ (0,
|
|
5537
|
+
const RenderSearchInput = () => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "flex-1 px-2", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "relative w-full max-w-md border border-gray-300 rounded-md", children: [
|
|
5538
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 dark:text-white text-gray-400" }),
|
|
5539
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
5435
5540
|
Input,
|
|
5436
5541
|
{
|
|
5437
5542
|
placeholder: "Search",
|
|
@@ -5447,23 +5552,23 @@ function Navbar({
|
|
|
5447
5552
|
}
|
|
5448
5553
|
)
|
|
5449
5554
|
] }) });
|
|
5450
|
-
return /* @__PURE__ */ (0,
|
|
5451
|
-
/* @__PURE__ */ (0,
|
|
5555
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_jsx_runtime67.Fragment, { children: [
|
|
5556
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
5452
5557
|
"nav",
|
|
5453
5558
|
{
|
|
5454
5559
|
className: "w-full min-h-[75px] border-b border-gray-200 dark:border-gray-800 dark:bg-gray-800 bg-white shadow-sm",
|
|
5455
5560
|
style,
|
|
5456
|
-
children: /* @__PURE__ */ (0,
|
|
5457
|
-
/* @__PURE__ */ (0,
|
|
5561
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "mx-auto flex max-w-[90%] items-center justify-between px-4 py-4", children: [
|
|
5562
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
5458
5563
|
import_link4.default,
|
|
5459
5564
|
{
|
|
5460
5565
|
href: "/",
|
|
5461
5566
|
onClick: (e) => handleBuilderExit(e, "/"),
|
|
5462
5567
|
className: "flex items-center space-x-2",
|
|
5463
|
-
children: imageUrl ? /* @__PURE__ */ (0,
|
|
5568
|
+
children: imageUrl ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_image2.default, { src: imageUrl, alt: altText, width: 180, height: 40 }) : /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "font-semibold text-blue-700", children: "Logo" })
|
|
5464
5569
|
}
|
|
5465
5570
|
),
|
|
5466
|
-
isDesktop && /* @__PURE__ */ (0,
|
|
5571
|
+
isDesktop && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "hidden md:flex items-center space-x-6", children: formattedMenu.map((item) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
5467
5572
|
import_link4.default,
|
|
5468
5573
|
{
|
|
5469
5574
|
href: item.url,
|
|
@@ -5473,23 +5578,23 @@ function Navbar({
|
|
|
5473
5578
|
},
|
|
5474
5579
|
item.id
|
|
5475
5580
|
)) }),
|
|
5476
|
-
/* @__PURE__ */ (0,
|
|
5477
|
-
(isDesktop || isTablet) && /* @__PURE__ */ (0,
|
|
5478
|
-
/* @__PURE__ */ (0,
|
|
5479
|
-
/* @__PURE__ */ (0,
|
|
5480
|
-
badgeType === "number" && !(hideBadgeWhenZero && badgeCount === 0) && Number(badgeCount) > 0 ? /* @__PURE__ */ (0,
|
|
5581
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex items-center space-x-3", children: [
|
|
5582
|
+
(isDesktop || isTablet) && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(RenderSearchInput, {}),
|
|
5583
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "relative bg-gray-200 dark:bg-gray-700 rounded-md", children: [
|
|
5584
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Button, { variant: "ghost", size: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.Bell, { className: "h-5 w-5 text-gray-700 dark:text-gray-300" }) }),
|
|
5585
|
+
badgeType === "number" && !(hideBadgeWhenZero && badgeCount === 0) && Number(badgeCount) > 0 ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "absolute -top-1 -right-1 h-4 w-4 flex items-center justify-center bg-red-500 rounded-full text-white text-[10px]", children: badgeCount }) : !hideBadgeWhenZero && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "absolute -top-1 -right-1 h-2 w-2 bg-red-500 rounded-full" })
|
|
5481
5586
|
] }),
|
|
5482
|
-
/* @__PURE__ */ (0,
|
|
5483
|
-
/* @__PURE__ */ (0,
|
|
5484
|
-
!isMobile && showName && /* @__PURE__ */ (0,
|
|
5485
|
-
/* @__PURE__ */ (0,
|
|
5486
|
-
(isMobile || isTablet) && /* @__PURE__ */ (0,
|
|
5587
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(DropdownMenu, { children: [
|
|
5588
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex items-center space-x-2 cursor-pointer", children: [
|
|
5589
|
+
!isMobile && showName && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("h4", { className: "text-gray-900 dark:text-gray-300 text-sm", children: userName }),
|
|
5590
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Avatar, { className: "h-8 w-8", children: profileType === "avatar" ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(AvatarImage, { src: "/images/appbuilder/toolset/profile.svg", alt: "profile" }) : /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "bg-green-700 text-white h-full w-full rounded-full flex items-center justify-center text-xs", children: getInitials(userName) }) }),
|
|
5591
|
+
(isMobile || isTablet) && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Button, { variant: "ghost", size: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.Menu, { className: "h-6 w-6" }) })
|
|
5487
5592
|
] }) }),
|
|
5488
|
-
/* @__PURE__ */ (0,
|
|
5489
|
-
profileMenu.map((item) => /* @__PURE__ */ (0,
|
|
5490
|
-
(isMobile || isTablet) && /* @__PURE__ */ (0,
|
|
5491
|
-
/* @__PURE__ */ (0,
|
|
5492
|
-
formattedMenu.map((item) => /* @__PURE__ */ (0,
|
|
5593
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(DropdownMenuContent, { align: "end", className: "bg-white dark:bg-gray-800", children: [
|
|
5594
|
+
profileMenu.map((item) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(DropdownMenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_link4.default, { href: item.url, onClick: (e) => handleBuilderExit(e, item.url), children: item.header }) }, item.id)),
|
|
5595
|
+
(isMobile || isTablet) && /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_jsx_runtime67.Fragment, { children: [
|
|
5596
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(DropdownMenuSeparator, {}),
|
|
5597
|
+
formattedMenu.map((item) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(DropdownMenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_link4.default, { href: item.url, onClick: (e) => handleBuilderExit(e, item.url), children: item.header }) }, item.id))
|
|
5493
5598
|
] })
|
|
5494
5599
|
] })
|
|
5495
5600
|
] })
|
|
@@ -5497,7 +5602,7 @@ function Navbar({
|
|
|
5497
5602
|
] })
|
|
5498
5603
|
}
|
|
5499
5604
|
),
|
|
5500
|
-
isMobile && /* @__PURE__ */ (0,
|
|
5605
|
+
isMobile && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "p-3", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(RenderSearchInput, {}) })
|
|
5501
5606
|
] });
|
|
5502
5607
|
}
|
|
5503
5608
|
|
|
@@ -5505,7 +5610,7 @@ function Navbar({
|
|
|
5505
5610
|
var import_react35 = __toESM(require("react"));
|
|
5506
5611
|
var import_axios3 = __toESM(require("axios"));
|
|
5507
5612
|
var import_recharts = require("recharts");
|
|
5508
|
-
var
|
|
5613
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
5509
5614
|
var getRandomColor = () => {
|
|
5510
5615
|
const palette = [
|
|
5511
5616
|
"#2563eb",
|
|
@@ -5632,27 +5737,27 @@ var ChartComponent = ({
|
|
|
5632
5737
|
const chartType = props.chartType || "bar";
|
|
5633
5738
|
const legendsPosition = ["middle", "bottom"].includes(props.legendsPosition) ? props.legendsPosition : "top";
|
|
5634
5739
|
if (effectiveLoading || data.length === 0) {
|
|
5635
|
-
return /* @__PURE__ */ (0,
|
|
5740
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
|
|
5636
5741
|
"div",
|
|
5637
5742
|
{
|
|
5638
5743
|
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}`,
|
|
5639
5744
|
style,
|
|
5640
5745
|
children: [
|
|
5641
|
-
/* @__PURE__ */ (0,
|
|
5642
|
-
/* @__PURE__ */ (0,
|
|
5643
|
-
/* @__PURE__ */ (0,
|
|
5746
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "mb-6 flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("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: [
|
|
5747
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "w-5 h-5 border-2 border-gray-400 border-t-blue-500 rounded-full animate-spin" }),
|
|
5748
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("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..." })
|
|
5644
5749
|
] }) }),
|
|
5645
|
-
/* @__PURE__ */ (0,
|
|
5646
|
-
/* @__PURE__ */ (0,
|
|
5750
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "absolute inset-0 bg-gradient-to-r from-transparent via-white/60 to-transparent animate-shimmer rounded-xl" }),
|
|
5751
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("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__ */ (0, import_jsx_runtime68.jsx)("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) => {
|
|
5647
5752
|
const randomHeight = `${Math.floor(Math.random() * 76) + 20}%`;
|
|
5648
|
-
return /* @__PURE__ */ (0,
|
|
5753
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
|
|
5649
5754
|
"div",
|
|
5650
5755
|
{
|
|
5651
5756
|
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`,
|
|
5652
5757
|
style: { height: randomHeight, animationDelay: `${idx * 0.08}s` },
|
|
5653
5758
|
children: [
|
|
5654
|
-
/* @__PURE__ */ (0,
|
|
5655
|
-
/* @__PURE__ */ (0,
|
|
5759
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "absolute inset-0 bg-gradient-to-r from-white/40 via-transparent to-white/40 animate-shimmer-bar" }),
|
|
5760
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "absolute bottom-1 left-1/2 w-4 h-1 rounded-full transform -translate-x-1/2 blur-sm" })
|
|
5656
5761
|
]
|
|
5657
5762
|
},
|
|
5658
5763
|
`bar-${idx}`
|
|
@@ -5662,9 +5767,9 @@ var ChartComponent = ({
|
|
|
5662
5767
|
}
|
|
5663
5768
|
);
|
|
5664
5769
|
}
|
|
5665
|
-
return /* @__PURE__ */ (0,
|
|
5666
|
-
isPaginationEnabled && rawMeta && /* @__PURE__ */ (0,
|
|
5667
|
-
/* @__PURE__ */ (0,
|
|
5770
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: `${className} h-[450px]`, style, children: [
|
|
5771
|
+
isPaginationEnabled && rawMeta && /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "flex items-center justify-between mb-4 px-2", children: [
|
|
5772
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "text-sm text-gray-600 hidden sm:block", children: [
|
|
5668
5773
|
"Page ",
|
|
5669
5774
|
rawMeta.page,
|
|
5670
5775
|
" of ",
|
|
@@ -5673,52 +5778,52 @@ var ChartComponent = ({
|
|
|
5673
5778
|
rawMeta.total.toLocaleString(),
|
|
5674
5779
|
" total records)"
|
|
5675
5780
|
] }),
|
|
5676
|
-
/* @__PURE__ */ (0,
|
|
5677
|
-
/* @__PURE__ */ (0,
|
|
5781
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "flex items-center space-x-2 sm:hidden w-full justify-center", children: [
|
|
5782
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5678
5783
|
"button",
|
|
5679
5784
|
{
|
|
5680
5785
|
onClick: () => handlePageChange(currentPage - 1),
|
|
5681
5786
|
disabled: currentPage === 1 || localLoading,
|
|
5682
5787
|
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",
|
|
5683
|
-
children: /* @__PURE__ */ (0,
|
|
5788
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { children: "\u2190 Prev" })
|
|
5684
5789
|
}
|
|
5685
5790
|
),
|
|
5686
|
-
/* @__PURE__ */ (0,
|
|
5687
|
-
/* @__PURE__ */ (0,
|
|
5791
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "px-2 py-2 text-xs font-semibold text-gray-700 min-w-[36px] text-center flex-shrink-0", children: currentPage }),
|
|
5792
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5688
5793
|
"button",
|
|
5689
5794
|
{
|
|
5690
5795
|
onClick: () => handlePageChange(currentPage + 1),
|
|
5691
5796
|
disabled: currentPage >= rawMeta.pages || localLoading,
|
|
5692
5797
|
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",
|
|
5693
|
-
children: /* @__PURE__ */ (0,
|
|
5798
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { children: "Next \u2192" })
|
|
5694
5799
|
}
|
|
5695
5800
|
)
|
|
5696
5801
|
] }),
|
|
5697
|
-
/* @__PURE__ */ (0,
|
|
5698
|
-
/* @__PURE__ */ (0,
|
|
5802
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "flex items-center space-x-2 hidden sm:flex", children: [
|
|
5803
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5699
5804
|
"button",
|
|
5700
5805
|
{
|
|
5701
5806
|
onClick: () => handlePageChange(currentPage - 1),
|
|
5702
5807
|
disabled: currentPage === 1 || localLoading,
|
|
5703
5808
|
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",
|
|
5704
|
-
children: /* @__PURE__ */ (0,
|
|
5809
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { children: "\u2190 Prev" })
|
|
5705
5810
|
}
|
|
5706
5811
|
),
|
|
5707
|
-
/* @__PURE__ */ (0,
|
|
5708
|
-
/* @__PURE__ */ (0,
|
|
5812
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "px-3 py-1 text-sm font-medium text-gray-700", children: currentPage }),
|
|
5813
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5709
5814
|
"button",
|
|
5710
5815
|
{
|
|
5711
5816
|
onClick: () => handlePageChange(currentPage + 1),
|
|
5712
5817
|
disabled: currentPage >= rawMeta.pages || localLoading,
|
|
5713
5818
|
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",
|
|
5714
|
-
children: /* @__PURE__ */ (0,
|
|
5819
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { children: "Next \u2192" })
|
|
5715
5820
|
}
|
|
5716
5821
|
)
|
|
5717
5822
|
] })
|
|
5718
5823
|
] }),
|
|
5719
|
-
/* @__PURE__ */ (0,
|
|
5720
|
-
/* @__PURE__ */ (0,
|
|
5721
|
-
/* @__PURE__ */ (0,
|
|
5824
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_recharts.ResponsiveContainer, { width: "100%", height: "100%", children: chartType === "bar" ? /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_recharts.BarChart, { data, children: [
|
|
5825
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_recharts.CartesianGrid, { strokeDasharray: "3 3" }),
|
|
5826
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5722
5827
|
import_recharts.XAxis,
|
|
5723
5828
|
{
|
|
5724
5829
|
dataKey: dataLabel,
|
|
@@ -5736,7 +5841,7 @@ var ChartComponent = ({
|
|
|
5736
5841
|
className: "hidden sm:block"
|
|
5737
5842
|
}
|
|
5738
5843
|
),
|
|
5739
|
-
/* @__PURE__ */ (0,
|
|
5844
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5740
5845
|
import_recharts.YAxis,
|
|
5741
5846
|
{
|
|
5742
5847
|
tickFormatter: (value) => `${(value / 1e3).toFixed(0)}k`,
|
|
@@ -5749,9 +5854,9 @@ var ChartComponent = ({
|
|
|
5749
5854
|
width: 60
|
|
5750
5855
|
}
|
|
5751
5856
|
),
|
|
5752
|
-
/* @__PURE__ */ (0,
|
|
5753
|
-
/* @__PURE__ */ (0,
|
|
5754
|
-
/* @__PURE__ */ (0,
|
|
5857
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_recharts.Tooltip, { formatter: (value) => [`${value}`, "Count"] }),
|
|
5858
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_recharts.Legend, { verticalAlign: legendsPosition, align: "center" }),
|
|
5859
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5755
5860
|
import_recharts.Bar,
|
|
5756
5861
|
{
|
|
5757
5862
|
dataKey,
|
|
@@ -5759,13 +5864,13 @@ var ChartComponent = ({
|
|
|
5759
5864
|
isAnimationActive: false
|
|
5760
5865
|
}
|
|
5761
5866
|
)
|
|
5762
|
-
] }) : /* @__PURE__ */ (0,
|
|
5763
|
-
/* @__PURE__ */ (0,
|
|
5764
|
-
/* @__PURE__ */ (0,
|
|
5765
|
-
/* @__PURE__ */ (0,
|
|
5867
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_recharts.AreaChart, { data, children: [
|
|
5868
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("linearGradient", { id: "colorCount", x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
5869
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("stop", { offset: "5%", stopColor: "#00695C", stopOpacity: 0.8 }),
|
|
5870
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("stop", { offset: "95%", stopColor: "#00695C", stopOpacity: 0 })
|
|
5766
5871
|
] }) }),
|
|
5767
|
-
/* @__PURE__ */ (0,
|
|
5768
|
-
/* @__PURE__ */ (0,
|
|
5872
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_recharts.CartesianGrid, { strokeDasharray: "3 3" }),
|
|
5873
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5769
5874
|
import_recharts.XAxis,
|
|
5770
5875
|
{
|
|
5771
5876
|
dataKey: dataLabel,
|
|
@@ -5779,7 +5884,7 @@ var ChartComponent = ({
|
|
|
5779
5884
|
}
|
|
5780
5885
|
}
|
|
5781
5886
|
),
|
|
5782
|
-
/* @__PURE__ */ (0,
|
|
5887
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5783
5888
|
import_recharts.YAxis,
|
|
5784
5889
|
{
|
|
5785
5890
|
tickFormatter: (value) => `${(value / 1e3).toFixed(0)}k`,
|
|
@@ -5792,8 +5897,8 @@ var ChartComponent = ({
|
|
|
5792
5897
|
width: 60
|
|
5793
5898
|
}
|
|
5794
5899
|
),
|
|
5795
|
-
/* @__PURE__ */ (0,
|
|
5796
|
-
/* @__PURE__ */ (0,
|
|
5900
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_recharts.Tooltip, { formatter: (value) => `${value}k` }),
|
|
5901
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5797
5902
|
import_recharts.Area,
|
|
5798
5903
|
{
|
|
5799
5904
|
type: "monotone",
|
|
@@ -5813,7 +5918,7 @@ var BarChart_default = import_react35.default.memo(ChartComponent);
|
|
|
5813
5918
|
var import_react36 = __toESM(require("react"));
|
|
5814
5919
|
var import_axios4 = __toESM(require("axios"));
|
|
5815
5920
|
var import_recharts2 = require("recharts");
|
|
5816
|
-
var
|
|
5921
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
5817
5922
|
var getRandomColor2 = () => {
|
|
5818
5923
|
const palette = [
|
|
5819
5924
|
"#2563eb",
|
|
@@ -5982,32 +6087,32 @@ var DonutChart = ({
|
|
|
5982
6087
|
}, []);
|
|
5983
6088
|
const renderLegends = (0, import_react36.useMemo)(() => {
|
|
5984
6089
|
if (!showLegends) return null;
|
|
5985
|
-
return /* @__PURE__ */ (0,
|
|
6090
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "flex flex-wrap justify-center gap-2 mt-4 w-full max-w-4xl", children: chartData.map((d, index) => {
|
|
5986
6091
|
const actualValue = data.find(
|
|
5987
6092
|
(item) => item[dataLabel] === d[dataLabel]
|
|
5988
6093
|
)?.[dataKey] ?? d[dataKey];
|
|
5989
6094
|
const displayValue = actualValue >= 1e3 ? `${(actualValue / 1e3).toFixed(0)}k` : actualValue.toLocaleString();
|
|
5990
|
-
return /* @__PURE__ */ (0,
|
|
6095
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
5991
6096
|
"div",
|
|
5992
6097
|
{
|
|
5993
6098
|
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",
|
|
5994
6099
|
children: [
|
|
5995
|
-
/* @__PURE__ */ (0,
|
|
6100
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5996
6101
|
"span",
|
|
5997
6102
|
{
|
|
5998
6103
|
className: "inline-block w-[12px] h-[12px] rounded-full shrink-0 border-2 border-white/50",
|
|
5999
6104
|
style: { backgroundColor: d.color }
|
|
6000
6105
|
}
|
|
6001
6106
|
),
|
|
6002
|
-
/* @__PURE__ */ (0,
|
|
6003
|
-
/* @__PURE__ */ (0,
|
|
6004
|
-
/* @__PURE__ */ (0,
|
|
6005
|
-
/* @__PURE__ */ (0,
|
|
6006
|
-
/* @__PURE__ */ (0,
|
|
6107
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
6108
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "text-gray-900 text-[11px] md:text-[13px] font-semibold block truncate leading-tight", children: d[dataLabel] }),
|
|
6109
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex items-center gap-1 text-xs text-gray-600 font-medium", children: [
|
|
6110
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { children: displayValue }),
|
|
6111
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("span", { children: [
|
|
6007
6112
|
(actualValue / total * 100).toFixed(1),
|
|
6008
6113
|
"%"
|
|
6009
6114
|
] }),
|
|
6010
|
-
d.isBoosted && /* @__PURE__ */ (0,
|
|
6115
|
+
d.isBoosted && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "text-[9px] px-1 py-0.5 bg-blue-100 text-blue-700 rounded-full", children: "min" })
|
|
6011
6116
|
] })
|
|
6012
6117
|
] })
|
|
6013
6118
|
]
|
|
@@ -6018,26 +6123,26 @@ var DonutChart = ({
|
|
|
6018
6123
|
}, [chartData, data, dataLabel, dataKey, total, showLegends]);
|
|
6019
6124
|
if (!mounted) return null;
|
|
6020
6125
|
if (effectiveLoading || data.length === 0) {
|
|
6021
|
-
return /* @__PURE__ */ (0,
|
|
6126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
6022
6127
|
"div",
|
|
6023
6128
|
{
|
|
6024
6129
|
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}`,
|
|
6025
6130
|
style,
|
|
6026
6131
|
children: [
|
|
6027
|
-
/* @__PURE__ */ (0,
|
|
6028
|
-
/* @__PURE__ */ (0,
|
|
6029
|
-
/* @__PURE__ */ (0,
|
|
6030
|
-
/* @__PURE__ */ (0,
|
|
6132
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "absolute inset-0 bg-gradient-to-r from-transparent via-white/60 to-transparent animate-shimmer rounded-xl" }),
|
|
6133
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "mt-6 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("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: [
|
|
6134
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "w-5 h-5 border-2 border-gray-300 border-t-blue-400 rounded-full animate-spin" }),
|
|
6135
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("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..." })
|
|
6031
6136
|
] }) }),
|
|
6032
|
-
/* @__PURE__ */ (0,
|
|
6137
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "flex flex-wrap justify-center gap-3 mt-8 w-full max-w-4xl", children: [...Array(18)].map((_, idx) => /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
6033
6138
|
"div",
|
|
6034
6139
|
{
|
|
6035
6140
|
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`,
|
|
6036
6141
|
children: [
|
|
6037
|
-
/* @__PURE__ */ (0,
|
|
6038
|
-
/* @__PURE__ */ (0,
|
|
6039
|
-
/* @__PURE__ */ (0,
|
|
6040
|
-
/* @__PURE__ */ (0,
|
|
6142
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "w-4 h-4 rounded-full bg-gradient-to-r from-blue-300 to-purple-300 animate-pulse" }),
|
|
6143
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex-1 space-y-1", children: [
|
|
6144
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "h-3 w-20 bg-gray-300 rounded animate-pulse" }),
|
|
6145
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "h-2.5 w-16 bg-gray-200/60 rounded animate-pulse-delayed" })
|
|
6041
6146
|
] })
|
|
6042
6147
|
]
|
|
6043
6148
|
},
|
|
@@ -6050,10 +6155,10 @@ var DonutChart = ({
|
|
|
6050
6155
|
const { inner, outer } = getDynamicRadius();
|
|
6051
6156
|
const innerRadius = inner;
|
|
6052
6157
|
const outerRadius = outer;
|
|
6053
|
-
return /* @__PURE__ */ (0,
|
|
6054
|
-
/* @__PURE__ */ (0,
|
|
6055
|
-
/* @__PURE__ */ (0,
|
|
6056
|
-
/* @__PURE__ */ (0,
|
|
6158
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: `relative flex flex-col items-center ${className}`, style, children: [
|
|
6159
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "relative w-full md:w-[75%] h-[280px] md:h-[380px] flex items-center justify-center mb-2", children: [
|
|
6160
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_recharts2.ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_recharts2.PieChart, { children: [
|
|
6161
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
6057
6162
|
import_recharts2.Pie,
|
|
6058
6163
|
{
|
|
6059
6164
|
data: chartData,
|
|
@@ -6066,7 +6171,7 @@ var DonutChart = ({
|
|
|
6066
6171
|
isAnimationActive: true,
|
|
6067
6172
|
animationDuration: 800,
|
|
6068
6173
|
minAngle: 3,
|
|
6069
|
-
children: chartData.map((entry, index) => /* @__PURE__ */ (0,
|
|
6174
|
+
children: chartData.map((entry, index) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
6070
6175
|
import_recharts2.Cell,
|
|
6071
6176
|
{
|
|
6072
6177
|
fill: entry.color,
|
|
@@ -6077,7 +6182,7 @@ var DonutChart = ({
|
|
|
6077
6182
|
))
|
|
6078
6183
|
}
|
|
6079
6184
|
),
|
|
6080
|
-
/* @__PURE__ */ (0,
|
|
6185
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
6081
6186
|
import_recharts2.Tooltip,
|
|
6082
6187
|
{
|
|
6083
6188
|
formatter: (value, name, payload) => {
|
|
@@ -6100,9 +6205,9 @@ var DonutChart = ({
|
|
|
6100
6205
|
}
|
|
6101
6206
|
)
|
|
6102
6207
|
] }) }),
|
|
6103
|
-
total > 0 && /* @__PURE__ */ (0,
|
|
6208
|
+
total > 0 && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("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__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "text-[#1f2937] leading-tight", children: [
|
|
6104
6209
|
formattedTotal,
|
|
6105
|
-
/* @__PURE__ */ (0,
|
|
6210
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "text-sm md:text-base font-normal text-gray-600 block md:inline-block md:ml-1", children: "total" })
|
|
6106
6211
|
] }) })
|
|
6107
6212
|
] }),
|
|
6108
6213
|
renderLegends
|
|
@@ -6111,10 +6216,10 @@ var DonutChart = ({
|
|
|
6111
6216
|
var PieChart_default = import_react36.default.memo(DonutChart);
|
|
6112
6217
|
|
|
6113
6218
|
// src/components/Blocks/EmailComposer.tsx
|
|
6114
|
-
var
|
|
6219
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
6115
6220
|
function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc, setShowBcc, cc, setCc, bcc, setBcc, subject, setSubject, body, setBody }) {
|
|
6116
|
-
return /* @__PURE__ */ (0,
|
|
6117
|
-
/* @__PURE__ */ (0,
|
|
6221
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className, style, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "border rounded-md shadow bg-[#fff] p-4 mx-auto z-[50] relative", children: [
|
|
6222
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
6118
6223
|
"input",
|
|
6119
6224
|
{
|
|
6120
6225
|
type: "email",
|
|
@@ -6123,8 +6228,8 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
6123
6228
|
required: true
|
|
6124
6229
|
}
|
|
6125
6230
|
) }),
|
|
6126
|
-
/* @__PURE__ */ (0,
|
|
6127
|
-
/* @__PURE__ */ (0,
|
|
6231
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
6232
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
6128
6233
|
"input",
|
|
6129
6234
|
{
|
|
6130
6235
|
type: "email",
|
|
@@ -6135,7 +6240,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
6135
6240
|
required: true
|
|
6136
6241
|
}
|
|
6137
6242
|
),
|
|
6138
|
-
!showCc && /* @__PURE__ */ (0,
|
|
6243
|
+
!showCc && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
6139
6244
|
"button",
|
|
6140
6245
|
{
|
|
6141
6246
|
onClick: () => setShowCc?.(true),
|
|
@@ -6143,7 +6248,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
6143
6248
|
children: "Cc"
|
|
6144
6249
|
}
|
|
6145
6250
|
),
|
|
6146
|
-
!showBcc && /* @__PURE__ */ (0,
|
|
6251
|
+
!showBcc && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
6147
6252
|
"button",
|
|
6148
6253
|
{
|
|
6149
6254
|
onClick: () => setShowBcc?.(true),
|
|
@@ -6152,7 +6257,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
6152
6257
|
}
|
|
6153
6258
|
)
|
|
6154
6259
|
] }) }),
|
|
6155
|
-
showCc && /* @__PURE__ */ (0,
|
|
6260
|
+
showCc && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
6156
6261
|
"input",
|
|
6157
6262
|
{
|
|
6158
6263
|
type: "text",
|
|
@@ -6162,7 +6267,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
6162
6267
|
className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
|
|
6163
6268
|
}
|
|
6164
6269
|
) }),
|
|
6165
|
-
showBcc && /* @__PURE__ */ (0,
|
|
6270
|
+
showBcc && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
6166
6271
|
"input",
|
|
6167
6272
|
{
|
|
6168
6273
|
type: "text",
|
|
@@ -6172,7 +6277,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
6172
6277
|
className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
|
|
6173
6278
|
}
|
|
6174
6279
|
) }),
|
|
6175
|
-
/* @__PURE__ */ (0,
|
|
6280
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
6176
6281
|
"input",
|
|
6177
6282
|
{
|
|
6178
6283
|
type: "text",
|
|
@@ -6182,11 +6287,11 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
6182
6287
|
className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
|
|
6183
6288
|
}
|
|
6184
6289
|
) }),
|
|
6185
|
-
/* @__PURE__ */ (0,
|
|
6186
|
-
/* @__PURE__ */ (0,
|
|
6187
|
-
/* @__PURE__ */ (0,
|
|
6188
|
-
/* @__PURE__ */ (0,
|
|
6189
|
-
/* @__PURE__ */ (0,
|
|
6290
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: "mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(MyEditor, { value: body, onChange: setBody }) }),
|
|
6291
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "flex justify-end gap-2", children: [
|
|
6292
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("button", { className: "px-4 py-2 rounded-md text-gray-600 hover:bg-gray-100", children: "Discard" }),
|
|
6293
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("button", { className: "px-4 py-2 rounded-md border text-[#12715B] border-[#12715B]", children: "Reset" }),
|
|
6294
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("button", { className: "px-4 py-2 rounded-md bg-[#12715B] text-white", children: "Send" })
|
|
6190
6295
|
] })
|
|
6191
6296
|
] }) });
|
|
6192
6297
|
}
|
|
@@ -6194,10 +6299,10 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
6194
6299
|
// src/components/ui/sonner.tsx
|
|
6195
6300
|
var import_next_themes = require("next-themes");
|
|
6196
6301
|
var import_sonner2 = require("sonner");
|
|
6197
|
-
var
|
|
6302
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
6198
6303
|
var Toaster = ({ ...props }) => {
|
|
6199
6304
|
const { theme = "system" } = (0, import_next_themes.useTheme)();
|
|
6200
|
-
return /* @__PURE__ */ (0,
|
|
6305
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
6201
6306
|
import_sonner2.Toaster,
|
|
6202
6307
|
{
|
|
6203
6308
|
theme,
|