@xsolla/xui-multi-select 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/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(
@@ -483,7 +515,11 @@ var ADDITIONAL_BLOCKED_PROPS2 = /* @__PURE__ */ new Set([
483
515
  "fontSize",
484
516
  "fontWeight",
485
517
  "fontFamily",
486
- "textDecoration"
518
+ "textDecoration",
519
+ // Cross-platform layout prop that Text consumes as CSS, never as an
520
+ // attribute. Pinned explicitly because it is now spread into the styled
521
+ // component rather than destructured away before it can reach the DOM.
522
+ "numberOfLines"
487
523
  ]);
488
524
  function shouldForwardProp2(key) {
489
525
  if (ADDITIONAL_BLOCKED_PROPS2.has(key)) return false;
@@ -573,7 +609,11 @@ var ADDITIONAL_BLOCKED_PROPS3 = /* @__PURE__ */ new Set([
573
609
  "fontSize",
574
610
  "fontWeight",
575
611
  "fontFamily",
576
- "textDecoration"
612
+ "textDecoration",
613
+ // Cross-platform layout prop that Text consumes as CSS, never as an
614
+ // attribute. Pinned explicitly because it is now spread into the styled
615
+ // component rather than destructured away before it can reach the DOM.
616
+ "numberOfLines"
577
617
  ]);
578
618
  function shouldForwardProp3(key) {
579
619
  if (ADDITIONAL_BLOCKED_PROPS3.has(key)) return false;
@@ -774,6 +814,28 @@ var Box2 = React22.forwardRef(
774
814
  }
775
815
  );
776
816
  Box2.displayName = "Box";
817
+ var truncationStyles2 = (numberOfLines) => {
818
+ if (!numberOfLines || numberOfLines < 1) return "";
819
+ if (numberOfLines === 1) {
820
+ return `
821
+ display: block;
822
+ max-width: 100%;
823
+ min-width: 0;
824
+ overflow: hidden;
825
+ text-overflow: ellipsis;
826
+ white-space: nowrap;
827
+ `;
828
+ }
829
+ return `
830
+ display: -webkit-box;
831
+ -webkit-box-orient: vertical;
832
+ -webkit-line-clamp: ${numberOfLines};
833
+ line-clamp: ${numberOfLines};
834
+ max-width: 100%;
835
+ min-width: 0;
836
+ overflow: hidden;
837
+ `;
838
+ };
777
839
  var FilteredSpan2 = createFilteredElement3("span");
778
840
  var StyledText2 = styled22(FilteredSpan2)`
779
841
  color: ${(props) => props.color || "inherit"};
@@ -784,6 +846,9 @@ var StyledText2 = styled22(FilteredSpan2)`
784
846
  white-space: ${(props) => props.whiteSpace || "normal"};
785
847
  text-align: ${(props) => props.textAlign || "inherit"};
786
848
  text-decoration: ${(props) => props.textDecoration || "none"};
849
+
850
+ /* Keep last: single-line truncation has to win over white-space above. */
851
+ ${(props) => truncationStyles2(props.numberOfLines)}
787
852
  `;
788
853
  var Text2 = ({
789
854
  style,
@@ -792,7 +857,6 @@ var Text2 = ({
792
857
  role,
793
858
  testID,
794
859
  "data-testid": dataTestId,
795
- numberOfLines: _numberOfLines,
796
860
  ...props
797
861
  }) => {
798
862
  return /* @__PURE__ */ jsx23(