@xsolla/xui-status-dropdown 0.172.0 → 0.172.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.
@@ -10,6 +10,8 @@ interface StatusDropdownProps extends ThemeOverrideProps {
10
10
  palette?: StatusDropdownPalette;
11
11
  /** Size of the trigger */
12
12
  size?: StatusDropdownSize;
13
+ /** Max width of the trigger. The label truncates with an ellipsis when it exceeds this. Accepts any layout width value (number or string). */
14
+ maxWidth?: number | string;
13
15
  /** Whether to show the status dot */
14
16
  dot?: boolean;
15
17
  /** Dropdown menu content (usually ContextMenuItem components) */
package/native/index.d.ts CHANGED
@@ -10,6 +10,8 @@ interface StatusDropdownProps extends ThemeOverrideProps {
10
10
  palette?: StatusDropdownPalette;
11
11
  /** Size of the trigger */
12
12
  size?: StatusDropdownSize;
13
+ /** Max width of the trigger. The label truncates with an ellipsis when it exceeds this. Accepts any layout width value (number or string). */
14
+ maxWidth?: number | string;
13
15
  /** Whether to show the status dot */
14
16
  dot?: boolean;
15
17
  /** Dropdown menu content (usually ContextMenuItem components) */
package/native/index.js CHANGED
@@ -1135,6 +1135,7 @@ var StatusDropdown = (0, import_react2.forwardRef)(
1135
1135
  label,
1136
1136
  palette = "Neutral",
1137
1137
  size = "xs",
1138
+ maxWidth,
1138
1139
  dot = false,
1139
1140
  children,
1140
1141
  isOpen: propIsOpen,
@@ -1188,6 +1189,8 @@ var StatusDropdown = (0, import_react2.forwardRef)(
1188
1189
  height: sizeStyles.height,
1189
1190
  paddingHorizontal: sizeStyles.padding,
1190
1191
  gap,
1192
+ minWidth: 0,
1193
+ maxWidth,
1191
1194
  ...isWeb ? {
1192
1195
  onFocus: (event) => {
1193
1196
  const target = event?.target;
@@ -1236,19 +1239,36 @@ var StatusDropdown = (0, import_react2.forwardRef)(
1236
1239
  )
1237
1240
  }
1238
1241
  ),
1239
- /* @__PURE__ */ (0, import_jsx_runtime725.jsx)(Box, { paddingHorizontal: gap, flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime725.jsx)(
1240
- Text,
1242
+ /* @__PURE__ */ (0, import_jsx_runtime725.jsx)(
1243
+ Box,
1241
1244
  {
1242
- color: contentColor,
1243
- fontSize: sizeStyles.fontSize,
1244
- fontWeight: "500",
1245
- numberOfLines: 1,
1246
- style: {
1247
- lineHeight: `${sizeStyles.lineHeight}px`
1248
- },
1249
- children: label
1245
+ paddingHorizontal: gap,
1246
+ flexShrink: 1,
1247
+ minWidth: 0,
1248
+ ...isWeb ? { overflow: "hidden" } : {},
1249
+ children: /* @__PURE__ */ (0, import_jsx_runtime725.jsx)(
1250
+ Text,
1251
+ {
1252
+ color: contentColor,
1253
+ fontSize: sizeStyles.fontSize,
1254
+ fontWeight: "500",
1255
+ numberOfLines: 1,
1256
+ style: {
1257
+ lineHeight: `${sizeStyles.lineHeight}px`,
1258
+ // Text primitive ignores numberOfLines on web, so enforce
1259
+ // single-line truncation with real CSS.
1260
+ ...isWeb ? {
1261
+ display: "block",
1262
+ whiteSpace: "nowrap",
1263
+ overflow: "hidden",
1264
+ textOverflow: "ellipsis"
1265
+ } : {}
1266
+ },
1267
+ children: label
1268
+ }
1269
+ )
1250
1270
  }
1251
- ) }),
1271
+ ),
1252
1272
  /* @__PURE__ */ (0, import_jsx_runtime725.jsx)(
1253
1273
  Box,
1254
1274
  {
@@ -1256,6 +1276,7 @@ var StatusDropdown = (0, import_react2.forwardRef)(
1256
1276
  height: sizeStyles.iconSize,
1257
1277
  alignItems: "center",
1258
1278
  justifyContent: "center",
1279
+ flexShrink: 0,
1259
1280
  children: /* @__PURE__ */ (0, import_jsx_runtime725.jsx)(
1260
1281
  Icon,
1261
1282
  {