@xsolla/xui-multi-select 0.104.0 → 0.106.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/web/index.mjs CHANGED
@@ -1007,9 +1007,13 @@ var StyledIcon4 = styled32.div`
1007
1007
  var Icon4 = ({ children, ...props }) => {
1008
1008
  return /* @__PURE__ */ jsx389(StyledIcon4, { ...props, children });
1009
1009
  };
1010
+ var SELECTABLE_BORDER_RADIUS = 8;
1010
1011
  var Tag = ({
1011
1012
  size = "md",
1012
1013
  tone = "primary",
1014
+ variant = "default",
1015
+ selected = false,
1016
+ onPress,
1013
1017
  children,
1014
1018
  icon,
1015
1019
  onRemove
@@ -1017,66 +1021,98 @@ var Tag = ({
1017
1021
  const { theme } = useDesignSystem();
1018
1022
  const sizeStyles = theme.sizing.tag(size);
1019
1023
  const resolveColors = () => {
1024
+ if (variant === "selectable") {
1025
+ if (selected) {
1026
+ return {
1027
+ bg: theme.colors.control.brand.secondary.bg,
1028
+ text: theme.colors.content.brand.primary,
1029
+ border: theme.colors.border.secondary
1030
+ };
1031
+ }
1032
+ return {
1033
+ bg: theme.colors.overlay.mono,
1034
+ text: theme.colors.content.primary,
1035
+ border: theme.colors.border.secondary
1036
+ };
1037
+ }
1020
1038
  switch (tone) {
1021
1039
  case "primary":
1022
1040
  return {
1023
1041
  bg: theme.colors.background.primary,
1024
- text: theme.colors.content.primary
1042
+ text: theme.colors.content.primary,
1043
+ border: void 0
1025
1044
  };
1026
1045
  case "secondary":
1027
1046
  return {
1028
1047
  bg: theme.colors.background.secondary,
1029
- text: theme.colors.content.primary
1048
+ text: theme.colors.content.primary,
1049
+ border: void 0
1030
1050
  };
1031
1051
  case "brand":
1032
1052
  return {
1033
1053
  bg: theme.colors.background.brand.primary,
1034
- text: theme.colors.content.on.brand
1054
+ text: theme.colors.content.on.brand,
1055
+ border: void 0
1035
1056
  };
1036
1057
  case "brandExtra":
1037
1058
  return {
1038
1059
  bg: theme.colors.background.brandExtra.primary,
1039
- text: theme.colors.content.on.brandExtra
1060
+ text: theme.colors.content.on.brandExtra,
1061
+ border: void 0
1040
1062
  };
1041
1063
  case "success":
1042
1064
  return {
1043
1065
  bg: theme.colors.background.success.primary,
1044
- text: theme.colors.content.on.success
1066
+ text: theme.colors.content.on.success,
1067
+ border: void 0
1045
1068
  };
1046
1069
  case "warning":
1047
1070
  return {
1048
1071
  bg: theme.colors.background.warning.primary,
1049
- text: theme.colors.content.on.warning
1072
+ text: theme.colors.content.on.warning,
1073
+ border: void 0
1050
1074
  };
1051
1075
  case "alert":
1052
1076
  return {
1053
1077
  bg: theme.colors.background.alert.primary,
1054
- text: theme.colors.content.on.alert
1078
+ text: theme.colors.content.on.alert,
1079
+ border: void 0
1055
1080
  };
1056
1081
  case "neutral":
1057
1082
  return {
1058
1083
  bg: theme.colors.background.neutral.primary,
1059
- text: theme.colors.content.on.neutral
1084
+ text: theme.colors.content.on.neutral,
1085
+ border: void 0
1060
1086
  };
1061
1087
  default:
1062
1088
  return {
1063
1089
  bg: theme.colors.background.primary,
1064
- text: theme.colors.content.primary
1090
+ text: theme.colors.content.primary,
1091
+ border: void 0
1065
1092
  };
1066
1093
  }
1067
1094
  };
1068
- const { bg, text } = resolveColors();
1095
+ const { bg, text, border } = resolveColors();
1096
+ const isSelectable = variant === "selectable";
1097
+ const borderRadius = isSelectable ? SELECTABLE_BORDER_RADIUS : sizeStyles.radius;
1069
1098
  return /* @__PURE__ */ jsxs(
1070
1099
  Box2,
1071
1100
  {
1101
+ as: isSelectable ? "button" : void 0,
1102
+ onPress: isSelectable ? onPress : void 0,
1072
1103
  backgroundColor: bg,
1073
- borderRadius: sizeStyles.radius,
1104
+ borderRadius,
1074
1105
  height: sizeStyles.height,
1075
1106
  paddingHorizontal: sizeStyles.padding,
1076
1107
  flexDirection: "row",
1077
1108
  alignItems: "center",
1078
1109
  justifyContent: "center",
1079
1110
  gap: sizeStyles.gap,
1111
+ borderWidth: isSelectable ? 1 : 0,
1112
+ borderColor: border,
1113
+ borderStyle: isSelectable ? "solid" : void 0,
1114
+ cursor: isSelectable ? "pointer" : void 0,
1115
+ hoverStyle: isSelectable && !selected ? { backgroundColor: theme.colors.control.brand.tertiary.bgHover } : void 0,
1080
1116
  style: {
1081
1117
  overflow: "hidden",
1082
1118
  textOverflow: "ellipsis",