@xsolla/xui-multi-select 0.103.0 → 0.105.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 -13
- package/native/index.js.map +1 -1
- package/native/index.mjs +49 -13
- package/native/index.mjs.map +1 -1
- package/package.json +5 -5
- package/web/index.js +49 -13
- package/web/index.js.map +1 -1
- package/web/index.mjs +49 -13
- package/web/index.mjs.map +1 -1
package/native/index.js
CHANGED
|
@@ -224,7 +224,7 @@ var Text = ({
|
|
|
224
224
|
...props
|
|
225
225
|
}) => {
|
|
226
226
|
let resolvedFontFamily = fontFamily ? fontFamily.split(",")[0].replace(/['"]/g, "").trim() : void 0;
|
|
227
|
-
if (resolvedFontFamily === "Pilat Wide Bold") {
|
|
227
|
+
if (resolvedFontFamily === "Pilat Wide" || resolvedFontFamily === "Pilat Wide Bold" || resolvedFontFamily === "Aktiv Grotesk") {
|
|
228
228
|
resolvedFontFamily = void 0;
|
|
229
229
|
}
|
|
230
230
|
const style = {
|
|
@@ -998,7 +998,7 @@ var StyledText = import_styled_components4.default.span`
|
|
|
998
998
|
color: ${(props) => props.color || "inherit"};
|
|
999
999
|
font-size: ${(props) => typeof props.fontSize === "number" ? `${props.fontSize}px` : props.fontSize || "inherit"};
|
|
1000
1000
|
font-weight: ${(props) => props.fontWeight || "normal"};
|
|
1001
|
-
font-family: ${(props) => props.fontFamily || '"
|
|
1001
|
+
font-family: ${(props) => props.fontFamily || '"Aktiv Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif'};
|
|
1002
1002
|
line-height: ${(props) => typeof props.lineHeight === "number" ? `${props.lineHeight}px` : props.lineHeight || "inherit"};
|
|
1003
1003
|
white-space: ${(props) => props.whiteSpace || "normal"};
|
|
1004
1004
|
text-align: ${(props) => props.textAlign || "inherit"};
|
|
@@ -1040,9 +1040,13 @@ var StyledIcon3 = import_styled_components5.default.div`
|
|
|
1040
1040
|
var Icon4 = ({ children, ...props }) => {
|
|
1041
1041
|
return /* @__PURE__ */ (0, import_jsx_runtime394.jsx)(StyledIcon3, { ...props, children });
|
|
1042
1042
|
};
|
|
1043
|
+
var SELECTABLE_BORDER_RADIUS = 8;
|
|
1043
1044
|
var Tag = ({
|
|
1044
1045
|
size = "md",
|
|
1045
1046
|
tone = "primary",
|
|
1047
|
+
variant = "default",
|
|
1048
|
+
selected = false,
|
|
1049
|
+
onPress,
|
|
1046
1050
|
children,
|
|
1047
1051
|
icon,
|
|
1048
1052
|
onRemove
|
|
@@ -1050,66 +1054,98 @@ var Tag = ({
|
|
|
1050
1054
|
const { theme } = (0, import_xui_core.useDesignSystem)();
|
|
1051
1055
|
const sizeStyles = theme.sizing.tag(size);
|
|
1052
1056
|
const resolveColors = () => {
|
|
1057
|
+
if (variant === "selectable") {
|
|
1058
|
+
if (selected) {
|
|
1059
|
+
return {
|
|
1060
|
+
bg: theme.colors.control.brand.secondary.bg,
|
|
1061
|
+
text: theme.colors.content.brand.primary,
|
|
1062
|
+
border: theme.colors.border.secondary
|
|
1063
|
+
};
|
|
1064
|
+
}
|
|
1065
|
+
return {
|
|
1066
|
+
bg: theme.colors.overlay.mono,
|
|
1067
|
+
text: theme.colors.content.primary,
|
|
1068
|
+
border: theme.colors.border.secondary
|
|
1069
|
+
};
|
|
1070
|
+
}
|
|
1053
1071
|
switch (tone) {
|
|
1054
1072
|
case "primary":
|
|
1055
1073
|
return {
|
|
1056
1074
|
bg: theme.colors.background.primary,
|
|
1057
|
-
text: theme.colors.content.primary
|
|
1075
|
+
text: theme.colors.content.primary,
|
|
1076
|
+
border: void 0
|
|
1058
1077
|
};
|
|
1059
1078
|
case "secondary":
|
|
1060
1079
|
return {
|
|
1061
1080
|
bg: theme.colors.background.secondary,
|
|
1062
|
-
text: theme.colors.content.primary
|
|
1081
|
+
text: theme.colors.content.primary,
|
|
1082
|
+
border: void 0
|
|
1063
1083
|
};
|
|
1064
1084
|
case "brand":
|
|
1065
1085
|
return {
|
|
1066
1086
|
bg: theme.colors.background.brand.primary,
|
|
1067
|
-
text: theme.colors.content.on.brand
|
|
1087
|
+
text: theme.colors.content.on.brand,
|
|
1088
|
+
border: void 0
|
|
1068
1089
|
};
|
|
1069
1090
|
case "brandExtra":
|
|
1070
1091
|
return {
|
|
1071
1092
|
bg: theme.colors.background.brandExtra.primary,
|
|
1072
|
-
text: theme.colors.content.on.brandExtra
|
|
1093
|
+
text: theme.colors.content.on.brandExtra,
|
|
1094
|
+
border: void 0
|
|
1073
1095
|
};
|
|
1074
1096
|
case "success":
|
|
1075
1097
|
return {
|
|
1076
1098
|
bg: theme.colors.background.success.primary,
|
|
1077
|
-
text: theme.colors.content.on.success
|
|
1099
|
+
text: theme.colors.content.on.success,
|
|
1100
|
+
border: void 0
|
|
1078
1101
|
};
|
|
1079
1102
|
case "warning":
|
|
1080
1103
|
return {
|
|
1081
1104
|
bg: theme.colors.background.warning.primary,
|
|
1082
|
-
text: theme.colors.content.on.warning
|
|
1105
|
+
text: theme.colors.content.on.warning,
|
|
1106
|
+
border: void 0
|
|
1083
1107
|
};
|
|
1084
1108
|
case "alert":
|
|
1085
1109
|
return {
|
|
1086
1110
|
bg: theme.colors.background.alert.primary,
|
|
1087
|
-
text: theme.colors.content.on.alert
|
|
1111
|
+
text: theme.colors.content.on.alert,
|
|
1112
|
+
border: void 0
|
|
1088
1113
|
};
|
|
1089
1114
|
case "neutral":
|
|
1090
1115
|
return {
|
|
1091
1116
|
bg: theme.colors.background.neutral.primary,
|
|
1092
|
-
text: theme.colors.content.on.neutral
|
|
1117
|
+
text: theme.colors.content.on.neutral,
|
|
1118
|
+
border: void 0
|
|
1093
1119
|
};
|
|
1094
1120
|
default:
|
|
1095
1121
|
return {
|
|
1096
1122
|
bg: theme.colors.background.primary,
|
|
1097
|
-
text: theme.colors.content.primary
|
|
1123
|
+
text: theme.colors.content.primary,
|
|
1124
|
+
border: void 0
|
|
1098
1125
|
};
|
|
1099
1126
|
}
|
|
1100
1127
|
};
|
|
1101
|
-
const { bg, text } = resolveColors();
|
|
1128
|
+
const { bg, text, border } = resolveColors();
|
|
1129
|
+
const isSelectable = variant === "selectable";
|
|
1130
|
+
const borderRadius = isSelectable ? SELECTABLE_BORDER_RADIUS : sizeStyles.radius;
|
|
1102
1131
|
return /* @__PURE__ */ (0, import_jsx_runtime395.jsxs)(
|
|
1103
1132
|
Box2,
|
|
1104
1133
|
{
|
|
1134
|
+
as: isSelectable ? "button" : void 0,
|
|
1135
|
+
onPress: isSelectable ? onPress : void 0,
|
|
1105
1136
|
backgroundColor: bg,
|
|
1106
|
-
borderRadius
|
|
1137
|
+
borderRadius,
|
|
1107
1138
|
height: sizeStyles.height,
|
|
1108
1139
|
paddingHorizontal: sizeStyles.padding,
|
|
1109
1140
|
flexDirection: "row",
|
|
1110
1141
|
alignItems: "center",
|
|
1111
1142
|
justifyContent: "center",
|
|
1112
1143
|
gap: sizeStyles.gap,
|
|
1144
|
+
borderWidth: isSelectable ? 1 : 0,
|
|
1145
|
+
borderColor: border,
|
|
1146
|
+
borderStyle: isSelectable ? "solid" : void 0,
|
|
1147
|
+
cursor: isSelectable ? "pointer" : void 0,
|
|
1148
|
+
hoverStyle: isSelectable && !selected ? { backgroundColor: theme.colors.control.brand.tertiary.bgHover } : void 0,
|
|
1113
1149
|
style: {
|
|
1114
1150
|
overflow: "hidden",
|
|
1115
1151
|
textOverflow: "ellipsis",
|