@xsolla/xui-b2c-side-navigation 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 +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/web/index.mjs
CHANGED
|
@@ -3558,7 +3558,11 @@ var ADDITIONAL_BLOCKED_PROPS = /* @__PURE__ */ new Set([
|
|
|
3558
3558
|
"fontSize",
|
|
3559
3559
|
"fontWeight",
|
|
3560
3560
|
"fontFamily",
|
|
3561
|
-
"textDecoration"
|
|
3561
|
+
"textDecoration",
|
|
3562
|
+
// Cross-platform layout prop that Text consumes as CSS, never as an
|
|
3563
|
+
// attribute. Pinned explicitly because it is now spread into the styled
|
|
3564
|
+
// component rather than destructured away before it can reach the DOM.
|
|
3565
|
+
"numberOfLines"
|
|
3562
3566
|
]);
|
|
3563
3567
|
function shouldForwardProp(key) {
|
|
3564
3568
|
if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;
|
|
@@ -3763,6 +3767,30 @@ var Box = React3.forwardRef(
|
|
|
3763
3767
|
);
|
|
3764
3768
|
Box.displayName = "Box";
|
|
3765
3769
|
|
|
3770
|
+
// ../../foundation/primitives-web/src/textTruncation.ts
|
|
3771
|
+
var truncationStyles = (numberOfLines) => {
|
|
3772
|
+
if (!numberOfLines || numberOfLines < 1) return "";
|
|
3773
|
+
if (numberOfLines === 1) {
|
|
3774
|
+
return `
|
|
3775
|
+
display: block;
|
|
3776
|
+
max-width: 100%;
|
|
3777
|
+
min-width: 0;
|
|
3778
|
+
overflow: hidden;
|
|
3779
|
+
text-overflow: ellipsis;
|
|
3780
|
+
white-space: nowrap;
|
|
3781
|
+
`;
|
|
3782
|
+
}
|
|
3783
|
+
return `
|
|
3784
|
+
display: -webkit-box;
|
|
3785
|
+
-webkit-box-orient: vertical;
|
|
3786
|
+
-webkit-line-clamp: ${numberOfLines};
|
|
3787
|
+
line-clamp: ${numberOfLines};
|
|
3788
|
+
max-width: 100%;
|
|
3789
|
+
min-width: 0;
|
|
3790
|
+
overflow: hidden;
|
|
3791
|
+
`;
|
|
3792
|
+
};
|
|
3793
|
+
|
|
3766
3794
|
// ../../foundation/primitives-web/src/Text.tsx
|
|
3767
3795
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
3768
3796
|
var FilteredSpan = createFilteredElement("span");
|
|
@@ -3775,6 +3803,9 @@ var StyledText = styled_components_esm_default(FilteredSpan)`
|
|
|
3775
3803
|
white-space: ${(props) => props.whiteSpace || "normal"};
|
|
3776
3804
|
text-align: ${(props) => props.textAlign || "inherit"};
|
|
3777
3805
|
text-decoration: ${(props) => props.textDecoration || "none"};
|
|
3806
|
+
|
|
3807
|
+
/* Keep last: single-line truncation has to win over white-space above. */
|
|
3808
|
+
${(props) => truncationStyles(props.numberOfLines)}
|
|
3778
3809
|
`;
|
|
3779
3810
|
var Text = ({
|
|
3780
3811
|
style,
|
|
@@ -3783,7 +3814,6 @@ var Text = ({
|
|
|
3783
3814
|
role,
|
|
3784
3815
|
testID,
|
|
3785
3816
|
"data-testid": dataTestId,
|
|
3786
|
-
numberOfLines: _numberOfLines,
|
|
3787
3817
|
...props
|
|
3788
3818
|
}) => {
|
|
3789
3819
|
return /* @__PURE__ */ jsx2(
|