@algorithm-shift/design-system 1.2.994 → 1.2.996
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 +274 -148
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +284 -158
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -8
package/dist/index.mjs
CHANGED
|
@@ -2029,7 +2029,8 @@ function LazySelectDropdown({
|
|
|
2029
2029
|
errorMessage,
|
|
2030
2030
|
axiosInstance,
|
|
2031
2031
|
enableAddNewOption = false,
|
|
2032
|
-
enforceStrictQueryParams = false
|
|
2032
|
+
enforceStrictQueryParams = false,
|
|
2033
|
+
...props
|
|
2033
2034
|
}) {
|
|
2034
2035
|
const [isOpen, setIsOpen] = useState8(false);
|
|
2035
2036
|
const [searchTerm, setSearchTerm] = useState8("");
|
|
@@ -2155,7 +2156,10 @@ function LazySelectDropdown({
|
|
|
2155
2156
|
top: dropdownRef.current ? dropdownRef.current.getBoundingClientRect().bottom + window.scrollY : 0,
|
|
2156
2157
|
left: dropdownRef.current ? dropdownRef.current.getBoundingClientRect().left + window.scrollX : 0
|
|
2157
2158
|
},
|
|
2158
|
-
children: loading &&
|
|
2159
|
+
children: props.loading && !loading ? /* @__PURE__ */ jsxs19("div", { className: "px-3 py-4 text-center text-gray-500 flex items-center justify-center gap-2 text-sm", children: [
|
|
2160
|
+
/* @__PURE__ */ jsx36("div", { className: "animate-spin w-4 h-4 border-2 border-gray-300 border-t-blue-500 rounded-full" }),
|
|
2161
|
+
"Loading..."
|
|
2162
|
+
] }) : /* @__PURE__ */ jsx36(Fragment11, { children: loading && lazyOptions.length === 0 ? /* @__PURE__ */ jsxs19("div", { className: "px-3 py-4 text-center text-gray-500 flex items-center justify-center gap-2 text-sm", children: [
|
|
2159
2163
|
/* @__PURE__ */ jsx36("div", { className: "animate-spin w-4 h-4 border-2 border-gray-300 border-t-blue-500 rounded-full" }),
|
|
2160
2164
|
"Loading..."
|
|
2161
2165
|
] }) : lazyOptions.length > 0 ? /* @__PURE__ */ jsxs19(Fragment11, { children: [
|
|
@@ -2193,7 +2197,7 @@ function LazySelectDropdown({
|
|
|
2193
2197
|
children: `Add "${searchTerm}"`
|
|
2194
2198
|
}
|
|
2195
2199
|
)
|
|
2196
|
-
] })
|
|
2200
|
+
] }) })
|
|
2197
2201
|
}
|
|
2198
2202
|
) })
|
|
2199
2203
|
] });
|
|
@@ -3160,7 +3164,7 @@ var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
|
|
|
3160
3164
|
var TextInputGroup_default = TextInputGroup;
|
|
3161
3165
|
|
|
3162
3166
|
// src/components/Inputs/Multiselect/MultiSelect.tsx
|
|
3163
|
-
import { useState as useState10, useRef as useRef7, useEffect as useEffect25, useMemo as useMemo5 } from "react";
|
|
3167
|
+
import { useState as useState10, useRef as useRef7, useEffect as useEffect25, useMemo as useMemo5, useCallback as useCallback3 } from "react";
|
|
3164
3168
|
import { XIcon, XSquareIcon as XSquareIcon3 } from "lucide-react";
|
|
3165
3169
|
import { Fragment as Fragment19, jsx as jsx48, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3166
3170
|
function LazyMultiSelectDropdown({
|
|
@@ -3183,6 +3187,7 @@ function LazyMultiSelectDropdown({
|
|
|
3183
3187
|
}) {
|
|
3184
3188
|
const [isOpen, setIsOpen] = useState10(false);
|
|
3185
3189
|
const [searchTerm, setSearchTerm] = useState10("");
|
|
3190
|
+
const [selectedDetails, setSelectedDetails] = useState10({});
|
|
3186
3191
|
const dropdownRef = useRef7(null);
|
|
3187
3192
|
const observerTarget = useRef7(null);
|
|
3188
3193
|
const ensureUnique = (arr) => {
|
|
@@ -3234,8 +3239,28 @@ function LazyMultiSelectDropdown({
|
|
|
3234
3239
|
}
|
|
3235
3240
|
};
|
|
3236
3241
|
const selectedOptions = useMemo5(() => {
|
|
3237
|
-
return
|
|
3238
|
-
|
|
3242
|
+
return normalizedValue.map((id2) => {
|
|
3243
|
+
const fromLazy = lazyOptions.find((opt) => opt.value === id2);
|
|
3244
|
+
if (fromLazy) return fromLazy;
|
|
3245
|
+
if (selectedDetails[id2]) return selectedDetails[id2];
|
|
3246
|
+
return { value: id2, label: id2 };
|
|
3247
|
+
});
|
|
3248
|
+
}, [normalizedValue, lazyOptions, selectedDetails]);
|
|
3249
|
+
useEffect25(() => {
|
|
3250
|
+
const newDetails = { ...selectedDetails };
|
|
3251
|
+
normalizedValue.forEach((id2) => {
|
|
3252
|
+
const option = lazyOptions.find((opt) => opt.value === id2);
|
|
3253
|
+
if (option && !newDetails[id2]) {
|
|
3254
|
+
newDetails[id2] = option;
|
|
3255
|
+
}
|
|
3256
|
+
});
|
|
3257
|
+
Object.keys(newDetails).forEach((key) => {
|
|
3258
|
+
if (!normalizedValue.includes(key)) {
|
|
3259
|
+
delete newDetails[key];
|
|
3260
|
+
}
|
|
3261
|
+
});
|
|
3262
|
+
setSelectedDetails(newDetails);
|
|
3263
|
+
}, [normalizedValue, lazyOptions]);
|
|
3239
3264
|
useEffect25(() => {
|
|
3240
3265
|
const handleClick = (e) => {
|
|
3241
3266
|
if (dropdownRef.current && !dropdownRef.current.contains(e.target)) {
|
|
@@ -3261,7 +3286,7 @@ function LazyMultiSelectDropdown({
|
|
|
3261
3286
|
setSearchTerm(term);
|
|
3262
3287
|
search(term);
|
|
3263
3288
|
};
|
|
3264
|
-
const toggleSelect = (val) => {
|
|
3289
|
+
const toggleSelect = useCallback3((val) => {
|
|
3265
3290
|
let updated;
|
|
3266
3291
|
if (normalizedValue.includes(val)) {
|
|
3267
3292
|
updated = normalizedValue.filter((v) => v !== val);
|
|
@@ -3269,14 +3294,18 @@ function LazyMultiSelectDropdown({
|
|
|
3269
3294
|
updated = ensureUnique([...normalizedValue, val]);
|
|
3270
3295
|
}
|
|
3271
3296
|
onChange?.(convertOutput(updated), id);
|
|
3272
|
-
};
|
|
3297
|
+
}, [normalizedValue, onChange, id, convertOutput]);
|
|
3273
3298
|
const removeTag = (val) => {
|
|
3274
3299
|
const updated = normalizedValue.filter((v) => v !== val);
|
|
3275
3300
|
onChange?.(convertOutput(updated), id);
|
|
3276
3301
|
};
|
|
3277
3302
|
const handleFocus = () => {
|
|
3278
|
-
if (!disabled)
|
|
3279
|
-
|
|
3303
|
+
if (!disabled) {
|
|
3304
|
+
setIsOpen(true);
|
|
3305
|
+
if (lazyOptions.length === 0) {
|
|
3306
|
+
loadPage(1, "");
|
|
3307
|
+
}
|
|
3308
|
+
}
|
|
3280
3309
|
};
|
|
3281
3310
|
return /* @__PURE__ */ jsxs28("div", { ref: dropdownRef, className: "relative w-full", children: [
|
|
3282
3311
|
/* @__PURE__ */ jsxs28(
|
|
@@ -3919,9 +3948,9 @@ function DataTable({
|
|
|
3919
3948
|
setLocalPageSize(newSize);
|
|
3920
3949
|
};
|
|
3921
3950
|
const pageSizeOptions = React10.useMemo(() => {
|
|
3922
|
-
const options = [10, 20, 50, 100].filter((size) => size < totalRecords);
|
|
3951
|
+
const options = [5, 10, 20, 50, 100].filter((size) => size < totalRecords);
|
|
3923
3952
|
if (options.length === 0) {
|
|
3924
|
-
options.push(
|
|
3953
|
+
options.push(5);
|
|
3925
3954
|
}
|
|
3926
3955
|
return options;
|
|
3927
3956
|
}, [totalRecords]);
|
|
@@ -4684,7 +4713,7 @@ var HistoryTimeline = ({
|
|
|
4684
4713
|
var HistoryTimeline_default = HistoryTimeline;
|
|
4685
4714
|
|
|
4686
4715
|
// src/components/Navigation/Tabs/Tabs.tsx
|
|
4687
|
-
import { useCallback as
|
|
4716
|
+
import { useCallback as useCallback4, useMemo as useMemo8, useState as useState12 } from "react";
|
|
4688
4717
|
import { ChevronDown as ChevronDown2, Menu } from "lucide-react";
|
|
4689
4718
|
import Link3 from "next/link";
|
|
4690
4719
|
import { usePathname, useRouter } from "next/navigation";
|
|
@@ -4911,7 +4940,7 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
4911
4940
|
const router = useRouter();
|
|
4912
4941
|
const [showExitDialog, setShowExitDialog] = useState12(false);
|
|
4913
4942
|
const [pendingUrl, setPendingUrl] = useState12(null);
|
|
4914
|
-
const handleBuilderExit =
|
|
4943
|
+
const handleBuilderExit = useCallback4(
|
|
4915
4944
|
(e, url) => {
|
|
4916
4945
|
if (isBuilder) {
|
|
4917
4946
|
e.preventDefault();
|
|
@@ -5079,7 +5108,59 @@ var Tabs_default = Tabs;
|
|
|
5079
5108
|
|
|
5080
5109
|
// src/components/Navigation/Stages/Stages.tsx
|
|
5081
5110
|
import React11, { useEffect as useEffect26, useState as useState13 } from "react";
|
|
5111
|
+
|
|
5112
|
+
// src/components/ui/tooltip.tsx
|
|
5113
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
5082
5114
|
import { jsx as jsx60, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
5115
|
+
function TooltipProvider({
|
|
5116
|
+
delayDuration = 0,
|
|
5117
|
+
...props
|
|
5118
|
+
}) {
|
|
5119
|
+
return /* @__PURE__ */ jsx60(
|
|
5120
|
+
TooltipPrimitive.Provider,
|
|
5121
|
+
{
|
|
5122
|
+
"data-slot": "tooltip-provider",
|
|
5123
|
+
delayDuration,
|
|
5124
|
+
...props
|
|
5125
|
+
}
|
|
5126
|
+
);
|
|
5127
|
+
}
|
|
5128
|
+
function Tooltip({
|
|
5129
|
+
...props
|
|
5130
|
+
}) {
|
|
5131
|
+
return /* @__PURE__ */ jsx60(TooltipProvider, { children: /* @__PURE__ */ jsx60(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props }) });
|
|
5132
|
+
}
|
|
5133
|
+
function TooltipTrigger({
|
|
5134
|
+
...props
|
|
5135
|
+
}) {
|
|
5136
|
+
return /* @__PURE__ */ jsx60(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
|
|
5137
|
+
}
|
|
5138
|
+
function TooltipContent({
|
|
5139
|
+
className,
|
|
5140
|
+
sideOffset = 0,
|
|
5141
|
+
children,
|
|
5142
|
+
...props
|
|
5143
|
+
}) {
|
|
5144
|
+
return /* @__PURE__ */ jsx60(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs37(
|
|
5145
|
+
TooltipPrimitive.Content,
|
|
5146
|
+
{
|
|
5147
|
+
"data-slot": "tooltip-content",
|
|
5148
|
+
sideOffset,
|
|
5149
|
+
className: cn(
|
|
5150
|
+
"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",
|
|
5151
|
+
className
|
|
5152
|
+
),
|
|
5153
|
+
...props,
|
|
5154
|
+
children: [
|
|
5155
|
+
children,
|
|
5156
|
+
/* @__PURE__ */ jsx60(TooltipPrimitive.Arrow, { className: "bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })
|
|
5157
|
+
]
|
|
5158
|
+
}
|
|
5159
|
+
) });
|
|
5160
|
+
}
|
|
5161
|
+
|
|
5162
|
+
// src/components/Navigation/Stages/Stages.tsx
|
|
5163
|
+
import { jsx as jsx61, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
5083
5164
|
var StagesComponent = ({
|
|
5084
5165
|
stages,
|
|
5085
5166
|
isShowBtn,
|
|
@@ -5097,6 +5178,8 @@ var StagesComponent = ({
|
|
|
5097
5178
|
}) => {
|
|
5098
5179
|
const [activeStage, setActiveStage] = useState13("");
|
|
5099
5180
|
const [isCompleted, setIsCompleted] = useState13(false);
|
|
5181
|
+
const [activeChildStage, setActiveChildStage] = useState13(null);
|
|
5182
|
+
const [activeRootStage, setActiveRootStage] = useState13(null);
|
|
5100
5183
|
useEffect26(() => {
|
|
5101
5184
|
if (currentStage) {
|
|
5102
5185
|
setActiveStage(currentStage);
|
|
@@ -5107,6 +5190,9 @@ var StagesComponent = ({
|
|
|
5107
5190
|
const updateStage = (stageKey) => {
|
|
5108
5191
|
setActiveStage(stageKey);
|
|
5109
5192
|
onStageChange?.(stageKey);
|
|
5193
|
+
const { activeRoot, activeChild } = findStageContext(stages, stageKey);
|
|
5194
|
+
setActiveRootStage(activeRoot);
|
|
5195
|
+
setActiveChildStage(activeChild);
|
|
5110
5196
|
};
|
|
5111
5197
|
const nextStage = () => {
|
|
5112
5198
|
if (!stages || stages.length === 0) return;
|
|
@@ -5132,9 +5218,41 @@ var StagesComponent = ({
|
|
|
5132
5218
|
onStageChange?.(stageKey);
|
|
5133
5219
|
}
|
|
5134
5220
|
};
|
|
5135
|
-
const
|
|
5221
|
+
const findStageContext = (nodes, curr, root = null) => {
|
|
5222
|
+
if (!nodes || nodes.length === 0) {
|
|
5223
|
+
return { activeRoot: null, activeChild: null };
|
|
5224
|
+
}
|
|
5225
|
+
if (!Array.isArray(nodes)) {
|
|
5226
|
+
return { activeRoot: null, activeChild: null };
|
|
5227
|
+
}
|
|
5228
|
+
for (const node of nodes) {
|
|
5229
|
+
const currentRoot = root ?? node;
|
|
5230
|
+
if (node?.[dataKey] === curr) {
|
|
5231
|
+
return {
|
|
5232
|
+
activeRoot: root ?? node,
|
|
5233
|
+
activeChild: node
|
|
5234
|
+
};
|
|
5235
|
+
}
|
|
5236
|
+
const result = findStageContext(node?.children, curr, currentRoot);
|
|
5237
|
+
if (result.activeChild) {
|
|
5238
|
+
return result;
|
|
5239
|
+
}
|
|
5240
|
+
}
|
|
5241
|
+
return { activeRoot: null, activeChild: null };
|
|
5242
|
+
};
|
|
5243
|
+
useEffect26(() => {
|
|
5244
|
+
if (!currentStage || !Array.isArray(stages)) {
|
|
5245
|
+
setActiveRootStage(null);
|
|
5246
|
+
setActiveChildStage(null);
|
|
5247
|
+
return;
|
|
5248
|
+
}
|
|
5249
|
+
const { activeRoot, activeChild } = findStageContext(stages, currentStage);
|
|
5250
|
+
setActiveRootStage(activeRoot);
|
|
5251
|
+
setActiveChildStage(activeChild);
|
|
5252
|
+
}, [currentStage, stages]);
|
|
5253
|
+
const isAllStagesCompleted = isCompleted || activeRootStage?.[dataKey] === lastStage;
|
|
5136
5254
|
const disabled = isAllStagesCompleted || loading || saving;
|
|
5137
|
-
return /* @__PURE__ */
|
|
5255
|
+
return /* @__PURE__ */ jsx61("div", { className, style, children: /* @__PURE__ */ jsxs38(
|
|
5138
5256
|
"div",
|
|
5139
5257
|
{
|
|
5140
5258
|
className: `
|
|
@@ -5144,8 +5262,8 @@ var StagesComponent = ({
|
|
|
5144
5262
|
${isMobile ? "p-3 sm:p-4" : "p-2"}
|
|
5145
5263
|
`,
|
|
5146
5264
|
children: [
|
|
5147
|
-
/* @__PURE__ */
|
|
5148
|
-
/* @__PURE__ */
|
|
5265
|
+
/* @__PURE__ */ jsx61("div", { className: "flex items-center flex-shrink-0 order-1 lg:order-1", children: /* @__PURE__ */ jsx61("button", { className: "p-2 hover:bg-gray-100 rounded flex-shrink-0", children: /* @__PURE__ */ jsx61("svg", { className: "w-4 h-4 text-gray-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx61("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) }) }),
|
|
5266
|
+
/* @__PURE__ */ jsx61(
|
|
5149
5267
|
"div",
|
|
5150
5268
|
{
|
|
5151
5269
|
className: `
|
|
@@ -5153,7 +5271,7 @@ var StagesComponent = ({
|
|
|
5153
5271
|
flex-wrap gap-2 sm:gap-2 lg:gap-3 w-full lg:w-auto
|
|
5154
5272
|
${isMobile ? "order-2 mt-2 lg:mt-0" : "order-2"}
|
|
5155
5273
|
`,
|
|
5156
|
-
children: loading ? Array(6).fill(null).map((_, index) => /* @__PURE__ */
|
|
5274
|
+
children: loading ? Array(6).fill(null).map((_, index) => /* @__PURE__ */ jsx61(
|
|
5157
5275
|
"button",
|
|
5158
5276
|
{
|
|
5159
5277
|
className: `
|
|
@@ -5167,41 +5285,49 @@ var StagesComponent = ({
|
|
|
5167
5285
|
disabled: true
|
|
5168
5286
|
},
|
|
5169
5287
|
index
|
|
5170
|
-
)) : stages?.length > 0 && stages?.map((stage, index) => {
|
|
5288
|
+
)) : (stages || [])?.length > 0 && stages?.map((stage, index) => {
|
|
5171
5289
|
const currentIndex = stages.findIndex((s) => s[dataKey] === activeStage);
|
|
5172
5290
|
const isCompletedStage = isAllStagesCompleted || index <= currentIndex;
|
|
5173
5291
|
const isActive = !isAllStagesCompleted && index === currentIndex;
|
|
5174
|
-
|
|
5175
|
-
|
|
5292
|
+
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";
|
|
5293
|
+
let stageLabel = stage[dataLabel];
|
|
5294
|
+
if (stage[dataKey] !== activeChildStage?.[dataKey] && activeRootStage?.[dataKey] === stage[dataKey]) {
|
|
5295
|
+
stageLabel = activeChildStage?.[dataLabel] || stageLabel;
|
|
5296
|
+
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";
|
|
5297
|
+
}
|
|
5298
|
+
const stageKey = typeof stage[dataKey] === "string" ? stage[dataKey] : JSON.stringify(stage[dataKey]);
|
|
5299
|
+
return /* @__PURE__ */ jsx61(React11.Fragment, { children: /* @__PURE__ */ jsxs38(Tooltip, { delayDuration: 500, disableHoverableContent: true, children: [
|
|
5300
|
+
/* @__PURE__ */ jsx61(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx61(
|
|
5176
5301
|
"button",
|
|
5177
5302
|
{
|
|
5178
5303
|
className: `
|
|
5179
5304
|
min-w-[70px] sm:min-w-[80px] w-full sm:w-auto px-3 sm:px-4 py-1.5 sm:py-2
|
|
5180
5305
|
rounded-full text-xs sm:text-sm font-medium transition-colors duration-200
|
|
5181
|
-
whitespace-normal sm:whitespace-nowrap flex-shrink-0
|
|
5182
|
-
${isActive ? "bg-green-700 text-white shadow-md" : isCompletedStage ?
|
|
5306
|
+
whitespace-normal sm:whitespace-nowrap flex-shrink-0 max-w-[150px] text-ellipsis overflow-hidden
|
|
5307
|
+
${isActive ? "bg-green-700 text-white shadow-md" : isCompletedStage ? stageColor : "bg-white text-gray-700 hover:bg-gray-100 border border-gray-200"}
|
|
5183
5308
|
${isMobile ? "flex-1 text-center py-2.5" : ""}
|
|
5184
5309
|
`,
|
|
5185
5310
|
onClick: () => {
|
|
5186
5311
|
if (isAllStagesCompleted) return;
|
|
5187
5312
|
onStageClick(stage[dataKey]);
|
|
5188
5313
|
},
|
|
5189
|
-
children:
|
|
5314
|
+
children: stageLabel
|
|
5190
5315
|
}
|
|
5191
|
-
),
|
|
5192
|
-
|
|
5193
|
-
|
|
5316
|
+
) }),
|
|
5317
|
+
/* @__PURE__ */ jsx61(TooltipContent, { className: "max-w-[400px] p-3 text-xs text-muted-foreground space-y-2", children: /* @__PURE__ */ jsx61("span", { children: /* @__PURE__ */ jsx61("b", { children: stageLabel }) }) }),
|
|
5318
|
+
!isMobile && index < stages.length - 1 && /* @__PURE__ */ jsx61("div", { className: "hidden sm:flex sm:flex-shrink-0 w-3 h-px bg-gray-300 sm:w-4" })
|
|
5319
|
+
] }, stageKey) }, stageKey);
|
|
5194
5320
|
})
|
|
5195
5321
|
}
|
|
5196
5322
|
),
|
|
5197
|
-
isShowBtn && /* @__PURE__ */
|
|
5323
|
+
isShowBtn && /* @__PURE__ */ jsx61(
|
|
5198
5324
|
"div",
|
|
5199
5325
|
{
|
|
5200
5326
|
className: `
|
|
5201
5327
|
flex items-center flex-shrink-0 w-full lg:w-auto
|
|
5202
5328
|
${isMobile ? "order-3 mt-3 lg:mt-0" : "order-3"}
|
|
5203
5329
|
`,
|
|
5204
|
-
children: /* @__PURE__ */
|
|
5330
|
+
children: /* @__PURE__ */ jsx61(
|
|
5205
5331
|
"button",
|
|
5206
5332
|
{
|
|
5207
5333
|
className: `
|
|
@@ -5223,23 +5349,23 @@ var StagesComponent = ({
|
|
|
5223
5349
|
var Stages_default = StagesComponent;
|
|
5224
5350
|
|
|
5225
5351
|
// src/components/Navigation/Spacer/Spacer.tsx
|
|
5226
|
-
import { jsx as
|
|
5352
|
+
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
5227
5353
|
var Spacer = ({ className, style }) => {
|
|
5228
|
-
return /* @__PURE__ */
|
|
5354
|
+
return /* @__PURE__ */ jsx62("div", { className: `${className}`, style });
|
|
5229
5355
|
};
|
|
5230
5356
|
var Spacer_default = Spacer;
|
|
5231
5357
|
|
|
5232
5358
|
// src/components/Navigation/Profile/Profile.tsx
|
|
5233
|
-
import { jsx as
|
|
5359
|
+
import { jsx as jsx63, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
5234
5360
|
|
|
5235
5361
|
// src/components/Navigation/Notification/Notification.tsx
|
|
5236
|
-
import { jsx as
|
|
5362
|
+
import { jsx as jsx64, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
5237
5363
|
|
|
5238
5364
|
// src/components/Navigation/Logo/Logo.tsx
|
|
5239
|
-
import { jsx as
|
|
5365
|
+
import { jsx as jsx65 } from "react/jsx-runtime";
|
|
5240
5366
|
|
|
5241
5367
|
// src/components/Navigation/Navbar/Navbar.tsx
|
|
5242
|
-
import { useCallback as
|
|
5368
|
+
import { useCallback as useCallback5, useMemo as useMemo9, useState as useState14, useEffect as useEffect27 } from "react";
|
|
5243
5369
|
import { Bell, Search as Search2, Menu as Menu2 } from "lucide-react";
|
|
5244
5370
|
import Image3 from "next/image";
|
|
5245
5371
|
import Link4 from "next/link";
|
|
@@ -5248,8 +5374,8 @@ import { useRouter as useRouter2 } from "next/navigation";
|
|
|
5248
5374
|
// src/components/ui/avatar.tsx
|
|
5249
5375
|
import * as React12 from "react";
|
|
5250
5376
|
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
5251
|
-
import { jsx as
|
|
5252
|
-
var Avatar = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
5377
|
+
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
5378
|
+
var Avatar = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx66(
|
|
5253
5379
|
AvatarPrimitive.Root,
|
|
5254
5380
|
{
|
|
5255
5381
|
ref,
|
|
@@ -5261,7 +5387,7 @@ var Avatar = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
5261
5387
|
}
|
|
5262
5388
|
));
|
|
5263
5389
|
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
5264
|
-
var AvatarImage = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
5390
|
+
var AvatarImage = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx66(
|
|
5265
5391
|
AvatarPrimitive.Image,
|
|
5266
5392
|
{
|
|
5267
5393
|
ref,
|
|
@@ -5270,7 +5396,7 @@ var AvatarImage = React12.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
5270
5396
|
}
|
|
5271
5397
|
));
|
|
5272
5398
|
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
5273
|
-
var AvatarFallback = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
5399
|
+
var AvatarFallback = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx66(
|
|
5274
5400
|
AvatarPrimitive.Fallback,
|
|
5275
5401
|
{
|
|
5276
5402
|
ref,
|
|
@@ -5284,7 +5410,7 @@ var AvatarFallback = React12.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
5284
5410
|
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
5285
5411
|
|
|
5286
5412
|
// src/components/Navigation/Navbar/Navbar.tsx
|
|
5287
|
-
import { Fragment as Fragment23, jsx as
|
|
5413
|
+
import { Fragment as Fragment23, jsx as jsx67, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
5288
5414
|
function Navbar({
|
|
5289
5415
|
style,
|
|
5290
5416
|
badgeType,
|
|
@@ -5322,7 +5448,7 @@ function Navbar({
|
|
|
5322
5448
|
const isMobile = mode === "mobile";
|
|
5323
5449
|
const isTablet = mode === "tablet";
|
|
5324
5450
|
const isDesktop = mode === "desktop";
|
|
5325
|
-
const handleBuilderExit =
|
|
5451
|
+
const handleBuilderExit = useCallback5(
|
|
5326
5452
|
(e, url) => {
|
|
5327
5453
|
if (isBuilder) {
|
|
5328
5454
|
e.preventDefault();
|
|
@@ -5342,9 +5468,9 @@ function Navbar({
|
|
|
5342
5468
|
}
|
|
5343
5469
|
return list;
|
|
5344
5470
|
}, [source, navList, list]);
|
|
5345
|
-
const RenderSearchInput = () => /* @__PURE__ */
|
|
5346
|
-
/* @__PURE__ */
|
|
5347
|
-
/* @__PURE__ */
|
|
5471
|
+
const RenderSearchInput = () => /* @__PURE__ */ jsx67("div", { className: "flex-1 px-2", children: /* @__PURE__ */ jsxs41("div", { className: "relative w-full max-w-md border border-gray-300 rounded-md", children: [
|
|
5472
|
+
/* @__PURE__ */ jsx67(Search2, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 dark:text-white text-gray-400" }),
|
|
5473
|
+
/* @__PURE__ */ jsx67(
|
|
5348
5474
|
Input,
|
|
5349
5475
|
{
|
|
5350
5476
|
placeholder: "Search",
|
|
@@ -5360,23 +5486,23 @@ function Navbar({
|
|
|
5360
5486
|
}
|
|
5361
5487
|
)
|
|
5362
5488
|
] }) });
|
|
5363
|
-
return /* @__PURE__ */
|
|
5364
|
-
/* @__PURE__ */
|
|
5489
|
+
return /* @__PURE__ */ jsxs41(Fragment23, { children: [
|
|
5490
|
+
/* @__PURE__ */ jsx67(
|
|
5365
5491
|
"nav",
|
|
5366
5492
|
{
|
|
5367
5493
|
className: "w-full min-h-[75px] border-b border-gray-200 dark:border-gray-800 dark:bg-gray-800 bg-white shadow-sm",
|
|
5368
5494
|
style,
|
|
5369
|
-
children: /* @__PURE__ */
|
|
5370
|
-
/* @__PURE__ */
|
|
5495
|
+
children: /* @__PURE__ */ jsxs41("div", { className: "mx-auto flex max-w-[90%] items-center justify-between px-4 py-4", children: [
|
|
5496
|
+
/* @__PURE__ */ jsx67(
|
|
5371
5497
|
Link4,
|
|
5372
5498
|
{
|
|
5373
5499
|
href: "/",
|
|
5374
5500
|
onClick: (e) => handleBuilderExit(e, "/"),
|
|
5375
5501
|
className: "flex items-center space-x-2",
|
|
5376
|
-
children: imageUrl ? /* @__PURE__ */
|
|
5502
|
+
children: imageUrl ? /* @__PURE__ */ jsx67(Image3, { src: imageUrl, alt: altText, width: 180, height: 40 }) : /* @__PURE__ */ jsx67("span", { className: "font-semibold text-blue-700", children: "Logo" })
|
|
5377
5503
|
}
|
|
5378
5504
|
),
|
|
5379
|
-
isDesktop && /* @__PURE__ */
|
|
5505
|
+
isDesktop && /* @__PURE__ */ jsx67("div", { className: "hidden md:flex items-center space-x-6", children: formattedMenu.map((item) => /* @__PURE__ */ jsx67(
|
|
5380
5506
|
Link4,
|
|
5381
5507
|
{
|
|
5382
5508
|
href: item.url,
|
|
@@ -5386,23 +5512,23 @@ function Navbar({
|
|
|
5386
5512
|
},
|
|
5387
5513
|
item.id
|
|
5388
5514
|
)) }),
|
|
5389
|
-
/* @__PURE__ */
|
|
5390
|
-
(isDesktop || isTablet) && /* @__PURE__ */
|
|
5391
|
-
/* @__PURE__ */
|
|
5392
|
-
/* @__PURE__ */
|
|
5393
|
-
badgeType === "number" && !(hideBadgeWhenZero && badgeCount === 0) && Number(badgeCount) > 0 ? /* @__PURE__ */
|
|
5515
|
+
/* @__PURE__ */ jsxs41("div", { className: "flex items-center space-x-3", children: [
|
|
5516
|
+
(isDesktop || isTablet) && /* @__PURE__ */ jsx67(RenderSearchInput, {}),
|
|
5517
|
+
/* @__PURE__ */ jsxs41("div", { className: "relative bg-gray-200 dark:bg-gray-700 rounded-md", children: [
|
|
5518
|
+
/* @__PURE__ */ jsx67(Button, { variant: "ghost", size: "icon", children: /* @__PURE__ */ jsx67(Bell, { className: "h-5 w-5 text-gray-700 dark:text-gray-300" }) }),
|
|
5519
|
+
badgeType === "number" && !(hideBadgeWhenZero && badgeCount === 0) && Number(badgeCount) > 0 ? /* @__PURE__ */ jsx67("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__ */ jsx67("span", { className: "absolute -top-1 -right-1 h-2 w-2 bg-red-500 rounded-full" })
|
|
5394
5520
|
] }),
|
|
5395
|
-
/* @__PURE__ */
|
|
5396
|
-
/* @__PURE__ */
|
|
5397
|
-
!isMobile && showName && /* @__PURE__ */
|
|
5398
|
-
/* @__PURE__ */
|
|
5399
|
-
(isMobile || isTablet) && /* @__PURE__ */
|
|
5521
|
+
/* @__PURE__ */ jsxs41(DropdownMenu, { children: [
|
|
5522
|
+
/* @__PURE__ */ jsx67(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs41("div", { className: "flex items-center space-x-2 cursor-pointer", children: [
|
|
5523
|
+
!isMobile && showName && /* @__PURE__ */ jsx67("h4", { className: "text-gray-900 dark:text-gray-300 text-sm", children: userName }),
|
|
5524
|
+
/* @__PURE__ */ jsx67(Avatar, { className: "h-8 w-8", children: profileType === "avatar" ? /* @__PURE__ */ jsx67(AvatarImage, { src: "/images/appbuilder/toolset/profile.svg", alt: "profile" }) : /* @__PURE__ */ jsx67("div", { className: "bg-green-700 text-white h-full w-full rounded-full flex items-center justify-center text-xs", children: getInitials(userName) }) }),
|
|
5525
|
+
(isMobile || isTablet) && /* @__PURE__ */ jsx67(Button, { variant: "ghost", size: "icon", children: /* @__PURE__ */ jsx67(Menu2, { className: "h-6 w-6" }) })
|
|
5400
5526
|
] }) }),
|
|
5401
|
-
/* @__PURE__ */
|
|
5402
|
-
profileMenu.map((item) => /* @__PURE__ */
|
|
5403
|
-
(isMobile || isTablet) && /* @__PURE__ */
|
|
5404
|
-
/* @__PURE__ */
|
|
5405
|
-
formattedMenu.map((item) => /* @__PURE__ */
|
|
5527
|
+
/* @__PURE__ */ jsxs41(DropdownMenuContent, { align: "end", className: "bg-white dark:bg-gray-800", children: [
|
|
5528
|
+
profileMenu.map((item) => /* @__PURE__ */ jsx67(DropdownMenuItem, { children: /* @__PURE__ */ jsx67(Link4, { href: item.url, onClick: (e) => handleBuilderExit(e, item.url), children: item.header }) }, item.id)),
|
|
5529
|
+
(isMobile || isTablet) && /* @__PURE__ */ jsxs41(Fragment23, { children: [
|
|
5530
|
+
/* @__PURE__ */ jsx67(DropdownMenuSeparator, {}),
|
|
5531
|
+
formattedMenu.map((item) => /* @__PURE__ */ jsx67(DropdownMenuItem, { children: /* @__PURE__ */ jsx67(Link4, { href: item.url, onClick: (e) => handleBuilderExit(e, item.url), children: item.header }) }, item.id))
|
|
5406
5532
|
] })
|
|
5407
5533
|
] })
|
|
5408
5534
|
] })
|
|
@@ -5410,12 +5536,12 @@ function Navbar({
|
|
|
5410
5536
|
] })
|
|
5411
5537
|
}
|
|
5412
5538
|
),
|
|
5413
|
-
isMobile && /* @__PURE__ */
|
|
5539
|
+
isMobile && /* @__PURE__ */ jsx67("div", { className: "p-3", children: /* @__PURE__ */ jsx67(RenderSearchInput, {}) })
|
|
5414
5540
|
] });
|
|
5415
5541
|
}
|
|
5416
5542
|
|
|
5417
5543
|
// src/components/Chart/BarChart.tsx
|
|
5418
|
-
import React13, { useEffect as useEffect28, useMemo as useMemo10, useState as useState15, useCallback as
|
|
5544
|
+
import React13, { useEffect as useEffect28, useMemo as useMemo10, useState as useState15, useCallback as useCallback6 } from "react";
|
|
5419
5545
|
import axios3 from "axios";
|
|
5420
5546
|
import {
|
|
5421
5547
|
BarChart,
|
|
@@ -5425,11 +5551,11 @@ import {
|
|
|
5425
5551
|
XAxis,
|
|
5426
5552
|
YAxis,
|
|
5427
5553
|
CartesianGrid,
|
|
5428
|
-
Tooltip,
|
|
5554
|
+
Tooltip as Tooltip2,
|
|
5429
5555
|
ResponsiveContainer,
|
|
5430
5556
|
Legend
|
|
5431
5557
|
} from "recharts";
|
|
5432
|
-
import { jsx as
|
|
5558
|
+
import { jsx as jsx68, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
5433
5559
|
var getRandomColor = () => {
|
|
5434
5560
|
const palette = [
|
|
5435
5561
|
"#2563eb",
|
|
@@ -5498,7 +5624,7 @@ var ChartComponent = ({
|
|
|
5498
5624
|
setCurrentPage(1);
|
|
5499
5625
|
}
|
|
5500
5626
|
}, [apiUrl]);
|
|
5501
|
-
const fetchData =
|
|
5627
|
+
const fetchData = useCallback6(async (page) => {
|
|
5502
5628
|
if (!apiUrl) return;
|
|
5503
5629
|
const cancelled = false;
|
|
5504
5630
|
try {
|
|
@@ -5556,27 +5682,27 @@ var ChartComponent = ({
|
|
|
5556
5682
|
const chartType = props.chartType || "bar";
|
|
5557
5683
|
const legendsPosition = ["middle", "bottom"].includes(props.legendsPosition) ? props.legendsPosition : "top";
|
|
5558
5684
|
if (effectiveLoading || data.length === 0) {
|
|
5559
|
-
return /* @__PURE__ */
|
|
5685
|
+
return /* @__PURE__ */ jsxs42(
|
|
5560
5686
|
"div",
|
|
5561
5687
|
{
|
|
5562
5688
|
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}`,
|
|
5563
5689
|
style,
|
|
5564
5690
|
children: [
|
|
5565
|
-
/* @__PURE__ */
|
|
5566
|
-
/* @__PURE__ */
|
|
5567
|
-
/* @__PURE__ */
|
|
5691
|
+
/* @__PURE__ */ jsx68("div", { className: "mb-6 flex justify-center", children: /* @__PURE__ */ jsxs42("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: [
|
|
5692
|
+
/* @__PURE__ */ jsx68("div", { className: "w-5 h-5 border-2 border-gray-400 border-t-blue-500 rounded-full animate-spin" }),
|
|
5693
|
+
/* @__PURE__ */ jsx68("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..." })
|
|
5568
5694
|
] }) }),
|
|
5569
|
-
/* @__PURE__ */
|
|
5570
|
-
/* @__PURE__ */
|
|
5695
|
+
/* @__PURE__ */ jsx68("div", { className: "absolute inset-0 bg-gradient-to-r from-transparent via-white/60 to-transparent animate-shimmer rounded-xl" }),
|
|
5696
|
+
/* @__PURE__ */ jsx68("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__ */ jsx68("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) => {
|
|
5571
5697
|
const randomHeight = `${Math.floor(Math.random() * 76) + 20}%`;
|
|
5572
|
-
return /* @__PURE__ */
|
|
5698
|
+
return /* @__PURE__ */ jsxs42(
|
|
5573
5699
|
"div",
|
|
5574
5700
|
{
|
|
5575
5701
|
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`,
|
|
5576
5702
|
style: { height: randomHeight, animationDelay: `${idx * 0.08}s` },
|
|
5577
5703
|
children: [
|
|
5578
|
-
/* @__PURE__ */
|
|
5579
|
-
/* @__PURE__ */
|
|
5704
|
+
/* @__PURE__ */ jsx68("div", { className: "absolute inset-0 bg-gradient-to-r from-white/40 via-transparent to-white/40 animate-shimmer-bar" }),
|
|
5705
|
+
/* @__PURE__ */ jsx68("div", { className: "absolute bottom-1 left-1/2 w-4 h-1 rounded-full transform -translate-x-1/2 blur-sm" })
|
|
5580
5706
|
]
|
|
5581
5707
|
},
|
|
5582
5708
|
`bar-${idx}`
|
|
@@ -5586,9 +5712,9 @@ var ChartComponent = ({
|
|
|
5586
5712
|
}
|
|
5587
5713
|
);
|
|
5588
5714
|
}
|
|
5589
|
-
return /* @__PURE__ */
|
|
5590
|
-
isPaginationEnabled && rawMeta && /* @__PURE__ */
|
|
5591
|
-
/* @__PURE__ */
|
|
5715
|
+
return /* @__PURE__ */ jsxs42("div", { className: `${className} h-[450px]`, style, children: [
|
|
5716
|
+
isPaginationEnabled && rawMeta && /* @__PURE__ */ jsxs42("div", { className: "flex items-center justify-between mb-4 px-2", children: [
|
|
5717
|
+
/* @__PURE__ */ jsxs42("div", { className: "text-sm text-gray-600 hidden sm:block", children: [
|
|
5592
5718
|
"Page ",
|
|
5593
5719
|
rawMeta.page,
|
|
5594
5720
|
" of ",
|
|
@@ -5597,52 +5723,52 @@ var ChartComponent = ({
|
|
|
5597
5723
|
rawMeta.total.toLocaleString(),
|
|
5598
5724
|
" total records)"
|
|
5599
5725
|
] }),
|
|
5600
|
-
/* @__PURE__ */
|
|
5601
|
-
/* @__PURE__ */
|
|
5726
|
+
/* @__PURE__ */ jsxs42("div", { className: "flex items-center space-x-2 sm:hidden w-full justify-center", children: [
|
|
5727
|
+
/* @__PURE__ */ jsx68(
|
|
5602
5728
|
"button",
|
|
5603
5729
|
{
|
|
5604
5730
|
onClick: () => handlePageChange(currentPage - 1),
|
|
5605
5731
|
disabled: currentPage === 1 || localLoading,
|
|
5606
5732
|
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",
|
|
5607
|
-
children: /* @__PURE__ */
|
|
5733
|
+
children: /* @__PURE__ */ jsx68("span", { children: "\u2190 Prev" })
|
|
5608
5734
|
}
|
|
5609
5735
|
),
|
|
5610
|
-
/* @__PURE__ */
|
|
5611
|
-
/* @__PURE__ */
|
|
5736
|
+
/* @__PURE__ */ jsx68("span", { className: "px-2 py-2 text-xs font-semibold text-gray-700 min-w-[36px] text-center flex-shrink-0", children: currentPage }),
|
|
5737
|
+
/* @__PURE__ */ jsx68(
|
|
5612
5738
|
"button",
|
|
5613
5739
|
{
|
|
5614
5740
|
onClick: () => handlePageChange(currentPage + 1),
|
|
5615
5741
|
disabled: currentPage >= rawMeta.pages || localLoading,
|
|
5616
5742
|
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",
|
|
5617
|
-
children: /* @__PURE__ */
|
|
5743
|
+
children: /* @__PURE__ */ jsx68("span", { children: "Next \u2192" })
|
|
5618
5744
|
}
|
|
5619
5745
|
)
|
|
5620
5746
|
] }),
|
|
5621
|
-
/* @__PURE__ */
|
|
5622
|
-
/* @__PURE__ */
|
|
5747
|
+
/* @__PURE__ */ jsxs42("div", { className: "flex items-center space-x-2 hidden sm:flex", children: [
|
|
5748
|
+
/* @__PURE__ */ jsx68(
|
|
5623
5749
|
"button",
|
|
5624
5750
|
{
|
|
5625
5751
|
onClick: () => handlePageChange(currentPage - 1),
|
|
5626
5752
|
disabled: currentPage === 1 || localLoading,
|
|
5627
5753
|
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",
|
|
5628
|
-
children: /* @__PURE__ */
|
|
5754
|
+
children: /* @__PURE__ */ jsx68("span", { children: "\u2190 Prev" })
|
|
5629
5755
|
}
|
|
5630
5756
|
),
|
|
5631
|
-
/* @__PURE__ */
|
|
5632
|
-
/* @__PURE__ */
|
|
5757
|
+
/* @__PURE__ */ jsx68("span", { className: "px-3 py-1 text-sm font-medium text-gray-700", children: currentPage }),
|
|
5758
|
+
/* @__PURE__ */ jsx68(
|
|
5633
5759
|
"button",
|
|
5634
5760
|
{
|
|
5635
5761
|
onClick: () => handlePageChange(currentPage + 1),
|
|
5636
5762
|
disabled: currentPage >= rawMeta.pages || localLoading,
|
|
5637
5763
|
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",
|
|
5638
|
-
children: /* @__PURE__ */
|
|
5764
|
+
children: /* @__PURE__ */ jsx68("span", { children: "Next \u2192" })
|
|
5639
5765
|
}
|
|
5640
5766
|
)
|
|
5641
5767
|
] })
|
|
5642
5768
|
] }),
|
|
5643
|
-
/* @__PURE__ */
|
|
5644
|
-
/* @__PURE__ */
|
|
5645
|
-
/* @__PURE__ */
|
|
5769
|
+
/* @__PURE__ */ jsx68(ResponsiveContainer, { width: "100%", height: "100%", children: chartType === "bar" ? /* @__PURE__ */ jsxs42(BarChart, { data, children: [
|
|
5770
|
+
/* @__PURE__ */ jsx68(CartesianGrid, { strokeDasharray: "3 3" }),
|
|
5771
|
+
/* @__PURE__ */ jsx68(
|
|
5646
5772
|
XAxis,
|
|
5647
5773
|
{
|
|
5648
5774
|
dataKey: dataLabel,
|
|
@@ -5660,7 +5786,7 @@ var ChartComponent = ({
|
|
|
5660
5786
|
className: "hidden sm:block"
|
|
5661
5787
|
}
|
|
5662
5788
|
),
|
|
5663
|
-
/* @__PURE__ */
|
|
5789
|
+
/* @__PURE__ */ jsx68(
|
|
5664
5790
|
YAxis,
|
|
5665
5791
|
{
|
|
5666
5792
|
tickFormatter: (value) => `${(value / 1e3).toFixed(0)}k`,
|
|
@@ -5673,9 +5799,9 @@ var ChartComponent = ({
|
|
|
5673
5799
|
width: 60
|
|
5674
5800
|
}
|
|
5675
5801
|
),
|
|
5676
|
-
/* @__PURE__ */
|
|
5677
|
-
/* @__PURE__ */
|
|
5678
|
-
/* @__PURE__ */
|
|
5802
|
+
/* @__PURE__ */ jsx68(Tooltip2, { formatter: (value) => [`${value}`, "Count"] }),
|
|
5803
|
+
/* @__PURE__ */ jsx68(Legend, { verticalAlign: legendsPosition, align: "center" }),
|
|
5804
|
+
/* @__PURE__ */ jsx68(
|
|
5679
5805
|
Bar,
|
|
5680
5806
|
{
|
|
5681
5807
|
dataKey,
|
|
@@ -5683,13 +5809,13 @@ var ChartComponent = ({
|
|
|
5683
5809
|
isAnimationActive: false
|
|
5684
5810
|
}
|
|
5685
5811
|
)
|
|
5686
|
-
] }) : /* @__PURE__ */
|
|
5687
|
-
/* @__PURE__ */
|
|
5688
|
-
/* @__PURE__ */
|
|
5689
|
-
/* @__PURE__ */
|
|
5812
|
+
] }) : /* @__PURE__ */ jsxs42(AreaChart, { data, children: [
|
|
5813
|
+
/* @__PURE__ */ jsx68("defs", { children: /* @__PURE__ */ jsxs42("linearGradient", { id: "colorCount", x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
5814
|
+
/* @__PURE__ */ jsx68("stop", { offset: "5%", stopColor: "#00695C", stopOpacity: 0.8 }),
|
|
5815
|
+
/* @__PURE__ */ jsx68("stop", { offset: "95%", stopColor: "#00695C", stopOpacity: 0 })
|
|
5690
5816
|
] }) }),
|
|
5691
|
-
/* @__PURE__ */
|
|
5692
|
-
/* @__PURE__ */
|
|
5817
|
+
/* @__PURE__ */ jsx68(CartesianGrid, { strokeDasharray: "3 3" }),
|
|
5818
|
+
/* @__PURE__ */ jsx68(
|
|
5693
5819
|
XAxis,
|
|
5694
5820
|
{
|
|
5695
5821
|
dataKey: dataLabel,
|
|
@@ -5703,7 +5829,7 @@ var ChartComponent = ({
|
|
|
5703
5829
|
}
|
|
5704
5830
|
}
|
|
5705
5831
|
),
|
|
5706
|
-
/* @__PURE__ */
|
|
5832
|
+
/* @__PURE__ */ jsx68(
|
|
5707
5833
|
YAxis,
|
|
5708
5834
|
{
|
|
5709
5835
|
tickFormatter: (value) => `${(value / 1e3).toFixed(0)}k`,
|
|
@@ -5716,8 +5842,8 @@ var ChartComponent = ({
|
|
|
5716
5842
|
width: 60
|
|
5717
5843
|
}
|
|
5718
5844
|
),
|
|
5719
|
-
/* @__PURE__ */
|
|
5720
|
-
/* @__PURE__ */
|
|
5845
|
+
/* @__PURE__ */ jsx68(Tooltip2, { formatter: (value) => `${value}k` }),
|
|
5846
|
+
/* @__PURE__ */ jsx68(
|
|
5721
5847
|
Area,
|
|
5722
5848
|
{
|
|
5723
5849
|
type: "monotone",
|
|
@@ -5741,9 +5867,9 @@ import {
|
|
|
5741
5867
|
Pie,
|
|
5742
5868
|
Cell,
|
|
5743
5869
|
ResponsiveContainer as ResponsiveContainer2,
|
|
5744
|
-
Tooltip as
|
|
5870
|
+
Tooltip as Tooltip3
|
|
5745
5871
|
} from "recharts";
|
|
5746
|
-
import { jsx as
|
|
5872
|
+
import { jsx as jsx69, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
5747
5873
|
var getRandomColor2 = () => {
|
|
5748
5874
|
const palette = [
|
|
5749
5875
|
"#2563eb",
|
|
@@ -5912,32 +6038,32 @@ var DonutChart = ({
|
|
|
5912
6038
|
}, []);
|
|
5913
6039
|
const renderLegends = useMemo11(() => {
|
|
5914
6040
|
if (!showLegends) return null;
|
|
5915
|
-
return /* @__PURE__ */
|
|
6041
|
+
return /* @__PURE__ */ jsx69("div", { className: "flex flex-wrap justify-center gap-2 mt-4 w-full max-w-4xl", children: chartData.map((d, index) => {
|
|
5916
6042
|
const actualValue = data.find(
|
|
5917
6043
|
(item) => item[dataLabel] === d[dataLabel]
|
|
5918
6044
|
)?.[dataKey] ?? d[dataKey];
|
|
5919
6045
|
const displayValue = actualValue >= 1e3 ? `${(actualValue / 1e3).toFixed(0)}k` : actualValue.toLocaleString();
|
|
5920
|
-
return /* @__PURE__ */
|
|
6046
|
+
return /* @__PURE__ */ jsxs43(
|
|
5921
6047
|
"div",
|
|
5922
6048
|
{
|
|
5923
6049
|
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",
|
|
5924
6050
|
children: [
|
|
5925
|
-
/* @__PURE__ */
|
|
6051
|
+
/* @__PURE__ */ jsx69(
|
|
5926
6052
|
"span",
|
|
5927
6053
|
{
|
|
5928
6054
|
className: "inline-block w-[12px] h-[12px] rounded-full shrink-0 border-2 border-white/50",
|
|
5929
6055
|
style: { backgroundColor: d.color }
|
|
5930
6056
|
}
|
|
5931
6057
|
),
|
|
5932
|
-
/* @__PURE__ */
|
|
5933
|
-
/* @__PURE__ */
|
|
5934
|
-
/* @__PURE__ */
|
|
5935
|
-
/* @__PURE__ */
|
|
5936
|
-
/* @__PURE__ */
|
|
6058
|
+
/* @__PURE__ */ jsxs43("div", { className: "min-w-0 flex-1", children: [
|
|
6059
|
+
/* @__PURE__ */ jsx69("span", { className: "text-gray-900 text-[11px] md:text-[13px] font-semibold block truncate leading-tight", children: d[dataLabel] }),
|
|
6060
|
+
/* @__PURE__ */ jsxs43("div", { className: "flex items-center gap-1 text-xs text-gray-600 font-medium", children: [
|
|
6061
|
+
/* @__PURE__ */ jsx69("span", { children: displayValue }),
|
|
6062
|
+
/* @__PURE__ */ jsxs43("span", { children: [
|
|
5937
6063
|
(actualValue / total * 100).toFixed(1),
|
|
5938
6064
|
"%"
|
|
5939
6065
|
] }),
|
|
5940
|
-
d.isBoosted && /* @__PURE__ */
|
|
6066
|
+
d.isBoosted && /* @__PURE__ */ jsx69("span", { className: "text-[9px] px-1 py-0.5 bg-blue-100 text-blue-700 rounded-full", children: "min" })
|
|
5941
6067
|
] })
|
|
5942
6068
|
] })
|
|
5943
6069
|
]
|
|
@@ -5948,26 +6074,26 @@ var DonutChart = ({
|
|
|
5948
6074
|
}, [chartData, data, dataLabel, dataKey, total, showLegends]);
|
|
5949
6075
|
if (!mounted) return null;
|
|
5950
6076
|
if (effectiveLoading || data.length === 0) {
|
|
5951
|
-
return /* @__PURE__ */
|
|
6077
|
+
return /* @__PURE__ */ jsxs43(
|
|
5952
6078
|
"div",
|
|
5953
6079
|
{
|
|
5954
6080
|
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}`,
|
|
5955
6081
|
style,
|
|
5956
6082
|
children: [
|
|
5957
|
-
/* @__PURE__ */
|
|
5958
|
-
/* @__PURE__ */
|
|
5959
|
-
/* @__PURE__ */
|
|
5960
|
-
/* @__PURE__ */
|
|
6083
|
+
/* @__PURE__ */ jsx69("div", { className: "absolute inset-0 bg-gradient-to-r from-transparent via-white/60 to-transparent animate-shimmer rounded-xl" }),
|
|
6084
|
+
/* @__PURE__ */ jsx69("div", { className: "mt-6 text-center", children: /* @__PURE__ */ jsxs43("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: [
|
|
6085
|
+
/* @__PURE__ */ jsx69("div", { className: "w-5 h-5 border-2 border-gray-300 border-t-blue-400 rounded-full animate-spin" }),
|
|
6086
|
+
/* @__PURE__ */ jsx69("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..." })
|
|
5961
6087
|
] }) }),
|
|
5962
|
-
/* @__PURE__ */
|
|
6088
|
+
/* @__PURE__ */ jsx69("div", { className: "flex flex-wrap justify-center gap-3 mt-8 w-full max-w-4xl", children: [...Array(18)].map((_, idx) => /* @__PURE__ */ jsxs43(
|
|
5963
6089
|
"div",
|
|
5964
6090
|
{
|
|
5965
6091
|
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`,
|
|
5966
6092
|
children: [
|
|
5967
|
-
/* @__PURE__ */
|
|
5968
|
-
/* @__PURE__ */
|
|
5969
|
-
/* @__PURE__ */
|
|
5970
|
-
/* @__PURE__ */
|
|
6093
|
+
/* @__PURE__ */ jsx69("div", { className: "w-4 h-4 rounded-full bg-gradient-to-r from-blue-300 to-purple-300 animate-pulse" }),
|
|
6094
|
+
/* @__PURE__ */ jsxs43("div", { className: "flex-1 space-y-1", children: [
|
|
6095
|
+
/* @__PURE__ */ jsx69("div", { className: "h-3 w-20 bg-gray-300 rounded animate-pulse" }),
|
|
6096
|
+
/* @__PURE__ */ jsx69("div", { className: "h-2.5 w-16 bg-gray-200/60 rounded animate-pulse-delayed" })
|
|
5971
6097
|
] })
|
|
5972
6098
|
]
|
|
5973
6099
|
},
|
|
@@ -5980,10 +6106,10 @@ var DonutChart = ({
|
|
|
5980
6106
|
const { inner, outer } = getDynamicRadius();
|
|
5981
6107
|
const innerRadius = inner;
|
|
5982
6108
|
const outerRadius = outer;
|
|
5983
|
-
return /* @__PURE__ */
|
|
5984
|
-
/* @__PURE__ */
|
|
5985
|
-
/* @__PURE__ */
|
|
5986
|
-
/* @__PURE__ */
|
|
6109
|
+
return /* @__PURE__ */ jsxs43("div", { className: `relative flex flex-col items-center ${className}`, style, children: [
|
|
6110
|
+
/* @__PURE__ */ jsxs43("div", { className: "relative w-full md:w-[75%] h-[280px] md:h-[380px] flex items-center justify-center mb-2", children: [
|
|
6111
|
+
/* @__PURE__ */ jsx69(ResponsiveContainer2, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs43(PieChart, { children: [
|
|
6112
|
+
/* @__PURE__ */ jsx69(
|
|
5987
6113
|
Pie,
|
|
5988
6114
|
{
|
|
5989
6115
|
data: chartData,
|
|
@@ -5996,7 +6122,7 @@ var DonutChart = ({
|
|
|
5996
6122
|
isAnimationActive: true,
|
|
5997
6123
|
animationDuration: 800,
|
|
5998
6124
|
minAngle: 3,
|
|
5999
|
-
children: chartData.map((entry, index) => /* @__PURE__ */
|
|
6125
|
+
children: chartData.map((entry, index) => /* @__PURE__ */ jsx69(
|
|
6000
6126
|
Cell,
|
|
6001
6127
|
{
|
|
6002
6128
|
fill: entry.color,
|
|
@@ -6007,8 +6133,8 @@ var DonutChart = ({
|
|
|
6007
6133
|
))
|
|
6008
6134
|
}
|
|
6009
6135
|
),
|
|
6010
|
-
/* @__PURE__ */
|
|
6011
|
-
|
|
6136
|
+
/* @__PURE__ */ jsx69(
|
|
6137
|
+
Tooltip3,
|
|
6012
6138
|
{
|
|
6013
6139
|
formatter: (value, name, payload) => {
|
|
6014
6140
|
const label = payload && payload.payload ? payload.payload[dataLabel] : name;
|
|
@@ -6030,9 +6156,9 @@ var DonutChart = ({
|
|
|
6030
6156
|
}
|
|
6031
6157
|
)
|
|
6032
6158
|
] }) }),
|
|
6033
|
-
total > 0 && /* @__PURE__ */
|
|
6159
|
+
total > 0 && /* @__PURE__ */ jsx69("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__ */ jsxs43("div", { className: "text-[#1f2937] leading-tight", children: [
|
|
6034
6160
|
formattedTotal,
|
|
6035
|
-
/* @__PURE__ */
|
|
6161
|
+
/* @__PURE__ */ jsx69("span", { className: "text-sm md:text-base font-normal text-gray-600 block md:inline-block md:ml-1", children: "total" })
|
|
6036
6162
|
] }) })
|
|
6037
6163
|
] }),
|
|
6038
6164
|
renderLegends
|
|
@@ -6041,10 +6167,10 @@ var DonutChart = ({
|
|
|
6041
6167
|
var PieChart_default = React14.memo(DonutChart);
|
|
6042
6168
|
|
|
6043
6169
|
// src/components/Blocks/EmailComposer.tsx
|
|
6044
|
-
import { jsx as
|
|
6170
|
+
import { jsx as jsx70, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
6045
6171
|
function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc, setShowBcc, cc, setCc, bcc, setBcc, subject, setSubject, body, setBody }) {
|
|
6046
|
-
return /* @__PURE__ */
|
|
6047
|
-
/* @__PURE__ */
|
|
6172
|
+
return /* @__PURE__ */ jsx70("div", { className, style, children: /* @__PURE__ */ jsxs44("div", { className: "border rounded-md shadow bg-[#fff] p-4 mx-auto z-[50] relative", children: [
|
|
6173
|
+
/* @__PURE__ */ jsx70("div", { className: "mb-3", children: /* @__PURE__ */ jsx70(
|
|
6048
6174
|
"input",
|
|
6049
6175
|
{
|
|
6050
6176
|
type: "email",
|
|
@@ -6053,8 +6179,8 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
6053
6179
|
required: true
|
|
6054
6180
|
}
|
|
6055
6181
|
) }),
|
|
6056
|
-
/* @__PURE__ */
|
|
6057
|
-
/* @__PURE__ */
|
|
6182
|
+
/* @__PURE__ */ jsx70("div", { className: "mb-3", children: /* @__PURE__ */ jsxs44("div", { className: "flex items-center gap-2", children: [
|
|
6183
|
+
/* @__PURE__ */ jsx70(
|
|
6058
6184
|
"input",
|
|
6059
6185
|
{
|
|
6060
6186
|
type: "email",
|
|
@@ -6065,7 +6191,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
6065
6191
|
required: true
|
|
6066
6192
|
}
|
|
6067
6193
|
),
|
|
6068
|
-
!showCc && /* @__PURE__ */
|
|
6194
|
+
!showCc && /* @__PURE__ */ jsx70(
|
|
6069
6195
|
"button",
|
|
6070
6196
|
{
|
|
6071
6197
|
onClick: () => setShowCc?.(true),
|
|
@@ -6073,7 +6199,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
6073
6199
|
children: "Cc"
|
|
6074
6200
|
}
|
|
6075
6201
|
),
|
|
6076
|
-
!showBcc && /* @__PURE__ */
|
|
6202
|
+
!showBcc && /* @__PURE__ */ jsx70(
|
|
6077
6203
|
"button",
|
|
6078
6204
|
{
|
|
6079
6205
|
onClick: () => setShowBcc?.(true),
|
|
@@ -6082,7 +6208,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
6082
6208
|
}
|
|
6083
6209
|
)
|
|
6084
6210
|
] }) }),
|
|
6085
|
-
showCc && /* @__PURE__ */
|
|
6211
|
+
showCc && /* @__PURE__ */ jsx70("div", { className: "mb-3", children: /* @__PURE__ */ jsx70(
|
|
6086
6212
|
"input",
|
|
6087
6213
|
{
|
|
6088
6214
|
type: "text",
|
|
@@ -6092,7 +6218,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
6092
6218
|
className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
|
|
6093
6219
|
}
|
|
6094
6220
|
) }),
|
|
6095
|
-
showBcc && /* @__PURE__ */
|
|
6221
|
+
showBcc && /* @__PURE__ */ jsx70("div", { className: "mb-3", children: /* @__PURE__ */ jsx70(
|
|
6096
6222
|
"input",
|
|
6097
6223
|
{
|
|
6098
6224
|
type: "text",
|
|
@@ -6102,7 +6228,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
6102
6228
|
className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
|
|
6103
6229
|
}
|
|
6104
6230
|
) }),
|
|
6105
|
-
/* @__PURE__ */
|
|
6231
|
+
/* @__PURE__ */ jsx70("div", { className: "mb-3", children: /* @__PURE__ */ jsx70(
|
|
6106
6232
|
"input",
|
|
6107
6233
|
{
|
|
6108
6234
|
type: "text",
|
|
@@ -6112,11 +6238,11 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
6112
6238
|
className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
|
|
6113
6239
|
}
|
|
6114
6240
|
) }),
|
|
6115
|
-
/* @__PURE__ */
|
|
6116
|
-
/* @__PURE__ */
|
|
6117
|
-
/* @__PURE__ */
|
|
6118
|
-
/* @__PURE__ */
|
|
6119
|
-
/* @__PURE__ */
|
|
6241
|
+
/* @__PURE__ */ jsx70("div", { className: "mb-4", children: /* @__PURE__ */ jsx70(MyEditor, { value: body, onChange: setBody }) }),
|
|
6242
|
+
/* @__PURE__ */ jsxs44("div", { className: "flex justify-end gap-2", children: [
|
|
6243
|
+
/* @__PURE__ */ jsx70("button", { className: "px-4 py-2 rounded-md text-gray-600 hover:bg-gray-100", children: "Discard" }),
|
|
6244
|
+
/* @__PURE__ */ jsx70("button", { className: "px-4 py-2 rounded-md border text-[#12715B] border-[#12715B]", children: "Reset" }),
|
|
6245
|
+
/* @__PURE__ */ jsx70("button", { className: "px-4 py-2 rounded-md bg-[#12715B] text-white", children: "Send" })
|
|
6120
6246
|
] })
|
|
6121
6247
|
] }) });
|
|
6122
6248
|
}
|
|
@@ -6124,10 +6250,10 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
6124
6250
|
// src/components/ui/sonner.tsx
|
|
6125
6251
|
import { useTheme } from "next-themes";
|
|
6126
6252
|
import { Toaster as Sonner } from "sonner";
|
|
6127
|
-
import { jsx as
|
|
6253
|
+
import { jsx as jsx71 } from "react/jsx-runtime";
|
|
6128
6254
|
var Toaster = ({ ...props }) => {
|
|
6129
6255
|
const { theme = "system" } = useTheme();
|
|
6130
|
-
return /* @__PURE__ */
|
|
6256
|
+
return /* @__PURE__ */ jsx71(
|
|
6131
6257
|
Sonner,
|
|
6132
6258
|
{
|
|
6133
6259
|
theme,
|