@xsolla/xui-stepper 0.138.0 → 0.138.1

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
@@ -352,6 +352,9 @@ var Divider = (props) => {
352
352
  return /* @__PURE__ */ jsx4(StyledDivider, { ...props });
353
353
  };
354
354
 
355
+ // ../primitives-web/src/index.tsx
356
+ var isWeb = true;
357
+
355
358
  // src/Stepper.tsx
356
359
  import { useResolvedTheme as useResolvedTheme3 } from "@xsolla/xui-core";
357
360
 
@@ -394,11 +397,6 @@ var hexToRgba = (hex, opacity) => {
394
397
  return hex;
395
398
  };
396
399
 
397
- // src/utils/platform.ts
398
- var isWeb = () => {
399
- return typeof window !== "undefined" && typeof document !== "undefined";
400
- };
401
-
402
400
  // src/StepTail.tsx
403
401
  import { useResolvedTheme } from "@xsolla/xui-core";
404
402
  import { jsx as jsx5 } from "react/jsx-runtime";
@@ -430,7 +428,7 @@ var StepTail = ({
430
428
  if (isFirstColoredTail && isLastColoredTail) {
431
429
  borderRadius = 4;
432
430
  } else if (isFirstColoredTail) {
433
- if (isWeb()) {
431
+ if (isWeb) {
434
432
  borderRadiusStyle = isHorizontal ? { borderRadius: "4px 0 0 4px" } : { borderRadius: "4px 4px 0 0" };
435
433
  } else {
436
434
  if (isHorizontal) {
@@ -446,7 +444,7 @@ var StepTail = ({
446
444
  }
447
445
  }
448
446
  } else if (isLastColoredTail) {
449
- if (isWeb()) {
447
+ if (isWeb) {
450
448
  borderRadiusStyle = isHorizontal ? { borderRadius: "0 4px 4px 0" } : { borderRadius: "0 0 4px 4px" };
451
449
  } else {
452
450
  if (isHorizontal) {
@@ -523,7 +521,7 @@ var StepTail = ({
523
521
  import { useEffect } from "react";
524
522
  var useStepHoverStyles = (variantUI, state, className, theme, isLast, disabled, noClick, palette) => {
525
523
  useEffect(() => {
526
- if (!isWeb()) {
524
+ if (!isWeb) {
527
525
  return;
528
526
  }
529
527
  const styleId = `step-hover-styles-${className}`;
@@ -1016,14 +1014,14 @@ var Step = ({
1016
1014
  return /* @__PURE__ */ jsxs(
1017
1015
  Box,
1018
1016
  {
1019
- role: isWeb() ? "button" : void 0,
1020
- "aria-label": isWeb() ? stepAriaLabel : void 0,
1021
- "aria-current": isWeb() && isCurrent ? "step" : void 0,
1022
- "aria-disabled": isWeb() && (disabled || noClick) ? true : void 0,
1023
- tabIndex: isWeb() && isInteractive ? 0 : void 0,
1017
+ role: isWeb ? "button" : void 0,
1018
+ "aria-label": isWeb ? stepAriaLabel : void 0,
1019
+ "aria-current": isWeb && isCurrent ? "step" : void 0,
1020
+ "aria-disabled": isWeb && (disabled || noClick) ? true : void 0,
1021
+ tabIndex: isWeb && isInteractive ? 0 : void 0,
1024
1022
  onPress: stepClick,
1025
- onKeyDown: isWeb() && isInteractive ? handleKeyDown : void 0,
1026
- onKeyUp: isWeb() && isInteractive ? handleKeyUp : void 0,
1023
+ onKeyDown: isWeb && isInteractive ? handleKeyDown : void 0,
1024
+ onKeyUp: isWeb && isInteractive ? handleKeyUp : void 0,
1027
1025
  disabled,
1028
1026
  "data-testid": "step",
1029
1027
  className: stepClassName,
@@ -1032,7 +1030,7 @@ var Step = ({
1032
1030
  justifyContent: "flex-start",
1033
1031
  position: "relative",
1034
1032
  ...stepWrapperStyles,
1035
- ...isWeb() && {
1033
+ ...isWeb && {
1036
1034
  cursor: disabled || noClick ? "default" : "pointer"
1037
1035
  },
1038
1036
  children: [
@@ -1122,21 +1120,21 @@ var Step = ({
1122
1120
  return /* @__PURE__ */ jsxs(
1123
1121
  Box,
1124
1122
  {
1125
- role: isWeb() ? "button" : void 0,
1126
- "aria-label": isWeb() ? stepAriaLabel : void 0,
1127
- "aria-current": isWeb() && isCurrent ? "step" : void 0,
1128
- "aria-disabled": isWeb() && (disabled || noClick) ? true : void 0,
1129
- tabIndex: isWeb() && isInteractive ? 0 : void 0,
1123
+ role: isWeb ? "button" : void 0,
1124
+ "aria-label": isWeb ? stepAriaLabel : void 0,
1125
+ "aria-current": isWeb && isCurrent ? "step" : void 0,
1126
+ "aria-disabled": isWeb && (disabled || noClick) ? true : void 0,
1127
+ tabIndex: isWeb && isInteractive ? 0 : void 0,
1130
1128
  onPress: stepClick,
1131
- onKeyDown: isWeb() && isInteractive ? handleKeyDown : void 0,
1132
- onKeyUp: isWeb() && isInteractive ? handleKeyUp : void 0,
1129
+ onKeyDown: isWeb && isInteractive ? handleKeyDown : void 0,
1130
+ onKeyUp: isWeb && isInteractive ? handleKeyUp : void 0,
1133
1131
  disabled,
1134
1132
  "data-testid": "step",
1135
1133
  className: stepClassName,
1136
1134
  flexDirection: "row",
1137
1135
  alignItems: "flex-start",
1138
1136
  ...stepWrapperStyles,
1139
- ...isWeb() && {
1137
+ ...isWeb && {
1140
1138
  cursor: disabled || noClick ? "default" : "pointer"
1141
1139
  },
1142
1140
  children: [
@@ -1210,14 +1208,14 @@ var Step = ({
1210
1208
  return /* @__PURE__ */ jsxs(
1211
1209
  Box,
1212
1210
  {
1213
- role: isWeb() ? "button" : void 0,
1214
- "aria-label": isWeb() ? stepAriaLabel : void 0,
1215
- "aria-current": isWeb() && isCurrent ? "step" : void 0,
1216
- "aria-disabled": isWeb() && (disabled || noClick) ? true : void 0,
1217
- tabIndex: isWeb() && isInteractive ? 0 : void 0,
1211
+ role: isWeb ? "button" : void 0,
1212
+ "aria-label": isWeb ? stepAriaLabel : void 0,
1213
+ "aria-current": isWeb && isCurrent ? "step" : void 0,
1214
+ "aria-disabled": isWeb && (disabled || noClick) ? true : void 0,
1215
+ tabIndex: isWeb && isInteractive ? 0 : void 0,
1218
1216
  onPress: stepClick,
1219
- onKeyDown: isWeb() && isInteractive ? handleKeyDown : void 0,
1220
- onKeyUp: isWeb() && isInteractive ? handleKeyUp : void 0,
1217
+ onKeyDown: isWeb && isInteractive ? handleKeyDown : void 0,
1218
+ onKeyUp: isWeb && isInteractive ? handleKeyUp : void 0,
1221
1219
  disabled,
1222
1220
  "data-testid": "step",
1223
1221
  className: stepClassName,
@@ -1225,7 +1223,7 @@ var Step = ({
1225
1223
  alignItems: "flex-start",
1226
1224
  position: "relative",
1227
1225
  ...stepWrapperStyles,
1228
- ...isWeb() && {
1226
+ ...isWeb && {
1229
1227
  cursor: disabled || noClick ? "default" : "pointer"
1230
1228
  },
1231
1229
  children: [
@@ -1314,21 +1312,21 @@ var Step = ({
1314
1312
  return /* @__PURE__ */ jsxs(
1315
1313
  Box,
1316
1314
  {
1317
- role: isWeb() ? "button" : void 0,
1318
- "aria-label": isWeb() ? stepAriaLabel : void 0,
1319
- "aria-current": isWeb() && isCurrent ? "step" : void 0,
1320
- "aria-disabled": isWeb() && (disabled || noClick) ? true : void 0,
1321
- tabIndex: isWeb() && isInteractive ? 0 : void 0,
1315
+ role: isWeb ? "button" : void 0,
1316
+ "aria-label": isWeb ? stepAriaLabel : void 0,
1317
+ "aria-current": isWeb && isCurrent ? "step" : void 0,
1318
+ "aria-disabled": isWeb && (disabled || noClick) ? true : void 0,
1319
+ tabIndex: isWeb && isInteractive ? 0 : void 0,
1322
1320
  onPress: stepClick,
1323
- onKeyDown: isWeb() && isInteractive ? handleKeyDown : void 0,
1324
- onKeyUp: isWeb() && isInteractive ? handleKeyUp : void 0,
1321
+ onKeyDown: isWeb && isInteractive ? handleKeyDown : void 0,
1322
+ onKeyUp: isWeb && isInteractive ? handleKeyUp : void 0,
1325
1323
  disabled,
1326
1324
  "data-testid": "step",
1327
1325
  className: stepClassName,
1328
1326
  flexDirection: "row",
1329
1327
  alignItems: "flex-start",
1330
1328
  ...stepWrapperStyles,
1331
- ...isWeb() && { cursor: disabled || noClick ? "default" : "pointer" },
1329
+ ...isWeb && { cursor: disabled || noClick ? "default" : "pointer" },
1332
1330
  children: [
1333
1331
  /* @__PURE__ */ jsxs(Box, { flexDirection: "column", alignItems: "center", flexShrink: 0, children: [
1334
1332
  /* @__PURE__ */ jsx6(