@xsolla/xui-context-menu 0.107.0 → 0.108.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/native/index.js +26 -25
- package/native/index.js.map +1 -1
- package/native/index.mjs +23 -22
- package/native/index.mjs.map +1 -1
- package/package.json +8 -8
- package/web/index.js +26 -25
- package/web/index.js.map +1 -1
- package/web/index.mjs +23 -22
- package/web/index.mjs.map +1 -1
package/native/index.js
CHANGED
|
@@ -1451,6 +1451,7 @@ var import_jsx_runtime393 = require("react/jsx-runtime");
|
|
|
1451
1451
|
var import_jsx_runtime394 = require("react/jsx-runtime");
|
|
1452
1452
|
var import_jsx_runtime395 = require("react/jsx-runtime");
|
|
1453
1453
|
var import_jsx_runtime396 = require("react/jsx-runtime");
|
|
1454
|
+
var import_jsx_runtime397 = require("react/jsx-runtime");
|
|
1454
1455
|
var StyledIcon = import_styled_components.default.div`
|
|
1455
1456
|
display: inline-flex;
|
|
1456
1457
|
align-items: center;
|
|
@@ -1468,15 +1469,15 @@ var BaseIcon = ({
|
|
|
1468
1469
|
variant = "line",
|
|
1469
1470
|
size = 24,
|
|
1470
1471
|
color = "currentColor",
|
|
1471
|
-
solidContent:
|
|
1472
|
-
lineContent:
|
|
1472
|
+
solidContent: solidContent387,
|
|
1473
|
+
lineContent: lineContent387,
|
|
1473
1474
|
className,
|
|
1474
1475
|
style,
|
|
1475
1476
|
"data-testid": testId,
|
|
1476
1477
|
"aria-label": ariaLabel,
|
|
1477
1478
|
"aria-hidden": ariaHidden
|
|
1478
1479
|
}) => {
|
|
1479
|
-
const svgContent = variant === "line" ?
|
|
1480
|
+
const svgContent = variant === "line" ? lineContent387 : solidContent387;
|
|
1480
1481
|
const sizeValue = typeof size === "number" ? `${size}px` : size;
|
|
1481
1482
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1482
1483
|
StyledIcon,
|
|
@@ -1493,13 +1494,13 @@ var BaseIcon = ({
|
|
|
1493
1494
|
}
|
|
1494
1495
|
);
|
|
1495
1496
|
};
|
|
1496
|
-
var
|
|
1497
|
-
var
|
|
1498
|
-
var Search = (props) => /* @__PURE__ */ (0,
|
|
1497
|
+
var solidContent373 = `<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%"><g id="icon_search--line"><path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M10 2C14.4183 2 18 5.58172 18 10C18 11.8484 17.3711 13.5488 16.3184 14.9033L21.957 20.543L20.543 21.957L14.9033 16.3174C13.5487 17.3703 11.8486 18 10 18C5.58172 18 2 14.4183 2 10C2 5.58172 5.58172 2 10 2ZM10 4C6.68629 4 4 6.68629 4 10C4 13.3137 6.68629 16 10 16C13.3137 16 16 13.3137 16 10C16 6.68629 13.3137 4 10 4Z" style="fill: currentColor"/></g></svg>`;
|
|
1498
|
+
var lineContent373 = `<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%"><g id="icon_search--line"><path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M10 2C14.4183 2 18 5.58172 18 10C18 11.8484 17.3711 13.5488 16.3184 14.9033L21.957 20.543L20.543 21.957L14.9033 16.3174C13.5487 17.3703 11.8486 18 10 18C5.58172 18 2 14.4183 2 10C2 5.58172 5.58172 2 10 2ZM10 4C6.68629 4 4 6.68629 4 10C4 13.3137 6.68629 16 10 16C13.3137 16 16 13.3137 16 10C16 6.68629 13.3137 4 10 4Z" style="fill: currentColor"/></g></svg>`;
|
|
1499
|
+
var Search = (props) => /* @__PURE__ */ (0, import_jsx_runtime384.jsx)(BaseIcon, { ...props, solidContent: solidContent373, lineContent: lineContent373 });
|
|
1499
1500
|
|
|
1500
1501
|
// src/ContextMenuSearch.tsx
|
|
1501
1502
|
var import_xui_divider = require("@xsolla/xui-divider");
|
|
1502
|
-
var
|
|
1503
|
+
var import_jsx_runtime398 = require("react/jsx-runtime");
|
|
1503
1504
|
var ContextMenuSearch = (0, import_react9.forwardRef)(
|
|
1504
1505
|
({
|
|
1505
1506
|
value,
|
|
@@ -1538,7 +1539,7 @@ var ContextMenuSearch = (0, import_react9.forwardRef)(
|
|
|
1538
1539
|
context?.closeMenu();
|
|
1539
1540
|
}
|
|
1540
1541
|
};
|
|
1541
|
-
return /* @__PURE__ */ (0,
|
|
1542
|
+
return /* @__PURE__ */ (0, import_jsx_runtime398.jsxs)(
|
|
1542
1543
|
Box,
|
|
1543
1544
|
{
|
|
1544
1545
|
flexDirection: "column",
|
|
@@ -1547,16 +1548,16 @@ var ContextMenuSearch = (0, import_react9.forwardRef)(
|
|
|
1547
1548
|
paddingVertical: sizeStyles.searchPaddingVertical,
|
|
1548
1549
|
"data-testid": testId,
|
|
1549
1550
|
children: [
|
|
1550
|
-
/* @__PURE__ */ (0,
|
|
1551
|
-
/* @__PURE__ */ (0,
|
|
1551
|
+
/* @__PURE__ */ (0, import_jsx_runtime398.jsxs)(Box, { flexDirection: "row", alignItems: "center", gap: 8, children: [
|
|
1552
|
+
/* @__PURE__ */ (0, import_jsx_runtime398.jsx)(
|
|
1552
1553
|
Icon,
|
|
1553
1554
|
{
|
|
1554
1555
|
size: sizeStyles.searchIconSize,
|
|
1555
1556
|
color: inputColors.placeholder,
|
|
1556
|
-
children: /* @__PURE__ */ (0,
|
|
1557
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime398.jsx)(Search, {})
|
|
1557
1558
|
}
|
|
1558
1559
|
),
|
|
1559
|
-
/* @__PURE__ */ (0,
|
|
1560
|
+
/* @__PURE__ */ (0, import_jsx_runtime398.jsx)(Box, { flex: 1, children: /* @__PURE__ */ (0, import_jsx_runtime398.jsx)(
|
|
1560
1561
|
InputPrimitive,
|
|
1561
1562
|
{
|
|
1562
1563
|
ref: inputRef,
|
|
@@ -1575,7 +1576,7 @@ var ContextMenuSearch = (0, import_react9.forwardRef)(
|
|
|
1575
1576
|
}
|
|
1576
1577
|
) })
|
|
1577
1578
|
] }),
|
|
1578
|
-
/* @__PURE__ */ (0,
|
|
1579
|
+
/* @__PURE__ */ (0, import_jsx_runtime398.jsx)(import_xui_divider.Divider, {})
|
|
1579
1580
|
]
|
|
1580
1581
|
}
|
|
1581
1582
|
);
|
|
@@ -1584,7 +1585,7 @@ var ContextMenuSearch = (0, import_react9.forwardRef)(
|
|
|
1584
1585
|
ContextMenuSearch.displayName = "ContextMenuSearch";
|
|
1585
1586
|
|
|
1586
1587
|
// src/ContextMenu.tsx
|
|
1587
|
-
var
|
|
1588
|
+
var import_jsx_runtime399 = require("react/jsx-runtime");
|
|
1588
1589
|
var ContextMenuRoot = (0, import_react10.forwardRef)(
|
|
1589
1590
|
({
|
|
1590
1591
|
children,
|
|
@@ -1763,7 +1764,7 @@ var ContextMenuRoot = (0, import_react10.forwardRef)(
|
|
|
1763
1764
|
"data-testid": `context-menu-item-${item.id || index}`
|
|
1764
1765
|
};
|
|
1765
1766
|
if (item.variant === "checkbox") {
|
|
1766
|
-
return /* @__PURE__ */ (0,
|
|
1767
|
+
return /* @__PURE__ */ (0, import_jsx_runtime399.jsx)(
|
|
1767
1768
|
ContextMenuCheckboxItem,
|
|
1768
1769
|
{
|
|
1769
1770
|
...commonProps,
|
|
@@ -1776,7 +1777,7 @@ var ContextMenuRoot = (0, import_react10.forwardRef)(
|
|
|
1776
1777
|
);
|
|
1777
1778
|
}
|
|
1778
1779
|
if (item.variant === "radio") {
|
|
1779
|
-
return /* @__PURE__ */ (0,
|
|
1780
|
+
return /* @__PURE__ */ (0, import_jsx_runtime399.jsx)(
|
|
1780
1781
|
ContextMenuRadioItem,
|
|
1781
1782
|
{
|
|
1782
1783
|
...commonProps,
|
|
@@ -1787,7 +1788,7 @@ var ContextMenuRoot = (0, import_react10.forwardRef)(
|
|
|
1787
1788
|
itemKey
|
|
1788
1789
|
);
|
|
1789
1790
|
}
|
|
1790
|
-
return /* @__PURE__ */ (0,
|
|
1791
|
+
return /* @__PURE__ */ (0, import_jsx_runtime399.jsx)(
|
|
1791
1792
|
ContextMenuItem,
|
|
1792
1793
|
{
|
|
1793
1794
|
...commonProps,
|
|
@@ -1805,9 +1806,9 @@ var ContextMenuRoot = (0, import_react10.forwardRef)(
|
|
|
1805
1806
|
});
|
|
1806
1807
|
};
|
|
1807
1808
|
const renderGroups = (groupsData) => {
|
|
1808
|
-
return groupsData.map((group, groupIndex) => /* @__PURE__ */ (0,
|
|
1809
|
-
groupIndex > 0 && /* @__PURE__ */ (0,
|
|
1810
|
-
/* @__PURE__ */ (0,
|
|
1809
|
+
return groupsData.map((group, groupIndex) => /* @__PURE__ */ (0, import_jsx_runtime399.jsxs)(import_react10.default.Fragment, { children: [
|
|
1810
|
+
groupIndex > 0 && /* @__PURE__ */ (0, import_jsx_runtime399.jsx)(ContextMenuSeparator, {}),
|
|
1811
|
+
/* @__PURE__ */ (0, import_jsx_runtime399.jsx)(
|
|
1811
1812
|
ContextMenuGroup,
|
|
1812
1813
|
{
|
|
1813
1814
|
label: group.label,
|
|
@@ -1821,14 +1822,14 @@ var ContextMenuRoot = (0, import_react10.forwardRef)(
|
|
|
1821
1822
|
const renderContent = () => {
|
|
1822
1823
|
if (isLoading) {
|
|
1823
1824
|
const brandColor = theme.colors.control.brand.primary.bg;
|
|
1824
|
-
return /* @__PURE__ */ (0,
|
|
1825
|
+
return /* @__PURE__ */ (0, import_jsx_runtime399.jsx)(
|
|
1825
1826
|
Box,
|
|
1826
1827
|
{
|
|
1827
1828
|
padding: 16,
|
|
1828
1829
|
alignItems: "center",
|
|
1829
1830
|
justifyContent: "center",
|
|
1830
1831
|
minHeight: 60,
|
|
1831
|
-
children: /* @__PURE__ */ (0,
|
|
1832
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime399.jsx)(import_xui_spinner.Spinner, { size: "md", color: brandColor })
|
|
1832
1833
|
}
|
|
1833
1834
|
);
|
|
1834
1835
|
}
|
|
@@ -1843,7 +1844,7 @@ var ContextMenuRoot = (0, import_react10.forwardRef)(
|
|
|
1843
1844
|
}
|
|
1844
1845
|
return null;
|
|
1845
1846
|
};
|
|
1846
|
-
return /* @__PURE__ */ (0,
|
|
1847
|
+
return /* @__PURE__ */ (0, import_jsx_runtime399.jsx)(ContextMenuContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime399.jsxs)(
|
|
1847
1848
|
"div",
|
|
1848
1849
|
{
|
|
1849
1850
|
ref: containerRef,
|
|
@@ -1854,7 +1855,7 @@ var ContextMenuRoot = (0, import_react10.forwardRef)(
|
|
|
1854
1855
|
},
|
|
1855
1856
|
"data-testid": testId,
|
|
1856
1857
|
children: [
|
|
1857
|
-
trigger && /* @__PURE__ */ (0,
|
|
1858
|
+
trigger && /* @__PURE__ */ (0, import_jsx_runtime399.jsx)(
|
|
1858
1859
|
"div",
|
|
1859
1860
|
{
|
|
1860
1861
|
onClick: toggleMenu,
|
|
@@ -1863,7 +1864,7 @@ var ContextMenuRoot = (0, import_react10.forwardRef)(
|
|
|
1863
1864
|
children: trigger
|
|
1864
1865
|
}
|
|
1865
1866
|
),
|
|
1866
|
-
isOpen && /* @__PURE__ */ (0,
|
|
1867
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime399.jsx)(
|
|
1867
1868
|
Box,
|
|
1868
1869
|
{
|
|
1869
1870
|
ref: (node) => {
|