@beyondcorp/beyond-ui 1.0.5 → 1.0.7

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.cjs CHANGED
@@ -1342,6 +1342,948 @@ var DashboardGridItem = React11__namespace.forwardRef(
1342
1342
  );
1343
1343
  DashboardGrid.displayName = "DashboardGrid";
1344
1344
  DashboardGridItem.displayName = "DashboardGridItem";
1345
+ var tableVariants = classVarianceAuthority.cva(
1346
+ "w-full border-collapse bg-white",
1347
+ {
1348
+ variants: {
1349
+ size: {
1350
+ small: "text-xs",
1351
+ middle: "text-sm",
1352
+ large: "text-base"
1353
+ },
1354
+ bordered: {
1355
+ true: "border border-gray-200",
1356
+ false: ""
1357
+ }
1358
+ },
1359
+ defaultVariants: {
1360
+ size: "middle",
1361
+ bordered: false
1362
+ }
1363
+ }
1364
+ );
1365
+ var cellVariants = classVarianceAuthority.cva(
1366
+ "border-b border-gray-200 transition-colors",
1367
+ {
1368
+ variants: {
1369
+ size: {
1370
+ small: "px-2 py-1",
1371
+ middle: "px-4 py-3",
1372
+ large: "px-6 py-4"
1373
+ },
1374
+ align: {
1375
+ left: "text-left",
1376
+ center: "text-center",
1377
+ right: "text-right"
1378
+ },
1379
+ type: {
1380
+ header: "bg-gray-50 font-semibold text-gray-900 border-b-2 border-gray-200",
1381
+ body: "text-gray-700 hover:bg-gray-50"
1382
+ }
1383
+ },
1384
+ defaultVariants: {
1385
+ size: "middle",
1386
+ align: "left",
1387
+ type: "body"
1388
+ }
1389
+ }
1390
+ );
1391
+ var ColumnFilter = ({
1392
+ column,
1393
+ value,
1394
+ onChange
1395
+ }) => {
1396
+ const [isOpen, setIsOpen] = React11.useState(false);
1397
+ const [tempValue, setTempValue] = React11.useState(value || "");
1398
+ const handleApply = () => {
1399
+ onChange(tempValue);
1400
+ setIsOpen(false);
1401
+ };
1402
+ const handleClear = () => {
1403
+ setTempValue("");
1404
+ onChange("");
1405
+ setIsOpen(false);
1406
+ };
1407
+ if (!column.filterable) return null;
1408
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative inline-block", children: [
1409
+ /* @__PURE__ */ jsxRuntime.jsx(
1410
+ Button,
1411
+ {
1412
+ variant: "ghost",
1413
+ size: "sm",
1414
+ onClick: () => setIsOpen(!isOpen),
1415
+ className: cn(
1416
+ "p-1 h-6 w-6",
1417
+ value && "text-primary-600"
1418
+ ),
1419
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Filter, { className: "h-3 w-3" })
1420
+ }
1421
+ ),
1422
+ isOpen && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1423
+ /* @__PURE__ */ jsxRuntime.jsx(
1424
+ "div",
1425
+ {
1426
+ className: "fixed inset-0 z-10",
1427
+ onClick: () => setIsOpen(false)
1428
+ }
1429
+ ),
1430
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute top-full left-0 z-20 mt-1 bg-white border border-gray-200 rounded-lg shadow-lg p-3 min-w-[200px]", children: [
1431
+ column.filterType === "select" && column.filterOptions ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2", children: column.filterOptions.map((option) => /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex items-center space-x-2", children: [
1432
+ /* @__PURE__ */ jsxRuntime.jsx(
1433
+ Checkbox,
1434
+ {
1435
+ checked: tempValue === option.value,
1436
+ onChange: () => setTempValue(
1437
+ tempValue === option.value ? "" : option.value
1438
+ )
1439
+ }
1440
+ ),
1441
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm", children: option.label })
1442
+ ] }, option.value)) }) : /* @__PURE__ */ jsxRuntime.jsx(
1443
+ Input,
1444
+ {
1445
+ placeholder: `Filter ${column.title}`,
1446
+ value: tempValue,
1447
+ onChange: (e) => setTempValue(e.target.value),
1448
+ className: "mb-2"
1449
+ }
1450
+ ),
1451
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end space-x-2 mt-3", children: [
1452
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "ghost", size: "sm", onClick: handleClear, children: "Clear" }),
1453
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "primary", size: "sm", onClick: handleApply, children: "Apply" })
1454
+ ] })
1455
+ ] })
1456
+ ] })
1457
+ ] });
1458
+ };
1459
+ var TablePagination = ({ pagination, onChange }) => {
1460
+ const { current, pageSize, total, showSizeChanger = true, pageSizeOptions = [10, 20, 50, 100] } = pagination;
1461
+ const totalPages = Math.ceil(total / pageSize);
1462
+ const startRecord = (current - 1) * pageSize + 1;
1463
+ const endRecord = Math.min(current * pageSize, total);
1464
+ const getPageNumbers = () => {
1465
+ const pages = [];
1466
+ const maxVisible = 5;
1467
+ if (totalPages <= maxVisible) {
1468
+ for (let i = 1; i <= totalPages; i++) {
1469
+ pages.push(i);
1470
+ }
1471
+ } else {
1472
+ const start = Math.max(1, current - 2);
1473
+ const end = Math.min(totalPages, start + maxVisible - 1);
1474
+ for (let i = start; i <= end; i++) {
1475
+ pages.push(i);
1476
+ }
1477
+ }
1478
+ return pages;
1479
+ };
1480
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between px-4 py-3 bg-white border-t border-gray-200", children: [
1481
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-4", children: [
1482
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm text-gray-700", children: [
1483
+ "Showing ",
1484
+ startRecord,
1485
+ " to ",
1486
+ endRecord,
1487
+ " of ",
1488
+ total,
1489
+ " results"
1490
+ ] }),
1491
+ showSizeChanger && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-2", children: [
1492
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-gray-700", children: "Show" }),
1493
+ /* @__PURE__ */ jsxRuntime.jsx(
1494
+ "select",
1495
+ {
1496
+ value: pageSize,
1497
+ onChange: (e) => onChange(1, Number(e.target.value)),
1498
+ className: "border border-gray-300 rounded px-2 py-1 text-sm",
1499
+ children: pageSizeOptions.map((size) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: size, children: size }, size))
1500
+ }
1501
+ ),
1502
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-gray-700", children: "per page" })
1503
+ ] })
1504
+ ] }),
1505
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-1", children: [
1506
+ /* @__PURE__ */ jsxRuntime.jsx(
1507
+ Button,
1508
+ {
1509
+ variant: "ghost",
1510
+ size: "sm",
1511
+ onClick: () => onChange(1, pageSize),
1512
+ disabled: current === 1,
1513
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronsLeft, { className: "h-4 w-4" })
1514
+ }
1515
+ ),
1516
+ /* @__PURE__ */ jsxRuntime.jsx(
1517
+ Button,
1518
+ {
1519
+ variant: "ghost",
1520
+ size: "sm",
1521
+ onClick: () => onChange(current - 1, pageSize),
1522
+ disabled: current === 1,
1523
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, { className: "h-4 w-4" })
1524
+ }
1525
+ ),
1526
+ getPageNumbers().map((page) => /* @__PURE__ */ jsxRuntime.jsx(
1527
+ Button,
1528
+ {
1529
+ variant: current === page ? "primary" : "ghost",
1530
+ size: "sm",
1531
+ onClick: () => onChange(page, pageSize),
1532
+ className: "min-w-[32px]",
1533
+ children: page
1534
+ },
1535
+ page
1536
+ )),
1537
+ /* @__PURE__ */ jsxRuntime.jsx(
1538
+ Button,
1539
+ {
1540
+ variant: "ghost",
1541
+ size: "sm",
1542
+ onClick: () => onChange(current + 1, pageSize),
1543
+ disabled: current === totalPages,
1544
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4" })
1545
+ }
1546
+ ),
1547
+ /* @__PURE__ */ jsxRuntime.jsx(
1548
+ Button,
1549
+ {
1550
+ variant: "ghost",
1551
+ size: "sm",
1552
+ onClick: () => onChange(totalPages, pageSize),
1553
+ disabled: current === totalPages,
1554
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronsRight, { className: "h-4 w-4" })
1555
+ }
1556
+ )
1557
+ ] })
1558
+ ] });
1559
+ };
1560
+ var DataTable = ({
1561
+ columns,
1562
+ dataSource,
1563
+ loading = false,
1564
+ rowKey = "id",
1565
+ pagination = { current: 1, pageSize: 10, total: 0 },
1566
+ rowSelection,
1567
+ size = "middle",
1568
+ bordered = false,
1569
+ showHeader = true,
1570
+ title,
1571
+ footer,
1572
+ className,
1573
+ onSort,
1574
+ onFilter,
1575
+ onChange,
1576
+ ...props
1577
+ }) => {
1578
+ const [sortConfig, setSortConfig] = React11.useState({ key: "", direction: null });
1579
+ const [filters, setFilters] = React11.useState({});
1580
+ const [selectedRowKeys, setSelectedRowKeys] = React11.useState(
1581
+ rowSelection?.selectedRowKeys || []
1582
+ );
1583
+ const getRowKey = React11.useCallback((record, index) => {
1584
+ if (typeof rowKey === "function") {
1585
+ return rowKey(record);
1586
+ }
1587
+ return record[rowKey] || index;
1588
+ }, [rowKey]);
1589
+ const handleSort = React11.useCallback((columnKey) => {
1590
+ let newDirection;
1591
+ if (sortConfig.key !== columnKey) {
1592
+ newDirection = "asc";
1593
+ } else if (sortConfig.direction === "asc") {
1594
+ newDirection = "desc";
1595
+ } else if (sortConfig.direction === "desc") {
1596
+ newDirection = null;
1597
+ } else {
1598
+ newDirection = "asc";
1599
+ }
1600
+ const newSortConfig = { key: columnKey, direction: newDirection };
1601
+ setSortConfig(newSortConfig);
1602
+ onSort?.(newSortConfig);
1603
+ onChange?.(pagination, filters, newSortConfig);
1604
+ }, [sortConfig, pagination, filters, onSort, onChange]);
1605
+ const handleFilter = React11.useCallback((columnKey, value) => {
1606
+ const newFilters = { ...filters };
1607
+ if (value === "" || value === null || value === void 0) {
1608
+ delete newFilters[columnKey];
1609
+ } else {
1610
+ newFilters[columnKey] = value;
1611
+ }
1612
+ setFilters(newFilters);
1613
+ onFilter?.(newFilters);
1614
+ onChange?.(pagination, newFilters, sortConfig);
1615
+ }, [filters, pagination, sortConfig, onFilter, onChange]);
1616
+ const handleRowSelect = React11.useCallback((record, selected) => {
1617
+ const key = getRowKey(record, 0);
1618
+ let newSelectedKeys;
1619
+ if (rowSelection?.type === "radio") {
1620
+ newSelectedKeys = selected ? [key] : [];
1621
+ } else {
1622
+ newSelectedKeys = selected ? [...selectedRowKeys, key] : selectedRowKeys.filter((k) => k !== key);
1623
+ }
1624
+ setSelectedRowKeys(newSelectedKeys);
1625
+ const selectedRows = dataSource.filter(
1626
+ (item) => newSelectedKeys.includes(getRowKey(item, 0))
1627
+ );
1628
+ rowSelection?.onChange?.(newSelectedKeys, selectedRows);
1629
+ rowSelection?.onSelect?.(record, selected, selectedRows, {});
1630
+ }, [selectedRowKeys, rowSelection, dataSource, getRowKey]);
1631
+ const handleSelectAll = React11.useCallback((selected) => {
1632
+ const newSelectedKeys = selected ? dataSource.map((item, index) => getRowKey(item, index)) : [];
1633
+ setSelectedRowKeys(newSelectedKeys);
1634
+ const selectedRows = selected ? dataSource : [];
1635
+ rowSelection?.onChange?.(newSelectedKeys, selectedRows);
1636
+ rowSelection?.onSelectAll?.(selected, selectedRows, dataSource);
1637
+ }, [dataSource, rowSelection, getRowKey]);
1638
+ const processedData = React11.useMemo(() => {
1639
+ let result = [...dataSource];
1640
+ Object.entries(filters).forEach(([key, value]) => {
1641
+ if (value !== "" && value !== null && value !== void 0) {
1642
+ result = result.filter((item) => {
1643
+ const itemValue = item[key];
1644
+ if (typeof itemValue === "string") {
1645
+ return itemValue.toLowerCase().includes(String(value).toLowerCase());
1646
+ }
1647
+ return itemValue === value;
1648
+ });
1649
+ }
1650
+ });
1651
+ if (sortConfig.key && sortConfig.direction) {
1652
+ result.sort((a, b) => {
1653
+ const aValue = a[sortConfig.key];
1654
+ const bValue = b[sortConfig.key];
1655
+ if (aValue === bValue) return 0;
1656
+ const comparison = aValue < bValue ? -1 : 1;
1657
+ return sortConfig.direction === "asc" ? comparison : -comparison;
1658
+ });
1659
+ }
1660
+ return result;
1661
+ }, [dataSource, filters, sortConfig]);
1662
+ const paginatedData = React11.useMemo(() => {
1663
+ if (!pagination) return processedData;
1664
+ const { current, pageSize } = pagination;
1665
+ const startIndex = (current - 1) * pageSize;
1666
+ return processedData.slice(startIndex, startIndex + pageSize);
1667
+ }, [processedData, pagination]);
1668
+ const currentPagination = React11.useMemo(() => {
1669
+ if (!pagination) return false;
1670
+ return {
1671
+ ...pagination,
1672
+ total: processedData.length
1673
+ };
1674
+ }, [pagination, processedData.length]);
1675
+ const isAllSelected = selectedRowKeys.length === dataSource.length && dataSource.length > 0;
1676
+ const isIndeterminate = selectedRowKeys.length > 0 && selectedRowKeys.length < dataSource.length;
1677
+ if (loading) {
1678
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("w-full", className), children: [
1679
+ title && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-4", children: title() }),
1680
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border border-gray-200 rounded-lg overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 space-y-3", children: Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex space-x-4", children: [
1681
+ /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-4 w-8" }),
1682
+ /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-4 flex-1" }),
1683
+ /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-4 w-24" }),
1684
+ /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-4 w-16" })
1685
+ ] }, i)) }) })
1686
+ ] });
1687
+ }
1688
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("w-full", className), children: [
1689
+ title && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-4", children: title() }),
1690
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border border-gray-200 rounded-lg overflow-hidden", children: [
1691
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: cn(tableVariants({ size, bordered })), children: [
1692
+ showHeader && /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
1693
+ rowSelection && /* @__PURE__ */ jsxRuntime.jsx("th", { className: cn(cellVariants({ size, type: "header" }), "w-12"), children: rowSelection.type !== "radio" && /* @__PURE__ */ jsxRuntime.jsx(
1694
+ Checkbox,
1695
+ {
1696
+ checked: isAllSelected,
1697
+ onChange: (e) => handleSelectAll(e.target.checked),
1698
+ className: cn(isIndeterminate && "indeterminate")
1699
+ }
1700
+ ) }),
1701
+ columns.map((column) => /* @__PURE__ */ jsxRuntime.jsx(
1702
+ "th",
1703
+ {
1704
+ className: cn(
1705
+ cellVariants({
1706
+ size,
1707
+ align: column.align,
1708
+ type: "header"
1709
+ }),
1710
+ column.width && `w-[${column.width}]`
1711
+ ),
1712
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
1713
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-2", children: [
1714
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: column.title }),
1715
+ column.sortable && /* @__PURE__ */ jsxRuntime.jsxs(
1716
+ "button",
1717
+ {
1718
+ onClick: () => handleSort(column.key),
1719
+ className: "flex flex-col items-center hover:text-primary-600",
1720
+ children: [
1721
+ /* @__PURE__ */ jsxRuntime.jsx(
1722
+ lucideReact.ChevronUp,
1723
+ {
1724
+ className: cn(
1725
+ "h-3 w-3",
1726
+ sortConfig.key === column.key && sortConfig.direction === "asc" ? "text-primary-600" : "text-gray-400"
1727
+ )
1728
+ }
1729
+ ),
1730
+ /* @__PURE__ */ jsxRuntime.jsx(
1731
+ lucideReact.ChevronDown,
1732
+ {
1733
+ className: cn(
1734
+ "h-3 w-3 -mt-1",
1735
+ sortConfig.key === column.key && sortConfig.direction === "desc" ? "text-primary-600" : "text-gray-400"
1736
+ )
1737
+ }
1738
+ )
1739
+ ]
1740
+ }
1741
+ )
1742
+ ] }),
1743
+ /* @__PURE__ */ jsxRuntime.jsx(
1744
+ ColumnFilter,
1745
+ {
1746
+ column,
1747
+ value: filters[column.key],
1748
+ onChange: (value) => handleFilter(column.key, value)
1749
+ }
1750
+ )
1751
+ ] })
1752
+ },
1753
+ column.key
1754
+ ))
1755
+ ] }) }),
1756
+ /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: paginatedData.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx(
1757
+ "td",
1758
+ {
1759
+ colSpan: columns.length + (rowSelection ? 1 : 0),
1760
+ className: cn(cellVariants({ size, align: "center" }), "py-8"),
1761
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-gray-500", children: [
1762
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-4xl mb-2", children: "\u{1F4CB}" }),
1763
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: "No data available" })
1764
+ ] })
1765
+ }
1766
+ ) }) : paginatedData.map((record, index) => {
1767
+ const key = getRowKey(record, index);
1768
+ const isSelected = selectedRowKeys.includes(key);
1769
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1770
+ "tr",
1771
+ {
1772
+ className: cn(
1773
+ "hover:bg-gray-50 transition-colors",
1774
+ isSelected && "bg-primary-50"
1775
+ ),
1776
+ ...props.onRow?.(record, index) ?? {},
1777
+ children: [
1778
+ rowSelection && /* @__PURE__ */ jsxRuntime.jsx("td", { className: cn(cellVariants({ size })), children: /* @__PURE__ */ jsxRuntime.jsx(
1779
+ Checkbox,
1780
+ {
1781
+ checked: isSelected,
1782
+ onChange: (e) => handleRowSelect(record, e.target.checked),
1783
+ ...rowSelection.getCheckboxProps?.(record)
1784
+ }
1785
+ ) }),
1786
+ columns.map((column) => /* @__PURE__ */ jsxRuntime.jsx(
1787
+ "td",
1788
+ {
1789
+ className: cn(cellVariants({
1790
+ size,
1791
+ align: column.align
1792
+ })),
1793
+ children: column.render ? column.render(record[column.dataIndex], record, index) : String(record[column.dataIndex] || "")
1794
+ },
1795
+ column.key
1796
+ ))
1797
+ ]
1798
+ },
1799
+ key
1800
+ );
1801
+ }) })
1802
+ ] }) }),
1803
+ currentPagination && /* @__PURE__ */ jsxRuntime.jsx(
1804
+ TablePagination,
1805
+ {
1806
+ pagination: currentPagination,
1807
+ onChange: (page, pageSize) => {
1808
+ const newPagination = { ...currentPagination, current: page, pageSize };
1809
+ onChange?.(newPagination, filters, sortConfig);
1810
+ }
1811
+ }
1812
+ )
1813
+ ] }),
1814
+ footer && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-4", children: footer() })
1815
+ ] });
1816
+ };
1817
+ DataTable.displayName = "DataTable";
1818
+ var generateUsers = () => {
1819
+ const roles = ["Admin", "Manager", "Developer", "Designer", "Analyst"];
1820
+ const departments = ["Engineering", "Design", "Marketing", "Sales", "HR"];
1821
+ const statuses = ["active", "inactive", "pending"];
1822
+ return Array.from({ length: 50 }, (_, i) => ({
1823
+ id: i + 1,
1824
+ name: `User ${i + 1}`,
1825
+ email: `user${i + 1}@company.com`,
1826
+ role: roles[Math.floor(Math.random() * roles.length)],
1827
+ status: statuses[Math.floor(Math.random() * statuses.length)],
1828
+ avatar: `https://images.pexels.com/photos/${774909 + i}/pexels-photo-${774909 + i}.jpeg?auto=compress&cs=tinysrgb&w=64`,
1829
+ joinDate: new Date(2020 + Math.floor(Math.random() * 4), Math.floor(Math.random() * 12), Math.floor(Math.random() * 28) + 1).toISOString().split("T")[0],
1830
+ lastLogin: new Date(Date.now() - Math.floor(Math.random() * 30) * 24 * 60 * 60 * 1e3).toISOString().split("T")[0],
1831
+ department: departments[Math.floor(Math.random() * departments.length)]
1832
+ }));
1833
+ };
1834
+ var generateSales = () => {
1835
+ const products = ["Pro Plan", "Basic Plan", "Enterprise", "Starter", "Premium"];
1836
+ const regions = ["North America", "Europe", "Asia Pacific", "Latin America"];
1837
+ const statuses = ["completed", "pending", "cancelled"];
1838
+ return Array.from({ length: 75 }, (_, i) => ({
1839
+ id: i + 1,
1840
+ product: products[Math.floor(Math.random() * products.length)],
1841
+ customer: `Customer ${i + 1}`,
1842
+ amount: Math.floor(Math.random() * 1e4) + 100,
1843
+ status: statuses[Math.floor(Math.random() * statuses.length)],
1844
+ date: new Date(2024, Math.floor(Math.random() * 12), Math.floor(Math.random() * 28) + 1).toISOString().split("T")[0],
1845
+ region: regions[Math.floor(Math.random() * regions.length)],
1846
+ salesperson: `Sales Rep ${Math.floor(Math.random() * 10) + 1}`
1847
+ }));
1848
+ };
1849
+ var generateTasks = () => {
1850
+ const priorities = ["low", "medium", "high", "urgent"];
1851
+ const statuses = ["todo", "in-progress", "review", "completed"];
1852
+ const projects = ["Website Redesign", "Mobile App", "API Integration", "Dashboard", "Marketing Campaign"];
1853
+ const tagOptions = ["frontend", "backend", "design", "testing", "documentation", "bug", "feature"];
1854
+ return Array.from({ length: 60 }, (_, i) => ({
1855
+ id: i + 1,
1856
+ title: `Task ${i + 1}: Implement feature`,
1857
+ assignee: `Developer ${Math.floor(Math.random() * 8) + 1}`,
1858
+ priority: priorities[Math.floor(Math.random() * priorities.length)],
1859
+ status: statuses[Math.floor(Math.random() * statuses.length)],
1860
+ dueDate: new Date(Date.now() + Math.floor(Math.random() * 60) * 24 * 60 * 60 * 1e3).toISOString().split("T")[0],
1861
+ project: projects[Math.floor(Math.random() * projects.length)],
1862
+ tags: Array.from(
1863
+ { length: Math.floor(Math.random() * 3) + 1 },
1864
+ () => tagOptions[Math.floor(Math.random() * tagOptions.length)]
1865
+ ).filter((tag, index, arr) => arr.indexOf(tag) === index)
1866
+ }));
1867
+ };
1868
+ var usersData = generateUsers();
1869
+ var salesData = generateSales();
1870
+ var tasksData = generateTasks();
1871
+ var DataTableShowcase = () => {
1872
+ const [selectedTab, setSelectedTab] = React11.useState("users");
1873
+ const [selectedRows, setSelectedRows] = React11.useState([]);
1874
+ const userColumns = [
1875
+ {
1876
+ key: "user",
1877
+ title: "User",
1878
+ dataIndex: "name",
1879
+ sortable: true,
1880
+ filterable: true,
1881
+ filterType: "text",
1882
+ render: (_, record) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-3", children: [
1883
+ /* @__PURE__ */ jsxRuntime.jsxs(Avatar, { size: "sm", children: [
1884
+ /* @__PURE__ */ jsxRuntime.jsx(AvatarImage, { src: record.avatar }),
1885
+ /* @__PURE__ */ jsxRuntime.jsx(AvatarFallback, { children: record.name.split(" ").map((n) => n[0]).join("") })
1886
+ ] }),
1887
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1888
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium text-gray-900", children: record.name }),
1889
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: record.email })
1890
+ ] })
1891
+ ] })
1892
+ },
1893
+ {
1894
+ key: "role",
1895
+ title: "Role",
1896
+ dataIndex: "role",
1897
+ sortable: true,
1898
+ filterable: true,
1899
+ filterType: "select",
1900
+ filterOptions: [
1901
+ { label: "Admin", value: "Admin" },
1902
+ { label: "Manager", value: "Manager" },
1903
+ { label: "Developer", value: "Developer" },
1904
+ { label: "Designer", value: "Designer" },
1905
+ { label: "Analyst", value: "Analyst" }
1906
+ ]
1907
+ },
1908
+ {
1909
+ key: "department",
1910
+ title: "Department",
1911
+ dataIndex: "department",
1912
+ sortable: true,
1913
+ filterable: true,
1914
+ filterType: "select",
1915
+ filterOptions: [
1916
+ { label: "Engineering", value: "Engineering" },
1917
+ { label: "Design", value: "Design" },
1918
+ { label: "Marketing", value: "Marketing" },
1919
+ { label: "Sales", value: "Sales" },
1920
+ { label: "HR", value: "HR" }
1921
+ ]
1922
+ },
1923
+ {
1924
+ key: "status",
1925
+ title: "Status",
1926
+ dataIndex: "status",
1927
+ sortable: true,
1928
+ filterable: true,
1929
+ filterType: "select",
1930
+ filterOptions: [
1931
+ { label: "Active", value: "active" },
1932
+ { label: "Inactive", value: "inactive" },
1933
+ { label: "Pending", value: "pending" }
1934
+ ],
1935
+ render: (status) => /* @__PURE__ */ jsxRuntime.jsx(
1936
+ Badge,
1937
+ {
1938
+ variant: status === "active" ? "success" : status === "inactive" ? "secondary" : "warning",
1939
+ children: status.charAt(0).toUpperCase() + status.slice(1)
1940
+ }
1941
+ )
1942
+ },
1943
+ {
1944
+ key: "joinDate",
1945
+ title: "Join Date",
1946
+ dataIndex: "joinDate",
1947
+ sortable: true,
1948
+ filterable: true,
1949
+ filterType: "date"
1950
+ },
1951
+ {
1952
+ key: "actions",
1953
+ title: "Actions",
1954
+ dataIndex: "id",
1955
+ align: "center",
1956
+ render: (_, record) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-center space-x-1", children: [
1957
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "ghost", size: "sm", onClick: () => showToast.info(`View user ${record.name}`), children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Eye, { className: "h-4 w-4" }) }),
1958
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "ghost", size: "sm", onClick: () => showToast.info(`Edit user ${record.name}`), children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Edit, { className: "h-4 w-4" }) }),
1959
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "ghost", size: "sm", onClick: () => showToast.warning(`Delete user ${record.name}`), children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "h-4 w-4 text-danger-600" }) })
1960
+ ] })
1961
+ }
1962
+ ];
1963
+ const salesColumns = [
1964
+ {
1965
+ key: "product",
1966
+ title: "Product",
1967
+ dataIndex: "product",
1968
+ sortable: true,
1969
+ filterable: true,
1970
+ filterType: "text",
1971
+ render: (product) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium text-gray-900", children: product })
1972
+ },
1973
+ {
1974
+ key: "customer",
1975
+ title: "Customer",
1976
+ dataIndex: "customer",
1977
+ sortable: true,
1978
+ filterable: true,
1979
+ filterType: "text"
1980
+ },
1981
+ {
1982
+ key: "amount",
1983
+ title: "Amount",
1984
+ dataIndex: "amount",
1985
+ sortable: true,
1986
+ filterable: true,
1987
+ filterType: "number",
1988
+ align: "right",
1989
+ render: (amount) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-end space-x-1", children: [
1990
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.DollarSign, { className: "h-4 w-4 text-gray-400" }),
1991
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: amount.toLocaleString() })
1992
+ ] })
1993
+ },
1994
+ {
1995
+ key: "status",
1996
+ title: "Status",
1997
+ dataIndex: "status",
1998
+ sortable: true,
1999
+ filterable: true,
2000
+ filterType: "select",
2001
+ filterOptions: [
2002
+ { label: "Completed", value: "completed" },
2003
+ { label: "Pending", value: "pending" },
2004
+ { label: "Cancelled", value: "cancelled" }
2005
+ ],
2006
+ render: (status) => /* @__PURE__ */ jsxRuntime.jsx(
2007
+ Badge,
2008
+ {
2009
+ variant: status === "completed" ? "success" : status === "pending" ? "warning" : "danger",
2010
+ children: status.charAt(0).toUpperCase() + status.slice(1)
2011
+ }
2012
+ )
2013
+ },
2014
+ {
2015
+ key: "region",
2016
+ title: "Region",
2017
+ dataIndex: "region",
2018
+ sortable: true,
2019
+ filterable: true,
2020
+ filterType: "select",
2021
+ filterOptions: [
2022
+ { label: "North America", value: "North America" },
2023
+ { label: "Europe", value: "Europe" },
2024
+ { label: "Asia Pacific", value: "Asia Pacific" },
2025
+ { label: "Latin America", value: "Latin America" }
2026
+ ]
2027
+ },
2028
+ {
2029
+ key: "date",
2030
+ title: "Date",
2031
+ dataIndex: "date",
2032
+ sortable: true,
2033
+ filterable: true,
2034
+ filterType: "date"
2035
+ }
2036
+ ];
2037
+ const taskColumns = [
2038
+ {
2039
+ key: "title",
2040
+ title: "Task",
2041
+ dataIndex: "title",
2042
+ sortable: true,
2043
+ filterable: true,
2044
+ filterType: "text",
2045
+ render: (title, record) => /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2046
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium text-gray-900", children: title }),
2047
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: record.project })
2048
+ ] })
2049
+ },
2050
+ {
2051
+ key: "assignee",
2052
+ title: "Assignee",
2053
+ dataIndex: "assignee",
2054
+ sortable: true,
2055
+ filterable: true,
2056
+ filterType: "text"
2057
+ },
2058
+ {
2059
+ key: "priority",
2060
+ title: "Priority",
2061
+ dataIndex: "priority",
2062
+ sortable: true,
2063
+ filterable: true,
2064
+ filterType: "select",
2065
+ filterOptions: [
2066
+ { label: "Low", value: "low" },
2067
+ { label: "Medium", value: "medium" },
2068
+ { label: "High", value: "high" },
2069
+ { label: "Urgent", value: "urgent" }
2070
+ ],
2071
+ render: (priority) => /* @__PURE__ */ jsxRuntime.jsx(
2072
+ Badge,
2073
+ {
2074
+ variant: priority === "urgent" ? "danger" : priority === "high" ? "warning" : priority === "medium" ? "secondary" : "outline",
2075
+ children: priority.charAt(0).toUpperCase() + priority.slice(1)
2076
+ }
2077
+ )
2078
+ },
2079
+ {
2080
+ key: "status",
2081
+ title: "Status",
2082
+ dataIndex: "status",
2083
+ sortable: true,
2084
+ filterable: true,
2085
+ filterType: "select",
2086
+ filterOptions: [
2087
+ { label: "To Do", value: "todo" },
2088
+ { label: "In Progress", value: "in-progress" },
2089
+ { label: "Review", value: "review" },
2090
+ { label: "Completed", value: "completed" }
2091
+ ],
2092
+ render: (status) => /* @__PURE__ */ jsxRuntime.jsx(
2093
+ Badge,
2094
+ {
2095
+ variant: status === "completed" ? "success" : status === "in-progress" ? "warning" : status === "review" ? "secondary" : "outline",
2096
+ children: status.replace("-", " ").replace(/\b\w/g, (l) => l.toUpperCase())
2097
+ }
2098
+ )
2099
+ },
2100
+ {
2101
+ key: "dueDate",
2102
+ title: "Due Date",
2103
+ dataIndex: "dueDate",
2104
+ sortable: true,
2105
+ filterable: true,
2106
+ filterType: "date"
2107
+ },
2108
+ {
2109
+ key: "tags",
2110
+ title: "Tags",
2111
+ dataIndex: "tags",
2112
+ render: (tags) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap gap-1", children: [
2113
+ tags.slice(0, 2).map((tag) => /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "outline", className: "text-xs", children: tag }, tag)),
2114
+ tags.length > 2 && /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: "outline", className: "text-xs", children: [
2115
+ "+",
2116
+ tags.length - 2
2117
+ ] })
2118
+ ] })
2119
+ }
2120
+ ];
2121
+ const getCurrentData = () => {
2122
+ switch (selectedTab) {
2123
+ case "users":
2124
+ return usersData;
2125
+ case "sales":
2126
+ return salesData;
2127
+ case "tasks":
2128
+ return tasksData;
2129
+ default:
2130
+ return [];
2131
+ }
2132
+ };
2133
+ const getCurrentColumns = () => {
2134
+ switch (selectedTab) {
2135
+ case "users":
2136
+ return userColumns;
2137
+ case "sales":
2138
+ return salesColumns;
2139
+ case "tasks":
2140
+ return taskColumns;
2141
+ default:
2142
+ return [];
2143
+ }
2144
+ };
2145
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
2146
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
2147
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2148
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-bold text-gray-900", children: "DataTable Component" }),
2149
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600 mt-1", children: "A comprehensive table component with filtering, sorting, and pagination" })
2150
+ ] }),
2151
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-2", children: [
2152
+ /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", onClick: () => showToast.info("Export functionality"), children: [
2153
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Download, { className: "h-4 w-4 mr-2" }),
2154
+ "Export"
2155
+ ] }),
2156
+ /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "primary", onClick: () => showToast.success("Add new item"), children: [
2157
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "h-4 w-4 mr-2" }),
2158
+ "Add New"
2159
+ ] })
2160
+ ] })
2161
+ ] }),
2162
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-b border-gray-200", children: /* @__PURE__ */ jsxRuntime.jsx("nav", { className: "-mb-px flex space-x-8", children: [
2163
+ { key: "users", label: "Users", icon: lucideReact.Users },
2164
+ { key: "sales", label: "Sales", icon: lucideReact.DollarSign },
2165
+ { key: "tasks", label: "Tasks", icon: lucideReact.Calendar }
2166
+ ].map(({ key, label, icon: Icon }) => /* @__PURE__ */ jsxRuntime.jsxs(
2167
+ "button",
2168
+ {
2169
+ onClick: () => setSelectedTab(key),
2170
+ className: `
2171
+ flex items-center space-x-2 py-2 px-1 border-b-2 font-medium text-sm
2172
+ ${selectedTab === key ? "border-primary-500 text-primary-600" : "border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"}
2173
+ `,
2174
+ children: [
2175
+ /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "h-4 w-4" }),
2176
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: label })
2177
+ ]
2178
+ },
2179
+ key
2180
+ )) }) }),
2181
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-4 gap-4", children: [
2182
+ /* @__PURE__ */ jsxRuntime.jsx(Card, { children: /* @__PURE__ */ jsxRuntime.jsx(CardContent, { className: "p-4", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
2183
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2184
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-gray-600", children: "Total Records" }),
2185
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-2xl font-bold text-gray-900", children: getCurrentData().length })
2186
+ ] }),
2187
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-2 bg-primary-100 rounded-lg", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Users, { className: "h-6 w-6 text-primary-600" }) })
2188
+ ] }) }) }),
2189
+ /* @__PURE__ */ jsxRuntime.jsx(Card, { children: /* @__PURE__ */ jsxRuntime.jsx(CardContent, { className: "p-4", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
2190
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2191
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-gray-600", children: "Selected" }),
2192
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-2xl font-bold text-gray-900", children: selectedRows.length })
2193
+ ] }),
2194
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-2 bg-success-100 rounded-lg", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Filter, { className: "h-6 w-6 text-success-600" }) })
2195
+ ] }) }) }),
2196
+ /* @__PURE__ */ jsxRuntime.jsx(Card, { children: /* @__PURE__ */ jsxRuntime.jsx(CardContent, { className: "p-4", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
2197
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2198
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-gray-600", children: "Active Filters" }),
2199
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-2xl font-bold text-gray-900", children: "0" })
2200
+ ] }),
2201
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-2 bg-warning-100 rounded-lg", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Filter, { className: "h-6 w-6 text-warning-600" }) })
2202
+ ] }) }) }),
2203
+ /* @__PURE__ */ jsxRuntime.jsx(Card, { children: /* @__PURE__ */ jsxRuntime.jsx(CardContent, { className: "p-4", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
2204
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2205
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-gray-600", children: "Performance" }),
2206
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-1", children: [
2207
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.TrendingUp, { className: "h-4 w-4 text-success-600" }),
2208
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-2xl font-bold text-gray-900", children: "Fast" })
2209
+ ] })
2210
+ ] }),
2211
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-2 bg-success-100 rounded-lg", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.TrendingUp, { className: "h-6 w-6 text-success-600" }) })
2212
+ ] }) }) })
2213
+ ] }),
2214
+ /* @__PURE__ */ jsxRuntime.jsx(Card, { children: /* @__PURE__ */ jsxRuntime.jsx(CardContent, { className: "p-0", children: /* @__PURE__ */ jsxRuntime.jsx(
2215
+ DataTable,
2216
+ {
2217
+ columns: getCurrentColumns(),
2218
+ dataSource: getCurrentData(),
2219
+ rowKey: "id",
2220
+ pagination: {
2221
+ current: 1,
2222
+ pageSize: 10,
2223
+ total: getCurrentData().length,
2224
+ showSizeChanger: true,
2225
+ pageSizeOptions: [5, 10, 20, 50]
2226
+ },
2227
+ rowSelection: {
2228
+ type: "checkbox",
2229
+ selectedRowKeys: selectedRows,
2230
+ onChange: (keys) => {
2231
+ setSelectedRows(keys);
2232
+ showToast.info(`Selected ${keys.length} items`);
2233
+ }
2234
+ },
2235
+ size: "middle",
2236
+ bordered: false,
2237
+ title: () => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between p-4 border-b border-gray-200", children: [
2238
+ /* @__PURE__ */ jsxRuntime.jsxs("h3", { className: "text-lg font-semibold text-gray-900", children: [
2239
+ selectedTab.charAt(0).toUpperCase() + selectedTab.slice(1),
2240
+ " Data"
2241
+ ] }),
2242
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-2", children: [
2243
+ /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: "outline", children: [
2244
+ getCurrentData().length,
2245
+ " total"
2246
+ ] }),
2247
+ selectedRows.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: "primary", children: [
2248
+ selectedRows.length,
2249
+ " selected"
2250
+ ] })
2251
+ ] })
2252
+ ] }),
2253
+ onChange: (pagination, filters, sorter) => {
2254
+ console.log("Table changed:", { pagination, filters, sorter });
2255
+ }
2256
+ }
2257
+ ) }) }),
2258
+ /* @__PURE__ */ jsxRuntime.jsxs(Card, { children: [
2259
+ /* @__PURE__ */ jsxRuntime.jsx(CardHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(CardTitle, { children: "Component Features" }) }),
2260
+ /* @__PURE__ */ jsxRuntime.jsx(CardContent, { className: "space-y-4", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
2261
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2262
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-semibold text-gray-900 mb-2", children: "Core Features" }),
2263
+ /* @__PURE__ */ jsxRuntime.jsxs("ul", { className: "space-y-1 text-sm text-gray-600", children: [
2264
+ /* @__PURE__ */ jsxRuntime.jsx("li", { children: "\u2022 Sortable columns with visual indicators" }),
2265
+ /* @__PURE__ */ jsxRuntime.jsx("li", { children: "\u2022 Advanced filtering (text, select, date)" }),
2266
+ /* @__PURE__ */ jsxRuntime.jsx("li", { children: "\u2022 Pagination with configurable page sizes" }),
2267
+ /* @__PURE__ */ jsxRuntime.jsx("li", { children: "\u2022 Row selection (single/multiple)" }),
2268
+ /* @__PURE__ */ jsxRuntime.jsx("li", { children: "\u2022 Responsive design for all screen sizes" }),
2269
+ /* @__PURE__ */ jsxRuntime.jsx("li", { children: "\u2022 Loading and empty states" })
2270
+ ] })
2271
+ ] }),
2272
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2273
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-semibold text-gray-900 mb-2", children: "Advanced Features" }),
2274
+ /* @__PURE__ */ jsxRuntime.jsxs("ul", { className: "space-y-1 text-sm text-gray-600", children: [
2275
+ /* @__PURE__ */ jsxRuntime.jsx("li", { children: "\u2022 Custom cell renderers" }),
2276
+ /* @__PURE__ */ jsxRuntime.jsx("li", { children: "\u2022 TypeScript support with full typing" }),
2277
+ /* @__PURE__ */ jsxRuntime.jsx("li", { children: "\u2022 Accessibility features (ARIA labels)" }),
2278
+ /* @__PURE__ */ jsxRuntime.jsx("li", { children: "\u2022 Performance optimizations" }),
2279
+ /* @__PURE__ */ jsxRuntime.jsx("li", { children: "\u2022 Customizable styling and themes" }),
2280
+ /* @__PURE__ */ jsxRuntime.jsx("li", { children: "\u2022 Export and bulk actions support" })
2281
+ ] })
2282
+ ] })
2283
+ ] }) })
2284
+ ] })
2285
+ ] });
2286
+ };
1345
2287
  function ShowcaseButtonDemo() {
1346
2288
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-4", children: [
1347
2289
  /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "primary", children: "Primary" }),
@@ -1591,7 +2533,8 @@ var showcasePreviewMap = {
1591
2533
  ] })
1592
2534
  }
1593
2535
  ) });
1594
- }
2536
+ },
2537
+ datatable: DataTableShowcase
1595
2538
  };
1596
2539
  function ShowcaseAlertDemo() {
1597
2540
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
@@ -1681,7 +2624,8 @@ var componentCategories = {
1681
2624
  { name: "Badge", id: "badge" },
1682
2625
  { name: "Avatar", id: "avatar" },
1683
2626
  { name: "StatsCard", id: "statscard" },
1684
- { name: "Tabs", id: "tabs" }
2627
+ { name: "Tabs", id: "tabs" },
2628
+ { name: "DataTable", id: "datatable" }
1685
2629
  ]
1686
2630
  },
1687
2631
  "Feedback": {
@@ -1700,7 +2644,8 @@ var componentCategories = {
1700
2644
  { name: "DashboardLayout", id: "dashboard-layout" },
1701
2645
  { name: "DashboardGrid", id: "dashboard-grid" },
1702
2646
  { name: "Sidebar", id: "sidebar" },
1703
- { name: "Navbar", id: "navbar" }
2647
+ { name: "Navbar", id: "navbar" },
2648
+ { name: "DataTable", id: "datatable" }
1704
2649
  ]
1705
2650
  }
1706
2651
  };
@@ -1966,6 +2911,35 @@ var componentDocs = {
1966
2911
  ],
1967
2912
  component: showcasePreviewMap["dashboard-layout"]
1968
2913
  },
2914
+ datatable: {
2915
+ name: "DataTable",
2916
+ description: "A comprehensive table component with filtering, sorting, pagination, and row selection capabilities.",
2917
+ example: `<DataTable
2918
+ columns={columns}
2919
+ dataSource={data}
2920
+ rowKey="id"
2921
+ pagination={{
2922
+ current: 1,
2923
+ pageSize: 10,
2924
+ total: data.length,
2925
+ }}
2926
+ rowSelection={{
2927
+ type: 'checkbox',
2928
+ onChange: (keys, rows) => console.log('Selected:', keys, rows),
2929
+ }}
2930
+ />`,
2931
+ props: [
2932
+ { name: "columns", type: "Column[]", required: true, description: "Table column configuration" },
2933
+ { name: "dataSource", type: "T[]", required: true, description: "Data to display in the table" },
2934
+ { name: "rowKey", type: "string | function", default: "id", description: "Unique key for each row" },
2935
+ { name: "pagination", type: "PaginationConfig | false", description: "Pagination configuration" },
2936
+ { name: "rowSelection", type: "RowSelection", description: "Row selection configuration" },
2937
+ { name: "loading", type: "boolean", default: "false", description: "Loading state" },
2938
+ { name: "size", type: `"small" | "middle" | "large"`, default: "middle", description: "Table size" },
2939
+ { name: "bordered", type: "boolean", default: "false", description: "Show borders" }
2940
+ ],
2941
+ component: /* @__PURE__ */ jsxRuntime.jsx(DataTableShowcase, {})
2942
+ },
1969
2943
  "dashboard-grid": {
1970
2944
  name: "DashboardGrid",
1971
2945
  description: "Grid container for dashboard widgets.",
@@ -2442,6 +3416,7 @@ exports.DashboardGrid = DashboardGrid;
2442
3416
  exports.DashboardGridItem = DashboardGridItem;
2443
3417
  exports.DashboardHeader = DashboardHeader;
2444
3418
  exports.DashboardLayout = DashboardLayout;
3419
+ exports.DataTable = DataTable;
2445
3420
  exports.Input = Input;
2446
3421
  exports.Modal = Modal;
2447
3422
  exports.ModalContent = ModalContent;