@webdevarif/dashui 0.1.2 → 0.1.4

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.mjs CHANGED
@@ -1440,11 +1440,370 @@ function usePagination(total, pageSize = 20) {
1440
1440
  return { page, setPage, pageSize, total, totalPages };
1441
1441
  }
1442
1442
 
1443
+ // src/components/auth/AuthShell.tsx
1444
+ import { jsx as jsx32, jsxs as jsxs18 } from "react/jsx-runtime";
1445
+ function AuthShell({ children, pattern = "dots" }) {
1446
+ return /* @__PURE__ */ jsxs18(
1447
+ "div",
1448
+ {
1449
+ style: {
1450
+ minHeight: "100vh",
1451
+ display: "flex",
1452
+ flexDirection: "column",
1453
+ alignItems: "center",
1454
+ justifyContent: "center",
1455
+ padding: "24px",
1456
+ background: "var(--background)",
1457
+ position: "relative",
1458
+ overflow: "hidden"
1459
+ },
1460
+ children: [
1461
+ pattern === "dots" && /* @__PURE__ */ jsx32(
1462
+ "div",
1463
+ {
1464
+ "aria-hidden": true,
1465
+ style: {
1466
+ position: "absolute",
1467
+ inset: 0,
1468
+ backgroundImage: "radial-gradient(circle, var(--border) 1px, transparent 1px)",
1469
+ backgroundSize: "28px 28px",
1470
+ opacity: 0.5,
1471
+ pointerEvents: "none"
1472
+ }
1473
+ }
1474
+ ),
1475
+ pattern === "grid" && /* @__PURE__ */ jsx32(
1476
+ "div",
1477
+ {
1478
+ "aria-hidden": true,
1479
+ style: {
1480
+ position: "absolute",
1481
+ inset: 0,
1482
+ backgroundImage: "linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px)",
1483
+ backgroundSize: "32px 32px",
1484
+ opacity: 0.4,
1485
+ pointerEvents: "none"
1486
+ }
1487
+ }
1488
+ ),
1489
+ /* @__PURE__ */ jsx32("div", { style: { position: "relative", zIndex: 1, width: "100%", maxWidth: "440px" }, children })
1490
+ ]
1491
+ }
1492
+ );
1493
+ }
1494
+
1495
+ // src/components/auth/AuthCard.tsx
1496
+ import { jsx as jsx33 } from "react/jsx-runtime";
1497
+ function AuthCard({ children }) {
1498
+ return /* @__PURE__ */ jsx33(
1499
+ "div",
1500
+ {
1501
+ style: {
1502
+ background: "var(--card)",
1503
+ border: "1px solid var(--border)",
1504
+ borderRadius: "calc(var(--radius, 0.5rem) * 1.5)",
1505
+ boxShadow: "0 4px 32px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04)",
1506
+ padding: "36px 40px",
1507
+ width: "100%"
1508
+ },
1509
+ children
1510
+ }
1511
+ );
1512
+ }
1513
+
1514
+ // src/components/auth/AuthLogo.tsx
1515
+ import { jsx as jsx34, jsxs as jsxs19 } from "react/jsx-runtime";
1516
+ function AuthLogo({ appName = "Builify CMS", letter = "B", imageUrl, size = 36 }) {
1517
+ return /* @__PURE__ */ jsxs19("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: "10px", marginBottom: "28px" }, children: [
1518
+ imageUrl ? /* @__PURE__ */ jsx34(
1519
+ "img",
1520
+ {
1521
+ src: imageUrl,
1522
+ alt: appName,
1523
+ width: size,
1524
+ height: size,
1525
+ style: { borderRadius: "calc(var(--radius, 0.5rem) * 1.2)", flexShrink: 0, display: "block" }
1526
+ }
1527
+ ) : /* @__PURE__ */ jsx34(
1528
+ "div",
1529
+ {
1530
+ style: {
1531
+ width: size,
1532
+ height: size,
1533
+ background: "var(--primary)",
1534
+ borderRadius: "calc(var(--radius, 0.5rem) * 1.2)",
1535
+ display: "flex",
1536
+ alignItems: "center",
1537
+ justifyContent: "center",
1538
+ color: "var(--primary-foreground)",
1539
+ fontWeight: 800,
1540
+ fontSize: `${size * 0.44}px`,
1541
+ flexShrink: 0
1542
+ },
1543
+ children: letter
1544
+ }
1545
+ ),
1546
+ /* @__PURE__ */ jsx34(
1547
+ "span",
1548
+ {
1549
+ style: {
1550
+ fontWeight: 700,
1551
+ fontSize: "1.125rem",
1552
+ color: "var(--foreground)",
1553
+ letterSpacing: "-0.02em"
1554
+ },
1555
+ children: appName
1556
+ }
1557
+ )
1558
+ ] });
1559
+ }
1560
+
1561
+ // src/components/auth/AuthHeader.tsx
1562
+ import { jsx as jsx35, jsxs as jsxs20 } from "react/jsx-runtime";
1563
+ function AuthHeader({ title, description }) {
1564
+ return /* @__PURE__ */ jsxs20("div", { style: { marginBottom: "24px", textAlign: "center" }, children: [
1565
+ /* @__PURE__ */ jsx35(
1566
+ "h1",
1567
+ {
1568
+ style: {
1569
+ fontSize: "1.375rem",
1570
+ fontWeight: 700,
1571
+ color: "var(--foreground)",
1572
+ margin: 0,
1573
+ letterSpacing: "-0.02em"
1574
+ },
1575
+ children: title
1576
+ }
1577
+ ),
1578
+ description && /* @__PURE__ */ jsx35(
1579
+ "p",
1580
+ {
1581
+ style: {
1582
+ marginTop: "6px",
1583
+ fontSize: "0.875rem",
1584
+ color: "var(--muted-foreground)",
1585
+ lineHeight: 1.5
1586
+ },
1587
+ children: description
1588
+ }
1589
+ )
1590
+ ] });
1591
+ }
1592
+
1593
+ // src/components/auth/AuthField.tsx
1594
+ import { jsx as jsx36, jsxs as jsxs21 } from "react/jsx-runtime";
1595
+ function AuthField({ label, error, hint, rightLabel, id, ...props }) {
1596
+ const fieldId = id ?? label.toLowerCase().replace(/\s+/g, "-");
1597
+ return /* @__PURE__ */ jsxs21("div", { style: { display: "flex", flexDirection: "column", gap: "6px" }, children: [
1598
+ /* @__PURE__ */ jsxs21("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
1599
+ /* @__PURE__ */ jsx36(
1600
+ "label",
1601
+ {
1602
+ htmlFor: fieldId,
1603
+ style: {
1604
+ fontSize: "0.8125rem",
1605
+ fontWeight: 500,
1606
+ color: "var(--foreground)"
1607
+ },
1608
+ children: label
1609
+ }
1610
+ ),
1611
+ rightLabel && /* @__PURE__ */ jsx36("span", { style: { fontSize: "0.8125rem" }, children: rightLabel })
1612
+ ] }),
1613
+ /* @__PURE__ */ jsx36(
1614
+ "input",
1615
+ {
1616
+ id: fieldId,
1617
+ style: {
1618
+ height: "40px",
1619
+ padding: "0 12px",
1620
+ background: "var(--background)",
1621
+ border: `1px solid ${error ? "var(--destructive)" : "var(--border)"}`,
1622
+ borderRadius: "var(--radius, 0.5rem)",
1623
+ color: "var(--foreground)",
1624
+ fontSize: "0.875rem",
1625
+ outline: "none",
1626
+ width: "100%",
1627
+ boxSizing: "border-box",
1628
+ transition: "border-color 0.15s, box-shadow 0.15s"
1629
+ },
1630
+ onFocus: (e) => {
1631
+ e.currentTarget.style.borderColor = "var(--ring)";
1632
+ e.currentTarget.style.boxShadow = "0 0 0 3px color-mix(in oklab, var(--ring) 20%, transparent)";
1633
+ props.onFocus?.(e);
1634
+ },
1635
+ onBlur: (e) => {
1636
+ e.currentTarget.style.borderColor = error ? "var(--destructive)" : "var(--border)";
1637
+ e.currentTarget.style.boxShadow = "none";
1638
+ props.onBlur?.(e);
1639
+ },
1640
+ ...props
1641
+ }
1642
+ ),
1643
+ error && /* @__PURE__ */ jsx36("p", { style: { fontSize: "0.8rem", color: "var(--destructive)", margin: 0 }, children: error }),
1644
+ hint && !error && /* @__PURE__ */ jsx36("p", { style: { fontSize: "0.8rem", color: "var(--muted-foreground)", margin: 0 }, children: hint })
1645
+ ] });
1646
+ }
1647
+
1648
+ // src/components/auth/AuthButton.tsx
1649
+ import { Fragment as Fragment3, jsx as jsx37, jsxs as jsxs22 } from "react/jsx-runtime";
1650
+ function AuthButton({
1651
+ loading,
1652
+ variant = "primary",
1653
+ fullWidth = true,
1654
+ children,
1655
+ disabled,
1656
+ style,
1657
+ ...props
1658
+ }) {
1659
+ const base = {
1660
+ height: "42px",
1661
+ padding: "0 20px",
1662
+ borderRadius: "var(--radius, 0.5rem)",
1663
+ fontSize: "0.875rem",
1664
+ fontWeight: 600,
1665
+ cursor: loading || disabled ? "not-allowed" : "pointer",
1666
+ opacity: loading || disabled ? 0.65 : 1,
1667
+ display: "inline-flex",
1668
+ alignItems: "center",
1669
+ justifyContent: "center",
1670
+ gap: "8px",
1671
+ border: "none",
1672
+ outline: "none",
1673
+ transition: "opacity 0.15s, filter 0.15s",
1674
+ width: fullWidth ? "100%" : "auto",
1675
+ ...style
1676
+ };
1677
+ const variantStyles = {
1678
+ primary: {
1679
+ background: "var(--primary)",
1680
+ color: "var(--primary-foreground)"
1681
+ },
1682
+ outline: {
1683
+ background: "transparent",
1684
+ color: "var(--foreground)",
1685
+ border: "1px solid var(--border)"
1686
+ },
1687
+ ghost: {
1688
+ background: "transparent",
1689
+ color: "var(--foreground)"
1690
+ }
1691
+ };
1692
+ return /* @__PURE__ */ jsx37(
1693
+ "button",
1694
+ {
1695
+ disabled: loading || disabled,
1696
+ style: { ...base, ...variantStyles[variant] },
1697
+ onMouseEnter: (e) => {
1698
+ if (!loading && !disabled) e.currentTarget.style.filter = "brightness(0.9)";
1699
+ },
1700
+ onMouseLeave: (e) => {
1701
+ e.currentTarget.style.filter = "none";
1702
+ },
1703
+ ...props,
1704
+ children: loading ? /* @__PURE__ */ jsxs22(Fragment3, { children: [
1705
+ /* @__PURE__ */ jsx37(
1706
+ "span",
1707
+ {
1708
+ style: {
1709
+ width: 14,
1710
+ height: 14,
1711
+ border: "2px solid currentColor",
1712
+ borderTopColor: "transparent",
1713
+ borderRadius: "50%",
1714
+ display: "inline-block",
1715
+ animation: "dashui-spin 0.7s linear infinite"
1716
+ }
1717
+ }
1718
+ ),
1719
+ children
1720
+ ] }) : children
1721
+ }
1722
+ );
1723
+ }
1724
+
1725
+ // src/components/auth/AuthDivider.tsx
1726
+ import { jsx as jsx38, jsxs as jsxs23 } from "react/jsx-runtime";
1727
+ function AuthDivider({ label = "or" }) {
1728
+ return /* @__PURE__ */ jsxs23("div", { style: { display: "flex", alignItems: "center", gap: "12px", margin: "20px 0" }, children: [
1729
+ /* @__PURE__ */ jsx38("div", { style: { flex: 1, height: 1, background: "var(--border)" } }),
1730
+ /* @__PURE__ */ jsx38("span", { style: { fontSize: "0.75rem", color: "var(--muted-foreground)", userSelect: "none" }, children: label }),
1731
+ /* @__PURE__ */ jsx38("div", { style: { flex: 1, height: 1, background: "var(--border)" } })
1732
+ ] });
1733
+ }
1734
+
1735
+ // src/components/auth/AuthFootnote.tsx
1736
+ import { jsx as jsx39, jsxs as jsxs24 } from "react/jsx-runtime";
1737
+ function AuthFootnote({ text, linkText, linkHref }) {
1738
+ return /* @__PURE__ */ jsxs24("p", { style: {
1739
+ textAlign: "center",
1740
+ marginTop: "20px",
1741
+ fontSize: "0.8125rem",
1742
+ color: "var(--muted-foreground)"
1743
+ }, children: [
1744
+ text,
1745
+ " ",
1746
+ /* @__PURE__ */ jsx39(
1747
+ "a",
1748
+ {
1749
+ href: linkHref,
1750
+ style: {
1751
+ color: "var(--primary)",
1752
+ fontWeight: 600,
1753
+ textDecoration: "none"
1754
+ },
1755
+ onMouseEnter: (e) => e.currentTarget.style.textDecoration = "underline",
1756
+ onMouseLeave: (e) => e.currentTarget.style.textDecoration = "none",
1757
+ children: linkText
1758
+ }
1759
+ )
1760
+ ] });
1761
+ }
1762
+
1763
+ // src/components/Skeleton.tsx
1764
+ import { jsx as jsx40 } from "react/jsx-runtime";
1765
+ function Skeleton2({ width = "100%", height = 16, rounded, style }) {
1766
+ return /* @__PURE__ */ jsx40(
1767
+ "div",
1768
+ {
1769
+ style: {
1770
+ width,
1771
+ height,
1772
+ background: "var(--muted, #e5e7eb)",
1773
+ borderRadius: rounded ?? "var(--radius, 0.5rem)",
1774
+ overflow: "hidden",
1775
+ position: "relative",
1776
+ flexShrink: 0,
1777
+ ...style
1778
+ },
1779
+ children: /* @__PURE__ */ jsx40(
1780
+ "div",
1781
+ {
1782
+ style: {
1783
+ position: "absolute",
1784
+ inset: 0,
1785
+ background: "linear-gradient(90deg, transparent 0%, color-mix(in oklab, var(--background, #fff) 40%, transparent) 50%, transparent 100%)",
1786
+ animation: "dashui-shimmer 1.6s ease-in-out infinite"
1787
+ }
1788
+ }
1789
+ )
1790
+ }
1791
+ );
1792
+ }
1793
+
1443
1794
  // src/index.ts
1444
1795
  import { ThemeProvider, useTheme } from "next-themes";
1445
1796
  export {
1446
1797
  Alert,
1447
1798
  AppShell,
1799
+ AuthButton,
1800
+ AuthCard,
1801
+ AuthDivider,
1802
+ AuthField,
1803
+ AuthFootnote,
1804
+ AuthHeader,
1805
+ AuthLogo,
1806
+ AuthShell,
1448
1807
  Badge,
1449
1808
  Button,
1450
1809
  Card,
@@ -1506,7 +1865,7 @@ export {
1506
1865
  SelectValue,
1507
1866
  Separator3 as Separator,
1508
1867
  Sidebar,
1509
- Skeleton,
1868
+ Skeleton2 as Skeleton,
1510
1869
  Stats,
1511
1870
  Switch,
1512
1871
  Tabs,