virtual-ui-lib 1.0.61 → 1.0.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.js +527 -0
- package/dist/index.mjs +525 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -31,6 +31,7 @@ var index_exports = {};
|
|
|
31
31
|
__export(index_exports, {
|
|
32
32
|
Avatar: () => Avatar,
|
|
33
33
|
AvatarCard: () => AvatarCard,
|
|
34
|
+
Charts: () => Charts,
|
|
34
35
|
CodeBlock: () => CodeBlock,
|
|
35
36
|
CustomInputField: () => CustomInputField,
|
|
36
37
|
DividerLine: () => DividerLine,
|
|
@@ -44,6 +45,7 @@ __export(index_exports, {
|
|
|
44
45
|
PricingCard: () => PricingCard,
|
|
45
46
|
ResponsiveNavbar: () => ResponsiveNavbar,
|
|
46
47
|
SearchBar: () => SearchBar,
|
|
48
|
+
Sidebar: () => Sidebar,
|
|
47
49
|
SkeletonLoader: () => SkeletonLoader,
|
|
48
50
|
SmartButton: () => SmartButton,
|
|
49
51
|
StatCard: () => StatCard,
|
|
@@ -1420,10 +1422,534 @@ var Footer = ({
|
|
|
1420
1422
|
link
|
|
1421
1423
|
))), /* @__PURE__ */ import_react21.default.createElement("div", { style: { width: "100%", height: "1px", background: "rgba(255,255,255,0.06)" } }), /* @__PURE__ */ import_react21.default.createElement("p", { style: { fontSize: "12px", color: "rgba(255,255,255,0.22)", margin: 0 } }, "\xA9 ", (/* @__PURE__ */ new Date()).getFullYear(), " ", copyright, ". All rights reserved.")));
|
|
1422
1424
|
};
|
|
1425
|
+
|
|
1426
|
+
// src/components/Sidebar/Sidebar.jsx
|
|
1427
|
+
var import_react22 = __toESM(require("react"));
|
|
1428
|
+
var Sidebar = ({
|
|
1429
|
+
logo = "VirtualAI",
|
|
1430
|
+
accent = "#6366f1",
|
|
1431
|
+
bg = "#0f172a",
|
|
1432
|
+
items = [
|
|
1433
|
+
{
|
|
1434
|
+
label: "Dashboard",
|
|
1435
|
+
icon: "M3 3h7v7H3zM14 3h7v7h-7zM3 14h7v7H3zM14 14h7v7h-7z",
|
|
1436
|
+
component: /* @__PURE__ */ import_react22.default.createElement("div", { style: { padding: "24px" } }, /* @__PURE__ */ import_react22.default.createElement("h2", { style: { color: "#fff", fontSize: "20px", fontWeight: "700", marginBottom: "8px" } }, "Dashboard"), /* @__PURE__ */ import_react22.default.createElement("p", { style: { color: "rgba(255,255,255,0.4)", fontSize: "14px" } }, "Welcome to your dashboard overview."))
|
|
1437
|
+
},
|
|
1438
|
+
{
|
|
1439
|
+
label: "Analytics",
|
|
1440
|
+
icon: "M18 20V10M12 20V4M6 20v-6",
|
|
1441
|
+
component: /* @__PURE__ */ import_react22.default.createElement("div", { style: { padding: "24px" } }, /* @__PURE__ */ import_react22.default.createElement("h2", { style: { color: "#fff", fontSize: "20px", fontWeight: "700", marginBottom: "8px" } }, "Analytics"), /* @__PURE__ */ import_react22.default.createElement("p", { style: { color: "rgba(255,255,255,0.4)", fontSize: "14px" } }, "View your stats and performance here."))
|
|
1442
|
+
},
|
|
1443
|
+
{
|
|
1444
|
+
label: "Users",
|
|
1445
|
+
icon: "M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2M9 11a4 4 0 100-8 4 4 0 000 8zM23 21v-2a4 4 0 00-3-3.87M16 3.13a4 4 0 010 7.75",
|
|
1446
|
+
component: /* @__PURE__ */ import_react22.default.createElement("div", { style: { padding: "24px" } }, /* @__PURE__ */ import_react22.default.createElement("h2", { style: { color: "#fff", fontSize: "20px", fontWeight: "700", marginBottom: "8px" } }, "Users"), /* @__PURE__ */ import_react22.default.createElement("p", { style: { color: "rgba(255,255,255,0.4)", fontSize: "14px" } }, "Manage your users and permissions."))
|
|
1447
|
+
},
|
|
1448
|
+
{
|
|
1449
|
+
label: "Settings",
|
|
1450
|
+
icon: "M12 15a3 3 0 100-6 3 3 0 000 6zM19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-4 0v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83-2.83l.06-.06A1.65 1.65 0 004.68 15a1.65 1.65 0 00-1.51-1H3a2 2 0 010-4h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 012.83-2.83l.06.06A1.65 1.65 0 009 4.68a1.65 1.65 0 001-1.51V3a2 2 0 014 0v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 2.83l-.06.06A1.65 1.65 0 0019.4 9a1.65 1.65 0 001.51 1H21a2 2 0 010 4h-.09a1.65 1.65 0 00-1.51 1z",
|
|
1451
|
+
component: /* @__PURE__ */ import_react22.default.createElement("div", { style: { padding: "24px" } }, /* @__PURE__ */ import_react22.default.createElement("h2", { style: { color: "#fff", fontSize: "20px", fontWeight: "700", marginBottom: "8px" } }, "Settings"), /* @__PURE__ */ import_react22.default.createElement("p", { style: { color: "rgba(255,255,255,0.4)", fontSize: "14px" } }, "Configure your preferences here."))
|
|
1452
|
+
}
|
|
1453
|
+
]
|
|
1454
|
+
}) => {
|
|
1455
|
+
const [active, setActive] = (0, import_react22.useState)(0);
|
|
1456
|
+
const [collapsed, setCollapsed] = (0, import_react22.useState)(false);
|
|
1457
|
+
const alpha = (hex, op) => {
|
|
1458
|
+
const r = parseInt(hex.slice(1, 3), 16);
|
|
1459
|
+
const g = parseInt(hex.slice(3, 5), 16);
|
|
1460
|
+
const b = parseInt(hex.slice(5, 7), 16);
|
|
1461
|
+
return `rgba(${r},${g},${b},${op})`;
|
|
1462
|
+
};
|
|
1463
|
+
const activeItem = items[active];
|
|
1464
|
+
return /* @__PURE__ */ import_react22.default.createElement("div", { style: {
|
|
1465
|
+
display: "flex",
|
|
1466
|
+
height: "480px",
|
|
1467
|
+
fontFamily: "system-ui, sans-serif",
|
|
1468
|
+
borderRadius: "16px",
|
|
1469
|
+
overflow: "hidden",
|
|
1470
|
+
border: "1px solid rgba(255,255,255,0.07)"
|
|
1471
|
+
} }, /* @__PURE__ */ import_react22.default.createElement("div", { style: {
|
|
1472
|
+
width: collapsed ? "60px" : "200px",
|
|
1473
|
+
background: bg,
|
|
1474
|
+
borderRight: "1px solid rgba(255,255,255,0.06)",
|
|
1475
|
+
display: "flex",
|
|
1476
|
+
flexDirection: "column",
|
|
1477
|
+
transition: "width 0.25s ease",
|
|
1478
|
+
flexShrink: 0,
|
|
1479
|
+
overflow: "hidden"
|
|
1480
|
+
} }, /* @__PURE__ */ import_react22.default.createElement("div", { style: {
|
|
1481
|
+
height: "56px",
|
|
1482
|
+
display: "flex",
|
|
1483
|
+
alignItems: "center",
|
|
1484
|
+
gap: "10px",
|
|
1485
|
+
padding: collapsed ? "0 14px" : "0 16px",
|
|
1486
|
+
borderBottom: "1px solid rgba(255,255,255,0.05)",
|
|
1487
|
+
overflow: "hidden",
|
|
1488
|
+
flexShrink: 0
|
|
1489
|
+
} }, /* @__PURE__ */ import_react22.default.createElement("div", { style: {
|
|
1490
|
+
width: "28px",
|
|
1491
|
+
height: "28px",
|
|
1492
|
+
borderRadius: "8px",
|
|
1493
|
+
flexShrink: 0,
|
|
1494
|
+
background: `linear-gradient(135deg, ${accent}, ${alpha(accent, 0.6)})`,
|
|
1495
|
+
display: "flex",
|
|
1496
|
+
alignItems: "center",
|
|
1497
|
+
justifyContent: "center",
|
|
1498
|
+
fontSize: "13px",
|
|
1499
|
+
fontWeight: "800",
|
|
1500
|
+
color: "#fff"
|
|
1501
|
+
} }, logo[0]), !collapsed && /* @__PURE__ */ import_react22.default.createElement("span", { style: { fontSize: "14px", fontWeight: "800", color: "#fff", whiteSpace: "nowrap" } }, logo)), /* @__PURE__ */ import_react22.default.createElement("nav", { style: { flex: 1, padding: "10px 8px", display: "flex", flexDirection: "column", gap: "3px", overflowY: "auto" } }, items.map((item, i) => /* @__PURE__ */ import_react22.default.createElement(
|
|
1502
|
+
"button",
|
|
1503
|
+
{
|
|
1504
|
+
key: i,
|
|
1505
|
+
onClick: () => setActive(i),
|
|
1506
|
+
title: collapsed ? item.label : "",
|
|
1507
|
+
style: {
|
|
1508
|
+
display: "flex",
|
|
1509
|
+
alignItems: "center",
|
|
1510
|
+
gap: "10px",
|
|
1511
|
+
padding: collapsed ? "9px 0" : "9px 12px",
|
|
1512
|
+
justifyContent: collapsed ? "center" : "flex-start",
|
|
1513
|
+
borderRadius: "10px",
|
|
1514
|
+
border: "none",
|
|
1515
|
+
cursor: "pointer",
|
|
1516
|
+
transition: "all 0.2s",
|
|
1517
|
+
fontFamily: "inherit",
|
|
1518
|
+
width: "100%",
|
|
1519
|
+
background: active === i ? alpha(accent, 0.12) : "transparent",
|
|
1520
|
+
color: active === i ? accent : "rgba(255,255,255,0.45)",
|
|
1521
|
+
borderLeft: active === i ? `2px solid ${accent}` : "2px solid transparent"
|
|
1522
|
+
},
|
|
1523
|
+
onMouseEnter: (e) => {
|
|
1524
|
+
if (active !== i) {
|
|
1525
|
+
e.currentTarget.style.background = "rgba(255,255,255,0.04)";
|
|
1526
|
+
e.currentTarget.style.color = "rgba(255,255,255,0.8)";
|
|
1527
|
+
}
|
|
1528
|
+
},
|
|
1529
|
+
onMouseLeave: (e) => {
|
|
1530
|
+
if (active !== i) {
|
|
1531
|
+
e.currentTarget.style.background = "transparent";
|
|
1532
|
+
e.currentTarget.style.color = "rgba(255,255,255,0.45)";
|
|
1533
|
+
}
|
|
1534
|
+
}
|
|
1535
|
+
},
|
|
1536
|
+
/* @__PURE__ */ import_react22.default.createElement(
|
|
1537
|
+
"svg",
|
|
1538
|
+
{
|
|
1539
|
+
width: "16",
|
|
1540
|
+
height: "16",
|
|
1541
|
+
viewBox: "0 0 24 24",
|
|
1542
|
+
fill: "none",
|
|
1543
|
+
stroke: "currentColor",
|
|
1544
|
+
strokeWidth: "2",
|
|
1545
|
+
strokeLinecap: "round",
|
|
1546
|
+
strokeLinejoin: "round",
|
|
1547
|
+
style: { flexShrink: 0 }
|
|
1548
|
+
},
|
|
1549
|
+
/* @__PURE__ */ import_react22.default.createElement("path", { d: item.icon })
|
|
1550
|
+
),
|
|
1551
|
+
!collapsed && /* @__PURE__ */ import_react22.default.createElement("span", { style: { fontSize: "13px", fontWeight: active === i ? "700" : "500", whiteSpace: "nowrap" } }, item.label)
|
|
1552
|
+
))), /* @__PURE__ */ import_react22.default.createElement("div", { style: { padding: "8px", borderTop: "1px solid rgba(255,255,255,0.05)" } }, /* @__PURE__ */ import_react22.default.createElement(
|
|
1553
|
+
"button",
|
|
1554
|
+
{
|
|
1555
|
+
onClick: () => setCollapsed((c) => !c),
|
|
1556
|
+
style: {
|
|
1557
|
+
width: "100%",
|
|
1558
|
+
padding: "8px",
|
|
1559
|
+
borderRadius: "9px",
|
|
1560
|
+
border: "none",
|
|
1561
|
+
background: "rgba(255,255,255,0.04)",
|
|
1562
|
+
cursor: "pointer",
|
|
1563
|
+
display: "flex",
|
|
1564
|
+
alignItems: "center",
|
|
1565
|
+
justifyContent: "center",
|
|
1566
|
+
color: "rgba(255,255,255,0.3)",
|
|
1567
|
+
transition: "all 0.2s"
|
|
1568
|
+
},
|
|
1569
|
+
onMouseEnter: (e) => e.currentTarget.style.color = "rgba(255,255,255,0.7)",
|
|
1570
|
+
onMouseLeave: (e) => e.currentTarget.style.color = "rgba(255,255,255,0.3)"
|
|
1571
|
+
},
|
|
1572
|
+
/* @__PURE__ */ import_react22.default.createElement(
|
|
1573
|
+
"svg",
|
|
1574
|
+
{
|
|
1575
|
+
width: "15",
|
|
1576
|
+
height: "15",
|
|
1577
|
+
viewBox: "0 0 24 24",
|
|
1578
|
+
fill: "none",
|
|
1579
|
+
stroke: "currentColor",
|
|
1580
|
+
strokeWidth: "2",
|
|
1581
|
+
strokeLinecap: "round"
|
|
1582
|
+
},
|
|
1583
|
+
/* @__PURE__ */ import_react22.default.createElement("path", { d: collapsed ? "M9 18l6-6-6-6" : "M15 18l-6-6 6-6" })
|
|
1584
|
+
)
|
|
1585
|
+
))), /* @__PURE__ */ import_react22.default.createElement("div", { style: {
|
|
1586
|
+
flex: 1,
|
|
1587
|
+
background: "rgba(255,255,255,0.02)",
|
|
1588
|
+
overflow: "auto"
|
|
1589
|
+
} }, /* @__PURE__ */ import_react22.default.createElement("div", { style: {
|
|
1590
|
+
height: "56px",
|
|
1591
|
+
display: "flex",
|
|
1592
|
+
alignItems: "center",
|
|
1593
|
+
padding: "0 20px",
|
|
1594
|
+
borderBottom: "1px solid rgba(255,255,255,0.05)",
|
|
1595
|
+
gap: "10px"
|
|
1596
|
+
} }, /* @__PURE__ */ import_react22.default.createElement("div", { style: {
|
|
1597
|
+
width: "6px",
|
|
1598
|
+
height: "6px",
|
|
1599
|
+
borderRadius: "50%",
|
|
1600
|
+
background: accent
|
|
1601
|
+
} }), /* @__PURE__ */ import_react22.default.createElement("span", { style: { fontSize: "14px", fontWeight: "700", color: "#fff" } }, activeItem == null ? void 0 : activeItem.label)), /* @__PURE__ */ import_react22.default.createElement("div", { style: { color: "#fff" } }, activeItem == null ? void 0 : activeItem.component)));
|
|
1602
|
+
};
|
|
1603
|
+
|
|
1604
|
+
// src/components/Charts/Charts.jsx
|
|
1605
|
+
var import_react23 = __toESM(require("react"));
|
|
1606
|
+
var Charts = ({
|
|
1607
|
+
type = "bar",
|
|
1608
|
+
data = [
|
|
1609
|
+
{ label: "Jan", value: 40 },
|
|
1610
|
+
{ label: "Feb", value: 70 },
|
|
1611
|
+
{ label: "Mar", value: 55 },
|
|
1612
|
+
{ label: "Apr", value: 90 },
|
|
1613
|
+
{ label: "May", value: 65 },
|
|
1614
|
+
{ label: "Jun", value: 80 },
|
|
1615
|
+
{ label: "Jul", value: 100 },
|
|
1616
|
+
{ label: "Aug", value: 30 }
|
|
1617
|
+
],
|
|
1618
|
+
title = "Monthly Stats",
|
|
1619
|
+
accent = "#6366f1",
|
|
1620
|
+
bg = "#0f172a",
|
|
1621
|
+
radius = "16px",
|
|
1622
|
+
showGrid = true,
|
|
1623
|
+
showValues = true
|
|
1624
|
+
}) => {
|
|
1625
|
+
const [hovered, setHovered] = (0, import_react23.useState)(null);
|
|
1626
|
+
const alpha = (hex, op) => {
|
|
1627
|
+
const r = parseInt(hex.slice(1, 3), 16);
|
|
1628
|
+
const g = parseInt(hex.slice(3, 5), 16);
|
|
1629
|
+
const b = parseInt(hex.slice(5, 7), 16);
|
|
1630
|
+
return `rgba(${r},${g},${b},${op})`;
|
|
1631
|
+
};
|
|
1632
|
+
const max = Math.max(...data.map((d) => d.value));
|
|
1633
|
+
const min = Math.min(...data.map((d) => d.value));
|
|
1634
|
+
const W = 320;
|
|
1635
|
+
const H = 160;
|
|
1636
|
+
const padL = 28;
|
|
1637
|
+
const padR = 12;
|
|
1638
|
+
const padT = 16;
|
|
1639
|
+
const padB = 28;
|
|
1640
|
+
const chartW = W - padL - padR;
|
|
1641
|
+
const chartH = H - padT - padB;
|
|
1642
|
+
const getX = (i) => padL + i / (data.length - 1) * chartW;
|
|
1643
|
+
const getY = (v) => padT + chartH - (v - min) / (max - min || 1) * chartH;
|
|
1644
|
+
const points = data.map((d, i) => `${getX(i)},${getY(d.value)}`).join(" ");
|
|
1645
|
+
const areaPoints = `${padL},${padT + chartH} ` + points + ` ${getX(data.length - 1)},${padT + chartH}`;
|
|
1646
|
+
const gridLines = [0, 0.25, 0.5, 0.75, 1].map((t) => ({
|
|
1647
|
+
y: padT + chartH * (1 - t),
|
|
1648
|
+
val: Math.round(min + t * (max - min))
|
|
1649
|
+
}));
|
|
1650
|
+
const BarChart = () => {
|
|
1651
|
+
const barW = Math.min(28, chartW / data.length * 0.55);
|
|
1652
|
+
return /* @__PURE__ */ import_react23.default.createElement("svg", { width: "100%", viewBox: `0 0 ${W} ${H}` }, showGrid && gridLines.map((g, i) => /* @__PURE__ */ import_react23.default.createElement("g", { key: i }, /* @__PURE__ */ import_react23.default.createElement(
|
|
1653
|
+
"line",
|
|
1654
|
+
{
|
|
1655
|
+
x1: padL,
|
|
1656
|
+
y1: g.y,
|
|
1657
|
+
x2: W - padR,
|
|
1658
|
+
y2: g.y,
|
|
1659
|
+
stroke: "rgba(255,255,255,0.05)",
|
|
1660
|
+
strokeWidth: "1"
|
|
1661
|
+
}
|
|
1662
|
+
), /* @__PURE__ */ import_react23.default.createElement(
|
|
1663
|
+
"text",
|
|
1664
|
+
{
|
|
1665
|
+
x: padL - 4,
|
|
1666
|
+
y: g.y + 4,
|
|
1667
|
+
textAnchor: "end",
|
|
1668
|
+
fill: "rgba(255,255,255,0.25)",
|
|
1669
|
+
fontSize: "9"
|
|
1670
|
+
},
|
|
1671
|
+
g.val
|
|
1672
|
+
))), data.map((d, i) => {
|
|
1673
|
+
const x = padL + i / data.length * chartW + (chartW / data.length - barW) / 2;
|
|
1674
|
+
const barH = (d.value - min) / (max - min || 1) * chartH;
|
|
1675
|
+
const y = padT + chartH - barH;
|
|
1676
|
+
const isH = hovered === i;
|
|
1677
|
+
return /* @__PURE__ */ import_react23.default.createElement("g", { key: i, onMouseEnter: () => setHovered(i), onMouseLeave: () => setHovered(null) }, /* @__PURE__ */ import_react23.default.createElement(
|
|
1678
|
+
"rect",
|
|
1679
|
+
{
|
|
1680
|
+
x,
|
|
1681
|
+
y: padT,
|
|
1682
|
+
width: barW,
|
|
1683
|
+
height: chartH,
|
|
1684
|
+
fill: "transparent",
|
|
1685
|
+
rx: "4"
|
|
1686
|
+
}
|
|
1687
|
+
), /* @__PURE__ */ import_react23.default.createElement(
|
|
1688
|
+
"rect",
|
|
1689
|
+
{
|
|
1690
|
+
x,
|
|
1691
|
+
y,
|
|
1692
|
+
width: barW,
|
|
1693
|
+
height: barH,
|
|
1694
|
+
fill: isH ? accent : alpha(accent, 0.55),
|
|
1695
|
+
rx: "4",
|
|
1696
|
+
style: { transition: "fill 0.15s" }
|
|
1697
|
+
}
|
|
1698
|
+
), showValues && isH && /* @__PURE__ */ import_react23.default.createElement(
|
|
1699
|
+
"text",
|
|
1700
|
+
{
|
|
1701
|
+
x: x + barW / 2,
|
|
1702
|
+
y: y - 5,
|
|
1703
|
+
textAnchor: "middle",
|
|
1704
|
+
fill: "#fff",
|
|
1705
|
+
fontSize: "9",
|
|
1706
|
+
fontWeight: "700"
|
|
1707
|
+
},
|
|
1708
|
+
d.value
|
|
1709
|
+
), /* @__PURE__ */ import_react23.default.createElement(
|
|
1710
|
+
"text",
|
|
1711
|
+
{
|
|
1712
|
+
x: x + barW / 2,
|
|
1713
|
+
y: H - 6,
|
|
1714
|
+
textAnchor: "middle",
|
|
1715
|
+
fill: "rgba(255,255,255,0.3)",
|
|
1716
|
+
fontSize: "9"
|
|
1717
|
+
},
|
|
1718
|
+
d.label
|
|
1719
|
+
));
|
|
1720
|
+
}));
|
|
1721
|
+
};
|
|
1722
|
+
const LineChart = () => /* @__PURE__ */ import_react23.default.createElement("svg", { width: "100%", viewBox: `0 0 ${W} ${H}` }, /* @__PURE__ */ import_react23.default.createElement("defs", null, /* @__PURE__ */ import_react23.default.createElement("linearGradient", { id: "lg", x1: "0", y1: "0", x2: "0", y2: "1" }, /* @__PURE__ */ import_react23.default.createElement("stop", { offset: "0%", stopColor: accent, stopOpacity: "0.3" }), /* @__PURE__ */ import_react23.default.createElement("stop", { offset: "100%", stopColor: accent, stopOpacity: "0" }))), showGrid && gridLines.map((g, i) => /* @__PURE__ */ import_react23.default.createElement("g", { key: i }, /* @__PURE__ */ import_react23.default.createElement(
|
|
1723
|
+
"line",
|
|
1724
|
+
{
|
|
1725
|
+
x1: padL,
|
|
1726
|
+
y1: g.y,
|
|
1727
|
+
x2: W - padR,
|
|
1728
|
+
y2: g.y,
|
|
1729
|
+
stroke: "rgba(255,255,255,0.05)",
|
|
1730
|
+
strokeWidth: "1"
|
|
1731
|
+
}
|
|
1732
|
+
), /* @__PURE__ */ import_react23.default.createElement(
|
|
1733
|
+
"text",
|
|
1734
|
+
{
|
|
1735
|
+
x: padL - 4,
|
|
1736
|
+
y: g.y + 4,
|
|
1737
|
+
textAnchor: "end",
|
|
1738
|
+
fill: "rgba(255,255,255,0.25)",
|
|
1739
|
+
fontSize: "9"
|
|
1740
|
+
},
|
|
1741
|
+
g.val
|
|
1742
|
+
))), /* @__PURE__ */ import_react23.default.createElement("polygon", { points: areaPoints, fill: "url(#lg)" }), /* @__PURE__ */ import_react23.default.createElement(
|
|
1743
|
+
"polyline",
|
|
1744
|
+
{
|
|
1745
|
+
points,
|
|
1746
|
+
fill: "none",
|
|
1747
|
+
stroke: accent,
|
|
1748
|
+
strokeWidth: "2",
|
|
1749
|
+
strokeLinejoin: "round",
|
|
1750
|
+
strokeLinecap: "round"
|
|
1751
|
+
}
|
|
1752
|
+
), data.map((d, i) => {
|
|
1753
|
+
const isH = hovered === i;
|
|
1754
|
+
return /* @__PURE__ */ import_react23.default.createElement("g", { key: i, onMouseEnter: () => setHovered(i), onMouseLeave: () => setHovered(null) }, /* @__PURE__ */ import_react23.default.createElement("circle", { cx: getX(i), cy: getY(d.value), r: "10", fill: "transparent" }), /* @__PURE__ */ import_react23.default.createElement(
|
|
1755
|
+
"circle",
|
|
1756
|
+
{
|
|
1757
|
+
cx: getX(i),
|
|
1758
|
+
cy: getY(d.value),
|
|
1759
|
+
r: isH ? 5 : 3,
|
|
1760
|
+
fill: isH ? "#fff" : accent,
|
|
1761
|
+
stroke: accent,
|
|
1762
|
+
strokeWidth: "2",
|
|
1763
|
+
style: { transition: "all 0.15s" }
|
|
1764
|
+
}
|
|
1765
|
+
), showValues && isH && /* @__PURE__ */ import_react23.default.createElement(
|
|
1766
|
+
"text",
|
|
1767
|
+
{
|
|
1768
|
+
x: getX(i),
|
|
1769
|
+
y: getY(d.value) - 10,
|
|
1770
|
+
textAnchor: "middle",
|
|
1771
|
+
fill: "#fff",
|
|
1772
|
+
fontSize: "9",
|
|
1773
|
+
fontWeight: "700"
|
|
1774
|
+
},
|
|
1775
|
+
d.value
|
|
1776
|
+
), /* @__PURE__ */ import_react23.default.createElement(
|
|
1777
|
+
"text",
|
|
1778
|
+
{
|
|
1779
|
+
x: getX(i),
|
|
1780
|
+
y: H - 6,
|
|
1781
|
+
textAnchor: "middle",
|
|
1782
|
+
fill: "rgba(255,255,255,0.3)",
|
|
1783
|
+
fontSize: "9"
|
|
1784
|
+
},
|
|
1785
|
+
d.label
|
|
1786
|
+
));
|
|
1787
|
+
}));
|
|
1788
|
+
const PieChart = () => {
|
|
1789
|
+
var _a, _b;
|
|
1790
|
+
const cx = W / 2, cy = H / 2 - 4, r = Math.min(H, W) / 2 - 24;
|
|
1791
|
+
const total = data.reduce((s, d) => s + d.value, 0);
|
|
1792
|
+
const colors = [
|
|
1793
|
+
accent,
|
|
1794
|
+
alpha(accent, 0.75),
|
|
1795
|
+
alpha(accent, 0.55),
|
|
1796
|
+
alpha(accent, 0.4),
|
|
1797
|
+
alpha(accent, 0.3),
|
|
1798
|
+
alpha(accent, 0.2),
|
|
1799
|
+
alpha(accent, 0.12)
|
|
1800
|
+
];
|
|
1801
|
+
let startAngle = -Math.PI / 2;
|
|
1802
|
+
const slices = data.map((d, i) => {
|
|
1803
|
+
const angle = d.value / total * 2 * Math.PI;
|
|
1804
|
+
const x1 = cx + r * Math.cos(startAngle);
|
|
1805
|
+
const y1 = cy + r * Math.sin(startAngle);
|
|
1806
|
+
const x2 = cx + r * Math.cos(startAngle + angle);
|
|
1807
|
+
const y2 = cy + r * Math.sin(startAngle + angle);
|
|
1808
|
+
const lx = cx + (r + 14) * Math.cos(startAngle + angle / 2);
|
|
1809
|
+
const ly = cy + (r + 14) * Math.sin(startAngle + angle / 2);
|
|
1810
|
+
const large = angle > Math.PI ? 1 : 0;
|
|
1811
|
+
const path = `M ${cx} ${cy} L ${x1} ${y1} A ${r} ${r} 0 ${large} 1 ${x2} ${y2} Z`;
|
|
1812
|
+
const slice = { path, color: colors[i % colors.length], d, angle, lx, ly, i };
|
|
1813
|
+
startAngle += angle;
|
|
1814
|
+
return slice;
|
|
1815
|
+
});
|
|
1816
|
+
return /* @__PURE__ */ import_react23.default.createElement("svg", { width: "100%", viewBox: `0 0 ${W} ${H}` }, slices.map((s) => /* @__PURE__ */ import_react23.default.createElement("g", { key: s.i, onMouseEnter: () => setHovered(s.i), onMouseLeave: () => setHovered(null) }, /* @__PURE__ */ import_react23.default.createElement(
|
|
1817
|
+
"path",
|
|
1818
|
+
{
|
|
1819
|
+
d: s.path,
|
|
1820
|
+
fill: s.color,
|
|
1821
|
+
stroke: bg,
|
|
1822
|
+
strokeWidth: "2",
|
|
1823
|
+
transform: hovered === s.i ? `translate(${Math.cos(s.angle / 2 - Math.PI / 2) * 4}, ${Math.sin(s.angle / 2 - Math.PI / 2) * 4})` : "",
|
|
1824
|
+
style: { transition: "transform 0.15s", cursor: "pointer" }
|
|
1825
|
+
}
|
|
1826
|
+
))), hovered !== null && /* @__PURE__ */ import_react23.default.createElement(import_react23.default.Fragment, null, /* @__PURE__ */ import_react23.default.createElement(
|
|
1827
|
+
"text",
|
|
1828
|
+
{
|
|
1829
|
+
x: cx,
|
|
1830
|
+
y: cy - 8,
|
|
1831
|
+
textAnchor: "middle",
|
|
1832
|
+
fill: "#fff",
|
|
1833
|
+
fontSize: "16",
|
|
1834
|
+
fontWeight: "800"
|
|
1835
|
+
},
|
|
1836
|
+
(_a = data[hovered]) == null ? void 0 : _a.value
|
|
1837
|
+
), /* @__PURE__ */ import_react23.default.createElement(
|
|
1838
|
+
"text",
|
|
1839
|
+
{
|
|
1840
|
+
x: cx,
|
|
1841
|
+
y: cy + 10,
|
|
1842
|
+
textAnchor: "middle",
|
|
1843
|
+
fill: "rgba(255,255,255,0.4)",
|
|
1844
|
+
fontSize: "9"
|
|
1845
|
+
},
|
|
1846
|
+
(_b = data[hovered]) == null ? void 0 : _b.label
|
|
1847
|
+
)), hovered === null && /* @__PURE__ */ import_react23.default.createElement(
|
|
1848
|
+
"text",
|
|
1849
|
+
{
|
|
1850
|
+
x: cx,
|
|
1851
|
+
y: cy + 5,
|
|
1852
|
+
textAnchor: "middle",
|
|
1853
|
+
fill: "rgba(255,255,255,0.2)",
|
|
1854
|
+
fontSize: "9"
|
|
1855
|
+
},
|
|
1856
|
+
"Hover slice"
|
|
1857
|
+
));
|
|
1858
|
+
};
|
|
1859
|
+
const AreaChart = () => /* @__PURE__ */ import_react23.default.createElement("svg", { width: "100%", viewBox: `0 0 ${W} ${H}` }, /* @__PURE__ */ import_react23.default.createElement("defs", null, /* @__PURE__ */ import_react23.default.createElement("linearGradient", { id: "ag", x1: "0", y1: "0", x2: "0", y2: "1" }, /* @__PURE__ */ import_react23.default.createElement("stop", { offset: "0%", stopColor: accent, stopOpacity: "0.5" }), /* @__PURE__ */ import_react23.default.createElement("stop", { offset: "100%", stopColor: accent, stopOpacity: "0.02" }))), showGrid && gridLines.map((g, i) => /* @__PURE__ */ import_react23.default.createElement("g", { key: i }, /* @__PURE__ */ import_react23.default.createElement(
|
|
1860
|
+
"line",
|
|
1861
|
+
{
|
|
1862
|
+
x1: padL,
|
|
1863
|
+
y1: g.y,
|
|
1864
|
+
x2: W - padR,
|
|
1865
|
+
y2: g.y,
|
|
1866
|
+
stroke: "rgba(255,255,255,0.05)",
|
|
1867
|
+
strokeWidth: "1"
|
|
1868
|
+
}
|
|
1869
|
+
), /* @__PURE__ */ import_react23.default.createElement(
|
|
1870
|
+
"text",
|
|
1871
|
+
{
|
|
1872
|
+
x: padL - 4,
|
|
1873
|
+
y: g.y + 4,
|
|
1874
|
+
textAnchor: "end",
|
|
1875
|
+
fill: "rgba(255,255,255,0.25)",
|
|
1876
|
+
fontSize: "9"
|
|
1877
|
+
},
|
|
1878
|
+
g.val
|
|
1879
|
+
))), /* @__PURE__ */ import_react23.default.createElement("polygon", { points: areaPoints, fill: "url(#ag)" }), /* @__PURE__ */ import_react23.default.createElement(
|
|
1880
|
+
"polyline",
|
|
1881
|
+
{
|
|
1882
|
+
points,
|
|
1883
|
+
fill: "none",
|
|
1884
|
+
stroke: accent,
|
|
1885
|
+
strokeWidth: "1.5",
|
|
1886
|
+
strokeLinejoin: "round",
|
|
1887
|
+
strokeLinecap: "round"
|
|
1888
|
+
}
|
|
1889
|
+
), data.map((d, i) => /* @__PURE__ */ import_react23.default.createElement("g", { key: i, onMouseEnter: () => setHovered(i), onMouseLeave: () => setHovered(null) }, /* @__PURE__ */ import_react23.default.createElement("rect", { x: getX(i) - 12, y: padT, width: 24, height: chartH, fill: "transparent" }), hovered === i && /* @__PURE__ */ import_react23.default.createElement(import_react23.default.Fragment, null, /* @__PURE__ */ import_react23.default.createElement(
|
|
1890
|
+
"line",
|
|
1891
|
+
{
|
|
1892
|
+
x1: getX(i),
|
|
1893
|
+
y1: padT,
|
|
1894
|
+
x2: getX(i),
|
|
1895
|
+
y2: padT + chartH,
|
|
1896
|
+
stroke: "rgba(255,255,255,0.1)",
|
|
1897
|
+
strokeWidth: "1",
|
|
1898
|
+
strokeDasharray: "3 3"
|
|
1899
|
+
}
|
|
1900
|
+
), showValues && /* @__PURE__ */ import_react23.default.createElement(
|
|
1901
|
+
"text",
|
|
1902
|
+
{
|
|
1903
|
+
x: getX(i),
|
|
1904
|
+
y: getY(d.value) - 10,
|
|
1905
|
+
textAnchor: "middle",
|
|
1906
|
+
fill: "#fff",
|
|
1907
|
+
fontSize: "9",
|
|
1908
|
+
fontWeight: "700"
|
|
1909
|
+
},
|
|
1910
|
+
d.value
|
|
1911
|
+
)), /* @__PURE__ */ import_react23.default.createElement(
|
|
1912
|
+
"text",
|
|
1913
|
+
{
|
|
1914
|
+
x: getX(i),
|
|
1915
|
+
y: H - 6,
|
|
1916
|
+
textAnchor: "middle",
|
|
1917
|
+
fill: "rgba(255,255,255,0.3)",
|
|
1918
|
+
fontSize: "9"
|
|
1919
|
+
},
|
|
1920
|
+
d.label
|
|
1921
|
+
))));
|
|
1922
|
+
const renderChart = () => {
|
|
1923
|
+
if (type === "line") return /* @__PURE__ */ import_react23.default.createElement(LineChart, null);
|
|
1924
|
+
if (type === "pie") return /* @__PURE__ */ import_react23.default.createElement(PieChart, null);
|
|
1925
|
+
if (type === "area") return /* @__PURE__ */ import_react23.default.createElement(AreaChart, null);
|
|
1926
|
+
return /* @__PURE__ */ import_react23.default.createElement(BarChart, null);
|
|
1927
|
+
};
|
|
1928
|
+
return /* @__PURE__ */ import_react23.default.createElement("div", { style: {
|
|
1929
|
+
background: bg,
|
|
1930
|
+
borderRadius: radius,
|
|
1931
|
+
padding: "20px",
|
|
1932
|
+
fontFamily: "system-ui, sans-serif",
|
|
1933
|
+
border: "1px solid rgba(255,255,255,0.07)",
|
|
1934
|
+
width: "100%",
|
|
1935
|
+
maxWidth: "360px",
|
|
1936
|
+
boxSizing: "border-box"
|
|
1937
|
+
} }, /* @__PURE__ */ import_react23.default.createElement("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: "16px" } }, /* @__PURE__ */ import_react23.default.createElement("p", { style: { fontSize: "14px", fontWeight: "700", color: "#fff", margin: 0 } }, title), /* @__PURE__ */ import_react23.default.createElement("span", { style: {
|
|
1938
|
+
fontSize: "10px",
|
|
1939
|
+
fontWeight: "700",
|
|
1940
|
+
padding: "3px 9px",
|
|
1941
|
+
borderRadius: "6px",
|
|
1942
|
+
background: alpha(accent, 0.12),
|
|
1943
|
+
color: accent,
|
|
1944
|
+
border: `1px solid ${alpha(accent, 0.25)}`,
|
|
1945
|
+
textTransform: "capitalize"
|
|
1946
|
+
} }, type)), renderChart());
|
|
1947
|
+
};
|
|
1423
1948
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1424
1949
|
0 && (module.exports = {
|
|
1425
1950
|
Avatar,
|
|
1426
1951
|
AvatarCard,
|
|
1952
|
+
Charts,
|
|
1427
1953
|
CodeBlock,
|
|
1428
1954
|
CustomInputField,
|
|
1429
1955
|
DividerLine,
|
|
@@ -1437,6 +1963,7 @@ var Footer = ({
|
|
|
1437
1963
|
PricingCard,
|
|
1438
1964
|
ResponsiveNavbar,
|
|
1439
1965
|
SearchBar,
|
|
1966
|
+
Sidebar,
|
|
1440
1967
|
SkeletonLoader,
|
|
1441
1968
|
SmartButton,
|
|
1442
1969
|
StatCard,
|
package/dist/index.mjs
CHANGED
|
@@ -1365,9 +1365,533 @@ var Footer = ({
|
|
|
1365
1365
|
link
|
|
1366
1366
|
))), /* @__PURE__ */ React21.createElement("div", { style: { width: "100%", height: "1px", background: "rgba(255,255,255,0.06)" } }), /* @__PURE__ */ React21.createElement("p", { style: { fontSize: "12px", color: "rgba(255,255,255,0.22)", margin: 0 } }, "\xA9 ", (/* @__PURE__ */ new Date()).getFullYear(), " ", copyright, ". All rights reserved.")));
|
|
1367
1367
|
};
|
|
1368
|
+
|
|
1369
|
+
// src/components/Sidebar/Sidebar.jsx
|
|
1370
|
+
import React22, { useState as useState15 } from "react";
|
|
1371
|
+
var Sidebar = ({
|
|
1372
|
+
logo = "VirtualAI",
|
|
1373
|
+
accent = "#6366f1",
|
|
1374
|
+
bg = "#0f172a",
|
|
1375
|
+
items = [
|
|
1376
|
+
{
|
|
1377
|
+
label: "Dashboard",
|
|
1378
|
+
icon: "M3 3h7v7H3zM14 3h7v7h-7zM3 14h7v7H3zM14 14h7v7h-7z",
|
|
1379
|
+
component: /* @__PURE__ */ React22.createElement("div", { style: { padding: "24px" } }, /* @__PURE__ */ React22.createElement("h2", { style: { color: "#fff", fontSize: "20px", fontWeight: "700", marginBottom: "8px" } }, "Dashboard"), /* @__PURE__ */ React22.createElement("p", { style: { color: "rgba(255,255,255,0.4)", fontSize: "14px" } }, "Welcome to your dashboard overview."))
|
|
1380
|
+
},
|
|
1381
|
+
{
|
|
1382
|
+
label: "Analytics",
|
|
1383
|
+
icon: "M18 20V10M12 20V4M6 20v-6",
|
|
1384
|
+
component: /* @__PURE__ */ React22.createElement("div", { style: { padding: "24px" } }, /* @__PURE__ */ React22.createElement("h2", { style: { color: "#fff", fontSize: "20px", fontWeight: "700", marginBottom: "8px" } }, "Analytics"), /* @__PURE__ */ React22.createElement("p", { style: { color: "rgba(255,255,255,0.4)", fontSize: "14px" } }, "View your stats and performance here."))
|
|
1385
|
+
},
|
|
1386
|
+
{
|
|
1387
|
+
label: "Users",
|
|
1388
|
+
icon: "M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2M9 11a4 4 0 100-8 4 4 0 000 8zM23 21v-2a4 4 0 00-3-3.87M16 3.13a4 4 0 010 7.75",
|
|
1389
|
+
component: /* @__PURE__ */ React22.createElement("div", { style: { padding: "24px" } }, /* @__PURE__ */ React22.createElement("h2", { style: { color: "#fff", fontSize: "20px", fontWeight: "700", marginBottom: "8px" } }, "Users"), /* @__PURE__ */ React22.createElement("p", { style: { color: "rgba(255,255,255,0.4)", fontSize: "14px" } }, "Manage your users and permissions."))
|
|
1390
|
+
},
|
|
1391
|
+
{
|
|
1392
|
+
label: "Settings",
|
|
1393
|
+
icon: "M12 15a3 3 0 100-6 3 3 0 000 6zM19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-4 0v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83-2.83l.06-.06A1.65 1.65 0 004.68 15a1.65 1.65 0 00-1.51-1H3a2 2 0 010-4h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 012.83-2.83l.06.06A1.65 1.65 0 009 4.68a1.65 1.65 0 001-1.51V3a2 2 0 014 0v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 2.83l-.06.06A1.65 1.65 0 0019.4 9a1.65 1.65 0 001.51 1H21a2 2 0 010 4h-.09a1.65 1.65 0 00-1.51 1z",
|
|
1394
|
+
component: /* @__PURE__ */ React22.createElement("div", { style: { padding: "24px" } }, /* @__PURE__ */ React22.createElement("h2", { style: { color: "#fff", fontSize: "20px", fontWeight: "700", marginBottom: "8px" } }, "Settings"), /* @__PURE__ */ React22.createElement("p", { style: { color: "rgba(255,255,255,0.4)", fontSize: "14px" } }, "Configure your preferences here."))
|
|
1395
|
+
}
|
|
1396
|
+
]
|
|
1397
|
+
}) => {
|
|
1398
|
+
const [active, setActive] = useState15(0);
|
|
1399
|
+
const [collapsed, setCollapsed] = useState15(false);
|
|
1400
|
+
const alpha = (hex, op) => {
|
|
1401
|
+
const r = parseInt(hex.slice(1, 3), 16);
|
|
1402
|
+
const g = parseInt(hex.slice(3, 5), 16);
|
|
1403
|
+
const b = parseInt(hex.slice(5, 7), 16);
|
|
1404
|
+
return `rgba(${r},${g},${b},${op})`;
|
|
1405
|
+
};
|
|
1406
|
+
const activeItem = items[active];
|
|
1407
|
+
return /* @__PURE__ */ React22.createElement("div", { style: {
|
|
1408
|
+
display: "flex",
|
|
1409
|
+
height: "480px",
|
|
1410
|
+
fontFamily: "system-ui, sans-serif",
|
|
1411
|
+
borderRadius: "16px",
|
|
1412
|
+
overflow: "hidden",
|
|
1413
|
+
border: "1px solid rgba(255,255,255,0.07)"
|
|
1414
|
+
} }, /* @__PURE__ */ React22.createElement("div", { style: {
|
|
1415
|
+
width: collapsed ? "60px" : "200px",
|
|
1416
|
+
background: bg,
|
|
1417
|
+
borderRight: "1px solid rgba(255,255,255,0.06)",
|
|
1418
|
+
display: "flex",
|
|
1419
|
+
flexDirection: "column",
|
|
1420
|
+
transition: "width 0.25s ease",
|
|
1421
|
+
flexShrink: 0,
|
|
1422
|
+
overflow: "hidden"
|
|
1423
|
+
} }, /* @__PURE__ */ React22.createElement("div", { style: {
|
|
1424
|
+
height: "56px",
|
|
1425
|
+
display: "flex",
|
|
1426
|
+
alignItems: "center",
|
|
1427
|
+
gap: "10px",
|
|
1428
|
+
padding: collapsed ? "0 14px" : "0 16px",
|
|
1429
|
+
borderBottom: "1px solid rgba(255,255,255,0.05)",
|
|
1430
|
+
overflow: "hidden",
|
|
1431
|
+
flexShrink: 0
|
|
1432
|
+
} }, /* @__PURE__ */ React22.createElement("div", { style: {
|
|
1433
|
+
width: "28px",
|
|
1434
|
+
height: "28px",
|
|
1435
|
+
borderRadius: "8px",
|
|
1436
|
+
flexShrink: 0,
|
|
1437
|
+
background: `linear-gradient(135deg, ${accent}, ${alpha(accent, 0.6)})`,
|
|
1438
|
+
display: "flex",
|
|
1439
|
+
alignItems: "center",
|
|
1440
|
+
justifyContent: "center",
|
|
1441
|
+
fontSize: "13px",
|
|
1442
|
+
fontWeight: "800",
|
|
1443
|
+
color: "#fff"
|
|
1444
|
+
} }, logo[0]), !collapsed && /* @__PURE__ */ React22.createElement("span", { style: { fontSize: "14px", fontWeight: "800", color: "#fff", whiteSpace: "nowrap" } }, logo)), /* @__PURE__ */ React22.createElement("nav", { style: { flex: 1, padding: "10px 8px", display: "flex", flexDirection: "column", gap: "3px", overflowY: "auto" } }, items.map((item, i) => /* @__PURE__ */ React22.createElement(
|
|
1445
|
+
"button",
|
|
1446
|
+
{
|
|
1447
|
+
key: i,
|
|
1448
|
+
onClick: () => setActive(i),
|
|
1449
|
+
title: collapsed ? item.label : "",
|
|
1450
|
+
style: {
|
|
1451
|
+
display: "flex",
|
|
1452
|
+
alignItems: "center",
|
|
1453
|
+
gap: "10px",
|
|
1454
|
+
padding: collapsed ? "9px 0" : "9px 12px",
|
|
1455
|
+
justifyContent: collapsed ? "center" : "flex-start",
|
|
1456
|
+
borderRadius: "10px",
|
|
1457
|
+
border: "none",
|
|
1458
|
+
cursor: "pointer",
|
|
1459
|
+
transition: "all 0.2s",
|
|
1460
|
+
fontFamily: "inherit",
|
|
1461
|
+
width: "100%",
|
|
1462
|
+
background: active === i ? alpha(accent, 0.12) : "transparent",
|
|
1463
|
+
color: active === i ? accent : "rgba(255,255,255,0.45)",
|
|
1464
|
+
borderLeft: active === i ? `2px solid ${accent}` : "2px solid transparent"
|
|
1465
|
+
},
|
|
1466
|
+
onMouseEnter: (e) => {
|
|
1467
|
+
if (active !== i) {
|
|
1468
|
+
e.currentTarget.style.background = "rgba(255,255,255,0.04)";
|
|
1469
|
+
e.currentTarget.style.color = "rgba(255,255,255,0.8)";
|
|
1470
|
+
}
|
|
1471
|
+
},
|
|
1472
|
+
onMouseLeave: (e) => {
|
|
1473
|
+
if (active !== i) {
|
|
1474
|
+
e.currentTarget.style.background = "transparent";
|
|
1475
|
+
e.currentTarget.style.color = "rgba(255,255,255,0.45)";
|
|
1476
|
+
}
|
|
1477
|
+
}
|
|
1478
|
+
},
|
|
1479
|
+
/* @__PURE__ */ React22.createElement(
|
|
1480
|
+
"svg",
|
|
1481
|
+
{
|
|
1482
|
+
width: "16",
|
|
1483
|
+
height: "16",
|
|
1484
|
+
viewBox: "0 0 24 24",
|
|
1485
|
+
fill: "none",
|
|
1486
|
+
stroke: "currentColor",
|
|
1487
|
+
strokeWidth: "2",
|
|
1488
|
+
strokeLinecap: "round",
|
|
1489
|
+
strokeLinejoin: "round",
|
|
1490
|
+
style: { flexShrink: 0 }
|
|
1491
|
+
},
|
|
1492
|
+
/* @__PURE__ */ React22.createElement("path", { d: item.icon })
|
|
1493
|
+
),
|
|
1494
|
+
!collapsed && /* @__PURE__ */ React22.createElement("span", { style: { fontSize: "13px", fontWeight: active === i ? "700" : "500", whiteSpace: "nowrap" } }, item.label)
|
|
1495
|
+
))), /* @__PURE__ */ React22.createElement("div", { style: { padding: "8px", borderTop: "1px solid rgba(255,255,255,0.05)" } }, /* @__PURE__ */ React22.createElement(
|
|
1496
|
+
"button",
|
|
1497
|
+
{
|
|
1498
|
+
onClick: () => setCollapsed((c) => !c),
|
|
1499
|
+
style: {
|
|
1500
|
+
width: "100%",
|
|
1501
|
+
padding: "8px",
|
|
1502
|
+
borderRadius: "9px",
|
|
1503
|
+
border: "none",
|
|
1504
|
+
background: "rgba(255,255,255,0.04)",
|
|
1505
|
+
cursor: "pointer",
|
|
1506
|
+
display: "flex",
|
|
1507
|
+
alignItems: "center",
|
|
1508
|
+
justifyContent: "center",
|
|
1509
|
+
color: "rgba(255,255,255,0.3)",
|
|
1510
|
+
transition: "all 0.2s"
|
|
1511
|
+
},
|
|
1512
|
+
onMouseEnter: (e) => e.currentTarget.style.color = "rgba(255,255,255,0.7)",
|
|
1513
|
+
onMouseLeave: (e) => e.currentTarget.style.color = "rgba(255,255,255,0.3)"
|
|
1514
|
+
},
|
|
1515
|
+
/* @__PURE__ */ React22.createElement(
|
|
1516
|
+
"svg",
|
|
1517
|
+
{
|
|
1518
|
+
width: "15",
|
|
1519
|
+
height: "15",
|
|
1520
|
+
viewBox: "0 0 24 24",
|
|
1521
|
+
fill: "none",
|
|
1522
|
+
stroke: "currentColor",
|
|
1523
|
+
strokeWidth: "2",
|
|
1524
|
+
strokeLinecap: "round"
|
|
1525
|
+
},
|
|
1526
|
+
/* @__PURE__ */ React22.createElement("path", { d: collapsed ? "M9 18l6-6-6-6" : "M15 18l-6-6 6-6" })
|
|
1527
|
+
)
|
|
1528
|
+
))), /* @__PURE__ */ React22.createElement("div", { style: {
|
|
1529
|
+
flex: 1,
|
|
1530
|
+
background: "rgba(255,255,255,0.02)",
|
|
1531
|
+
overflow: "auto"
|
|
1532
|
+
} }, /* @__PURE__ */ React22.createElement("div", { style: {
|
|
1533
|
+
height: "56px",
|
|
1534
|
+
display: "flex",
|
|
1535
|
+
alignItems: "center",
|
|
1536
|
+
padding: "0 20px",
|
|
1537
|
+
borderBottom: "1px solid rgba(255,255,255,0.05)",
|
|
1538
|
+
gap: "10px"
|
|
1539
|
+
} }, /* @__PURE__ */ React22.createElement("div", { style: {
|
|
1540
|
+
width: "6px",
|
|
1541
|
+
height: "6px",
|
|
1542
|
+
borderRadius: "50%",
|
|
1543
|
+
background: accent
|
|
1544
|
+
} }), /* @__PURE__ */ React22.createElement("span", { style: { fontSize: "14px", fontWeight: "700", color: "#fff" } }, activeItem == null ? void 0 : activeItem.label)), /* @__PURE__ */ React22.createElement("div", { style: { color: "#fff" } }, activeItem == null ? void 0 : activeItem.component)));
|
|
1545
|
+
};
|
|
1546
|
+
|
|
1547
|
+
// src/components/Charts/Charts.jsx
|
|
1548
|
+
import React23, { useState as useState16 } from "react";
|
|
1549
|
+
var Charts = ({
|
|
1550
|
+
type = "bar",
|
|
1551
|
+
data = [
|
|
1552
|
+
{ label: "Jan", value: 40 },
|
|
1553
|
+
{ label: "Feb", value: 70 },
|
|
1554
|
+
{ label: "Mar", value: 55 },
|
|
1555
|
+
{ label: "Apr", value: 90 },
|
|
1556
|
+
{ label: "May", value: 65 },
|
|
1557
|
+
{ label: "Jun", value: 80 },
|
|
1558
|
+
{ label: "Jul", value: 100 },
|
|
1559
|
+
{ label: "Aug", value: 30 }
|
|
1560
|
+
],
|
|
1561
|
+
title = "Monthly Stats",
|
|
1562
|
+
accent = "#6366f1",
|
|
1563
|
+
bg = "#0f172a",
|
|
1564
|
+
radius = "16px",
|
|
1565
|
+
showGrid = true,
|
|
1566
|
+
showValues = true
|
|
1567
|
+
}) => {
|
|
1568
|
+
const [hovered, setHovered] = useState16(null);
|
|
1569
|
+
const alpha = (hex, op) => {
|
|
1570
|
+
const r = parseInt(hex.slice(1, 3), 16);
|
|
1571
|
+
const g = parseInt(hex.slice(3, 5), 16);
|
|
1572
|
+
const b = parseInt(hex.slice(5, 7), 16);
|
|
1573
|
+
return `rgba(${r},${g},${b},${op})`;
|
|
1574
|
+
};
|
|
1575
|
+
const max = Math.max(...data.map((d) => d.value));
|
|
1576
|
+
const min = Math.min(...data.map((d) => d.value));
|
|
1577
|
+
const W = 320;
|
|
1578
|
+
const H = 160;
|
|
1579
|
+
const padL = 28;
|
|
1580
|
+
const padR = 12;
|
|
1581
|
+
const padT = 16;
|
|
1582
|
+
const padB = 28;
|
|
1583
|
+
const chartW = W - padL - padR;
|
|
1584
|
+
const chartH = H - padT - padB;
|
|
1585
|
+
const getX = (i) => padL + i / (data.length - 1) * chartW;
|
|
1586
|
+
const getY = (v) => padT + chartH - (v - min) / (max - min || 1) * chartH;
|
|
1587
|
+
const points = data.map((d, i) => `${getX(i)},${getY(d.value)}`).join(" ");
|
|
1588
|
+
const areaPoints = `${padL},${padT + chartH} ` + points + ` ${getX(data.length - 1)},${padT + chartH}`;
|
|
1589
|
+
const gridLines = [0, 0.25, 0.5, 0.75, 1].map((t) => ({
|
|
1590
|
+
y: padT + chartH * (1 - t),
|
|
1591
|
+
val: Math.round(min + t * (max - min))
|
|
1592
|
+
}));
|
|
1593
|
+
const BarChart = () => {
|
|
1594
|
+
const barW = Math.min(28, chartW / data.length * 0.55);
|
|
1595
|
+
return /* @__PURE__ */ React23.createElement("svg", { width: "100%", viewBox: `0 0 ${W} ${H}` }, showGrid && gridLines.map((g, i) => /* @__PURE__ */ React23.createElement("g", { key: i }, /* @__PURE__ */ React23.createElement(
|
|
1596
|
+
"line",
|
|
1597
|
+
{
|
|
1598
|
+
x1: padL,
|
|
1599
|
+
y1: g.y,
|
|
1600
|
+
x2: W - padR,
|
|
1601
|
+
y2: g.y,
|
|
1602
|
+
stroke: "rgba(255,255,255,0.05)",
|
|
1603
|
+
strokeWidth: "1"
|
|
1604
|
+
}
|
|
1605
|
+
), /* @__PURE__ */ React23.createElement(
|
|
1606
|
+
"text",
|
|
1607
|
+
{
|
|
1608
|
+
x: padL - 4,
|
|
1609
|
+
y: g.y + 4,
|
|
1610
|
+
textAnchor: "end",
|
|
1611
|
+
fill: "rgba(255,255,255,0.25)",
|
|
1612
|
+
fontSize: "9"
|
|
1613
|
+
},
|
|
1614
|
+
g.val
|
|
1615
|
+
))), data.map((d, i) => {
|
|
1616
|
+
const x = padL + i / data.length * chartW + (chartW / data.length - barW) / 2;
|
|
1617
|
+
const barH = (d.value - min) / (max - min || 1) * chartH;
|
|
1618
|
+
const y = padT + chartH - barH;
|
|
1619
|
+
const isH = hovered === i;
|
|
1620
|
+
return /* @__PURE__ */ React23.createElement("g", { key: i, onMouseEnter: () => setHovered(i), onMouseLeave: () => setHovered(null) }, /* @__PURE__ */ React23.createElement(
|
|
1621
|
+
"rect",
|
|
1622
|
+
{
|
|
1623
|
+
x,
|
|
1624
|
+
y: padT,
|
|
1625
|
+
width: barW,
|
|
1626
|
+
height: chartH,
|
|
1627
|
+
fill: "transparent",
|
|
1628
|
+
rx: "4"
|
|
1629
|
+
}
|
|
1630
|
+
), /* @__PURE__ */ React23.createElement(
|
|
1631
|
+
"rect",
|
|
1632
|
+
{
|
|
1633
|
+
x,
|
|
1634
|
+
y,
|
|
1635
|
+
width: barW,
|
|
1636
|
+
height: barH,
|
|
1637
|
+
fill: isH ? accent : alpha(accent, 0.55),
|
|
1638
|
+
rx: "4",
|
|
1639
|
+
style: { transition: "fill 0.15s" }
|
|
1640
|
+
}
|
|
1641
|
+
), showValues && isH && /* @__PURE__ */ React23.createElement(
|
|
1642
|
+
"text",
|
|
1643
|
+
{
|
|
1644
|
+
x: x + barW / 2,
|
|
1645
|
+
y: y - 5,
|
|
1646
|
+
textAnchor: "middle",
|
|
1647
|
+
fill: "#fff",
|
|
1648
|
+
fontSize: "9",
|
|
1649
|
+
fontWeight: "700"
|
|
1650
|
+
},
|
|
1651
|
+
d.value
|
|
1652
|
+
), /* @__PURE__ */ React23.createElement(
|
|
1653
|
+
"text",
|
|
1654
|
+
{
|
|
1655
|
+
x: x + barW / 2,
|
|
1656
|
+
y: H - 6,
|
|
1657
|
+
textAnchor: "middle",
|
|
1658
|
+
fill: "rgba(255,255,255,0.3)",
|
|
1659
|
+
fontSize: "9"
|
|
1660
|
+
},
|
|
1661
|
+
d.label
|
|
1662
|
+
));
|
|
1663
|
+
}));
|
|
1664
|
+
};
|
|
1665
|
+
const LineChart = () => /* @__PURE__ */ React23.createElement("svg", { width: "100%", viewBox: `0 0 ${W} ${H}` }, /* @__PURE__ */ React23.createElement("defs", null, /* @__PURE__ */ React23.createElement("linearGradient", { id: "lg", x1: "0", y1: "0", x2: "0", y2: "1" }, /* @__PURE__ */ React23.createElement("stop", { offset: "0%", stopColor: accent, stopOpacity: "0.3" }), /* @__PURE__ */ React23.createElement("stop", { offset: "100%", stopColor: accent, stopOpacity: "0" }))), showGrid && gridLines.map((g, i) => /* @__PURE__ */ React23.createElement("g", { key: i }, /* @__PURE__ */ React23.createElement(
|
|
1666
|
+
"line",
|
|
1667
|
+
{
|
|
1668
|
+
x1: padL,
|
|
1669
|
+
y1: g.y,
|
|
1670
|
+
x2: W - padR,
|
|
1671
|
+
y2: g.y,
|
|
1672
|
+
stroke: "rgba(255,255,255,0.05)",
|
|
1673
|
+
strokeWidth: "1"
|
|
1674
|
+
}
|
|
1675
|
+
), /* @__PURE__ */ React23.createElement(
|
|
1676
|
+
"text",
|
|
1677
|
+
{
|
|
1678
|
+
x: padL - 4,
|
|
1679
|
+
y: g.y + 4,
|
|
1680
|
+
textAnchor: "end",
|
|
1681
|
+
fill: "rgba(255,255,255,0.25)",
|
|
1682
|
+
fontSize: "9"
|
|
1683
|
+
},
|
|
1684
|
+
g.val
|
|
1685
|
+
))), /* @__PURE__ */ React23.createElement("polygon", { points: areaPoints, fill: "url(#lg)" }), /* @__PURE__ */ React23.createElement(
|
|
1686
|
+
"polyline",
|
|
1687
|
+
{
|
|
1688
|
+
points,
|
|
1689
|
+
fill: "none",
|
|
1690
|
+
stroke: accent,
|
|
1691
|
+
strokeWidth: "2",
|
|
1692
|
+
strokeLinejoin: "round",
|
|
1693
|
+
strokeLinecap: "round"
|
|
1694
|
+
}
|
|
1695
|
+
), data.map((d, i) => {
|
|
1696
|
+
const isH = hovered === i;
|
|
1697
|
+
return /* @__PURE__ */ React23.createElement("g", { key: i, onMouseEnter: () => setHovered(i), onMouseLeave: () => setHovered(null) }, /* @__PURE__ */ React23.createElement("circle", { cx: getX(i), cy: getY(d.value), r: "10", fill: "transparent" }), /* @__PURE__ */ React23.createElement(
|
|
1698
|
+
"circle",
|
|
1699
|
+
{
|
|
1700
|
+
cx: getX(i),
|
|
1701
|
+
cy: getY(d.value),
|
|
1702
|
+
r: isH ? 5 : 3,
|
|
1703
|
+
fill: isH ? "#fff" : accent,
|
|
1704
|
+
stroke: accent,
|
|
1705
|
+
strokeWidth: "2",
|
|
1706
|
+
style: { transition: "all 0.15s" }
|
|
1707
|
+
}
|
|
1708
|
+
), showValues && isH && /* @__PURE__ */ React23.createElement(
|
|
1709
|
+
"text",
|
|
1710
|
+
{
|
|
1711
|
+
x: getX(i),
|
|
1712
|
+
y: getY(d.value) - 10,
|
|
1713
|
+
textAnchor: "middle",
|
|
1714
|
+
fill: "#fff",
|
|
1715
|
+
fontSize: "9",
|
|
1716
|
+
fontWeight: "700"
|
|
1717
|
+
},
|
|
1718
|
+
d.value
|
|
1719
|
+
), /* @__PURE__ */ React23.createElement(
|
|
1720
|
+
"text",
|
|
1721
|
+
{
|
|
1722
|
+
x: getX(i),
|
|
1723
|
+
y: H - 6,
|
|
1724
|
+
textAnchor: "middle",
|
|
1725
|
+
fill: "rgba(255,255,255,0.3)",
|
|
1726
|
+
fontSize: "9"
|
|
1727
|
+
},
|
|
1728
|
+
d.label
|
|
1729
|
+
));
|
|
1730
|
+
}));
|
|
1731
|
+
const PieChart = () => {
|
|
1732
|
+
var _a, _b;
|
|
1733
|
+
const cx = W / 2, cy = H / 2 - 4, r = Math.min(H, W) / 2 - 24;
|
|
1734
|
+
const total = data.reduce((s, d) => s + d.value, 0);
|
|
1735
|
+
const colors = [
|
|
1736
|
+
accent,
|
|
1737
|
+
alpha(accent, 0.75),
|
|
1738
|
+
alpha(accent, 0.55),
|
|
1739
|
+
alpha(accent, 0.4),
|
|
1740
|
+
alpha(accent, 0.3),
|
|
1741
|
+
alpha(accent, 0.2),
|
|
1742
|
+
alpha(accent, 0.12)
|
|
1743
|
+
];
|
|
1744
|
+
let startAngle = -Math.PI / 2;
|
|
1745
|
+
const slices = data.map((d, i) => {
|
|
1746
|
+
const angle = d.value / total * 2 * Math.PI;
|
|
1747
|
+
const x1 = cx + r * Math.cos(startAngle);
|
|
1748
|
+
const y1 = cy + r * Math.sin(startAngle);
|
|
1749
|
+
const x2 = cx + r * Math.cos(startAngle + angle);
|
|
1750
|
+
const y2 = cy + r * Math.sin(startAngle + angle);
|
|
1751
|
+
const lx = cx + (r + 14) * Math.cos(startAngle + angle / 2);
|
|
1752
|
+
const ly = cy + (r + 14) * Math.sin(startAngle + angle / 2);
|
|
1753
|
+
const large = angle > Math.PI ? 1 : 0;
|
|
1754
|
+
const path = `M ${cx} ${cy} L ${x1} ${y1} A ${r} ${r} 0 ${large} 1 ${x2} ${y2} Z`;
|
|
1755
|
+
const slice = { path, color: colors[i % colors.length], d, angle, lx, ly, i };
|
|
1756
|
+
startAngle += angle;
|
|
1757
|
+
return slice;
|
|
1758
|
+
});
|
|
1759
|
+
return /* @__PURE__ */ React23.createElement("svg", { width: "100%", viewBox: `0 0 ${W} ${H}` }, slices.map((s) => /* @__PURE__ */ React23.createElement("g", { key: s.i, onMouseEnter: () => setHovered(s.i), onMouseLeave: () => setHovered(null) }, /* @__PURE__ */ React23.createElement(
|
|
1760
|
+
"path",
|
|
1761
|
+
{
|
|
1762
|
+
d: s.path,
|
|
1763
|
+
fill: s.color,
|
|
1764
|
+
stroke: bg,
|
|
1765
|
+
strokeWidth: "2",
|
|
1766
|
+
transform: hovered === s.i ? `translate(${Math.cos(s.angle / 2 - Math.PI / 2) * 4}, ${Math.sin(s.angle / 2 - Math.PI / 2) * 4})` : "",
|
|
1767
|
+
style: { transition: "transform 0.15s", cursor: "pointer" }
|
|
1768
|
+
}
|
|
1769
|
+
))), hovered !== null && /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement(
|
|
1770
|
+
"text",
|
|
1771
|
+
{
|
|
1772
|
+
x: cx,
|
|
1773
|
+
y: cy - 8,
|
|
1774
|
+
textAnchor: "middle",
|
|
1775
|
+
fill: "#fff",
|
|
1776
|
+
fontSize: "16",
|
|
1777
|
+
fontWeight: "800"
|
|
1778
|
+
},
|
|
1779
|
+
(_a = data[hovered]) == null ? void 0 : _a.value
|
|
1780
|
+
), /* @__PURE__ */ React23.createElement(
|
|
1781
|
+
"text",
|
|
1782
|
+
{
|
|
1783
|
+
x: cx,
|
|
1784
|
+
y: cy + 10,
|
|
1785
|
+
textAnchor: "middle",
|
|
1786
|
+
fill: "rgba(255,255,255,0.4)",
|
|
1787
|
+
fontSize: "9"
|
|
1788
|
+
},
|
|
1789
|
+
(_b = data[hovered]) == null ? void 0 : _b.label
|
|
1790
|
+
)), hovered === null && /* @__PURE__ */ React23.createElement(
|
|
1791
|
+
"text",
|
|
1792
|
+
{
|
|
1793
|
+
x: cx,
|
|
1794
|
+
y: cy + 5,
|
|
1795
|
+
textAnchor: "middle",
|
|
1796
|
+
fill: "rgba(255,255,255,0.2)",
|
|
1797
|
+
fontSize: "9"
|
|
1798
|
+
},
|
|
1799
|
+
"Hover slice"
|
|
1800
|
+
));
|
|
1801
|
+
};
|
|
1802
|
+
const AreaChart = () => /* @__PURE__ */ React23.createElement("svg", { width: "100%", viewBox: `0 0 ${W} ${H}` }, /* @__PURE__ */ React23.createElement("defs", null, /* @__PURE__ */ React23.createElement("linearGradient", { id: "ag", x1: "0", y1: "0", x2: "0", y2: "1" }, /* @__PURE__ */ React23.createElement("stop", { offset: "0%", stopColor: accent, stopOpacity: "0.5" }), /* @__PURE__ */ React23.createElement("stop", { offset: "100%", stopColor: accent, stopOpacity: "0.02" }))), showGrid && gridLines.map((g, i) => /* @__PURE__ */ React23.createElement("g", { key: i }, /* @__PURE__ */ React23.createElement(
|
|
1803
|
+
"line",
|
|
1804
|
+
{
|
|
1805
|
+
x1: padL,
|
|
1806
|
+
y1: g.y,
|
|
1807
|
+
x2: W - padR,
|
|
1808
|
+
y2: g.y,
|
|
1809
|
+
stroke: "rgba(255,255,255,0.05)",
|
|
1810
|
+
strokeWidth: "1"
|
|
1811
|
+
}
|
|
1812
|
+
), /* @__PURE__ */ React23.createElement(
|
|
1813
|
+
"text",
|
|
1814
|
+
{
|
|
1815
|
+
x: padL - 4,
|
|
1816
|
+
y: g.y + 4,
|
|
1817
|
+
textAnchor: "end",
|
|
1818
|
+
fill: "rgba(255,255,255,0.25)",
|
|
1819
|
+
fontSize: "9"
|
|
1820
|
+
},
|
|
1821
|
+
g.val
|
|
1822
|
+
))), /* @__PURE__ */ React23.createElement("polygon", { points: areaPoints, fill: "url(#ag)" }), /* @__PURE__ */ React23.createElement(
|
|
1823
|
+
"polyline",
|
|
1824
|
+
{
|
|
1825
|
+
points,
|
|
1826
|
+
fill: "none",
|
|
1827
|
+
stroke: accent,
|
|
1828
|
+
strokeWidth: "1.5",
|
|
1829
|
+
strokeLinejoin: "round",
|
|
1830
|
+
strokeLinecap: "round"
|
|
1831
|
+
}
|
|
1832
|
+
), data.map((d, i) => /* @__PURE__ */ React23.createElement("g", { key: i, onMouseEnter: () => setHovered(i), onMouseLeave: () => setHovered(null) }, /* @__PURE__ */ React23.createElement("rect", { x: getX(i) - 12, y: padT, width: 24, height: chartH, fill: "transparent" }), hovered === i && /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement(
|
|
1833
|
+
"line",
|
|
1834
|
+
{
|
|
1835
|
+
x1: getX(i),
|
|
1836
|
+
y1: padT,
|
|
1837
|
+
x2: getX(i),
|
|
1838
|
+
y2: padT + chartH,
|
|
1839
|
+
stroke: "rgba(255,255,255,0.1)",
|
|
1840
|
+
strokeWidth: "1",
|
|
1841
|
+
strokeDasharray: "3 3"
|
|
1842
|
+
}
|
|
1843
|
+
), showValues && /* @__PURE__ */ React23.createElement(
|
|
1844
|
+
"text",
|
|
1845
|
+
{
|
|
1846
|
+
x: getX(i),
|
|
1847
|
+
y: getY(d.value) - 10,
|
|
1848
|
+
textAnchor: "middle",
|
|
1849
|
+
fill: "#fff",
|
|
1850
|
+
fontSize: "9",
|
|
1851
|
+
fontWeight: "700"
|
|
1852
|
+
},
|
|
1853
|
+
d.value
|
|
1854
|
+
)), /* @__PURE__ */ React23.createElement(
|
|
1855
|
+
"text",
|
|
1856
|
+
{
|
|
1857
|
+
x: getX(i),
|
|
1858
|
+
y: H - 6,
|
|
1859
|
+
textAnchor: "middle",
|
|
1860
|
+
fill: "rgba(255,255,255,0.3)",
|
|
1861
|
+
fontSize: "9"
|
|
1862
|
+
},
|
|
1863
|
+
d.label
|
|
1864
|
+
))));
|
|
1865
|
+
const renderChart = () => {
|
|
1866
|
+
if (type === "line") return /* @__PURE__ */ React23.createElement(LineChart, null);
|
|
1867
|
+
if (type === "pie") return /* @__PURE__ */ React23.createElement(PieChart, null);
|
|
1868
|
+
if (type === "area") return /* @__PURE__ */ React23.createElement(AreaChart, null);
|
|
1869
|
+
return /* @__PURE__ */ React23.createElement(BarChart, null);
|
|
1870
|
+
};
|
|
1871
|
+
return /* @__PURE__ */ React23.createElement("div", { style: {
|
|
1872
|
+
background: bg,
|
|
1873
|
+
borderRadius: radius,
|
|
1874
|
+
padding: "20px",
|
|
1875
|
+
fontFamily: "system-ui, sans-serif",
|
|
1876
|
+
border: "1px solid rgba(255,255,255,0.07)",
|
|
1877
|
+
width: "100%",
|
|
1878
|
+
maxWidth: "360px",
|
|
1879
|
+
boxSizing: "border-box"
|
|
1880
|
+
} }, /* @__PURE__ */ React23.createElement("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: "16px" } }, /* @__PURE__ */ React23.createElement("p", { style: { fontSize: "14px", fontWeight: "700", color: "#fff", margin: 0 } }, title), /* @__PURE__ */ React23.createElement("span", { style: {
|
|
1881
|
+
fontSize: "10px",
|
|
1882
|
+
fontWeight: "700",
|
|
1883
|
+
padding: "3px 9px",
|
|
1884
|
+
borderRadius: "6px",
|
|
1885
|
+
background: alpha(accent, 0.12),
|
|
1886
|
+
color: accent,
|
|
1887
|
+
border: `1px solid ${alpha(accent, 0.25)}`,
|
|
1888
|
+
textTransform: "capitalize"
|
|
1889
|
+
} }, type)), renderChart());
|
|
1890
|
+
};
|
|
1368
1891
|
export {
|
|
1369
1892
|
Avatar,
|
|
1370
1893
|
AvatarCard,
|
|
1894
|
+
Charts,
|
|
1371
1895
|
CodeBlock,
|
|
1372
1896
|
CustomInputField,
|
|
1373
1897
|
DividerLine,
|
|
@@ -1381,6 +1905,7 @@ export {
|
|
|
1381
1905
|
PricingCard,
|
|
1382
1906
|
ResponsiveNavbar,
|
|
1383
1907
|
SearchBar,
|
|
1908
|
+
Sidebar,
|
|
1384
1909
|
SkeletonLoader,
|
|
1385
1910
|
SmartButton,
|
|
1386
1911
|
StatCard,
|