@xsolla/xui-status-dropdown 0.196.1 → 0.197.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.
- package/package.json +5 -5
- package/web/index.js +34 -2
- package/web/index.js.map +1 -1
- package/web/index.mjs +34 -2
- package/web/index.mjs.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xsolla/xui-status-dropdown",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.197.1",
|
|
4
4
|
"main": "./web/index.js",
|
|
5
5
|
"module": "./web/index.mjs",
|
|
6
6
|
"types": "./web/index.d.ts",
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
"test:coverage": "vitest run --coverage"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@xsolla/xui-context-menu": "0.
|
|
17
|
-
"@xsolla/xui-core": "0.
|
|
18
|
-
"@xsolla/xui-primitives-core": "0.
|
|
19
|
-
"@xsolla/xui-status": "0.
|
|
16
|
+
"@xsolla/xui-context-menu": "0.197.1",
|
|
17
|
+
"@xsolla/xui-core": "0.197.1",
|
|
18
|
+
"@xsolla/xui-primitives-core": "0.197.1",
|
|
19
|
+
"@xsolla/xui-status": "0.197.1"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
22
|
"react": ">=16.8.0",
|
package/web/index.js
CHANGED
|
@@ -83,7 +83,11 @@ var ADDITIONAL_BLOCKED_PROPS = /* @__PURE__ */ new Set([
|
|
|
83
83
|
"fontSize",
|
|
84
84
|
"fontWeight",
|
|
85
85
|
"fontFamily",
|
|
86
|
-
"textDecoration"
|
|
86
|
+
"textDecoration",
|
|
87
|
+
// Cross-platform layout prop that Text consumes as CSS, never as an
|
|
88
|
+
// attribute. Pinned explicitly because it is now spread into the styled
|
|
89
|
+
// component rather than destructured away before it can reach the DOM.
|
|
90
|
+
"numberOfLines"
|
|
87
91
|
]);
|
|
88
92
|
function shouldForwardProp(key) {
|
|
89
93
|
if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;
|
|
@@ -290,6 +294,32 @@ Box.displayName = "Box";
|
|
|
290
294
|
|
|
291
295
|
// ../../foundation/primitives-web/src/Text.tsx
|
|
292
296
|
var import_styled_components2 = __toESM(require("styled-components"));
|
|
297
|
+
|
|
298
|
+
// ../../foundation/primitives-web/src/textTruncation.ts
|
|
299
|
+
var truncationStyles = (numberOfLines) => {
|
|
300
|
+
if (!numberOfLines || numberOfLines < 1) return "";
|
|
301
|
+
if (numberOfLines === 1) {
|
|
302
|
+
return `
|
|
303
|
+
display: block;
|
|
304
|
+
max-width: 100%;
|
|
305
|
+
min-width: 0;
|
|
306
|
+
overflow: hidden;
|
|
307
|
+
text-overflow: ellipsis;
|
|
308
|
+
white-space: nowrap;
|
|
309
|
+
`;
|
|
310
|
+
}
|
|
311
|
+
return `
|
|
312
|
+
display: -webkit-box;
|
|
313
|
+
-webkit-box-orient: vertical;
|
|
314
|
+
-webkit-line-clamp: ${numberOfLines};
|
|
315
|
+
line-clamp: ${numberOfLines};
|
|
316
|
+
max-width: 100%;
|
|
317
|
+
min-width: 0;
|
|
318
|
+
overflow: hidden;
|
|
319
|
+
`;
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
// ../../foundation/primitives-web/src/Text.tsx
|
|
293
323
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
294
324
|
var FilteredSpan = createFilteredElement("span");
|
|
295
325
|
var StyledText = (0, import_styled_components2.default)(FilteredSpan)`
|
|
@@ -301,6 +331,9 @@ var StyledText = (0, import_styled_components2.default)(FilteredSpan)`
|
|
|
301
331
|
white-space: ${(props) => props.whiteSpace || "normal"};
|
|
302
332
|
text-align: ${(props) => props.textAlign || "inherit"};
|
|
303
333
|
text-decoration: ${(props) => props.textDecoration || "none"};
|
|
334
|
+
|
|
335
|
+
/* Keep last: single-line truncation has to win over white-space above. */
|
|
336
|
+
${(props) => truncationStyles(props.numberOfLines)}
|
|
304
337
|
`;
|
|
305
338
|
var Text = ({
|
|
306
339
|
style,
|
|
@@ -309,7 +342,6 @@ var Text = ({
|
|
|
309
342
|
role,
|
|
310
343
|
testID,
|
|
311
344
|
"data-testid": dataTestId,
|
|
312
|
-
numberOfLines: _numberOfLines,
|
|
313
345
|
...props
|
|
314
346
|
}) => {
|
|
315
347
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|