@xsolla/xui-select 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xsolla/xui-select",
3
- "version": "0.138.0",
3
+ "version": "0.138.1",
4
4
  "main": "./web/index.js",
5
5
  "module": "./web/index.mjs",
6
6
  "types": "./web/index.d.ts",
@@ -13,8 +13,8 @@
13
13
  "test:coverage": "vitest run --coverage"
14
14
  },
15
15
  "dependencies": {
16
- "@xsolla/xui-core": "0.138.0",
17
- "@xsolla/xui-primitives-core": "0.138.0"
16
+ "@xsolla/xui-core": "0.138.1",
17
+ "@xsolla/xui-primitives-core": "0.138.1"
18
18
  },
19
19
  "peerDependencies": {
20
20
  "react": ">=16.8.0",
package/web/index.js CHANGED
@@ -340,6 +340,10 @@ var Icon = ({ children, ...props }) => {
340
340
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(StyledIcon, { ...props, children });
341
341
  };
342
342
 
343
+ // ../primitives-web/src/index.tsx
344
+ var isWeb = true;
345
+ var isNative = false;
346
+
343
347
  // src/Select.tsx
344
348
  var import_xui_core = require("@xsolla/xui-core");
345
349
 
@@ -831,7 +835,7 @@ var Select = ({
831
835
  if (isFocus && selectedItemRef.current && dropdownRef.current) {
832
836
  const timeoutId = setTimeout(() => {
833
837
  const selectedItem = selectedItemRef.current;
834
- if (selectedItem && import_xui_core.isWeb) {
838
+ if (selectedItem && isWeb) {
835
839
  selectedItem.scrollIntoView({ block: "nearest" });
836
840
  }
837
841
  }, 0);
@@ -849,7 +853,7 @@ var Select = ({
849
853
  }
850
854
  }, [isFocus]);
851
855
  (0, import_react3.useEffect)(() => {
852
- if (import_xui_core.isNative || !isOpen) return;
856
+ if (isNative || !isOpen) return;
853
857
  const handleClickOutside = (event) => {
854
858
  if (containerRef.current && !containerRef.current.contains(event.target)) {
855
859
  setIsOpen(false);
@@ -988,11 +992,11 @@ var Select = ({
988
992
  borderRadius: theme.radius.button,
989
993
  style: {
990
994
  zIndex: 1e3,
991
- ...import_xui_core.isNative ? { elevation: 4 } : { boxShadow: "0 4px 12px rgba(0,0,0,0.1)" },
995
+ ...isNative ? { elevation: 4 } : { boxShadow: "0 4px 12px rgba(0,0,0,0.1)" },
992
996
  minWidth: iconOnly ? sizeStyles.height * 3 : void 0
993
997
  },
994
998
  children: [
995
- searchable && !import_xui_core.isNative && /* @__PURE__ */ (0, import_jsx_runtime391.jsx)(
999
+ searchable && !isNative && /* @__PURE__ */ (0, import_jsx_runtime391.jsx)(
996
1000
  Box,
997
1001
  {
998
1002
  paddingHorizontal: sizeStyles.paddingHorizontal,
@@ -1047,7 +1051,7 @@ var Select = ({
1047
1051
  overflow: "scroll",
1048
1052
  style: {
1049
1053
  maxHeight: searchable ? maxHeight - 60 : maxHeight,
1050
- ...import_xui_core.isWeb ? { overflowY: "auto" } : {}
1054
+ ...isWeb ? { overflowY: "auto" } : {}
1051
1055
  },
1052
1056
  children: filteredOptions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime391.jsx)(
1053
1057
  Box,
@@ -1083,7 +1087,7 @@ var Select = ({
1083
1087
  justifyContent: "space-between",
1084
1088
  backgroundColor: isSelected ? brandColors.bg : "transparent",
1085
1089
  style: {
1086
- ...import_xui_core.isWeb ? {
1090
+ ...isWeb ? {
1087
1091
  cursor: isOptionDisabled ? "not-allowed" : "pointer"
1088
1092
  } : {},
1089
1093
  opacity: isOptionDisabled ? 0.5 : 1