@xsolla/xui-context-menu 0.131.0 → 0.133.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
@@ -1,5 +1,5 @@
1
1
  // src/ContextMenu.tsx
2
- import React7, {
2
+ import React8, {
3
3
  forwardRef as forwardRef8,
4
4
  useState,
5
5
  useRef as useRef5,
@@ -9,10 +9,117 @@ import React7, {
9
9
  } from "react";
10
10
 
11
11
  // ../primitives-web/src/Box.tsx
12
- import React from "react";
12
+ import React2 from "react";
13
13
  import styled from "styled-components";
14
+
15
+ // ../primitives-web/src/filterDOMProps.ts
16
+ import React from "react";
17
+ var NON_HTML_PROPS = /* @__PURE__ */ new Set([
18
+ // BoxProps — layout & styling
19
+ "backgroundColor",
20
+ "borderColor",
21
+ "borderWidth",
22
+ "borderBottomWidth",
23
+ "borderBottomColor",
24
+ "borderTopWidth",
25
+ "borderTopColor",
26
+ "borderLeftWidth",
27
+ "borderLeftColor",
28
+ "borderRightWidth",
29
+ "borderRightColor",
30
+ "borderRadius",
31
+ "borderStyle",
32
+ "flexDirection",
33
+ "flexWrap",
34
+ "alignItems",
35
+ "justifyContent",
36
+ "alignSelf",
37
+ "flex",
38
+ "flexShrink",
39
+ "gap",
40
+ "position",
41
+ "top",
42
+ "bottom",
43
+ "left",
44
+ "right",
45
+ "outline",
46
+ "overflow",
47
+ "overflowX",
48
+ "overflowY",
49
+ "zIndex",
50
+ "cursor",
51
+ "padding",
52
+ "paddingHorizontal",
53
+ "paddingVertical",
54
+ "paddingTop",
55
+ "paddingBottom",
56
+ "paddingLeft",
57
+ "paddingRight",
58
+ "margin",
59
+ "marginTop",
60
+ "marginBottom",
61
+ "marginLeft",
62
+ "marginRight",
63
+ "minWidth",
64
+ "minHeight",
65
+ "maxWidth",
66
+ "maxHeight",
67
+ "hoverStyle",
68
+ "pressStyle",
69
+ "focusStyle",
70
+ "outlineColor",
71
+ "outlineWidth",
72
+ "outlineOffset",
73
+ "outlineStyle",
74
+ // BoxProps — RN-only
75
+ "onPress",
76
+ "onLayout",
77
+ "onMoveShouldSetResponder",
78
+ "onResponderGrant",
79
+ "onResponderMove",
80
+ "onResponderRelease",
81
+ "onResponderTerminate",
82
+ "testID",
83
+ // Box — custom element type
84
+ "elementType",
85
+ // TextProps
86
+ "fontSize",
87
+ "fontWeight",
88
+ "fontFamily",
89
+ "lineHeight",
90
+ "whiteSpace",
91
+ "textAlign",
92
+ "textDecoration",
93
+ "numberOfLines",
94
+ "letterSpacing",
95
+ "textTransform",
96
+ // SpinnerProps
97
+ "strokeWidth",
98
+ // DividerProps
99
+ "vertical",
100
+ "dashStroke"
101
+ ]);
102
+ function createFilteredElement(defaultTag) {
103
+ const Component = React.forwardRef(
104
+ ({ children, elementType, ...props }, ref) => {
105
+ const Tag = elementType || defaultTag;
106
+ const htmlProps = {};
107
+ for (const key of Object.keys(props)) {
108
+ if (!NON_HTML_PROPS.has(key)) {
109
+ htmlProps[key] = props[key];
110
+ }
111
+ }
112
+ return React.createElement(Tag, { ref, ...htmlProps }, children);
113
+ }
114
+ );
115
+ Component.displayName = `Filtered(${defaultTag})`;
116
+ return Component;
117
+ }
118
+
119
+ // ../primitives-web/src/Box.tsx
14
120
  import { jsx } from "react/jsx-runtime";
15
- var StyledBox = styled.div`
121
+ var FilteredDiv = createFilteredElement("div");
122
+ var StyledBox = styled(FilteredDiv)`
16
123
  display: flex;
17
124
  box-sizing: border-box;
18
125
  background-color: ${(props) => props.backgroundColor || "transparent"};
@@ -99,7 +206,7 @@ var StyledBox = styled.div`
99
206
  ${(props) => props.pressStyle?.backgroundColor && `background-color: ${props.pressStyle.backgroundColor};`}
100
207
  }
101
208
  `;
102
- var Box = React.forwardRef(
209
+ var Box = React2.forwardRef(
103
210
  ({
104
211
  children,
105
212
  onPress,
@@ -151,7 +258,7 @@ var Box = React.forwardRef(
151
258
  StyledBox,
152
259
  {
153
260
  ref,
154
- as,
261
+ elementType: as,
155
262
  id,
156
263
  type: as === "button" ? type || "button" : void 0,
157
264
  disabled: as === "button" ? disabled : void 0,
@@ -182,7 +289,8 @@ Box.displayName = "Box";
182
289
  // ../primitives-web/src/Text.tsx
183
290
  import styled2 from "styled-components";
184
291
  import { jsx as jsx2 } from "react/jsx-runtime";
185
- var StyledText = styled2.span`
292
+ var FilteredSpan = createFilteredElement("span");
293
+ var StyledText = styled2(FilteredSpan)`
186
294
  color: ${(props) => props.color || "inherit"};
187
295
  font-size: ${(props) => typeof props.fontSize === "number" ? `${props.fontSize}px` : props.fontSize || "inherit"};
188
296
  font-weight: ${(props) => props.fontWeight || "normal"};
@@ -215,7 +323,8 @@ var Text = ({
215
323
  // ../primitives-web/src/Icon.tsx
216
324
  import styled3 from "styled-components";
217
325
  import { jsx as jsx3 } from "react/jsx-runtime";
218
- var StyledIcon = styled3.div`
326
+ var FilteredDiv2 = createFilteredElement("div");
327
+ var StyledIcon = styled3(FilteredDiv2)`
219
328
  display: flex;
220
329
  align-items: center;
221
330
  justify-content: center;
@@ -1029,7 +1138,7 @@ var ContextMenuSeparator = ({
1029
1138
  ContextMenuSeparator.displayName = "ContextMenuSeparator";
1030
1139
 
1031
1140
  // src/ContextMenuSearch.tsx
1032
- import React6, { forwardRef as forwardRef7, useRef as useRef4, useEffect as useEffect4 } from "react";
1141
+ import React7, { forwardRef as forwardRef7, useRef as useRef4, useEffect as useEffect4 } from "react";
1033
1142
  import { useResolvedTheme as useResolvedTheme6 } from "@xsolla/xui-core";
1034
1143
 
1035
1144
  // ../icons-base/dist/web/index.mjs
@@ -1488,7 +1597,7 @@ var ContextMenuSearch = forwardRef7(
1488
1597
  const sizeStyles = theme.sizing.contextMenu(size);
1489
1598
  const inputRef = useRef4(null);
1490
1599
  const inputColors = theme.colors.control.input;
1491
- React6.useImperativeHandle(
1600
+ React7.useImperativeHandle(
1492
1601
  ref,
1493
1602
  () => inputRef.current,
1494
1603
  []
@@ -1779,7 +1888,7 @@ var ContextMenuRoot = forwardRef8(
1779
1888
  });
1780
1889
  };
1781
1890
  const renderGroups = (groupsData) => {
1782
- return groupsData.map((group, groupIndex) => /* @__PURE__ */ jsxs6(React7.Fragment, { children: [
1891
+ return groupsData.map((group, groupIndex) => /* @__PURE__ */ jsxs6(React8.Fragment, { children: [
1783
1892
  groupIndex > 0 && /* @__PURE__ */ jsx389(ContextMenuSeparator, {}),
1784
1893
  /* @__PURE__ */ jsx389(
1785
1894
  ContextMenuGroup,