@algorithm-shift/design-system 1.2.61 → 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 +301 -165
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +334 -195
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -27864,6 +27864,10 @@ function DatePicker({ className, style, ...props }) {
|
|
|
27864
27864
|
const handleChange = (e) => {
|
|
27865
27865
|
props.onChange?.(e);
|
|
27866
27866
|
};
|
|
27867
|
+
const toDateInputValue = (value) => {
|
|
27868
|
+
if (!value) return "";
|
|
27869
|
+
return new Date(value).toISOString().split("T")[0];
|
|
27870
|
+
};
|
|
27867
27871
|
return /* @__PURE__ */ jsxs23(Fragment14, { children: [
|
|
27868
27872
|
/* @__PURE__ */ jsxs23("div", { className: "flex justify-start items-center relative", children: [
|
|
27869
27873
|
/* @__PURE__ */ jsx41(Calendar, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[#BDBDBD]" }),
|
|
@@ -27876,7 +27880,7 @@ function DatePicker({ className, style, ...props }) {
|
|
|
27876
27880
|
onChange: handleChange,
|
|
27877
27881
|
disabled: isDisabled || !isEditable,
|
|
27878
27882
|
name: props.name,
|
|
27879
|
-
value: props.value
|
|
27883
|
+
value: toDateInputValue(props.value),
|
|
27880
27884
|
className: cn(
|
|
27881
27885
|
className,
|
|
27882
27886
|
props.errorMessage ? "border-red-500" : "",
|
|
@@ -28233,13 +28237,16 @@ var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
|
|
|
28233
28237
|
};
|
|
28234
28238
|
var TextInputGroup_default = TextInputGroup;
|
|
28235
28239
|
|
|
28236
|
-
// src/components/DataDisplay/Table/Table.tsx
|
|
28237
|
-
import { useState as useState3, useEffect as useEffect21 } from "react";
|
|
28238
|
-
|
|
28239
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";
|
|
28240
28244
|
import {
|
|
28241
28245
|
flexRender,
|
|
28242
28246
|
getCoreRowModel,
|
|
28247
|
+
getPaginationRowModel,
|
|
28248
|
+
getSortedRowModel,
|
|
28249
|
+
getFilteredRowModel,
|
|
28243
28250
|
useReactTable
|
|
28244
28251
|
} from "@tanstack/react-table";
|
|
28245
28252
|
|
|
@@ -28332,72 +28339,277 @@ function TableCell({ className, ...props }) {
|
|
|
28332
28339
|
import { Fragment as Fragment17, jsx as jsx47, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
28333
28340
|
function DataTable({
|
|
28334
28341
|
columns,
|
|
28335
|
-
rowActions,
|
|
28336
28342
|
data,
|
|
28337
28343
|
loading,
|
|
28338
|
-
|
|
28339
|
-
|
|
28340
|
-
|
|
28344
|
+
pagination = false,
|
|
28345
|
+
controlledPageIndex,
|
|
28346
|
+
onPageChange,
|
|
28347
|
+
pageSize = 10,
|
|
28348
|
+
paginationMode = "client",
|
|
28349
|
+
totalRecords = 0
|
|
28341
28350
|
}) {
|
|
28351
|
+
const [sorting, setSorting] = React6.useState([]);
|
|
28352
|
+
const [columnFilters, setColumnFilters] = React6.useState([]);
|
|
28353
|
+
const [columnVisibility, setColumnVisibility] = React6.useState({});
|
|
28342
28354
|
const table = useReactTable({
|
|
28343
28355
|
data,
|
|
28344
28356
|
columns,
|
|
28345
|
-
|
|
28346
|
-
|
|
28347
|
-
|
|
28348
|
-
|
|
28349
|
-
|
|
28350
|
-
|
|
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
|
+
}
|
|
28351
28380
|
});
|
|
28352
|
-
const
|
|
28353
|
-
if (
|
|
28354
|
-
|
|
28381
|
+
const getPageNumbers = (currentPage, totalPages, maxVisiblePages = 5) => {
|
|
28382
|
+
if (totalPages <= maxVisiblePages) {
|
|
28383
|
+
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
28355
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];
|
|
28397
|
+
}
|
|
28398
|
+
return [];
|
|
28356
28399
|
};
|
|
28357
|
-
return /* @__PURE__ */
|
|
28358
|
-
/* @__PURE__ */ jsx47(
|
|
28359
|
-
|
|
28360
|
-
|
|
28361
|
-
|
|
28362
|
-
|
|
28363
|
-
|
|
28364
|
-
|
|
28365
|
-
|
|
28366
|
-
|
|
28367
|
-
|
|
28368
|
-
|
|
28369
|
-
children:
|
|
28370
|
-
|
|
28371
|
-
|
|
28372
|
-
|
|
28373
|
-
|
|
28374
|
-
|
|
28375
|
-
|
|
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,
|
|
28376
28478
|
{
|
|
28377
|
-
|
|
28378
|
-
|
|
28379
|
-
|
|
28380
|
-
|
|
28381
|
-
|
|
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
|
+
]
|
|
28382
28514
|
}
|
|
28383
|
-
|
|
28384
|
-
|
|
28385
|
-
|
|
28386
|
-
|
|
28387
|
-
|
|
28388
|
-
|
|
28389
|
-
|
|
28390
|
-
|
|
28391
|
-
|
|
28392
|
-
|
|
28393
|
-
|
|
28394
|
-
|
|
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
|
+
] });
|
|
28395
28566
|
}
|
|
28396
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
|
+
|
|
28397
28609
|
// src/components/ui/pagination.tsx
|
|
28398
|
-
import { jsx as
|
|
28610
|
+
import { jsx as jsx49, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
28399
28611
|
function Pagination({ className, ...props }) {
|
|
28400
|
-
return /* @__PURE__ */
|
|
28612
|
+
return /* @__PURE__ */ jsx49(
|
|
28401
28613
|
"nav",
|
|
28402
28614
|
{
|
|
28403
28615
|
role: "navigation",
|
|
@@ -28412,7 +28624,7 @@ function PaginationContent({
|
|
|
28412
28624
|
className,
|
|
28413
28625
|
...props
|
|
28414
28626
|
}) {
|
|
28415
|
-
return /* @__PURE__ */
|
|
28627
|
+
return /* @__PURE__ */ jsx49(
|
|
28416
28628
|
"ul",
|
|
28417
28629
|
{
|
|
28418
28630
|
"data-slot": "pagination-content",
|
|
@@ -28422,7 +28634,7 @@ function PaginationContent({
|
|
|
28422
28634
|
);
|
|
28423
28635
|
}
|
|
28424
28636
|
function PaginationItem({ ...props }) {
|
|
28425
|
-
return /* @__PURE__ */
|
|
28637
|
+
return /* @__PURE__ */ jsx49("li", { "data-slot": "pagination-item", ...props });
|
|
28426
28638
|
}
|
|
28427
28639
|
function PaginationLink({
|
|
28428
28640
|
className,
|
|
@@ -28430,7 +28642,7 @@ function PaginationLink({
|
|
|
28430
28642
|
size = "icon",
|
|
28431
28643
|
...props
|
|
28432
28644
|
}) {
|
|
28433
|
-
return /* @__PURE__ */
|
|
28645
|
+
return /* @__PURE__ */ jsx49(
|
|
28434
28646
|
"a",
|
|
28435
28647
|
{
|
|
28436
28648
|
"aria-current": isActive ? "page" : void 0,
|
|
@@ -28459,8 +28671,8 @@ function PaginationPrevious({
|
|
|
28459
28671
|
className: cn("gap-1 px-2.5 sm:pl-2.5", className),
|
|
28460
28672
|
...props,
|
|
28461
28673
|
children: [
|
|
28462
|
-
/* @__PURE__ */
|
|
28463
|
-
/* @__PURE__ */
|
|
28674
|
+
/* @__PURE__ */ jsx49(ChevronLeft, {}),
|
|
28675
|
+
/* @__PURE__ */ jsx49("span", { className: "hidden sm:block", children: "Previous" })
|
|
28464
28676
|
]
|
|
28465
28677
|
}
|
|
28466
28678
|
);
|
|
@@ -28477,8 +28689,8 @@ function PaginationNext({
|
|
|
28477
28689
|
className: cn("gap-1 px-2.5 sm:pr-2.5", className),
|
|
28478
28690
|
...props,
|
|
28479
28691
|
children: [
|
|
28480
|
-
/* @__PURE__ */
|
|
28481
|
-
/* @__PURE__ */
|
|
28692
|
+
/* @__PURE__ */ jsx49("span", { className: "hidden sm:block", children: "Next" }),
|
|
28693
|
+
/* @__PURE__ */ jsx49(ChevronRight, {})
|
|
28482
28694
|
]
|
|
28483
28695
|
}
|
|
28484
28696
|
);
|
|
@@ -28495,15 +28707,15 @@ function PaginationEllipsis({
|
|
|
28495
28707
|
className: cn("flex size-9 items-center justify-center", className),
|
|
28496
28708
|
...props,
|
|
28497
28709
|
children: [
|
|
28498
|
-
/* @__PURE__ */
|
|
28499
|
-
/* @__PURE__ */
|
|
28710
|
+
/* @__PURE__ */ jsx49(Ellipsis, { className: "size-4" }),
|
|
28711
|
+
/* @__PURE__ */ jsx49("span", { className: "sr-only", children: "More pages" })
|
|
28500
28712
|
]
|
|
28501
28713
|
}
|
|
28502
28714
|
);
|
|
28503
28715
|
}
|
|
28504
28716
|
|
|
28505
28717
|
// src/components/DataDisplay/Pagination/Pagination.tsx
|
|
28506
|
-
import { jsx as
|
|
28718
|
+
import { jsx as jsx50, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
28507
28719
|
var CustomPagination = ({
|
|
28508
28720
|
totalPages,
|
|
28509
28721
|
currentPage,
|
|
@@ -28551,7 +28763,7 @@ var CustomPagination = ({
|
|
|
28551
28763
|
const pageNumbers = getPageNumbers();
|
|
28552
28764
|
return /* @__PURE__ */ jsxs28("div", { className: "flex flex-row gap-1 w-full items-center justify-between", children: [
|
|
28553
28765
|
/* @__PURE__ */ jsxs28("div", { className: "flex items-center gap-2", children: [
|
|
28554
|
-
/* @__PURE__ */
|
|
28766
|
+
/* @__PURE__ */ jsx50("p", { className: "text-sm text-muted-foreground whitespace-nowrap", children: "Items per page:" }),
|
|
28555
28767
|
/* @__PURE__ */ jsxs28(
|
|
28556
28768
|
Select,
|
|
28557
28769
|
{
|
|
@@ -28560,26 +28772,26 @@ var CustomPagination = ({
|
|
|
28560
28772
|
onPageChange({ page: 1, itemsPerPage: Number(value) });
|
|
28561
28773
|
},
|
|
28562
28774
|
children: [
|
|
28563
|
-
/* @__PURE__ */
|
|
28775
|
+
/* @__PURE__ */ jsx50(SelectTrigger, { className: "w-[100px]", children: /* @__PURE__ */ jsx50(SelectValue, { placeholder: "Select" }) }),
|
|
28564
28776
|
/* @__PURE__ */ jsxs28(SelectContent, { children: [
|
|
28565
|
-
/* @__PURE__ */
|
|
28566
|
-
/* @__PURE__ */
|
|
28567
|
-
/* @__PURE__ */
|
|
28568
|
-
/* @__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" })
|
|
28569
28781
|
] })
|
|
28570
28782
|
]
|
|
28571
28783
|
}
|
|
28572
28784
|
)
|
|
28573
28785
|
] }),
|
|
28574
|
-
/* @__PURE__ */
|
|
28575
|
-
/* @__PURE__ */
|
|
28786
|
+
/* @__PURE__ */ jsx50(Pagination, { className: "justify-end", children: /* @__PURE__ */ jsxs28(PaginationContent, { children: [
|
|
28787
|
+
/* @__PURE__ */ jsx50(PaginationItem, { children: /* @__PURE__ */ jsx50(
|
|
28576
28788
|
PaginationPrevious,
|
|
28577
28789
|
{
|
|
28578
28790
|
onClick: () => handlePageChange(currentPage - 1),
|
|
28579
28791
|
className: currentPage === 1 ? "pointer-events-none opacity-50" : "cursor-pointer"
|
|
28580
28792
|
}
|
|
28581
28793
|
) }),
|
|
28582
|
-
pageNumbers.map((pageNumber, index) => /* @__PURE__ */
|
|
28794
|
+
pageNumbers.map((pageNumber, index) => /* @__PURE__ */ jsx50(PaginationItem, { children: pageNumber === "..." ? /* @__PURE__ */ jsx50(PaginationEllipsis, {}) : /* @__PURE__ */ jsx50(
|
|
28583
28795
|
PaginationLink,
|
|
28584
28796
|
{
|
|
28585
28797
|
onClick: () => handlePageChange(pageNumber),
|
|
@@ -28588,7 +28800,7 @@ var CustomPagination = ({
|
|
|
28588
28800
|
children: pageNumber
|
|
28589
28801
|
}
|
|
28590
28802
|
) }, index)),
|
|
28591
|
-
/* @__PURE__ */
|
|
28803
|
+
/* @__PURE__ */ jsx50(PaginationItem, { children: /* @__PURE__ */ jsx50(
|
|
28592
28804
|
PaginationNext,
|
|
28593
28805
|
{
|
|
28594
28806
|
onClick: () => handlePageChange(currentPage + 1),
|
|
@@ -28600,81 +28812,9 @@ var CustomPagination = ({
|
|
|
28600
28812
|
};
|
|
28601
28813
|
var Pagination_default = CustomPagination;
|
|
28602
28814
|
|
|
28603
|
-
// src/components/DataDisplay/Table/Table.tsx
|
|
28604
|
-
import { jsx as jsx50, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
28605
|
-
var Table4 = ({
|
|
28606
|
-
columns,
|
|
28607
|
-
data,
|
|
28608
|
-
rowActions,
|
|
28609
|
-
className,
|
|
28610
|
-
style,
|
|
28611
|
-
pagination = false,
|
|
28612
|
-
paginationMode = "client",
|
|
28613
|
-
itemsPerPage = 10,
|
|
28614
|
-
onPageChange,
|
|
28615
|
-
page,
|
|
28616
|
-
loading = false,
|
|
28617
|
-
totalRecords = 0,
|
|
28618
|
-
...props
|
|
28619
|
-
}) => {
|
|
28620
|
-
const rawColumns = Array.isArray(columns) ? columns : [];
|
|
28621
|
-
const rawData = Array.isArray(data) ? data : [];
|
|
28622
|
-
const rawRowActions = Array.isArray(rowActions) ? rowActions : [];
|
|
28623
|
-
const isControlled = typeof page === "number";
|
|
28624
|
-
const [internalPage, setInternalPage] = useState3(1);
|
|
28625
|
-
const currentPage = isControlled ? page : internalPage;
|
|
28626
|
-
useEffect21(() => {
|
|
28627
|
-
if (isControlled) return;
|
|
28628
|
-
if (currentPage > 1 && !pagination) setInternalPage(1);
|
|
28629
|
-
}, [pagination, isControlled]);
|
|
28630
|
-
const enablePagination = pagination && (paginationMode === "server" ? totalRecords > itemsPerPage : rawData.length > itemsPerPage);
|
|
28631
|
-
const handlePageChange = (options) => {
|
|
28632
|
-
if (!isControlled) setInternalPage(options.page);
|
|
28633
|
-
onPageChange?.(options);
|
|
28634
|
-
};
|
|
28635
|
-
const paginatedData = !enablePagination ? rawData : paginationMode === "server" ? rawData : rawData.slice(
|
|
28636
|
-
(currentPage - 1) * itemsPerPage,
|
|
28637
|
-
currentPage * itemsPerPage
|
|
28638
|
-
);
|
|
28639
|
-
const totalPages = enablePagination ? Math.max(
|
|
28640
|
-
1,
|
|
28641
|
-
Math.ceil(
|
|
28642
|
-
(paginationMode === "server" ? totalRecords : rawData.length) / itemsPerPage
|
|
28643
|
-
)
|
|
28644
|
-
) : 1;
|
|
28645
|
-
const isCellClickEnabled = (row, id) => {
|
|
28646
|
-
const selectedColumn = (columns || [])?.find((col) => col.accessorKey === id);
|
|
28647
|
-
if (!selectedColumn) return false;
|
|
28648
|
-
return selectedColumn.isClickable ?? false;
|
|
28649
|
-
};
|
|
28650
|
-
return /* @__PURE__ */ jsxs29("div", { className: `${className || ""} space-y-3`, style, children: [
|
|
28651
|
-
/* @__PURE__ */ jsx50(
|
|
28652
|
-
DataTable,
|
|
28653
|
-
{
|
|
28654
|
-
...props,
|
|
28655
|
-
columns: rawColumns,
|
|
28656
|
-
data: paginatedData,
|
|
28657
|
-
rowActions: rawRowActions,
|
|
28658
|
-
loading,
|
|
28659
|
-
cellClickEnabled: isCellClickEnabled
|
|
28660
|
-
}
|
|
28661
|
-
),
|
|
28662
|
-
enablePagination && /* @__PURE__ */ jsx50(
|
|
28663
|
-
Pagination_default,
|
|
28664
|
-
{
|
|
28665
|
-
perPage: itemsPerPage,
|
|
28666
|
-
totalPages,
|
|
28667
|
-
currentPage,
|
|
28668
|
-
onPageChange: handlePageChange
|
|
28669
|
-
}
|
|
28670
|
-
)
|
|
28671
|
-
] });
|
|
28672
|
-
};
|
|
28673
|
-
var Table_default = Table4;
|
|
28674
|
-
|
|
28675
28815
|
// src/components/Navigation/Tabs/Tabs.tsx
|
|
28676
28816
|
import Link5 from "next/link";
|
|
28677
|
-
import { jsx as jsx51, jsxs as
|
|
28817
|
+
import { jsx as jsx51, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
28678
28818
|
var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode }) => {
|
|
28679
28819
|
const rawTabs = Array.isArray(tabs) ? tabs : [];
|
|
28680
28820
|
const baseClasses = "text-[12px] text-foreground p-2 text-center rounded-md transition-colors";
|
|
@@ -28687,8 +28827,8 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode }) => {
|
|
|
28687
28827
|
const renderDesktopTab = (tab, index) => {
|
|
28688
28828
|
const finalClasses = [baseClasses, isActive(tab.url) ? activeClasses : hoverClasses, tab.className || ""].join(" ");
|
|
28689
28829
|
if (Array.isArray(tab.children) && tab.children.length > 0 && tab.isDropDown) {
|
|
28690
|
-
return /* @__PURE__ */
|
|
28691
|
-
/* @__PURE__ */
|
|
28830
|
+
return /* @__PURE__ */ jsxs29(DropdownMenu, { children: [
|
|
28831
|
+
/* @__PURE__ */ jsxs29(DropdownMenuTrigger, { className: `${finalClasses} inline-flex items-center gap-1`, children: [
|
|
28692
28832
|
tab.header,
|
|
28693
28833
|
/* @__PURE__ */ jsx51(ChevronDown, { className: "h-4 w-4 opacity-80" })
|
|
28694
28834
|
] }),
|
|
@@ -28713,8 +28853,8 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode }) => {
|
|
|
28713
28853
|
}
|
|
28714
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);
|
|
28715
28855
|
};
|
|
28716
|
-
const renderMobileMenu = () => /* @__PURE__ */
|
|
28717
|
-
/* @__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: [
|
|
28718
28858
|
/* @__PURE__ */ jsx51(Menu, { className: "h-4 w-4" }),
|
|
28719
28859
|
"Menu"
|
|
28720
28860
|
] }),
|
|
@@ -28727,7 +28867,7 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode }) => {
|
|
|
28727
28867
|
children: rawTabs.map((tab, i) => {
|
|
28728
28868
|
const hasChildren = Array.isArray(tab.children) && tab.children.length > 0 && tab.isDropDown;
|
|
28729
28869
|
if (hasChildren) {
|
|
28730
|
-
return /* @__PURE__ */
|
|
28870
|
+
return /* @__PURE__ */ jsxs29(DropdownMenuSub, { children: [
|
|
28731
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 }),
|
|
28732
28872
|
/* @__PURE__ */ jsx51(DropdownMenuSubContent, { className: "bg-white border shadow-lg rounded-md p-1", children: tab.children.map((item) => /* @__PURE__ */ jsx51(
|
|
28733
28873
|
DropdownMenuItem,
|
|
@@ -28753,23 +28893,22 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode }) => {
|
|
|
28753
28893
|
}
|
|
28754
28894
|
)
|
|
28755
28895
|
] });
|
|
28756
|
-
const forceMobile = canvasMode === "mobile" || canvasMode === "tablet";
|
|
28757
|
-
const forceDesktop = canvasMode === "desktop";
|
|
28758
|
-
return /* @__PURE__ */
|
|
28759
|
-
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) }) }),
|
|
28760
|
-
forceMobile && /* @__PURE__ */ jsx51("div", { children: renderMobileMenu() }),
|
|
28761
|
-
/* @__PURE__ */ jsx51("div", { className: "md:hidden", children: renderMobileMenu() })
|
|
28896
|
+
const forceMobile = canvasMode ? canvasMode === "mobile" || canvasMode === "tablet" : void 0;
|
|
28897
|
+
const forceDesktop = canvasMode ? canvasMode === "desktop" : void 0;
|
|
28898
|
+
return /* @__PURE__ */ jsxs29("div", { className, style, children: [
|
|
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) }) }),
|
|
28900
|
+
forceMobile !== void 0 ? forceMobile && /* @__PURE__ */ jsx51("div", { children: renderMobileMenu() }) : /* @__PURE__ */ jsx51("div", { className: "flex md:hidden", children: renderMobileMenu() })
|
|
28762
28901
|
] });
|
|
28763
28902
|
};
|
|
28764
28903
|
var Tabs_default = Tabs;
|
|
28765
28904
|
|
|
28766
28905
|
// src/components/Navigation/Stages/Stages.tsx
|
|
28767
|
-
import
|
|
28768
|
-
import { jsx as jsx52, jsxs as
|
|
28906
|
+
import React7 from "react";
|
|
28907
|
+
import { jsx as jsx52, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
28769
28908
|
var StagesComponent = ({ stages, isShowBtn, buttonText, className, style }) => {
|
|
28770
|
-
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: [
|
|
28771
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" }) }) }) }),
|
|
28772
|
-
/* @__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: [
|
|
28773
28912
|
/* @__PURE__ */ jsx52(
|
|
28774
28913
|
"button",
|
|
28775
28914
|
{
|
|
@@ -28792,19 +28931,19 @@ var Spacer = ({ className, style }) => {
|
|
|
28792
28931
|
var Spacer_default = Spacer;
|
|
28793
28932
|
|
|
28794
28933
|
// src/components/Navigation/Profile/Profile.tsx
|
|
28795
|
-
import { jsx as jsx54, jsxs as
|
|
28934
|
+
import { jsx as jsx54, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
28796
28935
|
|
|
28797
28936
|
// src/components/Navigation/Notification/Notification.tsx
|
|
28798
|
-
import { jsx as jsx55, jsxs as
|
|
28937
|
+
import { jsx as jsx55, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
28799
28938
|
|
|
28800
28939
|
// src/components/Navigation/Logo/Logo.tsx
|
|
28801
28940
|
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
28802
28941
|
|
|
28803
28942
|
// src/components/ui/avatar.tsx
|
|
28804
|
-
import * as
|
|
28943
|
+
import * as React8 from "react";
|
|
28805
28944
|
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
28806
28945
|
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
28807
|
-
var Avatar =
|
|
28946
|
+
var Avatar = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx57(
|
|
28808
28947
|
AvatarPrimitive.Root,
|
|
28809
28948
|
{
|
|
28810
28949
|
ref,
|
|
@@ -28816,7 +28955,7 @@ var Avatar = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
28816
28955
|
}
|
|
28817
28956
|
));
|
|
28818
28957
|
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
28819
|
-
var AvatarImage =
|
|
28958
|
+
var AvatarImage = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx57(
|
|
28820
28959
|
AvatarPrimitive.Image,
|
|
28821
28960
|
{
|
|
28822
28961
|
ref,
|
|
@@ -28825,7 +28964,7 @@ var AvatarImage = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
28825
28964
|
}
|
|
28826
28965
|
));
|
|
28827
28966
|
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
28828
|
-
var AvatarFallback =
|
|
28967
|
+
var AvatarFallback = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx57(
|
|
28829
28968
|
AvatarPrimitive.Fallback,
|
|
28830
28969
|
{
|
|
28831
28970
|
ref,
|
|
@@ -28842,7 +28981,7 @@ AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
|
28842
28981
|
import Link6 from "next/link";
|
|
28843
28982
|
import Image3 from "next/image";
|
|
28844
28983
|
import { DropdownMenuSeparator } from "@radix-ui/react-dropdown-menu";
|
|
28845
|
-
import { Fragment as Fragment18, jsx as jsx58, jsxs as
|
|
28984
|
+
import { Fragment as Fragment18, jsx as jsx58, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
28846
28985
|
function Navbar({
|
|
28847
28986
|
style,
|
|
28848
28987
|
badgeType,
|
|
@@ -28858,7 +28997,7 @@ function Navbar({
|
|
|
28858
28997
|
userName = "Guest User"
|
|
28859
28998
|
}) {
|
|
28860
28999
|
const isMobileView = canvasMode === "mobile" || canvasMode === "tablet";
|
|
28861
|
-
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: [
|
|
28862
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" }) }),
|
|
28863
29002
|
!isMobileView && /* @__PURE__ */ jsx58("div", { className: "flex items-center space-x-6 sm:hidden md:flex", children: list.map((item) => /* @__PURE__ */ jsx58(
|
|
28864
29003
|
Link6,
|
|
@@ -28869,8 +29008,8 @@ function Navbar({
|
|
|
28869
29008
|
},
|
|
28870
29009
|
item.id
|
|
28871
29010
|
)) }),
|
|
28872
|
-
/* @__PURE__ */
|
|
28873
|
-
!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: [
|
|
28874
29013
|
/* @__PURE__ */ jsx58(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" }),
|
|
28875
29014
|
/* @__PURE__ */ jsx58(Input, { placeholder: "Search", className: "pl-9 text-gray-400" })
|
|
28876
29015
|
] }) }) : /* @__PURE__ */ jsx58(
|
|
@@ -28882,14 +29021,14 @@ function Navbar({
|
|
|
28882
29021
|
children: /* @__PURE__ */ jsx58(Search, { className: "h-5 w-5 text-gray-400" })
|
|
28883
29022
|
}
|
|
28884
29023
|
),
|
|
28885
|
-
/* @__PURE__ */
|
|
29024
|
+
/* @__PURE__ */ jsxs33("div", { className: "relative bg-[#E9E9E9] rounded-md", children: [
|
|
28886
29025
|
/* @__PURE__ */ jsx58(Button, { variant: "ghost", size: "icon", children: /* @__PURE__ */ jsx58(Bell, { className: "h-5 w-5 text-[#1C1B1F]" }) }),
|
|
28887
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" })
|
|
28888
29027
|
] }),
|
|
28889
|
-
/* @__PURE__ */
|
|
28890
|
-
/* @__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: [
|
|
28891
29030
|
!isMobileView && showName && /* @__PURE__ */ jsx58("h4", { className: "text-[#000000] text-[13px] font-[500] mb-0", children: userName }),
|
|
28892
|
-
!isMobileView ? /* @__PURE__ */
|
|
29031
|
+
!isMobileView ? /* @__PURE__ */ jsxs33(Fragment18, { children: [
|
|
28893
29032
|
/* @__PURE__ */ jsx58(Avatar, { className: "cursor-pointer h-8 w-8 text-gray-900", children: profileType === "avatar" ? /* @__PURE__ */ jsx58(
|
|
28894
29033
|
AvatarImage,
|
|
28895
29034
|
{
|
|
@@ -28916,9 +29055,9 @@ function Navbar({
|
|
|
28916
29055
|
}
|
|
28917
29056
|
)
|
|
28918
29057
|
] }) }),
|
|
28919
|
-
/* @__PURE__ */
|
|
29058
|
+
/* @__PURE__ */ jsxs33(DropdownMenuContent, { align: "end", className: "bg-white", children: [
|
|
28920
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)) }),
|
|
28921
|
-
/* @__PURE__ */
|
|
29060
|
+
/* @__PURE__ */ jsxs33("div", { className: "md:hidden", children: [
|
|
28922
29061
|
/* @__PURE__ */ jsx58(DropdownMenuSeparator, {}),
|
|
28923
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)) })
|
|
28924
29063
|
] })
|
|
@@ -28930,20 +29069,20 @@ function Navbar({
|
|
|
28930
29069
|
|
|
28931
29070
|
// src/components/Chart/BarChart.tsx
|
|
28932
29071
|
import { BarChart, Bar, Area, AreaChart, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, Legend } from "recharts";
|
|
28933
|
-
import { jsx as jsx59, jsxs as
|
|
29072
|
+
import { jsx as jsx59, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
28934
29073
|
var ChartComponent = ({ className, style, ...props }) => {
|
|
28935
29074
|
const data = Array.isArray(props?.data) ? props.data : [];
|
|
28936
29075
|
const chartType = props.chartType || "bar";
|
|
28937
29076
|
const legendsPosition = props.legendsPosition === "middle" || props.legendsPosition === "bottom" ? props.legendsPosition : "top";
|
|
28938
|
-
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: [
|
|
28939
29078
|
/* @__PURE__ */ jsx59(CartesianGrid, { strokeDasharray: "3 3" }),
|
|
28940
29079
|
/* @__PURE__ */ jsx59(XAxis, { dataKey: "name" }),
|
|
28941
29080
|
/* @__PURE__ */ jsx59(YAxis, {}),
|
|
28942
29081
|
/* @__PURE__ */ jsx59(Tooltip, {}),
|
|
28943
29082
|
/* @__PURE__ */ jsx59(Legend, { verticalAlign: legendsPosition, align: "center" }),
|
|
28944
29083
|
/* @__PURE__ */ jsx59(Bar, { dataKey: "value", fill: "#00695C" })
|
|
28945
|
-
] }) : /* @__PURE__ */
|
|
28946
|
-
/* @__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: [
|
|
28947
29086
|
/* @__PURE__ */ jsx59("stop", { offset: "5%", stopColor: "#00695C", stopOpacity: 0.8 }),
|
|
28948
29087
|
/* @__PURE__ */ jsx59("stop", { offset: "95%", stopColor: "#00695C", stopOpacity: 0 })
|
|
28949
29088
|
] }) }),
|
|
@@ -28967,7 +29106,7 @@ var BarChart_default = ChartComponent;
|
|
|
28967
29106
|
|
|
28968
29107
|
// src/components/Chart/PieChart.tsx
|
|
28969
29108
|
import { PieChart, Pie, Cell, ResponsiveContainer as ResponsiveContainer2, Tooltip as Tooltip2, LabelList } from "recharts";
|
|
28970
|
-
import { Fragment as Fragment19, jsx as jsx60, jsxs as
|
|
29109
|
+
import { Fragment as Fragment19, jsx as jsx60, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
28971
29110
|
var DonutChart = ({ className, style, ...props }) => {
|
|
28972
29111
|
const data = Array.isArray(props?.data) ? props.data : [];
|
|
28973
29112
|
const total = data.reduce((sum, d) => sum + d.value, 0);
|
|
@@ -28978,7 +29117,7 @@ var DonutChart = ({ className, style, ...props }) => {
|
|
|
28978
29117
|
const renderLabel = ({ value, x, y }) => {
|
|
28979
29118
|
if (value == null) return null;
|
|
28980
29119
|
const percentage = (Number(value) / total * 100).toFixed(0);
|
|
28981
|
-
return /* @__PURE__ */
|
|
29120
|
+
return /* @__PURE__ */ jsxs35(
|
|
28982
29121
|
"text",
|
|
28983
29122
|
{
|
|
28984
29123
|
x,
|
|
@@ -29000,7 +29139,7 @@ var DonutChart = ({ className, style, ...props }) => {
|
|
|
29000
29139
|
const wrapperClass = canvasMode ? forceDesktop ? "flex-row" : "flex-col" : "flex-col md:flex-row";
|
|
29001
29140
|
const renderLegends = () => {
|
|
29002
29141
|
if (!showLegends) return null;
|
|
29003
|
-
return /* @__PURE__ */ jsx60(Fragment19, { children: data.map((d) => /* @__PURE__ */
|
|
29142
|
+
return /* @__PURE__ */ jsx60(Fragment19, { children: data.map((d) => /* @__PURE__ */ jsxs35(
|
|
29004
29143
|
"div",
|
|
29005
29144
|
{
|
|
29006
29145
|
className: "flex items-center space-x-2 rounded-md border border-gray-200 px-3 py-2 w-[48%] md:w-auto",
|
|
@@ -29018,15 +29157,15 @@ var DonutChart = ({ className, style, ...props }) => {
|
|
|
29018
29157
|
d.name
|
|
29019
29158
|
)) });
|
|
29020
29159
|
};
|
|
29021
|
-
return /* @__PURE__ */
|
|
29160
|
+
return /* @__PURE__ */ jsxs35(
|
|
29022
29161
|
"div",
|
|
29023
29162
|
{
|
|
29024
29163
|
className: `relative flex items-center ${wrapperClass} ${className}`,
|
|
29025
29164
|
style,
|
|
29026
29165
|
children: [
|
|
29027
|
-
/* @__PURE__ */
|
|
29028
|
-
data.length > 0 && /* @__PURE__ */ jsx60(ResponsiveContainer2, { width: "100%", height: "100%", children: /* @__PURE__ */
|
|
29029
|
-
/* @__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(
|
|
29030
29169
|
Pie,
|
|
29031
29170
|
{
|
|
29032
29171
|
data,
|
|
@@ -29052,7 +29191,7 @@ var DonutChart = ({ className, style, ...props }) => {
|
|
|
29052
29191
|
),
|
|
29053
29192
|
/* @__PURE__ */ jsx60(Tooltip2, { formatter: (value, name) => [`${value}k`, name] })
|
|
29054
29193
|
] }) }),
|
|
29055
|
-
/* @__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: [
|
|
29056
29195
|
total,
|
|
29057
29196
|
"k"
|
|
29058
29197
|
] })
|
|
@@ -29066,9 +29205,9 @@ var DonutChart = ({ className, style, ...props }) => {
|
|
|
29066
29205
|
var PieChart_default = DonutChart;
|
|
29067
29206
|
|
|
29068
29207
|
// src/components/Blocks/EmailComposer.tsx
|
|
29069
|
-
import { jsx as jsx61, jsxs as
|
|
29208
|
+
import { jsx as jsx61, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
29070
29209
|
function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc, setShowBcc, cc, setCc, bcc, setBcc, subject, setSubject, body, setBody }) {
|
|
29071
|
-
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: [
|
|
29072
29211
|
/* @__PURE__ */ jsx61("div", { className: "mb-3", children: /* @__PURE__ */ jsx61(
|
|
29073
29212
|
"input",
|
|
29074
29213
|
{
|
|
@@ -29078,7 +29217,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
29078
29217
|
required: true
|
|
29079
29218
|
}
|
|
29080
29219
|
) }),
|
|
29081
|
-
/* @__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: [
|
|
29082
29221
|
/* @__PURE__ */ jsx61(
|
|
29083
29222
|
"input",
|
|
29084
29223
|
{
|
|
@@ -29138,7 +29277,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
29138
29277
|
}
|
|
29139
29278
|
) }),
|
|
29140
29279
|
/* @__PURE__ */ jsx61("div", { className: "mb-4", children: /* @__PURE__ */ jsx61(MyEditor, { value: body, onChange: setBody }) }),
|
|
29141
|
-
/* @__PURE__ */
|
|
29280
|
+
/* @__PURE__ */ jsxs36("div", { className: "flex justify-end gap-2", children: [
|
|
29142
29281
|
/* @__PURE__ */ jsx61("button", { className: "px-4 py-2 rounded-md text-gray-600 hover:bg-gray-100", children: "Discard" }),
|
|
29143
29282
|
/* @__PURE__ */ jsx61("button", { className: "px-4 py-2 rounded-md border text-[#12715B] border-[#12715B]", children: "Reset" }),
|
|
29144
29283
|
/* @__PURE__ */ jsx61("button", { className: "px-4 py-2 rounded-md bg-[#12715B] text-white", children: "Send" })
|