@xsolla/xui-select 0.133.0 → 0.135.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,118 +1,11 @@
1
1
  // src/Select.tsx
2
- import React3, { useState, useRef, useEffect } from "react";
2
+ import React2, { useState, useRef, useEffect } from "react";
3
3
 
4
4
  // ../primitives-web/src/Box.tsx
5
- import React2 from "react";
6
- import styled from "styled-components";
7
-
8
- // ../primitives-web/src/filterDOMProps.ts
9
5
  import React from "react";
10
- var NON_HTML_PROPS = /* @__PURE__ */ new Set([
11
- // BoxProps — layout & styling
12
- "backgroundColor",
13
- "borderColor",
14
- "borderWidth",
15
- "borderBottomWidth",
16
- "borderBottomColor",
17
- "borderTopWidth",
18
- "borderTopColor",
19
- "borderLeftWidth",
20
- "borderLeftColor",
21
- "borderRightWidth",
22
- "borderRightColor",
23
- "borderRadius",
24
- "borderStyle",
25
- "flexDirection",
26
- "flexWrap",
27
- "alignItems",
28
- "justifyContent",
29
- "alignSelf",
30
- "flex",
31
- "flexShrink",
32
- "gap",
33
- "position",
34
- "top",
35
- "bottom",
36
- "left",
37
- "right",
38
- "outline",
39
- "overflow",
40
- "overflowX",
41
- "overflowY",
42
- "zIndex",
43
- "cursor",
44
- "padding",
45
- "paddingHorizontal",
46
- "paddingVertical",
47
- "paddingTop",
48
- "paddingBottom",
49
- "paddingLeft",
50
- "paddingRight",
51
- "margin",
52
- "marginTop",
53
- "marginBottom",
54
- "marginLeft",
55
- "marginRight",
56
- "minWidth",
57
- "minHeight",
58
- "maxWidth",
59
- "maxHeight",
60
- "hoverStyle",
61
- "pressStyle",
62
- "focusStyle",
63
- "outlineColor",
64
- "outlineWidth",
65
- "outlineOffset",
66
- "outlineStyle",
67
- // BoxProps — RN-only
68
- "onPress",
69
- "onLayout",
70
- "onMoveShouldSetResponder",
71
- "onResponderGrant",
72
- "onResponderMove",
73
- "onResponderRelease",
74
- "onResponderTerminate",
75
- "testID",
76
- // Box — custom element type
77
- "elementType",
78
- // TextProps
79
- "fontSize",
80
- "fontWeight",
81
- "fontFamily",
82
- "lineHeight",
83
- "whiteSpace",
84
- "textAlign",
85
- "textDecoration",
86
- "numberOfLines",
87
- "letterSpacing",
88
- "textTransform",
89
- // SpinnerProps
90
- "strokeWidth",
91
- // DividerProps
92
- "vertical",
93
- "dashStroke"
94
- ]);
95
- function createFilteredElement(defaultTag) {
96
- const Component = React.forwardRef(
97
- ({ children, elementType, ...props }, ref) => {
98
- const Tag = elementType || defaultTag;
99
- const htmlProps = {};
100
- for (const key of Object.keys(props)) {
101
- if (!NON_HTML_PROPS.has(key)) {
102
- htmlProps[key] = props[key];
103
- }
104
- }
105
- return React.createElement(Tag, { ref, ...htmlProps }, children);
106
- }
107
- );
108
- Component.displayName = `Filtered(${defaultTag})`;
109
- return Component;
110
- }
111
-
112
- // ../primitives-web/src/Box.tsx
6
+ import styled from "styled-components";
113
7
  import { jsx } from "react/jsx-runtime";
114
- var FilteredDiv = createFilteredElement("div");
115
- var StyledBox = styled(FilteredDiv)`
8
+ var StyledBox = styled.div`
116
9
  display: flex;
117
10
  box-sizing: border-box;
118
11
  background-color: ${(props) => props.backgroundColor || "transparent"};
@@ -199,7 +92,7 @@ var StyledBox = styled(FilteredDiv)`
199
92
  ${(props) => props.pressStyle?.backgroundColor && `background-color: ${props.pressStyle.backgroundColor};`}
200
93
  }
201
94
  `;
202
- var Box = React2.forwardRef(
95
+ var Box = React.forwardRef(
203
96
  ({
204
97
  children,
205
98
  onPress,
@@ -251,7 +144,7 @@ var Box = React2.forwardRef(
251
144
  StyledBox,
252
145
  {
253
146
  ref,
254
- elementType: as,
147
+ as,
255
148
  id,
256
149
  type: as === "button" ? type || "button" : void 0,
257
150
  disabled: as === "button" ? disabled : void 0,
@@ -282,8 +175,7 @@ Box.displayName = "Box";
282
175
  // ../primitives-web/src/Text.tsx
283
176
  import styled2 from "styled-components";
284
177
  import { jsx as jsx2 } from "react/jsx-runtime";
285
- var FilteredSpan = createFilteredElement("span");
286
- var StyledText = styled2(FilteredSpan)`
178
+ var StyledText = styled2.span`
287
179
  color: ${(props) => props.color || "inherit"};
288
180
  font-size: ${(props) => typeof props.fontSize === "number" ? `${props.fontSize}px` : props.fontSize || "inherit"};
289
181
  font-weight: ${(props) => props.fontWeight || "normal"};
@@ -316,8 +208,7 @@ var Text = ({
316
208
  // ../primitives-web/src/Icon.tsx
317
209
  import styled3 from "styled-components";
318
210
  import { jsx as jsx3 } from "react/jsx-runtime";
319
- var FilteredDiv2 = createFilteredElement("div");
320
- var StyledIcon = styled3(FilteredDiv2)`
211
+ var StyledIcon = styled3.div`
321
212
  display: flex;
322
213
  align-items: center;
323
214
  justify-content: center;
@@ -822,7 +713,7 @@ var Select = ({
822
713
  const isDisable = externalState === "disable" || disabled;
823
714
  const isError = externalState === "error" || !!errorMessage;
824
715
  const isFocus = externalState === "focus" || isOpen;
825
- React3.useEffect(() => {
716
+ React2.useEffect(() => {
826
717
  if (value !== void 0) {
827
718
  setSelectedValue(value);
828
719
  }