@xsolla/xui-context-menu 0.211.1 → 0.212.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/web/index.mjs CHANGED
@@ -1544,6 +1544,7 @@ var ContextMenuRoot = forwardRef(
1544
1544
  maxHeight = 300,
1545
1545
  withArrow = false,
1546
1546
  noPadding = false,
1547
+ background,
1547
1548
  onSelect,
1548
1549
  closeOnSelect,
1549
1550
  "aria-label": ariaLabel,
@@ -1578,6 +1579,7 @@ var ContextMenuRoot = forwardRef(
1578
1579
  const panelPaddingVertical = noPadding ? 0 : sizeStyles.paddingVertical;
1579
1580
  const panelPaddingHorizontal = noPadding ? 0 : sizeStyles.paddingHorizontal;
1580
1581
  const shouldCloseOnSelect = closeOnSelect ?? (type === "checkbox" ? false : true);
1582
+ const surfaceColor = background ?? xuiTheme.colors.layer.float;
1581
1583
  const positionOffset = withArrow ? offset + ARROW_TIP_PROTRUSION : offset;
1582
1584
  const positioned = useContextMenuPosition({
1583
1585
  triggerRef,
@@ -1593,7 +1595,7 @@ var ContextMenuRoot = forwardRef(
1593
1595
  position: "absolute",
1594
1596
  width: ARROW_SIZE,
1595
1597
  height: ARROW_SIZE,
1596
- backgroundColor: xuiTheme.colors.layer.float,
1598
+ backgroundColor: surfaceColor,
1597
1599
  borderStyle: "solid",
1598
1600
  borderColor: xuiTheme.colors.border.secondary,
1599
1601
  // 1px outline only on the two outward-facing edges of the rotated square
@@ -1804,7 +1806,7 @@ var ContextMenuRoot = forwardRef(
1804
1806
  position: "sticky",
1805
1807
  top: 0,
1806
1808
  zIndex: 1,
1807
- backgroundColor: xuiTheme.colors.layer.float
1809
+ backgroundColor: surfaceColor
1808
1810
  },
1809
1811
  children: /* @__PURE__ */ jsx4(
1810
1812
  ContextMenuItem,
@@ -1946,7 +1948,7 @@ var ContextMenuRoot = forwardRef(
1946
1948
  "data-testid": dataTestId ?? testID ?? "context-menu",
1947
1949
  "data-xui-context-menu-portal": trigger || position ? menuId : void 0,
1948
1950
  "data-placement": resolvedPlacement,
1949
- backgroundColor: xuiTheme.colors.layer.float,
1951
+ backgroundColor: surfaceColor,
1950
1952
  borderColor: xuiTheme.colors.border.secondary,
1951
1953
  borderWidth: 1,
1952
1954
  borderRadius,