@eqtylab/equality 4.2.0 → 4.3.1
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 +41 -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/index.cjs +458 -196
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -4
- package/dist/index.d.ts +18 -4
- package/dist/index.js +457 -197
- 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.module.css.module.css +222 -25
- package/package.json +8 -2
package/dist/index.js
CHANGED
|
@@ -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]
|
|
1914
|
+
[onOpenChange, resetForOpen]
|
|
1842
1915
|
);
|
|
1843
|
-
|
|
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
|
-
]
|
|
1871
|
-
);
|
|
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 });
|
|
@@ -1919,11 +1964,16 @@ var DropdownMenuSub = ({
|
|
|
1919
1964
|
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Sub, { ...props, children });
|
|
1920
1965
|
};
|
|
1921
1966
|
var MENU_ITEM_SELECTOR = '[role="menuitem"]:not([data-disabled]),[role="menuitemcheckbox"]:not([data-disabled]),[role="menuitemradio"]:not([data-disabled])';
|
|
1922
|
-
var DropdownMenuContent = React15.forwardRef(({ className, sideOffset = 4, onKeyDown, children, ...props }, ref) => {
|
|
1967
|
+
var DropdownMenuContent = React15.forwardRef(({ className, sideOffset = 4, onKeyDown, onFocus, 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;
|
|
1972
|
+
const openFocusHandledRef = React15.useRef(false);
|
|
1973
|
+
const searchVisible = ctx?.visible ?? false;
|
|
1974
|
+
React15.useEffect(() => {
|
|
1975
|
+
if (!searchVisible) openFocusHandledRef.current = false;
|
|
1976
|
+
}, [searchVisible]);
|
|
1927
1977
|
const composedContentRef = React15.useCallback(
|
|
1928
1978
|
(node) => {
|
|
1929
1979
|
assignRefs(node, ref);
|
|
@@ -1937,6 +1987,13 @@ var DropdownMenuContent = React15.forwardRef(({ className, sideOffset = 4, onKey
|
|
|
1937
1987
|
ref: composedContentRef,
|
|
1938
1988
|
sideOffset,
|
|
1939
1989
|
className: cn(styles22["dropdown-menu-content"], className),
|
|
1990
|
+
onFocus: (event) => {
|
|
1991
|
+
onFocus?.(event);
|
|
1992
|
+
if (openFocusHandledRef.current) return;
|
|
1993
|
+
openFocusHandledRef.current = true;
|
|
1994
|
+
if (event.target !== event.currentTarget || !ctx?.enabled || !ctx.visible) return;
|
|
1995
|
+
ctx.requestFocus();
|
|
1996
|
+
},
|
|
1940
1997
|
onKeyDown: (event) => {
|
|
1941
1998
|
onKeyDown?.(event);
|
|
1942
1999
|
if (!ctx?.enabled) return;
|
|
@@ -1954,8 +2011,7 @@ var DropdownMenuContent = React15.forwardRef(({ className, sideOffset = 4, onKey
|
|
|
1954
2011
|
}
|
|
1955
2012
|
}
|
|
1956
2013
|
if (event.defaultPrevented) return;
|
|
1957
|
-
|
|
1958
|
-
if (!isPrintable) return;
|
|
2014
|
+
if (!isPrintableKey(event)) return;
|
|
1959
2015
|
const target = event.target;
|
|
1960
2016
|
if (target?.closest?.("[data-dropdown-search]")) return;
|
|
1961
2017
|
event.preventDefault();
|
|
@@ -1968,28 +2024,20 @@ var DropdownMenuContent = React15.forwardRef(({ className, sideOffset = 4, onKey
|
|
|
1968
2024
|
},
|
|
1969
2025
|
...props,
|
|
1970
2026
|
children: [
|
|
1971
|
-
ctx?.enabled ? /* @__PURE__ */ jsx("div", { className: styles22["dropdown-menu-sr-status"], role: "status", "aria-live": "polite", children: searching && resultCount > 0 ?
|
|
2027
|
+
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
2028
|
children
|
|
1973
2029
|
]
|
|
1974
2030
|
}
|
|
1975
2031
|
) });
|
|
1976
2032
|
});
|
|
1977
2033
|
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
2034
|
var DropdownMenuSearch = React15.forwardRef(
|
|
1985
2035
|
({
|
|
1986
2036
|
className,
|
|
1987
2037
|
placeholder = "Search...",
|
|
1988
2038
|
icon,
|
|
1989
|
-
/* Render the input immediately instead of revealing on first keypress */
|
|
1990
2039
|
alwaysVisible = false,
|
|
1991
2040
|
onKeyDown,
|
|
1992
|
-
/* Pulled out of props so the placeholder fallback below isn't overwritten by the spread */
|
|
1993
2041
|
"aria-label": ariaLabel,
|
|
1994
2042
|
...props
|
|
1995
2043
|
}, forwardedRef) => {
|
|
@@ -1997,32 +2045,15 @@ var DropdownMenuSearch = React15.forwardRef(
|
|
|
1997
2045
|
if (!ctx) {
|
|
1998
2046
|
throw new Error("DropdownMenuSearch must be used within a DropdownMenu");
|
|
1999
2047
|
}
|
|
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;
|
|
2048
|
+
const { ref, isRendered } = useSearchInput(ctx, alwaysVisible, forwardedRef);
|
|
2049
|
+
if (!isRendered) return null;
|
|
2018
2050
|
return /* @__PURE__ */ jsxs("div", { className: styles22["dropdown-menu-search"], children: [
|
|
2019
2051
|
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: styles22["dropdown-menu-item-icon"], children: icon ?? /* @__PURE__ */ jsx(SearchIcon2, { className: styles22["icon-size"] }) }),
|
|
2020
2052
|
/* @__PURE__ */ jsx(
|
|
2021
2053
|
"input",
|
|
2022
2054
|
{
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
},
|
|
2055
|
+
...props,
|
|
2056
|
+
ref,
|
|
2026
2057
|
"data-dropdown-search": "",
|
|
2027
2058
|
className: cn(styles22["dropdown-menu-search-input"], className),
|
|
2028
2059
|
value: ctx.query,
|
|
@@ -2034,19 +2065,19 @@ var DropdownMenuSearch = React15.forwardRef(
|
|
|
2034
2065
|
onChange: (event) => ctx.setQuery(event.target.value),
|
|
2035
2066
|
onKeyDown: (event) => {
|
|
2036
2067
|
onKeyDown?.(event);
|
|
2037
|
-
if (event.key === "
|
|
2068
|
+
if (event.key === "Enter" && !isSearchActive(ctx)) return;
|
|
2069
|
+
if (event.key === "ArrowDown" || event.key === "ArrowUp" || event.key === "Enter") {
|
|
2038
2070
|
const menu = event.currentTarget.closest('[role="menu"]');
|
|
2039
2071
|
const items = menu ? Array.from(menu.querySelectorAll(MENU_ITEM_SELECTOR)) : [];
|
|
2040
|
-
if (items.length)
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2072
|
+
if (!items.length || event.defaultPrevented) return;
|
|
2073
|
+
event.preventDefault();
|
|
2074
|
+
if (event.key === "Enter") items[0].click();
|
|
2075
|
+
else (event.key === "ArrowUp" ? items[items.length - 1] : items[0]).focus();
|
|
2044
2076
|
return;
|
|
2045
2077
|
}
|
|
2046
|
-
if (["
|
|
2078
|
+
if (["Escape", "Tab"].includes(event.key)) return;
|
|
2047
2079
|
event.stopPropagation();
|
|
2048
|
-
}
|
|
2049
|
-
...props
|
|
2080
|
+
}
|
|
2050
2081
|
}
|
|
2051
2082
|
)
|
|
2052
2083
|
] });
|
|
@@ -2060,15 +2091,14 @@ var DropdownMenuEmpty = ({
|
|
|
2060
2091
|
}) => {
|
|
2061
2092
|
const ctx = useDropdownMenuSearch();
|
|
2062
2093
|
if (!ctx) return null;
|
|
2063
|
-
const
|
|
2064
|
-
const isEmpty = !!query && ctx.matchCount === 0;
|
|
2094
|
+
const isEmpty = isSearchEmpty(ctx);
|
|
2065
2095
|
return /* @__PURE__ */ jsx(
|
|
2066
2096
|
"div",
|
|
2067
2097
|
{
|
|
2098
|
+
...props,
|
|
2068
2099
|
role: "status",
|
|
2069
2100
|
"aria-live": "polite",
|
|
2070
2101
|
className: isEmpty ? cn(styles22["dropdown-menu-empty"], className) : void 0,
|
|
2071
|
-
...props,
|
|
2072
2102
|
children: isEmpty ? children : null
|
|
2073
2103
|
}
|
|
2074
2104
|
);
|
|
@@ -2083,7 +2113,7 @@ var ItemBreadcrumb = () => {
|
|
|
2083
2113
|
] }, index)) });
|
|
2084
2114
|
};
|
|
2085
2115
|
var DropdownMenuItem = React15.forwardRef(({ className, inset, variant = "neutral", textValue, children, ...props }, ref) => {
|
|
2086
|
-
const visible = useFilterableItem(textValue, children);
|
|
2116
|
+
const visible = useFilterableItem(useDropdownMenuSearch(), textValue, children);
|
|
2087
2117
|
if (!visible) return null;
|
|
2088
2118
|
return /* @__PURE__ */ jsxs(
|
|
2089
2119
|
DropdownMenuPrimitive.Item,
|
|
@@ -2107,7 +2137,7 @@ var DropdownMenuItem = React15.forwardRef(({ className, inset, variant = "neutra
|
|
|
2107
2137
|
});
|
|
2108
2138
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
2109
2139
|
var DropdownMenuCheckboxItem = React15.forwardRef(({ className, children, checked, textValue, ...props }, ref) => {
|
|
2110
|
-
const visible = useFilterableItem(textValue, children);
|
|
2140
|
+
const visible = useFilterableItem(useDropdownMenuSearch(), textValue, children);
|
|
2111
2141
|
if (!visible) return null;
|
|
2112
2142
|
return /* @__PURE__ */ jsxs(
|
|
2113
2143
|
DropdownMenuPrimitive.CheckboxItem,
|
|
@@ -2127,7 +2157,7 @@ var DropdownMenuCheckboxItem = React15.forwardRef(({ className, children, checke
|
|
|
2127
2157
|
});
|
|
2128
2158
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
2129
2159
|
var DropdownMenuRadioItem = React15.forwardRef(({ className, children, textValue, ...props }, ref) => {
|
|
2130
|
-
const visible = useFilterableItem(textValue, children);
|
|
2160
|
+
const visible = useFilterableItem(useDropdownMenuSearch(), textValue, children);
|
|
2131
2161
|
if (!visible) return null;
|
|
2132
2162
|
return /* @__PURE__ */ jsxs(
|
|
2133
2163
|
DropdownMenuPrimitive.RadioItem,
|
|
@@ -2216,6 +2246,10 @@ var FilterDropdown = ({
|
|
|
2216
2246
|
const filteredOptions = options.filter(
|
|
2217
2247
|
(option) => option.value && option.value.trim() !== "" && option.label && option.label.trim() !== ""
|
|
2218
2248
|
);
|
|
2249
|
+
const clearAll = (className) => (
|
|
2250
|
+
// An empty textValue keeps this out of search results, so Enter can't clear every filter
|
|
2251
|
+
/* @__PURE__ */ jsx(DropdownMenuItem, { textValue: "", onSelect: onClearAll, className, children: /* @__PURE__ */ jsx("span", { className: buttonVariants({ variant: "link", size: "sm" }), children: "Clear all" }) })
|
|
2252
|
+
);
|
|
2219
2253
|
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
2220
2254
|
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, disabled, children: /* @__PURE__ */ jsxs(
|
|
2221
2255
|
Button,
|
|
@@ -2239,14 +2273,16 @@ var FilterDropdown = ({
|
|
|
2239
2273
|
className: cn(styles24["dropdown-menu-content"], contentClassName),
|
|
2240
2274
|
children: [
|
|
2241
2275
|
searchable && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2242
|
-
/* @__PURE__ */ jsx(DropdownMenuSearch, { placeholder: searchPlaceholder }),
|
|
2276
|
+
/* @__PURE__ */ jsx(DropdownMenuSearch, { alwaysVisible: true, placeholder: searchPlaceholder, "aria-label": label }),
|
|
2243
2277
|
/* @__PURE__ */ jsx(DropdownMenuEmpty, { children: emptyPlaceholder })
|
|
2244
2278
|
] }),
|
|
2245
|
-
/* @__PURE__ */ jsxs(
|
|
2246
|
-
"
|
|
2247
|
-
|
|
2279
|
+
!searchable && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2280
|
+
/* @__PURE__ */ jsxs(DropdownMenuLabel, { className: styles24["filters-header"], children: [
|
|
2281
|
+
"Filters",
|
|
2282
|
+
hasSelectedFilters && clearAll(styles24["clear-all-inline"])
|
|
2283
|
+
] }),
|
|
2284
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {})
|
|
2248
2285
|
] }),
|
|
2249
|
-
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
2250
2286
|
filteredOptions.map((option) => {
|
|
2251
2287
|
const isSelected = selectedFilters.includes(option.value);
|
|
2252
2288
|
return /* @__PURE__ */ jsx(
|
|
@@ -2259,7 +2295,11 @@ var FilterDropdown = ({
|
|
|
2259
2295
|
},
|
|
2260
2296
|
option.value
|
|
2261
2297
|
);
|
|
2262
|
-
})
|
|
2298
|
+
}),
|
|
2299
|
+
searchable && hasSelectedFilters && /* @__PURE__ */ jsxs("div", { className: styles24["clear-all-footer"], children: [
|
|
2300
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
2301
|
+
clearAll(styles24["clear-all"])
|
|
2302
|
+
] })
|
|
2263
2303
|
]
|
|
2264
2304
|
}
|
|
2265
2305
|
)
|
|
@@ -2607,8 +2647,59 @@ var NotFound = ({
|
|
|
2607
2647
|
var CheckIcon3 = Check;
|
|
2608
2648
|
var ChevronDownIcon2 = ChevronDown;
|
|
2609
2649
|
var ChevronUpIcon = ChevronUp;
|
|
2610
|
-
var
|
|
2611
|
-
var
|
|
2650
|
+
var SearchIcon3 = Search;
|
|
2651
|
+
var SEARCH_INPUT_SELECTOR = "[data-select-search]";
|
|
2652
|
+
var NAVIGABLE_OPTION_SELECTOR = '[role="option"]:not([data-disabled]):not([hidden])';
|
|
2653
|
+
var RADIX_HANDLED_SEARCH_KEYS = ["ArrowDown", "ArrowUp", "Escape", "Tab"];
|
|
2654
|
+
var SelectSearchContext = React15.createContext(null);
|
|
2655
|
+
var useSelectSearch = () => React15.useContext(SelectSearchContext);
|
|
2656
|
+
var useIsSearching2 = () => isSearchActive(useSelectSearch());
|
|
2657
|
+
var SelectGroupMatchContext = React15.createContext(null);
|
|
2658
|
+
var Select = ({
|
|
2659
|
+
open,
|
|
2660
|
+
onOpenChange,
|
|
2661
|
+
...props
|
|
2662
|
+
}) => {
|
|
2663
|
+
const search = useListSearchState(open);
|
|
2664
|
+
const { resetForOpen } = search;
|
|
2665
|
+
const interactedRef = React15.useRef(false);
|
|
2666
|
+
const markInteracted = React15.useCallback(() => {
|
|
2667
|
+
interactedRef.current = true;
|
|
2668
|
+
}, []);
|
|
2669
|
+
const interactedSinceOpen = React15.useCallback(() => interactedRef.current, []);
|
|
2670
|
+
React15.useEffect(() => {
|
|
2671
|
+
if (open) interactedRef.current = false;
|
|
2672
|
+
}, [open]);
|
|
2673
|
+
const handleOpenChange = React15.useCallback(
|
|
2674
|
+
(nextOpen) => {
|
|
2675
|
+
if (nextOpen) {
|
|
2676
|
+
resetForOpen();
|
|
2677
|
+
interactedRef.current = false;
|
|
2678
|
+
}
|
|
2679
|
+
onOpenChange?.(nextOpen);
|
|
2680
|
+
},
|
|
2681
|
+
[onOpenChange, resetForOpen]
|
|
2682
|
+
);
|
|
2683
|
+
const value = React15.useMemo(
|
|
2684
|
+
() => ({ ...search, markInteracted, interactedSinceOpen }),
|
|
2685
|
+
[search, markInteracted, interactedSinceOpen]
|
|
2686
|
+
);
|
|
2687
|
+
return /* @__PURE__ */ jsx(SelectSearchContext.Provider, { value, children: /* @__PURE__ */ jsx(SelectPrimitive.Root, { open, onOpenChange: handleOpenChange, ...props }) });
|
|
2688
|
+
};
|
|
2689
|
+
Select.displayName = "Select";
|
|
2690
|
+
var SelectGroup = React15.forwardRef(({ hidden, ...props }, ref) => {
|
|
2691
|
+
const searching = useIsSearching2();
|
|
2692
|
+
const registry = useMatchRegistry();
|
|
2693
|
+
return /* @__PURE__ */ jsx(SelectGroupMatchContext.Provider, { value: registry, children: /* @__PURE__ */ jsx(
|
|
2694
|
+
SelectPrimitive.Group,
|
|
2695
|
+
{
|
|
2696
|
+
ref,
|
|
2697
|
+
...props,
|
|
2698
|
+
hidden: hidden || searching && registry.matchCount === 0 || void 0
|
|
2699
|
+
}
|
|
2700
|
+
) });
|
|
2701
|
+
});
|
|
2702
|
+
SelectGroup.displayName = SelectPrimitive.Group.displayName;
|
|
2612
2703
|
var SelectValue = SelectPrimitive.Value;
|
|
2613
2704
|
var SelectTrigger = React15.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(SelectPrimitive.Trigger, { ref, className: cn(styles35["select-trigger"], className), ...props, children: [
|
|
2614
2705
|
children,
|
|
@@ -2641,50 +2732,217 @@ var selectContentElevationVariants = generateElevationVariants(
|
|
|
2641
2732
|
"select-content",
|
|
2642
2733
|
ELEVATION.OVERLAY
|
|
2643
2734
|
);
|
|
2644
|
-
var SelectContent = React15.forwardRef(
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2735
|
+
var SelectContent = React15.forwardRef(
|
|
2736
|
+
({
|
|
2737
|
+
className,
|
|
2738
|
+
children,
|
|
2739
|
+
position = "popper",
|
|
2740
|
+
elevation = ELEVATION.OVERLAY,
|
|
2741
|
+
onKeyDown,
|
|
2742
|
+
onKeyDownCapture,
|
|
2743
|
+
onPointerMoveCapture,
|
|
2744
|
+
onFocus,
|
|
2745
|
+
...props
|
|
2746
|
+
}, ref) => {
|
|
2747
|
+
const ctx = useSelectSearch();
|
|
2748
|
+
const setListId = ctx?.setListId;
|
|
2749
|
+
const searching = isSearchActive(ctx);
|
|
2750
|
+
const resultCount = ctx?.matchCount ?? 0;
|
|
2751
|
+
const composedContentRef = React15.useCallback(
|
|
2752
|
+
(node) => {
|
|
2753
|
+
assignRefs(node, ref);
|
|
2754
|
+
setListId?.(node?.id || void 0);
|
|
2755
|
+
},
|
|
2756
|
+
[ref, setListId]
|
|
2757
|
+
);
|
|
2758
|
+
const handleFocus = (event) => {
|
|
2759
|
+
onFocus?.(event);
|
|
2760
|
+
if (!ctx?.enabled || !ctx.visible || ctx.interactedSinceOpen()) return;
|
|
2761
|
+
if (event.target.closest(SEARCH_INPUT_SELECTOR)) return;
|
|
2762
|
+
ctx.requestFocus();
|
|
2763
|
+
};
|
|
2764
|
+
const handleKeyDown = (event) => {
|
|
2765
|
+
onKeyDown?.(event);
|
|
2766
|
+
if (!ctx?.enabled || event.defaultPrevented) return;
|
|
2767
|
+
const target = event.target;
|
|
2768
|
+
if (target?.closest(SEARCH_INPUT_SELECTOR)) return;
|
|
2769
|
+
if (event.key === "ArrowUp" && ctx.visible) {
|
|
2770
|
+
const firstOption = event.currentTarget.querySelector(NAVIGABLE_OPTION_SELECTOR);
|
|
2771
|
+
if (firstOption && firstOption === target?.closest(NAVIGABLE_OPTION_SELECTOR)) {
|
|
2772
|
+
event.preventDefault();
|
|
2773
|
+
ctx.requestFocus();
|
|
2774
|
+
return;
|
|
2775
|
+
}
|
|
2776
|
+
}
|
|
2777
|
+
if (event.key === "Backspace" && ctx.visible && ctx.query) {
|
|
2778
|
+
event.preventDefault();
|
|
2779
|
+
ctx.setQuery(ctx.query.slice(0, -1));
|
|
2780
|
+
ctx.requestFocus();
|
|
2781
|
+
return;
|
|
2782
|
+
}
|
|
2783
|
+
if (!isPrintableKey(event)) return;
|
|
2784
|
+
event.preventDefault();
|
|
2785
|
+
if (!ctx.visible) {
|
|
2786
|
+
ctx.reveal(event.key);
|
|
2787
|
+
} else {
|
|
2788
|
+
ctx.setQuery(ctx.query + event.key);
|
|
2789
|
+
ctx.requestFocus();
|
|
2790
|
+
}
|
|
2791
|
+
};
|
|
2792
|
+
return /* @__PURE__ */ jsx(SelectPortal, { children: /* @__PURE__ */ jsxs(
|
|
2793
|
+
SelectPrimitive.Content,
|
|
2794
|
+
{
|
|
2795
|
+
ref: composedContentRef,
|
|
2796
|
+
className: cn(
|
|
2797
|
+
styles35["select-content"],
|
|
2798
|
+
position === "popper" && styles35["select-content--popper"],
|
|
2799
|
+
selectContentElevationVariants({ elevation }),
|
|
2800
|
+
className
|
|
2801
|
+
),
|
|
2802
|
+
position,
|
|
2803
|
+
onFocus: handleFocus,
|
|
2804
|
+
onKeyDown: handleKeyDown,
|
|
2805
|
+
onKeyDownCapture: (event) => {
|
|
2806
|
+
onKeyDownCapture?.(event);
|
|
2807
|
+
ctx?.markInteracted();
|
|
2808
|
+
},
|
|
2809
|
+
onPointerMoveCapture: (event) => {
|
|
2810
|
+
onPointerMoveCapture?.(event);
|
|
2811
|
+
ctx?.markInteracted();
|
|
2812
|
+
},
|
|
2813
|
+
...props,
|
|
2814
|
+
children: [
|
|
2815
|
+
ctx?.enabled ? /* @__PURE__ */ jsx("div", { className: styles35["select-sr-status"], role: "status", "aria-live": "polite", children: searching && resultCount > 0 ? formatResultCount(resultCount) : null }) : null,
|
|
2816
|
+
/* @__PURE__ */ jsx(SelectScrollUpButton, {}),
|
|
2817
|
+
/* @__PURE__ */ jsx(
|
|
2818
|
+
SelectPrimitive.Viewport,
|
|
2819
|
+
{
|
|
2820
|
+
className: cn(
|
|
2821
|
+
styles35["select-viewport"],
|
|
2822
|
+
position === "popper" && styles35["select-viewport--popper"]
|
|
2823
|
+
),
|
|
2824
|
+
children
|
|
2825
|
+
}
|
|
2826
|
+
),
|
|
2827
|
+
/* @__PURE__ */ jsx(SelectScrollDownButton, {})
|
|
2828
|
+
]
|
|
2829
|
+
}
|
|
2830
|
+
) });
|
|
2831
|
+
}
|
|
2832
|
+
);
|
|
2833
|
+
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
2834
|
+
var SelectSearch = React15.forwardRef(
|
|
2835
|
+
({
|
|
2836
|
+
className,
|
|
2837
|
+
placeholder = "Search...",
|
|
2838
|
+
icon,
|
|
2839
|
+
alwaysVisible = true,
|
|
2840
|
+
onKeyDown,
|
|
2841
|
+
"aria-label": ariaLabel,
|
|
2842
|
+
...props
|
|
2843
|
+
}, forwardedRef) => {
|
|
2844
|
+
const ctx = useSelectSearch();
|
|
2845
|
+
if (!ctx) {
|
|
2846
|
+
throw new Error("SelectSearch must be used within a Select");
|
|
2847
|
+
}
|
|
2848
|
+
const { ref, isRendered } = useSearchInput(ctx, alwaysVisible, forwardedRef);
|
|
2849
|
+
if (!isRendered) return null;
|
|
2850
|
+
return /* @__PURE__ */ jsxs("div", { className: styles35["select-search"], children: [
|
|
2851
|
+
/* @__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
2852
|
/* @__PURE__ */ jsx(
|
|
2659
|
-
|
|
2853
|
+
"input",
|
|
2660
2854
|
{
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
),
|
|
2665
|
-
|
|
2855
|
+
...props,
|
|
2856
|
+
ref,
|
|
2857
|
+
"data-select-search": "",
|
|
2858
|
+
className: cn(styles35["select-search-input"], className),
|
|
2859
|
+
value: ctx.query,
|
|
2860
|
+
placeholder,
|
|
2861
|
+
"aria-label": ariaLabel ?? placeholder,
|
|
2862
|
+
role: "searchbox",
|
|
2863
|
+
"aria-controls": ctx.listId,
|
|
2864
|
+
"aria-autocomplete": "list",
|
|
2865
|
+
onChange: (event) => ctx.setQuery(event.target.value),
|
|
2866
|
+
onKeyDown: (event) => {
|
|
2867
|
+
onKeyDown?.(event);
|
|
2868
|
+
if (event.key === "Enter" && !event.defaultPrevented && isSearchActive(ctx)) {
|
|
2869
|
+
event.preventDefault();
|
|
2870
|
+
event.stopPropagation();
|
|
2871
|
+
const firstOption = event.currentTarget.closest('[role="listbox"]')?.querySelector(NAVIGABLE_OPTION_SELECTOR);
|
|
2872
|
+
firstOption?.dispatchEvent(
|
|
2873
|
+
new KeyboardEvent("keydown", { key: "Enter", bubbles: true })
|
|
2874
|
+
);
|
|
2875
|
+
return;
|
|
2876
|
+
}
|
|
2877
|
+
if (!RADIX_HANDLED_SEARCH_KEYS.includes(event.key)) event.stopPropagation();
|
|
2878
|
+
}
|
|
2666
2879
|
}
|
|
2667
|
-
)
|
|
2668
|
-
|
|
2669
|
-
]
|
|
2880
|
+
)
|
|
2881
|
+
] });
|
|
2670
2882
|
}
|
|
2671
|
-
)
|
|
2672
|
-
|
|
2673
|
-
var
|
|
2883
|
+
);
|
|
2884
|
+
SelectSearch.displayName = "SelectSearch";
|
|
2885
|
+
var SelectEmpty = ({ className, children, ...props }) => {
|
|
2886
|
+
const ctx = useSelectSearch();
|
|
2887
|
+
if (!ctx) return null;
|
|
2888
|
+
const isEmpty = isSearchEmpty(ctx);
|
|
2889
|
+
return /* @__PURE__ */ jsx(
|
|
2890
|
+
"div",
|
|
2891
|
+
{
|
|
2892
|
+
...props,
|
|
2893
|
+
role: "status",
|
|
2894
|
+
"aria-live": "polite",
|
|
2895
|
+
className: isEmpty ? cn(styles35["select-empty"], className) : void 0,
|
|
2896
|
+
children: isEmpty ? children : null
|
|
2897
|
+
}
|
|
2898
|
+
);
|
|
2899
|
+
};
|
|
2900
|
+
SelectEmpty.displayName = "SelectEmpty";
|
|
2901
|
+
var SelectLabel = React15.forwardRef(({ className, hidden, ...props }, ref) => {
|
|
2902
|
+
const searching = useIsSearching2();
|
|
2903
|
+
return /* @__PURE__ */ jsx(
|
|
2904
|
+
SelectPrimitive.Label,
|
|
2905
|
+
{
|
|
2906
|
+
ref,
|
|
2907
|
+
className: cn(styles35["select-label"], className),
|
|
2908
|
+
...props,
|
|
2909
|
+
hidden: hidden || searching || void 0
|
|
2910
|
+
}
|
|
2911
|
+
);
|
|
2912
|
+
});
|
|
2674
2913
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
2675
|
-
var SelectItem = React15.forwardRef(({ className, children, ...props }, ref) =>
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2914
|
+
var SelectItem = React15.forwardRef(({ className, children, textValue, hidden, ...props }, ref) => {
|
|
2915
|
+
const search = useSelectSearch();
|
|
2916
|
+
const group = React15.useContext(SelectGroupMatchContext);
|
|
2917
|
+
const matches = useFilterableItem(search, textValue, children, group);
|
|
2918
|
+
return /* @__PURE__ */ jsxs(
|
|
2919
|
+
SelectPrimitive.Item,
|
|
2920
|
+
{
|
|
2921
|
+
ref,
|
|
2922
|
+
className: cn(styles35["select-item"], className),
|
|
2923
|
+
...props,
|
|
2924
|
+
textValue,
|
|
2925
|
+
hidden: hidden || !matches || void 0,
|
|
2926
|
+
children: [
|
|
2927
|
+
/* @__PURE__ */ jsx("span", { className: styles35["select-item-indicator"], children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon3, { className: styles35["select-icon"] }) }) }),
|
|
2928
|
+
/* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })
|
|
2929
|
+
]
|
|
2930
|
+
}
|
|
2931
|
+
);
|
|
2932
|
+
});
|
|
2679
2933
|
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
2680
|
-
var SelectSeparator = React15.forwardRef(({ className, ...props }, ref) =>
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
)
|
|
2934
|
+
var SelectSeparator = React15.forwardRef(({ className, ...props }, ref) => {
|
|
2935
|
+
const searching = useIsSearching2();
|
|
2936
|
+
if (searching) return null;
|
|
2937
|
+
return /* @__PURE__ */ jsx(
|
|
2938
|
+
SelectPrimitive.Separator,
|
|
2939
|
+
{
|
|
2940
|
+
ref,
|
|
2941
|
+
className: cn(styles35["select-separator"], className),
|
|
2942
|
+
...props
|
|
2943
|
+
}
|
|
2944
|
+
);
|
|
2945
|
+
});
|
|
2688
2946
|
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
2689
2947
|
var ChevronLeftIcon2 = ChevronLeft;
|
|
2690
2948
|
var ChevronRightIcon3 = ChevronRight;
|
|
@@ -3132,11 +3390,13 @@ var RadioDropdown = ({
|
|
|
3132
3390
|
] }) }),
|
|
3133
3391
|
/* @__PURE__ */ jsxs(DropdownMenuContent, { align: "end", className: styles41["dropdown-menu-content"], children: [
|
|
3134
3392
|
searchable && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3135
|
-
/* @__PURE__ */ jsx(DropdownMenuSearch, { placeholder: searchPlaceholder }),
|
|
3393
|
+
/* @__PURE__ */ jsx(DropdownMenuSearch, { alwaysVisible: true, placeholder: searchPlaceholder, "aria-label": label }),
|
|
3136
3394
|
/* @__PURE__ */ jsx(DropdownMenuEmpty, { children: emptyPlaceholder })
|
|
3137
3395
|
] }),
|
|
3138
|
-
/* @__PURE__ */
|
|
3139
|
-
|
|
3396
|
+
!searchable && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3397
|
+
/* @__PURE__ */ jsx(DropdownMenuLabel, { children: label }),
|
|
3398
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {})
|
|
3399
|
+
] }),
|
|
3140
3400
|
/* @__PURE__ */ jsx(DropdownMenuRadioGroup, { value: selectedValue, onValueChange: onSelect, children: filteredOptions.map((option) => {
|
|
3141
3401
|
const hasCount = option.count !== void 0;
|
|
3142
3402
|
return /* @__PURE__ */ jsxs(DropdownMenuRadioItem, { value: option.value, children: [
|
|
@@ -3193,7 +3453,7 @@ var ScrollBar = React15.forwardRef(({ className, orientation = "vertical", ...pr
|
|
|
3193
3453
|
}
|
|
3194
3454
|
));
|
|
3195
3455
|
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
3196
|
-
var
|
|
3456
|
+
var SearchIcon4 = Search;
|
|
3197
3457
|
var SearchBar = ({
|
|
3198
3458
|
searchQuery,
|
|
3199
3459
|
setSearchQuery,
|
|
@@ -3213,7 +3473,7 @@ var SearchBar = ({
|
|
|
3213
3473
|
value: searchQuery,
|
|
3214
3474
|
onChange: handleChange,
|
|
3215
3475
|
className: styles44["input"],
|
|
3216
|
-
prefix: /* @__PURE__ */ jsx(
|
|
3476
|
+
prefix: /* @__PURE__ */ jsx(SearchIcon4, { className: styles44["search-icon"] }),
|
|
3217
3477
|
suffix: searchQuery && /* @__PURE__ */ jsx(
|
|
3218
3478
|
IconButton,
|
|
3219
3479
|
{
|
|
@@ -4298,6 +4558,6 @@ var useTheme = () => {
|
|
|
4298
4558
|
return [theme, setTheme];
|
|
4299
4559
|
};
|
|
4300
4560
|
|
|
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 };
|
|
4561
|
+
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
4562
|
//# sourceMappingURL=index.js.map
|
|
4303
4563
|
//# sourceMappingURL=index.js.map
|