@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 +49 -45
- package/native/index.js.map +1 -1
- package/native/index.mjs +33 -29
- package/native/index.mjs.map +1 -1
- package/package.json +5 -5
- package/web/index.js +49 -45
- package/web/index.js.map +1 -1
- package/web/index.mjs +33 -29
- package/web/index.mjs.map +1 -1
package/native/index.mjs
CHANGED
|
@@ -621,6 +621,10 @@ import { jsx as jsx379 } from "react/jsx-runtime";
|
|
|
621
621
|
import { jsx as jsx380 } from "react/jsx-runtime";
|
|
622
622
|
import { jsx as jsx381 } from "react/jsx-runtime";
|
|
623
623
|
import { jsx as jsx382 } from "react/jsx-runtime";
|
|
624
|
+
import { jsx as jsx383 } from "react/jsx-runtime";
|
|
625
|
+
import { jsx as jsx384 } from "react/jsx-runtime";
|
|
626
|
+
import { jsx as jsx385 } from "react/jsx-runtime";
|
|
627
|
+
import { jsx as jsx386 } from "react/jsx-runtime";
|
|
624
628
|
var StyledIcon = styled.div`
|
|
625
629
|
display: inline-flex;
|
|
626
630
|
align-items: center;
|
|
@@ -638,15 +642,15 @@ var BaseIcon = ({
|
|
|
638
642
|
variant = "line",
|
|
639
643
|
size = 24,
|
|
640
644
|
color = "currentColor",
|
|
641
|
-
solidContent:
|
|
642
|
-
lineContent:
|
|
645
|
+
solidContent: solidContent386,
|
|
646
|
+
lineContent: lineContent386,
|
|
643
647
|
className,
|
|
644
648
|
style,
|
|
645
649
|
"data-testid": testId,
|
|
646
650
|
"aria-label": ariaLabel,
|
|
647
651
|
"aria-hidden": ariaHidden
|
|
648
652
|
}) => {
|
|
649
|
-
const svgContent = variant === "line" ?
|
|
653
|
+
const svgContent = variant === "line" ? lineContent386 : solidContent386;
|
|
650
654
|
const sizeValue = typeof size === "number" ? `${size}px` : size;
|
|
651
655
|
return /* @__PURE__ */ jsx4(
|
|
652
656
|
StyledIcon,
|
|
@@ -687,16 +691,16 @@ import {
|
|
|
687
691
|
// ../tag/dist/web/index.mjs
|
|
688
692
|
import React2 from "react";
|
|
689
693
|
import styled3 from "styled-components";
|
|
690
|
-
import { jsx as
|
|
694
|
+
import { jsx as jsx388 } from "react/jsx-runtime";
|
|
691
695
|
import styled22 from "styled-components";
|
|
692
696
|
import { jsx as jsx2101 } from "react/jsx-runtime";
|
|
693
697
|
import styled32 from "styled-components";
|
|
694
|
-
import { jsx as
|
|
698
|
+
import { jsx as jsx389 } from "react/jsx-runtime";
|
|
695
699
|
import { useDesignSystem } from "@xsolla/xui-core";
|
|
696
700
|
|
|
697
701
|
// ../icons/dist/web/index.mjs
|
|
698
702
|
import styled2 from "styled-components";
|
|
699
|
-
import { jsx as
|
|
703
|
+
import { jsx as jsx387 } from "react/jsx-runtime";
|
|
700
704
|
|
|
701
705
|
// ../../node_modules/lucide-react/dist/esm/createLucideIcon.js
|
|
702
706
|
import { forwardRef as forwardRef2, createElement as createElement2 } from "react";
|
|
@@ -793,7 +797,7 @@ var StyledIcon2 = styled2.div`
|
|
|
793
797
|
}
|
|
794
798
|
`;
|
|
795
799
|
var Icon3 = ({ children, ...props }) => {
|
|
796
|
-
return /* @__PURE__ */
|
|
800
|
+
return /* @__PURE__ */ jsx387(StyledIcon2, { ...props, children });
|
|
797
801
|
};
|
|
798
802
|
var X2 = (props) => /* @__PURE__ */ jsx2100(Icon3, { ...props, children: /* @__PURE__ */ jsx2100(X, { size: "100%" }) });
|
|
799
803
|
|
|
@@ -912,7 +916,7 @@ var Box2 = React2.forwardRef(
|
|
|
912
916
|
...props
|
|
913
917
|
}, ref) => {
|
|
914
918
|
if (as === "img" && src) {
|
|
915
|
-
return /* @__PURE__ */
|
|
919
|
+
return /* @__PURE__ */ jsx388(
|
|
916
920
|
"img",
|
|
917
921
|
{
|
|
918
922
|
src,
|
|
@@ -932,7 +936,7 @@ var Box2 = React2.forwardRef(
|
|
|
932
936
|
}
|
|
933
937
|
);
|
|
934
938
|
}
|
|
935
|
-
return /* @__PURE__ */
|
|
939
|
+
return /* @__PURE__ */ jsx388(
|
|
936
940
|
StyledBox,
|
|
937
941
|
{
|
|
938
942
|
ref,
|
|
@@ -1007,7 +1011,7 @@ var StyledIcon3 = styled32.div`
|
|
|
1007
1011
|
}
|
|
1008
1012
|
`;
|
|
1009
1013
|
var Icon4 = ({ children, ...props }) => {
|
|
1010
|
-
return /* @__PURE__ */
|
|
1014
|
+
return /* @__PURE__ */ jsx389(StyledIcon3, { ...props, children });
|
|
1011
1015
|
};
|
|
1012
1016
|
var Tag = ({
|
|
1013
1017
|
size = "md",
|
|
@@ -1108,7 +1112,7 @@ var Tag = ({
|
|
|
1108
1112
|
|
|
1109
1113
|
// src/useMultiSelectControl.tsx
|
|
1110
1114
|
import { useDesignSystem as useDesignSystem2 } from "@xsolla/xui-core";
|
|
1111
|
-
import { jsx as
|
|
1115
|
+
import { jsx as jsx390, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1112
1116
|
var COUNT_ITEM_VALUE = "count-item";
|
|
1113
1117
|
var useMultiSelectControl = ({
|
|
1114
1118
|
variant,
|
|
@@ -1168,7 +1172,7 @@ var useMultiSelectControl = ({
|
|
|
1168
1172
|
};
|
|
1169
1173
|
const setPlaceholder = () => {
|
|
1170
1174
|
setSelectedContent(
|
|
1171
|
-
/* @__PURE__ */
|
|
1175
|
+
/* @__PURE__ */ jsx390(
|
|
1172
1176
|
Text,
|
|
1173
1177
|
{
|
|
1174
1178
|
color: theme.colors.control.input.placeholder,
|
|
@@ -1219,7 +1223,7 @@ var useMultiSelectControl = ({
|
|
|
1219
1223
|
const isCount = item.value === COUNT_ITEM_VALUE;
|
|
1220
1224
|
const isReducable = index === 0 && displayStateRef.current === 3 /* Render */ && displayedItemsCount === 0 || flexible;
|
|
1221
1225
|
if (variant === "tag") {
|
|
1222
|
-
return /* @__PURE__ */
|
|
1226
|
+
return /* @__PURE__ */ jsx390(
|
|
1223
1227
|
Box,
|
|
1224
1228
|
{
|
|
1225
1229
|
onPress: !isCount ? (e) => {
|
|
@@ -1231,7 +1235,7 @@ var useMultiSelectControl = ({
|
|
|
1231
1235
|
opacity: disabled ? 0.5 : 1,
|
|
1232
1236
|
cursor: disabled || isCount ? "not-allowed" : "pointer"
|
|
1233
1237
|
},
|
|
1234
|
-
children: /* @__PURE__ */
|
|
1238
|
+
children: /* @__PURE__ */ jsx390(
|
|
1235
1239
|
Tag,
|
|
1236
1240
|
{
|
|
1237
1241
|
size,
|
|
@@ -1351,7 +1355,7 @@ var useMultiSelectControl = ({
|
|
|
1351
1355
|
};
|
|
1352
1356
|
|
|
1353
1357
|
// src/MultiSelectControl.tsx
|
|
1354
|
-
import { jsx as
|
|
1358
|
+
import { jsx as jsx391, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1355
1359
|
var MultiSelectControl = forwardRef3(
|
|
1356
1360
|
({
|
|
1357
1361
|
variant = "tag",
|
|
@@ -1452,8 +1456,8 @@ var MultiSelectControl = forwardRef3(
|
|
|
1452
1456
|
gap: 8,
|
|
1453
1457
|
style: { minWidth: 0 },
|
|
1454
1458
|
children: [
|
|
1455
|
-
iconLeft && /* @__PURE__ */
|
|
1456
|
-
/* @__PURE__ */
|
|
1459
|
+
iconLeft && /* @__PURE__ */ jsx391(Icon, { size: sizeStyles.iconSize, color: iconColor, variant: "line", children: iconLeft }),
|
|
1460
|
+
/* @__PURE__ */ jsx391(
|
|
1457
1461
|
Box,
|
|
1458
1462
|
{
|
|
1459
1463
|
ref: itemsRef,
|
|
@@ -1473,7 +1477,7 @@ var MultiSelectControl = forwardRef3(
|
|
|
1473
1477
|
}
|
|
1474
1478
|
),
|
|
1475
1479
|
/* @__PURE__ */ jsxs3(Box, { flexDirection: "row", alignItems: "center", gap: 4, children: [
|
|
1476
|
-
extraClear && selectedItems.length > 0 && !isDisable && /* @__PURE__ */
|
|
1480
|
+
extraClear && selectedItems.length > 0 && !isDisable && /* @__PURE__ */ jsx391(
|
|
1477
1481
|
Box,
|
|
1478
1482
|
{
|
|
1479
1483
|
onPress: (e) => {
|
|
@@ -1481,17 +1485,17 @@ var MultiSelectControl = forwardRef3(
|
|
|
1481
1485
|
removeAllValues();
|
|
1482
1486
|
},
|
|
1483
1487
|
style: { cursor: "pointer" },
|
|
1484
|
-
children: /* @__PURE__ */
|
|
1488
|
+
children: /* @__PURE__ */ jsx391(Remove, { size: 18, color: iconColor, variant: "line" })
|
|
1485
1489
|
}
|
|
1486
1490
|
),
|
|
1487
|
-
isError && /* @__PURE__ */
|
|
1491
|
+
isError && /* @__PURE__ */ jsx391(
|
|
1488
1492
|
ExclamationMarkCr,
|
|
1489
1493
|
{
|
|
1490
1494
|
size: 18,
|
|
1491
1495
|
color: theme.colors.content.alert.primary
|
|
1492
1496
|
}
|
|
1493
1497
|
),
|
|
1494
|
-
iconRight ? iconRight : isOpen ? /* @__PURE__ */
|
|
1498
|
+
iconRight ? iconRight : isOpen ? /* @__PURE__ */ jsx391(ChevronUp, { size: 18, color: iconColor, variant: "line" }) : /* @__PURE__ */ jsx391(ChevronDown, { size: 18, color: iconColor })
|
|
1495
1499
|
] })
|
|
1496
1500
|
]
|
|
1497
1501
|
}
|
|
@@ -1592,7 +1596,7 @@ var useMultiSelect = ({
|
|
|
1592
1596
|
};
|
|
1593
1597
|
|
|
1594
1598
|
// src/MultiSelect.tsx
|
|
1595
|
-
import { Fragment, jsx as
|
|
1599
|
+
import { Fragment, jsx as jsx392, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1596
1600
|
var MultiSelect = forwardRef4(
|
|
1597
1601
|
({
|
|
1598
1602
|
options,
|
|
@@ -1657,7 +1661,7 @@ var MultiSelect = forwardRef4(
|
|
|
1657
1661
|
onChoose(newValues.map(String));
|
|
1658
1662
|
};
|
|
1659
1663
|
return /* @__PURE__ */ jsxs4(Box, { flexDirection: "column", gap: sizeStyles.fieldGap, children: [
|
|
1660
|
-
label && /* @__PURE__ */
|
|
1664
|
+
label && /* @__PURE__ */ jsx392(
|
|
1661
1665
|
Text,
|
|
1662
1666
|
{
|
|
1663
1667
|
color: theme.colors.content.secondary,
|
|
@@ -1674,7 +1678,7 @@ var MultiSelect = forwardRef4(
|
|
|
1674
1678
|
position: "relative"
|
|
1675
1679
|
},
|
|
1676
1680
|
children: [
|
|
1677
|
-
/* @__PURE__ */
|
|
1681
|
+
/* @__PURE__ */ jsx392(
|
|
1678
1682
|
MultiSelectControl,
|
|
1679
1683
|
{
|
|
1680
1684
|
ref: controlRef,
|
|
@@ -1699,7 +1703,7 @@ var MultiSelect = forwardRef4(
|
|
|
1699
1703
|
}
|
|
1700
1704
|
),
|
|
1701
1705
|
isOpen && !isDisable && /* @__PURE__ */ jsxs4(Fragment, { children: [
|
|
1702
|
-
/* @__PURE__ */
|
|
1706
|
+
/* @__PURE__ */ jsx392(
|
|
1703
1707
|
Box,
|
|
1704
1708
|
{
|
|
1705
1709
|
style: {
|
|
@@ -1714,7 +1718,7 @@ var MultiSelect = forwardRef4(
|
|
|
1714
1718
|
onPress: onClose
|
|
1715
1719
|
}
|
|
1716
1720
|
),
|
|
1717
|
-
/* @__PURE__ */
|
|
1721
|
+
/* @__PURE__ */ jsx392(
|
|
1718
1722
|
Box,
|
|
1719
1723
|
{
|
|
1720
1724
|
ref: menuRef,
|
|
@@ -1738,7 +1742,7 @@ var MultiSelect = forwardRef4(
|
|
|
1738
1742
|
children: menuItems.map((item, _index) => {
|
|
1739
1743
|
const brandColors = theme.colors.control.brand.primary;
|
|
1740
1744
|
const contentColors = theme.colors.content;
|
|
1741
|
-
return /* @__PURE__ */
|
|
1745
|
+
return /* @__PURE__ */ jsx392(
|
|
1742
1746
|
Box,
|
|
1743
1747
|
{
|
|
1744
1748
|
paddingHorizontal: sizeStyles.paddingHorizontal,
|
|
@@ -1759,7 +1763,7 @@ var MultiSelect = forwardRef4(
|
|
|
1759
1763
|
cursor: item.disabled ? "not-allowed" : "pointer",
|
|
1760
1764
|
opacity: item.disabled ? 0.5 : 1
|
|
1761
1765
|
},
|
|
1762
|
-
children: /* @__PURE__ */
|
|
1766
|
+
children: /* @__PURE__ */ jsx392(
|
|
1763
1767
|
Text,
|
|
1764
1768
|
{
|
|
1765
1769
|
color: item.checked ? contentColors.on.brand : theme.colors.content.secondary,
|
|
@@ -1778,7 +1782,7 @@ var MultiSelect = forwardRef4(
|
|
|
1778
1782
|
]
|
|
1779
1783
|
}
|
|
1780
1784
|
),
|
|
1781
|
-
errorMessage && /* @__PURE__ */
|
|
1785
|
+
errorMessage && /* @__PURE__ */ jsx392(
|
|
1782
1786
|
Text,
|
|
1783
1787
|
{
|
|
1784
1788
|
color: theme.colors.content.alert.primary,
|