@xsolla/xui-input-phone 0.196.0 → 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/web/index.mjs
CHANGED
|
@@ -52,7 +52,11 @@ var ADDITIONAL_BLOCKED_PROPS = /* @__PURE__ */ new Set([
|
|
|
52
52
|
"fontSize",
|
|
53
53
|
"fontWeight",
|
|
54
54
|
"fontFamily",
|
|
55
|
-
"textDecoration"
|
|
55
|
+
"textDecoration",
|
|
56
|
+
// Cross-platform layout prop that Text consumes as CSS, never as an
|
|
57
|
+
// attribute. Pinned explicitly because it is now spread into the styled
|
|
58
|
+
// component rather than destructured away before it can reach the DOM.
|
|
59
|
+
"numberOfLines"
|
|
56
60
|
]);
|
|
57
61
|
function shouldForwardProp(key) {
|
|
58
62
|
if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;
|
|
@@ -259,6 +263,32 @@ Box.displayName = "Box";
|
|
|
259
263
|
|
|
260
264
|
// ../../foundation/primitives-web/src/Text.tsx
|
|
261
265
|
import styled2 from "styled-components";
|
|
266
|
+
|
|
267
|
+
// ../../foundation/primitives-web/src/textTruncation.ts
|
|
268
|
+
var truncationStyles = (numberOfLines) => {
|
|
269
|
+
if (!numberOfLines || numberOfLines < 1) return "";
|
|
270
|
+
if (numberOfLines === 1) {
|
|
271
|
+
return `
|
|
272
|
+
display: block;
|
|
273
|
+
max-width: 100%;
|
|
274
|
+
min-width: 0;
|
|
275
|
+
overflow: hidden;
|
|
276
|
+
text-overflow: ellipsis;
|
|
277
|
+
white-space: nowrap;
|
|
278
|
+
`;
|
|
279
|
+
}
|
|
280
|
+
return `
|
|
281
|
+
display: -webkit-box;
|
|
282
|
+
-webkit-box-orient: vertical;
|
|
283
|
+
-webkit-line-clamp: ${numberOfLines};
|
|
284
|
+
line-clamp: ${numberOfLines};
|
|
285
|
+
max-width: 100%;
|
|
286
|
+
min-width: 0;
|
|
287
|
+
overflow: hidden;
|
|
288
|
+
`;
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
// ../../foundation/primitives-web/src/Text.tsx
|
|
262
292
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
263
293
|
var FilteredSpan = createFilteredElement("span");
|
|
264
294
|
var StyledText = styled2(FilteredSpan)`
|
|
@@ -270,6 +300,9 @@ var StyledText = styled2(FilteredSpan)`
|
|
|
270
300
|
white-space: ${(props) => props.whiteSpace || "normal"};
|
|
271
301
|
text-align: ${(props) => props.textAlign || "inherit"};
|
|
272
302
|
text-decoration: ${(props) => props.textDecoration || "none"};
|
|
303
|
+
|
|
304
|
+
/* Keep last: single-line truncation has to win over white-space above. */
|
|
305
|
+
${(props) => truncationStyles(props.numberOfLines)}
|
|
273
306
|
`;
|
|
274
307
|
var Text = ({
|
|
275
308
|
style,
|
|
@@ -278,7 +311,6 @@ var Text = ({
|
|
|
278
311
|
role,
|
|
279
312
|
testID,
|
|
280
313
|
"data-testid": dataTestId,
|
|
281
|
-
numberOfLines: _numberOfLines,
|
|
282
314
|
...props
|
|
283
315
|
}) => {
|
|
284
316
|
return /* @__PURE__ */ jsx2(
|