@xsolla/xui-multi-select 0.94.0 → 0.95.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
@@ -653,6 +653,10 @@ var import_jsx_runtime382 = require("react/jsx-runtime");
653
653
  var import_jsx_runtime383 = require("react/jsx-runtime");
654
654
  var import_jsx_runtime384 = require("react/jsx-runtime");
655
655
  var import_jsx_runtime385 = require("react/jsx-runtime");
656
+ var import_jsx_runtime386 = require("react/jsx-runtime");
657
+ var import_jsx_runtime387 = require("react/jsx-runtime");
658
+ var import_jsx_runtime388 = require("react/jsx-runtime");
659
+ var import_jsx_runtime389 = require("react/jsx-runtime");
656
660
  var StyledIcon = import_styled_components.default.div`
657
661
  display: inline-flex;
658
662
  align-items: center;
@@ -670,15 +674,15 @@ var BaseIcon = ({
670
674
  variant = "line",
671
675
  size = 24,
672
676
  color = "currentColor",
673
- solidContent: solidContent382,
674
- lineContent: lineContent382,
677
+ solidContent: solidContent386,
678
+ lineContent: lineContent386,
675
679
  className,
676
680
  style,
677
681
  "data-testid": testId,
678
682
  "aria-label": ariaLabel,
679
683
  "aria-hidden": ariaHidden
680
684
  }) => {
681
- const svgContent = variant === "line" ? lineContent382 : solidContent382;
685
+ const svgContent = variant === "line" ? lineContent386 : solidContent386;
682
686
  const sizeValue = typeof size === "number" ? `${size}px` : size;
683
687
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
684
688
  StyledIcon,
@@ -714,16 +718,16 @@ var import_react5 = require("react");
714
718
  // ../tag/dist/web/index.mjs
715
719
  var import_react4 = __toESM(require("react"), 1);
716
720
  var import_styled_components3 = __toESM(require("styled-components"), 1);
717
- var import_jsx_runtime388 = require("react/jsx-runtime");
721
+ var import_jsx_runtime392 = require("react/jsx-runtime");
718
722
  var import_styled_components4 = __toESM(require("styled-components"), 1);
719
- var import_jsx_runtime389 = require("react/jsx-runtime");
723
+ var import_jsx_runtime393 = require("react/jsx-runtime");
720
724
  var import_styled_components5 = __toESM(require("styled-components"), 1);
721
- var import_jsx_runtime390 = require("react/jsx-runtime");
725
+ var import_jsx_runtime394 = require("react/jsx-runtime");
722
726
  var import_xui_core = require("@xsolla/xui-core");
723
727
 
724
728
  // ../icons/dist/web/index.mjs
725
729
  var import_styled_components2 = __toESM(require("styled-components"), 1);
726
- var import_jsx_runtime386 = require("react/jsx-runtime");
730
+ var import_jsx_runtime390 = require("react/jsx-runtime");
727
731
 
728
732
  // ../../node_modules/lucide-react/dist/esm/createLucideIcon.js
729
733
  var import_react3 = require("react");
@@ -803,7 +807,7 @@ var X = createLucideIcon("X", [
803
807
  ]);
804
808
 
805
809
  // ../icons/dist/web/index.mjs
806
- var import_jsx_runtime387 = require("react/jsx-runtime");
810
+ var import_jsx_runtime391 = require("react/jsx-runtime");
807
811
  var StyledIcon2 = import_styled_components2.default.div`
808
812
  display: flex;
809
813
  align-items: center;
@@ -820,12 +824,12 @@ var StyledIcon2 = import_styled_components2.default.div`
820
824
  }
821
825
  `;
822
826
  var Icon3 = ({ children, ...props }) => {
823
- return /* @__PURE__ */ (0, import_jsx_runtime386.jsx)(StyledIcon2, { ...props, children });
827
+ return /* @__PURE__ */ (0, import_jsx_runtime390.jsx)(StyledIcon2, { ...props, children });
824
828
  };
825
- var X2 = (props) => /* @__PURE__ */ (0, import_jsx_runtime387.jsx)(Icon3, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime387.jsx)(X, { size: "100%" }) });
829
+ var X2 = (props) => /* @__PURE__ */ (0, import_jsx_runtime391.jsx)(Icon3, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime391.jsx)(X, { size: "100%" }) });
826
830
 
827
831
  // ../tag/dist/web/index.mjs
828
- var import_jsx_runtime391 = require("react/jsx-runtime");
832
+ var import_jsx_runtime395 = require("react/jsx-runtime");
829
833
  var StyledBox = import_styled_components3.default.div`
830
834
  display: flex;
831
835
  box-sizing: border-box;
@@ -939,7 +943,7 @@ var Box2 = import_react4.default.forwardRef(
939
943
  ...props
940
944
  }, ref) => {
941
945
  if (as === "img" && src) {
942
- return /* @__PURE__ */ (0, import_jsx_runtime388.jsx)(
946
+ return /* @__PURE__ */ (0, import_jsx_runtime392.jsx)(
943
947
  "img",
944
948
  {
945
949
  src,
@@ -959,7 +963,7 @@ var Box2 = import_react4.default.forwardRef(
959
963
  }
960
964
  );
961
965
  }
962
- return /* @__PURE__ */ (0, import_jsx_runtime388.jsx)(
966
+ return /* @__PURE__ */ (0, import_jsx_runtime392.jsx)(
963
967
  StyledBox,
964
968
  {
965
969
  ref,
@@ -1007,7 +1011,7 @@ var Text2 = ({
1007
1011
  role,
1008
1012
  ...props
1009
1013
  }) => {
1010
- return /* @__PURE__ */ (0, import_jsx_runtime389.jsx)(
1014
+ return /* @__PURE__ */ (0, import_jsx_runtime393.jsx)(
1011
1015
  StyledText,
1012
1016
  {
1013
1017
  ...props,
@@ -1034,7 +1038,7 @@ var StyledIcon3 = import_styled_components5.default.div`
1034
1038
  }
1035
1039
  `;
1036
1040
  var Icon4 = ({ children, ...props }) => {
1037
- return /* @__PURE__ */ (0, import_jsx_runtime390.jsx)(StyledIcon3, { ...props, children });
1041
+ return /* @__PURE__ */ (0, import_jsx_runtime394.jsx)(StyledIcon3, { ...props, children });
1038
1042
  };
1039
1043
  var Tag = ({
1040
1044
  size = "md",
@@ -1095,7 +1099,7 @@ var Tag = ({
1095
1099
  }
1096
1100
  };
1097
1101
  const { bg, text } = resolveColors();
1098
- return /* @__PURE__ */ (0, import_jsx_runtime391.jsxs)(
1102
+ return /* @__PURE__ */ (0, import_jsx_runtime395.jsxs)(
1099
1103
  Box2,
1100
1104
  {
1101
1105
  backgroundColor: bg,
@@ -1112,8 +1116,8 @@ var Tag = ({
1112
1116
  whiteSpace: "nowrap"
1113
1117
  },
1114
1118
  children: [
1115
- icon && /* @__PURE__ */ (0, import_jsx_runtime391.jsx)(Icon4, { size: sizeStyles.iconSize, color: text, children: icon }),
1116
- /* @__PURE__ */ (0, import_jsx_runtime391.jsx)(
1119
+ icon && /* @__PURE__ */ (0, import_jsx_runtime395.jsx)(Icon4, { size: sizeStyles.iconSize, color: text, children: icon }),
1120
+ /* @__PURE__ */ (0, import_jsx_runtime395.jsx)(
1117
1121
  Text2,
1118
1122
  {
1119
1123
  color: text,
@@ -1127,7 +1131,7 @@ var Tag = ({
1127
1131
  children
1128
1132
  }
1129
1133
  ),
1130
- onRemove && /* @__PURE__ */ (0, import_jsx_runtime391.jsx)(Box2, { onPress: onRemove, children: /* @__PURE__ */ (0, import_jsx_runtime391.jsx)(X2, { size: sizeStyles.iconSize, color: text }) })
1134
+ onRemove && /* @__PURE__ */ (0, import_jsx_runtime395.jsx)(Box2, { onPress: onRemove, children: /* @__PURE__ */ (0, import_jsx_runtime395.jsx)(X2, { size: sizeStyles.iconSize, color: text }) })
1131
1135
  ]
1132
1136
  }
1133
1137
  );
@@ -1135,7 +1139,7 @@ var Tag = ({
1135
1139
 
1136
1140
  // src/useMultiSelectControl.tsx
1137
1141
  var import_xui_core2 = require("@xsolla/xui-core");
1138
- var import_jsx_runtime392 = require("react/jsx-runtime");
1142
+ var import_jsx_runtime396 = require("react/jsx-runtime");
1139
1143
  var COUNT_ITEM_VALUE = "count-item";
1140
1144
  var useMultiSelectControl = ({
1141
1145
  variant,
@@ -1195,7 +1199,7 @@ var useMultiSelectControl = ({
1195
1199
  };
1196
1200
  const setPlaceholder = () => {
1197
1201
  setSelectedContent(
1198
- /* @__PURE__ */ (0, import_jsx_runtime392.jsx)(
1202
+ /* @__PURE__ */ (0, import_jsx_runtime396.jsx)(
1199
1203
  Text,
1200
1204
  {
1201
1205
  color: theme.colors.control.input.placeholder,
@@ -1246,7 +1250,7 @@ var useMultiSelectControl = ({
1246
1250
  const isCount = item.value === COUNT_ITEM_VALUE;
1247
1251
  const isReducable = index === 0 && displayStateRef.current === 3 /* Render */ && displayedItemsCount === 0 || flexible;
1248
1252
  if (variant === "tag") {
1249
- return /* @__PURE__ */ (0, import_jsx_runtime392.jsx)(
1253
+ return /* @__PURE__ */ (0, import_jsx_runtime396.jsx)(
1250
1254
  Box,
1251
1255
  {
1252
1256
  onPress: !isCount ? (e) => {
@@ -1258,7 +1262,7 @@ var useMultiSelectControl = ({
1258
1262
  opacity: disabled ? 0.5 : 1,
1259
1263
  cursor: disabled || isCount ? "not-allowed" : "pointer"
1260
1264
  },
1261
- children: /* @__PURE__ */ (0, import_jsx_runtime392.jsx)(
1265
+ children: /* @__PURE__ */ (0, import_jsx_runtime396.jsx)(
1262
1266
  Tag,
1263
1267
  {
1264
1268
  size,
@@ -1276,7 +1280,7 @@ var useMultiSelectControl = ({
1276
1280
  }
1277
1281
  const isCountItem = hasHidden;
1278
1282
  const needsComma = index < displayedItems.length - 2 || index < displayedItems.length - 1 && !isCountItem;
1279
- return /* @__PURE__ */ (0, import_jsx_runtime392.jsxs)(
1283
+ return /* @__PURE__ */ (0, import_jsx_runtime396.jsxs)(
1280
1284
  Text,
1281
1285
  {
1282
1286
  color: theme.colors.content.primary,
@@ -1378,7 +1382,7 @@ var useMultiSelectControl = ({
1378
1382
  };
1379
1383
 
1380
1384
  // src/MultiSelectControl.tsx
1381
- var import_jsx_runtime393 = require("react/jsx-runtime");
1385
+ var import_jsx_runtime397 = require("react/jsx-runtime");
1382
1386
  var MultiSelectControl = (0, import_react6.forwardRef)(
1383
1387
  ({
1384
1388
  variant = "tag",
@@ -1441,7 +1445,7 @@ var MultiSelectControl = (0, import_react6.forwardRef)(
1441
1445
  borderColor = inputColors.borderHover;
1442
1446
  }
1443
1447
  const iconColor = isDisable ? inputColors.textDisable : inputColors.placeholder;
1444
- return /* @__PURE__ */ (0, import_jsx_runtime393.jsxs)(
1448
+ return /* @__PURE__ */ (0, import_jsx_runtime397.jsxs)(
1445
1449
  Box,
1446
1450
  {
1447
1451
  ref,
@@ -1469,7 +1473,7 @@ var MultiSelectControl = (0, import_react6.forwardRef)(
1469
1473
  borderColor: inputColors.borderHover
1470
1474
  } : void 0,
1471
1475
  children: [
1472
- /* @__PURE__ */ (0, import_jsx_runtime393.jsxs)(
1476
+ /* @__PURE__ */ (0, import_jsx_runtime397.jsxs)(
1473
1477
  Box,
1474
1478
  {
1475
1479
  ref: containerRef,
@@ -1479,8 +1483,8 @@ var MultiSelectControl = (0, import_react6.forwardRef)(
1479
1483
  gap: 8,
1480
1484
  style: { minWidth: 0 },
1481
1485
  children: [
1482
- iconLeft && /* @__PURE__ */ (0, import_jsx_runtime393.jsx)(Icon, { size: sizeStyles.iconSize, color: iconColor, variant: "line", children: iconLeft }),
1483
- /* @__PURE__ */ (0, import_jsx_runtime393.jsx)(
1486
+ iconLeft && /* @__PURE__ */ (0, import_jsx_runtime397.jsx)(Icon, { size: sizeStyles.iconSize, color: iconColor, variant: "line", children: iconLeft }),
1487
+ /* @__PURE__ */ (0, import_jsx_runtime397.jsx)(
1484
1488
  Box,
1485
1489
  {
1486
1490
  ref: itemsRef,
@@ -1499,8 +1503,8 @@ var MultiSelectControl = (0, import_react6.forwardRef)(
1499
1503
  ]
1500
1504
  }
1501
1505
  ),
1502
- /* @__PURE__ */ (0, import_jsx_runtime393.jsxs)(Box, { flexDirection: "row", alignItems: "center", gap: 4, children: [
1503
- extraClear && selectedItems.length > 0 && !isDisable && /* @__PURE__ */ (0, import_jsx_runtime393.jsx)(
1506
+ /* @__PURE__ */ (0, import_jsx_runtime397.jsxs)(Box, { flexDirection: "row", alignItems: "center", gap: 4, children: [
1507
+ extraClear && selectedItems.length > 0 && !isDisable && /* @__PURE__ */ (0, import_jsx_runtime397.jsx)(
1504
1508
  Box,
1505
1509
  {
1506
1510
  onPress: (e) => {
@@ -1508,17 +1512,17 @@ var MultiSelectControl = (0, import_react6.forwardRef)(
1508
1512
  removeAllValues();
1509
1513
  },
1510
1514
  style: { cursor: "pointer" },
1511
- children: /* @__PURE__ */ (0, import_jsx_runtime393.jsx)(Remove, { size: 18, color: iconColor, variant: "line" })
1515
+ children: /* @__PURE__ */ (0, import_jsx_runtime397.jsx)(Remove, { size: 18, color: iconColor, variant: "line" })
1512
1516
  }
1513
1517
  ),
1514
- isError && /* @__PURE__ */ (0, import_jsx_runtime393.jsx)(
1518
+ isError && /* @__PURE__ */ (0, import_jsx_runtime397.jsx)(
1515
1519
  ExclamationMarkCr,
1516
1520
  {
1517
1521
  size: 18,
1518
1522
  color: theme.colors.content.alert.primary
1519
1523
  }
1520
1524
  ),
1521
- iconRight ? iconRight : isOpen ? /* @__PURE__ */ (0, import_jsx_runtime393.jsx)(ChevronUp, { size: 18, color: iconColor, variant: "line" }) : /* @__PURE__ */ (0, import_jsx_runtime393.jsx)(ChevronDown, { size: 18, color: iconColor })
1525
+ iconRight ? iconRight : isOpen ? /* @__PURE__ */ (0, import_jsx_runtime397.jsx)(ChevronUp, { size: 18, color: iconColor, variant: "line" }) : /* @__PURE__ */ (0, import_jsx_runtime397.jsx)(ChevronDown, { size: 18, color: iconColor })
1522
1526
  ] })
1523
1527
  ]
1524
1528
  }
@@ -1619,7 +1623,7 @@ var useMultiSelect = ({
1619
1623
  };
1620
1624
 
1621
1625
  // src/MultiSelect.tsx
1622
- var import_jsx_runtime394 = require("react/jsx-runtime");
1626
+ var import_jsx_runtime398 = require("react/jsx-runtime");
1623
1627
  var MultiSelect = (0, import_react8.forwardRef)(
1624
1628
  ({
1625
1629
  options,
@@ -1683,8 +1687,8 @@ var MultiSelect = (0, import_react8.forwardRef)(
1683
1687
  const newValues = checked ? [...values, value2] : values.filter((v) => v !== value2);
1684
1688
  onChoose(newValues.map(String));
1685
1689
  };
1686
- return /* @__PURE__ */ (0, import_jsx_runtime394.jsxs)(Box, { flexDirection: "column", gap: sizeStyles.fieldGap, children: [
1687
- label && /* @__PURE__ */ (0, import_jsx_runtime394.jsx)(
1690
+ return /* @__PURE__ */ (0, import_jsx_runtime398.jsxs)(Box, { flexDirection: "column", gap: sizeStyles.fieldGap, children: [
1691
+ label && /* @__PURE__ */ (0, import_jsx_runtime398.jsx)(
1688
1692
  Text,
1689
1693
  {
1690
1694
  color: theme.colors.content.secondary,
@@ -1693,7 +1697,7 @@ var MultiSelect = (0, import_react8.forwardRef)(
1693
1697
  children: label
1694
1698
  }
1695
1699
  ),
1696
- /* @__PURE__ */ (0, import_jsx_runtime394.jsxs)(
1700
+ /* @__PURE__ */ (0, import_jsx_runtime398.jsxs)(
1697
1701
  Box,
1698
1702
  {
1699
1703
  ref,
@@ -1701,7 +1705,7 @@ var MultiSelect = (0, import_react8.forwardRef)(
1701
1705
  position: "relative"
1702
1706
  },
1703
1707
  children: [
1704
- /* @__PURE__ */ (0, import_jsx_runtime394.jsx)(
1708
+ /* @__PURE__ */ (0, import_jsx_runtime398.jsx)(
1705
1709
  MultiSelectControl,
1706
1710
  {
1707
1711
  ref: controlRef,
@@ -1725,8 +1729,8 @@ var MultiSelect = (0, import_react8.forwardRef)(
1725
1729
  extraClear
1726
1730
  }
1727
1731
  ),
1728
- isOpen && !isDisable && /* @__PURE__ */ (0, import_jsx_runtime394.jsxs)(import_jsx_runtime394.Fragment, { children: [
1729
- /* @__PURE__ */ (0, import_jsx_runtime394.jsx)(
1732
+ isOpen && !isDisable && /* @__PURE__ */ (0, import_jsx_runtime398.jsxs)(import_jsx_runtime398.Fragment, { children: [
1733
+ /* @__PURE__ */ (0, import_jsx_runtime398.jsx)(
1730
1734
  Box,
1731
1735
  {
1732
1736
  style: {
@@ -1741,7 +1745,7 @@ var MultiSelect = (0, import_react8.forwardRef)(
1741
1745
  onPress: onClose
1742
1746
  }
1743
1747
  ),
1744
- /* @__PURE__ */ (0, import_jsx_runtime394.jsx)(
1748
+ /* @__PURE__ */ (0, import_jsx_runtime398.jsx)(
1745
1749
  Box,
1746
1750
  {
1747
1751
  ref: menuRef,
@@ -1765,7 +1769,7 @@ var MultiSelect = (0, import_react8.forwardRef)(
1765
1769
  children: menuItems.map((item, _index) => {
1766
1770
  const brandColors = theme.colors.control.brand.primary;
1767
1771
  const contentColors = theme.colors.content;
1768
- return /* @__PURE__ */ (0, import_jsx_runtime394.jsx)(
1772
+ return /* @__PURE__ */ (0, import_jsx_runtime398.jsx)(
1769
1773
  Box,
1770
1774
  {
1771
1775
  paddingHorizontal: sizeStyles.paddingHorizontal,
@@ -1786,7 +1790,7 @@ var MultiSelect = (0, import_react8.forwardRef)(
1786
1790
  cursor: item.disabled ? "not-allowed" : "pointer",
1787
1791
  opacity: item.disabled ? 0.5 : 1
1788
1792
  },
1789
- children: /* @__PURE__ */ (0, import_jsx_runtime394.jsx)(
1793
+ children: /* @__PURE__ */ (0, import_jsx_runtime398.jsx)(
1790
1794
  Text,
1791
1795
  {
1792
1796
  color: item.checked ? contentColors.on.brand : theme.colors.content.secondary,
@@ -1805,7 +1809,7 @@ var MultiSelect = (0, import_react8.forwardRef)(
1805
1809
  ]
1806
1810
  }
1807
1811
  ),
1808
- errorMessage && /* @__PURE__ */ (0, import_jsx_runtime394.jsx)(
1812
+ errorMessage && /* @__PURE__ */ (0, import_jsx_runtime398.jsx)(
1809
1813
  Text,
1810
1814
  {
1811
1815
  color: theme.colors.content.alert.primary,