@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xsolla/xui-multi-select",
3
- "version": "0.196.1",
3
+ "version": "0.197.0",
4
4
  "main": "./web/index.js",
5
5
  "module": "./web/index.mjs",
6
6
  "types": "./web/index.d.ts",
@@ -10,11 +10,11 @@
10
10
  "build:native": "PLATFORM=native tsup"
11
11
  },
12
12
  "dependencies": {
13
- "@xsolla/xui-checkbox": "0.196.1",
14
- "@xsolla/xui-core": "0.196.1",
15
- "@xsolla/xui-dropdown": "0.196.1",
16
- "@xsolla/xui-icons-base": "0.196.1",
17
- "@xsolla/xui-primitives-core": "0.196.1"
13
+ "@xsolla/xui-checkbox": "0.197.0",
14
+ "@xsolla/xui-core": "0.197.0",
15
+ "@xsolla/xui-dropdown": "0.197.0",
16
+ "@xsolla/xui-icons-base": "0.197.0",
17
+ "@xsolla/xui-primitives-core": "0.197.0"
18
18
  },
19
19
  "peerDependencies": {
20
20
  "react": ">=16.8.0",
package/web/index.js CHANGED
@@ -83,7 +83,11 @@ var ADDITIONAL_BLOCKED_PROPS = /* @__PURE__ */ new Set([
83
83
  "fontSize",
84
84
  "fontWeight",
85
85
  "fontFamily",
86
- "textDecoration"
86
+ "textDecoration",
87
+ // Cross-platform layout prop that Text consumes as CSS, never as an
88
+ // attribute. Pinned explicitly because it is now spread into the styled
89
+ // component rather than destructured away before it can reach the DOM.
90
+ "numberOfLines"
87
91
  ]);
88
92
  function shouldForwardProp(key) {
89
93
  if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;
@@ -290,6 +294,32 @@ Box.displayName = "Box";
290
294
 
291
295
  // ../../foundation/primitives-web/src/Text.tsx
292
296
  var import_styled_components2 = __toESM(require("styled-components"));
297
+
298
+ // ../../foundation/primitives-web/src/textTruncation.ts
299
+ var truncationStyles = (numberOfLines) => {
300
+ if (!numberOfLines || numberOfLines < 1) return "";
301
+ if (numberOfLines === 1) {
302
+ return `
303
+ display: block;
304
+ max-width: 100%;
305
+ min-width: 0;
306
+ overflow: hidden;
307
+ text-overflow: ellipsis;
308
+ white-space: nowrap;
309
+ `;
310
+ }
311
+ return `
312
+ display: -webkit-box;
313
+ -webkit-box-orient: vertical;
314
+ -webkit-line-clamp: ${numberOfLines};
315
+ line-clamp: ${numberOfLines};
316
+ max-width: 100%;
317
+ min-width: 0;
318
+ overflow: hidden;
319
+ `;
320
+ };
321
+
322
+ // ../../foundation/primitives-web/src/Text.tsx
293
323
  var import_jsx_runtime2 = require("react/jsx-runtime");
294
324
  var FilteredSpan = createFilteredElement("span");
295
325
  var StyledText = (0, import_styled_components2.default)(FilteredSpan)`
@@ -301,6 +331,9 @@ var StyledText = (0, import_styled_components2.default)(FilteredSpan)`
301
331
  white-space: ${(props) => props.whiteSpace || "normal"};
302
332
  text-align: ${(props) => props.textAlign || "inherit"};
303
333
  text-decoration: ${(props) => props.textDecoration || "none"};
334
+
335
+ /* Keep last: single-line truncation has to win over white-space above. */
336
+ ${(props) => truncationStyles(props.numberOfLines)}
304
337
  `;
305
338
  var Text = ({
306
339
  style,
@@ -309,7 +342,6 @@ var Text = ({
309
342
  role,
310
343
  testID,
311
344
  "data-testid": dataTestId,
312
- numberOfLines: _numberOfLines,
313
345
  ...props
314
346
  }) => {
315
347
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
@@ -499,7 +531,11 @@ var ADDITIONAL_BLOCKED_PROPS2 = /* @__PURE__ */ new Set([
499
531
  "fontSize",
500
532
  "fontWeight",
501
533
  "fontFamily",
502
- "textDecoration"
534
+ "textDecoration",
535
+ // Cross-platform layout prop that Text consumes as CSS, never as an
536
+ // attribute. Pinned explicitly because it is now spread into the styled
537
+ // component rather than destructured away before it can reach the DOM.
538
+ "numberOfLines"
503
539
  ]);
504
540
  function shouldForwardProp2(key) {
505
541
  if (ADDITIONAL_BLOCKED_PROPS2.has(key)) return false;
@@ -589,7 +625,11 @@ var ADDITIONAL_BLOCKED_PROPS3 = /* @__PURE__ */ new Set([
589
625
  "fontSize",
590
626
  "fontWeight",
591
627
  "fontFamily",
592
- "textDecoration"
628
+ "textDecoration",
629
+ // Cross-platform layout prop that Text consumes as CSS, never as an
630
+ // attribute. Pinned explicitly because it is now spread into the styled
631
+ // component rather than destructured away before it can reach the DOM.
632
+ "numberOfLines"
593
633
  ]);
594
634
  function shouldForwardProp3(key) {
595
635
  if (ADDITIONAL_BLOCKED_PROPS3.has(key)) return false;
@@ -790,6 +830,28 @@ var Box2 = import_react6.default.forwardRef(
790
830
  }
791
831
  );
792
832
  Box2.displayName = "Box";
833
+ var truncationStyles2 = (numberOfLines) => {
834
+ if (!numberOfLines || numberOfLines < 1) return "";
835
+ if (numberOfLines === 1) {
836
+ return `
837
+ display: block;
838
+ max-width: 100%;
839
+ min-width: 0;
840
+ overflow: hidden;
841
+ text-overflow: ellipsis;
842
+ white-space: nowrap;
843
+ `;
844
+ }
845
+ return `
846
+ display: -webkit-box;
847
+ -webkit-box-orient: vertical;
848
+ -webkit-line-clamp: ${numberOfLines};
849
+ line-clamp: ${numberOfLines};
850
+ max-width: 100%;
851
+ min-width: 0;
852
+ overflow: hidden;
853
+ `;
854
+ };
793
855
  var FilteredSpan2 = createFilteredElement3("span");
794
856
  var StyledText2 = (0, import_styled_components6.default)(FilteredSpan2)`
795
857
  color: ${(props) => props.color || "inherit"};
@@ -800,6 +862,9 @@ var StyledText2 = (0, import_styled_components6.default)(FilteredSpan2)`
800
862
  white-space: ${(props) => props.whiteSpace || "normal"};
801
863
  text-align: ${(props) => props.textAlign || "inherit"};
802
864
  text-decoration: ${(props) => props.textDecoration || "none"};
865
+
866
+ /* Keep last: single-line truncation has to win over white-space above. */
867
+ ${(props) => truncationStyles2(props.numberOfLines)}
803
868
  `;
804
869
  var Text2 = ({
805
870
  style,
@@ -808,7 +873,6 @@ var Text2 = ({
808
873
  role,
809
874
  testID,
810
875
  "data-testid": dataTestId,
811
- numberOfLines: _numberOfLines,
812
876
  ...props
813
877
  }) => {
814
878
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(