@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/native/index.js CHANGED
@@ -298,6 +298,10 @@ var Icon = ({ children, color, size }) => {
298
298
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.View, { style, children: childrenWithProps });
299
299
  };
300
300
 
301
+ // ../primitives-native/src/index.tsx
302
+ var isWeb = false;
303
+ var isNative = true;
304
+
301
305
  // src/Select.tsx
302
306
  var import_xui_core = require("@xsolla/xui-core");
303
307
 
@@ -789,7 +793,7 @@ var Select = ({
789
793
  if (isFocus && selectedItemRef.current && dropdownRef.current) {
790
794
  const timeoutId = setTimeout(() => {
791
795
  const selectedItem = selectedItemRef.current;
792
- if (selectedItem && import_xui_core.isWeb) {
796
+ if (selectedItem && isWeb) {
793
797
  selectedItem.scrollIntoView({ block: "nearest" });
794
798
  }
795
799
  }, 0);
@@ -807,7 +811,7 @@ var Select = ({
807
811
  }
808
812
  }, [isFocus]);
809
813
  (0, import_react2.useEffect)(() => {
810
- if (import_xui_core.isNative || !isOpen) return;
814
+ if (isNative || !isOpen) return;
811
815
  const handleClickOutside = (event) => {
812
816
  if (containerRef.current && !containerRef.current.contains(event.target)) {
813
817
  setIsOpen(false);
@@ -946,11 +950,11 @@ var Select = ({
946
950
  borderRadius: theme.radius.button,
947
951
  style: {
948
952
  zIndex: 1e3,
949
- ...import_xui_core.isNative ? { elevation: 4 } : { boxShadow: "0 4px 12px rgba(0,0,0,0.1)" },
953
+ ...isNative ? { elevation: 4 } : { boxShadow: "0 4px 12px rgba(0,0,0,0.1)" },
950
954
  minWidth: iconOnly ? sizeStyles.height * 3 : void 0
951
955
  },
952
956
  children: [
953
- searchable && !import_xui_core.isNative && /* @__PURE__ */ (0, import_jsx_runtime391.jsx)(
957
+ searchable && !isNative && /* @__PURE__ */ (0, import_jsx_runtime391.jsx)(
954
958
  Box,
955
959
  {
956
960
  paddingHorizontal: sizeStyles.paddingHorizontal,
@@ -1005,7 +1009,7 @@ var Select = ({
1005
1009
  overflow: "scroll",
1006
1010
  style: {
1007
1011
  maxHeight: searchable ? maxHeight - 60 : maxHeight,
1008
- ...import_xui_core.isWeb ? { overflowY: "auto" } : {}
1012
+ ...isWeb ? { overflowY: "auto" } : {}
1009
1013
  },
1010
1014
  children: filteredOptions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime391.jsx)(
1011
1015
  Box,
@@ -1041,7 +1045,7 @@ var Select = ({
1041
1045
  justifyContent: "space-between",
1042
1046
  backgroundColor: isSelected ? brandColors.bg : "transparent",
1043
1047
  style: {
1044
- ...import_xui_core.isWeb ? {
1048
+ ...isWeb ? {
1045
1049
  cursor: isOptionDisabled ? "not-allowed" : "pointer"
1046
1050
  } : {},
1047
1051
  opacity: isOptionDisabled ? 0.5 : 1