@webdevarif/dashui 0.1.2 → 0.1.3

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,330 @@ 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" }) {
1517
+ return /* @__PURE__ */ jsxs19("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: "10px", marginBottom: "28px" }, children: [
1518
+ /* @__PURE__ */ jsx34(
1519
+ "div",
1520
+ {
1521
+ style: {
1522
+ width: 36,
1523
+ height: 36,
1524
+ background: "var(--primary)",
1525
+ borderRadius: "calc(var(--radius, 0.5rem) * 1.2)",
1526
+ display: "flex",
1527
+ alignItems: "center",
1528
+ justifyContent: "center",
1529
+ color: "var(--primary-foreground)",
1530
+ fontWeight: 800,
1531
+ fontSize: "1rem",
1532
+ flexShrink: 0
1533
+ },
1534
+ children: letter
1535
+ }
1536
+ ),
1537
+ /* @__PURE__ */ jsx34(
1538
+ "span",
1539
+ {
1540
+ style: {
1541
+ fontWeight: 700,
1542
+ fontSize: "1.125rem",
1543
+ color: "var(--foreground)",
1544
+ letterSpacing: "-0.02em"
1545
+ },
1546
+ children: appName
1547
+ }
1548
+ )
1549
+ ] });
1550
+ }
1551
+
1552
+ // src/components/auth/AuthHeader.tsx
1553
+ import { jsx as jsx35, jsxs as jsxs20 } from "react/jsx-runtime";
1554
+ function AuthHeader({ title, description }) {
1555
+ return /* @__PURE__ */ jsxs20("div", { style: { marginBottom: "24px", textAlign: "center" }, children: [
1556
+ /* @__PURE__ */ jsx35(
1557
+ "h1",
1558
+ {
1559
+ style: {
1560
+ fontSize: "1.375rem",
1561
+ fontWeight: 700,
1562
+ color: "var(--foreground)",
1563
+ margin: 0,
1564
+ letterSpacing: "-0.02em"
1565
+ },
1566
+ children: title
1567
+ }
1568
+ ),
1569
+ description && /* @__PURE__ */ jsx35(
1570
+ "p",
1571
+ {
1572
+ style: {
1573
+ marginTop: "6px",
1574
+ fontSize: "0.875rem",
1575
+ color: "var(--muted-foreground)",
1576
+ lineHeight: 1.5
1577
+ },
1578
+ children: description
1579
+ }
1580
+ )
1581
+ ] });
1582
+ }
1583
+
1584
+ // src/components/auth/AuthField.tsx
1585
+ import { jsx as jsx36, jsxs as jsxs21 } from "react/jsx-runtime";
1586
+ function AuthField({ label, error, hint, rightLabel, id, ...props }) {
1587
+ const fieldId = id ?? label.toLowerCase().replace(/\s+/g, "-");
1588
+ return /* @__PURE__ */ jsxs21("div", { style: { display: "flex", flexDirection: "column", gap: "6px" }, children: [
1589
+ /* @__PURE__ */ jsxs21("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
1590
+ /* @__PURE__ */ jsx36(
1591
+ "label",
1592
+ {
1593
+ htmlFor: fieldId,
1594
+ style: {
1595
+ fontSize: "0.8125rem",
1596
+ fontWeight: 500,
1597
+ color: "var(--foreground)"
1598
+ },
1599
+ children: label
1600
+ }
1601
+ ),
1602
+ rightLabel && /* @__PURE__ */ jsx36("span", { style: { fontSize: "0.8125rem" }, children: rightLabel })
1603
+ ] }),
1604
+ /* @__PURE__ */ jsx36(
1605
+ "input",
1606
+ {
1607
+ id: fieldId,
1608
+ style: {
1609
+ height: "40px",
1610
+ padding: "0 12px",
1611
+ background: "var(--background)",
1612
+ border: `1px solid ${error ? "var(--destructive)" : "var(--border)"}`,
1613
+ borderRadius: "var(--radius, 0.5rem)",
1614
+ color: "var(--foreground)",
1615
+ fontSize: "0.875rem",
1616
+ outline: "none",
1617
+ width: "100%",
1618
+ boxSizing: "border-box",
1619
+ transition: "border-color 0.15s, box-shadow 0.15s"
1620
+ },
1621
+ onFocus: (e) => {
1622
+ e.currentTarget.style.borderColor = "var(--ring)";
1623
+ e.currentTarget.style.boxShadow = "0 0 0 3px color-mix(in oklab, var(--ring) 20%, transparent)";
1624
+ props.onFocus?.(e);
1625
+ },
1626
+ onBlur: (e) => {
1627
+ e.currentTarget.style.borderColor = error ? "var(--destructive)" : "var(--border)";
1628
+ e.currentTarget.style.boxShadow = "none";
1629
+ props.onBlur?.(e);
1630
+ },
1631
+ ...props
1632
+ }
1633
+ ),
1634
+ error && /* @__PURE__ */ jsx36("p", { style: { fontSize: "0.8rem", color: "var(--destructive)", margin: 0 }, children: error }),
1635
+ hint && !error && /* @__PURE__ */ jsx36("p", { style: { fontSize: "0.8rem", color: "var(--muted-foreground)", margin: 0 }, children: hint })
1636
+ ] });
1637
+ }
1638
+
1639
+ // src/components/auth/AuthButton.tsx
1640
+ import { Fragment as Fragment3, jsx as jsx37, jsxs as jsxs22 } from "react/jsx-runtime";
1641
+ function AuthButton({
1642
+ loading,
1643
+ variant = "primary",
1644
+ fullWidth = true,
1645
+ children,
1646
+ disabled,
1647
+ style,
1648
+ ...props
1649
+ }) {
1650
+ const base = {
1651
+ height: "42px",
1652
+ padding: "0 20px",
1653
+ borderRadius: "var(--radius, 0.5rem)",
1654
+ fontSize: "0.875rem",
1655
+ fontWeight: 600,
1656
+ cursor: loading || disabled ? "not-allowed" : "pointer",
1657
+ opacity: loading || disabled ? 0.65 : 1,
1658
+ display: "inline-flex",
1659
+ alignItems: "center",
1660
+ justifyContent: "center",
1661
+ gap: "8px",
1662
+ border: "none",
1663
+ outline: "none",
1664
+ transition: "opacity 0.15s, filter 0.15s",
1665
+ width: fullWidth ? "100%" : "auto",
1666
+ ...style
1667
+ };
1668
+ const variantStyles = {
1669
+ primary: {
1670
+ background: "var(--primary)",
1671
+ color: "var(--primary-foreground)"
1672
+ },
1673
+ outline: {
1674
+ background: "transparent",
1675
+ color: "var(--foreground)",
1676
+ border: "1px solid var(--border)"
1677
+ },
1678
+ ghost: {
1679
+ background: "transparent",
1680
+ color: "var(--foreground)"
1681
+ }
1682
+ };
1683
+ return /* @__PURE__ */ jsx37(
1684
+ "button",
1685
+ {
1686
+ disabled: loading || disabled,
1687
+ style: { ...base, ...variantStyles[variant] },
1688
+ onMouseEnter: (e) => {
1689
+ if (!loading && !disabled) e.currentTarget.style.filter = "brightness(0.9)";
1690
+ },
1691
+ onMouseLeave: (e) => {
1692
+ e.currentTarget.style.filter = "none";
1693
+ },
1694
+ ...props,
1695
+ children: loading ? /* @__PURE__ */ jsxs22(Fragment3, { children: [
1696
+ /* @__PURE__ */ jsx37(
1697
+ "span",
1698
+ {
1699
+ style: {
1700
+ width: 14,
1701
+ height: 14,
1702
+ border: "2px solid currentColor",
1703
+ borderTopColor: "transparent",
1704
+ borderRadius: "50%",
1705
+ display: "inline-block",
1706
+ animation: "dashui-spin 0.7s linear infinite"
1707
+ }
1708
+ }
1709
+ ),
1710
+ children
1711
+ ] }) : children
1712
+ }
1713
+ );
1714
+ }
1715
+
1716
+ // src/components/auth/AuthDivider.tsx
1717
+ import { jsx as jsx38, jsxs as jsxs23 } from "react/jsx-runtime";
1718
+ function AuthDivider({ label = "or" }) {
1719
+ return /* @__PURE__ */ jsxs23("div", { style: { display: "flex", alignItems: "center", gap: "12px", margin: "20px 0" }, children: [
1720
+ /* @__PURE__ */ jsx38("div", { style: { flex: 1, height: 1, background: "var(--border)" } }),
1721
+ /* @__PURE__ */ jsx38("span", { style: { fontSize: "0.75rem", color: "var(--muted-foreground)", userSelect: "none" }, children: label }),
1722
+ /* @__PURE__ */ jsx38("div", { style: { flex: 1, height: 1, background: "var(--border)" } })
1723
+ ] });
1724
+ }
1725
+
1726
+ // src/components/auth/AuthFootnote.tsx
1727
+ import { jsx as jsx39, jsxs as jsxs24 } from "react/jsx-runtime";
1728
+ function AuthFootnote({ text, linkText, linkHref }) {
1729
+ return /* @__PURE__ */ jsxs24("p", { style: {
1730
+ textAlign: "center",
1731
+ marginTop: "20px",
1732
+ fontSize: "0.8125rem",
1733
+ color: "var(--muted-foreground)"
1734
+ }, children: [
1735
+ text,
1736
+ " ",
1737
+ /* @__PURE__ */ jsx39(
1738
+ "a",
1739
+ {
1740
+ href: linkHref,
1741
+ style: {
1742
+ color: "var(--primary)",
1743
+ fontWeight: 600,
1744
+ textDecoration: "none"
1745
+ },
1746
+ onMouseEnter: (e) => e.currentTarget.style.textDecoration = "underline",
1747
+ onMouseLeave: (e) => e.currentTarget.style.textDecoration = "none",
1748
+ children: linkText
1749
+ }
1750
+ )
1751
+ ] });
1752
+ }
1753
+
1443
1754
  // src/index.ts
1444
1755
  import { ThemeProvider, useTheme } from "next-themes";
1445
1756
  export {
1446
1757
  Alert,
1447
1758
  AppShell,
1759
+ AuthButton,
1760
+ AuthCard,
1761
+ AuthDivider,
1762
+ AuthField,
1763
+ AuthFootnote,
1764
+ AuthHeader,
1765
+ AuthLogo,
1766
+ AuthShell,
1448
1767
  Badge,
1449
1768
  Button,
1450
1769
  Card,