@cytario/design 10.0.0 → 10.1.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.css +1 -1
- package/dist/index.d.ts +10 -3
- package/dist/index.js +372 -341
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -184,6 +184,7 @@ import {
|
|
|
184
184
|
FolderPlus,
|
|
185
185
|
FolderTree,
|
|
186
186
|
Fullscreen,
|
|
187
|
+
Funnel,
|
|
187
188
|
Grid2x2,
|
|
188
189
|
Grid3x3,
|
|
189
190
|
Hand,
|
|
@@ -345,6 +346,7 @@ var iconRegistry = {
|
|
|
345
346
|
FolderPlus,
|
|
346
347
|
FolderTree,
|
|
347
348
|
Fullscreen,
|
|
349
|
+
Funnel,
|
|
348
350
|
Github: GithubIcon,
|
|
349
351
|
Grid2x2,
|
|
350
352
|
Grid3x3,
|
|
@@ -1624,6 +1626,8 @@ function TableBodyRow({
|
|
|
1624
1626
|
rowIndex,
|
|
1625
1627
|
columns,
|
|
1626
1628
|
enableRowSelection,
|
|
1629
|
+
showIndex,
|
|
1630
|
+
anchorDataColumnId,
|
|
1627
1631
|
className
|
|
1628
1632
|
}) {
|
|
1629
1633
|
const handleKeyDown = useCallback3((event) => {
|
|
@@ -1656,10 +1660,11 @@ function TableBodyRow({
|
|
|
1656
1660
|
children: row.getVisibleCells().map((cell) => {
|
|
1657
1661
|
const isIndexColumn = cell.column.id === "index";
|
|
1658
1662
|
const columnConfig = columns.find((col) => col.id === cell.column.id);
|
|
1663
|
+
const isFirstDataCell = cell.column.id === anchorDataColumnId;
|
|
1659
1664
|
const isRight = columnConfig?.align === "right";
|
|
1660
1665
|
const alignClass = isRight ? "text-right" : columnConfig?.align === "center" ? "text-center" : "text-left";
|
|
1661
1666
|
const cxCell = twMerge11(
|
|
1662
|
-
"px-4 py-2",
|
|
1667
|
+
"relative px-4 py-2",
|
|
1663
1668
|
isIndexColumn ? "text-right" : alignClass,
|
|
1664
1669
|
columnConfig?.monospace && "font-mono font-light",
|
|
1665
1670
|
(isRight || isIndexColumn) && "tabular-nums",
|
|
@@ -1674,10 +1679,19 @@ function TableBodyRow({
|
|
|
1674
1679
|
const useRawString = columnConfig?.ellipsis === "middle" && typeof rawValue === "string";
|
|
1675
1680
|
const content = isIndexColumn ? rowIndex + 1 : useRawString ? rawValue : flexRender(cell.column.columnDef.cell, cell.getContext());
|
|
1676
1681
|
const copyValue = columnConfig?.copyable && typeof rawValue === "string" ? rawValue : void 0;
|
|
1677
|
-
return isIndexColumn ? /* @__PURE__ */ jsx20("th", { className: "p-2", style, children: /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-1 text-sm text-muted-foreground tabular-nums justify-between", children: [
|
|
1682
|
+
return isIndexColumn ? /* @__PURE__ */ jsx20("th", { className: "relative p-2", style, children: /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-1 text-sm text-muted-foreground tabular-nums justify-between", children: [
|
|
1678
1683
|
enableRowSelection && /* @__PURE__ */ jsx20(Checkbox, { isSelected: row.getIsSelected(), onChange: () => row.toggleSelected() }),
|
|
1679
1684
|
/* @__PURE__ */ jsx20("span", { children: rowIndex + 1 })
|
|
1680
|
-
] }) }, cell.id) : /* @__PURE__ */
|
|
1685
|
+
] }) }, cell.id) : /* @__PURE__ */ jsxs11("td", { className: cxCell, style, children: [
|
|
1686
|
+
!isFirstDataCell && /* @__PURE__ */ jsx20(
|
|
1687
|
+
"span",
|
|
1688
|
+
{
|
|
1689
|
+
"aria-hidden": "true",
|
|
1690
|
+
className: "pointer-events-none absolute inset-y-[20%] left-0 w-px bg-border"
|
|
1691
|
+
}
|
|
1692
|
+
),
|
|
1693
|
+
/* @__PURE__ */ jsx20(TruncatedText, { ellipsis: columnConfig?.ellipsis, copyValue, children: content })
|
|
1694
|
+
] }, cell.id);
|
|
1681
1695
|
})
|
|
1682
1696
|
}
|
|
1683
1697
|
);
|
|
@@ -1685,7 +1699,7 @@ function TableBodyRow({
|
|
|
1685
1699
|
|
|
1686
1700
|
// src/components/Table/TableHeaderRow.tsx
|
|
1687
1701
|
import { flexRender as flexRender2 } from "@tanstack/react-table";
|
|
1688
|
-
import { twMerge as
|
|
1702
|
+
import { twMerge as twMerge15 } from "tailwind-merge";
|
|
1689
1703
|
|
|
1690
1704
|
// src/components/Badge/Badge.tsx
|
|
1691
1705
|
import { twMerge as twMerge13 } from "tailwind-merge";
|
|
@@ -1743,12 +1757,65 @@ function Badge({
|
|
|
1743
1757
|
);
|
|
1744
1758
|
}
|
|
1745
1759
|
|
|
1760
|
+
// src/components/Popover/Popover.tsx
|
|
1761
|
+
import {
|
|
1762
|
+
DialogTrigger,
|
|
1763
|
+
Popover as AriaPopover,
|
|
1764
|
+
Button as AriaButton3
|
|
1765
|
+
} from "react-aria-components";
|
|
1766
|
+
import { twMerge as twMerge14 } from "tailwind-merge";
|
|
1767
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
1768
|
+
function Popover2({ children, isOpen, onOpenChange }) {
|
|
1769
|
+
return /* @__PURE__ */ jsx23(DialogTrigger, { isOpen, onOpenChange, children });
|
|
1770
|
+
}
|
|
1771
|
+
function PopoverTrigger({
|
|
1772
|
+
children,
|
|
1773
|
+
className,
|
|
1774
|
+
"aria-label": ariaLabel
|
|
1775
|
+
}) {
|
|
1776
|
+
const cx = `
|
|
1777
|
+
inline-flex items-center bg-transparent border-none p-0 outline-none cursor-pointer
|
|
1778
|
+
focus-visible:ring-2 focus-visible:ring-ring focus-visible:rounded-sm
|
|
1779
|
+
`;
|
|
1780
|
+
return /* @__PURE__ */ jsx23(AriaButton3, { "aria-label": ariaLabel, className: twMerge14(cx, className), children });
|
|
1781
|
+
}
|
|
1782
|
+
function PopoverContent({
|
|
1783
|
+
placement = "bottom",
|
|
1784
|
+
offset: offsetPx = 8,
|
|
1785
|
+
className,
|
|
1786
|
+
children,
|
|
1787
|
+
...rest
|
|
1788
|
+
}) {
|
|
1789
|
+
const cx = `
|
|
1790
|
+
z-50
|
|
1791
|
+
bg-background
|
|
1792
|
+
border border-border
|
|
1793
|
+
rounded-md shadow-lg
|
|
1794
|
+
entering:animate-in entering:fade-in entering:duration-300
|
|
1795
|
+
exiting:animate-out exiting:fade-out exiting:duration-300
|
|
1796
|
+
entering:placement-top:slide-in-from-bottom-1
|
|
1797
|
+
entering:placement-bottom:slide-in-from-top-1
|
|
1798
|
+
entering:placement-left:slide-in-from-right-1
|
|
1799
|
+
entering:placement-right:slide-in-from-left-1
|
|
1800
|
+
`;
|
|
1801
|
+
return /* @__PURE__ */ jsx23(
|
|
1802
|
+
AriaPopover,
|
|
1803
|
+
{
|
|
1804
|
+
...rest,
|
|
1805
|
+
placement,
|
|
1806
|
+
offset: offsetPx,
|
|
1807
|
+
className: twMerge14(cx, className),
|
|
1808
|
+
children
|
|
1809
|
+
}
|
|
1810
|
+
);
|
|
1811
|
+
}
|
|
1812
|
+
|
|
1746
1813
|
// src/components/Table/ColumnFilterInput.tsx
|
|
1747
|
-
import { useMemo } from "react";
|
|
1748
|
-
import { jsx as
|
|
1814
|
+
import { useMemo, useState as useState6 } from "react";
|
|
1815
|
+
import { jsx as jsx24, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1749
1816
|
var ALL_KEY = "__all__";
|
|
1750
1817
|
var ALL_OPTION = { id: ALL_KEY, name: "All" };
|
|
1751
|
-
var AllPill = () => /* @__PURE__ */
|
|
1818
|
+
var AllPill = () => /* @__PURE__ */ jsx24(Badge, { color: "slate", children: "All" });
|
|
1752
1819
|
function ColumnFilterInput({
|
|
1753
1820
|
column,
|
|
1754
1821
|
filterType,
|
|
@@ -1757,6 +1824,7 @@ function ColumnFilterInput({
|
|
|
1757
1824
|
filterRender
|
|
1758
1825
|
}) {
|
|
1759
1826
|
const filterValue = column.getFilterValue() ?? "";
|
|
1827
|
+
const [isOpen, setIsOpen] = useState6(false);
|
|
1760
1828
|
const selectItems = useMemo(() => {
|
|
1761
1829
|
if (filterType !== "select") return [];
|
|
1762
1830
|
if (filterOptions) {
|
|
@@ -1778,40 +1846,62 @@ function ColumnFilterInput({
|
|
|
1778
1846
|
if (!filterRender) return void 0;
|
|
1779
1847
|
const render = filterRender;
|
|
1780
1848
|
function FilterOption(item) {
|
|
1781
|
-
return item.id === ALL_KEY ? /* @__PURE__ */
|
|
1849
|
+
return item.id === ALL_KEY ? /* @__PURE__ */ jsx24(AllPill, {}) : render({ label: item.name, value: item.id });
|
|
1782
1850
|
}
|
|
1783
1851
|
return FilterOption;
|
|
1784
1852
|
}, [filterRender]);
|
|
1785
|
-
return /* @__PURE__ */ jsxs13(
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
{
|
|
1789
|
-
size: "sm",
|
|
1790
|
-
className: "w-full",
|
|
1791
|
-
items: selectItems,
|
|
1792
|
-
value: selectedKey,
|
|
1793
|
-
onChange: (key) => setFilter(String(key)),
|
|
1794
|
-
"aria-label": `Filter by ${column.columnDef.header}`,
|
|
1795
|
-
renderItem
|
|
1796
|
-
}
|
|
1797
|
-
) : /* @__PURE__ */ jsx23(
|
|
1798
|
-
Input,
|
|
1853
|
+
return /* @__PURE__ */ jsxs13(Popover2, { isOpen, onOpenChange: setIsOpen, children: [
|
|
1854
|
+
/* @__PURE__ */ jsx24(PopoverTrigger, { className: "group", "aria-label": `Filter by ${column.columnDef.header}`, children: /* @__PURE__ */ jsxs13(
|
|
1855
|
+
"span",
|
|
1799
1856
|
{
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1857
|
+
"aria-hidden": "true",
|
|
1858
|
+
className: "relative inline-flex size-7 items-center justify-center rounded-md text-muted-foreground transition-colors group-hover:text-foreground group-focus-visible:text-foreground",
|
|
1859
|
+
children: [
|
|
1860
|
+
/* @__PURE__ */ jsx24(Icon, { icon: "Funnel", size: "sm" }),
|
|
1861
|
+
filterValue && /* @__PURE__ */ jsx24("span", { className: "pointer-events-none absolute right-1 top-1 size-1.5 rounded-full bg-primary" })
|
|
1862
|
+
]
|
|
1805
1863
|
}
|
|
1806
|
-
),
|
|
1807
|
-
|
|
1864
|
+
) }),
|
|
1865
|
+
/* @__PURE__ */ jsx24(PopoverContent, { placement: "bottom start", offset: 4, className: "w-56 p-3", children: /* @__PURE__ */ jsxs13("div", { className: "flex flex-col gap-2 font-normal", children: [
|
|
1866
|
+
filterType === "select" ? /* @__PURE__ */ jsx24(
|
|
1867
|
+
Select,
|
|
1868
|
+
{
|
|
1869
|
+
size: "sm",
|
|
1870
|
+
className: "w-full",
|
|
1871
|
+
items: selectItems,
|
|
1872
|
+
value: selectedKey,
|
|
1873
|
+
onChange: (key) => setFilter(String(key)),
|
|
1874
|
+
"aria-label": `Filter by ${column.columnDef.header}`,
|
|
1875
|
+
renderItem
|
|
1876
|
+
}
|
|
1877
|
+
) : /* @__PURE__ */ jsx24(
|
|
1878
|
+
Input,
|
|
1879
|
+
{
|
|
1880
|
+
value: filterValue,
|
|
1881
|
+
onChange: setFilter,
|
|
1882
|
+
placeholder: filterPlaceholder ?? `Filter ${column.columnDef.header}...`,
|
|
1883
|
+
"aria-label": `Filter by ${column.columnDef.header}`,
|
|
1884
|
+
size: "sm"
|
|
1885
|
+
}
|
|
1886
|
+
),
|
|
1887
|
+
filterValue && /* @__PURE__ */ jsx24(
|
|
1888
|
+
IconButton,
|
|
1889
|
+
{
|
|
1890
|
+
icon: "X",
|
|
1891
|
+
size: "sm",
|
|
1892
|
+
variant: "ghost",
|
|
1893
|
+
onPress: clearFilter,
|
|
1894
|
+
label: "Clear filter"
|
|
1895
|
+
}
|
|
1896
|
+
)
|
|
1897
|
+
] }) })
|
|
1808
1898
|
] });
|
|
1809
1899
|
}
|
|
1810
1900
|
|
|
1811
1901
|
// src/components/Table/ColumnResizeHandle.tsx
|
|
1812
|
-
import { jsx as
|
|
1902
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1813
1903
|
var ColumnResizeHandle = ({ header }) => {
|
|
1814
|
-
return /* @__PURE__ */
|
|
1904
|
+
return /* @__PURE__ */ jsx25(
|
|
1815
1905
|
"button",
|
|
1816
1906
|
{
|
|
1817
1907
|
type: "button",
|
|
@@ -1825,13 +1915,13 @@ var ColumnResizeHandle = ({ header }) => {
|
|
|
1825
1915
|
transition-colors duration-200
|
|
1826
1916
|
bg-transparent hover:bg-accent active:bg-secondary
|
|
1827
1917
|
`,
|
|
1828
|
-
children: /* @__PURE__ */
|
|
1918
|
+
children: /* @__PURE__ */ jsx25("div", { className: "w-px h-full bg-border" })
|
|
1829
1919
|
}
|
|
1830
1920
|
);
|
|
1831
1921
|
};
|
|
1832
1922
|
|
|
1833
1923
|
// src/components/Table/ColumnSortButton.tsx
|
|
1834
|
-
import { jsx as
|
|
1924
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
1835
1925
|
function getStyle(sortDirection) {
|
|
1836
1926
|
switch (sortDirection) {
|
|
1837
1927
|
case "desc":
|
|
@@ -1844,17 +1934,114 @@ function getStyle(sortDirection) {
|
|
|
1844
1934
|
var ColumnSortButton = ({ header }) => {
|
|
1845
1935
|
const sortDirection = header.column.getIsSorted();
|
|
1846
1936
|
const cx = getStyle(sortDirection);
|
|
1847
|
-
return sortDirection === "desc" ? /* @__PURE__ */
|
|
1937
|
+
return sortDirection === "desc" ? /* @__PURE__ */ jsx26(Icon, { icon: "ArrowDown", size: "xs", className: cx }) : /* @__PURE__ */ jsx26(Icon, { icon: "ArrowUp", size: "xs", className: cx });
|
|
1848
1938
|
};
|
|
1849
1939
|
|
|
1940
|
+
// src/components/Table/TableHeaderRow.tsx
|
|
1941
|
+
import { jsx as jsx27, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1942
|
+
function TableHeaderRow({
|
|
1943
|
+
headerGroup,
|
|
1944
|
+
columns,
|
|
1945
|
+
enableRowSelection,
|
|
1946
|
+
showFilters
|
|
1947
|
+
}) {
|
|
1948
|
+
return /* @__PURE__ */ jsx27("tr", { className: "w-full block", children: headerGroup.headers.map((header) => {
|
|
1949
|
+
const columnConfig = columns.find((col) => col.id === header.id);
|
|
1950
|
+
const isIndexColumn = header.id === "index";
|
|
1951
|
+
const isSorted = header.column.getIsSorted();
|
|
1952
|
+
const baseClass = "relative pl-4 pr-4 group/header text-sm align-top";
|
|
1953
|
+
const indexClass = "text-right tabular-nums text-center p-1 px-2";
|
|
1954
|
+
const alignClasses2 = {
|
|
1955
|
+
left: "text-left",
|
|
1956
|
+
right: "text-right",
|
|
1957
|
+
center: "text-center"
|
|
1958
|
+
};
|
|
1959
|
+
const alignClass = alignClasses2[columnConfig?.align ?? "left"];
|
|
1960
|
+
const cxTh = twMerge15(baseClass, isIndexColumn ? indexClass : alignClass);
|
|
1961
|
+
const style = {
|
|
1962
|
+
width: header.getSize(),
|
|
1963
|
+
minWidth: header.getSize(),
|
|
1964
|
+
maxWidth: header.getSize()
|
|
1965
|
+
};
|
|
1966
|
+
const isRight = columnConfig?.align === "right";
|
|
1967
|
+
const tableHeadCx = `
|
|
1968
|
+
flex items-center justify-between gap-1 h-8 text-left
|
|
1969
|
+
text-sm font-medium text-foreground
|
|
1970
|
+
`;
|
|
1971
|
+
const tableHeadToggleCx = `
|
|
1972
|
+
cursor-pointer
|
|
1973
|
+
hover:text-muted-foreground
|
|
1974
|
+
focus-visible:outline-none
|
|
1975
|
+
focus-visible:ring-2
|
|
1976
|
+
focus-visible:ring-ring
|
|
1977
|
+
focus-visible:ring-offset-1
|
|
1978
|
+
rounded-sm
|
|
1979
|
+
`;
|
|
1980
|
+
return /* @__PURE__ */ jsxs14(
|
|
1981
|
+
"th",
|
|
1982
|
+
{
|
|
1983
|
+
className: cxTh,
|
|
1984
|
+
style,
|
|
1985
|
+
"aria-sort": isSorted === "asc" ? "ascending" : isSorted === "desc" ? "descending" : void 0,
|
|
1986
|
+
children: [
|
|
1987
|
+
isIndexColumn ? enableRowSelection && /* @__PURE__ */ jsx27(
|
|
1988
|
+
Checkbox,
|
|
1989
|
+
{
|
|
1990
|
+
isSelected: header.getContext().table.getIsAllRowsSelected(),
|
|
1991
|
+
isIndeterminate: header.getContext().table.getIsSomeRowsSelected() && !header.getContext().table.getIsAllRowsSelected(),
|
|
1992
|
+
onChange: () => header.getContext().table.toggleAllRowsSelected()
|
|
1993
|
+
}
|
|
1994
|
+
) : /* @__PURE__ */ jsx27("div", { className: "flex flex-col gap-1 pb-2", children: /* @__PURE__ */ jsxs14("div", { className: "flex items-center justify-between gap-1", children: [
|
|
1995
|
+
header.column.getCanSort() ? (
|
|
1996
|
+
// Sortable Header
|
|
1997
|
+
/* @__PURE__ */ jsxs14(
|
|
1998
|
+
"button",
|
|
1999
|
+
{
|
|
2000
|
+
type: "button",
|
|
2001
|
+
className: twMerge15(
|
|
2002
|
+
tableHeadCx,
|
|
2003
|
+
tableHeadToggleCx,
|
|
2004
|
+
isRight && "flex-row-reverse",
|
|
2005
|
+
isSorted && "text-foreground"
|
|
2006
|
+
),
|
|
2007
|
+
onClick: header.column.getToggleSortingHandler() ?? void 0,
|
|
2008
|
+
children: [
|
|
2009
|
+
/* @__PURE__ */ jsx27("div", { className: "min-w-0", children: /* @__PURE__ */ jsx27(TruncatedText, { children: flexRender2(header.column.columnDef.header, header.getContext()) }) }),
|
|
2010
|
+
/* @__PURE__ */ jsx27(ColumnSortButton, { header })
|
|
2011
|
+
]
|
|
2012
|
+
}
|
|
2013
|
+
)
|
|
2014
|
+
) : (
|
|
2015
|
+
// Non-Sortable Header
|
|
2016
|
+
/* @__PURE__ */ jsx27("div", { className: tableHeadCx, children: /* @__PURE__ */ jsx27("div", { className: "min-w-0", children: /* @__PURE__ */ jsx27(TruncatedText, { children: flexRender2(header.column.columnDef.header, header.getContext()) }) }) })
|
|
2017
|
+
),
|
|
2018
|
+
showFilters && header.column.getCanFilter() && columnConfig?.enableColumnFilter && /* @__PURE__ */ jsx27(
|
|
2019
|
+
ColumnFilterInput,
|
|
2020
|
+
{
|
|
2021
|
+
column: header.column,
|
|
2022
|
+
filterType: columnConfig.filterType ?? "text",
|
|
2023
|
+
filterPlaceholder: columnConfig.filterPlaceholder,
|
|
2024
|
+
filterOptions: columnConfig.filterOptions,
|
|
2025
|
+
filterRender: columnConfig.filterRender
|
|
2026
|
+
}
|
|
2027
|
+
)
|
|
2028
|
+
] }) }),
|
|
2029
|
+
!isIndexColumn && header.column.getCanResize() && /* @__PURE__ */ jsx27(ColumnResizeHandle, { header })
|
|
2030
|
+
]
|
|
2031
|
+
},
|
|
2032
|
+
header.id
|
|
2033
|
+
);
|
|
2034
|
+
}) }, headerGroup.id);
|
|
2035
|
+
}
|
|
2036
|
+
|
|
1850
2037
|
// src/components/Menu/Menu.tsx
|
|
1851
2038
|
import {
|
|
1852
2039
|
MenuTrigger,
|
|
1853
2040
|
Menu as AriaMenu,
|
|
1854
2041
|
MenuItem as AriaMenuItem,
|
|
1855
|
-
Popover as
|
|
2042
|
+
Popover as Popover3
|
|
1856
2043
|
} from "react-aria-components";
|
|
1857
|
-
import { twMerge as
|
|
2044
|
+
import { twMerge as twMerge16 } from "tailwind-merge";
|
|
1858
2045
|
|
|
1859
2046
|
// src/components/Menu/menuStyles.ts
|
|
1860
2047
|
var popoverStyles = `
|
|
@@ -1866,7 +2053,7 @@ var popoverStyles = `
|
|
|
1866
2053
|
`;
|
|
1867
2054
|
|
|
1868
2055
|
// src/components/Menu/Menu.tsx
|
|
1869
|
-
import { jsx as
|
|
2056
|
+
import { jsx as jsx28, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1870
2057
|
function Menu2({
|
|
1871
2058
|
items,
|
|
1872
2059
|
content,
|
|
@@ -1879,9 +2066,9 @@ function Menu2({
|
|
|
1879
2066
|
className
|
|
1880
2067
|
}) {
|
|
1881
2068
|
const selectionProps = selectionMode && selectionMode !== "none" ? { selectionMode, selectedKeys, defaultSelectedKeys, onSelectionChange } : {};
|
|
1882
|
-
return /* @__PURE__ */
|
|
2069
|
+
return /* @__PURE__ */ jsxs15(MenuTrigger, { children: [
|
|
1883
2070
|
children,
|
|
1884
|
-
/* @__PURE__ */
|
|
2071
|
+
/* @__PURE__ */ jsx28(Popover3, { className: twMerge16(popoverStyles, className), children: items ? /* @__PURE__ */ jsx28(
|
|
1885
2072
|
AriaMenu,
|
|
1886
2073
|
{
|
|
1887
2074
|
items,
|
|
@@ -1892,7 +2079,7 @@ function Menu2({
|
|
|
1892
2079
|
},
|
|
1893
2080
|
...selectionProps,
|
|
1894
2081
|
className: "outline-none",
|
|
1895
|
-
children: (item) => /* @__PURE__ */
|
|
2082
|
+
children: (item) => /* @__PURE__ */ jsxs15(
|
|
1896
2083
|
AriaMenuItem,
|
|
1897
2084
|
{
|
|
1898
2085
|
id: item.id,
|
|
@@ -1908,14 +2095,14 @@ function Menu2({
|
|
|
1908
2095
|
item.isDanger ? "text-destructive" : "text-foreground"
|
|
1909
2096
|
].filter(Boolean).join(" "),
|
|
1910
2097
|
children: [
|
|
1911
|
-
item.icon && /* @__PURE__ */
|
|
1912
|
-
/* @__PURE__ */
|
|
1913
|
-
item.endContent && /* @__PURE__ */
|
|
2098
|
+
item.icon && /* @__PURE__ */ jsx28(Icon, { icon: item.icon, size: "sm" }),
|
|
2099
|
+
/* @__PURE__ */ jsx28("span", { className: "flex-1", children: item.label }),
|
|
2100
|
+
item.endContent && /* @__PURE__ */ jsx28("span", { className: "ml-auto flex items-center", children: item.endContent })
|
|
1914
2101
|
]
|
|
1915
2102
|
}
|
|
1916
2103
|
)
|
|
1917
2104
|
}
|
|
1918
|
-
) : /* @__PURE__ */
|
|
2105
|
+
) : /* @__PURE__ */ jsx28(
|
|
1919
2106
|
AriaMenu,
|
|
1920
2107
|
{
|
|
1921
2108
|
onAction: (key) => onAction?.(key),
|
|
@@ -1933,15 +2120,15 @@ import {
|
|
|
1933
2120
|
useEffect as useEffect2,
|
|
1934
2121
|
useId as useId2,
|
|
1935
2122
|
useRef as useRef4,
|
|
1936
|
-
useState as
|
|
2123
|
+
useState as useState7
|
|
1937
2124
|
} from "react";
|
|
1938
2125
|
import {
|
|
1939
2126
|
Menu as AriaMenu2,
|
|
1940
2127
|
MenuTrigger as MenuTrigger2,
|
|
1941
|
-
Popover as
|
|
2128
|
+
Popover as Popover4
|
|
1942
2129
|
} from "react-aria-components";
|
|
1943
|
-
import { twMerge as
|
|
1944
|
-
import { jsx as
|
|
2130
|
+
import { twMerge as twMerge17 } from "tailwind-merge";
|
|
2131
|
+
import { jsx as jsx29, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1945
2132
|
function useContextMenu({
|
|
1946
2133
|
content,
|
|
1947
2134
|
label,
|
|
@@ -1949,7 +2136,7 @@ function useContextMenu({
|
|
|
1949
2136
|
className
|
|
1950
2137
|
}) {
|
|
1951
2138
|
const popoverId = useId2();
|
|
1952
|
-
const [anchor, setAnchor] =
|
|
2139
|
+
const [anchor, setAnchor] = useState7(null);
|
|
1953
2140
|
const anchorRef = useRef4(null);
|
|
1954
2141
|
const popoverRef = useRef4(null);
|
|
1955
2142
|
const isOpen = anchor !== null;
|
|
@@ -1985,7 +2172,7 @@ function useContextMenu({
|
|
|
1985
2172
|
document.removeEventListener("keydown", onKeyDown, true);
|
|
1986
2173
|
};
|
|
1987
2174
|
}, [isOpen, close]);
|
|
1988
|
-
const menu = /* @__PURE__ */
|
|
2175
|
+
const menu = /* @__PURE__ */ jsxs16(
|
|
1989
2176
|
MenuTrigger2,
|
|
1990
2177
|
{
|
|
1991
2178
|
isOpen,
|
|
@@ -1993,7 +2180,7 @@ function useContextMenu({
|
|
|
1993
2180
|
if (!open) close();
|
|
1994
2181
|
},
|
|
1995
2182
|
children: [
|
|
1996
|
-
/* @__PURE__ */
|
|
2183
|
+
/* @__PURE__ */ jsx29(
|
|
1997
2184
|
"span",
|
|
1998
2185
|
{
|
|
1999
2186
|
ref: anchorRef,
|
|
@@ -2003,15 +2190,15 @@ function useContextMenu({
|
|
|
2003
2190
|
style: { left: anchor?.x ?? 0, top: anchor?.y ?? 0 }
|
|
2004
2191
|
}
|
|
2005
2192
|
),
|
|
2006
|
-
/* @__PURE__ */
|
|
2007
|
-
|
|
2193
|
+
/* @__PURE__ */ jsx29(
|
|
2194
|
+
Popover4,
|
|
2008
2195
|
{
|
|
2009
2196
|
isNonModal: true,
|
|
2010
2197
|
triggerRef: anchorRef,
|
|
2011
2198
|
placement: "bottom start",
|
|
2012
2199
|
ref: popoverRef,
|
|
2013
|
-
className:
|
|
2014
|
-
children: /* @__PURE__ */
|
|
2200
|
+
className: twMerge17(popoverStyles, className),
|
|
2201
|
+
children: /* @__PURE__ */ jsx29(
|
|
2015
2202
|
AriaMenu2,
|
|
2016
2203
|
{
|
|
2017
2204
|
id: popoverId,
|
|
@@ -2049,7 +2236,7 @@ function useContextMenu({
|
|
|
2049
2236
|
|
|
2050
2237
|
// src/components/Menu/MenuItem.tsx
|
|
2051
2238
|
import { MenuItem as AriaMenuItem2 } from "react-aria-components";
|
|
2052
|
-
import { jsx as
|
|
2239
|
+
import { jsx as jsx30, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2053
2240
|
function MenuItem({
|
|
2054
2241
|
id,
|
|
2055
2242
|
children,
|
|
@@ -2063,7 +2250,7 @@ function MenuItem({
|
|
|
2063
2250
|
textValue,
|
|
2064
2251
|
className
|
|
2065
2252
|
}) {
|
|
2066
|
-
return /* @__PURE__ */
|
|
2253
|
+
return /* @__PURE__ */ jsxs17(
|
|
2067
2254
|
AriaMenuItem2,
|
|
2068
2255
|
{
|
|
2069
2256
|
id,
|
|
@@ -2082,9 +2269,9 @@ function MenuItem({
|
|
|
2082
2269
|
className
|
|
2083
2270
|
].filter(Boolean).join(" "),
|
|
2084
2271
|
children: [
|
|
2085
|
-
icon && /* @__PURE__ */
|
|
2086
|
-
/* @__PURE__ */
|
|
2087
|
-
endContent && /* @__PURE__ */
|
|
2272
|
+
icon && /* @__PURE__ */ jsx30(Icon, { icon, size: "sm" }),
|
|
2273
|
+
/* @__PURE__ */ jsx30("span", { className: "flex-1", children }),
|
|
2274
|
+
endContent && /* @__PURE__ */ jsx30("span", { className: "ml-auto flex items-center", children: endContent })
|
|
2088
2275
|
]
|
|
2089
2276
|
}
|
|
2090
2277
|
);
|
|
@@ -2093,7 +2280,7 @@ function MenuItem({
|
|
|
2093
2280
|
// src/components/Menu/MenuCheckboxItem.tsx
|
|
2094
2281
|
import { MenuItem as AriaMenuItem3 } from "react-aria-components";
|
|
2095
2282
|
import { Check as Check4 } from "lucide-react";
|
|
2096
|
-
import { Fragment as Fragment3, jsx as
|
|
2283
|
+
import { Fragment as Fragment3, jsx as jsx31, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2097
2284
|
function MenuCheckboxItem({
|
|
2098
2285
|
id,
|
|
2099
2286
|
children,
|
|
@@ -2101,7 +2288,7 @@ function MenuCheckboxItem({
|
|
|
2101
2288
|
isDisabled,
|
|
2102
2289
|
className
|
|
2103
2290
|
}) {
|
|
2104
|
-
return /* @__PURE__ */
|
|
2291
|
+
return /* @__PURE__ */ jsx31(
|
|
2105
2292
|
AriaMenuItem3,
|
|
2106
2293
|
{
|
|
2107
2294
|
id,
|
|
@@ -2117,9 +2304,9 @@ function MenuCheckboxItem({
|
|
|
2117
2304
|
isSelected ? "font-medium" : "",
|
|
2118
2305
|
className
|
|
2119
2306
|
].filter(Boolean).join(" "),
|
|
2120
|
-
children: ({ isSelected }) => /* @__PURE__ */
|
|
2121
|
-
/* @__PURE__ */
|
|
2122
|
-
/* @__PURE__ */
|
|
2307
|
+
children: ({ isSelected }) => /* @__PURE__ */ jsxs18(Fragment3, { children: [
|
|
2308
|
+
/* @__PURE__ */ jsx31("span", { className: "flex items-center justify-center w-4 h-4 shrink-0", children: isSelected && /* @__PURE__ */ jsx31(Check4, { size: 14, className: "text-primary", "aria-hidden": "true" }) }),
|
|
2309
|
+
/* @__PURE__ */ jsx31("span", { className: "flex-1", children })
|
|
2123
2310
|
] })
|
|
2124
2311
|
}
|
|
2125
2312
|
);
|
|
@@ -2130,15 +2317,15 @@ import {
|
|
|
2130
2317
|
MenuSection as AriaMenuSection,
|
|
2131
2318
|
Header
|
|
2132
2319
|
} from "react-aria-components";
|
|
2133
|
-
import { jsx as
|
|
2320
|
+
import { jsx as jsx32, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2134
2321
|
function MenuSection({
|
|
2135
2322
|
header,
|
|
2136
2323
|
children,
|
|
2137
2324
|
"aria-label": ariaLabel,
|
|
2138
2325
|
className
|
|
2139
2326
|
}) {
|
|
2140
|
-
return /* @__PURE__ */
|
|
2141
|
-
header && /* @__PURE__ */
|
|
2327
|
+
return /* @__PURE__ */ jsxs19(AriaMenuSection, { className, "aria-label": ariaLabel, children: [
|
|
2328
|
+
header && /* @__PURE__ */ jsx32(
|
|
2142
2329
|
Header,
|
|
2143
2330
|
{
|
|
2144
2331
|
className: [
|
|
@@ -2157,16 +2344,16 @@ function MenuSection({
|
|
|
2157
2344
|
|
|
2158
2345
|
// src/components/Menu/MenuHeader.tsx
|
|
2159
2346
|
import { Header as Header2 } from "react-aria-components";
|
|
2160
|
-
import { jsx as
|
|
2347
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
2161
2348
|
function MenuHeader({ children, className }) {
|
|
2162
|
-
return /* @__PURE__ */
|
|
2349
|
+
return /* @__PURE__ */ jsx33(Header2, { className, children });
|
|
2163
2350
|
}
|
|
2164
2351
|
|
|
2165
2352
|
// src/components/Menu/MenuSeparator.tsx
|
|
2166
2353
|
import { Separator } from "react-aria-components";
|
|
2167
|
-
import { jsx as
|
|
2354
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
2168
2355
|
function MenuSeparator({ className }) {
|
|
2169
|
-
return /* @__PURE__ */
|
|
2356
|
+
return /* @__PURE__ */ jsx34(
|
|
2170
2357
|
Separator,
|
|
2171
2358
|
{
|
|
2172
2359
|
className: [
|
|
@@ -2178,7 +2365,7 @@ function MenuSeparator({ className }) {
|
|
|
2178
2365
|
}
|
|
2179
2366
|
|
|
2180
2367
|
// src/components/Table/TableMenu.tsx
|
|
2181
|
-
import { Fragment as Fragment4, jsx as
|
|
2368
|
+
import { Fragment as Fragment4, jsx as jsx35, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2182
2369
|
function TableMenu({
|
|
2183
2370
|
toggleableColumns,
|
|
2184
2371
|
columnVisibility,
|
|
@@ -2199,148 +2386,22 @@ function TableMenu({
|
|
|
2199
2386
|
}
|
|
2200
2387
|
}
|
|
2201
2388
|
}
|
|
2202
|
-
return /* @__PURE__ */
|
|
2389
|
+
return /* @__PURE__ */ jsx35(
|
|
2203
2390
|
Menu2,
|
|
2204
2391
|
{
|
|
2205
2392
|
selectionMode: "multiple",
|
|
2206
2393
|
selectedKeys,
|
|
2207
2394
|
onSelectionChange: handleSelectionChange,
|
|
2208
|
-
content: /* @__PURE__ */
|
|
2209
|
-
toggleableColumns.map((col) => /* @__PURE__ */
|
|
2210
|
-
/* @__PURE__ */
|
|
2211
|
-
/* @__PURE__ */
|
|
2395
|
+
content: /* @__PURE__ */ jsxs20(Fragment4, { children: [
|
|
2396
|
+
toggleableColumns.map((col) => /* @__PURE__ */ jsx35(MenuCheckboxItem, { id: col.id, children: col.header }, col.id)),
|
|
2397
|
+
/* @__PURE__ */ jsx35(MenuSeparator, {}),
|
|
2398
|
+
/* @__PURE__ */ jsx35(MenuItem, { id: "reset-all", onAction: () => store.getState().reset(), children: "Reset all" })
|
|
2212
2399
|
] }),
|
|
2213
|
-
children: /* @__PURE__ */
|
|
2400
|
+
children: /* @__PURE__ */ jsx35(IconButton, { icon: "Columns3", variant: "ghost", size: "sm", label: "Column settings" })
|
|
2214
2401
|
}
|
|
2215
2402
|
);
|
|
2216
2403
|
}
|
|
2217
2404
|
|
|
2218
|
-
// src/components/Table/TableHeaderRow.tsx
|
|
2219
|
-
import { jsx as jsx34, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2220
|
-
function TableHeaderRow({
|
|
2221
|
-
headerGroup,
|
|
2222
|
-
columns,
|
|
2223
|
-
tableId,
|
|
2224
|
-
toggleableColumns,
|
|
2225
|
-
columnVisibility,
|
|
2226
|
-
toggleColumn,
|
|
2227
|
-
enableRowSelection,
|
|
2228
|
-
hasFilters,
|
|
2229
|
-
onClearAllFilters,
|
|
2230
|
-
showFilters
|
|
2231
|
-
}) {
|
|
2232
|
-
return /* @__PURE__ */ jsx34("tr", { className: "w-full block", children: headerGroup.headers.map((header) => {
|
|
2233
|
-
const columnConfig = columns.find((col) => col.id === header.id);
|
|
2234
|
-
const isIndexColumn = header.id === "index";
|
|
2235
|
-
const isSorted = header.column.getIsSorted();
|
|
2236
|
-
const baseClass = "relative pl-4 pr-4 group/header text-sm align-top";
|
|
2237
|
-
const indexClass = "text-right tabular-nums text-center p-1 px-2";
|
|
2238
|
-
const alignClasses2 = {
|
|
2239
|
-
left: "text-left",
|
|
2240
|
-
right: "text-right",
|
|
2241
|
-
center: "text-center"
|
|
2242
|
-
};
|
|
2243
|
-
const alignClass = alignClasses2[columnConfig?.align ?? "left"];
|
|
2244
|
-
const cxTh = twMerge16(baseClass, isIndexColumn ? indexClass : alignClass);
|
|
2245
|
-
const style = {
|
|
2246
|
-
width: header.getSize(),
|
|
2247
|
-
minWidth: header.getSize(),
|
|
2248
|
-
maxWidth: header.getSize()
|
|
2249
|
-
};
|
|
2250
|
-
const isRight = columnConfig?.align === "right";
|
|
2251
|
-
const tableHeadCx = `
|
|
2252
|
-
flex items-center justify-between gap-1 h-8 text-left
|
|
2253
|
-
text-sm font-medium text-foreground
|
|
2254
|
-
`;
|
|
2255
|
-
const tableHeadToggleCx = `
|
|
2256
|
-
cursor-pointer
|
|
2257
|
-
hover:text-muted-foreground
|
|
2258
|
-
focus-visible:outline-none
|
|
2259
|
-
focus-visible:ring-2
|
|
2260
|
-
focus-visible:ring-ring
|
|
2261
|
-
focus-visible:ring-offset-1
|
|
2262
|
-
rounded-sm
|
|
2263
|
-
`;
|
|
2264
|
-
return /* @__PURE__ */ jsxs20(
|
|
2265
|
-
"th",
|
|
2266
|
-
{
|
|
2267
|
-
className: cxTh,
|
|
2268
|
-
style,
|
|
2269
|
-
"aria-sort": isSorted === "asc" ? "ascending" : isSorted === "desc" ? "descending" : void 0,
|
|
2270
|
-
children: [
|
|
2271
|
-
isIndexColumn ? /* @__PURE__ */ jsxs20("div", { className: "flex flex-col gap-2", children: [
|
|
2272
|
-
/* @__PURE__ */ jsxs20("div", { className: "flex items-center gap-1", children: [
|
|
2273
|
-
enableRowSelection && /* @__PURE__ */ jsx34(
|
|
2274
|
-
Checkbox,
|
|
2275
|
-
{
|
|
2276
|
-
isSelected: header.getContext().table.getIsAllRowsSelected(),
|
|
2277
|
-
isIndeterminate: header.getContext().table.getIsSomeRowsSelected() && !header.getContext().table.getIsAllRowsSelected(),
|
|
2278
|
-
onChange: () => header.getContext().table.toggleAllRowsSelected()
|
|
2279
|
-
}
|
|
2280
|
-
),
|
|
2281
|
-
/* @__PURE__ */ jsx34(
|
|
2282
|
-
TableMenu,
|
|
2283
|
-
{
|
|
2284
|
-
toggleableColumns,
|
|
2285
|
-
columnVisibility,
|
|
2286
|
-
toggleColumn,
|
|
2287
|
-
tableId
|
|
2288
|
-
}
|
|
2289
|
-
)
|
|
2290
|
-
] }),
|
|
2291
|
-
hasFilters && /* @__PURE__ */ jsx34(
|
|
2292
|
-
IconButton,
|
|
2293
|
-
{
|
|
2294
|
-
icon: "FilterX",
|
|
2295
|
-
size: "sm",
|
|
2296
|
-
variant: "secondary",
|
|
2297
|
-
onPress: onClearAllFilters,
|
|
2298
|
-
label: "Clear all filters"
|
|
2299
|
-
}
|
|
2300
|
-
)
|
|
2301
|
-
] }) : /* @__PURE__ */ jsxs20("div", { className: "flex flex-col gap-2 pb-2", children: [
|
|
2302
|
-
header.column.getCanSort() ? (
|
|
2303
|
-
// Sortable Header
|
|
2304
|
-
/* @__PURE__ */ jsxs20(
|
|
2305
|
-
"button",
|
|
2306
|
-
{
|
|
2307
|
-
type: "button",
|
|
2308
|
-
className: twMerge16(
|
|
2309
|
-
tableHeadCx,
|
|
2310
|
-
tableHeadToggleCx,
|
|
2311
|
-
isRight && "flex-row-reverse",
|
|
2312
|
-
isSorted && "text-foreground"
|
|
2313
|
-
),
|
|
2314
|
-
onClick: header.column.getToggleSortingHandler() ?? void 0,
|
|
2315
|
-
children: [
|
|
2316
|
-
/* @__PURE__ */ jsx34("div", { className: "min-w-0", children: /* @__PURE__ */ jsx34(TruncatedText, { children: flexRender2(header.column.columnDef.header, header.getContext()) }) }),
|
|
2317
|
-
/* @__PURE__ */ jsx34(ColumnSortButton, { header })
|
|
2318
|
-
]
|
|
2319
|
-
}
|
|
2320
|
-
)
|
|
2321
|
-
) : (
|
|
2322
|
-
// Non-Sortable Header
|
|
2323
|
-
/* @__PURE__ */ jsx34("div", { className: tableHeadCx, children: /* @__PURE__ */ jsx34("div", { className: "min-w-0", children: /* @__PURE__ */ jsx34(TruncatedText, { children: flexRender2(header.column.columnDef.header, header.getContext()) }) }) })
|
|
2324
|
-
),
|
|
2325
|
-
showFilters && header.column.getCanFilter() && columnConfig?.enableColumnFilter && /* @__PURE__ */ jsx34(
|
|
2326
|
-
ColumnFilterInput,
|
|
2327
|
-
{
|
|
2328
|
-
column: header.column,
|
|
2329
|
-
filterType: columnConfig.filterType ?? "text",
|
|
2330
|
-
filterPlaceholder: columnConfig.filterPlaceholder,
|
|
2331
|
-
filterOptions: columnConfig.filterOptions,
|
|
2332
|
-
filterRender: columnConfig.filterRender
|
|
2333
|
-
}
|
|
2334
|
-
)
|
|
2335
|
-
] }),
|
|
2336
|
-
!isIndexColumn && header.column.getCanResize() && /* @__PURE__ */ jsx34(ColumnResizeHandle, { header })
|
|
2337
|
-
]
|
|
2338
|
-
},
|
|
2339
|
-
header.id
|
|
2340
|
-
);
|
|
2341
|
-
}) }, headerGroup.id);
|
|
2342
|
-
}
|
|
2343
|
-
|
|
2344
2405
|
// src/components/Table/useColumnVisibility.ts
|
|
2345
2406
|
import { useCallback as useCallback5, useMemo as useMemo2 } from "react";
|
|
2346
2407
|
import { useStore as useStore2 } from "zustand";
|
|
@@ -2450,7 +2511,7 @@ function useTableSorting(tableId, defaultSorting = []) {
|
|
|
2450
2511
|
}
|
|
2451
2512
|
|
|
2452
2513
|
// src/components/Table/Table.tsx
|
|
2453
|
-
import { Fragment as Fragment5, jsx as
|
|
2514
|
+
import { Fragment as Fragment5, jsx as jsx36, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2454
2515
|
function booleanSortingFn(rowA, rowB, columnId) {
|
|
2455
2516
|
const a = rowA.getValue(columnId) ? 1 : 0;
|
|
2456
2517
|
const b = rowB.getValue(columnId) ? 1 : 0;
|
|
@@ -2467,7 +2528,8 @@ function Table2({
|
|
|
2467
2528
|
onRowSelectionChange,
|
|
2468
2529
|
getRowId,
|
|
2469
2530
|
showFilters = true,
|
|
2470
|
-
defaultSorting
|
|
2531
|
+
defaultSorting,
|
|
2532
|
+
showIndex = true
|
|
2471
2533
|
}) {
|
|
2472
2534
|
const { columnSizing, setColumnSizing } = useColumnWidths(columns, tableId);
|
|
2473
2535
|
const anchorColumnId = columns.find((c) => c.anchor)?.id ?? columns[0]?.id;
|
|
@@ -2510,8 +2572,8 @@ function Table2({
|
|
|
2510
2572
|
maxSize: colConfig.maxSize ?? Number.MAX_SAFE_INTEGER
|
|
2511
2573
|
};
|
|
2512
2574
|
});
|
|
2513
|
-
return [indexColumn, ...dataColumns];
|
|
2514
|
-
}, [columns, cellRenderers, indexColumnSize]);
|
|
2575
|
+
return showIndex ? [indexColumn, ...dataColumns] : dataColumns;
|
|
2576
|
+
}, [columns, cellRenderers, indexColumnSize, showIndex]);
|
|
2515
2577
|
const table = useReactTable({
|
|
2516
2578
|
data,
|
|
2517
2579
|
columns: columnDefs,
|
|
@@ -2565,40 +2627,58 @@ function Table2({
|
|
|
2565
2627
|
const filteredCount = table.getRowModel().rows.length;
|
|
2566
2628
|
const totalCount = data.length;
|
|
2567
2629
|
const isFiltered = filteredCount !== totalCount;
|
|
2630
|
+
const firstVisibleColumnId = table.getVisibleLeafColumns().find((c) => c.id !== "index")?.id;
|
|
2568
2631
|
return /* @__PURE__ */ jsxs21(Fragment5, { children: [
|
|
2569
|
-
/* @__PURE__ */
|
|
2570
|
-
/* @__PURE__ */
|
|
2632
|
+
/* @__PURE__ */ jsx36("div", { className: "sr-only", "aria-live": "polite", "aria-atomic": "true", children: isFiltered ? `Showing ${filteredCount} of ${totalCount} rows` : "" }),
|
|
2633
|
+
(toggleableColumns.length > 0 || columnFilters.length > 0) && /* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-end gap-1 pb-1", children: [
|
|
2634
|
+
columnFilters.length > 0 && /* @__PURE__ */ jsx36(
|
|
2635
|
+
IconButton,
|
|
2636
|
+
{
|
|
2637
|
+
icon: "FilterX",
|
|
2638
|
+
size: "sm",
|
|
2639
|
+
variant: "ghost",
|
|
2640
|
+
onPress: resetFilters,
|
|
2641
|
+
label: "Clear all filters"
|
|
2642
|
+
}
|
|
2643
|
+
),
|
|
2644
|
+
toggleableColumns.length > 0 && /* @__PURE__ */ jsx36(
|
|
2645
|
+
TableMenu,
|
|
2646
|
+
{
|
|
2647
|
+
toggleableColumns,
|
|
2648
|
+
columnVisibility,
|
|
2649
|
+
toggleColumn,
|
|
2650
|
+
tableId
|
|
2651
|
+
}
|
|
2652
|
+
)
|
|
2653
|
+
] }),
|
|
2654
|
+
/* @__PURE__ */ jsx36(
|
|
2571
2655
|
"div",
|
|
2572
2656
|
{
|
|
2573
2657
|
ref: headerRef,
|
|
2574
|
-
className: "sticky top-0 z-10 bg-white border-b border-border overflow-x-auto",
|
|
2658
|
+
className: "sticky top-0 z-10 bg-white border-b border-border pb-1.5 overflow-x-auto",
|
|
2575
2659
|
style: { scrollbarWidth: "none" },
|
|
2576
2660
|
onScroll: handleHeaderScroll,
|
|
2577
|
-
children: /* @__PURE__ */
|
|
2661
|
+
children: /* @__PURE__ */ jsx36("table", { className: "min-w-full", "aria-label": ariaLabel, children: /* @__PURE__ */ jsx36("thead", { className: "w-full", children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx36(
|
|
2578
2662
|
TableHeaderRow,
|
|
2579
2663
|
{
|
|
2580
2664
|
headerGroup,
|
|
2581
2665
|
columns,
|
|
2582
|
-
tableId,
|
|
2583
|
-
toggleableColumns,
|
|
2584
|
-
columnVisibility,
|
|
2585
|
-
toggleColumn,
|
|
2586
2666
|
enableRowSelection: !!enableRowSelection,
|
|
2587
|
-
hasFilters: columnFilters.length > 0,
|
|
2588
|
-
onClearAllFilters: resetFilters,
|
|
2589
2667
|
showFilters
|
|
2590
2668
|
},
|
|
2591
2669
|
headerGroup.id
|
|
2592
2670
|
)) }) })
|
|
2593
2671
|
}
|
|
2594
2672
|
),
|
|
2595
|
-
/* @__PURE__ */
|
|
2673
|
+
/* @__PURE__ */ jsx36("div", { ref: bodyRef, className: "overflow-x-auto", onScroll: handleBodyScroll, children: /* @__PURE__ */ jsx36("table", { className: "min-w-full", "aria-hidden": "true", children: /* @__PURE__ */ jsx36("tbody", { children: data.length === 0 ? /* @__PURE__ */ jsx36("tr", { children: /* @__PURE__ */ jsx36("td", { colSpan: columns.length + (showIndex ? 1 : 0), children: /* @__PURE__ */ jsx36(EmptyState, { icon: "Inbox", title: "No results" }) }) }) : table.getRowModel().rows.length === 0 ? /* @__PURE__ */ jsx36("tr", { children: /* @__PURE__ */ jsx36("td", { colSpan: columns.length + (showIndex ? 1 : 0), children: /* @__PURE__ */ jsx36(NoFilterResults, { tableId }) }) }) : table.getRowModel().rows.map((row, index) => /* @__PURE__ */ jsx36(
|
|
2596
2674
|
TableBodyRow,
|
|
2597
2675
|
{
|
|
2598
2676
|
row,
|
|
2599
2677
|
rowIndex: index,
|
|
2600
2678
|
columns,
|
|
2601
|
-
enableRowSelection: !!enableRowSelection
|
|
2679
|
+
enableRowSelection: !!enableRowSelection,
|
|
2680
|
+
showIndex,
|
|
2681
|
+
anchorDataColumnId: firstVisibleColumnId
|
|
2602
2682
|
},
|
|
2603
2683
|
row.id
|
|
2604
2684
|
)) }) }) })
|
|
@@ -2606,14 +2686,14 @@ function Table2({
|
|
|
2606
2686
|
}
|
|
2607
2687
|
|
|
2608
2688
|
// src/components/Table/SelectionFooter.tsx
|
|
2609
|
-
import { jsx as
|
|
2689
|
+
import { jsx as jsx37, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2610
2690
|
function SelectionFooter({
|
|
2611
2691
|
selectedCount,
|
|
2612
2692
|
totalCount,
|
|
2613
2693
|
onReset,
|
|
2614
2694
|
children
|
|
2615
2695
|
}) {
|
|
2616
|
-
return /* @__PURE__ */
|
|
2696
|
+
return /* @__PURE__ */ jsx37(
|
|
2617
2697
|
"div",
|
|
2618
2698
|
{
|
|
2619
2699
|
role: "toolbar",
|
|
@@ -2622,15 +2702,15 @@ function SelectionFooter({
|
|
|
2622
2702
|
children: /* @__PURE__ */ jsxs22("div", { className: "container mx-auto flex items-center justify-between", children: [
|
|
2623
2703
|
/* @__PURE__ */ jsxs22("div", { className: "flex items-center gap-3", children: [
|
|
2624
2704
|
/* @__PURE__ */ jsxs22("span", { className: "text-sm text-muted-foreground", children: [
|
|
2625
|
-
/* @__PURE__ */
|
|
2705
|
+
/* @__PURE__ */ jsx37("span", { className: "font-medium text-foreground", children: selectedCount }),
|
|
2626
2706
|
" of ",
|
|
2627
2707
|
totalCount,
|
|
2628
2708
|
" ",
|
|
2629
2709
|
"selected"
|
|
2630
2710
|
] }),
|
|
2631
|
-
/* @__PURE__ */
|
|
2711
|
+
/* @__PURE__ */ jsx37(Button, { variant: "secondary", size: "sm", onPress: onReset, children: "Clear selection" })
|
|
2632
2712
|
] }),
|
|
2633
|
-
children && /* @__PURE__ */
|
|
2713
|
+
children && /* @__PURE__ */ jsx37("div", { className: "flex items-center gap-2", children })
|
|
2634
2714
|
] })
|
|
2635
2715
|
}
|
|
2636
2716
|
);
|
|
@@ -2644,7 +2724,7 @@ import {
|
|
|
2644
2724
|
Heading as Heading3
|
|
2645
2725
|
} from "react-aria-components";
|
|
2646
2726
|
import { X as X2 } from "lucide-react";
|
|
2647
|
-
import { Fragment as Fragment6, jsx as
|
|
2727
|
+
import { Fragment as Fragment6, jsx as jsx38, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2648
2728
|
var sizeStyles4 = {
|
|
2649
2729
|
sm: "max-w-md",
|
|
2650
2730
|
md: "max-w-lg",
|
|
@@ -2660,7 +2740,7 @@ function Dialog({
|
|
|
2660
2740
|
children,
|
|
2661
2741
|
className
|
|
2662
2742
|
}) {
|
|
2663
|
-
return /* @__PURE__ */
|
|
2743
|
+
return /* @__PURE__ */ jsx38(
|
|
2664
2744
|
ModalOverlay,
|
|
2665
2745
|
{
|
|
2666
2746
|
isOpen,
|
|
@@ -2672,7 +2752,7 @@ function Dialog({
|
|
|
2672
2752
|
"entering:animate-in entering:fade-in",
|
|
2673
2753
|
"exiting:animate-out exiting:fade-out"
|
|
2674
2754
|
].join(" "),
|
|
2675
|
-
children: /* @__PURE__ */
|
|
2755
|
+
children: /* @__PURE__ */ jsx38(
|
|
2676
2756
|
Modal,
|
|
2677
2757
|
{
|
|
2678
2758
|
className: [
|
|
@@ -2683,9 +2763,9 @@ function Dialog({
|
|
|
2683
2763
|
"exiting:animate-out exiting:zoom-out-95 exiting:fade-out",
|
|
2684
2764
|
className
|
|
2685
2765
|
].filter(Boolean).join(" "),
|
|
2686
|
-
children: /* @__PURE__ */
|
|
2766
|
+
children: /* @__PURE__ */ jsx38(AriaDialog, { className: "outline-none flex flex-col max-h-[85vh]", children: ({ close }) => /* @__PURE__ */ jsxs23(Fragment6, { children: [
|
|
2687
2767
|
/* @__PURE__ */ jsxs23("div", { className: "flex items-center justify-between px-6 py-4 border-b border-border", children: [
|
|
2688
|
-
/* @__PURE__ */
|
|
2768
|
+
/* @__PURE__ */ jsx38(
|
|
2689
2769
|
Heading3,
|
|
2690
2770
|
{
|
|
2691
2771
|
slot: "title",
|
|
@@ -2693,7 +2773,7 @@ function Dialog({
|
|
|
2693
2773
|
children: title
|
|
2694
2774
|
}
|
|
2695
2775
|
),
|
|
2696
|
-
/* @__PURE__ */
|
|
2776
|
+
/* @__PURE__ */ jsx38(
|
|
2697
2777
|
"button",
|
|
2698
2778
|
{
|
|
2699
2779
|
type: "button",
|
|
@@ -2705,11 +2785,11 @@ function Dialog({
|
|
|
2705
2785
|
"transition-colors"
|
|
2706
2786
|
].join(" "),
|
|
2707
2787
|
"aria-label": "Close",
|
|
2708
|
-
children: /* @__PURE__ */
|
|
2788
|
+
children: /* @__PURE__ */ jsx38(X2, { size: 20, "aria-hidden": "true" })
|
|
2709
2789
|
}
|
|
2710
2790
|
)
|
|
2711
2791
|
] }),
|
|
2712
|
-
/* @__PURE__ */
|
|
2792
|
+
/* @__PURE__ */ jsx38("div", { className: "px-6 py-4 overflow-y-auto", children })
|
|
2713
2793
|
] }) })
|
|
2714
2794
|
}
|
|
2715
2795
|
)
|
|
@@ -2718,7 +2798,7 @@ function Dialog({
|
|
|
2718
2798
|
}
|
|
2719
2799
|
|
|
2720
2800
|
// src/components/Dialog/DialogFooter.tsx
|
|
2721
|
-
import { jsx as
|
|
2801
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
2722
2802
|
|
|
2723
2803
|
// src/components/Toast/Toast.tsx
|
|
2724
2804
|
import {
|
|
@@ -2727,11 +2807,11 @@ import {
|
|
|
2727
2807
|
useContext,
|
|
2728
2808
|
useEffect as useEffect3,
|
|
2729
2809
|
useRef as useRef6,
|
|
2730
|
-
useState as
|
|
2810
|
+
useState as useState8
|
|
2731
2811
|
} from "react";
|
|
2732
2812
|
import { createPortal as createPortal2 } from "react-dom";
|
|
2733
2813
|
import { CheckCircle as CheckCircle3, XCircle as XCircle2, Info as Info2, X as X3 } from "lucide-react";
|
|
2734
|
-
import { jsx as
|
|
2814
|
+
import { jsx as jsx40, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2735
2815
|
var ToastContext = createContext(null);
|
|
2736
2816
|
var toastCounter = 0;
|
|
2737
2817
|
var defaultDuration = {
|
|
@@ -2773,7 +2853,7 @@ function ToastItem({
|
|
|
2773
2853
|
toast,
|
|
2774
2854
|
onRemove
|
|
2775
2855
|
}) {
|
|
2776
|
-
const [isExiting, setIsExiting] =
|
|
2856
|
+
const [isExiting, setIsExiting] = useState8(false);
|
|
2777
2857
|
const timerRef = useRef6(null);
|
|
2778
2858
|
const placement = useContext(PlacementContext);
|
|
2779
2859
|
const config = variantConfig[toast.variant];
|
|
@@ -2802,16 +2882,16 @@ function ToastItem({
|
|
|
2802
2882
|
config.containerClass
|
|
2803
2883
|
].join(" "),
|
|
2804
2884
|
children: [
|
|
2805
|
-
/* @__PURE__ */
|
|
2806
|
-
/* @__PURE__ */
|
|
2807
|
-
/* @__PURE__ */
|
|
2885
|
+
/* @__PURE__ */ jsx40(IconComponent, { size: 20, className: ["shrink-0 mt-0.5", config.iconClass].join(" "), "aria-hidden": "true" }),
|
|
2886
|
+
/* @__PURE__ */ jsx40("p", { className: "flex-1 text-sm font-medium", children: toast.message }),
|
|
2887
|
+
/* @__PURE__ */ jsx40(
|
|
2808
2888
|
"button",
|
|
2809
2889
|
{
|
|
2810
2890
|
type: "button",
|
|
2811
2891
|
onClick: dismiss,
|
|
2812
2892
|
className: "shrink-0 rounded-sm p-0.5 opacity-70 hover:opacity-100 transition-opacity outline-none focus-visible:ring-2 focus-visible:ring-current",
|
|
2813
2893
|
"aria-label": "Dismiss",
|
|
2814
|
-
children: /* @__PURE__ */
|
|
2894
|
+
children: /* @__PURE__ */ jsx40(X3, { size: 16, "aria-hidden": "true" })
|
|
2815
2895
|
}
|
|
2816
2896
|
)
|
|
2817
2897
|
]
|
|
@@ -2831,7 +2911,7 @@ function ToastContainer({
|
|
|
2831
2911
|
}) {
|
|
2832
2912
|
if (toasts.length === 0) return null;
|
|
2833
2913
|
return createPortal2(
|
|
2834
|
-
/* @__PURE__ */
|
|
2914
|
+
/* @__PURE__ */ jsx40(PlacementContext.Provider, { value: placement, children: /* @__PURE__ */ jsx40("div", { className: containerPositionStyles[placement], children: toasts.map((toast) => /* @__PURE__ */ jsx40(ToastItem, { toast, onRemove: removeToast }, toast.id)) }) }),
|
|
2835
2915
|
document.body
|
|
2836
2916
|
);
|
|
2837
2917
|
}
|
|
@@ -2850,7 +2930,7 @@ function createToastBridge() {
|
|
|
2850
2930
|
};
|
|
2851
2931
|
}
|
|
2852
2932
|
function ToastProvider({ children, bridge, placement = "bottom-right" }) {
|
|
2853
|
-
const [toasts, setToasts] =
|
|
2933
|
+
const [toasts, setToasts] = useState8([]);
|
|
2854
2934
|
const addToast = useCallback9((toast) => {
|
|
2855
2935
|
const id = `toast-${++toastCounter}`;
|
|
2856
2936
|
setToasts((prev) => [...prev, { ...toast, id }]);
|
|
@@ -2864,7 +2944,7 @@ function ToastProvider({ children, bridge, placement = "bottom-right" }) {
|
|
|
2864
2944
|
}, [bridge, addToast]);
|
|
2865
2945
|
return /* @__PURE__ */ jsxs24(ToastContext.Provider, { value: { toasts, addToast, removeToast }, children: [
|
|
2866
2946
|
children,
|
|
2867
|
-
/* @__PURE__ */
|
|
2947
|
+
/* @__PURE__ */ jsx40(ToastContainer, { toasts, removeToast, placement })
|
|
2868
2948
|
] });
|
|
2869
2949
|
}
|
|
2870
2950
|
function useToast() {
|
|
@@ -2884,19 +2964,19 @@ import {
|
|
|
2884
2964
|
SwitchField,
|
|
2885
2965
|
SwitchButton
|
|
2886
2966
|
} from "react-aria-components";
|
|
2887
|
-
import { twMerge as
|
|
2888
|
-
import { Fragment as Fragment7, jsx as
|
|
2967
|
+
import { twMerge as twMerge18 } from "tailwind-merge";
|
|
2968
|
+
import { Fragment as Fragment7, jsx as jsx41, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2889
2969
|
function Switch({
|
|
2890
2970
|
children,
|
|
2891
2971
|
color = "var(--color-primary)",
|
|
2892
2972
|
className,
|
|
2893
2973
|
...props
|
|
2894
2974
|
}) {
|
|
2895
|
-
return /* @__PURE__ */
|
|
2896
|
-
/* @__PURE__ */
|
|
2975
|
+
return /* @__PURE__ */ jsx41(SwitchField, { ...props, children: /* @__PURE__ */ jsx41(SwitchButton, { className: "relative cursor-pointer flex items-center gap-2", children: ({ isSelected, isFocusVisible }) => /* @__PURE__ */ jsxs25(Fragment7, { children: [
|
|
2976
|
+
/* @__PURE__ */ jsx41(
|
|
2897
2977
|
"div",
|
|
2898
2978
|
{
|
|
2899
|
-
className:
|
|
2979
|
+
className: twMerge18(
|
|
2900
2980
|
`
|
|
2901
2981
|
flex items-center
|
|
2902
2982
|
border-2 border-border
|
|
@@ -2906,10 +2986,10 @@ function Switch({
|
|
|
2906
2986
|
!isSelected && "bg-border"
|
|
2907
2987
|
),
|
|
2908
2988
|
style: isSelected ? { backgroundColor: color } : void 0,
|
|
2909
|
-
children: /* @__PURE__ */
|
|
2989
|
+
children: /* @__PURE__ */ jsx41(
|
|
2910
2990
|
"div",
|
|
2911
2991
|
{
|
|
2912
|
-
className:
|
|
2992
|
+
className: twMerge18(
|
|
2913
2993
|
`
|
|
2914
2994
|
absolute top-0 left-0 w-5 h-5
|
|
2915
2995
|
rounded-full
|
|
@@ -2923,7 +3003,7 @@ function Switch({
|
|
|
2923
3003
|
)
|
|
2924
3004
|
}
|
|
2925
3005
|
),
|
|
2926
|
-
children && /* @__PURE__ */
|
|
3006
|
+
children && /* @__PURE__ */ jsx41("span", { className: "flex items-center", children })
|
|
2927
3007
|
] }) }) });
|
|
2928
3008
|
}
|
|
2929
3009
|
|
|
@@ -2932,20 +3012,20 @@ import {
|
|
|
2932
3012
|
RadioGroup as AriaRadioGroup,
|
|
2933
3013
|
Radio as AriaRadio
|
|
2934
3014
|
} from "react-aria-components";
|
|
2935
|
-
import { twMerge as
|
|
2936
|
-
import { Fragment as Fragment8, jsx as
|
|
3015
|
+
import { twMerge as twMerge19 } from "tailwind-merge";
|
|
3016
|
+
import { Fragment as Fragment8, jsx as jsx42, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2937
3017
|
function RadioGroup({
|
|
2938
3018
|
children,
|
|
2939
3019
|
className,
|
|
2940
3020
|
orientation = "vertical",
|
|
2941
3021
|
...props
|
|
2942
3022
|
}) {
|
|
2943
|
-
return /* @__PURE__ */
|
|
3023
|
+
return /* @__PURE__ */ jsx42(
|
|
2944
3024
|
AriaRadioGroup,
|
|
2945
3025
|
{
|
|
2946
3026
|
...props,
|
|
2947
3027
|
orientation,
|
|
2948
|
-
className:
|
|
3028
|
+
className: twMerge19(
|
|
2949
3029
|
"flex gap-2 disabled:opacity-50",
|
|
2950
3030
|
orientation === "horizontal" ? "flex-row" : "flex-col",
|
|
2951
3031
|
className
|
|
@@ -2955,7 +3035,7 @@ function RadioGroup({
|
|
|
2955
3035
|
);
|
|
2956
3036
|
}
|
|
2957
3037
|
function Radio({ children, className, ...props }) {
|
|
2958
|
-
return /* @__PURE__ */
|
|
3038
|
+
return /* @__PURE__ */ jsx42(
|
|
2959
3039
|
AriaRadio,
|
|
2960
3040
|
{
|
|
2961
3041
|
...props,
|
|
@@ -2965,7 +3045,7 @@ function Radio({ children, className, ...props }) {
|
|
|
2965
3045
|
className
|
|
2966
3046
|
].filter(Boolean).join(" "),
|
|
2967
3047
|
children: ({ isSelected }) => /* @__PURE__ */ jsxs26(Fragment8, { children: [
|
|
2968
|
-
/* @__PURE__ */
|
|
3048
|
+
/* @__PURE__ */ jsx42(
|
|
2969
3049
|
"div",
|
|
2970
3050
|
{
|
|
2971
3051
|
className: [
|
|
@@ -2974,16 +3054,16 @@ function Radio({ children, className, ...props }) {
|
|
|
2974
3054
|
"group-focus-visible:ring-2 group-focus-visible:ring-ring group-focus-visible:ring-offset-2",
|
|
2975
3055
|
isSelected ? "border-primary" : "border-border group-hover:border-border"
|
|
2976
3056
|
].join(" "),
|
|
2977
|
-
children: isSelected && /* @__PURE__ */
|
|
3057
|
+
children: isSelected && /* @__PURE__ */ jsx42("div", { className: "w-2.5 h-2.5 rounded-full bg-primary" })
|
|
2978
3058
|
}
|
|
2979
3059
|
),
|
|
2980
|
-
children && /* @__PURE__ */
|
|
3060
|
+
children && /* @__PURE__ */ jsx42("span", { children })
|
|
2981
3061
|
] })
|
|
2982
3062
|
}
|
|
2983
3063
|
);
|
|
2984
3064
|
}
|
|
2985
3065
|
function RadioButton({ children, className, ...props }) {
|
|
2986
|
-
return /* @__PURE__ */
|
|
3066
|
+
return /* @__PURE__ */ jsx42(
|
|
2987
3067
|
AriaRadio,
|
|
2988
3068
|
{
|
|
2989
3069
|
...props,
|
|
@@ -2992,7 +3072,7 @@ function RadioButton({ children, className, ...props }) {
|
|
|
2992
3072
|
"disabled:opacity-50 disabled:cursor-default",
|
|
2993
3073
|
className
|
|
2994
3074
|
].filter(Boolean).join(" "),
|
|
2995
|
-
children: ({ isSelected }) => /* @__PURE__ */
|
|
3075
|
+
children: ({ isSelected }) => /* @__PURE__ */ jsx42(
|
|
2996
3076
|
"div",
|
|
2997
3077
|
{
|
|
2998
3078
|
className: [
|
|
@@ -3015,8 +3095,8 @@ import {
|
|
|
3015
3095
|
SliderFill,
|
|
3016
3096
|
SliderThumb
|
|
3017
3097
|
} from "react-aria-components";
|
|
3018
|
-
import { twMerge as
|
|
3019
|
-
import { Fragment as Fragment9, jsx as
|
|
3098
|
+
import { twMerge as twMerge20 } from "tailwind-merge";
|
|
3099
|
+
import { Fragment as Fragment9, jsx as jsx43, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
3020
3100
|
function Slider({
|
|
3021
3101
|
label,
|
|
3022
3102
|
output,
|
|
@@ -3027,12 +3107,12 @@ function Slider({
|
|
|
3027
3107
|
isDisabled,
|
|
3028
3108
|
...props
|
|
3029
3109
|
}) {
|
|
3030
|
-
return /* @__PURE__ */
|
|
3110
|
+
return /* @__PURE__ */ jsx43(
|
|
3031
3111
|
AriaSlider,
|
|
3032
3112
|
{
|
|
3033
3113
|
...props,
|
|
3034
3114
|
isDisabled,
|
|
3035
|
-
className:
|
|
3115
|
+
className: twMerge20(
|
|
3036
3116
|
// data-disabled lands on the root (tailwindcss-react-aria-components
|
|
3037
3117
|
// maps the disabled: variant onto it).
|
|
3038
3118
|
"w-full flex flex-col gap-2 disabled:opacity-50 disabled:cursor-default",
|
|
@@ -3040,15 +3120,15 @@ function Slider({
|
|
|
3040
3120
|
),
|
|
3041
3121
|
children: ({ state }) => /* @__PURE__ */ jsxs27(Fragment9, { children: [
|
|
3042
3122
|
/* @__PURE__ */ jsxs27("div", { className: "flex items-center justify-between", children: [
|
|
3043
|
-
label && /* @__PURE__ */
|
|
3044
|
-
output && /* @__PURE__ */
|
|
3123
|
+
label && /* @__PURE__ */ jsx43(Label, { children: label }),
|
|
3124
|
+
output && /* @__PURE__ */ jsx43("span", { className: "text-sm font-medium text-foreground tabular-nums", children: output(state.values[0]) })
|
|
3045
3125
|
] }),
|
|
3046
3126
|
/* @__PURE__ */ jsxs27(SliderTrack, { className: "flex h-6 w-full cursor-pointer items-center", children: [
|
|
3047
|
-
/* @__PURE__ */
|
|
3048
|
-
/* @__PURE__ */
|
|
3127
|
+
/* @__PURE__ */ jsx43("div", { className: "relative h-1.5 w-full overflow-hidden rounded-full bg-border", children: /* @__PURE__ */ jsx43(SliderFill, { className: "h-full rounded-full bg-primary" }) }),
|
|
3128
|
+
/* @__PURE__ */ jsx43(
|
|
3049
3129
|
SliderThumb,
|
|
3050
3130
|
{
|
|
3051
|
-
className:
|
|
3131
|
+
className: twMerge20(
|
|
3052
3132
|
"top-1/2 h-4 w-4 rounded-full bg-background",
|
|
3053
3133
|
"border-2 border-primary",
|
|
3054
3134
|
"shadow-sm",
|
|
@@ -3060,10 +3140,10 @@ function Slider({
|
|
|
3060
3140
|
}
|
|
3061
3141
|
)
|
|
3062
3142
|
] }),
|
|
3063
|
-
(description || errorMessage) && /* @__PURE__ */
|
|
3143
|
+
(description || errorMessage) && /* @__PURE__ */ jsx43(
|
|
3064
3144
|
"p",
|
|
3065
3145
|
{
|
|
3066
|
-
className:
|
|
3146
|
+
className: twMerge20(
|
|
3067
3147
|
"text-xs text-muted-foreground",
|
|
3068
3148
|
errorMessage && "text-destructive"
|
|
3069
3149
|
),
|
|
@@ -3077,7 +3157,7 @@ function Slider({
|
|
|
3077
3157
|
}
|
|
3078
3158
|
|
|
3079
3159
|
// src/components/Form/Fieldset/Fieldset.tsx
|
|
3080
|
-
import { jsx as
|
|
3160
|
+
import { jsx as jsx44, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3081
3161
|
function Fieldset({ legend, children, className }) {
|
|
3082
3162
|
return /* @__PURE__ */ jsxs28(
|
|
3083
3163
|
"fieldset",
|
|
@@ -3088,7 +3168,7 @@ function Fieldset({ legend, children, className }) {
|
|
|
3088
3168
|
className
|
|
3089
3169
|
].filter(Boolean).join(" "),
|
|
3090
3170
|
children: [
|
|
3091
|
-
legend && /* @__PURE__ */
|
|
3171
|
+
legend && /* @__PURE__ */ jsx44(
|
|
3092
3172
|
"legend",
|
|
3093
3173
|
{
|
|
3094
3174
|
className: [
|
|
@@ -3110,7 +3190,7 @@ function Fieldset({ legend, children, className }) {
|
|
|
3110
3190
|
import {
|
|
3111
3191
|
Link as AriaLink3
|
|
3112
3192
|
} from "react-aria-components";
|
|
3113
|
-
import { jsx as
|
|
3193
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
3114
3194
|
var variantStyles2 = {
|
|
3115
3195
|
default: [
|
|
3116
3196
|
"text-teal-700 underline",
|
|
@@ -3126,7 +3206,7 @@ function Link({
|
|
|
3126
3206
|
className,
|
|
3127
3207
|
...props
|
|
3128
3208
|
}) {
|
|
3129
|
-
return /* @__PURE__ */
|
|
3209
|
+
return /* @__PURE__ */ jsx45(
|
|
3130
3210
|
AriaLink3,
|
|
3131
3211
|
{
|
|
3132
3212
|
...props,
|
|
@@ -3147,20 +3227,20 @@ import {
|
|
|
3147
3227
|
Link as Link2
|
|
3148
3228
|
} from "react-aria-components";
|
|
3149
3229
|
import { ChevronRight as ChevronRight2 } from "lucide-react";
|
|
3150
|
-
import { Fragment as Fragment10, jsx as
|
|
3230
|
+
import { Fragment as Fragment10, jsx as jsx46, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
3151
3231
|
function Breadcrumbs({ items, className }) {
|
|
3152
|
-
return /* @__PURE__ */
|
|
3232
|
+
return /* @__PURE__ */ jsx46(
|
|
3153
3233
|
"nav",
|
|
3154
3234
|
{
|
|
3155
3235
|
"aria-label": "Breadcrumb",
|
|
3156
3236
|
className,
|
|
3157
|
-
children: /* @__PURE__ */
|
|
3237
|
+
children: /* @__PURE__ */ jsx46(
|
|
3158
3238
|
AriaBreadcrumbs,
|
|
3159
3239
|
{
|
|
3160
3240
|
className: "flex items-center gap-1 text-sm min-w-0",
|
|
3161
3241
|
children: items.map((item, index) => {
|
|
3162
3242
|
const isLast = index === items.length - 1;
|
|
3163
|
-
return /* @__PURE__ */
|
|
3243
|
+
return /* @__PURE__ */ jsx46(
|
|
3164
3244
|
AriaBreadcrumb,
|
|
3165
3245
|
{
|
|
3166
3246
|
id: item.id,
|
|
@@ -3168,8 +3248,8 @@ function Breadcrumbs({ items, className }) {
|
|
|
3168
3248
|
"flex items-center gap-1",
|
|
3169
3249
|
isLast ? "min-w-0" : "shrink-0"
|
|
3170
3250
|
].join(" "),
|
|
3171
|
-
children: isLast ? /* @__PURE__ */
|
|
3172
|
-
/* @__PURE__ */
|
|
3251
|
+
children: isLast ? /* @__PURE__ */ jsx46("span", { className: "font-medium text-foreground truncate", children: item.label }) : /* @__PURE__ */ jsxs29(Fragment10, { children: [
|
|
3252
|
+
/* @__PURE__ */ jsx46(
|
|
3173
3253
|
Link2,
|
|
3174
3254
|
{
|
|
3175
3255
|
href: item.href,
|
|
@@ -3177,7 +3257,7 @@ function Breadcrumbs({ items, className }) {
|
|
|
3177
3257
|
children: item.label
|
|
3178
3258
|
}
|
|
3179
3259
|
),
|
|
3180
|
-
/* @__PURE__ */
|
|
3260
|
+
/* @__PURE__ */ jsx46(
|
|
3181
3261
|
ChevronRight2,
|
|
3182
3262
|
{
|
|
3183
3263
|
className: "shrink-0 text-slate-400",
|
|
@@ -3200,8 +3280,8 @@ function Breadcrumbs({ items, className }) {
|
|
|
3200
3280
|
import {
|
|
3201
3281
|
ToggleButton as AriaToggleButton2
|
|
3202
3282
|
} from "react-aria-components";
|
|
3203
|
-
import { twMerge as
|
|
3204
|
-
import { jsx as
|
|
3283
|
+
import { twMerge as twMerge21 } from "tailwind-merge";
|
|
3284
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
3205
3285
|
var squareSizeStyles2 = {
|
|
3206
3286
|
xs: "h-6 w-6 text-xs",
|
|
3207
3287
|
sm: "h-7 w-7 text-sm",
|
|
@@ -3246,11 +3326,11 @@ function ToggleButton({
|
|
|
3246
3326
|
...props
|
|
3247
3327
|
}) {
|
|
3248
3328
|
const styles = variantStyles3[variant];
|
|
3249
|
-
return /* @__PURE__ */
|
|
3329
|
+
return /* @__PURE__ */ jsx47(
|
|
3250
3330
|
AriaToggleButton2,
|
|
3251
3331
|
{
|
|
3252
3332
|
...props,
|
|
3253
|
-
className: ({ isSelected }) =>
|
|
3333
|
+
className: ({ isSelected }) => twMerge21(
|
|
3254
3334
|
"inline-flex items-center justify-center gap-2 cursor-pointer",
|
|
3255
3335
|
isSquare ? "rounded-none" : "rounded-md",
|
|
3256
3336
|
"font-medium",
|
|
@@ -3266,55 +3346,6 @@ function ToggleButton({
|
|
|
3266
3346
|
);
|
|
3267
3347
|
}
|
|
3268
3348
|
|
|
3269
|
-
// src/components/Popover/Popover.tsx
|
|
3270
|
-
import {
|
|
3271
|
-
DialogTrigger,
|
|
3272
|
-
Popover as AriaPopover,
|
|
3273
|
-
Button as AriaButton3
|
|
3274
|
-
} from "react-aria-components";
|
|
3275
|
-
import { twMerge as twMerge21 } from "tailwind-merge";
|
|
3276
|
-
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
3277
|
-
function Popover4({ children, isOpen, onOpenChange }) {
|
|
3278
|
-
return /* @__PURE__ */ jsx47(DialogTrigger, { isOpen, onOpenChange, children });
|
|
3279
|
-
}
|
|
3280
|
-
function PopoverTrigger({ children, className }) {
|
|
3281
|
-
const cx = `
|
|
3282
|
-
inline-flex items-center bg-transparent border-none p-0 outline-none cursor-pointer
|
|
3283
|
-
focus-visible:ring-2 focus-visible:ring-ring focus-visible:rounded-sm
|
|
3284
|
-
`;
|
|
3285
|
-
return /* @__PURE__ */ jsx47(AriaButton3, { className: twMerge21(cx, className), children });
|
|
3286
|
-
}
|
|
3287
|
-
function PopoverContent({
|
|
3288
|
-
placement = "bottom",
|
|
3289
|
-
offset: offsetPx = 8,
|
|
3290
|
-
className,
|
|
3291
|
-
children,
|
|
3292
|
-
...rest
|
|
3293
|
-
}) {
|
|
3294
|
-
const cx = `
|
|
3295
|
-
z-50
|
|
3296
|
-
bg-background
|
|
3297
|
-
border border-border
|
|
3298
|
-
rounded-md shadow-lg
|
|
3299
|
-
entering:animate-in entering:fade-in entering:duration-300
|
|
3300
|
-
exiting:animate-out exiting:fade-out exiting:duration-300
|
|
3301
|
-
entering:placement-top:slide-in-from-bottom-1
|
|
3302
|
-
entering:placement-bottom:slide-in-from-top-1
|
|
3303
|
-
entering:placement-left:slide-in-from-right-1
|
|
3304
|
-
entering:placement-right:slide-in-from-left-1
|
|
3305
|
-
`;
|
|
3306
|
-
return /* @__PURE__ */ jsx47(
|
|
3307
|
-
AriaPopover,
|
|
3308
|
-
{
|
|
3309
|
-
...rest,
|
|
3310
|
-
placement,
|
|
3311
|
-
offset: offsetPx,
|
|
3312
|
-
className: twMerge21(cx, className),
|
|
3313
|
-
children
|
|
3314
|
-
}
|
|
3315
|
-
);
|
|
3316
|
-
}
|
|
3317
|
-
|
|
3318
3349
|
// src/components/Tabs/Tabs.tsx
|
|
3319
3350
|
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
3320
3351
|
import { twMerge as twMerge22 } from "tailwind-merge";
|
|
@@ -3720,7 +3751,7 @@ function ProgressBar({
|
|
|
3720
3751
|
}
|
|
3721
3752
|
|
|
3722
3753
|
// src/components/Banner/Banner.tsx
|
|
3723
|
-
import { useState as
|
|
3754
|
+
import { useState as useState9 } from "react";
|
|
3724
3755
|
import {
|
|
3725
3756
|
Info as Info3,
|
|
3726
3757
|
AlertTriangle as AlertTriangle2,
|
|
@@ -3764,7 +3795,7 @@ function Banner({
|
|
|
3764
3795
|
onDismiss,
|
|
3765
3796
|
className
|
|
3766
3797
|
}) {
|
|
3767
|
-
const [dismissed, setDismissed] =
|
|
3798
|
+
const [dismissed, setDismissed] = useState9(false);
|
|
3768
3799
|
if (dismissed) return null;
|
|
3769
3800
|
const config = variantConfig2[variant];
|
|
3770
3801
|
const resolvedIcon = icon ?? config.icon;
|
|
@@ -4186,7 +4217,7 @@ export {
|
|
|
4186
4217
|
MetricText,
|
|
4187
4218
|
NoFilterResults,
|
|
4188
4219
|
PathPill,
|
|
4189
|
-
|
|
4220
|
+
Popover2 as Popover,
|
|
4190
4221
|
PopoverContent,
|
|
4191
4222
|
PopoverTrigger,
|
|
4192
4223
|
ProgressBar,
|