@algorithm-shift/design-system 1.2.62 → 1.2.63
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 +78 -18
- package/dist/index.css.map +1 -1
- package/dist/index.js +292 -159
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +325 -189
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -28237,13 +28237,16 @@ var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
|
|
|
28237
28237
|
};
|
|
28238
28238
|
var TextInputGroup_default = TextInputGroup;
|
|
28239
28239
|
|
|
28240
|
-
// src/components/DataDisplay/Table/Table.tsx
|
|
28241
|
-
import { useState as useState3, useEffect as useEffect21 } from "react";
|
|
28242
|
-
|
|
28243
28240
|
// src/components/ui/data-table.tsx
|
|
28241
|
+
import * as React6 from "react";
|
|
28242
|
+
import { faEllipsisH } from "@fortawesome/free-solid-svg-icons";
|
|
28243
|
+
import { FontAwesomeIcon as FontAwesomeIcon2 } from "@fortawesome/react-fontawesome";
|
|
28244
28244
|
import {
|
|
28245
28245
|
flexRender,
|
|
28246
28246
|
getCoreRowModel,
|
|
28247
|
+
getPaginationRowModel,
|
|
28248
|
+
getSortedRowModel,
|
|
28249
|
+
getFilteredRowModel,
|
|
28247
28250
|
useReactTable
|
|
28248
28251
|
} from "@tanstack/react-table";
|
|
28249
28252
|
|
|
@@ -28336,72 +28339,277 @@ function TableCell({ className, ...props }) {
|
|
|
28336
28339
|
import { Fragment as Fragment17, jsx as jsx47, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
28337
28340
|
function DataTable({
|
|
28338
28341
|
columns,
|
|
28339
|
-
rowActions,
|
|
28340
28342
|
data,
|
|
28341
28343
|
loading,
|
|
28342
|
-
|
|
28343
|
-
|
|
28344
|
-
|
|
28344
|
+
pagination = false,
|
|
28345
|
+
controlledPageIndex,
|
|
28346
|
+
onPageChange,
|
|
28347
|
+
pageSize = 10,
|
|
28348
|
+
paginationMode = "client",
|
|
28349
|
+
totalRecords = 0
|
|
28345
28350
|
}) {
|
|
28351
|
+
const [sorting, setSorting] = React6.useState([]);
|
|
28352
|
+
const [columnFilters, setColumnFilters] = React6.useState([]);
|
|
28353
|
+
const [columnVisibility, setColumnVisibility] = React6.useState({});
|
|
28346
28354
|
const table = useReactTable({
|
|
28347
28355
|
data,
|
|
28348
28356
|
columns,
|
|
28349
|
-
|
|
28350
|
-
|
|
28351
|
-
|
|
28352
|
-
|
|
28353
|
-
|
|
28354
|
-
|
|
28357
|
+
state: {
|
|
28358
|
+
sorting,
|
|
28359
|
+
columnFilters,
|
|
28360
|
+
columnVisibility,
|
|
28361
|
+
pagination: {
|
|
28362
|
+
pageIndex: controlledPageIndex ?? 0,
|
|
28363
|
+
pageSize
|
|
28364
|
+
}
|
|
28365
|
+
},
|
|
28366
|
+
onSortingChange: setSorting,
|
|
28367
|
+
onColumnFiltersChange: setColumnFilters,
|
|
28368
|
+
onColumnVisibilityChange: setColumnVisibility,
|
|
28369
|
+
getCoreRowModel: getCoreRowModel(),
|
|
28370
|
+
getSortedRowModel: getSortedRowModel(),
|
|
28371
|
+
getFilteredRowModel: getFilteredRowModel(),
|
|
28372
|
+
getPaginationRowModel: pagination && paginationMode === "client" ? getPaginationRowModel() : void 0,
|
|
28373
|
+
manualPagination: paginationMode === "server",
|
|
28374
|
+
pageCount: paginationMode === "server" ? Math.ceil(totalRecords / pageSize) : void 0,
|
|
28375
|
+
onPaginationChange: (updater) => {
|
|
28376
|
+
const prev = table.getState().pagination;
|
|
28377
|
+
const next = typeof updater === "function" ? updater(prev) : updater;
|
|
28378
|
+
onPageChange?.(next.pageIndex, next.pageSize);
|
|
28379
|
+
}
|
|
28355
28380
|
});
|
|
28356
|
-
const
|
|
28357
|
-
if (
|
|
28358
|
-
|
|
28381
|
+
const getPageNumbers = (currentPage, totalPages, maxVisiblePages = 5) => {
|
|
28382
|
+
if (totalPages <= maxVisiblePages) {
|
|
28383
|
+
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
28384
|
+
}
|
|
28385
|
+
const leftSiblingIndex = Math.max(currentPage - 1, 1);
|
|
28386
|
+
const rightSiblingIndex = Math.min(currentPage + 1, totalPages);
|
|
28387
|
+
const shouldShowLeftDots = leftSiblingIndex > 2;
|
|
28388
|
+
const shouldShowRightDots = rightSiblingIndex < totalPages - 1;
|
|
28389
|
+
if (!shouldShowLeftDots && shouldShowRightDots) {
|
|
28390
|
+
return [1, 2, 3, "...", totalPages];
|
|
28391
|
+
}
|
|
28392
|
+
if (shouldShowLeftDots && !shouldShowRightDots) {
|
|
28393
|
+
return [1, "...", totalPages - 2, totalPages - 1, totalPages];
|
|
28394
|
+
}
|
|
28395
|
+
if (shouldShowLeftDots && shouldShowRightDots) {
|
|
28396
|
+
return [1, "...", currentPage - 1, currentPage, currentPage + 1, "...", totalPages];
|
|
28359
28397
|
}
|
|
28398
|
+
return [];
|
|
28360
28399
|
};
|
|
28361
|
-
return /* @__PURE__ */
|
|
28362
|
-
/* @__PURE__ */ jsx47(
|
|
28363
|
-
|
|
28364
|
-
|
|
28365
|
-
|
|
28366
|
-
|
|
28367
|
-
|
|
28368
|
-
|
|
28369
|
-
|
|
28370
|
-
|
|
28371
|
-
|
|
28372
|
-
|
|
28373
|
-
children:
|
|
28374
|
-
|
|
28375
|
-
|
|
28376
|
-
|
|
28377
|
-
|
|
28378
|
-
|
|
28379
|
-
|
|
28400
|
+
return /* @__PURE__ */ jsxs26("div", { className: "overflow-hidden rounded-md border w-full", children: [
|
|
28401
|
+
/* @__PURE__ */ jsx47("div", { className: "flex justify-end p-2", children: /* @__PURE__ */ jsxs26(Popover, { children: [
|
|
28402
|
+
/* @__PURE__ */ jsx47(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx47(
|
|
28403
|
+
Button,
|
|
28404
|
+
{
|
|
28405
|
+
variant: "outline",
|
|
28406
|
+
size: "sm",
|
|
28407
|
+
className: "px-3 py-1 text-xs cursor-pointer",
|
|
28408
|
+
children: "Manage Columns"
|
|
28409
|
+
}
|
|
28410
|
+
) }),
|
|
28411
|
+
/* @__PURE__ */ jsxs26(PopoverContent, { align: "end", className: "w-48 p-3 space-y-2", children: [
|
|
28412
|
+
/* @__PURE__ */ jsx47("div", { className: "text-sm font-medium mb-2", children: "Show / Hide Columns" }),
|
|
28413
|
+
/* @__PURE__ */ jsxs26("label", { className: "flex items-center gap-2 text-sm font-semibold border-b pb-2 mb-2", children: [
|
|
28414
|
+
/* @__PURE__ */ jsx47(
|
|
28415
|
+
"input",
|
|
28416
|
+
{
|
|
28417
|
+
type: "checkbox",
|
|
28418
|
+
checked: table.getAllLeafColumns().every((col) => col.getIsVisible()),
|
|
28419
|
+
ref: (input) => {
|
|
28420
|
+
if (input) {
|
|
28421
|
+
input.indeterminate = table.getAllLeafColumns().some((col) => col.getIsVisible()) && !table.getAllLeafColumns().every((col) => col.getIsVisible());
|
|
28422
|
+
}
|
|
28423
|
+
},
|
|
28424
|
+
onChange: (e) => {
|
|
28425
|
+
table.getAllLeafColumns().forEach(
|
|
28426
|
+
(col) => col.toggleVisibility(e.target.checked)
|
|
28427
|
+
);
|
|
28428
|
+
}
|
|
28429
|
+
}
|
|
28430
|
+
),
|
|
28431
|
+
"Toggle All"
|
|
28432
|
+
] }),
|
|
28433
|
+
table.getAllLeafColumns().map((column) => /* @__PURE__ */ jsxs26("label", { className: "flex items-center gap-2 text-sm", children: [
|
|
28434
|
+
/* @__PURE__ */ jsx47(
|
|
28435
|
+
"input",
|
|
28436
|
+
{
|
|
28437
|
+
type: "checkbox",
|
|
28438
|
+
checked: column.getIsVisible(),
|
|
28439
|
+
onChange: (e) => column.toggleVisibility(e.target.checked)
|
|
28440
|
+
}
|
|
28441
|
+
),
|
|
28442
|
+
column.columnDef.header?.toString() ?? column.id
|
|
28443
|
+
] }, column.id))
|
|
28444
|
+
] })
|
|
28445
|
+
] }) }),
|
|
28446
|
+
/* @__PURE__ */ jsxs26(Table3, { children: [
|
|
28447
|
+
/* @__PURE__ */ jsx47(TableHeader, { children: table.getHeaderGroups().map((hg) => /* @__PURE__ */ jsx47(TableRow, { children: hg.headers.map((header) => {
|
|
28448
|
+
const canSort = header.column.getCanSort();
|
|
28449
|
+
const canFilter = header.column.getCanFilter();
|
|
28450
|
+
return /* @__PURE__ */ jsx47(TableHead, { className: "relative select-none", children: /* @__PURE__ */ jsxs26("div", { className: "flex items-center justify-between", children: [
|
|
28451
|
+
/* @__PURE__ */ jsxs26(
|
|
28452
|
+
"span",
|
|
28453
|
+
{
|
|
28454
|
+
className: `flex items-center gap-1 ${canSort ? "cursor-pointer" : ""}`,
|
|
28455
|
+
onClick: canSort ? header.column.getToggleSortingHandler() : void 0,
|
|
28456
|
+
children: [
|
|
28457
|
+
flexRender(header.column.columnDef.header, header.getContext()),
|
|
28458
|
+
canSort && /* @__PURE__ */ jsxs26(Fragment17, { children: [
|
|
28459
|
+
header.column.getIsSorted() === "asc" && /* @__PURE__ */ jsx47(ArrowUp, { size: 14, className: "text-gray-500" }),
|
|
28460
|
+
header.column.getIsSorted() === "desc" && /* @__PURE__ */ jsx47(ArrowDown, { size: 14, className: "text-gray-500" }),
|
|
28461
|
+
!header.column.getIsSorted() && /* @__PURE__ */ jsx47(ArrowUpDown, { size: 14, className: "text-gray-400" })
|
|
28462
|
+
] })
|
|
28463
|
+
]
|
|
28464
|
+
}
|
|
28465
|
+
),
|
|
28466
|
+
canFilter && /* @__PURE__ */ jsxs26(Popover, { children: [
|
|
28467
|
+
/* @__PURE__ */ jsx47(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx47(
|
|
28468
|
+
"span",
|
|
28469
|
+
{
|
|
28470
|
+
role: "presentation",
|
|
28471
|
+
className: "pl-5 cursor-pointer",
|
|
28472
|
+
onClick: (e) => e.stopPropagation(),
|
|
28473
|
+
children: /* @__PURE__ */ jsx47(FontAwesomeIcon2, { icon: faEllipsisH, className: "w-5 h-5 text-gray-500" })
|
|
28474
|
+
}
|
|
28475
|
+
) }),
|
|
28476
|
+
/* @__PURE__ */ jsx47(
|
|
28477
|
+
PopoverContent,
|
|
28380
28478
|
{
|
|
28381
|
-
|
|
28382
|
-
|
|
28383
|
-
|
|
28384
|
-
|
|
28385
|
-
|
|
28479
|
+
align: "start",
|
|
28480
|
+
sideOffset: 4,
|
|
28481
|
+
className: "w-50 p-3 z-[200] border-gray-300",
|
|
28482
|
+
avoidCollisions: true,
|
|
28483
|
+
children: /* @__PURE__ */ jsxs26(
|
|
28484
|
+
"form",
|
|
28485
|
+
{
|
|
28486
|
+
onSubmit: (e) => {
|
|
28487
|
+
e.preventDefault();
|
|
28488
|
+
const formData = new FormData(e.currentTarget);
|
|
28489
|
+
const value = formData.get("filter");
|
|
28490
|
+
header.column.setFilterValue(value || void 0);
|
|
28491
|
+
},
|
|
28492
|
+
className: "space-y-2",
|
|
28493
|
+
children: [
|
|
28494
|
+
/* @__PURE__ */ jsx47("label", { htmlFor: "filter", className: "text-xs text-gray-500 font-normal", children: "Filter by value:" }),
|
|
28495
|
+
/* @__PURE__ */ jsx47(
|
|
28496
|
+
"input",
|
|
28497
|
+
{
|
|
28498
|
+
name: "filter",
|
|
28499
|
+
placeholder: "Search",
|
|
28500
|
+
defaultValue: header.column.getFilterValue() ?? "",
|
|
28501
|
+
className: "border-gray-300 border-1 block p-3 rounded-md text-xs w-full h-9 focus:ring-0 focus:border-gray-300 focus-visible:ring-0 focus-visible:border-gray-300 focus-visible:outline-none mt-2 font-normal",
|
|
28502
|
+
autoComplete: "off"
|
|
28503
|
+
}
|
|
28504
|
+
),
|
|
28505
|
+
/* @__PURE__ */ jsx47("div", { className: "justify-end flex", children: /* @__PURE__ */ jsx47(
|
|
28506
|
+
Button,
|
|
28507
|
+
{
|
|
28508
|
+
type: "submit",
|
|
28509
|
+
className: "py-2 px-3 bg-[#12715B] text-white text-xs h-auto cursor-pointer",
|
|
28510
|
+
children: "Apply"
|
|
28511
|
+
}
|
|
28512
|
+
) })
|
|
28513
|
+
]
|
|
28386
28514
|
}
|
|
28387
|
-
|
|
28388
|
-
|
|
28389
|
-
|
|
28390
|
-
|
|
28391
|
-
|
|
28392
|
-
|
|
28393
|
-
|
|
28394
|
-
|
|
28395
|
-
|
|
28396
|
-
|
|
28397
|
-
|
|
28398
|
-
|
|
28515
|
+
)
|
|
28516
|
+
}
|
|
28517
|
+
)
|
|
28518
|
+
] })
|
|
28519
|
+
] }) }, header.id);
|
|
28520
|
+
}) }, hg.id)) }),
|
|
28521
|
+
/* @__PURE__ */ jsx47(TableBody, { children: loading ? /* @__PURE__ */ jsx47(TableRow, { children: /* @__PURE__ */ jsx47(TableCell, { colSpan: columns.length, className: "h-24 text-center", children: "Loading..." }) }) : table.getRowModel().rows.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx47(TableRow, { children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx47(TableCell, { children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id)) }, row.id)) : /* @__PURE__ */ jsx47(TableRow, { children: /* @__PURE__ */ jsx47(TableCell, { colSpan: columns.length, className: "h-24 text-center", children: "No results." }) }) })
|
|
28522
|
+
] }),
|
|
28523
|
+
pagination && /* @__PURE__ */ jsxs26("div", { className: "flex items-center justify-between py-3 px-2 text-sm w-full", children: [
|
|
28524
|
+
/* @__PURE__ */ jsxs26("div", { children: [
|
|
28525
|
+
"Page ",
|
|
28526
|
+
table.getState().pagination.pageIndex + 1,
|
|
28527
|
+
" of ",
|
|
28528
|
+
table.getPageCount()
|
|
28529
|
+
] }),
|
|
28530
|
+
/* @__PURE__ */ jsxs26("div", { className: "flex items-center gap-2", children: [
|
|
28531
|
+
/* @__PURE__ */ jsx47(
|
|
28532
|
+
"button",
|
|
28533
|
+
{
|
|
28534
|
+
onClick: () => table.previousPage(),
|
|
28535
|
+
disabled: !table.getCanPreviousPage?.(),
|
|
28536
|
+
className: "px-2 py-1 border rounded disabled:opacity-50 cursor-pointer",
|
|
28537
|
+
children: "Prev"
|
|
28538
|
+
}
|
|
28539
|
+
),
|
|
28540
|
+
getPageNumbers(
|
|
28541
|
+
table.getState().pagination.pageIndex + 1,
|
|
28542
|
+
table.getPageCount(),
|
|
28543
|
+
5
|
|
28544
|
+
).map((pageNum, index) => /* @__PURE__ */ jsx47(
|
|
28545
|
+
"button",
|
|
28546
|
+
{
|
|
28547
|
+
disabled: pageNum === "...",
|
|
28548
|
+
onClick: () => typeof pageNum === "number" && table.setPageIndex(pageNum - 1),
|
|
28549
|
+
className: `px-2 py-1 border rounded ${table.getState().pagination.pageIndex + 1 === pageNum ? "bg-[#12715B] text-white" : "bg-white"} ${pageNum === "..." ? "cursor-default" : "cursor-pointer"}`,
|
|
28550
|
+
children: pageNum
|
|
28551
|
+
},
|
|
28552
|
+
index
|
|
28553
|
+
)),
|
|
28554
|
+
/* @__PURE__ */ jsx47(
|
|
28555
|
+
"button",
|
|
28556
|
+
{
|
|
28557
|
+
onClick: () => table.nextPage(),
|
|
28558
|
+
disabled: !table.getCanNextPage?.(),
|
|
28559
|
+
className: "px-2 py-1 border rounded disabled:opacity-50 cursor-pointer",
|
|
28560
|
+
children: "Next"
|
|
28561
|
+
}
|
|
28562
|
+
)
|
|
28563
|
+
] })
|
|
28564
|
+
] })
|
|
28565
|
+
] });
|
|
28399
28566
|
}
|
|
28400
28567
|
|
|
28568
|
+
// src/components/DataDisplay/Table/Table.tsx
|
|
28569
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
28570
|
+
var Table4 = ({
|
|
28571
|
+
columns,
|
|
28572
|
+
data,
|
|
28573
|
+
rowActions,
|
|
28574
|
+
className,
|
|
28575
|
+
style,
|
|
28576
|
+
pagination = false,
|
|
28577
|
+
paginationMode = "client",
|
|
28578
|
+
itemsPerPage = 10,
|
|
28579
|
+
onPageChange,
|
|
28580
|
+
page,
|
|
28581
|
+
loading = false,
|
|
28582
|
+
totalRecords = 0,
|
|
28583
|
+
...props
|
|
28584
|
+
}) => {
|
|
28585
|
+
const rawColumns = Array.isArray(columns) ? columns : [];
|
|
28586
|
+
const rawData = Array.isArray(data) ? data : [];
|
|
28587
|
+
const isControlled = typeof page === "number";
|
|
28588
|
+
return /* @__PURE__ */ jsx48("div", { className: `${className || ""} space-y-3`, style, children: /* @__PURE__ */ jsx48(
|
|
28589
|
+
DataTable,
|
|
28590
|
+
{
|
|
28591
|
+
...props,
|
|
28592
|
+
columns: rawColumns,
|
|
28593
|
+
data: rawData,
|
|
28594
|
+
rowActions,
|
|
28595
|
+
loading,
|
|
28596
|
+
pagination,
|
|
28597
|
+
pageSize: itemsPerPage,
|
|
28598
|
+
controlledPageIndex: isControlled ? page - 1 : void 0,
|
|
28599
|
+
onPageChange: (pageIndex, pageSize) => {
|
|
28600
|
+
onPageChange?.({ page: pageIndex + 1, itemsPerPage: pageSize });
|
|
28601
|
+
},
|
|
28602
|
+
paginationMode,
|
|
28603
|
+
totalRecords
|
|
28604
|
+
}
|
|
28605
|
+
) });
|
|
28606
|
+
};
|
|
28607
|
+
var Table_default = Table4;
|
|
28608
|
+
|
|
28401
28609
|
// src/components/ui/pagination.tsx
|
|
28402
|
-
import { jsx as
|
|
28610
|
+
import { jsx as jsx49, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
28403
28611
|
function Pagination({ className, ...props }) {
|
|
28404
|
-
return /* @__PURE__ */
|
|
28612
|
+
return /* @__PURE__ */ jsx49(
|
|
28405
28613
|
"nav",
|
|
28406
28614
|
{
|
|
28407
28615
|
role: "navigation",
|
|
@@ -28416,7 +28624,7 @@ function PaginationContent({
|
|
|
28416
28624
|
className,
|
|
28417
28625
|
...props
|
|
28418
28626
|
}) {
|
|
28419
|
-
return /* @__PURE__ */
|
|
28627
|
+
return /* @__PURE__ */ jsx49(
|
|
28420
28628
|
"ul",
|
|
28421
28629
|
{
|
|
28422
28630
|
"data-slot": "pagination-content",
|
|
@@ -28426,7 +28634,7 @@ function PaginationContent({
|
|
|
28426
28634
|
);
|
|
28427
28635
|
}
|
|
28428
28636
|
function PaginationItem({ ...props }) {
|
|
28429
|
-
return /* @__PURE__ */
|
|
28637
|
+
return /* @__PURE__ */ jsx49("li", { "data-slot": "pagination-item", ...props });
|
|
28430
28638
|
}
|
|
28431
28639
|
function PaginationLink({
|
|
28432
28640
|
className,
|
|
@@ -28434,7 +28642,7 @@ function PaginationLink({
|
|
|
28434
28642
|
size = "icon",
|
|
28435
28643
|
...props
|
|
28436
28644
|
}) {
|
|
28437
|
-
return /* @__PURE__ */
|
|
28645
|
+
return /* @__PURE__ */ jsx49(
|
|
28438
28646
|
"a",
|
|
28439
28647
|
{
|
|
28440
28648
|
"aria-current": isActive ? "page" : void 0,
|
|
@@ -28463,8 +28671,8 @@ function PaginationPrevious({
|
|
|
28463
28671
|
className: cn("gap-1 px-2.5 sm:pl-2.5", className),
|
|
28464
28672
|
...props,
|
|
28465
28673
|
children: [
|
|
28466
|
-
/* @__PURE__ */
|
|
28467
|
-
/* @__PURE__ */
|
|
28674
|
+
/* @__PURE__ */ jsx49(ChevronLeft, {}),
|
|
28675
|
+
/* @__PURE__ */ jsx49("span", { className: "hidden sm:block", children: "Previous" })
|
|
28468
28676
|
]
|
|
28469
28677
|
}
|
|
28470
28678
|
);
|
|
@@ -28481,8 +28689,8 @@ function PaginationNext({
|
|
|
28481
28689
|
className: cn("gap-1 px-2.5 sm:pr-2.5", className),
|
|
28482
28690
|
...props,
|
|
28483
28691
|
children: [
|
|
28484
|
-
/* @__PURE__ */
|
|
28485
|
-
/* @__PURE__ */
|
|
28692
|
+
/* @__PURE__ */ jsx49("span", { className: "hidden sm:block", children: "Next" }),
|
|
28693
|
+
/* @__PURE__ */ jsx49(ChevronRight, {})
|
|
28486
28694
|
]
|
|
28487
28695
|
}
|
|
28488
28696
|
);
|
|
@@ -28499,15 +28707,15 @@ function PaginationEllipsis({
|
|
|
28499
28707
|
className: cn("flex size-9 items-center justify-center", className),
|
|
28500
28708
|
...props,
|
|
28501
28709
|
children: [
|
|
28502
|
-
/* @__PURE__ */
|
|
28503
|
-
/* @__PURE__ */
|
|
28710
|
+
/* @__PURE__ */ jsx49(Ellipsis, { className: "size-4" }),
|
|
28711
|
+
/* @__PURE__ */ jsx49("span", { className: "sr-only", children: "More pages" })
|
|
28504
28712
|
]
|
|
28505
28713
|
}
|
|
28506
28714
|
);
|
|
28507
28715
|
}
|
|
28508
28716
|
|
|
28509
28717
|
// src/components/DataDisplay/Pagination/Pagination.tsx
|
|
28510
|
-
import { jsx as
|
|
28718
|
+
import { jsx as jsx50, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
28511
28719
|
var CustomPagination = ({
|
|
28512
28720
|
totalPages,
|
|
28513
28721
|
currentPage,
|
|
@@ -28555,7 +28763,7 @@ var CustomPagination = ({
|
|
|
28555
28763
|
const pageNumbers = getPageNumbers();
|
|
28556
28764
|
return /* @__PURE__ */ jsxs28("div", { className: "flex flex-row gap-1 w-full items-center justify-between", children: [
|
|
28557
28765
|
/* @__PURE__ */ jsxs28("div", { className: "flex items-center gap-2", children: [
|
|
28558
|
-
/* @__PURE__ */
|
|
28766
|
+
/* @__PURE__ */ jsx50("p", { className: "text-sm text-muted-foreground whitespace-nowrap", children: "Items per page:" }),
|
|
28559
28767
|
/* @__PURE__ */ jsxs28(
|
|
28560
28768
|
Select,
|
|
28561
28769
|
{
|
|
@@ -28564,26 +28772,26 @@ var CustomPagination = ({
|
|
|
28564
28772
|
onPageChange({ page: 1, itemsPerPage: Number(value) });
|
|
28565
28773
|
},
|
|
28566
28774
|
children: [
|
|
28567
|
-
/* @__PURE__ */
|
|
28775
|
+
/* @__PURE__ */ jsx50(SelectTrigger, { className: "w-[100px]", children: /* @__PURE__ */ jsx50(SelectValue, { placeholder: "Select" }) }),
|
|
28568
28776
|
/* @__PURE__ */ jsxs28(SelectContent, { children: [
|
|
28569
|
-
/* @__PURE__ */
|
|
28570
|
-
/* @__PURE__ */
|
|
28571
|
-
/* @__PURE__ */
|
|
28572
|
-
/* @__PURE__ */
|
|
28777
|
+
/* @__PURE__ */ jsx50(SelectItem, { value: "5", children: "5" }),
|
|
28778
|
+
/* @__PURE__ */ jsx50(SelectItem, { value: "10", children: "10" }),
|
|
28779
|
+
/* @__PURE__ */ jsx50(SelectItem, { value: "20", children: "20" }),
|
|
28780
|
+
/* @__PURE__ */ jsx50(SelectItem, { value: "50", children: "50" })
|
|
28573
28781
|
] })
|
|
28574
28782
|
]
|
|
28575
28783
|
}
|
|
28576
28784
|
)
|
|
28577
28785
|
] }),
|
|
28578
|
-
/* @__PURE__ */
|
|
28579
|
-
/* @__PURE__ */
|
|
28786
|
+
/* @__PURE__ */ jsx50(Pagination, { className: "justify-end", children: /* @__PURE__ */ jsxs28(PaginationContent, { children: [
|
|
28787
|
+
/* @__PURE__ */ jsx50(PaginationItem, { children: /* @__PURE__ */ jsx50(
|
|
28580
28788
|
PaginationPrevious,
|
|
28581
28789
|
{
|
|
28582
28790
|
onClick: () => handlePageChange(currentPage - 1),
|
|
28583
28791
|
className: currentPage === 1 ? "pointer-events-none opacity-50" : "cursor-pointer"
|
|
28584
28792
|
}
|
|
28585
28793
|
) }),
|
|
28586
|
-
pageNumbers.map((pageNumber, index) => /* @__PURE__ */
|
|
28794
|
+
pageNumbers.map((pageNumber, index) => /* @__PURE__ */ jsx50(PaginationItem, { children: pageNumber === "..." ? /* @__PURE__ */ jsx50(PaginationEllipsis, {}) : /* @__PURE__ */ jsx50(
|
|
28587
28795
|
PaginationLink,
|
|
28588
28796
|
{
|
|
28589
28797
|
onClick: () => handlePageChange(pageNumber),
|
|
@@ -28592,7 +28800,7 @@ var CustomPagination = ({
|
|
|
28592
28800
|
children: pageNumber
|
|
28593
28801
|
}
|
|
28594
28802
|
) }, index)),
|
|
28595
|
-
/* @__PURE__ */
|
|
28803
|
+
/* @__PURE__ */ jsx50(PaginationItem, { children: /* @__PURE__ */ jsx50(
|
|
28596
28804
|
PaginationNext,
|
|
28597
28805
|
{
|
|
28598
28806
|
onClick: () => handlePageChange(currentPage + 1),
|
|
@@ -28604,81 +28812,9 @@ var CustomPagination = ({
|
|
|
28604
28812
|
};
|
|
28605
28813
|
var Pagination_default = CustomPagination;
|
|
28606
28814
|
|
|
28607
|
-
// src/components/DataDisplay/Table/Table.tsx
|
|
28608
|
-
import { jsx as jsx50, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
28609
|
-
var Table4 = ({
|
|
28610
|
-
columns,
|
|
28611
|
-
data,
|
|
28612
|
-
rowActions,
|
|
28613
|
-
className,
|
|
28614
|
-
style,
|
|
28615
|
-
pagination = false,
|
|
28616
|
-
paginationMode = "client",
|
|
28617
|
-
itemsPerPage = 10,
|
|
28618
|
-
onPageChange,
|
|
28619
|
-
page,
|
|
28620
|
-
loading = false,
|
|
28621
|
-
totalRecords = 0,
|
|
28622
|
-
...props
|
|
28623
|
-
}) => {
|
|
28624
|
-
const rawColumns = Array.isArray(columns) ? columns : [];
|
|
28625
|
-
const rawData = Array.isArray(data) ? data : [];
|
|
28626
|
-
const rawRowActions = Array.isArray(rowActions) ? rowActions : [];
|
|
28627
|
-
const isControlled = typeof page === "number";
|
|
28628
|
-
const [internalPage, setInternalPage] = useState3(1);
|
|
28629
|
-
const currentPage = isControlled ? page : internalPage;
|
|
28630
|
-
useEffect21(() => {
|
|
28631
|
-
if (isControlled) return;
|
|
28632
|
-
if (currentPage > 1 && !pagination) setInternalPage(1);
|
|
28633
|
-
}, [pagination, isControlled]);
|
|
28634
|
-
const enablePagination = pagination && (paginationMode === "server" ? totalRecords > itemsPerPage : rawData.length > itemsPerPage);
|
|
28635
|
-
const handlePageChange = (options) => {
|
|
28636
|
-
if (!isControlled) setInternalPage(options.page);
|
|
28637
|
-
onPageChange?.(options);
|
|
28638
|
-
};
|
|
28639
|
-
const paginatedData = !enablePagination ? rawData : paginationMode === "server" ? rawData : rawData.slice(
|
|
28640
|
-
(currentPage - 1) * itemsPerPage,
|
|
28641
|
-
currentPage * itemsPerPage
|
|
28642
|
-
);
|
|
28643
|
-
const totalPages = enablePagination ? Math.max(
|
|
28644
|
-
1,
|
|
28645
|
-
Math.ceil(
|
|
28646
|
-
(paginationMode === "server" ? totalRecords : rawData.length) / itemsPerPage
|
|
28647
|
-
)
|
|
28648
|
-
) : 1;
|
|
28649
|
-
const isCellClickEnabled = (row, id) => {
|
|
28650
|
-
const selectedColumn = (columns || [])?.find((col) => col.accessorKey === id);
|
|
28651
|
-
if (!selectedColumn) return false;
|
|
28652
|
-
return selectedColumn.isClickable ?? false;
|
|
28653
|
-
};
|
|
28654
|
-
return /* @__PURE__ */ jsxs29("div", { className: `${className || ""} space-y-3`, style, children: [
|
|
28655
|
-
/* @__PURE__ */ jsx50(
|
|
28656
|
-
DataTable,
|
|
28657
|
-
{
|
|
28658
|
-
...props,
|
|
28659
|
-
columns: rawColumns,
|
|
28660
|
-
data: paginatedData,
|
|
28661
|
-
rowActions: rawRowActions,
|
|
28662
|
-
loading,
|
|
28663
|
-
cellClickEnabled: isCellClickEnabled
|
|
28664
|
-
}
|
|
28665
|
-
),
|
|
28666
|
-
enablePagination && /* @__PURE__ */ jsx50(
|
|
28667
|
-
Pagination_default,
|
|
28668
|
-
{
|
|
28669
|
-
perPage: itemsPerPage,
|
|
28670
|
-
totalPages,
|
|
28671
|
-
currentPage,
|
|
28672
|
-
onPageChange: handlePageChange
|
|
28673
|
-
}
|
|
28674
|
-
)
|
|
28675
|
-
] });
|
|
28676
|
-
};
|
|
28677
|
-
var Table_default = Table4;
|
|
28678
|
-
|
|
28679
28815
|
// src/components/Navigation/Tabs/Tabs.tsx
|
|
28680
28816
|
import Link5 from "next/link";
|
|
28681
|
-
import { jsx as jsx51, jsxs as
|
|
28817
|
+
import { jsx as jsx51, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
28682
28818
|
var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode }) => {
|
|
28683
28819
|
const rawTabs = Array.isArray(tabs) ? tabs : [];
|
|
28684
28820
|
const baseClasses = "text-[12px] text-foreground p-2 text-center rounded-md transition-colors";
|
|
@@ -28691,8 +28827,8 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode }) => {
|
|
|
28691
28827
|
const renderDesktopTab = (tab, index) => {
|
|
28692
28828
|
const finalClasses = [baseClasses, isActive(tab.url) ? activeClasses : hoverClasses, tab.className || ""].join(" ");
|
|
28693
28829
|
if (Array.isArray(tab.children) && tab.children.length > 0 && tab.isDropDown) {
|
|
28694
|
-
return /* @__PURE__ */
|
|
28695
|
-
/* @__PURE__ */
|
|
28830
|
+
return /* @__PURE__ */ jsxs29(DropdownMenu, { children: [
|
|
28831
|
+
/* @__PURE__ */ jsxs29(DropdownMenuTrigger, { className: `${finalClasses} inline-flex items-center gap-1`, children: [
|
|
28696
28832
|
tab.header,
|
|
28697
28833
|
/* @__PURE__ */ jsx51(ChevronDown, { className: "h-4 w-4 opacity-80" })
|
|
28698
28834
|
] }),
|
|
@@ -28717,8 +28853,8 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode }) => {
|
|
|
28717
28853
|
}
|
|
28718
28854
|
return tab.url ? /* @__PURE__ */ jsx51(Link5, { href: tab.url, className: finalClasses, style: tab.style, children: tab.header }, index) : /* @__PURE__ */ jsx51("div", { className: finalClasses, style: tab.style, role: "button", tabIndex: 0, children: tab.header }, index);
|
|
28719
28855
|
};
|
|
28720
|
-
const renderMobileMenu = () => /* @__PURE__ */
|
|
28721
|
-
/* @__PURE__ */
|
|
28856
|
+
const renderMobileMenu = () => /* @__PURE__ */ jsxs29(DropdownMenu, { children: [
|
|
28857
|
+
/* @__PURE__ */ jsxs29(DropdownMenuTrigger, { className: "flex items-center gap-2 px-3 py-2 rounded-md bg-white/10 text-white text-sm", children: [
|
|
28722
28858
|
/* @__PURE__ */ jsx51(Menu, { className: "h-4 w-4" }),
|
|
28723
28859
|
"Menu"
|
|
28724
28860
|
] }),
|
|
@@ -28731,7 +28867,7 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode }) => {
|
|
|
28731
28867
|
children: rawTabs.map((tab, i) => {
|
|
28732
28868
|
const hasChildren = Array.isArray(tab.children) && tab.children.length > 0 && tab.isDropDown;
|
|
28733
28869
|
if (hasChildren) {
|
|
28734
|
-
return /* @__PURE__ */
|
|
28870
|
+
return /* @__PURE__ */ jsxs29(DropdownMenuSub, { children: [
|
|
28735
28871
|
/* @__PURE__ */ jsx51(DropdownMenuSubTrigger, { className: "flex items-center justify-between cursor-pointer rounded-sm px-3 py-2 text-[13px] text-foreground hover:text-foreground", children: tab.header }),
|
|
28736
28872
|
/* @__PURE__ */ jsx51(DropdownMenuSubContent, { className: "bg-white border shadow-lg rounded-md p-1", children: tab.children.map((item) => /* @__PURE__ */ jsx51(
|
|
28737
28873
|
DropdownMenuItem,
|
|
@@ -28759,7 +28895,7 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode }) => {
|
|
|
28759
28895
|
] });
|
|
28760
28896
|
const forceMobile = canvasMode ? canvasMode === "mobile" || canvasMode === "tablet" : void 0;
|
|
28761
28897
|
const forceDesktop = canvasMode ? canvasMode === "desktop" : void 0;
|
|
28762
|
-
return /* @__PURE__ */
|
|
28898
|
+
return /* @__PURE__ */ jsxs29("div", { className, style, children: [
|
|
28763
28899
|
forceDesktop !== void 0 ? forceDesktop && /* @__PURE__ */ jsx51("div", { className: "hidden md:flex", children: /* @__PURE__ */ jsx51("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }) : /* @__PURE__ */ jsx51("div", { className: "hidden md:flex", children: /* @__PURE__ */ jsx51("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }),
|
|
28764
28900
|
forceMobile !== void 0 ? forceMobile && /* @__PURE__ */ jsx51("div", { children: renderMobileMenu() }) : /* @__PURE__ */ jsx51("div", { className: "flex md:hidden", children: renderMobileMenu() })
|
|
28765
28901
|
] });
|
|
@@ -28767,12 +28903,12 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode }) => {
|
|
|
28767
28903
|
var Tabs_default = Tabs;
|
|
28768
28904
|
|
|
28769
28905
|
// src/components/Navigation/Stages/Stages.tsx
|
|
28770
|
-
import
|
|
28771
|
-
import { jsx as jsx52, jsxs as
|
|
28906
|
+
import React7 from "react";
|
|
28907
|
+
import { jsx as jsx52, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
28772
28908
|
var StagesComponent = ({ stages, isShowBtn, buttonText, className, style }) => {
|
|
28773
|
-
return /* @__PURE__ */ jsx52("div", { className, style, children: /* @__PURE__ */
|
|
28909
|
+
return /* @__PURE__ */ jsx52("div", { className, style, children: /* @__PURE__ */ jsxs30("div", { className: "flex items-center justify-between bg-red p-2 rounded-lg border border-gray-200 w-full", children: [
|
|
28774
28910
|
/* @__PURE__ */ jsx52("div", { className: "flex items-center", children: /* @__PURE__ */ jsx52("button", { className: "p-2 hover:bg-gray-100 rounded", children: /* @__PURE__ */ jsx52("svg", { className: "w-4 h-4 text-gray-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx52("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) }) }),
|
|
28775
|
-
/* @__PURE__ */ jsx52("div", { className: "flex items-center flex-1 px-2 flex-wrap gap-2", children: stages?.length > 0 && stages?.map((stage, index) => /* @__PURE__ */
|
|
28911
|
+
/* @__PURE__ */ jsx52("div", { className: "flex items-center flex-1 px-2 flex-wrap gap-2", children: stages?.length > 0 && stages?.map((stage, index) => /* @__PURE__ */ jsxs30(React7.Fragment, { children: [
|
|
28776
28912
|
/* @__PURE__ */ jsx52(
|
|
28777
28913
|
"button",
|
|
28778
28914
|
{
|
|
@@ -28795,19 +28931,19 @@ var Spacer = ({ className, style }) => {
|
|
|
28795
28931
|
var Spacer_default = Spacer;
|
|
28796
28932
|
|
|
28797
28933
|
// src/components/Navigation/Profile/Profile.tsx
|
|
28798
|
-
import { jsx as jsx54, jsxs as
|
|
28934
|
+
import { jsx as jsx54, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
28799
28935
|
|
|
28800
28936
|
// src/components/Navigation/Notification/Notification.tsx
|
|
28801
|
-
import { jsx as jsx55, jsxs as
|
|
28937
|
+
import { jsx as jsx55, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
28802
28938
|
|
|
28803
28939
|
// src/components/Navigation/Logo/Logo.tsx
|
|
28804
28940
|
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
28805
28941
|
|
|
28806
28942
|
// src/components/ui/avatar.tsx
|
|
28807
|
-
import * as
|
|
28943
|
+
import * as React8 from "react";
|
|
28808
28944
|
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
28809
28945
|
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
28810
|
-
var Avatar =
|
|
28946
|
+
var Avatar = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx57(
|
|
28811
28947
|
AvatarPrimitive.Root,
|
|
28812
28948
|
{
|
|
28813
28949
|
ref,
|
|
@@ -28819,7 +28955,7 @@ var Avatar = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
28819
28955
|
}
|
|
28820
28956
|
));
|
|
28821
28957
|
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
28822
|
-
var AvatarImage =
|
|
28958
|
+
var AvatarImage = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx57(
|
|
28823
28959
|
AvatarPrimitive.Image,
|
|
28824
28960
|
{
|
|
28825
28961
|
ref,
|
|
@@ -28828,7 +28964,7 @@ var AvatarImage = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
28828
28964
|
}
|
|
28829
28965
|
));
|
|
28830
28966
|
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
28831
|
-
var AvatarFallback =
|
|
28967
|
+
var AvatarFallback = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx57(
|
|
28832
28968
|
AvatarPrimitive.Fallback,
|
|
28833
28969
|
{
|
|
28834
28970
|
ref,
|
|
@@ -28845,7 +28981,7 @@ AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
|
28845
28981
|
import Link6 from "next/link";
|
|
28846
28982
|
import Image3 from "next/image";
|
|
28847
28983
|
import { DropdownMenuSeparator } from "@radix-ui/react-dropdown-menu";
|
|
28848
|
-
import { Fragment as Fragment18, jsx as jsx58, jsxs as
|
|
28984
|
+
import { Fragment as Fragment18, jsx as jsx58, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
28849
28985
|
function Navbar({
|
|
28850
28986
|
style,
|
|
28851
28987
|
badgeType,
|
|
@@ -28861,7 +28997,7 @@ function Navbar({
|
|
|
28861
28997
|
userName = "Guest User"
|
|
28862
28998
|
}) {
|
|
28863
28999
|
const isMobileView = canvasMode === "mobile" || canvasMode === "tablet";
|
|
28864
|
-
return /* @__PURE__ */ jsx58("nav", { className: "w-full border-b bg-white shadow-sm", style, children: /* @__PURE__ */
|
|
29000
|
+
return /* @__PURE__ */ jsx58("nav", { className: "w-full border-b bg-white shadow-sm", style, children: /* @__PURE__ */ jsxs33("div", { className: "mx-auto flex max-w-7xl items-center justify-between px-4 py-4", children: [
|
|
28865
29001
|
/* @__PURE__ */ jsx58(Link6, { href: "/", className: "flex items-center space-x-2", children: imageUrl ? /* @__PURE__ */ jsx58(Image3, { src: imageUrl, alt: altText, width: 200, height: 200 }) : /* @__PURE__ */ jsx58("span", { className: "font-semibold text-blue-700", children: "Logo" }) }),
|
|
28866
29002
|
!isMobileView && /* @__PURE__ */ jsx58("div", { className: "flex items-center space-x-6 sm:hidden md:flex", children: list.map((item) => /* @__PURE__ */ jsx58(
|
|
28867
29003
|
Link6,
|
|
@@ -28872,8 +29008,8 @@ function Navbar({
|
|
|
28872
29008
|
},
|
|
28873
29009
|
item.id
|
|
28874
29010
|
)) }),
|
|
28875
|
-
/* @__PURE__ */
|
|
28876
|
-
!isMobileView ? /* @__PURE__ */ jsx58("div", { className: "flex-1 px-6", children: /* @__PURE__ */
|
|
29011
|
+
/* @__PURE__ */ jsxs33("div", { className: "flex items-center space-x-3", children: [
|
|
29012
|
+
!isMobileView ? /* @__PURE__ */ jsx58("div", { className: "flex-1 px-6", children: /* @__PURE__ */ jsxs33("div", { className: "relative w-full max-w-md border border-gray-300 rounded-md", children: [
|
|
28877
29013
|
/* @__PURE__ */ jsx58(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" }),
|
|
28878
29014
|
/* @__PURE__ */ jsx58(Input, { placeholder: "Search", className: "pl-9 text-gray-400" })
|
|
28879
29015
|
] }) }) : /* @__PURE__ */ jsx58(
|
|
@@ -28885,14 +29021,14 @@ function Navbar({
|
|
|
28885
29021
|
children: /* @__PURE__ */ jsx58(Search, { className: "h-5 w-5 text-gray-400" })
|
|
28886
29022
|
}
|
|
28887
29023
|
),
|
|
28888
|
-
/* @__PURE__ */
|
|
29024
|
+
/* @__PURE__ */ jsxs33("div", { className: "relative bg-[#E9E9E9] rounded-md", children: [
|
|
28889
29025
|
/* @__PURE__ */ jsx58(Button, { variant: "ghost", size: "icon", children: /* @__PURE__ */ jsx58(Bell, { className: "h-5 w-5 text-[#1C1B1F]" }) }),
|
|
28890
29026
|
badgeType === "number" && !(hideBadgeWhenZero && badgeCount === 0) && Number(badgeCount) > 0 ? /* @__PURE__ */ jsx58("span", { className: "absolute -top-1 -right-1 flex h-4 w-4 items-center justify-center rounded-full bg-red-500 text-[10px] text-white leading-8", children: badgeCount }) : /* @__PURE__ */ jsx58("span", { className: "absolute -top-1 -right-1 flex h-2 w-2 items-center justify-center rounded-full bg-red-500" })
|
|
28891
29027
|
] }),
|
|
28892
|
-
/* @__PURE__ */
|
|
28893
|
-
/* @__PURE__ */ jsx58(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */
|
|
29028
|
+
/* @__PURE__ */ jsxs33(DropdownMenu, { children: [
|
|
29029
|
+
/* @__PURE__ */ jsx58(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs33("div", { className: "flex items-center space-x-2", children: [
|
|
28894
29030
|
!isMobileView && showName && /* @__PURE__ */ jsx58("h4", { className: "text-[#000000] text-[13px] font-[500] mb-0", children: userName }),
|
|
28895
|
-
!isMobileView ? /* @__PURE__ */
|
|
29031
|
+
!isMobileView ? /* @__PURE__ */ jsxs33(Fragment18, { children: [
|
|
28896
29032
|
/* @__PURE__ */ jsx58(Avatar, { className: "cursor-pointer h-8 w-8 text-gray-900", children: profileType === "avatar" ? /* @__PURE__ */ jsx58(
|
|
28897
29033
|
AvatarImage,
|
|
28898
29034
|
{
|
|
@@ -28919,9 +29055,9 @@ function Navbar({
|
|
|
28919
29055
|
}
|
|
28920
29056
|
)
|
|
28921
29057
|
] }) }),
|
|
28922
|
-
/* @__PURE__ */
|
|
29058
|
+
/* @__PURE__ */ jsxs33(DropdownMenuContent, { align: "end", className: "bg-white", children: [
|
|
28923
29059
|
profileMenu && profileMenu.length > 0 && /* @__PURE__ */ jsx58(Fragment18, { children: profileMenu.map((item) => /* @__PURE__ */ jsx58(DropdownMenuItem, { className: "text-black", children: /* @__PURE__ */ jsx58(Link6, { href: item.url || "#", children: item.header }) }, item.id)) }),
|
|
28924
|
-
/* @__PURE__ */
|
|
29060
|
+
/* @__PURE__ */ jsxs33("div", { className: "md:hidden", children: [
|
|
28925
29061
|
/* @__PURE__ */ jsx58(DropdownMenuSeparator, {}),
|
|
28926
29062
|
list && list.length > 0 && /* @__PURE__ */ jsx58(Fragment18, { children: list.map((item) => /* @__PURE__ */ jsx58(DropdownMenuItem, { className: "text-black", children: /* @__PURE__ */ jsx58(Link6, { href: item.url || "#", children: item.header }) }, item.id)) })
|
|
28927
29063
|
] })
|
|
@@ -28933,20 +29069,20 @@ function Navbar({
|
|
|
28933
29069
|
|
|
28934
29070
|
// src/components/Chart/BarChart.tsx
|
|
28935
29071
|
import { BarChart, Bar, Area, AreaChart, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, Legend } from "recharts";
|
|
28936
|
-
import { jsx as jsx59, jsxs as
|
|
29072
|
+
import { jsx as jsx59, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
28937
29073
|
var ChartComponent = ({ className, style, ...props }) => {
|
|
28938
29074
|
const data = Array.isArray(props?.data) ? props.data : [];
|
|
28939
29075
|
const chartType = props.chartType || "bar";
|
|
28940
29076
|
const legendsPosition = props.legendsPosition === "middle" || props.legendsPosition === "bottom" ? props.legendsPosition : "top";
|
|
28941
|
-
return /* @__PURE__ */ jsx59("div", { className: `${className} h-[400px]`, style, children: data.length > 0 && /* @__PURE__ */ jsx59(ResponsiveContainer, { width: "100%", height: "100%", children: chartType === "bar" ? /* @__PURE__ */
|
|
29077
|
+
return /* @__PURE__ */ jsx59("div", { className: `${className} h-[400px]`, style, children: data.length > 0 && /* @__PURE__ */ jsx59(ResponsiveContainer, { width: "100%", height: "100%", children: chartType === "bar" ? /* @__PURE__ */ jsxs34(BarChart, { data, children: [
|
|
28942
29078
|
/* @__PURE__ */ jsx59(CartesianGrid, { strokeDasharray: "3 3" }),
|
|
28943
29079
|
/* @__PURE__ */ jsx59(XAxis, { dataKey: "name" }),
|
|
28944
29080
|
/* @__PURE__ */ jsx59(YAxis, {}),
|
|
28945
29081
|
/* @__PURE__ */ jsx59(Tooltip, {}),
|
|
28946
29082
|
/* @__PURE__ */ jsx59(Legend, { verticalAlign: legendsPosition, align: "center" }),
|
|
28947
29083
|
/* @__PURE__ */ jsx59(Bar, { dataKey: "value", fill: "#00695C" })
|
|
28948
|
-
] }) : /* @__PURE__ */
|
|
28949
|
-
/* @__PURE__ */ jsx59("defs", { children: /* @__PURE__ */
|
|
29084
|
+
] }) : /* @__PURE__ */ jsxs34(AreaChart, { data, children: [
|
|
29085
|
+
/* @__PURE__ */ jsx59("defs", { children: /* @__PURE__ */ jsxs34("linearGradient", { id: "colorCount", x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
28950
29086
|
/* @__PURE__ */ jsx59("stop", { offset: "5%", stopColor: "#00695C", stopOpacity: 0.8 }),
|
|
28951
29087
|
/* @__PURE__ */ jsx59("stop", { offset: "95%", stopColor: "#00695C", stopOpacity: 0 })
|
|
28952
29088
|
] }) }),
|
|
@@ -28970,7 +29106,7 @@ var BarChart_default = ChartComponent;
|
|
|
28970
29106
|
|
|
28971
29107
|
// src/components/Chart/PieChart.tsx
|
|
28972
29108
|
import { PieChart, Pie, Cell, ResponsiveContainer as ResponsiveContainer2, Tooltip as Tooltip2, LabelList } from "recharts";
|
|
28973
|
-
import { Fragment as Fragment19, jsx as jsx60, jsxs as
|
|
29109
|
+
import { Fragment as Fragment19, jsx as jsx60, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
28974
29110
|
var DonutChart = ({ className, style, ...props }) => {
|
|
28975
29111
|
const data = Array.isArray(props?.data) ? props.data : [];
|
|
28976
29112
|
const total = data.reduce((sum, d) => sum + d.value, 0);
|
|
@@ -28981,7 +29117,7 @@ var DonutChart = ({ className, style, ...props }) => {
|
|
|
28981
29117
|
const renderLabel = ({ value, x, y }) => {
|
|
28982
29118
|
if (value == null) return null;
|
|
28983
29119
|
const percentage = (Number(value) / total * 100).toFixed(0);
|
|
28984
|
-
return /* @__PURE__ */
|
|
29120
|
+
return /* @__PURE__ */ jsxs35(
|
|
28985
29121
|
"text",
|
|
28986
29122
|
{
|
|
28987
29123
|
x,
|
|
@@ -29003,7 +29139,7 @@ var DonutChart = ({ className, style, ...props }) => {
|
|
|
29003
29139
|
const wrapperClass = canvasMode ? forceDesktop ? "flex-row" : "flex-col" : "flex-col md:flex-row";
|
|
29004
29140
|
const renderLegends = () => {
|
|
29005
29141
|
if (!showLegends) return null;
|
|
29006
|
-
return /* @__PURE__ */ jsx60(Fragment19, { children: data.map((d) => /* @__PURE__ */
|
|
29142
|
+
return /* @__PURE__ */ jsx60(Fragment19, { children: data.map((d) => /* @__PURE__ */ jsxs35(
|
|
29007
29143
|
"div",
|
|
29008
29144
|
{
|
|
29009
29145
|
className: "flex items-center space-x-2 rounded-md border border-gray-200 px-3 py-2 w-[48%] md:w-auto",
|
|
@@ -29021,15 +29157,15 @@ var DonutChart = ({ className, style, ...props }) => {
|
|
|
29021
29157
|
d.name
|
|
29022
29158
|
)) });
|
|
29023
29159
|
};
|
|
29024
|
-
return /* @__PURE__ */
|
|
29160
|
+
return /* @__PURE__ */ jsxs35(
|
|
29025
29161
|
"div",
|
|
29026
29162
|
{
|
|
29027
29163
|
className: `relative flex items-center ${wrapperClass} ${className}`,
|
|
29028
29164
|
style,
|
|
29029
29165
|
children: [
|
|
29030
|
-
/* @__PURE__ */
|
|
29031
|
-
data.length > 0 && /* @__PURE__ */ jsx60(ResponsiveContainer2, { width: "100%", height: "100%", children: /* @__PURE__ */
|
|
29032
|
-
/* @__PURE__ */
|
|
29166
|
+
/* @__PURE__ */ jsxs35("div", { className: "relative w-full md:w-[70%] h-[300px] md:h-[400px] flex items-center justify-center", children: [
|
|
29167
|
+
data.length > 0 && /* @__PURE__ */ jsx60(ResponsiveContainer2, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs35(PieChart, { children: [
|
|
29168
|
+
/* @__PURE__ */ jsxs35(
|
|
29033
29169
|
Pie,
|
|
29034
29170
|
{
|
|
29035
29171
|
data,
|
|
@@ -29055,7 +29191,7 @@ var DonutChart = ({ className, style, ...props }) => {
|
|
|
29055
29191
|
),
|
|
29056
29192
|
/* @__PURE__ */ jsx60(Tooltip2, { formatter: (value, name) => [`${value}k`, name] })
|
|
29057
29193
|
] }) }),
|
|
29058
|
-
/* @__PURE__ */
|
|
29194
|
+
/* @__PURE__ */ jsxs35("div", { className: "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 text-2xl md:text-4xl font-bold text-[#000]", children: [
|
|
29059
29195
|
total,
|
|
29060
29196
|
"k"
|
|
29061
29197
|
] })
|
|
@@ -29069,9 +29205,9 @@ var DonutChart = ({ className, style, ...props }) => {
|
|
|
29069
29205
|
var PieChart_default = DonutChart;
|
|
29070
29206
|
|
|
29071
29207
|
// src/components/Blocks/EmailComposer.tsx
|
|
29072
|
-
import { jsx as jsx61, jsxs as
|
|
29208
|
+
import { jsx as jsx61, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
29073
29209
|
function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc, setShowBcc, cc, setCc, bcc, setBcc, subject, setSubject, body, setBody }) {
|
|
29074
|
-
return /* @__PURE__ */ jsx61("div", { className, style, children: /* @__PURE__ */
|
|
29210
|
+
return /* @__PURE__ */ jsx61("div", { className, style, children: /* @__PURE__ */ jsxs36("div", { className: "border rounded-md shadow bg-[#fff] p-4 mx-auto z-[50] relative", children: [
|
|
29075
29211
|
/* @__PURE__ */ jsx61("div", { className: "mb-3", children: /* @__PURE__ */ jsx61(
|
|
29076
29212
|
"input",
|
|
29077
29213
|
{
|
|
@@ -29081,7 +29217,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
29081
29217
|
required: true
|
|
29082
29218
|
}
|
|
29083
29219
|
) }),
|
|
29084
|
-
/* @__PURE__ */ jsx61("div", { className: "mb-3", children: /* @__PURE__ */
|
|
29220
|
+
/* @__PURE__ */ jsx61("div", { className: "mb-3", children: /* @__PURE__ */ jsxs36("div", { className: "flex items-center gap-2", children: [
|
|
29085
29221
|
/* @__PURE__ */ jsx61(
|
|
29086
29222
|
"input",
|
|
29087
29223
|
{
|
|
@@ -29141,7 +29277,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
29141
29277
|
}
|
|
29142
29278
|
) }),
|
|
29143
29279
|
/* @__PURE__ */ jsx61("div", { className: "mb-4", children: /* @__PURE__ */ jsx61(MyEditor, { value: body, onChange: setBody }) }),
|
|
29144
|
-
/* @__PURE__ */
|
|
29280
|
+
/* @__PURE__ */ jsxs36("div", { className: "flex justify-end gap-2", children: [
|
|
29145
29281
|
/* @__PURE__ */ jsx61("button", { className: "px-4 py-2 rounded-md text-gray-600 hover:bg-gray-100", children: "Discard" }),
|
|
29146
29282
|
/* @__PURE__ */ jsx61("button", { className: "px-4 py-2 rounded-md border text-[#12715B] border-[#12715B]", children: "Reset" }),
|
|
29147
29283
|
/* @__PURE__ */ jsx61("button", { className: "px-4 py-2 rounded-md bg-[#12715B] text-white", children: "Send" })
|