mywhy-ui 0.1.1 → 0.2.0
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 +417 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +93 -1
- package/dist/index.d.ts +93 -1
- package/dist/index.js +411 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -545,7 +545,7 @@ function MultiSelect({
|
|
|
545
545
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
546
546
|
};
|
|
547
547
|
}, [isOpen]);
|
|
548
|
-
const
|
|
548
|
+
const sizeClasses13 = {
|
|
549
549
|
sm: "h-7 px-2 text-sm",
|
|
550
550
|
md: "h-8 px-3 text-base",
|
|
551
551
|
lg: "h-9 px-4 text-base"
|
|
@@ -563,7 +563,7 @@ function MultiSelect({
|
|
|
563
563
|
"focus-within:ring-2 focus-within:ring-brand focus-within:ring-offset-1",
|
|
564
564
|
disabled ? "bg-surface-gray opacity-50 cursor-not-allowed" : "bg-white",
|
|
565
565
|
error ? "border-danger-border" : "border-outline",
|
|
566
|
-
|
|
566
|
+
sizeClasses13[size]
|
|
567
567
|
].join(" "),
|
|
568
568
|
onClick: () => !disabled && setIsOpen(!isOpen),
|
|
569
569
|
children: [
|
|
@@ -1613,6 +1613,412 @@ function Sidebar({
|
|
|
1613
1613
|
}
|
|
1614
1614
|
);
|
|
1615
1615
|
}
|
|
1616
|
+
function Table({
|
|
1617
|
+
columns,
|
|
1618
|
+
data,
|
|
1619
|
+
striped = true,
|
|
1620
|
+
hoverable = true,
|
|
1621
|
+
compact = false,
|
|
1622
|
+
className = "",
|
|
1623
|
+
emptyMessage = "No data"
|
|
1624
|
+
}) {
|
|
1625
|
+
if (data.length === 0) {
|
|
1626
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center py-8 text-ink-faint text-sm", children: emptyMessage });
|
|
1627
|
+
}
|
|
1628
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `overflow-x-auto border border-outline rounded-lg ${className}`, children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "w-full", children: [
|
|
1629
|
+
/* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsx("tr", { className: "bg-surface-gray border-b border-outline", children: columns.map((col) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1630
|
+
"th",
|
|
1631
|
+
{
|
|
1632
|
+
style: { width: col.width },
|
|
1633
|
+
className: `
|
|
1634
|
+
${compact ? "px-3 py-2" : "px-4 py-3"}
|
|
1635
|
+
text-left text-xs font-semibold text-ink-faint uppercase tracking-wide
|
|
1636
|
+
${col.align === "center" ? "text-center" : col.align === "right" ? "text-right" : "text-left"}
|
|
1637
|
+
`,
|
|
1638
|
+
children: col.label
|
|
1639
|
+
},
|
|
1640
|
+
col.key
|
|
1641
|
+
)) }) }),
|
|
1642
|
+
/* @__PURE__ */ jsxRuntime.jsx("tbody", { children: data.map((row, rowIdx) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1643
|
+
"tr",
|
|
1644
|
+
{
|
|
1645
|
+
className: `
|
|
1646
|
+
border-b border-outline last:border-b-0
|
|
1647
|
+
${striped && rowIdx % 2 === 1 ? "bg-surface-gray/50" : ""}
|
|
1648
|
+
${hoverable ? "hover:bg-surface-overlay transition-colors" : ""}
|
|
1649
|
+
`,
|
|
1650
|
+
children: columns.map((col) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1651
|
+
"td",
|
|
1652
|
+
{
|
|
1653
|
+
style: { width: col.width },
|
|
1654
|
+
className: `
|
|
1655
|
+
${compact ? "px-3 py-2" : "px-4 py-3"}
|
|
1656
|
+
text-sm text-ink
|
|
1657
|
+
${col.align === "center" ? "text-center" : col.align === "right" ? "text-right" : "text-left"}
|
|
1658
|
+
`,
|
|
1659
|
+
children: col.render ? col.render(row[col.key], row) : row[col.key]
|
|
1660
|
+
},
|
|
1661
|
+
`${rowIdx}-${col.key}`
|
|
1662
|
+
))
|
|
1663
|
+
},
|
|
1664
|
+
rowIdx
|
|
1665
|
+
)) })
|
|
1666
|
+
] }) });
|
|
1667
|
+
}
|
|
1668
|
+
var ChevronLeftIcon = ({ size }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "15 18 9 12 15 6" }) });
|
|
1669
|
+
var ChevronRightIcon = ({ size }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "9 18 15 12 9 6" }) });
|
|
1670
|
+
function Pagination({
|
|
1671
|
+
current,
|
|
1672
|
+
total,
|
|
1673
|
+
onChange,
|
|
1674
|
+
size = "md",
|
|
1675
|
+
showInfo = true,
|
|
1676
|
+
maxVisible = 5,
|
|
1677
|
+
className = ""
|
|
1678
|
+
}) {
|
|
1679
|
+
const sizeClass = size === "sm" ? "text-xs px-2 py-1" : "text-sm px-3 py-2";
|
|
1680
|
+
const getPages = () => {
|
|
1681
|
+
const pages2 = [];
|
|
1682
|
+
const halfVisible = Math.floor(maxVisible / 2);
|
|
1683
|
+
let start = Math.max(1, current - halfVisible);
|
|
1684
|
+
let end = Math.min(total, current + halfVisible);
|
|
1685
|
+
if (start === 1) {
|
|
1686
|
+
end = Math.min(total, maxVisible);
|
|
1687
|
+
} else if (end === total) {
|
|
1688
|
+
start = Math.max(1, total - maxVisible + 1);
|
|
1689
|
+
}
|
|
1690
|
+
if (start > 1) pages2.push(1);
|
|
1691
|
+
if (start > 2) pages2.push("...");
|
|
1692
|
+
for (let i = start; i <= end; i++) {
|
|
1693
|
+
pages2.push(i);
|
|
1694
|
+
}
|
|
1695
|
+
if (end < total - 1) pages2.push("...");
|
|
1696
|
+
if (end < total) pages2.push(total);
|
|
1697
|
+
return pages2;
|
|
1698
|
+
};
|
|
1699
|
+
const pages = getPages();
|
|
1700
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `flex items-center gap-2 ${className}`, children: [
|
|
1701
|
+
showInfo && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs text-ink-faint", children: [
|
|
1702
|
+
"Page ",
|
|
1703
|
+
current,
|
|
1704
|
+
" of ",
|
|
1705
|
+
total
|
|
1706
|
+
] }),
|
|
1707
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1708
|
+
"button",
|
|
1709
|
+
{
|
|
1710
|
+
onClick: () => onChange(Math.max(1, current - 1)),
|
|
1711
|
+
disabled: current === 1,
|
|
1712
|
+
className: `
|
|
1713
|
+
flex items-center justify-center rounded border border-outline
|
|
1714
|
+
hover:bg-surface-overlay disabled:text-ink-faint disabled:cursor-not-allowed disabled:hover:bg-transparent
|
|
1715
|
+
transition-colors ${sizeClass}
|
|
1716
|
+
`,
|
|
1717
|
+
title: "Previous page",
|
|
1718
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ChevronLeftIcon, { size: size === "sm" ? 12 : 16 })
|
|
1719
|
+
}
|
|
1720
|
+
),
|
|
1721
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-1", children: pages.map(
|
|
1722
|
+
(page, i) => page === "..." ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "px-2 text-ink-faint", children: "..." }, `ellipsis-${i}`) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1723
|
+
"button",
|
|
1724
|
+
{
|
|
1725
|
+
onClick: () => onChange(page),
|
|
1726
|
+
className: `
|
|
1727
|
+
flex items-center justify-center rounded border
|
|
1728
|
+
transition-colors ${sizeClass}
|
|
1729
|
+
${current === page ? "bg-brand text-white border-brand" : "border-outline hover:bg-surface-overlay"}
|
|
1730
|
+
`,
|
|
1731
|
+
children: page
|
|
1732
|
+
},
|
|
1733
|
+
page
|
|
1734
|
+
)
|
|
1735
|
+
) }),
|
|
1736
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1737
|
+
"button",
|
|
1738
|
+
{
|
|
1739
|
+
onClick: () => onChange(Math.min(total, current + 1)),
|
|
1740
|
+
disabled: current === total,
|
|
1741
|
+
className: `
|
|
1742
|
+
flex items-center justify-center rounded border border-outline
|
|
1743
|
+
hover:bg-surface-overlay disabled:text-ink-faint disabled:cursor-not-allowed disabled:hover:bg-transparent
|
|
1744
|
+
transition-colors ${sizeClass}
|
|
1745
|
+
`,
|
|
1746
|
+
title: "Next page",
|
|
1747
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ChevronRightIcon, { size: size === "sm" ? 12 : 16 })
|
|
1748
|
+
}
|
|
1749
|
+
)
|
|
1750
|
+
] });
|
|
1751
|
+
}
|
|
1752
|
+
function EmptyState({
|
|
1753
|
+
icon,
|
|
1754
|
+
title,
|
|
1755
|
+
description,
|
|
1756
|
+
action,
|
|
1757
|
+
className = ""
|
|
1758
|
+
}) {
|
|
1759
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `flex flex-col items-center justify-center py-12 px-4 ${className}`, children: [
|
|
1760
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-4xl mb-4", children: icon }),
|
|
1761
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg font-semibold text-ink mb-2", children: title }),
|
|
1762
|
+
description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-ink-faint mb-6 text-center max-w-sm", children: description }),
|
|
1763
|
+
action && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1764
|
+
"button",
|
|
1765
|
+
{
|
|
1766
|
+
onClick: action.onClick,
|
|
1767
|
+
className: "px-4 py-2 bg-brand text-white rounded-md hover:bg-brand-600 transition-colors text-sm font-medium",
|
|
1768
|
+
children: action.label
|
|
1769
|
+
}
|
|
1770
|
+
)
|
|
1771
|
+
] });
|
|
1772
|
+
}
|
|
1773
|
+
var ChevronUpIcon = ({ size }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "18 15 12 9 6 15" }) });
|
|
1774
|
+
var ChevronDownIcon = ({ size }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "6 9 12 15 18 9" }) });
|
|
1775
|
+
var sizeClasses10 = {
|
|
1776
|
+
sm: "text-xs px-2 py-1 h-8",
|
|
1777
|
+
md: "text-sm px-3 py-2 h-10",
|
|
1778
|
+
lg: "text-base px-4 py-2.5 h-12"
|
|
1779
|
+
};
|
|
1780
|
+
function NumberInput({
|
|
1781
|
+
value,
|
|
1782
|
+
onChange,
|
|
1783
|
+
step = 1,
|
|
1784
|
+
min,
|
|
1785
|
+
max,
|
|
1786
|
+
size = "md",
|
|
1787
|
+
disabled = false,
|
|
1788
|
+
placeholder,
|
|
1789
|
+
className = ""
|
|
1790
|
+
}) {
|
|
1791
|
+
const [isEditing, setIsEditing] = React9.useState(false);
|
|
1792
|
+
const handleIncrement = () => {
|
|
1793
|
+
const newValue = value + step;
|
|
1794
|
+
if (max === void 0 || newValue <= max) {
|
|
1795
|
+
onChange(newValue);
|
|
1796
|
+
}
|
|
1797
|
+
};
|
|
1798
|
+
const handleDecrement = () => {
|
|
1799
|
+
const newValue = value - step;
|
|
1800
|
+
if (min === void 0 || newValue >= min) {
|
|
1801
|
+
onChange(newValue);
|
|
1802
|
+
}
|
|
1803
|
+
};
|
|
1804
|
+
const handleInputChange = (e) => {
|
|
1805
|
+
const newValue = parseFloat(e.target.value);
|
|
1806
|
+
if (!isNaN(newValue)) {
|
|
1807
|
+
let val = newValue;
|
|
1808
|
+
if (min !== void 0 && val < min) val = min;
|
|
1809
|
+
if (max !== void 0 && val > max) val = max;
|
|
1810
|
+
onChange(val);
|
|
1811
|
+
}
|
|
1812
|
+
};
|
|
1813
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `relative inline-flex items-center border border-outline rounded-md bg-surface ${className}`, children: [
|
|
1814
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1815
|
+
"input",
|
|
1816
|
+
{
|
|
1817
|
+
type: "number",
|
|
1818
|
+
value,
|
|
1819
|
+
onChange: handleInputChange,
|
|
1820
|
+
onFocus: () => setIsEditing(true),
|
|
1821
|
+
onBlur: () => setIsEditing(false),
|
|
1822
|
+
disabled,
|
|
1823
|
+
placeholder,
|
|
1824
|
+
step,
|
|
1825
|
+
min,
|
|
1826
|
+
max,
|
|
1827
|
+
className: `
|
|
1828
|
+
flex-1 bg-transparent outline-none text-ink disabled:text-ink-faint disabled:cursor-not-allowed
|
|
1829
|
+
${sizeClasses10[size]}
|
|
1830
|
+
`
|
|
1831
|
+
}
|
|
1832
|
+
),
|
|
1833
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col border-l border-outline", children: [
|
|
1834
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1835
|
+
"button",
|
|
1836
|
+
{
|
|
1837
|
+
onClick: handleIncrement,
|
|
1838
|
+
disabled: disabled || max !== void 0 && value >= max,
|
|
1839
|
+
className: "flex-1 px-1 hover:bg-surface-overlay disabled:text-ink-faint disabled:cursor-not-allowed transition-colors",
|
|
1840
|
+
title: "Increment",
|
|
1841
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ChevronUpIcon, { size: size === "sm" ? 12 : size === "md" ? 14 : 16 })
|
|
1842
|
+
}
|
|
1843
|
+
),
|
|
1844
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1845
|
+
"button",
|
|
1846
|
+
{
|
|
1847
|
+
onClick: handleDecrement,
|
|
1848
|
+
disabled: disabled || min !== void 0 && value <= min,
|
|
1849
|
+
className: "flex-1 px-1 hover:bg-surface-overlay disabled:text-ink-faint disabled:cursor-not-allowed transition-colors border-t border-outline",
|
|
1850
|
+
title: "Decrement",
|
|
1851
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ChevronDownIcon, { size: size === "sm" ? 12 : size === "md" ? 14 : 16 })
|
|
1852
|
+
}
|
|
1853
|
+
)
|
|
1854
|
+
] })
|
|
1855
|
+
] });
|
|
1856
|
+
}
|
|
1857
|
+
var CopyIcon = ({ size }) => /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1858
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2" }),
|
|
1859
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "8", y: "2", width: "8", height: "4", rx: "1", ry: "1" })
|
|
1860
|
+
] });
|
|
1861
|
+
var CheckIcon = ({ size, className }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className, children: /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "20 6 9 17 4 12" }) });
|
|
1862
|
+
function CodeBlock({
|
|
1863
|
+
code,
|
|
1864
|
+
language = "text",
|
|
1865
|
+
copyable = true,
|
|
1866
|
+
numbered = false,
|
|
1867
|
+
maxHeight = "max-h-96",
|
|
1868
|
+
className = ""
|
|
1869
|
+
}) {
|
|
1870
|
+
const [copied, setCopied] = React9.useState(false);
|
|
1871
|
+
const handleCopy = async () => {
|
|
1872
|
+
try {
|
|
1873
|
+
await navigator.clipboard.writeText(code);
|
|
1874
|
+
setCopied(true);
|
|
1875
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
1876
|
+
} catch (err) {
|
|
1877
|
+
console.error("Failed to copy:", err);
|
|
1878
|
+
}
|
|
1879
|
+
};
|
|
1880
|
+
const lines = code.split("\n");
|
|
1881
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `relative bg-ink rounded-lg overflow-hidden border border-outline ${className}`, children: [
|
|
1882
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between bg-surface-gray px-4 py-2 border-b border-outline", children: [
|
|
1883
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-ink-faint font-mono uppercase", children: language }),
|
|
1884
|
+
copyable && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1885
|
+
"button",
|
|
1886
|
+
{
|
|
1887
|
+
onClick: handleCopy,
|
|
1888
|
+
className: "p-1 rounded hover:bg-surface-overlay transition-colors text-ink-faint hover:text-ink",
|
|
1889
|
+
title: "Copy to clipboard",
|
|
1890
|
+
children: copied ? /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "currentColor" }, className: "text-status-online", children: /* @__PURE__ */ jsxRuntime.jsx(CheckIcon, { size: 14 }) }) : /* @__PURE__ */ jsxRuntime.jsx(CopyIcon, { size: 14 })
|
|
1891
|
+
}
|
|
1892
|
+
)
|
|
1893
|
+
] }),
|
|
1894
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: `overflow-auto ${maxHeight}`, children: /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "p-4 text-sm font-mono text-sky-100", children: numbered ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: lines.map((line, i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-4", children: [
|
|
1895
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-ink-faint select-none", children: String(i + 1).padStart(3, " ") }),
|
|
1896
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: line })
|
|
1897
|
+
] }, i)) }) : code }) })
|
|
1898
|
+
] });
|
|
1899
|
+
}
|
|
1900
|
+
var statusColors = {
|
|
1901
|
+
completed: {
|
|
1902
|
+
dot: "bg-status-online border-status-online",
|
|
1903
|
+
line: "bg-status-online",
|
|
1904
|
+
text: "text-status-online"
|
|
1905
|
+
},
|
|
1906
|
+
pending: {
|
|
1907
|
+
dot: "bg-ink-light border-ink-light",
|
|
1908
|
+
line: "bg-ink-faint",
|
|
1909
|
+
text: "text-ink-faint"
|
|
1910
|
+
},
|
|
1911
|
+
error: {
|
|
1912
|
+
dot: "bg-danger-icon border-danger-icon",
|
|
1913
|
+
line: "bg-danger-icon",
|
|
1914
|
+
text: "text-danger-text"
|
|
1915
|
+
},
|
|
1916
|
+
"in-progress": {
|
|
1917
|
+
dot: "bg-brand border-brand",
|
|
1918
|
+
line: "bg-brand",
|
|
1919
|
+
text: "text-brand"
|
|
1920
|
+
}
|
|
1921
|
+
};
|
|
1922
|
+
function Timeline({
|
|
1923
|
+
items,
|
|
1924
|
+
orientation = "vertical",
|
|
1925
|
+
className = ""
|
|
1926
|
+
}) {
|
|
1927
|
+
if (orientation === "vertical") {
|
|
1928
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `space-y-4 ${className}`, children: items.map((item, index) => {
|
|
1929
|
+
const colors = statusColors[item.status];
|
|
1930
|
+
const isLast = index === items.length - 1;
|
|
1931
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-4", children: [
|
|
1932
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center", children: [
|
|
1933
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1934
|
+
"div",
|
|
1935
|
+
{
|
|
1936
|
+
className: `
|
|
1937
|
+
w-4 h-4 rounded-full border-2 flex-shrink-0
|
|
1938
|
+
flex items-center justify-center bg-white
|
|
1939
|
+
${colors.dot}
|
|
1940
|
+
`,
|
|
1941
|
+
children: item.icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-white text-2xs", children: item.icon })
|
|
1942
|
+
}
|
|
1943
|
+
),
|
|
1944
|
+
!isLast && /* @__PURE__ */ jsxRuntime.jsx("div", { className: `w-0.5 h-12 ${colors.line}` })
|
|
1945
|
+
] }),
|
|
1946
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 py-1", children: [
|
|
1947
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1948
|
+
/* @__PURE__ */ jsxRuntime.jsx("h4", { className: `font-semibold text-sm ${colors.text}`, children: item.label }),
|
|
1949
|
+
item.timestamp && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-ink-faint", children: typeof item.timestamp === "string" ? item.timestamp : new Date(item.timestamp).toLocaleTimeString("en-GB", {
|
|
1950
|
+
hour12: false,
|
|
1951
|
+
hour: "2-digit",
|
|
1952
|
+
minute: "2-digit",
|
|
1953
|
+
second: "2-digit"
|
|
1954
|
+
}) })
|
|
1955
|
+
] }),
|
|
1956
|
+
item.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-ink-faint mt-1", children: item.description })
|
|
1957
|
+
] })
|
|
1958
|
+
] }, item.id);
|
|
1959
|
+
}) });
|
|
1960
|
+
}
|
|
1961
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `flex gap-4 overflow-x-auto pb-2 ${className}`, children: items.map((item, index) => {
|
|
1962
|
+
const colors = statusColors[item.status];
|
|
1963
|
+
index === items.length - 1;
|
|
1964
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center flex-shrink-0 gap-2 min-w-fit", children: [
|
|
1965
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1966
|
+
index > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: `h-0.5 w-6 ${statusColors[items[index - 1].status].line}` }),
|
|
1967
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1968
|
+
"div",
|
|
1969
|
+
{
|
|
1970
|
+
className: `
|
|
1971
|
+
w-5 h-5 rounded-full border-2 flex items-center justify-center bg-white
|
|
1972
|
+
${colors.dot}
|
|
1973
|
+
`,
|
|
1974
|
+
children: item.icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-white text-2xs", children: item.icon })
|
|
1975
|
+
}
|
|
1976
|
+
)
|
|
1977
|
+
] }),
|
|
1978
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center", children: [
|
|
1979
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: `text-xs font-semibold ${colors.text}`, children: item.label }),
|
|
1980
|
+
item.timestamp && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-2xs text-ink-faint", children: typeof item.timestamp === "string" ? item.timestamp : new Date(item.timestamp).toLocaleTimeString("en-GB", {
|
|
1981
|
+
hour12: false,
|
|
1982
|
+
hour: "2-digit",
|
|
1983
|
+
minute: "2-digit"
|
|
1984
|
+
}) })
|
|
1985
|
+
] })
|
|
1986
|
+
] }, item.id);
|
|
1987
|
+
}) });
|
|
1988
|
+
}
|
|
1989
|
+
var sizeClasses11 = {
|
|
1990
|
+
xs: "text-xs px-1.5 py-0.5 min-w-5 h-5",
|
|
1991
|
+
sm: "text-xs px-2 py-1 min-w-6 h-6",
|
|
1992
|
+
md: "text-sm px-2.5 py-1.5 min-w-8 h-8"
|
|
1993
|
+
};
|
|
1994
|
+
var themeClasses5 = {
|
|
1995
|
+
gray: "bg-surface-gray border-outline text-ink",
|
|
1996
|
+
dark: "bg-ink text-white border-ink-faint",
|
|
1997
|
+
brand: "bg-brand border-brand text-white"
|
|
1998
|
+
};
|
|
1999
|
+
function Kbd({
|
|
2000
|
+
keys,
|
|
2001
|
+
size = "sm",
|
|
2002
|
+
theme = "gray",
|
|
2003
|
+
className = ""
|
|
2004
|
+
}) {
|
|
2005
|
+
const keyArray = Array.isArray(keys) ? keys : [keys];
|
|
2006
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: `inline-flex items-center gap-1 ${className}`, children: keyArray.map((key, i) => /* @__PURE__ */ jsxRuntime.jsxs(React9__default.default.Fragment, { children: [
|
|
2007
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2008
|
+
"kbd",
|
|
2009
|
+
{
|
|
2010
|
+
className: `
|
|
2011
|
+
inline-flex items-center justify-center rounded font-mono font-medium
|
|
2012
|
+
border border-b-2 shadow-sm
|
|
2013
|
+
${sizeClasses11[size]}
|
|
2014
|
+
${themeClasses5[theme]}
|
|
2015
|
+
`,
|
|
2016
|
+
children: key
|
|
2017
|
+
}
|
|
2018
|
+
),
|
|
2019
|
+
i < keyArray.length - 1 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-ink-faint text-xs", children: "+" })
|
|
2020
|
+
] }, key)) });
|
|
2021
|
+
}
|
|
1616
2022
|
var statusConfig = {
|
|
1617
2023
|
online: {
|
|
1618
2024
|
label: "Online",
|
|
@@ -1687,7 +2093,7 @@ function StatusBadge({
|
|
|
1687
2093
|
}
|
|
1688
2094
|
);
|
|
1689
2095
|
}
|
|
1690
|
-
var
|
|
2096
|
+
var sizeClasses12 = {
|
|
1691
2097
|
sm: "text-xs gap-1.5",
|
|
1692
2098
|
md: "text-sm gap-2",
|
|
1693
2099
|
lg: "text-base gap-2"
|
|
@@ -1706,7 +2112,7 @@ function ConnectionIndicator({
|
|
|
1706
2112
|
className = ""
|
|
1707
2113
|
}) {
|
|
1708
2114
|
const status = connected ? "online" : "offline";
|
|
1709
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `inline-flex items-center ${
|
|
2115
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `inline-flex items-center ${sizeClasses12[size]} ${className}`, children: [
|
|
1710
2116
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1711
2117
|
StatusBadge,
|
|
1712
2118
|
{
|
|
@@ -1760,16 +2166,21 @@ exports.Breadcrumbs = Breadcrumbs;
|
|
|
1760
2166
|
exports.Button = Button;
|
|
1761
2167
|
exports.Card = Card;
|
|
1762
2168
|
exports.Checkbox = Checkbox;
|
|
2169
|
+
exports.CodeBlock = CodeBlock;
|
|
1763
2170
|
exports.ConnectionIcon = ConnectionIcon;
|
|
1764
2171
|
exports.ConnectionIndicator = ConnectionIndicator;
|
|
1765
2172
|
exports.DatePicker = DatePicker;
|
|
1766
2173
|
exports.Dialog = Dialog;
|
|
1767
2174
|
exports.Dropdown = Dropdown;
|
|
2175
|
+
exports.EmptyState = EmptyState;
|
|
1768
2176
|
exports.FileUploader = FileUploader;
|
|
1769
2177
|
exports.FormControl = FormControl;
|
|
1770
2178
|
exports.Input = Input;
|
|
2179
|
+
exports.Kbd = Kbd;
|
|
1771
2180
|
exports.Link = Link;
|
|
1772
2181
|
exports.MultiSelect = MultiSelect;
|
|
2182
|
+
exports.NumberInput = NumberInput;
|
|
2183
|
+
exports.Pagination = Pagination;
|
|
1773
2184
|
exports.Progress = Progress;
|
|
1774
2185
|
exports.Rating = Rating;
|
|
1775
2186
|
exports.Select = Select;
|
|
@@ -1778,9 +2189,11 @@ exports.Slider = Slider;
|
|
|
1778
2189
|
exports.Spinner = Spinner;
|
|
1779
2190
|
exports.StatusBadge = StatusBadge;
|
|
1780
2191
|
exports.Switch = Switch;
|
|
2192
|
+
exports.Table = Table;
|
|
1781
2193
|
exports.Tabs = Tabs;
|
|
1782
2194
|
exports.Textarea = Textarea;
|
|
1783
2195
|
exports.TimePicker = TimePicker;
|
|
2196
|
+
exports.Timeline = Timeline;
|
|
1784
2197
|
exports.Toast = Toast;
|
|
1785
2198
|
exports.ToastContainer = ToastContainer;
|
|
1786
2199
|
exports.Tooltip = Tooltip;
|