@xsolla/xui-stepper 0.206.2 → 0.207.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/README.md +31 -11
- package/native/index.js +32 -17
- package/native/index.js.map +1 -1
- package/native/index.mjs +33 -18
- package/native/index.mjs.map +1 -1
- package/package.json +4 -4
- package/web/index.js +32 -17
- package/web/index.js.map +1 -1
- package/web/index.mjs +33 -18
- package/web/index.mjs.map +1 -1
package/web/index.js
CHANGED
|
@@ -1574,6 +1574,8 @@ var import_xui_icons2 = require("@xsolla/xui-icons");
|
|
|
1574
1574
|
// src/ProgressStepItem.tsx
|
|
1575
1575
|
var import_xui_core4 = require("@xsolla/xui-core");
|
|
1576
1576
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1577
|
+
var DEFAULT_OPACITY = 0.2;
|
|
1578
|
+
var HOVER_OPACITY = 0.5;
|
|
1577
1579
|
var ProgressStepItem = ({
|
|
1578
1580
|
state = "default",
|
|
1579
1581
|
size = "md",
|
|
@@ -1596,8 +1598,9 @@ var ProgressStepItem = ({
|
|
|
1596
1598
|
let opacity = 1;
|
|
1597
1599
|
if (!isActive) {
|
|
1598
1600
|
backgroundColor = theme.colors.content.tertiary || "rgba(0, 0, 0, 0.6)";
|
|
1599
|
-
opacity = isHover ?
|
|
1601
|
+
opacity = isHover ? HOVER_OPACITY : DEFAULT_OPACITY;
|
|
1600
1602
|
}
|
|
1603
|
+
const hoverStyle = onPress && !isActive && !isHover ? { opacity: HOVER_OPACITY } : void 0;
|
|
1601
1604
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1602
1605
|
Box,
|
|
1603
1606
|
{
|
|
@@ -1608,6 +1611,7 @@ var ProgressStepItem = ({
|
|
|
1608
1611
|
borderRadius,
|
|
1609
1612
|
backgroundColor,
|
|
1610
1613
|
opacity,
|
|
1614
|
+
hoverStyle,
|
|
1611
1615
|
onPress,
|
|
1612
1616
|
onMouseEnter,
|
|
1613
1617
|
onMouseLeave,
|
|
@@ -1640,10 +1644,11 @@ var ProgressStep = ({
|
|
|
1640
1644
|
onStepPress(activeStep + 1);
|
|
1641
1645
|
}
|
|
1642
1646
|
};
|
|
1643
|
-
const
|
|
1647
|
+
const controlSize = size === "md" ? 24 : 18;
|
|
1644
1648
|
const iconSize = size === "md" ? 18 : 14;
|
|
1645
|
-
const
|
|
1646
|
-
const
|
|
1649
|
+
const isPrevDisabled = activeStep <= 0 || !onStepPress;
|
|
1650
|
+
const isNextDisabled = activeStep >= count - 1 || !onStepPress;
|
|
1651
|
+
const hoverBackground = theme.colors.overlay?.mono || "rgba(127, 127, 127, 0.16)";
|
|
1647
1652
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1648
1653
|
Box,
|
|
1649
1654
|
{
|
|
@@ -1653,20 +1658,25 @@ var ProgressStep = ({
|
|
|
1653
1658
|
alignItems: "center",
|
|
1654
1659
|
justifyContent: "center",
|
|
1655
1660
|
gap: 4,
|
|
1656
|
-
height:
|
|
1661
|
+
height: controlSize,
|
|
1657
1662
|
children: [
|
|
1658
1663
|
arrows && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1659
1664
|
Box,
|
|
1660
1665
|
{
|
|
1661
|
-
onPress: handlePrev,
|
|
1662
|
-
width:
|
|
1663
|
-
height:
|
|
1666
|
+
onPress: isPrevDisabled ? void 0 : handlePrev,
|
|
1667
|
+
width: controlSize,
|
|
1668
|
+
height: controlSize,
|
|
1664
1669
|
alignItems: "center",
|
|
1665
1670
|
justifyContent: "center",
|
|
1666
1671
|
borderRadius: 4,
|
|
1667
|
-
opacity:
|
|
1668
|
-
cursor:
|
|
1669
|
-
|
|
1672
|
+
opacity: isPrevDisabled ? 0.6 : 1,
|
|
1673
|
+
cursor: isPrevDisabled ? "not-allowed" : "pointer",
|
|
1674
|
+
hoverStyle: isPrevDisabled ? void 0 : { backgroundColor: hoverBackground },
|
|
1675
|
+
role: "button",
|
|
1676
|
+
"aria-label": "Previous step",
|
|
1677
|
+
"aria-disabled": isPrevDisabled,
|
|
1678
|
+
testID: testID ? `${testID}-prev` : void 0,
|
|
1679
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_xui_icons2.ChevronLeft, { size: iconSize, color: theme.colors.content.primary })
|
|
1670
1680
|
}
|
|
1671
1681
|
),
|
|
1672
1682
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Box, { flexDirection: "row", alignItems: "center", gap: 4, children: Array.from({ length: count }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
@@ -1681,15 +1691,20 @@ var ProgressStep = ({
|
|
|
1681
1691
|
arrows && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1682
1692
|
Box,
|
|
1683
1693
|
{
|
|
1684
|
-
onPress: handleNext,
|
|
1685
|
-
width:
|
|
1686
|
-
height:
|
|
1694
|
+
onPress: isNextDisabled ? void 0 : handleNext,
|
|
1695
|
+
width: controlSize,
|
|
1696
|
+
height: controlSize,
|
|
1687
1697
|
alignItems: "center",
|
|
1688
1698
|
justifyContent: "center",
|
|
1689
1699
|
borderRadius: 4,
|
|
1690
|
-
opacity:
|
|
1691
|
-
cursor:
|
|
1692
|
-
|
|
1700
|
+
opacity: isNextDisabled ? 0.6 : 1,
|
|
1701
|
+
cursor: isNextDisabled ? "not-allowed" : "pointer",
|
|
1702
|
+
hoverStyle: isNextDisabled ? void 0 : { backgroundColor: hoverBackground },
|
|
1703
|
+
role: "button",
|
|
1704
|
+
"aria-label": "Next step",
|
|
1705
|
+
"aria-disabled": isNextDisabled,
|
|
1706
|
+
testID: testID ? `${testID}-next` : void 0,
|
|
1707
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_xui_icons2.ChevronRight, { size: iconSize, color: theme.colors.content.primary })
|
|
1693
1708
|
}
|
|
1694
1709
|
)
|
|
1695
1710
|
]
|