@xsolla/xui-stepper 0.132.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
@@ -2,10 +2,117 @@
2
2
  import { forwardRef } from "react";
3
3
 
4
4
  // ../primitives-web/src/Box.tsx
5
- import React from "react";
5
+ import React2 from "react";
6
6
  import styled from "styled-components";
7
+
8
+ // ../primitives-web/src/filterDOMProps.ts
9
+ 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
7
113
  import { jsx } from "react/jsx-runtime";
8
- var StyledBox = styled.div`
114
+ var FilteredDiv = createFilteredElement("div");
115
+ var StyledBox = styled(FilteredDiv)`
9
116
  display: flex;
10
117
  box-sizing: border-box;
11
118
  background-color: ${(props) => props.backgroundColor || "transparent"};
@@ -92,7 +199,7 @@ var StyledBox = styled.div`
92
199
  ${(props) => props.pressStyle?.backgroundColor && `background-color: ${props.pressStyle.backgroundColor};`}
93
200
  }
94
201
  `;
95
- var Box = React.forwardRef(
202
+ var Box = React2.forwardRef(
96
203
  ({
97
204
  children,
98
205
  onPress,
@@ -144,7 +251,7 @@ var Box = React.forwardRef(
144
251
  StyledBox,
145
252
  {
146
253
  ref,
147
- as,
254
+ elementType: as,
148
255
  id,
149
256
  type: as === "button" ? type || "button" : void 0,
150
257
  disabled: as === "button" ? disabled : void 0,
@@ -175,7 +282,8 @@ Box.displayName = "Box";
175
282
  // ../primitives-web/src/Text.tsx
176
283
  import styled2 from "styled-components";
177
284
  import { jsx as jsx2 } from "react/jsx-runtime";
178
- var StyledText = styled2.span`
285
+ var FilteredSpan = createFilteredElement("span");
286
+ var StyledText = styled2(FilteredSpan)`
179
287
  color: ${(props) => props.color || "inherit"};
180
288
  font-size: ${(props) => typeof props.fontSize === "number" ? `${props.fontSize}px` : props.fontSize || "inherit"};
181
289
  font-weight: ${(props) => props.fontWeight || "normal"};
@@ -216,7 +324,8 @@ var rotate = keyframes`
216
324
  transform: rotate(360deg);
217
325
  }
218
326
  `;
219
- var StyledSpinner = styled3.div`
327
+ var FilteredDiv2 = createFilteredElement("div");
328
+ var StyledSpinner = styled3(FilteredDiv2)`
220
329
  width: ${(props) => typeof props.size === "number" ? `${props.size}px` : props.size || "24px"};
221
330
  height: ${(props) => typeof props.size === "number" ? `${props.size}px` : props.size || "24px"};
222
331
  border: ${(props) => props.strokeWidth || 2}px solid
@@ -252,7 +361,8 @@ Spinner.displayName = "Spinner";
252
361
  // ../primitives-web/src/Divider.tsx
253
362
  import styled4 from "styled-components";
254
363
  import { jsx as jsx4 } from "react/jsx-runtime";
255
- var StyledDivider = styled4.div`
364
+ var FilteredDiv3 = createFilteredElement("div");
365
+ var StyledDivider = styled4(FilteredDiv3)`
256
366
  background-color: ${(props) => props.dashStroke ? "transparent" : props.color || "rgba(255, 255, 255, 0.15)"};
257
367
  width: ${(props) => props.vertical ? typeof props.width === "number" ? `${props.width}px` : props.width || "1px" : "100%"};
258
368
  height: ${(props) => props.vertical ? "100%" : typeof props.height === "number" ? `${props.height}px` : props.height || "1px"};