@eqtylab/equality 4.1.0 → 4.3.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/CHANGELOG.md +53 -0
- package/dist/dropdown-menu.module.module.css.module.css +3 -3
- package/dist/filter-dropdown.module.module.css.module.css +13 -0
- package/dist/global-theme-config.css +0 -1
- package/dist/index.cjs +447 -197
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +25 -4
- package/dist/index.d.ts +25 -4
- package/dist/index.js +446 -198
- package/dist/index.js.map +1 -1
- package/dist/select.module.module.css.module.css +75 -0
- package/dist/theme-utilities.css +19 -0
- package/dist/theme.module.css +0 -1
- package/dist/theme.module.module.css.module.css +222 -51
- package/package.json +10 -3
- package/dist/theme-components.css +0 -27
package/dist/index.js
CHANGED
|
@@ -1259,7 +1259,7 @@ var DialogDescription = React15.forwardRef(({ className, ...props }, ref) => /*
|
|
|
1259
1259
|
}
|
|
1260
1260
|
));
|
|
1261
1261
|
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
1262
|
-
var DialogContent = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn(styles16["dialog-body"],
|
|
1262
|
+
var DialogContent = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn(styles16["dialog-body"], className), ...props });
|
|
1263
1263
|
DialogContent.displayName = "DialogContent";
|
|
1264
1264
|
function Command({ className, ...props }) {
|
|
1265
1265
|
return /* @__PURE__ */ jsx(Command$1, { "data-slot": "command", className: cn(styles17.command, className), ...props });
|
|
@@ -1727,18 +1727,79 @@ var DrawerDescription = React15.forwardRef(({ className, ...props }, ref) => /*
|
|
|
1727
1727
|
DrawerDescription.displayName = Drawer$1.Description.displayName;
|
|
1728
1728
|
var DrawerInnerContent = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn(styles21["drawer-inner-content"], className), ...props });
|
|
1729
1729
|
DrawerInnerContent.displayName = "DrawerInnerContent";
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1730
|
+
function useMatchRegistry() {
|
|
1731
|
+
const itemsRef = React15.useRef(/* @__PURE__ */ new Map());
|
|
1732
|
+
const [matchCount, setMatchCount] = React15.useState(0);
|
|
1733
|
+
const registerItem = React15.useCallback((id, matches) => {
|
|
1734
|
+
const delta = Number(matches) - Number(itemsRef.current.get(id) ?? false);
|
|
1735
|
+
itemsRef.current.set(id, matches);
|
|
1736
|
+
if (delta) setMatchCount((count2) => count2 + delta);
|
|
1737
|
+
}, []);
|
|
1738
|
+
const unregisterItem = React15.useCallback((id) => {
|
|
1739
|
+
if (itemsRef.current.get(id)) setMatchCount((count2) => count2 - 1);
|
|
1740
|
+
itemsRef.current.delete(id);
|
|
1741
|
+
}, []);
|
|
1742
|
+
return React15.useMemo(
|
|
1743
|
+
() => ({ registerItem, unregisterItem, matchCount }),
|
|
1744
|
+
[registerItem, unregisterItem, matchCount]
|
|
1745
|
+
);
|
|
1746
|
+
}
|
|
1747
|
+
function useListSearchState(open) {
|
|
1748
|
+
const [enabled, setEnabled] = React15.useState(false);
|
|
1749
|
+
const [visible, setVisible] = React15.useState(false);
|
|
1750
|
+
const [query, setQuery] = React15.useState("");
|
|
1751
|
+
const [listId, setListId] = React15.useState(void 0);
|
|
1752
|
+
const [focusSignal, setFocusSignal] = React15.useState(0);
|
|
1753
|
+
const requestFocus = React15.useCallback(() => setFocusSignal((n) => n + 1), []);
|
|
1754
|
+
const { registerItem, unregisterItem, matchCount } = useMatchRegistry();
|
|
1755
|
+
const reveal = React15.useCallback((seed) => {
|
|
1756
|
+
setVisible(true);
|
|
1757
|
+
setQuery(seed);
|
|
1758
|
+
}, []);
|
|
1759
|
+
const resetForOpen = React15.useCallback(() => {
|
|
1760
|
+
setVisible(false);
|
|
1761
|
+
setQuery("");
|
|
1762
|
+
}, []);
|
|
1763
|
+
const [previousOpen, setPreviousOpen] = React15.useState(open);
|
|
1764
|
+
if (open !== previousOpen) {
|
|
1765
|
+
setPreviousOpen(open);
|
|
1766
|
+
if (open) resetForOpen();
|
|
1767
|
+
}
|
|
1768
|
+
return React15.useMemo(
|
|
1769
|
+
() => ({
|
|
1770
|
+
enabled,
|
|
1771
|
+
setEnabled,
|
|
1772
|
+
visible,
|
|
1773
|
+
reveal,
|
|
1774
|
+
query,
|
|
1775
|
+
setQuery,
|
|
1776
|
+
focusSignal,
|
|
1777
|
+
requestFocus,
|
|
1778
|
+
registerItem,
|
|
1779
|
+
unregisterItem,
|
|
1780
|
+
matchCount,
|
|
1781
|
+
resetForOpen,
|
|
1782
|
+
listId,
|
|
1783
|
+
setListId
|
|
1784
|
+
}),
|
|
1785
|
+
[
|
|
1786
|
+
enabled,
|
|
1787
|
+
visible,
|
|
1788
|
+
reveal,
|
|
1789
|
+
query,
|
|
1790
|
+
focusSignal,
|
|
1791
|
+
requestFocus,
|
|
1792
|
+
registerItem,
|
|
1793
|
+
unregisterItem,
|
|
1794
|
+
matchCount,
|
|
1795
|
+
resetForOpen,
|
|
1796
|
+
listId
|
|
1797
|
+
]
|
|
1798
|
+
);
|
|
1799
|
+
}
|
|
1800
|
+
var isSearchActive = (state) => !!state && state.query.trim().length > 0;
|
|
1801
|
+
var isSearchEmpty = (state) => isSearchActive(state) && state.matchCount === 0;
|
|
1802
|
+
var formatResultCount = (count2) => `${count2} result${count2 === 1 ? "" : "s"} available`;
|
|
1742
1803
|
function getNodeText(node) {
|
|
1743
1804
|
if (node == null || typeof node === "boolean") return "";
|
|
1744
1805
|
if (typeof node === "string" || typeof node === "number") return String(node);
|
|
@@ -1748,6 +1809,66 @@ function getNodeText(node) {
|
|
|
1748
1809
|
}
|
|
1749
1810
|
return "";
|
|
1750
1811
|
}
|
|
1812
|
+
var matchesQuery = (query, textValue, children) => {
|
|
1813
|
+
const normalized = query.trim().toLowerCase();
|
|
1814
|
+
return !normalized || (textValue ?? getNodeText(children)).toLowerCase().includes(normalized);
|
|
1815
|
+
};
|
|
1816
|
+
function useRegisterMatch(registry, enabled, id, matches) {
|
|
1817
|
+
const registerItem = registry?.registerItem;
|
|
1818
|
+
const unregisterItem = registry?.unregisterItem;
|
|
1819
|
+
React15.useEffect(() => {
|
|
1820
|
+
if (!enabled || !registerItem || !unregisterItem) return;
|
|
1821
|
+
registerItem(id, matches);
|
|
1822
|
+
return () => unregisterItem(id);
|
|
1823
|
+
}, [enabled, registerItem, unregisterItem, id, matches]);
|
|
1824
|
+
}
|
|
1825
|
+
function useFilterableItem(state, textValue, children, group) {
|
|
1826
|
+
const id = React15.useId();
|
|
1827
|
+
const matches = matchesQuery(state?.query ?? "", textValue, children);
|
|
1828
|
+
const enabled = state?.enabled ?? false;
|
|
1829
|
+
useRegisterMatch(state, enabled, id, matches);
|
|
1830
|
+
useRegisterMatch(group, enabled, id, matches);
|
|
1831
|
+
return matches;
|
|
1832
|
+
}
|
|
1833
|
+
function useSearchInput(state, alwaysVisible, forwardedRef) {
|
|
1834
|
+
const { setEnabled, reveal, visible, focusSignal } = state;
|
|
1835
|
+
const inputRef = React15.useRef(null);
|
|
1836
|
+
const ref = React15.useCallback(
|
|
1837
|
+
(node) => assignRefs(node, inputRef, forwardedRef),
|
|
1838
|
+
[forwardedRef]
|
|
1839
|
+
);
|
|
1840
|
+
React15.useEffect(() => {
|
|
1841
|
+
setEnabled(true);
|
|
1842
|
+
return () => setEnabled(false);
|
|
1843
|
+
}, [setEnabled]);
|
|
1844
|
+
React15.useEffect(() => {
|
|
1845
|
+
if (!visible) return;
|
|
1846
|
+
const input = inputRef.current;
|
|
1847
|
+
if (!input) return;
|
|
1848
|
+
input.focus();
|
|
1849
|
+
input.setSelectionRange(input.value.length, input.value.length);
|
|
1850
|
+
}, [visible, focusSignal]);
|
|
1851
|
+
React15.useEffect(() => {
|
|
1852
|
+
if (alwaysVisible && !visible) reveal("");
|
|
1853
|
+
}, [alwaysVisible, visible, reveal]);
|
|
1854
|
+
return { ref, isRendered: alwaysVisible || visible };
|
|
1855
|
+
}
|
|
1856
|
+
var isPrintableKey = (event) => event.key.length === 1 && !event.metaKey && !event.ctrlKey && !event.altKey && /\S/.test(event.key);
|
|
1857
|
+
function assignRefs(node, ...refs) {
|
|
1858
|
+
refs.forEach((ref) => {
|
|
1859
|
+
if (typeof ref === "function") ref(node);
|
|
1860
|
+
else if (ref) ref.current = node;
|
|
1861
|
+
});
|
|
1862
|
+
}
|
|
1863
|
+
var CheckIcon2 = Check;
|
|
1864
|
+
var ChevronRightIcon2 = ChevronRight;
|
|
1865
|
+
var CircleIcon = Circle;
|
|
1866
|
+
var SearchIcon2 = Search;
|
|
1867
|
+
var DropdownMenuSearchContext = React15.createContext(null);
|
|
1868
|
+
var useDropdownMenuSearch = () => React15.useContext(DropdownMenuSearchContext);
|
|
1869
|
+
var useIsSearching = () => isSearchActive(useDropdownMenuSearch());
|
|
1870
|
+
var DropdownMenuBreadcrumbContext = React15.createContext([]);
|
|
1871
|
+
var useBreadcrumbAncestry = () => React15.useContext(DropdownMenuBreadcrumbContext);
|
|
1751
1872
|
var SUB_CONTENT_NAME = "DropdownMenuSubContent";
|
|
1752
1873
|
var SUB_TRIGGER_NAME = "DropdownMenuSubTrigger";
|
|
1753
1874
|
function hasDisplayName(node, name) {
|
|
@@ -1777,100 +1898,24 @@ function getSubTriggerLabel(nodes) {
|
|
|
1777
1898
|
const trigger = React15.Children.toArray(nodes).find(isSubTrigger);
|
|
1778
1899
|
return trigger ? getNodeText(trigger.props.children) : "";
|
|
1779
1900
|
}
|
|
1780
|
-
function useFilterableItem(textValue, children) {
|
|
1781
|
-
const ctx = useDropdownMenuSearch();
|
|
1782
|
-
const id = React15.useId();
|
|
1783
|
-
const query = ctx?.query.trim().toLowerCase() ?? "";
|
|
1784
|
-
const visible = !query || (textValue ?? getNodeText(children)).toLowerCase().includes(query);
|
|
1785
|
-
const enabled = ctx?.enabled ?? false;
|
|
1786
|
-
const registerItem = ctx?.registerItem;
|
|
1787
|
-
const unregisterItem = ctx?.unregisterItem;
|
|
1788
|
-
React15.useEffect(() => {
|
|
1789
|
-
if (!enabled || !registerItem || !unregisterItem) return;
|
|
1790
|
-
registerItem(id, visible);
|
|
1791
|
-
return () => unregisterItem(id);
|
|
1792
|
-
}, [enabled, registerItem, unregisterItem, id, visible]);
|
|
1793
|
-
return visible;
|
|
1794
|
-
}
|
|
1795
1901
|
var DropdownMenu = ({
|
|
1796
1902
|
children,
|
|
1903
|
+
open,
|
|
1797
1904
|
onOpenChange,
|
|
1798
1905
|
...props
|
|
1799
1906
|
}) => {
|
|
1800
|
-
const
|
|
1801
|
-
const
|
|
1802
|
-
const [query, setQuery] = React15.useState("");
|
|
1803
|
-
const [focusSignal, setFocusSignal] = React15.useState(0);
|
|
1804
|
-
const requestFocus = React15.useCallback(() => setFocusSignal((n) => n + 1), []);
|
|
1805
|
-
const [listId, setListId] = React15.useState(void 0);
|
|
1806
|
-
const itemsRef = React15.useRef(/* @__PURE__ */ new Map());
|
|
1807
|
-
const [matchCount, setMatchCount] = React15.useState(0);
|
|
1808
|
-
const recount = React15.useCallback(() => {
|
|
1809
|
-
let count2 = 0;
|
|
1810
|
-
itemsRef.current.forEach((matches) => {
|
|
1811
|
-
if (matches) count2 += 1;
|
|
1812
|
-
});
|
|
1813
|
-
setMatchCount(count2);
|
|
1814
|
-
}, []);
|
|
1815
|
-
const registerItem = React15.useCallback(
|
|
1816
|
-
(id, matches) => {
|
|
1817
|
-
itemsRef.current.set(id, matches);
|
|
1818
|
-
recount();
|
|
1819
|
-
},
|
|
1820
|
-
[recount]
|
|
1821
|
-
);
|
|
1822
|
-
const unregisterItem = React15.useCallback(
|
|
1823
|
-
(id) => {
|
|
1824
|
-
itemsRef.current.delete(id);
|
|
1825
|
-
recount();
|
|
1826
|
-
},
|
|
1827
|
-
[recount]
|
|
1828
|
-
);
|
|
1829
|
-
const reveal = React15.useCallback((seed) => {
|
|
1830
|
-
setVisible(true);
|
|
1831
|
-
setQuery(seed);
|
|
1832
|
-
}, []);
|
|
1907
|
+
const search = useListSearchState(open);
|
|
1908
|
+
const { resetForOpen } = search;
|
|
1833
1909
|
const handleOpenChange = React15.useCallback(
|
|
1834
|
-
(
|
|
1835
|
-
if (
|
|
1836
|
-
|
|
1837
|
-
setQuery("");
|
|
1838
|
-
}
|
|
1839
|
-
onOpenChange?.(open);
|
|
1910
|
+
(nextOpen) => {
|
|
1911
|
+
if (nextOpen) resetForOpen();
|
|
1912
|
+
onOpenChange?.(nextOpen);
|
|
1840
1913
|
},
|
|
1841
|
-
[onOpenChange]
|
|
1842
|
-
);
|
|
1843
|
-
const value = React15.useMemo(
|
|
1844
|
-
() => ({
|
|
1845
|
-
enabled,
|
|
1846
|
-
setEnabled,
|
|
1847
|
-
visible,
|
|
1848
|
-
reveal,
|
|
1849
|
-
query,
|
|
1850
|
-
setQuery,
|
|
1851
|
-
focusSignal,
|
|
1852
|
-
requestFocus,
|
|
1853
|
-
listId,
|
|
1854
|
-
setListId,
|
|
1855
|
-
registerItem,
|
|
1856
|
-
unregisterItem,
|
|
1857
|
-
matchCount
|
|
1858
|
-
}),
|
|
1859
|
-
[
|
|
1860
|
-
enabled,
|
|
1861
|
-
visible,
|
|
1862
|
-
reveal,
|
|
1863
|
-
query,
|
|
1864
|
-
focusSignal,
|
|
1865
|
-
requestFocus,
|
|
1866
|
-
listId,
|
|
1867
|
-
registerItem,
|
|
1868
|
-
unregisterItem,
|
|
1869
|
-
matchCount
|
|
1870
|
-
]
|
|
1914
|
+
[onOpenChange, resetForOpen]
|
|
1871
1915
|
);
|
|
1872
|
-
return /* @__PURE__ */ jsx(DropdownMenuSearchContext.Provider, { value, children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.Root, { onOpenChange: handleOpenChange, ...props, children }) });
|
|
1916
|
+
return /* @__PURE__ */ jsx(DropdownMenuSearchContext.Provider, { value: search, children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.Root, { open, onOpenChange: handleOpenChange, ...props, children }) });
|
|
1873
1917
|
};
|
|
1918
|
+
DropdownMenu.displayName = "DropdownMenu";
|
|
1874
1919
|
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
1875
1920
|
var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
1876
1921
|
var DropdownMenuPortal = ({ children }) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { container: usePortalContainer(), children });
|
|
@@ -1922,7 +1967,7 @@ var MENU_ITEM_SELECTOR = '[role="menuitem"]:not([data-disabled]),[role="menuitem
|
|
|
1922
1967
|
var DropdownMenuContent = React15.forwardRef(({ className, sideOffset = 4, onKeyDown, children, ...props }, ref) => {
|
|
1923
1968
|
const ctx = useDropdownMenuSearch();
|
|
1924
1969
|
const setListId = ctx?.setListId;
|
|
1925
|
-
const searching =
|
|
1970
|
+
const searching = isSearchActive(ctx);
|
|
1926
1971
|
const resultCount = ctx?.matchCount ?? 0;
|
|
1927
1972
|
const composedContentRef = React15.useCallback(
|
|
1928
1973
|
(node) => {
|
|
@@ -1954,8 +1999,7 @@ var DropdownMenuContent = React15.forwardRef(({ className, sideOffset = 4, onKey
|
|
|
1954
1999
|
}
|
|
1955
2000
|
}
|
|
1956
2001
|
if (event.defaultPrevented) return;
|
|
1957
|
-
|
|
1958
|
-
if (!isPrintable) return;
|
|
2002
|
+
if (!isPrintableKey(event)) return;
|
|
1959
2003
|
const target = event.target;
|
|
1960
2004
|
if (target?.closest?.("[data-dropdown-search]")) return;
|
|
1961
2005
|
event.preventDefault();
|
|
@@ -1968,28 +2012,20 @@ var DropdownMenuContent = React15.forwardRef(({ className, sideOffset = 4, onKey
|
|
|
1968
2012
|
},
|
|
1969
2013
|
...props,
|
|
1970
2014
|
children: [
|
|
1971
|
-
ctx?.enabled ? /* @__PURE__ */ jsx("div", { className: styles22["dropdown-menu-sr-status"], role: "status", "aria-live": "polite", children: searching && resultCount > 0 ?
|
|
2015
|
+
ctx?.enabled ? /* @__PURE__ */ jsx("div", { className: styles22["dropdown-menu-sr-status"], role: "status", "aria-live": "polite", children: searching && resultCount > 0 ? formatResultCount(resultCount) : null }) : null,
|
|
1972
2016
|
children
|
|
1973
2017
|
]
|
|
1974
2018
|
}
|
|
1975
2019
|
) });
|
|
1976
2020
|
});
|
|
1977
2021
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
1978
|
-
function assignRefs(node, ...refs) {
|
|
1979
|
-
refs.forEach((ref) => {
|
|
1980
|
-
if (typeof ref === "function") ref(node);
|
|
1981
|
-
else if (ref) ref.current = node;
|
|
1982
|
-
});
|
|
1983
|
-
}
|
|
1984
2022
|
var DropdownMenuSearch = React15.forwardRef(
|
|
1985
2023
|
({
|
|
1986
2024
|
className,
|
|
1987
2025
|
placeholder = "Search...",
|
|
1988
2026
|
icon,
|
|
1989
|
-
/* Render the input immediately instead of revealing on first keypress */
|
|
1990
2027
|
alwaysVisible = false,
|
|
1991
2028
|
onKeyDown,
|
|
1992
|
-
/* Pulled out of props so the placeholder fallback below isn't overwritten by the spread */
|
|
1993
2029
|
"aria-label": ariaLabel,
|
|
1994
2030
|
...props
|
|
1995
2031
|
}, forwardedRef) => {
|
|
@@ -1997,32 +2033,15 @@ var DropdownMenuSearch = React15.forwardRef(
|
|
|
1997
2033
|
if (!ctx) {
|
|
1998
2034
|
throw new Error("DropdownMenuSearch must be used within a DropdownMenu");
|
|
1999
2035
|
}
|
|
2000
|
-
const {
|
|
2001
|
-
|
|
2002
|
-
React15.useEffect(() => {
|
|
2003
|
-
setEnabled(true);
|
|
2004
|
-
return () => setEnabled(false);
|
|
2005
|
-
}, [setEnabled]);
|
|
2006
|
-
React15.useEffect(() => {
|
|
2007
|
-
if (!visible) return;
|
|
2008
|
-
const el = inputRef.current;
|
|
2009
|
-
if (!el) return;
|
|
2010
|
-
el.focus();
|
|
2011
|
-
const end = el.value.length;
|
|
2012
|
-
el.setSelectionRange(end, end);
|
|
2013
|
-
}, [visible, focusSignal]);
|
|
2014
|
-
React15.useEffect(() => {
|
|
2015
|
-
if (alwaysVisible && !visible) reveal("");
|
|
2016
|
-
}, [alwaysVisible, visible, reveal]);
|
|
2017
|
-
if (!alwaysVisible && !visible) return null;
|
|
2036
|
+
const { ref, isRendered } = useSearchInput(ctx, alwaysVisible, forwardedRef);
|
|
2037
|
+
if (!isRendered) return null;
|
|
2018
2038
|
return /* @__PURE__ */ jsxs("div", { className: styles22["dropdown-menu-search"], children: [
|
|
2019
2039
|
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: styles22["dropdown-menu-item-icon"], children: icon ?? /* @__PURE__ */ jsx(SearchIcon2, { className: styles22["icon-size"] }) }),
|
|
2020
2040
|
/* @__PURE__ */ jsx(
|
|
2021
2041
|
"input",
|
|
2022
2042
|
{
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
},
|
|
2043
|
+
...props,
|
|
2044
|
+
ref,
|
|
2026
2045
|
"data-dropdown-search": "",
|
|
2027
2046
|
className: cn(styles22["dropdown-menu-search-input"], className),
|
|
2028
2047
|
value: ctx.query,
|
|
@@ -2034,19 +2053,19 @@ var DropdownMenuSearch = React15.forwardRef(
|
|
|
2034
2053
|
onChange: (event) => ctx.setQuery(event.target.value),
|
|
2035
2054
|
onKeyDown: (event) => {
|
|
2036
2055
|
onKeyDown?.(event);
|
|
2037
|
-
if (event.key === "
|
|
2056
|
+
if (event.key === "Enter" && !isSearchActive(ctx)) return;
|
|
2057
|
+
if (event.key === "ArrowDown" || event.key === "ArrowUp" || event.key === "Enter") {
|
|
2038
2058
|
const menu = event.currentTarget.closest('[role="menu"]');
|
|
2039
2059
|
const items = menu ? Array.from(menu.querySelectorAll(MENU_ITEM_SELECTOR)) : [];
|
|
2040
|
-
if (items.length)
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2060
|
+
if (!items.length || event.defaultPrevented) return;
|
|
2061
|
+
event.preventDefault();
|
|
2062
|
+
if (event.key === "Enter") items[0].click();
|
|
2063
|
+
else (event.key === "ArrowUp" ? items[items.length - 1] : items[0]).focus();
|
|
2044
2064
|
return;
|
|
2045
2065
|
}
|
|
2046
|
-
if (["
|
|
2066
|
+
if (["Escape", "Tab"].includes(event.key)) return;
|
|
2047
2067
|
event.stopPropagation();
|
|
2048
|
-
}
|
|
2049
|
-
...props
|
|
2068
|
+
}
|
|
2050
2069
|
}
|
|
2051
2070
|
)
|
|
2052
2071
|
] });
|
|
@@ -2060,15 +2079,14 @@ var DropdownMenuEmpty = ({
|
|
|
2060
2079
|
}) => {
|
|
2061
2080
|
const ctx = useDropdownMenuSearch();
|
|
2062
2081
|
if (!ctx) return null;
|
|
2063
|
-
const
|
|
2064
|
-
const isEmpty = !!query && ctx.matchCount === 0;
|
|
2082
|
+
const isEmpty = isSearchEmpty(ctx);
|
|
2065
2083
|
return /* @__PURE__ */ jsx(
|
|
2066
2084
|
"div",
|
|
2067
2085
|
{
|
|
2086
|
+
...props,
|
|
2068
2087
|
role: "status",
|
|
2069
2088
|
"aria-live": "polite",
|
|
2070
2089
|
className: isEmpty ? cn(styles22["dropdown-menu-empty"], className) : void 0,
|
|
2071
|
-
...props,
|
|
2072
2090
|
children: isEmpty ? children : null
|
|
2073
2091
|
}
|
|
2074
2092
|
);
|
|
@@ -2083,7 +2101,7 @@ var ItemBreadcrumb = () => {
|
|
|
2083
2101
|
] }, index)) });
|
|
2084
2102
|
};
|
|
2085
2103
|
var DropdownMenuItem = React15.forwardRef(({ className, inset, variant = "neutral", textValue, children, ...props }, ref) => {
|
|
2086
|
-
const visible = useFilterableItem(textValue, children);
|
|
2104
|
+
const visible = useFilterableItem(useDropdownMenuSearch(), textValue, children);
|
|
2087
2105
|
if (!visible) return null;
|
|
2088
2106
|
return /* @__PURE__ */ jsxs(
|
|
2089
2107
|
DropdownMenuPrimitive.Item,
|
|
@@ -2107,7 +2125,7 @@ var DropdownMenuItem = React15.forwardRef(({ className, inset, variant = "neutra
|
|
|
2107
2125
|
});
|
|
2108
2126
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
2109
2127
|
var DropdownMenuCheckboxItem = React15.forwardRef(({ className, children, checked, textValue, ...props }, ref) => {
|
|
2110
|
-
const visible = useFilterableItem(textValue, children);
|
|
2128
|
+
const visible = useFilterableItem(useDropdownMenuSearch(), textValue, children);
|
|
2111
2129
|
if (!visible) return null;
|
|
2112
2130
|
return /* @__PURE__ */ jsxs(
|
|
2113
2131
|
DropdownMenuPrimitive.CheckboxItem,
|
|
@@ -2127,7 +2145,7 @@ var DropdownMenuCheckboxItem = React15.forwardRef(({ className, children, checke
|
|
|
2127
2145
|
});
|
|
2128
2146
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
2129
2147
|
var DropdownMenuRadioItem = React15.forwardRef(({ className, children, textValue, ...props }, ref) => {
|
|
2130
|
-
const visible = useFilterableItem(textValue, children);
|
|
2148
|
+
const visible = useFilterableItem(useDropdownMenuSearch(), textValue, children);
|
|
2131
2149
|
if (!visible) return null;
|
|
2132
2150
|
return /* @__PURE__ */ jsxs(
|
|
2133
2151
|
DropdownMenuPrimitive.RadioItem,
|
|
@@ -2216,6 +2234,10 @@ var FilterDropdown = ({
|
|
|
2216
2234
|
const filteredOptions = options.filter(
|
|
2217
2235
|
(option) => option.value && option.value.trim() !== "" && option.label && option.label.trim() !== ""
|
|
2218
2236
|
);
|
|
2237
|
+
const clearAll = (className) => (
|
|
2238
|
+
// An empty textValue keeps this out of search results, so Enter can't clear every filter
|
|
2239
|
+
/* @__PURE__ */ jsx(DropdownMenuItem, { textValue: "", onSelect: onClearAll, className, children: /* @__PURE__ */ jsx("span", { className: buttonVariants({ variant: "link", size: "sm" }), children: "Clear all" }) })
|
|
2240
|
+
);
|
|
2219
2241
|
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
2220
2242
|
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, disabled, children: /* @__PURE__ */ jsxs(
|
|
2221
2243
|
Button,
|
|
@@ -2239,14 +2261,16 @@ var FilterDropdown = ({
|
|
|
2239
2261
|
className: cn(styles24["dropdown-menu-content"], contentClassName),
|
|
2240
2262
|
children: [
|
|
2241
2263
|
searchable && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2242
|
-
/* @__PURE__ */ jsx(DropdownMenuSearch, { placeholder: searchPlaceholder }),
|
|
2264
|
+
/* @__PURE__ */ jsx(DropdownMenuSearch, { alwaysVisible: true, placeholder: searchPlaceholder, "aria-label": label }),
|
|
2243
2265
|
/* @__PURE__ */ jsx(DropdownMenuEmpty, { children: emptyPlaceholder })
|
|
2244
2266
|
] }),
|
|
2245
|
-
/* @__PURE__ */ jsxs(
|
|
2246
|
-
"
|
|
2247
|
-
|
|
2267
|
+
!searchable && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2268
|
+
/* @__PURE__ */ jsxs(DropdownMenuLabel, { className: styles24["filters-header"], children: [
|
|
2269
|
+
"Filters",
|
|
2270
|
+
hasSelectedFilters && clearAll(styles24["clear-all-inline"])
|
|
2271
|
+
] }),
|
|
2272
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {})
|
|
2248
2273
|
] }),
|
|
2249
|
-
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
2250
2274
|
filteredOptions.map((option) => {
|
|
2251
2275
|
const isSelected = selectedFilters.includes(option.value);
|
|
2252
2276
|
return /* @__PURE__ */ jsx(
|
|
@@ -2259,7 +2283,11 @@ var FilterDropdown = ({
|
|
|
2259
2283
|
},
|
|
2260
2284
|
option.value
|
|
2261
2285
|
);
|
|
2262
|
-
})
|
|
2286
|
+
}),
|
|
2287
|
+
searchable && hasSelectedFilters && /* @__PURE__ */ jsxs("div", { className: styles24["clear-all-footer"], children: [
|
|
2288
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
2289
|
+
clearAll(styles24["clear-all"])
|
|
2290
|
+
] })
|
|
2263
2291
|
]
|
|
2264
2292
|
}
|
|
2265
2293
|
)
|
|
@@ -2607,8 +2635,59 @@ var NotFound = ({
|
|
|
2607
2635
|
var CheckIcon3 = Check;
|
|
2608
2636
|
var ChevronDownIcon2 = ChevronDown;
|
|
2609
2637
|
var ChevronUpIcon = ChevronUp;
|
|
2610
|
-
var
|
|
2611
|
-
var
|
|
2638
|
+
var SearchIcon3 = Search;
|
|
2639
|
+
var SEARCH_INPUT_SELECTOR = "[data-select-search]";
|
|
2640
|
+
var NAVIGABLE_OPTION_SELECTOR = '[role="option"]:not([data-disabled]):not([hidden])';
|
|
2641
|
+
var RADIX_HANDLED_SEARCH_KEYS = ["ArrowDown", "ArrowUp", "Escape", "Tab"];
|
|
2642
|
+
var SelectSearchContext = React15.createContext(null);
|
|
2643
|
+
var useSelectSearch = () => React15.useContext(SelectSearchContext);
|
|
2644
|
+
var useIsSearching2 = () => isSearchActive(useSelectSearch());
|
|
2645
|
+
var SelectGroupMatchContext = React15.createContext(null);
|
|
2646
|
+
var Select = ({
|
|
2647
|
+
open,
|
|
2648
|
+
onOpenChange,
|
|
2649
|
+
...props
|
|
2650
|
+
}) => {
|
|
2651
|
+
const search = useListSearchState(open);
|
|
2652
|
+
const { resetForOpen } = search;
|
|
2653
|
+
const interactedRef = React15.useRef(false);
|
|
2654
|
+
const markInteracted = React15.useCallback(() => {
|
|
2655
|
+
interactedRef.current = true;
|
|
2656
|
+
}, []);
|
|
2657
|
+
const interactedSinceOpen = React15.useCallback(() => interactedRef.current, []);
|
|
2658
|
+
React15.useEffect(() => {
|
|
2659
|
+
if (open) interactedRef.current = false;
|
|
2660
|
+
}, [open]);
|
|
2661
|
+
const handleOpenChange = React15.useCallback(
|
|
2662
|
+
(nextOpen) => {
|
|
2663
|
+
if (nextOpen) {
|
|
2664
|
+
resetForOpen();
|
|
2665
|
+
interactedRef.current = false;
|
|
2666
|
+
}
|
|
2667
|
+
onOpenChange?.(nextOpen);
|
|
2668
|
+
},
|
|
2669
|
+
[onOpenChange, resetForOpen]
|
|
2670
|
+
);
|
|
2671
|
+
const value = React15.useMemo(
|
|
2672
|
+
() => ({ ...search, markInteracted, interactedSinceOpen }),
|
|
2673
|
+
[search, markInteracted, interactedSinceOpen]
|
|
2674
|
+
);
|
|
2675
|
+
return /* @__PURE__ */ jsx(SelectSearchContext.Provider, { value, children: /* @__PURE__ */ jsx(SelectPrimitive.Root, { open, onOpenChange: handleOpenChange, ...props }) });
|
|
2676
|
+
};
|
|
2677
|
+
Select.displayName = "Select";
|
|
2678
|
+
var SelectGroup = React15.forwardRef(({ hidden, ...props }, ref) => {
|
|
2679
|
+
const searching = useIsSearching2();
|
|
2680
|
+
const registry = useMatchRegistry();
|
|
2681
|
+
return /* @__PURE__ */ jsx(SelectGroupMatchContext.Provider, { value: registry, children: /* @__PURE__ */ jsx(
|
|
2682
|
+
SelectPrimitive.Group,
|
|
2683
|
+
{
|
|
2684
|
+
ref,
|
|
2685
|
+
...props,
|
|
2686
|
+
hidden: hidden || searching && registry.matchCount === 0 || void 0
|
|
2687
|
+
}
|
|
2688
|
+
) });
|
|
2689
|
+
});
|
|
2690
|
+
SelectGroup.displayName = SelectPrimitive.Group.displayName;
|
|
2612
2691
|
var SelectValue = SelectPrimitive.Value;
|
|
2613
2692
|
var SelectTrigger = React15.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(SelectPrimitive.Trigger, { ref, className: cn(styles35["select-trigger"], className), ...props, children: [
|
|
2614
2693
|
children,
|
|
@@ -2641,50 +2720,217 @@ var selectContentElevationVariants = generateElevationVariants(
|
|
|
2641
2720
|
"select-content",
|
|
2642
2721
|
ELEVATION.OVERLAY
|
|
2643
2722
|
);
|
|
2644
|
-
var SelectContent = React15.forwardRef(
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2723
|
+
var SelectContent = React15.forwardRef(
|
|
2724
|
+
({
|
|
2725
|
+
className,
|
|
2726
|
+
children,
|
|
2727
|
+
position = "popper",
|
|
2728
|
+
elevation = ELEVATION.OVERLAY,
|
|
2729
|
+
onKeyDown,
|
|
2730
|
+
onKeyDownCapture,
|
|
2731
|
+
onPointerMoveCapture,
|
|
2732
|
+
onFocus,
|
|
2733
|
+
...props
|
|
2734
|
+
}, ref) => {
|
|
2735
|
+
const ctx = useSelectSearch();
|
|
2736
|
+
const setListId = ctx?.setListId;
|
|
2737
|
+
const searching = isSearchActive(ctx);
|
|
2738
|
+
const resultCount = ctx?.matchCount ?? 0;
|
|
2739
|
+
const composedContentRef = React15.useCallback(
|
|
2740
|
+
(node) => {
|
|
2741
|
+
assignRefs(node, ref);
|
|
2742
|
+
setListId?.(node?.id || void 0);
|
|
2743
|
+
},
|
|
2744
|
+
[ref, setListId]
|
|
2745
|
+
);
|
|
2746
|
+
const handleFocus = (event) => {
|
|
2747
|
+
onFocus?.(event);
|
|
2748
|
+
if (!ctx?.enabled || !ctx.visible || ctx.interactedSinceOpen()) return;
|
|
2749
|
+
if (event.target.closest(SEARCH_INPUT_SELECTOR)) return;
|
|
2750
|
+
ctx.requestFocus();
|
|
2751
|
+
};
|
|
2752
|
+
const handleKeyDown = (event) => {
|
|
2753
|
+
onKeyDown?.(event);
|
|
2754
|
+
if (!ctx?.enabled || event.defaultPrevented) return;
|
|
2755
|
+
const target = event.target;
|
|
2756
|
+
if (target?.closest(SEARCH_INPUT_SELECTOR)) return;
|
|
2757
|
+
if (event.key === "ArrowUp" && ctx.visible) {
|
|
2758
|
+
const firstOption = event.currentTarget.querySelector(NAVIGABLE_OPTION_SELECTOR);
|
|
2759
|
+
if (firstOption && firstOption === target?.closest(NAVIGABLE_OPTION_SELECTOR)) {
|
|
2760
|
+
event.preventDefault();
|
|
2761
|
+
ctx.requestFocus();
|
|
2762
|
+
return;
|
|
2763
|
+
}
|
|
2764
|
+
}
|
|
2765
|
+
if (event.key === "Backspace" && ctx.visible && ctx.query) {
|
|
2766
|
+
event.preventDefault();
|
|
2767
|
+
ctx.setQuery(ctx.query.slice(0, -1));
|
|
2768
|
+
ctx.requestFocus();
|
|
2769
|
+
return;
|
|
2770
|
+
}
|
|
2771
|
+
if (!isPrintableKey(event)) return;
|
|
2772
|
+
event.preventDefault();
|
|
2773
|
+
if (!ctx.visible) {
|
|
2774
|
+
ctx.reveal(event.key);
|
|
2775
|
+
} else {
|
|
2776
|
+
ctx.setQuery(ctx.query + event.key);
|
|
2777
|
+
ctx.requestFocus();
|
|
2778
|
+
}
|
|
2779
|
+
};
|
|
2780
|
+
return /* @__PURE__ */ jsx(SelectPortal, { children: /* @__PURE__ */ jsxs(
|
|
2781
|
+
SelectPrimitive.Content,
|
|
2782
|
+
{
|
|
2783
|
+
ref: composedContentRef,
|
|
2784
|
+
className: cn(
|
|
2785
|
+
styles35["select-content"],
|
|
2786
|
+
position === "popper" && styles35["select-content--popper"],
|
|
2787
|
+
selectContentElevationVariants({ elevation }),
|
|
2788
|
+
className
|
|
2789
|
+
),
|
|
2790
|
+
position,
|
|
2791
|
+
onFocus: handleFocus,
|
|
2792
|
+
onKeyDown: handleKeyDown,
|
|
2793
|
+
onKeyDownCapture: (event) => {
|
|
2794
|
+
onKeyDownCapture?.(event);
|
|
2795
|
+
ctx?.markInteracted();
|
|
2796
|
+
},
|
|
2797
|
+
onPointerMoveCapture: (event) => {
|
|
2798
|
+
onPointerMoveCapture?.(event);
|
|
2799
|
+
ctx?.markInteracted();
|
|
2800
|
+
},
|
|
2801
|
+
...props,
|
|
2802
|
+
children: [
|
|
2803
|
+
ctx?.enabled ? /* @__PURE__ */ jsx("div", { className: styles35["select-sr-status"], role: "status", "aria-live": "polite", children: searching && resultCount > 0 ? formatResultCount(resultCount) : null }) : null,
|
|
2804
|
+
/* @__PURE__ */ jsx(SelectScrollUpButton, {}),
|
|
2805
|
+
/* @__PURE__ */ jsx(
|
|
2806
|
+
SelectPrimitive.Viewport,
|
|
2807
|
+
{
|
|
2808
|
+
className: cn(
|
|
2809
|
+
styles35["select-viewport"],
|
|
2810
|
+
position === "popper" && styles35["select-viewport--popper"]
|
|
2811
|
+
),
|
|
2812
|
+
children
|
|
2813
|
+
}
|
|
2814
|
+
),
|
|
2815
|
+
/* @__PURE__ */ jsx(SelectScrollDownButton, {})
|
|
2816
|
+
]
|
|
2817
|
+
}
|
|
2818
|
+
) });
|
|
2819
|
+
}
|
|
2820
|
+
);
|
|
2821
|
+
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
2822
|
+
var SelectSearch = React15.forwardRef(
|
|
2823
|
+
({
|
|
2824
|
+
className,
|
|
2825
|
+
placeholder = "Search...",
|
|
2826
|
+
icon,
|
|
2827
|
+
alwaysVisible = true,
|
|
2828
|
+
onKeyDown,
|
|
2829
|
+
"aria-label": ariaLabel,
|
|
2830
|
+
...props
|
|
2831
|
+
}, forwardedRef) => {
|
|
2832
|
+
const ctx = useSelectSearch();
|
|
2833
|
+
if (!ctx) {
|
|
2834
|
+
throw new Error("SelectSearch must be used within a Select");
|
|
2835
|
+
}
|
|
2836
|
+
const { ref, isRendered } = useSearchInput(ctx, alwaysVisible, forwardedRef);
|
|
2837
|
+
if (!isRendered) return null;
|
|
2838
|
+
return /* @__PURE__ */ jsxs("div", { className: styles35["select-search"], children: [
|
|
2839
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: styles35["select-search-icon"], children: icon ?? /* @__PURE__ */ jsx(SearchIcon3, { className: cn(styles35["select-icon"], styles35["select-icon--sm"]) }) }),
|
|
2658
2840
|
/* @__PURE__ */ jsx(
|
|
2659
|
-
|
|
2841
|
+
"input",
|
|
2660
2842
|
{
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
),
|
|
2665
|
-
|
|
2843
|
+
...props,
|
|
2844
|
+
ref,
|
|
2845
|
+
"data-select-search": "",
|
|
2846
|
+
className: cn(styles35["select-search-input"], className),
|
|
2847
|
+
value: ctx.query,
|
|
2848
|
+
placeholder,
|
|
2849
|
+
"aria-label": ariaLabel ?? placeholder,
|
|
2850
|
+
role: "searchbox",
|
|
2851
|
+
"aria-controls": ctx.listId,
|
|
2852
|
+
"aria-autocomplete": "list",
|
|
2853
|
+
onChange: (event) => ctx.setQuery(event.target.value),
|
|
2854
|
+
onKeyDown: (event) => {
|
|
2855
|
+
onKeyDown?.(event);
|
|
2856
|
+
if (event.key === "Enter" && !event.defaultPrevented && isSearchActive(ctx)) {
|
|
2857
|
+
event.preventDefault();
|
|
2858
|
+
event.stopPropagation();
|
|
2859
|
+
const firstOption = event.currentTarget.closest('[role="listbox"]')?.querySelector(NAVIGABLE_OPTION_SELECTOR);
|
|
2860
|
+
firstOption?.dispatchEvent(
|
|
2861
|
+
new KeyboardEvent("keydown", { key: "Enter", bubbles: true })
|
|
2862
|
+
);
|
|
2863
|
+
return;
|
|
2864
|
+
}
|
|
2865
|
+
if (!RADIX_HANDLED_SEARCH_KEYS.includes(event.key)) event.stopPropagation();
|
|
2866
|
+
}
|
|
2666
2867
|
}
|
|
2667
|
-
)
|
|
2668
|
-
|
|
2669
|
-
]
|
|
2868
|
+
)
|
|
2869
|
+
] });
|
|
2670
2870
|
}
|
|
2671
|
-
)
|
|
2672
|
-
|
|
2673
|
-
var
|
|
2871
|
+
);
|
|
2872
|
+
SelectSearch.displayName = "SelectSearch";
|
|
2873
|
+
var SelectEmpty = ({ className, children, ...props }) => {
|
|
2874
|
+
const ctx = useSelectSearch();
|
|
2875
|
+
if (!ctx) return null;
|
|
2876
|
+
const isEmpty = isSearchEmpty(ctx);
|
|
2877
|
+
return /* @__PURE__ */ jsx(
|
|
2878
|
+
"div",
|
|
2879
|
+
{
|
|
2880
|
+
...props,
|
|
2881
|
+
role: "status",
|
|
2882
|
+
"aria-live": "polite",
|
|
2883
|
+
className: isEmpty ? cn(styles35["select-empty"], className) : void 0,
|
|
2884
|
+
children: isEmpty ? children : null
|
|
2885
|
+
}
|
|
2886
|
+
);
|
|
2887
|
+
};
|
|
2888
|
+
SelectEmpty.displayName = "SelectEmpty";
|
|
2889
|
+
var SelectLabel = React15.forwardRef(({ className, hidden, ...props }, ref) => {
|
|
2890
|
+
const searching = useIsSearching2();
|
|
2891
|
+
return /* @__PURE__ */ jsx(
|
|
2892
|
+
SelectPrimitive.Label,
|
|
2893
|
+
{
|
|
2894
|
+
ref,
|
|
2895
|
+
className: cn(styles35["select-label"], className),
|
|
2896
|
+
...props,
|
|
2897
|
+
hidden: hidden || searching || void 0
|
|
2898
|
+
}
|
|
2899
|
+
);
|
|
2900
|
+
});
|
|
2674
2901
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
2675
|
-
var SelectItem = React15.forwardRef(({ className, children, ...props }, ref) =>
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2902
|
+
var SelectItem = React15.forwardRef(({ className, children, textValue, hidden, ...props }, ref) => {
|
|
2903
|
+
const search = useSelectSearch();
|
|
2904
|
+
const group = React15.useContext(SelectGroupMatchContext);
|
|
2905
|
+
const matches = useFilterableItem(search, textValue, children, group);
|
|
2906
|
+
return /* @__PURE__ */ jsxs(
|
|
2907
|
+
SelectPrimitive.Item,
|
|
2908
|
+
{
|
|
2909
|
+
ref,
|
|
2910
|
+
className: cn(styles35["select-item"], className),
|
|
2911
|
+
...props,
|
|
2912
|
+
textValue,
|
|
2913
|
+
hidden: hidden || !matches || void 0,
|
|
2914
|
+
children: [
|
|
2915
|
+
/* @__PURE__ */ jsx("span", { className: styles35["select-item-indicator"], children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon3, { className: styles35["select-icon"] }) }) }),
|
|
2916
|
+
/* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })
|
|
2917
|
+
]
|
|
2918
|
+
}
|
|
2919
|
+
);
|
|
2920
|
+
});
|
|
2679
2921
|
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
2680
|
-
var SelectSeparator = React15.forwardRef(({ className, ...props }, ref) =>
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
)
|
|
2922
|
+
var SelectSeparator = React15.forwardRef(({ className, ...props }, ref) => {
|
|
2923
|
+
const searching = useIsSearching2();
|
|
2924
|
+
if (searching) return null;
|
|
2925
|
+
return /* @__PURE__ */ jsx(
|
|
2926
|
+
SelectPrimitive.Separator,
|
|
2927
|
+
{
|
|
2928
|
+
ref,
|
|
2929
|
+
className: cn(styles35["select-separator"], className),
|
|
2930
|
+
...props
|
|
2931
|
+
}
|
|
2932
|
+
);
|
|
2933
|
+
});
|
|
2688
2934
|
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
2689
2935
|
var ChevronLeftIcon2 = ChevronLeft;
|
|
2690
2936
|
var ChevronRightIcon3 = ChevronRight;
|
|
@@ -3132,11 +3378,13 @@ var RadioDropdown = ({
|
|
|
3132
3378
|
] }) }),
|
|
3133
3379
|
/* @__PURE__ */ jsxs(DropdownMenuContent, { align: "end", className: styles41["dropdown-menu-content"], children: [
|
|
3134
3380
|
searchable && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3135
|
-
/* @__PURE__ */ jsx(DropdownMenuSearch, { placeholder: searchPlaceholder }),
|
|
3381
|
+
/* @__PURE__ */ jsx(DropdownMenuSearch, { alwaysVisible: true, placeholder: searchPlaceholder, "aria-label": label }),
|
|
3136
3382
|
/* @__PURE__ */ jsx(DropdownMenuEmpty, { children: emptyPlaceholder })
|
|
3137
3383
|
] }),
|
|
3138
|
-
/* @__PURE__ */
|
|
3139
|
-
|
|
3384
|
+
!searchable && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3385
|
+
/* @__PURE__ */ jsx(DropdownMenuLabel, { children: label }),
|
|
3386
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {})
|
|
3387
|
+
] }),
|
|
3140
3388
|
/* @__PURE__ */ jsx(DropdownMenuRadioGroup, { value: selectedValue, onValueChange: onSelect, children: filteredOptions.map((option) => {
|
|
3141
3389
|
const hasCount = option.count !== void 0;
|
|
3142
3390
|
return /* @__PURE__ */ jsxs(DropdownMenuRadioItem, { value: option.value, children: [
|
|
@@ -3193,7 +3441,7 @@ var ScrollBar = React15.forwardRef(({ className, orientation = "vertical", ...pr
|
|
|
3193
3441
|
}
|
|
3194
3442
|
));
|
|
3195
3443
|
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
3196
|
-
var
|
|
3444
|
+
var SearchIcon4 = Search;
|
|
3197
3445
|
var SearchBar = ({
|
|
3198
3446
|
searchQuery,
|
|
3199
3447
|
setSearchQuery,
|
|
@@ -3213,7 +3461,7 @@ var SearchBar = ({
|
|
|
3213
3461
|
value: searchQuery,
|
|
3214
3462
|
onChange: handleChange,
|
|
3215
3463
|
className: styles44["input"],
|
|
3216
|
-
prefix: /* @__PURE__ */ jsx(
|
|
3464
|
+
prefix: /* @__PURE__ */ jsx(SearchIcon4, { className: styles44["search-icon"] }),
|
|
3217
3465
|
suffix: searchQuery && /* @__PURE__ */ jsx(
|
|
3218
3466
|
IconButton,
|
|
3219
3467
|
{
|
|
@@ -3381,7 +3629,7 @@ var SheetDescription = React15.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
3381
3629
|
}
|
|
3382
3630
|
));
|
|
3383
3631
|
SheetDescription.displayName = DialogPrimitive.Description.displayName;
|
|
3384
|
-
var SheetContent = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn(styles48["sheet-body"],
|
|
3632
|
+
var SheetContent = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn(styles48["sheet-body"], className), ...props });
|
|
3385
3633
|
SheetContent.displayName = "SheetContent";
|
|
3386
3634
|
function Skeleton({ className, ...props }) {
|
|
3387
3635
|
return /* @__PURE__ */ jsx("div", { className: cn(styles49["skeleton"], className), ...props });
|
|
@@ -4298,6 +4546,6 @@ var useTheme = () => {
|
|
|
4298
4546
|
return [theme, setTheme];
|
|
4299
4547
|
};
|
|
4300
4548
|
|
|
4301
|
-
export { Alert, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Badge, BarGraph, BarGraphSegment, BgGradient, Button, CODE_BLOCK_ATTRIBUTE, Card, CardContent, CardContentHeader, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CodeBlock, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ControlStatusBadge, CopyButton, DateRangePicker, Dialog, DialogClose, DialogContainer, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogHeaderIcon, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DisplayField, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerHeaderActions, DrawerInnerContent, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuEmpty, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSearch, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, ELEVATION, EmptyTableState, FilterDropdown, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, FormatDate, Heading, Icon, IconButton, InfoCard, Input, Label2 as Label, ListOrGridViewToggle, LoadingOverlay, MetricCard, MotionCollapsibleContent, NotFound, PORTAL_ROOT_ID, Pagination, PanelLabel, Popover, PopoverContent, PopoverTrigger, PortalContainerProvider, Progress, ProgressIndicator, ProgressIndicatorStep, RadialGraph, RadioDropdown, RadioGroup2 as RadioGroup, RadioGroupItem, ResourceBadge, ScrollArea, ScrollBar, SearchBar, SectionHeading, SegmentedControls, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator3 as Separator, Sheet, SheetClose, SheetContainer, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetHeaderIcon, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, SortButton, SortSelector, Spinner, Switch, TableBody, TableCaption, TableCell, TableContainer, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContainer, TabsContent, TabsList, TabsTrigger, Textarea, ThemeProvider, Toast, ToastAction, ToastClose, ToastContainer, ToastDescription, ToastProvider, ToastRoot, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TruncatedDescription, badgeVariants, buttonVariants, reducer, scheduleHighlight, toast, useFormField, usePortalContainer, useTheme, useToast };
|
|
4549
|
+
export { Alert, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Badge, BarGraph, BarGraphSegment, BgGradient, Button, CODE_BLOCK_ATTRIBUTE, Card, CardContent, CardContentHeader, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CodeBlock, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ControlStatusBadge, CopyButton, DateRangePicker, Dialog, DialogClose, DialogContainer, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogHeaderIcon, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DisplayField, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerHeaderActions, DrawerInnerContent, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuEmpty, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSearch, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, ELEVATION, EmptyTableState, FilterDropdown, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, FormatDate, Heading, Icon, IconButton, InfoCard, Input, Label2 as Label, ListOrGridViewToggle, LoadingOverlay, MetricCard, MotionCollapsibleContent, NotFound, PORTAL_ROOT_ID, Pagination, PanelLabel, Popover, PopoverContent, PopoverTrigger, PortalContainerProvider, Progress, ProgressIndicator, ProgressIndicatorStep, RadialGraph, RadioDropdown, RadioGroup2 as RadioGroup, RadioGroupItem, ResourceBadge, ScrollArea, ScrollBar, SearchBar, SectionHeading, SegmentedControls, Select, SelectContent, SelectEmpty, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSearch, SelectSeparator, SelectTrigger, SelectValue, Separator3 as Separator, Sheet, SheetClose, SheetContainer, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetHeaderIcon, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, SortButton, SortSelector, Spinner, Switch, TableBody, TableCaption, TableCell, TableContainer, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContainer, TabsContent, TabsList, TabsTrigger, Textarea, ThemeProvider, Toast, ToastAction, ToastClose, ToastContainer, ToastDescription, ToastProvider, ToastRoot, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TruncatedDescription, badgeVariants, buttonVariants, reducer, scheduleHighlight, toast, useFormField, usePortalContainer, useTheme, useToast };
|
|
4302
4550
|
//# sourceMappingURL=index.js.map
|
|
4303
4551
|
//# sourceMappingURL=index.js.map
|