@algorithm-shift/design-system 1.2.90 → 1.2.92

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.js CHANGED
@@ -27775,7 +27775,8 @@ function useLazyDropdown(config) {
27775
27775
  const limit = PAGE_SIZE;
27776
27776
  const params = { page: pageNum, limit };
27777
27777
  if (term) params[configRef.current.dataLabel ?? "search"] = term;
27778
- const res = await import_axios.default.get(configRef.current.apiUrl, {
27778
+ const axiosClient = configRef.current.axiosInstance ?? import_axios.default;
27779
+ const res = await axiosClient.get(configRef.current.apiUrl, {
27779
27780
  params,
27780
27781
  withCredentials: true
27781
27782
  });
@@ -27823,7 +27824,8 @@ function useLazyDropdown(config) {
27823
27824
  if (!configRef.current.apiUrl) return [];
27824
27825
  try {
27825
27826
  setLoading(true);
27826
- const res = await import_axios.default.get(configRef.current.apiUrl, {
27827
+ const axiosClient = configRef.current.axiosInstance ?? import_axios.default;
27828
+ const res = await axiosClient.get(configRef.current.apiUrl, {
27827
27829
  params: { [configRef.current.dataKey]: configRef.current.value },
27828
27830
  withCredentials: true
27829
27831
  });
@@ -27899,7 +27901,8 @@ function LazySelectDropdown({
27899
27901
  pageSize,
27900
27902
  dataKey = "id",
27901
27903
  dataLabel = "name",
27902
- errorMessage
27904
+ errorMessage,
27905
+ axiosInstance
27903
27906
  }) {
27904
27907
  const [isOpen, setIsOpen] = (0, import_react20.useState)(false);
27905
27908
  const [searchTerm, setSearchTerm] = (0, import_react20.useState)("");
@@ -27921,7 +27924,8 @@ function LazySelectDropdown({
27921
27924
  dataKey,
27922
27925
  dataLabel,
27923
27926
  initialData: options || [],
27924
- value
27927
+ value,
27928
+ axiosInstance
27925
27929
  });
27926
27930
  const selectedOption = lazyOptions.find((opt) => opt.value === value);
27927
27931
  (0, import_react20.useEffect)(() => {
@@ -29010,7 +29014,7 @@ var MultiSelect = ({
29010
29014
  var MultiSelect_default = MultiSelect;
29011
29015
 
29012
29016
  // src/components/ui/data-table.tsx
29013
- var React9 = __toESM(require("react"));
29017
+ var React10 = __toESM(require("react"));
29014
29018
  var import_free_solid_svg_icons2 = require("@fortawesome/free-solid-svg-icons");
29015
29019
  var import_react_fontawesome3 = require("@fortawesome/react-fontawesome");
29016
29020
  var import_react_table2 = require("@tanstack/react-table");
@@ -29104,6 +29108,7 @@ function TableCell({ className, ...props }) {
29104
29108
  var import_react_table = require("@tanstack/react-table");
29105
29109
 
29106
29110
  // src/lib/table/cellRendererFactory.tsx
29111
+ var import_react29 = __toESM(require("react"));
29107
29112
  var import_image3 = __toESM(require("next/image"));
29108
29113
 
29109
29114
  // src/lib/dayjs-setup.ts
@@ -29184,6 +29189,22 @@ var getContrastColor = (bg) => {
29184
29189
  const brightness = (r * 299 + g * 587 + b * 114) / 1e3;
29185
29190
  return brightness > 160 ? "#000000" : "#FFFFFF";
29186
29191
  };
29192
+ var sanitizeValue = (val) => {
29193
+ if (val == null) return null;
29194
+ if (import_react29.default.isValidElement(val)) return val;
29195
+ if (typeof val === "string" || typeof val === "number") return val;
29196
+ if (Array.isArray(val)) return val.map((v, i) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react29.default.Fragment, { children: sanitizeValue(v) }, i));
29197
+ if (typeof val === "object") {
29198
+ if ("name" in val && typeof val.name === "string") return val.name;
29199
+ if ("label" in val && typeof val.label === "string") return val.label;
29200
+ try {
29201
+ return JSON.stringify(val);
29202
+ } catch {
29203
+ return "[object]";
29204
+ }
29205
+ }
29206
+ return String(val);
29207
+ };
29187
29208
  var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers = {}, format2, customFormatters = {}) => {
29188
29209
  const formattedValue = valueFormatter(value, format2, customFormatters);
29189
29210
  switch (renderer) {
@@ -29335,13 +29356,15 @@ var useDynamicColumns = (config, customRenderers = {}, customFormatters = {}) =>
29335
29356
  return config.columns.map((col) => {
29336
29357
  const accessorKey = col.accessorKey ?? col.id;
29337
29358
  const accessorFn = (row) => {
29359
+ if (!row) return null;
29338
29360
  if (Object.prototype.hasOwnProperty.call(row, accessorKey)) {
29339
- return row[accessorKey];
29361
+ return sanitizeValue(row[accessorKey]);
29340
29362
  }
29341
29363
  if (accessorKey.includes(".")) {
29342
- return getValueByPath(row, accessorKey);
29364
+ const val = getValueByPath(row, accessorKey);
29365
+ return sanitizeValue(val);
29343
29366
  }
29344
- return row[accessorKey];
29367
+ return sanitizeValue(row[accessorKey]);
29345
29368
  };
29346
29369
  return columnHelper.accessor(accessorFn, {
29347
29370
  id: col.id ?? accessorKey,
@@ -29386,13 +29409,13 @@ function DataTable({
29386
29409
  onDeleteRow,
29387
29410
  rowActions
29388
29411
  }) {
29389
- const [columnFilters, setColumnFilters] = React9.useState([]);
29390
- const [columnVisibility, setColumnVisibility] = React9.useState({});
29391
- const [manualSort, setManualSort] = React9.useState(null);
29392
- const [searchTerm, setSearchTerm] = React9.useState("");
29412
+ const [columnFilters, setColumnFilters] = React10.useState([]);
29413
+ const [columnVisibility, setColumnVisibility] = React10.useState({});
29414
+ const [manualSort, setManualSort] = React10.useState(null);
29415
+ const [searchTerm, setSearchTerm] = React10.useState("");
29393
29416
  const dynamicCols = useDynamicColumns({ columns });
29394
29417
  const table = (0, import_react_table2.useReactTable)({
29395
- data,
29418
+ data: data ?? [],
29396
29419
  columns: dynamicCols,
29397
29420
  state: {
29398
29421
  columnFilters,
@@ -29605,7 +29628,7 @@ function DataTable({
29605
29628
  return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
29606
29629
  TableCell,
29607
29630
  {
29608
- className: `${meta?.cellClass ?? ""} ${isClickable ? "cursor-pointer hover:bg-gray-100" : ""} relative`,
29631
+ className: `${meta?.cellClass ?? ""} ${isClickable ? "cursor-pointer hover:bg-gray-100 underline text-blue-500" : ""} relative`,
29609
29632
  style: meta?.cellStyle,
29610
29633
  onClick: () => {
29611
29634
  if (isClickable && onCellClick) {
@@ -29949,11 +29972,12 @@ var CustomPagination = ({
29949
29972
  var Pagination_default = CustomPagination;
29950
29973
 
29951
29974
  // src/components/Navigation/Tabs/Tabs.tsx
29952
- var import_react29 = require("react");
29975
+ var import_react30 = require("react");
29953
29976
  var import_link5 = __toESM(require("next/link"));
29954
29977
  var import_navigation3 = require("next/navigation");
29955
29978
  var import_jsx_runtime57 = require("react/jsx-runtime");
29956
29979
  var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuilder = false, source, parentKey, menuNameKey, menuUrlKey, loading }) => {
29980
+ const [openIndex, setOpenIndex] = (0, import_react30.useState)(null);
29957
29981
  function groupMenus(menus = []) {
29958
29982
  const menuMap = /* @__PURE__ */ new Map();
29959
29983
  menus.forEach((menu) => {
@@ -29986,7 +30010,7 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
29986
30010
  });
29987
30011
  return sortMenus(rootMenus);
29988
30012
  }
29989
- const rawTabs = (0, import_react29.useMemo)(() => {
30013
+ const rawTabs = (0, import_react30.useMemo)(() => {
29990
30014
  if (!Array.isArray(tabs)) return [];
29991
30015
  if (source === "manual") return Array.isArray(tabs) ? tabs : [];
29992
30016
  return groupMenus(tabs);
@@ -29999,9 +30023,9 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
29999
30023
  return pathname === path || path !== "/" && pathname?.startsWith(path);
30000
30024
  };
30001
30025
  const router = (0, import_navigation3.useRouter)();
30002
- const [showExitDialog, setShowExitDialog] = (0, import_react29.useState)(false);
30003
- const [pendingUrl, setPendingUrl] = (0, import_react29.useState)(null);
30004
- const handleBuilderExit = (0, import_react29.useCallback)(
30026
+ const [showExitDialog, setShowExitDialog] = (0, import_react30.useState)(false);
30027
+ const [pendingUrl, setPendingUrl] = (0, import_react30.useState)(null);
30028
+ const handleBuilderExit = (0, import_react30.useCallback)(
30005
30029
  (e, url) => {
30006
30030
  if (isBuilder) {
30007
30031
  e.preventDefault();
@@ -30017,40 +30041,69 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
30017
30041
  router.push(pendingUrl);
30018
30042
  }
30019
30043
  };
30044
+ let timeout;
30020
30045
  const renderDesktopTab = (tab, index) => {
30021
30046
  const finalClasses = [baseClasses, isActive(tab.url) ? activeClasses : hoverClasses, tab.className || ""].join(" ");
30022
30047
  if (Array.isArray(tab.children) && tab.children.length > 0 && tab.isDropDown) {
30023
- return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(DropdownMenu, { children: [
30024
- /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(DropdownMenuTrigger, { className: `${finalClasses} inline-flex items-center gap-1`, children: [
30025
- tab.header,
30026
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(ChevronDown, { className: "h-4 w-4 opacity-80" })
30027
- ] }),
30028
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
30029
- DropdownMenuContent,
30030
- {
30031
- align: "start",
30032
- sideOffset: 6,
30033
- className: "z-50 min-w-[160px] rounded-md border border-gray-200 bg-white p-1 shadow-lg",
30034
- children: tab.children.map((item, index2) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
30035
- DropdownMenuItem,
30048
+ return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
30049
+ DropdownMenu,
30050
+ {
30051
+ open: openIndex === index,
30052
+ onOpenChange: (open) => setOpenIndex(open ? index : null),
30053
+ children: [
30054
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
30055
+ DropdownMenuTrigger,
30036
30056
  {
30037
- asChild: true,
30038
- className: "cursor-pointer rounded-sm px-3 py-2 text-[12px] text-gray-800 hover:bg-gray-100 focus:bg-gray-100",
30039
- children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
30040
- import_link5.default,
30057
+ className: `${finalClasses} inline-flex items-center gap-1`,
30058
+ onMouseEnter: () => {
30059
+ clearTimeout(timeout);
30060
+ setOpenIndex(index);
30061
+ },
30062
+ onMouseLeave: () => {
30063
+ timeout = setTimeout(() => setOpenIndex(null), 150);
30064
+ },
30065
+ children: [
30066
+ tab.header,
30067
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(ChevronDown, { className: "h-4 w-4 opacity-80" })
30068
+ ]
30069
+ }
30070
+ ),
30071
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
30072
+ DropdownMenuContent,
30073
+ {
30074
+ align: "start",
30075
+ sideOffset: 6,
30076
+ className: "z-50 min-w-[200px] max-h-80 rounded-md border border-gray-200 bg-white p-1 shadow-lg",
30077
+ onMouseEnter: () => {
30078
+ clearTimeout(timeout);
30079
+ setOpenIndex(index);
30080
+ },
30081
+ onMouseLeave: () => {
30082
+ timeout = setTimeout(() => setOpenIndex(null), 150);
30083
+ },
30084
+ children: tab.children.map((item, index2) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
30085
+ DropdownMenuItem,
30041
30086
  {
30042
- href: item.url || "#",
30043
- target: item.opens_in_new_tab ? "_blank" : "_self",
30044
- onClick: (e) => handleBuilderExit(e, item.url || "#"),
30045
- children: item.header
30046
- }
30047
- )
30048
- },
30049
- item.id || index2
30050
- ))
30051
- }
30052
- )
30053
- ] }, index);
30087
+ asChild: true,
30088
+ className: "cursor-pointer rounded-sm px-3 py-2 text-[12px] text-gray-800 hover:bg-gray-100 focus:bg-gray-100",
30089
+ children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
30090
+ import_link5.default,
30091
+ {
30092
+ href: item.url || "#",
30093
+ target: item.opens_in_new_tab ? "_blank" : "_self",
30094
+ onClick: (e) => handleBuilderExit(e, item.url || "#"),
30095
+ children: item.header
30096
+ }
30097
+ )
30098
+ },
30099
+ item.id || index2
30100
+ ))
30101
+ }
30102
+ )
30103
+ ]
30104
+ },
30105
+ index
30106
+ );
30054
30107
  }
30055
30108
  return tab.url ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
30056
30109
  import_link5.default,
@@ -30108,7 +30161,7 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
30108
30161
  const forceMobile = canvasMode ? canvasMode === "mobile" || canvasMode === "tablet" : void 0;
30109
30162
  const forceDesktop = canvasMode ? canvasMode === "desktop" : void 0;
30110
30163
  return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
30111
- /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className, style, children: [
30164
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: cn("min-h-10", className), style, children: [
30112
30165
  forceDesktop !== void 0 ? forceDesktop && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "hidden md:flex", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "hidden md:flex", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }),
30113
30166
  forceMobile !== void 0 ? forceMobile && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { children: renderMobileMenu() }) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "flex md:hidden", children: renderMobileMenu() })
30114
30167
  ] }),
@@ -30127,10 +30180,10 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
30127
30180
  var Tabs_default = Tabs;
30128
30181
 
30129
30182
  // src/components/Navigation/Stages/Stages.tsx
30130
- var import_react30 = __toESM(require("react"));
30183
+ var import_react31 = __toESM(require("react"));
30131
30184
  var import_jsx_runtime58 = require("react/jsx-runtime");
30132
30185
  var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStageChange, currentStage, dataKey = "key", dataLabel = "header", loading }) => {
30133
- const [activeStage, setActiveStage] = (0, import_react30.useState)(currentStage || (stages && stages.length > 0 ? stages[0].key : null));
30186
+ const [activeStage, setActiveStage] = (0, import_react31.useState)(currentStage || (stages && stages.length > 0 ? stages[0].key : null));
30134
30187
  const nextStage = () => {
30135
30188
  if (!stages || stages.length === 0) return;
30136
30189
  const currentIndex = stages.findIndex((stage) => stage[dataKey] === activeStage);
@@ -30162,7 +30215,7 @@ var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStag
30162
30215
  const currentIndex = stages.findIndex((s) => s[dataKey] === activeStage);
30163
30216
  const isCompleted = isAllStagesCompleted || index < currentIndex;
30164
30217
  const isActive = !isAllStagesCompleted && index === currentIndex;
30165
- return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_react30.default.Fragment, { children: [
30218
+ return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_react31.default.Fragment, { children: [
30166
30219
  /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
30167
30220
  "button",
30168
30221
  {
@@ -30210,10 +30263,10 @@ var import_jsx_runtime61 = require("react/jsx-runtime");
30210
30263
  var import_jsx_runtime62 = require("react/jsx-runtime");
30211
30264
 
30212
30265
  // src/components/ui/avatar.tsx
30213
- var React11 = __toESM(require("react"));
30266
+ var React12 = __toESM(require("react"));
30214
30267
  var AvatarPrimitive = __toESM(require("@radix-ui/react-avatar"));
30215
30268
  var import_jsx_runtime63 = require("react/jsx-runtime");
30216
- var Avatar = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
30269
+ var Avatar = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
30217
30270
  AvatarPrimitive.Root,
30218
30271
  {
30219
30272
  ref,
@@ -30225,7 +30278,7 @@ var Avatar = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
30225
30278
  }
30226
30279
  ));
30227
30280
  Avatar.displayName = AvatarPrimitive.Root.displayName;
30228
- var AvatarImage = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
30281
+ var AvatarImage = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
30229
30282
  AvatarPrimitive.Image,
30230
30283
  {
30231
30284
  ref,
@@ -30234,7 +30287,7 @@ var AvatarImage = React11.forwardRef(({ className, ...props }, ref) => /* @__PUR
30234
30287
  }
30235
30288
  ));
30236
30289
  AvatarImage.displayName = AvatarPrimitive.Image.displayName;
30237
- var AvatarFallback = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
30290
+ var AvatarFallback = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
30238
30291
  AvatarPrimitive.Fallback,
30239
30292
  {
30240
30293
  ref,
@@ -30252,7 +30305,7 @@ var import_link6 = __toESM(require("next/link"));
30252
30305
  var import_image4 = __toESM(require("next/image"));
30253
30306
  var import_navigation4 = require("next/navigation");
30254
30307
  var import_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
30255
- var import_react31 = require("react");
30308
+ var import_react32 = require("react");
30256
30309
  var import_jsx_runtime64 = require("react/jsx-runtime");
30257
30310
  function Navbar({
30258
30311
  style,
@@ -30273,9 +30326,9 @@ function Navbar({
30273
30326
  }) {
30274
30327
  const isMobileView = canvasMode === "mobile" || canvasMode === "tablet";
30275
30328
  const router = (0, import_navigation4.useRouter)();
30276
- const [showExitDialog, setShowExitDialog] = (0, import_react31.useState)(false);
30277
- const [pendingUrl, setPendingUrl] = (0, import_react31.useState)(null);
30278
- const handleBuilderExit = (0, import_react31.useCallback)(
30329
+ const [showExitDialog, setShowExitDialog] = (0, import_react32.useState)(false);
30330
+ const [pendingUrl, setPendingUrl] = (0, import_react32.useState)(null);
30331
+ const handleBuilderExit = (0, import_react32.useCallback)(
30279
30332
  (e, url) => {
30280
30333
  if (isBuilder) {
30281
30334
  e.preventDefault();
@@ -30291,7 +30344,7 @@ function Navbar({
30291
30344
  router.push(pendingUrl);
30292
30345
  }
30293
30346
  };
30294
- const formatedMenu = (0, import_react31.useMemo)(() => {
30347
+ const formatedMenu = (0, import_react32.useMemo)(() => {
30295
30348
  if (source === "state" && navList && navList.length) {
30296
30349
  return navList.map((i) => ({ ...i, header: i.name || "Menu" }));
30297
30350
  }
@@ -30394,7 +30447,7 @@ function Navbar({
30394
30447
  }
30395
30448
 
30396
30449
  // src/components/Chart/BarChart.tsx
30397
- var import_react32 = __toESM(require("react"));
30450
+ var import_react33 = __toESM(require("react"));
30398
30451
  var import_recharts = require("recharts");
30399
30452
  var import_jsx_runtime65 = require("react/jsx-runtime");
30400
30453
  var ChartComponent = ({ className, style, loading, ...props }) => {
@@ -30455,10 +30508,10 @@ var ChartComponent = ({ className, style, loading, ...props }) => {
30455
30508
  )
30456
30509
  ] }) }) });
30457
30510
  };
30458
- var BarChart_default = import_react32.default.memo(ChartComponent);
30511
+ var BarChart_default = import_react33.default.memo(ChartComponent);
30459
30512
 
30460
30513
  // src/components/Chart/PieChart.tsx
30461
- var import_react33 = __toESM(require("react"));
30514
+ var import_react34 = __toESM(require("react"));
30462
30515
  var import_recharts2 = require("recharts");
30463
30516
  var import_jsx_runtime66 = require("react/jsx-runtime");
30464
30517
  var getRandomColor = () => {
@@ -30480,18 +30533,18 @@ var DonutChart = ({ className, style, loading, ...props }) => {
30480
30533
  const showLegends = props.showLegends ?? true;
30481
30534
  const labelType = props.labelType || "inside";
30482
30535
  const canvasMode = props.canvasMode;
30483
- const data = (0, import_react33.useMemo)(() => {
30536
+ const data = (0, import_react34.useMemo)(() => {
30484
30537
  if (!Array.isArray(props.data)) return [];
30485
30538
  return props.data.map((item) => ({ ...item, color: getRandomColor() }));
30486
30539
  }, [props.data]);
30487
- const total = (0, import_react33.useMemo)(() => data.reduce((sum, d) => sum + d.value, 0), [data]);
30540
+ const total = (0, import_react34.useMemo)(() => data.reduce((sum, d) => sum + d.value, 0), [data]);
30488
30541
  const forceMobile = canvasMode === "mobile" || canvasMode === "tablet";
30489
- const [mounted, setMounted] = (0, import_react33.useState)(false);
30490
- (0, import_react33.useEffect)(() => {
30542
+ const [mounted, setMounted] = (0, import_react34.useState)(false);
30543
+ (0, import_react34.useEffect)(() => {
30491
30544
  const timeout = setTimeout(() => setMounted(true), 100);
30492
30545
  return () => clearTimeout(timeout);
30493
30546
  }, []);
30494
- const renderLegends = (0, import_react33.useMemo)(() => {
30547
+ const renderLegends = (0, import_react34.useMemo)(() => {
30495
30548
  if (!showLegends) return null;
30496
30549
  return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_jsx_runtime66.Fragment, { children: data.map((d) => /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
30497
30550
  "div",
@@ -30579,7 +30632,7 @@ var DonutChart = ({ className, style, loading, ...props }) => {
30579
30632
  }
30580
30633
  );
30581
30634
  };
30582
- var PieChart_default = import_react33.default.memo(DonutChart);
30635
+ var PieChart_default = import_react34.default.memo(DonutChart);
30583
30636
 
30584
30637
  // src/components/Blocks/EmailComposer.tsx
30585
30638
  var import_jsx_runtime67 = require("react/jsx-runtime");