@xsolla/xui-multi-select 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/native/index.mjs CHANGED
@@ -441,7 +441,11 @@ var ADDITIONAL_BLOCKED_PROPS = /* @__PURE__ */ new Set([
441
441
  "fontSize",
442
442
  "fontWeight",
443
443
  "fontFamily",
444
- "textDecoration"
444
+ "textDecoration",
445
+ // Cross-platform layout prop that Text consumes as CSS, never as an
446
+ // attribute. Pinned explicitly because it is now spread into the styled
447
+ // component rather than destructured away before it can reach the DOM.
448
+ "numberOfLines"
445
449
  ]);
446
450
  function shouldForwardProp(key) {
447
451
  if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;
@@ -531,7 +535,11 @@ var ADDITIONAL_BLOCKED_PROPS2 = /* @__PURE__ */ new Set([
531
535
  "fontSize",
532
536
  "fontWeight",
533
537
  "fontFamily",
534
- "textDecoration"
538
+ "textDecoration",
539
+ // Cross-platform layout prop that Text consumes as CSS, never as an
540
+ // attribute. Pinned explicitly because it is now spread into the styled
541
+ // component rather than destructured away before it can reach the DOM.
542
+ "numberOfLines"
535
543
  ]);
536
544
  function shouldForwardProp2(key) {
537
545
  if (ADDITIONAL_BLOCKED_PROPS2.has(key)) return false;
@@ -732,6 +740,28 @@ var Box2 = React22.forwardRef(
732
740
  }
733
741
  );
734
742
  Box2.displayName = "Box";
743
+ var truncationStyles = (numberOfLines) => {
744
+ if (!numberOfLines || numberOfLines < 1) return "";
745
+ if (numberOfLines === 1) {
746
+ return `
747
+ display: block;
748
+ max-width: 100%;
749
+ min-width: 0;
750
+ overflow: hidden;
751
+ text-overflow: ellipsis;
752
+ white-space: nowrap;
753
+ `;
754
+ }
755
+ return `
756
+ display: -webkit-box;
757
+ -webkit-box-orient: vertical;
758
+ -webkit-line-clamp: ${numberOfLines};
759
+ line-clamp: ${numberOfLines};
760
+ max-width: 100%;
761
+ min-width: 0;
762
+ overflow: hidden;
763
+ `;
764
+ };
735
765
  var FilteredSpan = createFilteredElement2("span");
736
766
  var StyledText = styled22(FilteredSpan)`
737
767
  color: ${(props) => props.color || "inherit"};
@@ -742,6 +772,9 @@ var StyledText = styled22(FilteredSpan)`
742
772
  white-space: ${(props) => props.whiteSpace || "normal"};
743
773
  text-align: ${(props) => props.textAlign || "inherit"};
744
774
  text-decoration: ${(props) => props.textDecoration || "none"};
775
+
776
+ /* Keep last: single-line truncation has to win over white-space above. */
777
+ ${(props) => truncationStyles(props.numberOfLines)}
745
778
  `;
746
779
  var Text2 = ({
747
780
  style,
@@ -750,7 +783,6 @@ var Text2 = ({
750
783
  role,
751
784
  testID,
752
785
  "data-testid": dataTestId,
753
- numberOfLines: _numberOfLines,
754
786
  ...props
755
787
  }) => {
756
788
  return /* @__PURE__ */ jsx23(