@xsolla/xui-b2c-shop-card 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 +4 -4
- package/web/index.js +32 -2
- package/web/index.js.map +1 -1
- package/web/index.mjs +32 -2
- package/web/index.mjs.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xsolla/xui-b2c-shop-card",
|
|
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,9 +13,9 @@
|
|
|
13
13
|
"test:coverage": "vitest run --coverage"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@xsolla/xui-core": "0.
|
|
17
|
-
"@xsolla/xui-icons": "0.
|
|
18
|
-
"@xsolla/xui-primitives-core": "0.
|
|
16
|
+
"@xsolla/xui-core": "0.197.0",
|
|
17
|
+
"@xsolla/xui-icons": "0.197.0",
|
|
18
|
+
"@xsolla/xui-primitives-core": "0.197.0"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
21
|
"react": ">=16.8.0"
|
package/web/index.js
CHANGED
|
@@ -3571,7 +3571,11 @@ var ADDITIONAL_BLOCKED_PROPS = /* @__PURE__ */ new Set([
|
|
|
3571
3571
|
"fontSize",
|
|
3572
3572
|
"fontWeight",
|
|
3573
3573
|
"fontFamily",
|
|
3574
|
-
"textDecoration"
|
|
3574
|
+
"textDecoration",
|
|
3575
|
+
// Cross-platform layout prop that Text consumes as CSS, never as an
|
|
3576
|
+
// attribute. Pinned explicitly because it is now spread into the styled
|
|
3577
|
+
// component rather than destructured away before it can reach the DOM.
|
|
3578
|
+
"numberOfLines"
|
|
3575
3579
|
]);
|
|
3576
3580
|
function shouldForwardProp(key) {
|
|
3577
3581
|
if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;
|
|
@@ -3776,6 +3780,30 @@ var Box = import_react3.default.forwardRef(
|
|
|
3776
3780
|
);
|
|
3777
3781
|
Box.displayName = "Box";
|
|
3778
3782
|
|
|
3783
|
+
// ../../foundation/primitives-web/src/textTruncation.ts
|
|
3784
|
+
var truncationStyles = (numberOfLines) => {
|
|
3785
|
+
if (!numberOfLines || numberOfLines < 1) return "";
|
|
3786
|
+
if (numberOfLines === 1) {
|
|
3787
|
+
return `
|
|
3788
|
+
display: block;
|
|
3789
|
+
max-width: 100%;
|
|
3790
|
+
min-width: 0;
|
|
3791
|
+
overflow: hidden;
|
|
3792
|
+
text-overflow: ellipsis;
|
|
3793
|
+
white-space: nowrap;
|
|
3794
|
+
`;
|
|
3795
|
+
}
|
|
3796
|
+
return `
|
|
3797
|
+
display: -webkit-box;
|
|
3798
|
+
-webkit-box-orient: vertical;
|
|
3799
|
+
-webkit-line-clamp: ${numberOfLines};
|
|
3800
|
+
line-clamp: ${numberOfLines};
|
|
3801
|
+
max-width: 100%;
|
|
3802
|
+
min-width: 0;
|
|
3803
|
+
overflow: hidden;
|
|
3804
|
+
`;
|
|
3805
|
+
};
|
|
3806
|
+
|
|
3779
3807
|
// ../../foundation/primitives-web/src/Text.tsx
|
|
3780
3808
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
3781
3809
|
var FilteredSpan = createFilteredElement("span");
|
|
@@ -3788,6 +3816,9 @@ var StyledText = styled_components_esm_default(FilteredSpan)`
|
|
|
3788
3816
|
white-space: ${(props) => props.whiteSpace || "normal"};
|
|
3789
3817
|
text-align: ${(props) => props.textAlign || "inherit"};
|
|
3790
3818
|
text-decoration: ${(props) => props.textDecoration || "none"};
|
|
3819
|
+
|
|
3820
|
+
/* Keep last: single-line truncation has to win over white-space above. */
|
|
3821
|
+
${(props) => truncationStyles(props.numberOfLines)}
|
|
3791
3822
|
`;
|
|
3792
3823
|
var Text = ({
|
|
3793
3824
|
style,
|
|
@@ -3796,7 +3827,6 @@ var Text = ({
|
|
|
3796
3827
|
role,
|
|
3797
3828
|
testID,
|
|
3798
3829
|
"data-testid": dataTestId,
|
|
3799
|
-
numberOfLines: _numberOfLines,
|
|
3800
3830
|
...props
|
|
3801
3831
|
}) => {
|
|
3802
3832
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|