@xsolla/xui-stepper 0.133.0 → 0.134.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/package.json +4 -4
- package/web/index.js +24 -134
- package/web/index.js.map +1 -1
- package/web/index.mjs +7 -117
- package/web/index.mjs.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xsolla/xui-stepper",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.134.0",
|
|
4
4
|
"main": "./web/index.js",
|
|
5
5
|
"module": "./web/index.mjs",
|
|
6
6
|
"types": "./web/index.d.ts",
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
"test:coverage": "vitest run --coverage"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@xsolla/xui-core": "0.
|
|
18
|
-
"@xsolla/xui-icons": "0.
|
|
19
|
-
"@xsolla/xui-primitives-core": "0.
|
|
17
|
+
"@xsolla/xui-core": "0.134.0",
|
|
18
|
+
"@xsolla/xui-icons": "0.134.0",
|
|
19
|
+
"@xsolla/xui-primitives-core": "0.134.0"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
22
|
"react": ">=16.8.0",
|
package/web/index.js
CHANGED
|
@@ -38,120 +38,13 @@ __export(index_exports, {
|
|
|
38
38
|
module.exports = __toCommonJS(index_exports);
|
|
39
39
|
|
|
40
40
|
// src/Stepper.tsx
|
|
41
|
-
var
|
|
41
|
+
var import_react4 = require("react");
|
|
42
42
|
|
|
43
43
|
// ../primitives-web/src/Box.tsx
|
|
44
|
-
var import_react2 = __toESM(require("react"));
|
|
45
|
-
var import_styled_components = __toESM(require("styled-components"));
|
|
46
|
-
|
|
47
|
-
// ../primitives-web/src/filterDOMProps.ts
|
|
48
44
|
var import_react = __toESM(require("react"));
|
|
49
|
-
var
|
|
50
|
-
// BoxProps — layout & styling
|
|
51
|
-
"backgroundColor",
|
|
52
|
-
"borderColor",
|
|
53
|
-
"borderWidth",
|
|
54
|
-
"borderBottomWidth",
|
|
55
|
-
"borderBottomColor",
|
|
56
|
-
"borderTopWidth",
|
|
57
|
-
"borderTopColor",
|
|
58
|
-
"borderLeftWidth",
|
|
59
|
-
"borderLeftColor",
|
|
60
|
-
"borderRightWidth",
|
|
61
|
-
"borderRightColor",
|
|
62
|
-
"borderRadius",
|
|
63
|
-
"borderStyle",
|
|
64
|
-
"flexDirection",
|
|
65
|
-
"flexWrap",
|
|
66
|
-
"alignItems",
|
|
67
|
-
"justifyContent",
|
|
68
|
-
"alignSelf",
|
|
69
|
-
"flex",
|
|
70
|
-
"flexShrink",
|
|
71
|
-
"gap",
|
|
72
|
-
"position",
|
|
73
|
-
"top",
|
|
74
|
-
"bottom",
|
|
75
|
-
"left",
|
|
76
|
-
"right",
|
|
77
|
-
"outline",
|
|
78
|
-
"overflow",
|
|
79
|
-
"overflowX",
|
|
80
|
-
"overflowY",
|
|
81
|
-
"zIndex",
|
|
82
|
-
"cursor",
|
|
83
|
-
"padding",
|
|
84
|
-
"paddingHorizontal",
|
|
85
|
-
"paddingVertical",
|
|
86
|
-
"paddingTop",
|
|
87
|
-
"paddingBottom",
|
|
88
|
-
"paddingLeft",
|
|
89
|
-
"paddingRight",
|
|
90
|
-
"margin",
|
|
91
|
-
"marginTop",
|
|
92
|
-
"marginBottom",
|
|
93
|
-
"marginLeft",
|
|
94
|
-
"marginRight",
|
|
95
|
-
"minWidth",
|
|
96
|
-
"minHeight",
|
|
97
|
-
"maxWidth",
|
|
98
|
-
"maxHeight",
|
|
99
|
-
"hoverStyle",
|
|
100
|
-
"pressStyle",
|
|
101
|
-
"focusStyle",
|
|
102
|
-
"outlineColor",
|
|
103
|
-
"outlineWidth",
|
|
104
|
-
"outlineOffset",
|
|
105
|
-
"outlineStyle",
|
|
106
|
-
// BoxProps — RN-only
|
|
107
|
-
"onPress",
|
|
108
|
-
"onLayout",
|
|
109
|
-
"onMoveShouldSetResponder",
|
|
110
|
-
"onResponderGrant",
|
|
111
|
-
"onResponderMove",
|
|
112
|
-
"onResponderRelease",
|
|
113
|
-
"onResponderTerminate",
|
|
114
|
-
"testID",
|
|
115
|
-
// Box — custom element type
|
|
116
|
-
"elementType",
|
|
117
|
-
// TextProps
|
|
118
|
-
"fontSize",
|
|
119
|
-
"fontWeight",
|
|
120
|
-
"fontFamily",
|
|
121
|
-
"lineHeight",
|
|
122
|
-
"whiteSpace",
|
|
123
|
-
"textAlign",
|
|
124
|
-
"textDecoration",
|
|
125
|
-
"numberOfLines",
|
|
126
|
-
"letterSpacing",
|
|
127
|
-
"textTransform",
|
|
128
|
-
// SpinnerProps
|
|
129
|
-
"strokeWidth",
|
|
130
|
-
// DividerProps
|
|
131
|
-
"vertical",
|
|
132
|
-
"dashStroke"
|
|
133
|
-
]);
|
|
134
|
-
function createFilteredElement(defaultTag) {
|
|
135
|
-
const Component = import_react.default.forwardRef(
|
|
136
|
-
({ children, elementType, ...props }, ref) => {
|
|
137
|
-
const Tag = elementType || defaultTag;
|
|
138
|
-
const htmlProps = {};
|
|
139
|
-
for (const key of Object.keys(props)) {
|
|
140
|
-
if (!NON_HTML_PROPS.has(key)) {
|
|
141
|
-
htmlProps[key] = props[key];
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
return import_react.default.createElement(Tag, { ref, ...htmlProps }, children);
|
|
145
|
-
}
|
|
146
|
-
);
|
|
147
|
-
Component.displayName = `Filtered(${defaultTag})`;
|
|
148
|
-
return Component;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
// ../primitives-web/src/Box.tsx
|
|
45
|
+
var import_styled_components = __toESM(require("styled-components"));
|
|
152
46
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
153
|
-
var
|
|
154
|
-
var StyledBox = (0, import_styled_components.default)(FilteredDiv)`
|
|
47
|
+
var StyledBox = import_styled_components.default.div`
|
|
155
48
|
display: flex;
|
|
156
49
|
box-sizing: border-box;
|
|
157
50
|
background-color: ${(props) => props.backgroundColor || "transparent"};
|
|
@@ -238,7 +131,7 @@ var StyledBox = (0, import_styled_components.default)(FilteredDiv)`
|
|
|
238
131
|
${(props) => props.pressStyle?.backgroundColor && `background-color: ${props.pressStyle.backgroundColor};`}
|
|
239
132
|
}
|
|
240
133
|
`;
|
|
241
|
-
var Box =
|
|
134
|
+
var Box = import_react.default.forwardRef(
|
|
242
135
|
({
|
|
243
136
|
children,
|
|
244
137
|
onPress,
|
|
@@ -290,7 +183,7 @@ var Box = import_react2.default.forwardRef(
|
|
|
290
183
|
StyledBox,
|
|
291
184
|
{
|
|
292
185
|
ref,
|
|
293
|
-
|
|
186
|
+
as,
|
|
294
187
|
id,
|
|
295
188
|
type: as === "button" ? type || "button" : void 0,
|
|
296
189
|
disabled: as === "button" ? disabled : void 0,
|
|
@@ -321,8 +214,7 @@ Box.displayName = "Box";
|
|
|
321
214
|
// ../primitives-web/src/Text.tsx
|
|
322
215
|
var import_styled_components2 = __toESM(require("styled-components"));
|
|
323
216
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
324
|
-
var
|
|
325
|
-
var StyledText = (0, import_styled_components2.default)(FilteredSpan)`
|
|
217
|
+
var StyledText = import_styled_components2.default.span`
|
|
326
218
|
color: ${(props) => props.color || "inherit"};
|
|
327
219
|
font-size: ${(props) => typeof props.fontSize === "number" ? `${props.fontSize}px` : props.fontSize || "inherit"};
|
|
328
220
|
font-weight: ${(props) => props.fontWeight || "normal"};
|
|
@@ -363,8 +255,7 @@ var rotate = import_styled_components3.keyframes`
|
|
|
363
255
|
transform: rotate(360deg);
|
|
364
256
|
}
|
|
365
257
|
`;
|
|
366
|
-
var
|
|
367
|
-
var StyledSpinner = (0, import_styled_components3.default)(FilteredDiv2)`
|
|
258
|
+
var StyledSpinner = import_styled_components3.default.div`
|
|
368
259
|
width: ${(props) => typeof props.size === "number" ? `${props.size}px` : props.size || "24px"};
|
|
369
260
|
height: ${(props) => typeof props.size === "number" ? `${props.size}px` : props.size || "24px"};
|
|
370
261
|
border: ${(props) => props.strokeWidth || 2}px solid
|
|
@@ -400,8 +291,7 @@ Spinner.displayName = "Spinner";
|
|
|
400
291
|
// ../primitives-web/src/Divider.tsx
|
|
401
292
|
var import_styled_components4 = __toESM(require("styled-components"));
|
|
402
293
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
403
|
-
var
|
|
404
|
-
var StyledDivider = (0, import_styled_components4.default)(FilteredDiv3)`
|
|
294
|
+
var StyledDivider = import_styled_components4.default.div`
|
|
405
295
|
background-color: ${(props) => props.dashStroke ? "transparent" : props.color || "rgba(255, 255, 255, 0.15)"};
|
|
406
296
|
width: ${(props) => props.vertical ? typeof props.width === "number" ? `${props.width}px` : props.width || "1px" : "100%"};
|
|
407
297
|
height: ${(props) => props.vertical ? "100%" : typeof props.height === "number" ? `${props.height}px` : props.height || "1px"};
|
|
@@ -427,7 +317,7 @@ var Divider = (props) => {
|
|
|
427
317
|
var import_xui_core3 = require("@xsolla/xui-core");
|
|
428
318
|
|
|
429
319
|
// src/Step.tsx
|
|
430
|
-
var
|
|
320
|
+
var import_react3 = require("react");
|
|
431
321
|
var import_xui_core2 = require("@xsolla/xui-core");
|
|
432
322
|
var import_xui_icons = require("@xsolla/xui-icons");
|
|
433
323
|
|
|
@@ -591,9 +481,9 @@ var StepTail = ({
|
|
|
591
481
|
};
|
|
592
482
|
|
|
593
483
|
// src/hooks/useStepHoverStyles.ts
|
|
594
|
-
var
|
|
484
|
+
var import_react2 = require("react");
|
|
595
485
|
var useStepHoverStyles = (variantUI, state, className, theme, isLast, disabled, noClick, palette) => {
|
|
596
|
-
(0,
|
|
486
|
+
(0, import_react2.useEffect)(() => {
|
|
597
487
|
if (!isWeb()) {
|
|
598
488
|
return;
|
|
599
489
|
}
|
|
@@ -720,7 +610,7 @@ var StepState = ({
|
|
|
720
610
|
className
|
|
721
611
|
}) => {
|
|
722
612
|
const paletteColor = getPaletteColor(palette, theme, "active");
|
|
723
|
-
const iconStyles = (0,
|
|
613
|
+
const iconStyles = (0, import_react3.useMemo)(() => {
|
|
724
614
|
if (variantUI === "simple") {
|
|
725
615
|
switch (state) {
|
|
726
616
|
case "current":
|
|
@@ -870,7 +760,7 @@ var Step = ({
|
|
|
870
760
|
}) => {
|
|
871
761
|
const { theme, mode } = (0, import_xui_core2.useResolvedTheme)({ themeMode, themeProductContext });
|
|
872
762
|
const sizeStyles = theme.sizing.stepper(size);
|
|
873
|
-
const stepClassName = (0,
|
|
763
|
+
const stepClassName = (0, import_react3.useMemo)(
|
|
874
764
|
() => `step-${stepNumber}-${variantUI}-${direction}-${size}-${state}-${palette}`,
|
|
875
765
|
[stepNumber, variantUI, direction, size, state, palette]
|
|
876
766
|
);
|
|
@@ -884,7 +774,7 @@ var Step = ({
|
|
|
884
774
|
noClick,
|
|
885
775
|
palette
|
|
886
776
|
);
|
|
887
|
-
const stepClick = (0,
|
|
777
|
+
const stepClick = (0, import_react3.useCallback)(() => {
|
|
888
778
|
if (onClick && !disabled && !noClick) {
|
|
889
779
|
onClick({
|
|
890
780
|
number: stepNumber,
|
|
@@ -897,7 +787,7 @@ var Step = ({
|
|
|
897
787
|
});
|
|
898
788
|
}
|
|
899
789
|
}, [onClick, disabled, noClick, stepNumber, title, description, state]);
|
|
900
|
-
const stepAriaLabel = (0,
|
|
790
|
+
const stepAriaLabel = (0, import_react3.useMemo)(() => {
|
|
901
791
|
const stepNum = stepNumber + 1;
|
|
902
792
|
const titleText = typeof title === "string" ? title : "Step";
|
|
903
793
|
const descriptionText = description && typeof description === "string" ? description : "";
|
|
@@ -919,7 +809,7 @@ var Step = ({
|
|
|
919
809
|
}
|
|
920
810
|
return label;
|
|
921
811
|
}, [stepNumber, title, description, state, isLast]);
|
|
922
|
-
const handleKeyDown = (0,
|
|
812
|
+
const handleKeyDown = (0, import_react3.useCallback)(
|
|
923
813
|
(event) => {
|
|
924
814
|
if (event.key === "Enter" && !disabled && !noClick) {
|
|
925
815
|
event.preventDefault();
|
|
@@ -931,7 +821,7 @@ var Step = ({
|
|
|
931
821
|
},
|
|
932
822
|
[stepClick, disabled, noClick]
|
|
933
823
|
);
|
|
934
|
-
const handleKeyUp = (0,
|
|
824
|
+
const handleKeyUp = (0, import_react3.useCallback)(
|
|
935
825
|
(event) => {
|
|
936
826
|
if (event.key === " " && !disabled && !noClick) {
|
|
937
827
|
event.preventDefault();
|
|
@@ -942,7 +832,7 @@ var Step = ({
|
|
|
942
832
|
);
|
|
943
833
|
const isInteractive = !disabled && !noClick && !!onClick;
|
|
944
834
|
const isCurrent = state === "current";
|
|
945
|
-
const titleStyles = (0,
|
|
835
|
+
const titleStyles = (0, import_react3.useMemo)(() => {
|
|
946
836
|
if (variantUI === "simple") {
|
|
947
837
|
const sizeStylesMap = {
|
|
948
838
|
sm: {
|
|
@@ -1000,7 +890,7 @@ var Step = ({
|
|
|
1000
890
|
};
|
|
1001
891
|
}
|
|
1002
892
|
}, [variantUI, direction, size, state, theme, palette]);
|
|
1003
|
-
const descriptionStyles = (0,
|
|
893
|
+
const descriptionStyles = (0, import_react3.useMemo)(() => {
|
|
1004
894
|
const sizeStylesMap = {
|
|
1005
895
|
sm: {
|
|
1006
896
|
fontSize: 12,
|
|
@@ -1023,7 +913,7 @@ var Step = ({
|
|
|
1023
913
|
fontWeight: "400"
|
|
1024
914
|
};
|
|
1025
915
|
}, [size, variantUI, state, theme]);
|
|
1026
|
-
const contentWrapperStyles = (0,
|
|
916
|
+
const contentWrapperStyles = (0, import_react3.useMemo)(() => {
|
|
1027
917
|
if (variantUI === "simple") {
|
|
1028
918
|
if (direction === "horizontal") {
|
|
1029
919
|
return {
|
|
@@ -1051,7 +941,7 @@ var Step = ({
|
|
|
1051
941
|
return baseStyles;
|
|
1052
942
|
}
|
|
1053
943
|
}, [variantUI, direction, size]);
|
|
1054
|
-
const stepWrapperStyles = (0,
|
|
944
|
+
const stepWrapperStyles = (0, import_react3.useMemo)(() => {
|
|
1055
945
|
if (variantUI === "current") {
|
|
1056
946
|
if (direction === "horizontal") {
|
|
1057
947
|
return {
|
|
@@ -1460,8 +1350,8 @@ var Step = ({
|
|
|
1460
1350
|
|
|
1461
1351
|
// src/Stepper.tsx
|
|
1462
1352
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1463
|
-
var
|
|
1464
|
-
var Stepper = (0,
|
|
1353
|
+
var import_react5 = require("react");
|
|
1354
|
+
var Stepper = (0, import_react4.forwardRef)(
|
|
1465
1355
|
({
|
|
1466
1356
|
direction = "horizontal",
|
|
1467
1357
|
variantUI = "current",
|
|
@@ -1524,7 +1414,7 @@ var Stepper = (0, import_react5.forwardRef)(
|
|
|
1524
1414
|
const isLast = index === steps.length - 1;
|
|
1525
1415
|
const isFirstColoredTail = index === firstColoredTailIndex;
|
|
1526
1416
|
const isLastColoredTail = index === lastColoredTailIndex;
|
|
1527
|
-
return /* @__PURE__ */ (0,
|
|
1417
|
+
return /* @__PURE__ */ (0, import_react5.createElement)(
|
|
1528
1418
|
Step,
|
|
1529
1419
|
{
|
|
1530
1420
|
size,
|