@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.js CHANGED
@@ -32,6 +32,14 @@ var index_exports = {};
32
32
  __export(index_exports, {
33
33
  Alert: () => Alert,
34
34
  AppShell: () => AppShell,
35
+ AuthButton: () => AuthButton,
36
+ AuthCard: () => AuthCard,
37
+ AuthDivider: () => AuthDivider,
38
+ AuthField: () => AuthField,
39
+ AuthFootnote: () => AuthFootnote,
40
+ AuthHeader: () => AuthHeader,
41
+ AuthLogo: () => AuthLogo,
42
+ AuthShell: () => AuthShell,
35
43
  Badge: () => Badge,
36
44
  Button: () => Button,
37
45
  Card: () => Card,
@@ -93,7 +101,7 @@ __export(index_exports, {
93
101
  SelectValue: () => SelectValue,
94
102
  Separator: () => Separator3,
95
103
  Sidebar: () => Sidebar,
96
- Skeleton: () => Skeleton,
104
+ Skeleton: () => Skeleton2,
97
105
  Stats: () => Stats,
98
106
  Switch: () => Switch,
99
107
  Tabs: () => Tabs,
@@ -1558,12 +1566,371 @@ function usePagination(total, pageSize = 20) {
1558
1566
  return { page, setPage, pageSize, total, totalPages };
1559
1567
  }
1560
1568
 
1569
+ // src/components/auth/AuthShell.tsx
1570
+ var import_jsx_runtime32 = require("react/jsx-runtime");
1571
+ function AuthShell({ children, pattern = "dots" }) {
1572
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
1573
+ "div",
1574
+ {
1575
+ style: {
1576
+ minHeight: "100vh",
1577
+ display: "flex",
1578
+ flexDirection: "column",
1579
+ alignItems: "center",
1580
+ justifyContent: "center",
1581
+ padding: "24px",
1582
+ background: "var(--background)",
1583
+ position: "relative",
1584
+ overflow: "hidden"
1585
+ },
1586
+ children: [
1587
+ pattern === "dots" && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
1588
+ "div",
1589
+ {
1590
+ "aria-hidden": true,
1591
+ style: {
1592
+ position: "absolute",
1593
+ inset: 0,
1594
+ backgroundImage: "radial-gradient(circle, var(--border) 1px, transparent 1px)",
1595
+ backgroundSize: "28px 28px",
1596
+ opacity: 0.5,
1597
+ pointerEvents: "none"
1598
+ }
1599
+ }
1600
+ ),
1601
+ pattern === "grid" && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
1602
+ "div",
1603
+ {
1604
+ "aria-hidden": true,
1605
+ style: {
1606
+ position: "absolute",
1607
+ inset: 0,
1608
+ backgroundImage: "linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px)",
1609
+ backgroundSize: "32px 32px",
1610
+ opacity: 0.4,
1611
+ pointerEvents: "none"
1612
+ }
1613
+ }
1614
+ ),
1615
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { style: { position: "relative", zIndex: 1, width: "100%", maxWidth: "440px" }, children })
1616
+ ]
1617
+ }
1618
+ );
1619
+ }
1620
+
1621
+ // src/components/auth/AuthCard.tsx
1622
+ var import_jsx_runtime33 = require("react/jsx-runtime");
1623
+ function AuthCard({ children }) {
1624
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
1625
+ "div",
1626
+ {
1627
+ style: {
1628
+ background: "var(--card)",
1629
+ border: "1px solid var(--border)",
1630
+ borderRadius: "calc(var(--radius, 0.5rem) * 1.5)",
1631
+ boxShadow: "0 4px 32px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04)",
1632
+ padding: "36px 40px",
1633
+ width: "100%"
1634
+ },
1635
+ children
1636
+ }
1637
+ );
1638
+ }
1639
+
1640
+ // src/components/auth/AuthLogo.tsx
1641
+ var import_jsx_runtime34 = require("react/jsx-runtime");
1642
+ function AuthLogo({ appName = "Builify CMS", letter = "B", imageUrl, size = 36 }) {
1643
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: "10px", marginBottom: "28px" }, children: [
1644
+ imageUrl ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
1645
+ "img",
1646
+ {
1647
+ src: imageUrl,
1648
+ alt: appName,
1649
+ width: size,
1650
+ height: size,
1651
+ style: { borderRadius: "calc(var(--radius, 0.5rem) * 1.2)", flexShrink: 0, display: "block" }
1652
+ }
1653
+ ) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
1654
+ "div",
1655
+ {
1656
+ style: {
1657
+ width: size,
1658
+ height: size,
1659
+ background: "var(--primary)",
1660
+ borderRadius: "calc(var(--radius, 0.5rem) * 1.2)",
1661
+ display: "flex",
1662
+ alignItems: "center",
1663
+ justifyContent: "center",
1664
+ color: "var(--primary-foreground)",
1665
+ fontWeight: 800,
1666
+ fontSize: `${size * 0.44}px`,
1667
+ flexShrink: 0
1668
+ },
1669
+ children: letter
1670
+ }
1671
+ ),
1672
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
1673
+ "span",
1674
+ {
1675
+ style: {
1676
+ fontWeight: 700,
1677
+ fontSize: "1.125rem",
1678
+ color: "var(--foreground)",
1679
+ letterSpacing: "-0.02em"
1680
+ },
1681
+ children: appName
1682
+ }
1683
+ )
1684
+ ] });
1685
+ }
1686
+
1687
+ // src/components/auth/AuthHeader.tsx
1688
+ var import_jsx_runtime35 = require("react/jsx-runtime");
1689
+ function AuthHeader({ title, description }) {
1690
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { style: { marginBottom: "24px", textAlign: "center" }, children: [
1691
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
1692
+ "h1",
1693
+ {
1694
+ style: {
1695
+ fontSize: "1.375rem",
1696
+ fontWeight: 700,
1697
+ color: "var(--foreground)",
1698
+ margin: 0,
1699
+ letterSpacing: "-0.02em"
1700
+ },
1701
+ children: title
1702
+ }
1703
+ ),
1704
+ description && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
1705
+ "p",
1706
+ {
1707
+ style: {
1708
+ marginTop: "6px",
1709
+ fontSize: "0.875rem",
1710
+ color: "var(--muted-foreground)",
1711
+ lineHeight: 1.5
1712
+ },
1713
+ children: description
1714
+ }
1715
+ )
1716
+ ] });
1717
+ }
1718
+
1719
+ // src/components/auth/AuthField.tsx
1720
+ var import_jsx_runtime36 = require("react/jsx-runtime");
1721
+ function AuthField({ label, error, hint, rightLabel, id, ...props }) {
1722
+ const fieldId = id ?? label.toLowerCase().replace(/\s+/g, "-");
1723
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: "6px" }, children: [
1724
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
1725
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
1726
+ "label",
1727
+ {
1728
+ htmlFor: fieldId,
1729
+ style: {
1730
+ fontSize: "0.8125rem",
1731
+ fontWeight: 500,
1732
+ color: "var(--foreground)"
1733
+ },
1734
+ children: label
1735
+ }
1736
+ ),
1737
+ rightLabel && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { style: { fontSize: "0.8125rem" }, children: rightLabel })
1738
+ ] }),
1739
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
1740
+ "input",
1741
+ {
1742
+ id: fieldId,
1743
+ style: {
1744
+ height: "40px",
1745
+ padding: "0 12px",
1746
+ background: "var(--background)",
1747
+ border: `1px solid ${error ? "var(--destructive)" : "var(--border)"}`,
1748
+ borderRadius: "var(--radius, 0.5rem)",
1749
+ color: "var(--foreground)",
1750
+ fontSize: "0.875rem",
1751
+ outline: "none",
1752
+ width: "100%",
1753
+ boxSizing: "border-box",
1754
+ transition: "border-color 0.15s, box-shadow 0.15s"
1755
+ },
1756
+ onFocus: (e) => {
1757
+ e.currentTarget.style.borderColor = "var(--ring)";
1758
+ e.currentTarget.style.boxShadow = "0 0 0 3px color-mix(in oklab, var(--ring) 20%, transparent)";
1759
+ props.onFocus?.(e);
1760
+ },
1761
+ onBlur: (e) => {
1762
+ e.currentTarget.style.borderColor = error ? "var(--destructive)" : "var(--border)";
1763
+ e.currentTarget.style.boxShadow = "none";
1764
+ props.onBlur?.(e);
1765
+ },
1766
+ ...props
1767
+ }
1768
+ ),
1769
+ error && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { style: { fontSize: "0.8rem", color: "var(--destructive)", margin: 0 }, children: error }),
1770
+ hint && !error && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { style: { fontSize: "0.8rem", color: "var(--muted-foreground)", margin: 0 }, children: hint })
1771
+ ] });
1772
+ }
1773
+
1774
+ // src/components/auth/AuthButton.tsx
1775
+ var import_jsx_runtime37 = require("react/jsx-runtime");
1776
+ function AuthButton({
1777
+ loading,
1778
+ variant = "primary",
1779
+ fullWidth = true,
1780
+ children,
1781
+ disabled,
1782
+ style,
1783
+ ...props
1784
+ }) {
1785
+ const base = {
1786
+ height: "42px",
1787
+ padding: "0 20px",
1788
+ borderRadius: "var(--radius, 0.5rem)",
1789
+ fontSize: "0.875rem",
1790
+ fontWeight: 600,
1791
+ cursor: loading || disabled ? "not-allowed" : "pointer",
1792
+ opacity: loading || disabled ? 0.65 : 1,
1793
+ display: "inline-flex",
1794
+ alignItems: "center",
1795
+ justifyContent: "center",
1796
+ gap: "8px",
1797
+ border: "none",
1798
+ outline: "none",
1799
+ transition: "opacity 0.15s, filter 0.15s",
1800
+ width: fullWidth ? "100%" : "auto",
1801
+ ...style
1802
+ };
1803
+ const variantStyles = {
1804
+ primary: {
1805
+ background: "var(--primary)",
1806
+ color: "var(--primary-foreground)"
1807
+ },
1808
+ outline: {
1809
+ background: "transparent",
1810
+ color: "var(--foreground)",
1811
+ border: "1px solid var(--border)"
1812
+ },
1813
+ ghost: {
1814
+ background: "transparent",
1815
+ color: "var(--foreground)"
1816
+ }
1817
+ };
1818
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
1819
+ "button",
1820
+ {
1821
+ disabled: loading || disabled,
1822
+ style: { ...base, ...variantStyles[variant] },
1823
+ onMouseEnter: (e) => {
1824
+ if (!loading && !disabled) e.currentTarget.style.filter = "brightness(0.9)";
1825
+ },
1826
+ onMouseLeave: (e) => {
1827
+ e.currentTarget.style.filter = "none";
1828
+ },
1829
+ ...props,
1830
+ children: loading ? /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
1831
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
1832
+ "span",
1833
+ {
1834
+ style: {
1835
+ width: 14,
1836
+ height: 14,
1837
+ border: "2px solid currentColor",
1838
+ borderTopColor: "transparent",
1839
+ borderRadius: "50%",
1840
+ display: "inline-block",
1841
+ animation: "dashui-spin 0.7s linear infinite"
1842
+ }
1843
+ }
1844
+ ),
1845
+ children
1846
+ ] }) : children
1847
+ }
1848
+ );
1849
+ }
1850
+
1851
+ // src/components/auth/AuthDivider.tsx
1852
+ var import_jsx_runtime38 = require("react/jsx-runtime");
1853
+ function AuthDivider({ label = "or" }) {
1854
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "12px", margin: "20px 0" }, children: [
1855
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { style: { flex: 1, height: 1, background: "var(--border)" } }),
1856
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { style: { fontSize: "0.75rem", color: "var(--muted-foreground)", userSelect: "none" }, children: label }),
1857
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { style: { flex: 1, height: 1, background: "var(--border)" } })
1858
+ ] });
1859
+ }
1860
+
1861
+ // src/components/auth/AuthFootnote.tsx
1862
+ var import_jsx_runtime39 = require("react/jsx-runtime");
1863
+ function AuthFootnote({ text, linkText, linkHref }) {
1864
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("p", { style: {
1865
+ textAlign: "center",
1866
+ marginTop: "20px",
1867
+ fontSize: "0.8125rem",
1868
+ color: "var(--muted-foreground)"
1869
+ }, children: [
1870
+ text,
1871
+ " ",
1872
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
1873
+ "a",
1874
+ {
1875
+ href: linkHref,
1876
+ style: {
1877
+ color: "var(--primary)",
1878
+ fontWeight: 600,
1879
+ textDecoration: "none"
1880
+ },
1881
+ onMouseEnter: (e) => e.currentTarget.style.textDecoration = "underline",
1882
+ onMouseLeave: (e) => e.currentTarget.style.textDecoration = "none",
1883
+ children: linkText
1884
+ }
1885
+ )
1886
+ ] });
1887
+ }
1888
+
1889
+ // src/components/Skeleton.tsx
1890
+ var import_jsx_runtime40 = require("react/jsx-runtime");
1891
+ function Skeleton2({ width = "100%", height = 16, rounded, style }) {
1892
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
1893
+ "div",
1894
+ {
1895
+ style: {
1896
+ width,
1897
+ height,
1898
+ background: "var(--muted, #e5e7eb)",
1899
+ borderRadius: rounded ?? "var(--radius, 0.5rem)",
1900
+ overflow: "hidden",
1901
+ position: "relative",
1902
+ flexShrink: 0,
1903
+ ...style
1904
+ },
1905
+ children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
1906
+ "div",
1907
+ {
1908
+ style: {
1909
+ position: "absolute",
1910
+ inset: 0,
1911
+ background: "linear-gradient(90deg, transparent 0%, color-mix(in oklab, var(--background, #fff) 40%, transparent) 50%, transparent 100%)",
1912
+ animation: "dashui-shimmer 1.6s ease-in-out infinite"
1913
+ }
1914
+ }
1915
+ )
1916
+ }
1917
+ );
1918
+ }
1919
+
1561
1920
  // src/index.ts
1562
1921
  var import_next_themes = require("next-themes");
1563
1922
  // Annotate the CommonJS export names for ESM import in node:
1564
1923
  0 && (module.exports = {
1565
1924
  Alert,
1566
1925
  AppShell,
1926
+ AuthButton,
1927
+ AuthCard,
1928
+ AuthDivider,
1929
+ AuthField,
1930
+ AuthFootnote,
1931
+ AuthHeader,
1932
+ AuthLogo,
1933
+ AuthShell,
1567
1934
  Badge,
1568
1935
  Button,
1569
1936
  Card,