@xsolla/xui-multi-select 0.216.0 → 0.216.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/native/index.js CHANGED
@@ -35,7 +35,7 @@ __export(index_exports, {
35
35
  module.exports = __toCommonJS(index_exports);
36
36
 
37
37
  // src/MultiSelect.tsx
38
- var import_react10 = require("react");
38
+ var import_react5 = require("react");
39
39
 
40
40
  // ../../foundation/primitives-native/src/Box.tsx
41
41
  var import_react_native = require("react-native");
@@ -373,656 +373,19 @@ var Icon = ({
373
373
  var isWeb = false;
374
374
 
375
375
  // src/MultiSelect.tsx
376
- var import_xui_core4 = require("@xsolla/xui-core");
376
+ var import_xui_core3 = require("@xsolla/xui-core");
377
377
  var import_xui_icons_base2 = require("@xsolla/xui-icons-base");
378
378
 
379
379
  // src/MultiSelectControl.tsx
380
- var import_react8 = require("react");
381
- var import_xui_core3 = require("@xsolla/xui-core");
380
+ var import_react3 = require("react");
381
+ var import_xui_core2 = require("@xsolla/xui-core");
382
382
  var import_xui_icons_base = require("@xsolla/xui-icons-base");
383
383
 
384
384
  // src/useMultiSelectControl.tsx
385
- var import_react7 = require("react");
386
-
387
- // ../tag/dist/web/index.mjs
388
- var import_react5 = __toESM(require("react"), 1);
389
- var import_styled_components2 = __toESM(require("styled-components"), 1);
390
- var import_react6 = __toESM(require("react"), 1);
391
- var import_jsx_runtime6 = require("react/jsx-runtime");
392
- var import_styled_components3 = __toESM(require("styled-components"), 1);
393
- var import_jsx_runtime7 = require("react/jsx-runtime");
394
- var import_styled_components4 = __toESM(require("styled-components"), 1);
395
- var import_jsx_runtime8 = require("react/jsx-runtime");
385
+ var import_react2 = require("react");
386
+ var import_xui_tag = require("@xsolla/xui-tag");
396
387
  var import_xui_core = require("@xsolla/xui-core");
397
-
398
- // ../../foundation/icons/dist/web/index.mjs
399
- var import_react4 = __toESM(require("react"), 1);
400
- var import_styled_components = __toESM(require("styled-components"), 1);
401
388
  var import_jsx_runtime4 = require("react/jsx-runtime");
402
-
403
- // ../../../node_modules/lucide-react/dist/esm/createLucideIcon.js
404
- var import_react3 = require("react");
405
-
406
- // ../../../node_modules/lucide-react/dist/esm/shared/src/utils.js
407
- var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
408
- var mergeClasses = (...classes) => classes.filter((className, index3, array) => {
409
- return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index3;
410
- }).join(" ").trim();
411
-
412
- // ../../../node_modules/lucide-react/dist/esm/Icon.js
413
- var import_react2 = require("react");
414
-
415
- // ../../../node_modules/lucide-react/dist/esm/defaultAttributes.js
416
- var defaultAttributes = {
417
- xmlns: "http://www.w3.org/2000/svg",
418
- width: 24,
419
- height: 24,
420
- viewBox: "0 0 24 24",
421
- fill: "none",
422
- stroke: "currentColor",
423
- strokeWidth: 2,
424
- strokeLinecap: "round",
425
- strokeLinejoin: "round"
426
- };
427
-
428
- // ../../../node_modules/lucide-react/dist/esm/Icon.js
429
- var Icon2 = (0, import_react2.forwardRef)(
430
- ({
431
- color = "currentColor",
432
- size = 24,
433
- strokeWidth = 2,
434
- absoluteStrokeWidth,
435
- className = "",
436
- children,
437
- iconNode,
438
- ...rest
439
- }, ref) => {
440
- return (0, import_react2.createElement)(
441
- "svg",
442
- {
443
- ref,
444
- ...defaultAttributes,
445
- width: size,
446
- height: size,
447
- stroke: color,
448
- strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
449
- className: mergeClasses("lucide", className),
450
- ...rest
451
- },
452
- [
453
- ...iconNode.map(([tag, attrs]) => (0, import_react2.createElement)(tag, attrs)),
454
- ...Array.isArray(children) ? children : [children]
455
- ]
456
- );
457
- }
458
- );
459
-
460
- // ../../../node_modules/lucide-react/dist/esm/createLucideIcon.js
461
- var createLucideIcon = (iconName, iconNode) => {
462
- const Component = (0, import_react3.forwardRef)(
463
- ({ className, ...props }, ref) => (0, import_react3.createElement)(Icon2, {
464
- ref,
465
- iconNode,
466
- className: mergeClasses(`lucide-${toKebabCase(iconName)}`, className),
467
- ...props
468
- })
469
- );
470
- Component.displayName = `${iconName}`;
471
- return Component;
472
- };
473
-
474
- // ../../../node_modules/lucide-react/dist/esm/icons/x.js
475
- var X = createLucideIcon("X", [
476
- ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
477
- ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
478
- ]);
479
-
480
- // ../../foundation/icons/dist/web/index.mjs
481
- var import_jsx_runtime5 = require("react/jsx-runtime");
482
- function memoize(fn) {
483
- var cache = {};
484
- return function(arg) {
485
- if (cache[arg] === void 0) cache[arg] = fn(arg);
486
- return cache[arg];
487
- };
488
- }
489
- var memoize_esm_default = memoize;
490
- var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/;
491
- var index = memoize_esm_default(
492
- function(prop) {
493
- return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 && prop.charCodeAt(1) === 110 && prop.charCodeAt(2) < 91;
494
- }
495
- /* Z+1 */
496
- );
497
- var is_prop_valid_esm_default = index;
498
- var ADDITIONAL_BLOCKED_PROPS = /* @__PURE__ */ new Set([
499
- // RN-only event handlers (pass isPropValid's on* pattern)
500
- "onPress",
501
- "onChangeText",
502
- "onLayout",
503
- "onMoveShouldSetResponder",
504
- "onResponderGrant",
505
- "onResponderMove",
506
- "onResponderRelease",
507
- "onResponderTerminate",
508
- // SVG attributes that pass isPropValid
509
- "strokeWidth",
510
- // CSS properties that pass isPropValid but are used as component props
511
- "overflow",
512
- "opacity",
513
- "cursor",
514
- "fontSize",
515
- "fontWeight",
516
- "fontFamily",
517
- "textDecoration",
518
- // Cross-platform layout prop that Text consumes as CSS, never as an
519
- // attribute. Pinned explicitly because it is now spread into the styled
520
- // component rather than destructured away before it can reach the DOM.
521
- "numberOfLines"
522
- ]);
523
- function shouldForwardProp(key) {
524
- if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;
525
- return is_prop_valid_esm_default(key);
526
- }
527
- function createFilteredElement(defaultTag) {
528
- const Component = import_react4.default.forwardRef(
529
- ({ children, elementType, ...props }, ref) => {
530
- const Tag2 = elementType || defaultTag;
531
- const htmlProps = {};
532
- for (const key of Object.keys(props)) {
533
- if (shouldForwardProp(key)) {
534
- htmlProps[key] = props[key];
535
- }
536
- }
537
- return import_react4.default.createElement(
538
- Tag2,
539
- { ref, ...htmlProps },
540
- children
541
- );
542
- }
543
- );
544
- Component.displayName = `Filtered(${defaultTag})`;
545
- return Component;
546
- }
547
- var FilteredDiv = createFilteredElement("div");
548
- var StyledIcon = (0, import_styled_components.default)(FilteredDiv)`
549
- display: flex;
550
- align-items: center;
551
- justify-content: center;
552
- width: ${(props) => typeof props.size === "number" ? `${props.size}px` : props.size || "24px"};
553
- height: ${(props) => typeof props.size === "number" ? `${props.size}px` : props.size || "24px"};
554
- color: ${(props) => props.color || "currentColor"};
555
-
556
- /* Icons paint themselves — each icon's own SVG sets its fill/stroke
557
- (icons-base via inline "fill: currentColor", Lucide via "fill"/"stroke"
558
- attributes). Do not add fill/stroke here: it re-strokes fill-based icons
559
- and thickens the glyph. See FEP-877. */
560
- svg {
561
- width: 100%;
562
- height: 100%;
563
- }
564
- `;
565
- var Icon3 = ({
566
- children,
567
- testID,
568
- "data-testid": dataTestId,
569
- ...props
570
- }) => {
571
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(StyledIcon, { "data-testid": dataTestId || testID, ...props, children });
572
- };
573
- var X2 = (props) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon3, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(X, { size: "100%" }) });
574
-
575
- // ../tag/dist/web/index.mjs
576
- var import_jsx_runtime9 = require("react/jsx-runtime");
577
- function memoize2(fn) {
578
- var cache = {};
579
- return function(arg) {
580
- if (cache[arg] === void 0) cache[arg] = fn(arg);
581
- return cache[arg];
582
- };
583
- }
584
- var memoize_esm_default2 = memoize2;
585
- var reactPropsRegex2 = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/;
586
- var index2 = memoize_esm_default2(
587
- function(prop) {
588
- return reactPropsRegex2.test(prop) || prop.charCodeAt(0) === 111 && prop.charCodeAt(1) === 110 && prop.charCodeAt(2) < 91;
589
- }
590
- /* Z+1 */
591
- );
592
- var is_prop_valid_esm_default2 = index2;
593
- var ADDITIONAL_BLOCKED_PROPS2 = /* @__PURE__ */ new Set([
594
- // RN-only event handlers (pass isPropValid's on* pattern)
595
- "onPress",
596
- "onChangeText",
597
- "onLayout",
598
- "onMoveShouldSetResponder",
599
- "onResponderGrant",
600
- "onResponderMove",
601
- "onResponderRelease",
602
- "onResponderTerminate",
603
- // SVG attributes that pass isPropValid
604
- "strokeWidth",
605
- // CSS properties that pass isPropValid but are used as component props
606
- "overflow",
607
- "opacity",
608
- "cursor",
609
- "fontSize",
610
- "fontWeight",
611
- "fontFamily",
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"
617
- ]);
618
- function shouldForwardProp2(key) {
619
- if (ADDITIONAL_BLOCKED_PROPS2.has(key)) return false;
620
- return is_prop_valid_esm_default2(key);
621
- }
622
- function createFilteredElement2(defaultTag) {
623
- const Component = import_react6.default.forwardRef(
624
- ({ children, elementType, ...props }, ref) => {
625
- const Tag2 = elementType || defaultTag;
626
- const htmlProps = {};
627
- for (const key of Object.keys(props)) {
628
- if (shouldForwardProp2(key)) {
629
- htmlProps[key] = props[key];
630
- }
631
- }
632
- return import_react6.default.createElement(
633
- Tag2,
634
- { ref, ...htmlProps },
635
- children
636
- );
637
- }
638
- );
639
- Component.displayName = `Filtered(${defaultTag})`;
640
- return Component;
641
- }
642
- var FilteredDiv2 = createFilteredElement2("div");
643
- var StyledBox = (0, import_styled_components2.default)(FilteredDiv2)`
644
- display: flex;
645
- box-sizing: border-box;
646
- background-color: ${(props) => props.backgroundColor || "transparent"};
647
- border-color: ${(props) => props.borderColor || "transparent"};
648
- border-width: ${(props) => typeof props.borderWidth === "number" ? `${props.borderWidth}px` : props.borderWidth || 0};
649
-
650
- ${(props) => props.borderBottomWidth !== void 0 && `
651
- border-bottom-width: ${typeof props.borderBottomWidth === "number" ? `${props.borderBottomWidth}px` : props.borderBottomWidth};
652
- border-bottom-color: ${props.borderBottomColor || props.borderColor || "transparent"};
653
- border-bottom-style: solid;
654
- `}
655
- ${(props) => props.borderTopWidth !== void 0 && `
656
- border-top-width: ${typeof props.borderTopWidth === "number" ? `${props.borderTopWidth}px` : props.borderTopWidth};
657
- border-top-color: ${props.borderTopColor || props.borderColor || "transparent"};
658
- border-top-style: solid;
659
- `}
660
- ${(props) => props.borderLeftWidth !== void 0 && `
661
- border-left-width: ${typeof props.borderLeftWidth === "number" ? `${props.borderLeftWidth}px` : props.borderLeftWidth};
662
- border-left-color: ${props.borderLeftColor || props.borderColor || "transparent"};
663
- border-left-style: solid;
664
- `}
665
- ${(props) => props.borderRightWidth !== void 0 && `
666
- border-right-width: ${typeof props.borderRightWidth === "number" ? `${props.borderRightWidth}px` : props.borderRightWidth};
667
- border-right-color: ${props.borderRightColor || props.borderColor || "transparent"};
668
- border-right-style: solid;
669
- `}
670
-
671
- border-style: ${(props) => props.borderStyle || (props.borderWidth || props.borderBottomWidth || props.borderTopWidth || props.borderLeftWidth || props.borderRightWidth ? "solid" : "none")};
672
- border-radius: ${(props) => typeof props.borderRadius === "number" ? `${props.borderRadius}px` : props.borderRadius || 0};
673
- height: ${(props) => typeof props.height === "number" ? `${props.height}px` : props.height || "auto"};
674
- width: ${(props) => typeof props.width === "number" ? `${props.width}px` : props.width || "auto"};
675
- min-width: ${(props) => typeof props.minWidth === "number" ? `${props.minWidth}px` : props.minWidth || "auto"};
676
- min-height: ${(props) => typeof props.minHeight === "number" ? `${props.minHeight}px` : props.minHeight || "auto"};
677
- max-width: ${(props) => typeof props.maxWidth === "number" ? `${props.maxWidth}px` : props.maxWidth || "none"};
678
- max-height: ${(props) => typeof props.maxHeight === "number" ? `${props.maxHeight}px` : props.maxHeight || "none"};
679
-
680
- padding: ${(props) => typeof props.padding === "number" ? `${props.padding}px` : props.padding || 0};
681
- ${(props) => props.paddingHorizontal && `
682
- padding-left: ${typeof props.paddingHorizontal === "number" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};
683
- padding-right: ${typeof props.paddingHorizontal === "number" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};
684
- `}
685
- ${(props) => props.paddingVertical && `
686
- padding-top: ${typeof props.paddingVertical === "number" ? `${props.paddingVertical}px` : props.paddingVertical};
687
- padding-bottom: ${typeof props.paddingVertical === "number" ? `${props.paddingVertical}px` : props.paddingVertical};
688
- `}
689
- ${(props) => props.paddingTop !== void 0 && `padding-top: ${typeof props.paddingTop === "number" ? `${props.paddingTop}px` : props.paddingTop};`}
690
- ${(props) => props.paddingBottom !== void 0 && `padding-bottom: ${typeof props.paddingBottom === "number" ? `${props.paddingBottom}px` : props.paddingBottom};`}
691
- ${(props) => props.paddingLeft !== void 0 && `padding-left: ${typeof props.paddingLeft === "number" ? `${props.paddingLeft}px` : props.paddingLeft};`}
692
- ${(props) => props.paddingRight !== void 0 && `padding-right: ${typeof props.paddingRight === "number" ? `${props.paddingRight}px` : props.paddingRight};`}
693
-
694
- margin: ${(props) => typeof props.margin === "number" ? `${props.margin}px` : props.margin || 0};
695
- ${(props) => props.marginTop !== void 0 && `margin-top: ${typeof props.marginTop === "number" ? `${props.marginTop}px` : props.marginTop};`}
696
- ${(props) => props.marginBottom !== void 0 && `margin-bottom: ${typeof props.marginBottom === "number" ? `${props.marginBottom}px` : props.marginBottom};`}
697
- ${(props) => props.marginLeft !== void 0 && `margin-left: ${typeof props.marginLeft === "number" ? `${props.marginLeft}px` : props.marginLeft};`}
698
- ${(props) => props.marginRight !== void 0 && `margin-right: ${typeof props.marginRight === "number" ? `${props.marginRight}px` : props.marginRight};`}
699
-
700
- flex-direction: ${(props) => props.flexDirection || "column"};
701
- flex-wrap: ${(props) => props.flexWrap || "nowrap"};
702
- align-items: ${(props) => props.alignItems || "stretch"};
703
- justify-content: ${(props) => props.justifyContent || "flex-start"};
704
- cursor: ${(props) => props.cursor ? props.cursor : props.onClick || props.onPress ? "pointer" : "inherit"};
705
- position: ${(props) => props.position || "static"};
706
- top: ${(props) => typeof props.top === "number" ? `${props.top}px` : props.top};
707
- bottom: ${(props) => typeof props.bottom === "number" ? `${props.bottom}px` : props.bottom};
708
- left: ${(props) => typeof props.left === "number" ? `${props.left}px` : props.left};
709
- right: ${(props) => typeof props.right === "number" ? `${props.right}px` : props.right};
710
- flex: ${(props) => props.flex};
711
- flex-shrink: ${(props) => props.flexShrink ?? 1};
712
- gap: ${(props) => typeof props.gap === "number" ? `${props.gap}px` : props.gap || 0};
713
- align-self: ${(props) => props.alignSelf || "auto"};
714
- /* Only emit overflow-x/y when explicitly set. Defaulting them to
715
- visible after overflow would override the shorthand and break
716
- clipping (e.g. OtherCard bottom-right promo image). */
717
- overflow: ${(props) => props.overflow || "visible"};
718
- ${(props) => props.overflowX != null ? `overflow-x: ${props.overflowX};` : ""}
719
- ${(props) => props.overflowY != null ? `overflow-y: ${props.overflowY};` : ""}
720
- z-index: ${(props) => props.zIndex};
721
- opacity: ${(props) => props.opacity != null ? props.opacity : props.disabled ? 0.5 : 1};
722
- pointer-events: ${(props) => props.disabled ? "none" : "auto"};
723
-
724
- /* \`background\` is emitted before \`background-color\` so a caller passing
725
- both still gets backgroundColor as the winner. Use the shorthand for a
726
- layered fill (e.g. an overlay tint over a resting surface colour), which
727
- a single background-color cannot express. */
728
- &:hover {
729
- ${(props) => props.hoverStyle?.background && `background: ${props.hoverStyle.background};`}
730
- ${(props) => props.hoverStyle?.backgroundColor && `background-color: ${props.hoverStyle.backgroundColor};`}
731
- ${(props) => props.hoverStyle?.borderColor && `border-color: ${props.hoverStyle.borderColor};`}
732
- }
733
-
734
- &:active {
735
- ${(props) => props.pressStyle?.background && `background: ${props.pressStyle.background};`}
736
- ${(props) => props.pressStyle?.backgroundColor && `background-color: ${props.pressStyle.backgroundColor};`}
737
- }
738
- `;
739
- var Box2 = import_react5.default.forwardRef(
740
- ({
741
- children,
742
- onPress,
743
- onKeyDown,
744
- onKeyUp,
745
- role,
746
- "aria-label": ariaLabel,
747
- "aria-labelledby": ariaLabelledBy,
748
- "aria-current": ariaCurrent,
749
- "aria-disabled": ariaDisabled,
750
- "aria-live": ariaLive,
751
- "aria-busy": ariaBusy,
752
- "aria-describedby": ariaDescribedBy,
753
- "aria-expanded": ariaExpanded,
754
- "aria-haspopup": ariaHasPopup,
755
- "aria-pressed": ariaPressed,
756
- "aria-controls": ariaControls,
757
- tabIndex,
758
- as,
759
- src,
760
- alt,
761
- onError,
762
- onLoad,
763
- type,
764
- disabled,
765
- id,
766
- testID,
767
- "data-testid": dataTestId,
768
- ...props
769
- }, ref) => {
770
- if (as === "img" && src) {
771
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
772
- "img",
773
- {
774
- src,
775
- alt: alt || "",
776
- onError,
777
- onLoad,
778
- "data-testid": dataTestId || testID,
779
- style: {
780
- display: "block",
781
- objectFit: "cover",
782
- width: typeof props.width === "number" ? `${props.width}px` : props.width,
783
- height: typeof props.height === "number" ? `${props.height}px` : props.height,
784
- borderRadius: typeof props.borderRadius === "number" ? `${props.borderRadius}px` : props.borderRadius,
785
- position: props.position,
786
- top: typeof props.top === "number" ? `${props.top}px` : props.top,
787
- left: typeof props.left === "number" ? `${props.left}px` : props.left,
788
- right: typeof props.right === "number" ? `${props.right}px` : props.right,
789
- bottom: typeof props.bottom === "number" ? `${props.bottom}px` : props.bottom,
790
- ...props.style
791
- }
792
- }
793
- );
794
- }
795
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
796
- StyledBox,
797
- {
798
- ref,
799
- elementType: as,
800
- id,
801
- type: as === "button" ? type || "button" : void 0,
802
- disabled: as === "button" ? disabled : void 0,
803
- onClick: onPress,
804
- onKeyDown,
805
- onKeyUp,
806
- role,
807
- "aria-label": ariaLabel,
808
- "aria-labelledby": ariaLabelledBy,
809
- "aria-current": ariaCurrent,
810
- "aria-disabled": ariaDisabled,
811
- "aria-busy": ariaBusy,
812
- "aria-describedby": ariaDescribedBy,
813
- "aria-expanded": ariaExpanded,
814
- "aria-haspopup": ariaHasPopup,
815
- "aria-pressed": ariaPressed,
816
- "aria-controls": ariaControls,
817
- "aria-live": ariaLive,
818
- tabIndex: tabIndex !== void 0 ? tabIndex : void 0,
819
- "data-testid": dataTestId || testID,
820
- ...props,
821
- children
822
- }
823
- );
824
- }
825
- );
826
- Box2.displayName = "Box";
827
- var truncationStyles = (numberOfLines) => {
828
- if (!numberOfLines || numberOfLines < 1) return "";
829
- if (numberOfLines === 1) {
830
- return `
831
- display: block;
832
- max-width: 100%;
833
- min-width: 0;
834
- overflow: hidden;
835
- text-overflow: ellipsis;
836
- white-space: nowrap;
837
- `;
838
- }
839
- return `
840
- display: -webkit-box;
841
- -webkit-box-orient: vertical;
842
- -webkit-line-clamp: ${numberOfLines};
843
- line-clamp: ${numberOfLines};
844
- max-width: 100%;
845
- min-width: 0;
846
- overflow: hidden;
847
- `;
848
- };
849
- var FilteredSpan = createFilteredElement2("span");
850
- var StyledText = (0, import_styled_components3.default)(FilteredSpan)`
851
- color: ${(props) => props.color || "inherit"};
852
- font-size: ${(props) => typeof props.fontSize === "number" ? `${props.fontSize}px` : props.fontSize || "inherit"};
853
- font-weight: ${(props) => props.fontWeight || "normal"};
854
- font-family: ${(props) => props.fontFamily || '"Aktiv Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif'};
855
- line-height: ${(props) => typeof props.lineHeight === "number" ? `${props.lineHeight}px` : props.lineHeight || "inherit"};
856
- white-space: ${(props) => props.whiteSpace || "normal"};
857
- text-align: ${(props) => props.textAlign || "inherit"};
858
- text-decoration: ${(props) => props.textDecoration || "none"};
859
-
860
- /* Keep last: single-line truncation has to win over white-space above. */
861
- ${(props) => truncationStyles(props.numberOfLines)}
862
- `;
863
- var Text2 = ({
864
- style,
865
- className,
866
- id,
867
- role,
868
- testID,
869
- "data-testid": dataTestId,
870
- ...props
871
- }) => {
872
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
873
- StyledText,
874
- {
875
- ...props,
876
- style,
877
- className,
878
- id,
879
- role,
880
- "data-testid": dataTestId || testID
881
- }
882
- );
883
- };
884
- var FilteredDiv22 = createFilteredElement2("div");
885
- var StyledIcon2 = (0, import_styled_components4.default)(FilteredDiv22)`
886
- display: flex;
887
- align-items: center;
888
- justify-content: center;
889
- width: ${(props) => typeof props.size === "number" ? `${props.size}px` : props.size || "24px"};
890
- height: ${(props) => typeof props.size === "number" ? `${props.size}px` : props.size || "24px"};
891
- color: ${(props) => props.color || "currentColor"};
892
-
893
- /* Icons paint themselves — each icon's own SVG sets its fill/stroke
894
- (icons-base via inline "fill: currentColor", Lucide via "fill"/"stroke"
895
- attributes). Do not add fill/stroke here: it re-strokes fill-based icons
896
- and thickens the glyph. See FEP-877. */
897
- svg {
898
- width: 100%;
899
- height: 100%;
900
- }
901
- `;
902
- var Icon4 = ({
903
- children,
904
- testID,
905
- "data-testid": dataTestId,
906
- ...props
907
- }) => {
908
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(StyledIcon2, { "data-testid": dataTestId || testID, ...props, children });
909
- };
910
- var Tag = ({
911
- size = "md",
912
- tone = "primary",
913
- type = "solid",
914
- children,
915
- iconLeft,
916
- iconRight,
917
- onRemove,
918
- testID,
919
- themeMode,
920
- themeProductContext
921
- }) => {
922
- const { theme } = (0, import_xui_core.useResolvedTheme)({ themeMode, themeProductContext });
923
- const sizeStyles = theme.sizing.tag(size);
924
- const resolveColors = () => {
925
- const isOutlined = type === "outlined";
926
- switch (tone) {
927
- case "primary":
928
- return {
929
- bg: isOutlined ? "transparent" : theme.colors.background.primary,
930
- text: theme.colors.content.primary,
931
- border: theme.colors.border.secondary
932
- };
933
- case "brand":
934
- return {
935
- bg: isOutlined ? "transparent" : theme.colors.background.brand.primary,
936
- text: isOutlined ? theme.colors.content.brand.primary : theme.colors.content.on.brand,
937
- border: theme.colors.border.brand
938
- };
939
- case "brandExtra":
940
- return {
941
- bg: isOutlined ? "transparent" : theme.colors.background.brandExtra.primary,
942
- text: isOutlined ? theme.colors.content.brandExtra.primary : theme.colors.content.on.brandExtra,
943
- border: theme.colors.border.brandExtra
944
- };
945
- case "success":
946
- return {
947
- bg: isOutlined ? "transparent" : theme.colors.background.success.primary,
948
- text: isOutlined ? theme.colors.content.success.primary : theme.colors.content.on.success,
949
- border: theme.colors.border.success
950
- };
951
- case "warning":
952
- return {
953
- bg: isOutlined ? "transparent" : theme.colors.background.warning.primary,
954
- text: isOutlined ? theme.colors.content.warning.primary : theme.colors.content.on.warning,
955
- border: theme.colors.border.warning
956
- };
957
- case "alert":
958
- return {
959
- bg: isOutlined ? "transparent" : theme.colors.background.alert.primary,
960
- text: isOutlined ? theme.colors.content.alert.primary : theme.colors.content.on.alert,
961
- border: theme.colors.border.alert
962
- };
963
- case "neutral":
964
- return {
965
- bg: isOutlined ? "transparent" : theme.colors.background.neutral.primary,
966
- text: isOutlined ? theme.colors.content.neutral.primary : theme.colors.content.on.neutral,
967
- border: theme.colors.border.neutral
968
- };
969
- default:
970
- return {
971
- bg: isOutlined ? "transparent" : theme.colors.background.primary,
972
- text: theme.colors.content.primary,
973
- border: theme.colors.border.secondary
974
- };
975
- }
976
- };
977
- const { bg, text, border } = resolveColors();
978
- const isIconOnly = !children && (!!iconLeft || !!iconRight);
979
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
980
- Box2,
981
- {
982
- testID,
983
- backgroundColor: bg,
984
- borderRadius: sizeStyles.radius,
985
- height: sizeStyles.height,
986
- width: isIconOnly ? sizeStyles.height : void 0,
987
- paddingHorizontal: isIconOnly ? 0 : sizeStyles.padding,
988
- flexDirection: "row",
989
- alignItems: "center",
990
- justifyContent: "center",
991
- gap: sizeStyles.gap,
992
- borderWidth: sizeStyles.borderWidth,
993
- borderColor: border,
994
- borderStyle: "solid",
995
- style: {
996
- overflow: "hidden",
997
- textOverflow: "ellipsis",
998
- whiteSpace: "nowrap"
999
- },
1000
- children: [
1001
- iconLeft && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon4, { size: sizeStyles.iconSize, color: text, children: iconLeft }),
1002
- children && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1003
- Text2,
1004
- {
1005
- color: text,
1006
- fontSize: sizeStyles.fontSize,
1007
- fontWeight: "500",
1008
- whiteSpace: "nowrap",
1009
- style: {
1010
- overflow: "hidden",
1011
- textOverflow: "ellipsis"
1012
- },
1013
- children
1014
- }
1015
- ),
1016
- iconRight && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon4, { size: sizeStyles.iconSize, color: text, children: iconRight }),
1017
- onRemove && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Box2, { onPress: onRemove, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(X2, { size: sizeStyles.iconSize, color: text }) })
1018
- ]
1019
- }
1020
- );
1021
- };
1022
-
1023
- // src/useMultiSelectControl.tsx
1024
- var import_xui_core2 = require("@xsolla/xui-core");
1025
- var import_jsx_runtime10 = require("react/jsx-runtime");
1026
389
  var COUNT_ITEM_VALUE = "count-item";
1027
390
  var useMultiSelectControl = ({
1028
391
  variant,
@@ -1038,16 +401,16 @@ var useMultiSelectControl = ({
1038
401
  themeMode,
1039
402
  themeProductContext
1040
403
  }) => {
1041
- const { theme } = (0, import_xui_core2.useResolvedTheme)({ themeMode, themeProductContext });
1042
- const displayStateRef = (0, import_react7.useRef)(0 /* Placeholder */);
1043
- const savedWidthsRef = (0, import_react7.useRef)(null);
1044
- const itemsRef = (0, import_react7.useRef)(null);
1045
- const [itemsWidth, setItemsWidth] = (0, import_react7.useState)(0);
1046
- const [selectedContent, setSelectedContent] = (0, import_react7.useState)(
404
+ const { theme } = (0, import_xui_core.useResolvedTheme)({ themeMode, themeProductContext });
405
+ const displayStateRef = (0, import_react2.useRef)(0 /* Placeholder */);
406
+ const savedWidthsRef = (0, import_react2.useRef)(null);
407
+ const itemsRef = (0, import_react2.useRef)(null);
408
+ const [itemsWidth, setItemsWidth] = (0, import_react2.useState)(0);
409
+ const [selectedContent, setSelectedContent] = (0, import_react2.useState)(
1047
410
  null
1048
411
  );
1049
412
  const isPlaceholder = !selectedItems || selectedItems.length === 0;
1050
- (0, import_react7.useEffect)(() => {
413
+ (0, import_react2.useEffect)(() => {
1051
414
  if (!containerRef.current) return;
1052
415
  let rafId = null;
1053
416
  const syncItemsWidth = () => {
@@ -1067,7 +430,7 @@ var useMultiSelectControl = ({
1067
430
  resizeObserver.disconnect();
1068
431
  };
1069
432
  }, [containerRef]);
1070
- const widthsDependencies = (0, import_react7.useMemo)(
433
+ const widthsDependencies = (0, import_react2.useMemo)(
1071
434
  () => ({
1072
435
  stateList: stateList.map((item) => item.value),
1073
436
  variant,
@@ -1094,7 +457,7 @@ var useMultiSelectControl = ({
1094
457
  };
1095
458
  const setPlaceholder = () => {
1096
459
  setSelectedContent(
1097
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
460
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1098
461
  Text,
1099
462
  {
1100
463
  color: theme.colors.control.input.placeholder,
@@ -1141,11 +504,11 @@ var useMultiSelectControl = ({
1141
504
  const countText = displayStateRef.current === 1 /* PreRender */ ? `+${itemsList.length}` : `+${itemsList.length - displayedItems.length}`;
1142
505
  displayedItems.push({ value: COUNT_ITEM_VALUE, label: countText });
1143
506
  }
1144
- const content = displayedItems.map((item, index3) => {
507
+ const content = displayedItems.map((item, index) => {
1145
508
  const isCount = item.value === COUNT_ITEM_VALUE;
1146
- const isReducable = index3 === 0 && displayStateRef.current === 3 /* Render */ && displayedItemsCount === 0 || flexible;
509
+ const isReducable = index === 0 && displayStateRef.current === 3 /* Render */ && displayedItemsCount === 0 || flexible;
1147
510
  if (variant === "tag") {
1148
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
511
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1149
512
  Box,
1150
513
  {
1151
514
  onPress: !isCount ? (e) => {
@@ -1157,8 +520,8 @@ var useMultiSelectControl = ({
1157
520
  opacity: disabled ? 0.5 : 1,
1158
521
  cursor: disabled || isCount ? "not-allowed" : "pointer"
1159
522
  },
1160
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1161
- Tag,
523
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
524
+ import_xui_tag.Tag,
1162
525
  {
1163
526
  size,
1164
527
  tone: "primary",
@@ -1174,8 +537,8 @@ var useMultiSelectControl = ({
1174
537
  );
1175
538
  }
1176
539
  const isCountItem = hasHidden;
1177
- const needsComma = index3 < displayedItems.length - 2 || index3 < displayedItems.length - 1 && !isCountItem;
1178
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
540
+ const needsComma = index < displayedItems.length - 2 || index < displayedItems.length - 1 && !isCountItem;
541
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
1179
542
  Text,
1180
543
  {
1181
544
  color: theme.colors.content.primary,
@@ -1210,11 +573,11 @@ var useMultiSelectControl = ({
1210
573
  const countItemWidth = countEl.getBoundingClientRect().width;
1211
574
  const columnGap = parseInt(getComputedStyle(itemsRef.current).columnGap || "0", 10) || 0;
1212
575
  const tagsWidths = {};
1213
- let index3 = 0;
576
+ let index = 0;
1214
577
  for (const el of allItems) {
1215
- const key = index3 < allItems.length - 1 ? stateList[index3].value : COUNT_ITEM_VALUE;
578
+ const key = index < allItems.length - 1 ? stateList[index].value : COUNT_ITEM_VALUE;
1216
579
  tagsWidths[key] = el.getBoundingClientRect().width;
1217
- index3++;
580
+ index++;
1218
581
  }
1219
582
  savedWidthsRef.current = {
1220
583
  tagsWidths,
@@ -1225,7 +588,7 @@ var useMultiSelectControl = ({
1225
588
  displayStateRef.current = 3 /* Render */;
1226
589
  setItemsRender();
1227
590
  };
1228
- (0, import_react7.useEffect)(() => {
591
+ (0, import_react2.useEffect)(() => {
1229
592
  if (isPlaceholder) {
1230
593
  displayStateRef.current = 0 /* Placeholder */;
1231
594
  setPlaceholder();
@@ -1259,7 +622,7 @@ var useMultiSelectControl = ({
1259
622
  widthsDependencies,
1260
623
  stateList
1261
624
  ]);
1262
- (0, import_react7.useEffect)(() => {
625
+ (0, import_react2.useEffect)(() => {
1263
626
  if (displayStateRef.current !== 2 /* Calculation */) return;
1264
627
  const rafId = requestAnimationFrame(() => {
1265
628
  if (displayStateRef.current === 2 /* Calculation */) {
@@ -1277,8 +640,8 @@ var useMultiSelectControl = ({
1277
640
  };
1278
641
 
1279
642
  // src/MultiSelectControl.tsx
1280
- var import_jsx_runtime11 = require("react/jsx-runtime");
1281
- var MultiSelectControl = (0, import_react8.forwardRef)(
643
+ var import_jsx_runtime5 = require("react/jsx-runtime");
644
+ var MultiSelectControl = (0, import_react3.forwardRef)(
1282
645
  ({
1283
646
  variant = "tag",
1284
647
  flexible = true,
@@ -1302,12 +665,12 @@ var MultiSelectControl = (0, import_react8.forwardRef)(
1302
665
  themeMode,
1303
666
  themeProductContext
1304
667
  }, ref) => {
1305
- const { theme } = (0, import_xui_core3.useResolvedTheme)({ themeMode, themeProductContext });
668
+ const { theme } = (0, import_xui_core2.useResolvedTheme)({ themeMode, themeProductContext });
1306
669
  const sizeStyles = theme.sizing.input(size);
1307
670
  const inputColors = theme.colors.control.input;
1308
671
  const state = externalState || (disabled ? "disable" : "default");
1309
672
  const isDisable = state === "disable" || disabled;
1310
- const containerRef = (0, import_react8.useRef)(null);
673
+ const containerRef = (0, import_react3.useRef)(null);
1311
674
  const { itemsRef, selectedContent, isCalculating } = useMultiSelectControl({
1312
675
  variant,
1313
676
  flexible,
@@ -1337,7 +700,7 @@ var MultiSelectControl = (0, import_react8.forwardRef)(
1337
700
  borderColor = inputColors.borderHover;
1338
701
  }
1339
702
  const iconColor = isDisable ? inputColors.textDisable : inputColors.placeholder;
1340
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
703
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1341
704
  Box,
1342
705
  {
1343
706
  ref,
@@ -1365,7 +728,7 @@ var MultiSelectControl = (0, import_react8.forwardRef)(
1365
728
  borderColor: inputColors.borderHover
1366
729
  } : void 0,
1367
730
  children: [
1368
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
731
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1369
732
  Box,
1370
733
  {
1371
734
  ref: containerRef,
@@ -1375,8 +738,8 @@ var MultiSelectControl = (0, import_react8.forwardRef)(
1375
738
  gap: 8,
1376
739
  style: { minWidth: 0 },
1377
740
  children: [
1378
- iconLeft && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Icon, { size: sizeStyles.iconSize, color: iconColor, variant: "line", children: iconLeft }),
1379
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
741
+ iconLeft && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { size: sizeStyles.iconSize, color: iconColor, variant: "line", children: iconLeft }),
742
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1380
743
  Box,
1381
744
  {
1382
745
  ref: itemsRef,
@@ -1392,8 +755,8 @@ var MultiSelectControl = (0, import_react8.forwardRef)(
1392
755
  ]
1393
756
  }
1394
757
  ),
1395
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Box, { flexDirection: "row", alignItems: "center", gap: 4, children: [
1396
- extraClear && selectedItems.length > 0 && !isDisable && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
758
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box, { flexDirection: "row", alignItems: "center", gap: 4, children: [
759
+ extraClear && selectedItems.length > 0 && !isDisable && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1397
760
  Box,
1398
761
  {
1399
762
  onPress: (e) => {
@@ -1401,11 +764,11 @@ var MultiSelectControl = (0, import_react8.forwardRef)(
1401
764
  removeAllValues();
1402
765
  },
1403
766
  style: { cursor: "pointer" },
1404
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_xui_icons_base.Remove, { size: 18, color: iconColor, variant: "line" })
767
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_xui_icons_base.Remove, { size: 18, color: iconColor, variant: "line" })
1405
768
  }
1406
769
  ),
1407
- isError && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_xui_icons_base.ExclamationMarkCr, { size: 18, color: theme.colors.content.alert.primary }),
1408
- iconRight ? iconRight : isOpen ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_xui_icons_base.ChevronUp, { size: 18, color: iconColor, variant: "line" }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_xui_icons_base.ChevronDown, { size: 18, color: iconColor, variant: "line" })
770
+ isError && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_xui_icons_base.ExclamationMarkCr, { size: 18, color: theme.colors.content.alert.primary }),
771
+ iconRight ? iconRight : isOpen ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_xui_icons_base.ChevronUp, { size: 18, color: iconColor, variant: "line" }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_xui_icons_base.ChevronDown, { size: 18, color: iconColor, variant: "line" })
1409
772
  ] })
1410
773
  ]
1411
774
  }
@@ -1415,7 +778,7 @@ var MultiSelectControl = (0, import_react8.forwardRef)(
1415
778
  MultiSelectControl.displayName = "MultiSelectControl";
1416
779
 
1417
780
  // src/useMultiSelect.ts
1418
- var import_react9 = require("react");
781
+ var import_react4 = require("react");
1419
782
  var initialState = {
1420
783
  values: [],
1421
784
  selectedItems: [],
@@ -1426,12 +789,12 @@ var useMultiSelect = ({
1426
789
  value = [],
1427
790
  onChange
1428
791
  }) => {
1429
- const [state, setState] = (0, import_react9.useState)(initialState);
1430
- const optionsRef = (0, import_react9.useRef)(options);
1431
- (0, import_react9.useEffect)(() => {
792
+ const [state, setState] = (0, import_react4.useState)(initialState);
793
+ const optionsRef = (0, import_react4.useRef)(options);
794
+ (0, import_react4.useEffect)(() => {
1432
795
  optionsRef.current = options;
1433
796
  }, [options]);
1434
- (0, import_react9.useEffect)(() => {
797
+ (0, import_react4.useEffect)(() => {
1435
798
  const selectedItems = options.filter((opt) => value.includes(opt.value));
1436
799
  setState((prevState) => ({
1437
800
  ...prevState,
@@ -1439,7 +802,7 @@ var useMultiSelect = ({
1439
802
  selectedItems
1440
803
  }));
1441
804
  }, [options, value]);
1442
- const onChoose = (0, import_react9.useCallback)(
805
+ const onChoose = (0, import_react4.useCallback)(
1443
806
  (selectedIds) => {
1444
807
  const newValues = optionsRef.current.filter((opt) => selectedIds.includes(String(opt.value))).map((opt) => opt.value);
1445
808
  const newSelectedItems = optionsRef.current.filter(
@@ -1454,7 +817,7 @@ var useMultiSelect = ({
1454
817
  },
1455
818
  [onChange]
1456
819
  );
1457
- const onRemove = (0, import_react9.useCallback)(
820
+ const onRemove = (0, import_react4.useCallback)(
1458
821
  (value2, event) => {
1459
822
  event?.stopPropagation();
1460
823
  setState((prev) => {
@@ -1472,7 +835,7 @@ var useMultiSelect = ({
1472
835
  },
1473
836
  [onChange]
1474
837
  );
1475
- const onRemoveAll = (0, import_react9.useCallback)(() => {
838
+ const onRemoveAll = (0, import_react4.useCallback)(() => {
1476
839
  setState((prevState) => ({
1477
840
  ...prevState,
1478
841
  values: [],
@@ -1480,13 +843,13 @@ var useMultiSelect = ({
1480
843
  }));
1481
844
  onChange?.([]);
1482
845
  }, [onChange]);
1483
- const onSelectClick = (0, import_react9.useCallback)(() => {
846
+ const onSelectClick = (0, import_react4.useCallback)(() => {
1484
847
  setState((prevState) => ({
1485
848
  ...prevState,
1486
849
  isOpen: !prevState.isOpen
1487
850
  }));
1488
851
  }, []);
1489
- const onClose = (0, import_react9.useCallback)(() => {
852
+ const onClose = (0, import_react4.useCallback)(() => {
1490
853
  setState((prevState) => ({
1491
854
  ...prevState,
1492
855
  isOpen: false
@@ -1506,13 +869,13 @@ var useMultiSelect = ({
1506
869
  };
1507
870
 
1508
871
  // src/Portal.native.tsx
1509
- var import_jsx_runtime12 = require("react/jsx-runtime");
1510
- var Portal = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_jsx_runtime12.Fragment, { children });
872
+ var import_jsx_runtime6 = require("react/jsx-runtime");
873
+ var Portal = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children });
1511
874
 
1512
875
  // src/MultiSelect.tsx
1513
- var import_jsx_runtime13 = require("react/jsx-runtime");
876
+ var import_jsx_runtime7 = require("react/jsx-runtime");
1514
877
  var EXTERNAL_MENU_MIN_WIDTH_DEFAULT = 540;
1515
- var MultiSelect = (0, import_react10.forwardRef)(
878
+ var MultiSelect = (0, import_react5.forwardRef)(
1516
879
  ({
1517
880
  options,
1518
881
  errorMessage,
@@ -1542,15 +905,15 @@ var MultiSelect = (0, import_react10.forwardRef)(
1542
905
  themeMode,
1543
906
  themeProductContext
1544
907
  }, ref) => {
1545
- const { theme } = (0, import_xui_core4.useResolvedTheme)({ themeMode, themeProductContext });
1546
- const modalId = (0, import_xui_core4.useModalId)();
1547
- const overlayLayer = (0, import_xui_core4.useOverlayLayer)();
1548
- const controlRef = (0, import_react10.useRef)(null);
1549
- const menuRef = (0, import_react10.useRef)(null);
1550
- const containerRef = (0, import_react10.useRef)(null);
1551
- const searchInputRef = (0, import_react10.useRef)(null);
1552
- const [menuPosition, setMenuPosition] = (0, import_react10.useState)(null);
1553
- const [searchValue, setSearchValue] = (0, import_react10.useState)("");
908
+ const { theme } = (0, import_xui_core3.useResolvedTheme)({ themeMode, themeProductContext });
909
+ const modalId = (0, import_xui_core3.useModalId)();
910
+ const overlayLayer = (0, import_xui_core3.useOverlayLayer)();
911
+ const controlRef = (0, import_react5.useRef)(null);
912
+ const menuRef = (0, import_react5.useRef)(null);
913
+ const containerRef = (0, import_react5.useRef)(null);
914
+ const searchInputRef = (0, import_react5.useRef)(null);
915
+ const [menuPosition, setMenuPosition] = (0, import_react5.useState)(null);
916
+ const [searchValue, setSearchValue] = (0, import_react5.useState)("");
1554
917
  const sizeStyles = theme.sizing.input(size);
1555
918
  const inputColors = theme.colors.control.input;
1556
919
  const state = externalState || (disabled ? "disable" : "default");
@@ -1572,17 +935,17 @@ var MultiSelect = (0, import_react10.forwardRef)(
1572
935
  value,
1573
936
  onChange
1574
937
  });
1575
- (0, import_react10.useEffect)(() => {
938
+ (0, import_react5.useEffect)(() => {
1576
939
  if (isDisable || !dropdownMenu) {
1577
940
  onClose();
1578
941
  }
1579
942
  }, [isDisable, dropdownMenu, onClose]);
1580
- (0, import_react10.useEffect)(() => {
943
+ (0, import_react5.useEffect)(() => {
1581
944
  if (isOpen && searchable && isWeb) {
1582
945
  searchInputRef.current?.focus();
1583
946
  }
1584
947
  }, [isOpen, searchable]);
1585
- (0, import_react10.useEffect)(() => {
948
+ (0, import_react5.useEffect)(() => {
1586
949
  if (!isOpen) setSearchValue("");
1587
950
  }, [isOpen]);
1588
951
  const getOptionText = (opt) => typeof opt.label === "string" ? opt.label : String(opt.value);
@@ -1623,7 +986,7 @@ var MultiSelect = (0, import_react10.forwardRef)(
1623
986
  overflow: "hidden",
1624
987
  textOverflow: "ellipsis"
1625
988
  };
1626
- (0, import_react10.useEffect)(() => {
989
+ (0, import_react5.useEffect)(() => {
1627
990
  if (!isWeb || !controlMenuOpen || isDisable || !dropdownMenu) return;
1628
991
  let rafId = null;
1629
992
  const repositionMenu = () => {
@@ -1649,7 +1012,7 @@ var MultiSelect = (0, import_react10.forwardRef)(
1649
1012
  window.removeEventListener("scroll", scheduleUpdate, true);
1650
1013
  };
1651
1014
  }, [controlMenuOpen, dropdownMenu, isDisable]);
1652
- (0, import_react10.useEffect)(() => {
1015
+ (0, import_react5.useEffect)(() => {
1653
1016
  if (!isWeb || !dropdownMenu || !isOpen || isDisable) return;
1654
1017
  const handleOutsideMouseDown = (event) => {
1655
1018
  const path = typeof event.composedPath === "function" ? event.composedPath() : [];
@@ -1666,8 +1029,8 @@ var MultiSelect = (0, import_react10.forwardRef)(
1666
1029
  minWidth: menuMinWidth ?? EXTERNAL_MENU_MIN_WIDTH_DEFAULT,
1667
1030
  boxSizing: "border-box"
1668
1031
  } : void 0;
1669
- const dropdown = dropdownMenu && isOpen && !isDisable && (!isWeb || menuPosition) && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
1670
- !isWeb && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1032
+ const dropdown = dropdownMenu && isOpen && !isDisable && (!isWeb || menuPosition) && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
1033
+ !isWeb && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1671
1034
  Box,
1672
1035
  {
1673
1036
  "data-modal-id": modalId,
@@ -1677,13 +1040,13 @@ var MultiSelect = (0, import_react10.forwardRef)(
1677
1040
  left: 0,
1678
1041
  right: 0,
1679
1042
  bottom: 0,
1680
- zIndex: overlayLayer + import_xui_core4.LAYER_OFFSET.menu,
1043
+ zIndex: overlayLayer + import_xui_core3.LAYER_OFFSET.menu,
1681
1044
  cursor: "default"
1682
1045
  },
1683
1046
  onPress: onClose
1684
1047
  }
1685
1048
  ),
1686
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
1049
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
1687
1050
  Box,
1688
1051
  {
1689
1052
  ref: menuRef,
@@ -1702,18 +1065,18 @@ var MultiSelect = (0, import_react10.forwardRef)(
1702
1065
  right: isWeb ? void 0 : 0,
1703
1066
  width: isWeb ? menuPosition?.width : void 0,
1704
1067
  marginTop: isWeb ? void 0 : 4,
1705
- zIndex: overlayLayer + import_xui_core4.LAYER_OFFSET.popover,
1068
+ zIndex: overlayLayer + import_xui_core3.LAYER_OFFSET.popover,
1706
1069
  boxShadow: theme.shadow.popover
1707
1070
  },
1708
1071
  children: [
1709
- searchable && isWeb && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1072
+ searchable && isWeb && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1710
1073
  Box,
1711
1074
  {
1712
1075
  paddingHorizontal: sizeStyles.paddingHorizontal,
1713
1076
  paddingVertical: sizeStyles.paddingVertical,
1714
1077
  borderBottomWidth: 1,
1715
1078
  borderColor: theme.colors.border.secondary,
1716
- children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
1079
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
1717
1080
  Box,
1718
1081
  {
1719
1082
  flexDirection: "row",
@@ -1721,15 +1084,15 @@ var MultiSelect = (0, import_react10.forwardRef)(
1721
1084
  gap: sizeStyles.paddingHorizontal / 2,
1722
1085
  paddingHorizontal: 4,
1723
1086
  children: [
1724
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1087
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1725
1088
  Icon,
1726
1089
  {
1727
1090
  size: sizeStyles.iconSize - 2,
1728
1091
  color: inputColors.placeholder,
1729
- children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_xui_icons_base2.Search, {})
1092
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_xui_icons_base2.Search, {})
1730
1093
  }
1731
1094
  ),
1732
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1095
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1733
1096
  Box,
1734
1097
  {
1735
1098
  as: "input",
@@ -1756,7 +1119,7 @@ var MultiSelect = (0, import_react10.forwardRef)(
1756
1119
  )
1757
1120
  }
1758
1121
  ),
1759
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1122
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1760
1123
  Box,
1761
1124
  {
1762
1125
  paddingVertical: 4,
@@ -1766,13 +1129,13 @@ var MultiSelect = (0, import_react10.forwardRef)(
1766
1129
  overflowX: optionListOverflowX,
1767
1130
  scrollbarWidth: "none"
1768
1131
  },
1769
- children: menuItems.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1132
+ children: menuItems.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1770
1133
  Box,
1771
1134
  {
1772
1135
  paddingVertical: sizeStyles.paddingVertical * 2,
1773
1136
  paddingHorizontal: sizeStyles.paddingHorizontal,
1774
1137
  alignItems: "center",
1775
- children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1138
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1776
1139
  Text,
1777
1140
  {
1778
1141
  color: theme.colors.content.tertiary,
@@ -1784,7 +1147,7 @@ var MultiSelect = (0, import_react10.forwardRef)(
1784
1147
  ) : menuItems.map((item, _index) => {
1785
1148
  const brandColors = theme.colors.control.brand.primary;
1786
1149
  const contentColors = theme.colors.content;
1787
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1150
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1788
1151
  Box,
1789
1152
  {
1790
1153
  testID,
@@ -1807,7 +1170,7 @@ var MultiSelect = (0, import_react10.forwardRef)(
1807
1170
  opacity: item.disabled ? 0.5 : 1,
1808
1171
  minWidth: optionRowMinWidth
1809
1172
  },
1810
- children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1173
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1811
1174
  Text,
1812
1175
  {
1813
1176
  color: item.checked ? contentColors.on.brand : theme.colors.content.secondary,
@@ -1828,7 +1191,7 @@ var MultiSelect = (0, import_react10.forwardRef)(
1828
1191
  }
1829
1192
  )
1830
1193
  ] });
1831
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
1194
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
1832
1195
  Box,
1833
1196
  {
1834
1197
  ref: containerRef,
@@ -1837,7 +1200,7 @@ var MultiSelect = (0, import_react10.forwardRef)(
1837
1200
  gap: sizeStyles.fieldGap,
1838
1201
  style: externalFieldLayout,
1839
1202
  children: [
1840
- label && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1203
+ label && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1841
1204
  Text,
1842
1205
  {
1843
1206
  color: theme.colors.content.secondary,
@@ -1846,7 +1209,7 @@ var MultiSelect = (0, import_react10.forwardRef)(
1846
1209
  children: label
1847
1210
  }
1848
1211
  ),
1849
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
1212
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
1850
1213
  Box,
1851
1214
  {
1852
1215
  ref,
@@ -1855,7 +1218,7 @@ var MultiSelect = (0, import_react10.forwardRef)(
1855
1218
  ...externalFieldLayout ? { width: "100%" } : {}
1856
1219
  },
1857
1220
  children: [
1858
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1221
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1859
1222
  MultiSelectControl,
1860
1223
  {
1861
1224
  ref: controlRef,
@@ -1880,11 +1243,11 @@ var MultiSelect = (0, import_react10.forwardRef)(
1880
1243
  extraClear
1881
1244
  }
1882
1245
  ),
1883
- isWeb ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Portal, { children: dropdown }) : dropdown
1246
+ isWeb ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Portal, { children: dropdown }) : dropdown
1884
1247
  ]
1885
1248
  }
1886
1249
  ),
1887
- errorMessage && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1250
+ errorMessage && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1888
1251
  Text,
1889
1252
  {
1890
1253
  color: theme.colors.content.alert.primary,
@@ -1903,19 +1266,4 @@ MultiSelect.displayName = "MultiSelect";
1903
1266
  0 && (module.exports = {
1904
1267
  MultiSelect
1905
1268
  });
1906
- /*! Bundled license information:
1907
-
1908
- lucide-react/dist/esm/shared/src/utils.js:
1909
- lucide-react/dist/esm/defaultAttributes.js:
1910
- lucide-react/dist/esm/Icon.js:
1911
- lucide-react/dist/esm/createLucideIcon.js:
1912
- lucide-react/dist/esm/icons/x.js:
1913
- lucide-react/dist/esm/lucide-react.js:
1914
- (**
1915
- * @license lucide-react v0.470.0 - ISC
1916
- *
1917
- * This source code is licensed under the ISC license.
1918
- * See the LICENSE file in the root directory of this source tree.
1919
- *)
1920
- */
1921
1269
  //# sourceMappingURL=index.js.map