@xsolla/xui-b2b-sidebar 0.199.0 → 0.201.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/native/index.js CHANGED
@@ -1074,6 +1074,38 @@ var SidebarContent = ({
1074
1074
  // ../../foundation/primitives-native/src/Box.tsx
1075
1075
  var import_react_native = require("react-native");
1076
1076
  var import_jsx_runtime6 = require("react/jsx-runtime");
1077
+ var roleToAccessibilityRole = {
1078
+ button: "button",
1079
+ link: "link",
1080
+ img: "image",
1081
+ image: "image",
1082
+ summary: "summary",
1083
+ switch: "switch",
1084
+ checkbox: "checkbox",
1085
+ radio: "radio",
1086
+ heading: "header",
1087
+ text: "text",
1088
+ search: "search",
1089
+ alert: "alert",
1090
+ none: "none",
1091
+ presentation: "none",
1092
+ progressbar: "progressbar",
1093
+ scrollbar: "scrollbar",
1094
+ adjustable: "adjustable",
1095
+ tab: "tab",
1096
+ menu: "menu",
1097
+ menuitem: "menuitem",
1098
+ list: "list",
1099
+ timer: "timer"
1100
+ };
1101
+ var toGapValue = (gap) => {
1102
+ if (gap === void 0) return void 0;
1103
+ if (typeof gap === "number") return gap;
1104
+ const pxMatch = /^(\d+(?:\.\d+)?)px$/.exec(gap);
1105
+ if (pxMatch) return Number(pxMatch[1]);
1106
+ const asNumber = Number(gap);
1107
+ return Number.isFinite(asNumber) ? asNumber : void 0;
1108
+ };
1077
1109
  var Box = ({
1078
1110
  children,
1079
1111
  onPress,
@@ -1106,8 +1138,10 @@ var Box = ({
1106
1138
  marginLeft,
1107
1139
  marginRight,
1108
1140
  flexDirection,
1141
+ flexWrap,
1109
1142
  alignItems,
1110
1143
  justifyContent,
1144
+ alignSelf,
1111
1145
  position,
1112
1146
  top,
1113
1147
  bottom,
@@ -1119,11 +1153,14 @@ var Box = ({
1119
1153
  maxWidth,
1120
1154
  maxHeight,
1121
1155
  flex,
1156
+ flexShrink,
1157
+ gap,
1122
1158
  overflow,
1123
1159
  zIndex,
1124
1160
  hoverStyle,
1125
1161
  pressStyle,
1126
1162
  style,
1163
+ disabled,
1127
1164
  "data-testid": dataTestId,
1128
1165
  testID,
1129
1166
  as,
@@ -1162,14 +1199,18 @@ var Box = ({
1162
1199
  marginLeft,
1163
1200
  marginRight,
1164
1201
  flexDirection,
1202
+ flexWrap,
1165
1203
  alignItems,
1166
1204
  justifyContent,
1205
+ alignSelf,
1167
1206
  position,
1168
1207
  top,
1169
1208
  bottom,
1170
1209
  left,
1171
1210
  right,
1172
1211
  flex,
1212
+ flexShrink,
1213
+ gap: toGapValue(gap),
1173
1214
  ...style
1174
1215
  });
1175
1216
  const finalTestID = dataTestId || testID;
@@ -1178,15 +1219,25 @@ var Box = ({
1178
1219
  tabIndex,
1179
1220
  onKeyDown,
1180
1221
  onKeyUp,
1181
- "aria-label": _ariaLabel,
1222
+ "aria-label": ariaLabel,
1182
1223
  "aria-labelledby": _ariaLabelledBy,
1183
1224
  "aria-current": _ariaCurrent,
1184
- "aria-disabled": _ariaDisabled,
1185
- "aria-live": _ariaLive,
1225
+ "aria-disabled": ariaDisabled,
1226
+ "aria-live": ariaLive,
1227
+ "aria-busy": ariaBusy,
1186
1228
  className,
1187
1229
  "data-testid": _dataTestId,
1230
+ cursor: _cursor,
1231
+ type: _type,
1188
1232
  ...nativeRest
1189
1233
  } = rest;
1234
+ const accessibilityRole = typeof role === "string" && roleToAccessibilityRole[role] || (as === "button" ? "button" : void 0);
1235
+ const isDisabled = Boolean(disabled || ariaDisabled);
1236
+ const accessibilityState = {
1237
+ disabled: isDisabled || void 0,
1238
+ busy: Boolean(ariaBusy) || void 0
1239
+ };
1240
+ const accessibilityLiveRegion = ariaLive === "polite" || ariaLive === "assertive" ? ariaLive : void 0;
1190
1241
  if (as === "img" && src) {
1191
1242
  const imageStyle = {
1192
1243
  width,
@@ -1205,16 +1256,18 @@ var Box = ({
1205
1256
  source: { uri: src },
1206
1257
  style: imageStyle,
1207
1258
  testID: finalTestID,
1259
+ accessibilityLabel: typeof ariaLabel === "string" ? ariaLabel : alt,
1208
1260
  resizeMode: "cover",
1209
1261
  ...nativeRest
1210
1262
  }
1211
1263
  );
1212
1264
  }
1213
- if (onPress) {
1265
+ if (onPress || as === "button") {
1214
1266
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1215
1267
  import_react_native.Pressable,
1216
1268
  {
1217
- onPress,
1269
+ onPress: !isDisabled && onPress ? onPress : void 0,
1270
+ disabled: isDisabled,
1218
1271
  onLayout,
1219
1272
  onMoveShouldSetResponder,
1220
1273
  onResponderGrant,
@@ -1223,6 +1276,10 @@ var Box = ({
1223
1276
  onResponderTerminate,
1224
1277
  style: ({ pressed }) => getContainerStyle(pressed),
1225
1278
  testID: finalTestID,
1279
+ accessibilityRole,
1280
+ accessibilityLabel: typeof ariaLabel === "string" ? ariaLabel : void 0,
1281
+ accessibilityState,
1282
+ accessibilityLiveRegion,
1226
1283
  ...nativeRest,
1227
1284
  children
1228
1285
  }
@@ -1239,6 +1296,10 @@ var Box = ({
1239
1296
  onResponderMove,
1240
1297
  onResponderRelease,
1241
1298
  onResponderTerminate,
1299
+ accessibilityRole,
1300
+ accessibilityLabel: typeof ariaLabel === "string" ? ariaLabel : void 0,
1301
+ accessibilityState,
1302
+ accessibilityLiveRegion,
1242
1303
  ...nativeRest,
1243
1304
  children
1244
1305
  }