@xsolla/xui-input-phone 0.196.1 → 0.197.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/package.json +3 -3
- 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-input-phone",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.197.0",
|
|
4
4
|
"main": "./web/index.js",
|
|
5
5
|
"module": "./web/index.mjs",
|
|
6
6
|
"types": "./web/index.d.ts",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"test:coverage": "vitest run --coverage"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@xsolla/xui-core": "0.
|
|
17
|
-
"@xsolla/xui-primitives-core": "0.
|
|
16
|
+
"@xsolla/xui-core": "0.197.0",
|
|
17
|
+
"@xsolla/xui-primitives-core": "0.197.0",
|
|
18
18
|
"libphonenumber-js": "^1.10.56"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
package/web/index.js
CHANGED
|
@@ -90,7 +90,11 @@ var ADDITIONAL_BLOCKED_PROPS = /* @__PURE__ */ new Set([
|
|
|
90
90
|
"fontSize",
|
|
91
91
|
"fontWeight",
|
|
92
92
|
"fontFamily",
|
|
93
|
-
"textDecoration"
|
|
93
|
+
"textDecoration",
|
|
94
|
+
// Cross-platform layout prop that Text consumes as CSS, never as an
|
|
95
|
+
// attribute. Pinned explicitly because it is now spread into the styled
|
|
96
|
+
// component rather than destructured away before it can reach the DOM.
|
|
97
|
+
"numberOfLines"
|
|
94
98
|
]);
|
|
95
99
|
function shouldForwardProp(key) {
|
|
96
100
|
if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;
|
|
@@ -297,6 +301,32 @@ Box.displayName = "Box";
|
|
|
297
301
|
|
|
298
302
|
// ../../foundation/primitives-web/src/Text.tsx
|
|
299
303
|
var import_styled_components2 = __toESM(require("styled-components"));
|
|
304
|
+
|
|
305
|
+
// ../../foundation/primitives-web/src/textTruncation.ts
|
|
306
|
+
var truncationStyles = (numberOfLines) => {
|
|
307
|
+
if (!numberOfLines || numberOfLines < 1) return "";
|
|
308
|
+
if (numberOfLines === 1) {
|
|
309
|
+
return `
|
|
310
|
+
display: block;
|
|
311
|
+
max-width: 100%;
|
|
312
|
+
min-width: 0;
|
|
313
|
+
overflow: hidden;
|
|
314
|
+
text-overflow: ellipsis;
|
|
315
|
+
white-space: nowrap;
|
|
316
|
+
`;
|
|
317
|
+
}
|
|
318
|
+
return `
|
|
319
|
+
display: -webkit-box;
|
|
320
|
+
-webkit-box-orient: vertical;
|
|
321
|
+
-webkit-line-clamp: ${numberOfLines};
|
|
322
|
+
line-clamp: ${numberOfLines};
|
|
323
|
+
max-width: 100%;
|
|
324
|
+
min-width: 0;
|
|
325
|
+
overflow: hidden;
|
|
326
|
+
`;
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
// ../../foundation/primitives-web/src/Text.tsx
|
|
300
330
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
301
331
|
var FilteredSpan = createFilteredElement("span");
|
|
302
332
|
var StyledText = (0, import_styled_components2.default)(FilteredSpan)`
|
|
@@ -308,6 +338,9 @@ var StyledText = (0, import_styled_components2.default)(FilteredSpan)`
|
|
|
308
338
|
white-space: ${(props) => props.whiteSpace || "normal"};
|
|
309
339
|
text-align: ${(props) => props.textAlign || "inherit"};
|
|
310
340
|
text-decoration: ${(props) => props.textDecoration || "none"};
|
|
341
|
+
|
|
342
|
+
/* Keep last: single-line truncation has to win over white-space above. */
|
|
343
|
+
${(props) => truncationStyles(props.numberOfLines)}
|
|
311
344
|
`;
|
|
312
345
|
var Text = ({
|
|
313
346
|
style,
|
|
@@ -316,7 +349,6 @@ var Text = ({
|
|
|
316
349
|
role,
|
|
317
350
|
testID,
|
|
318
351
|
"data-testid": dataTestId,
|
|
319
|
-
numberOfLines: _numberOfLines,
|
|
320
352
|
...props
|
|
321
353
|
}) => {
|
|
322
354
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|