@xsolla/xui-multi-select 0.215.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/web/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_react12 = require("react");
38
+ var import_react7 = require("react");
39
39
 
40
40
  // ../../foundation/primitives-web/src/Box.tsx
41
41
  var import_react2 = __toESM(require("react"));
@@ -402,656 +402,19 @@ var Icon = ({
402
402
  var isWeb = true;
403
403
 
404
404
  // src/MultiSelect.tsx
405
- var import_xui_core4 = require("@xsolla/xui-core");
405
+ var import_xui_core3 = require("@xsolla/xui-core");
406
406
  var import_xui_icons_base2 = require("@xsolla/xui-icons-base");
407
407
 
408
408
  // src/MultiSelectControl.tsx
409
- var import_react9 = require("react");
410
- var import_xui_core3 = require("@xsolla/xui-core");
409
+ var import_react4 = require("react");
410
+ var import_xui_core2 = require("@xsolla/xui-core");
411
411
  var import_xui_icons_base = require("@xsolla/xui-icons-base");
412
412
 
413
413
  // src/useMultiSelectControl.tsx
414
- var import_react8 = require("react");
415
-
416
- // ../tag/dist/web/index.mjs
417
- var import_react6 = __toESM(require("react"), 1);
418
- var import_styled_components5 = __toESM(require("styled-components"), 1);
419
- var import_react7 = __toESM(require("react"), 1);
420
- var import_jsx_runtime6 = require("react/jsx-runtime");
421
- var import_styled_components6 = __toESM(require("styled-components"), 1);
422
- var import_jsx_runtime7 = require("react/jsx-runtime");
423
- var import_styled_components7 = __toESM(require("styled-components"), 1);
424
- var import_jsx_runtime8 = require("react/jsx-runtime");
414
+ var import_react3 = require("react");
415
+ var import_xui_tag = require("@xsolla/xui-tag");
425
416
  var import_xui_core = require("@xsolla/xui-core");
426
-
427
- // ../../foundation/icons/dist/web/index.mjs
428
- var import_react5 = __toESM(require("react"), 1);
429
- var import_styled_components4 = __toESM(require("styled-components"), 1);
430
417
  var import_jsx_runtime4 = require("react/jsx-runtime");
431
-
432
- // ../../../node_modules/lucide-react/dist/esm/createLucideIcon.js
433
- var import_react4 = require("react");
434
-
435
- // ../../../node_modules/lucide-react/dist/esm/shared/src/utils.js
436
- var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
437
- var mergeClasses = (...classes) => classes.filter((className, index4, array) => {
438
- return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index4;
439
- }).join(" ").trim();
440
-
441
- // ../../../node_modules/lucide-react/dist/esm/Icon.js
442
- var import_react3 = require("react");
443
-
444
- // ../../../node_modules/lucide-react/dist/esm/defaultAttributes.js
445
- var defaultAttributes = {
446
- xmlns: "http://www.w3.org/2000/svg",
447
- width: 24,
448
- height: 24,
449
- viewBox: "0 0 24 24",
450
- fill: "none",
451
- stroke: "currentColor",
452
- strokeWidth: 2,
453
- strokeLinecap: "round",
454
- strokeLinejoin: "round"
455
- };
456
-
457
- // ../../../node_modules/lucide-react/dist/esm/Icon.js
458
- var Icon2 = (0, import_react3.forwardRef)(
459
- ({
460
- color = "currentColor",
461
- size = 24,
462
- strokeWidth = 2,
463
- absoluteStrokeWidth,
464
- className = "",
465
- children,
466
- iconNode,
467
- ...rest
468
- }, ref) => {
469
- return (0, import_react3.createElement)(
470
- "svg",
471
- {
472
- ref,
473
- ...defaultAttributes,
474
- width: size,
475
- height: size,
476
- stroke: color,
477
- strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
478
- className: mergeClasses("lucide", className),
479
- ...rest
480
- },
481
- [
482
- ...iconNode.map(([tag, attrs]) => (0, import_react3.createElement)(tag, attrs)),
483
- ...Array.isArray(children) ? children : [children]
484
- ]
485
- );
486
- }
487
- );
488
-
489
- // ../../../node_modules/lucide-react/dist/esm/createLucideIcon.js
490
- var createLucideIcon = (iconName, iconNode) => {
491
- const Component = (0, import_react4.forwardRef)(
492
- ({ className, ...props }, ref) => (0, import_react4.createElement)(Icon2, {
493
- ref,
494
- iconNode,
495
- className: mergeClasses(`lucide-${toKebabCase(iconName)}`, className),
496
- ...props
497
- })
498
- );
499
- Component.displayName = `${iconName}`;
500
- return Component;
501
- };
502
-
503
- // ../../../node_modules/lucide-react/dist/esm/icons/x.js
504
- var X = createLucideIcon("X", [
505
- ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
506
- ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
507
- ]);
508
-
509
- // ../../foundation/icons/dist/web/index.mjs
510
- var import_jsx_runtime5 = require("react/jsx-runtime");
511
- function memoize2(fn) {
512
- var cache = {};
513
- return function(arg) {
514
- if (cache[arg] === void 0) cache[arg] = fn(arg);
515
- return cache[arg];
516
- };
517
- }
518
- var memoize_esm_default2 = memoize2;
519
- 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)-.*))$/;
520
- var index2 = memoize_esm_default2(
521
- function(prop) {
522
- return reactPropsRegex2.test(prop) || prop.charCodeAt(0) === 111 && prop.charCodeAt(1) === 110 && prop.charCodeAt(2) < 91;
523
- }
524
- /* Z+1 */
525
- );
526
- var is_prop_valid_esm_default2 = index2;
527
- var ADDITIONAL_BLOCKED_PROPS2 = /* @__PURE__ */ new Set([
528
- // RN-only event handlers (pass isPropValid's on* pattern)
529
- "onPress",
530
- "onChangeText",
531
- "onLayout",
532
- "onMoveShouldSetResponder",
533
- "onResponderGrant",
534
- "onResponderMove",
535
- "onResponderRelease",
536
- "onResponderTerminate",
537
- // SVG attributes that pass isPropValid
538
- "strokeWidth",
539
- // CSS properties that pass isPropValid but are used as component props
540
- "overflow",
541
- "opacity",
542
- "cursor",
543
- "fontSize",
544
- "fontWeight",
545
- "fontFamily",
546
- "textDecoration",
547
- // Cross-platform layout prop that Text consumes as CSS, never as an
548
- // attribute. Pinned explicitly because it is now spread into the styled
549
- // component rather than destructured away before it can reach the DOM.
550
- "numberOfLines"
551
- ]);
552
- function shouldForwardProp2(key) {
553
- if (ADDITIONAL_BLOCKED_PROPS2.has(key)) return false;
554
- return is_prop_valid_esm_default2(key);
555
- }
556
- function createFilteredElement2(defaultTag) {
557
- const Component = import_react5.default.forwardRef(
558
- ({ children, elementType, ...props }, ref) => {
559
- const Tag2 = elementType || defaultTag;
560
- const htmlProps = {};
561
- for (const key of Object.keys(props)) {
562
- if (shouldForwardProp2(key)) {
563
- htmlProps[key] = props[key];
564
- }
565
- }
566
- return import_react5.default.createElement(
567
- Tag2,
568
- { ref, ...htmlProps },
569
- children
570
- );
571
- }
572
- );
573
- Component.displayName = `Filtered(${defaultTag})`;
574
- return Component;
575
- }
576
- var FilteredDiv3 = createFilteredElement2("div");
577
- var StyledIcon2 = (0, import_styled_components4.default)(FilteredDiv3)`
578
- display: flex;
579
- align-items: center;
580
- justify-content: center;
581
- width: ${(props) => typeof props.size === "number" ? `${props.size}px` : props.size || "24px"};
582
- height: ${(props) => typeof props.size === "number" ? `${props.size}px` : props.size || "24px"};
583
- color: ${(props) => props.color || "currentColor"};
584
-
585
- /* Icons paint themselves — each icon's own SVG sets its fill/stroke
586
- (icons-base via inline "fill: currentColor", Lucide via "fill"/"stroke"
587
- attributes). Do not add fill/stroke here: it re-strokes fill-based icons
588
- and thickens the glyph. See FEP-877. */
589
- svg {
590
- width: 100%;
591
- height: 100%;
592
- }
593
- `;
594
- var Icon3 = ({
595
- children,
596
- testID,
597
- "data-testid": dataTestId,
598
- ...props
599
- }) => {
600
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(StyledIcon2, { "data-testid": dataTestId || testID, ...props, children });
601
- };
602
- var X2 = (props) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon3, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(X, { size: "100%" }) });
603
-
604
- // ../tag/dist/web/index.mjs
605
- var import_jsx_runtime9 = require("react/jsx-runtime");
606
- function memoize3(fn) {
607
- var cache = {};
608
- return function(arg) {
609
- if (cache[arg] === void 0) cache[arg] = fn(arg);
610
- return cache[arg];
611
- };
612
- }
613
- var memoize_esm_default3 = memoize3;
614
- var reactPropsRegex3 = /^((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)-.*))$/;
615
- var index3 = memoize_esm_default3(
616
- function(prop) {
617
- return reactPropsRegex3.test(prop) || prop.charCodeAt(0) === 111 && prop.charCodeAt(1) === 110 && prop.charCodeAt(2) < 91;
618
- }
619
- /* Z+1 */
620
- );
621
- var is_prop_valid_esm_default3 = index3;
622
- var ADDITIONAL_BLOCKED_PROPS3 = /* @__PURE__ */ new Set([
623
- // RN-only event handlers (pass isPropValid's on* pattern)
624
- "onPress",
625
- "onChangeText",
626
- "onLayout",
627
- "onMoveShouldSetResponder",
628
- "onResponderGrant",
629
- "onResponderMove",
630
- "onResponderRelease",
631
- "onResponderTerminate",
632
- // SVG attributes that pass isPropValid
633
- "strokeWidth",
634
- // CSS properties that pass isPropValid but are used as component props
635
- "overflow",
636
- "opacity",
637
- "cursor",
638
- "fontSize",
639
- "fontWeight",
640
- "fontFamily",
641
- "textDecoration",
642
- // Cross-platform layout prop that Text consumes as CSS, never as an
643
- // attribute. Pinned explicitly because it is now spread into the styled
644
- // component rather than destructured away before it can reach the DOM.
645
- "numberOfLines"
646
- ]);
647
- function shouldForwardProp3(key) {
648
- if (ADDITIONAL_BLOCKED_PROPS3.has(key)) return false;
649
- return is_prop_valid_esm_default3(key);
650
- }
651
- function createFilteredElement3(defaultTag) {
652
- const Component = import_react7.default.forwardRef(
653
- ({ children, elementType, ...props }, ref) => {
654
- const Tag2 = elementType || defaultTag;
655
- const htmlProps = {};
656
- for (const key of Object.keys(props)) {
657
- if (shouldForwardProp3(key)) {
658
- htmlProps[key] = props[key];
659
- }
660
- }
661
- return import_react7.default.createElement(
662
- Tag2,
663
- { ref, ...htmlProps },
664
- children
665
- );
666
- }
667
- );
668
- Component.displayName = `Filtered(${defaultTag})`;
669
- return Component;
670
- }
671
- var FilteredDiv4 = createFilteredElement3("div");
672
- var StyledBox2 = (0, import_styled_components5.default)(FilteredDiv4)`
673
- display: flex;
674
- box-sizing: border-box;
675
- background-color: ${(props) => props.backgroundColor || "transparent"};
676
- border-color: ${(props) => props.borderColor || "transparent"};
677
- border-width: ${(props) => typeof props.borderWidth === "number" ? `${props.borderWidth}px` : props.borderWidth || 0};
678
-
679
- ${(props) => props.borderBottomWidth !== void 0 && `
680
- border-bottom-width: ${typeof props.borderBottomWidth === "number" ? `${props.borderBottomWidth}px` : props.borderBottomWidth};
681
- border-bottom-color: ${props.borderBottomColor || props.borderColor || "transparent"};
682
- border-bottom-style: solid;
683
- `}
684
- ${(props) => props.borderTopWidth !== void 0 && `
685
- border-top-width: ${typeof props.borderTopWidth === "number" ? `${props.borderTopWidth}px` : props.borderTopWidth};
686
- border-top-color: ${props.borderTopColor || props.borderColor || "transparent"};
687
- border-top-style: solid;
688
- `}
689
- ${(props) => props.borderLeftWidth !== void 0 && `
690
- border-left-width: ${typeof props.borderLeftWidth === "number" ? `${props.borderLeftWidth}px` : props.borderLeftWidth};
691
- border-left-color: ${props.borderLeftColor || props.borderColor || "transparent"};
692
- border-left-style: solid;
693
- `}
694
- ${(props) => props.borderRightWidth !== void 0 && `
695
- border-right-width: ${typeof props.borderRightWidth === "number" ? `${props.borderRightWidth}px` : props.borderRightWidth};
696
- border-right-color: ${props.borderRightColor || props.borderColor || "transparent"};
697
- border-right-style: solid;
698
- `}
699
-
700
- border-style: ${(props) => props.borderStyle || (props.borderWidth || props.borderBottomWidth || props.borderTopWidth || props.borderLeftWidth || props.borderRightWidth ? "solid" : "none")};
701
- border-radius: ${(props) => typeof props.borderRadius === "number" ? `${props.borderRadius}px` : props.borderRadius || 0};
702
- height: ${(props) => typeof props.height === "number" ? `${props.height}px` : props.height || "auto"};
703
- width: ${(props) => typeof props.width === "number" ? `${props.width}px` : props.width || "auto"};
704
- min-width: ${(props) => typeof props.minWidth === "number" ? `${props.minWidth}px` : props.minWidth || "auto"};
705
- min-height: ${(props) => typeof props.minHeight === "number" ? `${props.minHeight}px` : props.minHeight || "auto"};
706
- max-width: ${(props) => typeof props.maxWidth === "number" ? `${props.maxWidth}px` : props.maxWidth || "none"};
707
- max-height: ${(props) => typeof props.maxHeight === "number" ? `${props.maxHeight}px` : props.maxHeight || "none"};
708
-
709
- padding: ${(props) => typeof props.padding === "number" ? `${props.padding}px` : props.padding || 0};
710
- ${(props) => props.paddingHorizontal && `
711
- padding-left: ${typeof props.paddingHorizontal === "number" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};
712
- padding-right: ${typeof props.paddingHorizontal === "number" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};
713
- `}
714
- ${(props) => props.paddingVertical && `
715
- padding-top: ${typeof props.paddingVertical === "number" ? `${props.paddingVertical}px` : props.paddingVertical};
716
- padding-bottom: ${typeof props.paddingVertical === "number" ? `${props.paddingVertical}px` : props.paddingVertical};
717
- `}
718
- ${(props) => props.paddingTop !== void 0 && `padding-top: ${typeof props.paddingTop === "number" ? `${props.paddingTop}px` : props.paddingTop};`}
719
- ${(props) => props.paddingBottom !== void 0 && `padding-bottom: ${typeof props.paddingBottom === "number" ? `${props.paddingBottom}px` : props.paddingBottom};`}
720
- ${(props) => props.paddingLeft !== void 0 && `padding-left: ${typeof props.paddingLeft === "number" ? `${props.paddingLeft}px` : props.paddingLeft};`}
721
- ${(props) => props.paddingRight !== void 0 && `padding-right: ${typeof props.paddingRight === "number" ? `${props.paddingRight}px` : props.paddingRight};`}
722
-
723
- margin: ${(props) => typeof props.margin === "number" ? `${props.margin}px` : props.margin || 0};
724
- ${(props) => props.marginTop !== void 0 && `margin-top: ${typeof props.marginTop === "number" ? `${props.marginTop}px` : props.marginTop};`}
725
- ${(props) => props.marginBottom !== void 0 && `margin-bottom: ${typeof props.marginBottom === "number" ? `${props.marginBottom}px` : props.marginBottom};`}
726
- ${(props) => props.marginLeft !== void 0 && `margin-left: ${typeof props.marginLeft === "number" ? `${props.marginLeft}px` : props.marginLeft};`}
727
- ${(props) => props.marginRight !== void 0 && `margin-right: ${typeof props.marginRight === "number" ? `${props.marginRight}px` : props.marginRight};`}
728
-
729
- flex-direction: ${(props) => props.flexDirection || "column"};
730
- flex-wrap: ${(props) => props.flexWrap || "nowrap"};
731
- align-items: ${(props) => props.alignItems || "stretch"};
732
- justify-content: ${(props) => props.justifyContent || "flex-start"};
733
- cursor: ${(props) => props.cursor ? props.cursor : props.onClick || props.onPress ? "pointer" : "inherit"};
734
- position: ${(props) => props.position || "static"};
735
- top: ${(props) => typeof props.top === "number" ? `${props.top}px` : props.top};
736
- bottom: ${(props) => typeof props.bottom === "number" ? `${props.bottom}px` : props.bottom};
737
- left: ${(props) => typeof props.left === "number" ? `${props.left}px` : props.left};
738
- right: ${(props) => typeof props.right === "number" ? `${props.right}px` : props.right};
739
- flex: ${(props) => props.flex};
740
- flex-shrink: ${(props) => props.flexShrink ?? 1};
741
- gap: ${(props) => typeof props.gap === "number" ? `${props.gap}px` : props.gap || 0};
742
- align-self: ${(props) => props.alignSelf || "auto"};
743
- /* Only emit overflow-x/y when explicitly set. Defaulting them to
744
- visible after overflow would override the shorthand and break
745
- clipping (e.g. OtherCard bottom-right promo image). */
746
- overflow: ${(props) => props.overflow || "visible"};
747
- ${(props) => props.overflowX != null ? `overflow-x: ${props.overflowX};` : ""}
748
- ${(props) => props.overflowY != null ? `overflow-y: ${props.overflowY};` : ""}
749
- z-index: ${(props) => props.zIndex};
750
- opacity: ${(props) => props.opacity != null ? props.opacity : props.disabled ? 0.5 : 1};
751
- pointer-events: ${(props) => props.disabled ? "none" : "auto"};
752
-
753
- /* \`background\` is emitted before \`background-color\` so a caller passing
754
- both still gets backgroundColor as the winner. Use the shorthand for a
755
- layered fill (e.g. an overlay tint over a resting surface colour), which
756
- a single background-color cannot express. */
757
- &:hover {
758
- ${(props) => props.hoverStyle?.background && `background: ${props.hoverStyle.background};`}
759
- ${(props) => props.hoverStyle?.backgroundColor && `background-color: ${props.hoverStyle.backgroundColor};`}
760
- ${(props) => props.hoverStyle?.borderColor && `border-color: ${props.hoverStyle.borderColor};`}
761
- }
762
-
763
- &:active {
764
- ${(props) => props.pressStyle?.background && `background: ${props.pressStyle.background};`}
765
- ${(props) => props.pressStyle?.backgroundColor && `background-color: ${props.pressStyle.backgroundColor};`}
766
- }
767
- `;
768
- var Box2 = import_react6.default.forwardRef(
769
- ({
770
- children,
771
- onPress,
772
- onKeyDown,
773
- onKeyUp,
774
- role,
775
- "aria-label": ariaLabel,
776
- "aria-labelledby": ariaLabelledBy,
777
- "aria-current": ariaCurrent,
778
- "aria-disabled": ariaDisabled,
779
- "aria-live": ariaLive,
780
- "aria-busy": ariaBusy,
781
- "aria-describedby": ariaDescribedBy,
782
- "aria-expanded": ariaExpanded,
783
- "aria-haspopup": ariaHasPopup,
784
- "aria-pressed": ariaPressed,
785
- "aria-controls": ariaControls,
786
- tabIndex,
787
- as,
788
- src,
789
- alt,
790
- onError,
791
- onLoad,
792
- type,
793
- disabled,
794
- id,
795
- testID,
796
- "data-testid": dataTestId,
797
- ...props
798
- }, ref) => {
799
- if (as === "img" && src) {
800
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
801
- "img",
802
- {
803
- src,
804
- alt: alt || "",
805
- onError,
806
- onLoad,
807
- "data-testid": dataTestId || testID,
808
- style: {
809
- display: "block",
810
- objectFit: "cover",
811
- width: typeof props.width === "number" ? `${props.width}px` : props.width,
812
- height: typeof props.height === "number" ? `${props.height}px` : props.height,
813
- borderRadius: typeof props.borderRadius === "number" ? `${props.borderRadius}px` : props.borderRadius,
814
- position: props.position,
815
- top: typeof props.top === "number" ? `${props.top}px` : props.top,
816
- left: typeof props.left === "number" ? `${props.left}px` : props.left,
817
- right: typeof props.right === "number" ? `${props.right}px` : props.right,
818
- bottom: typeof props.bottom === "number" ? `${props.bottom}px` : props.bottom,
819
- ...props.style
820
- }
821
- }
822
- );
823
- }
824
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
825
- StyledBox2,
826
- {
827
- ref,
828
- elementType: as,
829
- id,
830
- type: as === "button" ? type || "button" : void 0,
831
- disabled: as === "button" ? disabled : void 0,
832
- onClick: onPress,
833
- onKeyDown,
834
- onKeyUp,
835
- role,
836
- "aria-label": ariaLabel,
837
- "aria-labelledby": ariaLabelledBy,
838
- "aria-current": ariaCurrent,
839
- "aria-disabled": ariaDisabled,
840
- "aria-busy": ariaBusy,
841
- "aria-describedby": ariaDescribedBy,
842
- "aria-expanded": ariaExpanded,
843
- "aria-haspopup": ariaHasPopup,
844
- "aria-pressed": ariaPressed,
845
- "aria-controls": ariaControls,
846
- "aria-live": ariaLive,
847
- tabIndex: tabIndex !== void 0 ? tabIndex : void 0,
848
- "data-testid": dataTestId || testID,
849
- ...props,
850
- children
851
- }
852
- );
853
- }
854
- );
855
- Box2.displayName = "Box";
856
- var truncationStyles2 = (numberOfLines) => {
857
- if (!numberOfLines || numberOfLines < 1) return "";
858
- if (numberOfLines === 1) {
859
- return `
860
- display: block;
861
- max-width: 100%;
862
- min-width: 0;
863
- overflow: hidden;
864
- text-overflow: ellipsis;
865
- white-space: nowrap;
866
- `;
867
- }
868
- return `
869
- display: -webkit-box;
870
- -webkit-box-orient: vertical;
871
- -webkit-line-clamp: ${numberOfLines};
872
- line-clamp: ${numberOfLines};
873
- max-width: 100%;
874
- min-width: 0;
875
- overflow: hidden;
876
- `;
877
- };
878
- var FilteredSpan2 = createFilteredElement3("span");
879
- var StyledText2 = (0, import_styled_components6.default)(FilteredSpan2)`
880
- color: ${(props) => props.color || "inherit"};
881
- font-size: ${(props) => typeof props.fontSize === "number" ? `${props.fontSize}px` : props.fontSize || "inherit"};
882
- font-weight: ${(props) => props.fontWeight || "normal"};
883
- font-family: ${(props) => props.fontFamily || '"Aktiv Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif'};
884
- line-height: ${(props) => typeof props.lineHeight === "number" ? `${props.lineHeight}px` : props.lineHeight || "inherit"};
885
- white-space: ${(props) => props.whiteSpace || "normal"};
886
- text-align: ${(props) => props.textAlign || "inherit"};
887
- text-decoration: ${(props) => props.textDecoration || "none"};
888
-
889
- /* Keep last: single-line truncation has to win over white-space above. */
890
- ${(props) => truncationStyles2(props.numberOfLines)}
891
- `;
892
- var Text2 = ({
893
- style,
894
- className,
895
- id,
896
- role,
897
- testID,
898
- "data-testid": dataTestId,
899
- ...props
900
- }) => {
901
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
902
- StyledText2,
903
- {
904
- ...props,
905
- style,
906
- className,
907
- id,
908
- role,
909
- "data-testid": dataTestId || testID
910
- }
911
- );
912
- };
913
- var FilteredDiv22 = createFilteredElement3("div");
914
- var StyledIcon3 = (0, import_styled_components7.default)(FilteredDiv22)`
915
- display: flex;
916
- align-items: center;
917
- justify-content: center;
918
- width: ${(props) => typeof props.size === "number" ? `${props.size}px` : props.size || "24px"};
919
- height: ${(props) => typeof props.size === "number" ? `${props.size}px` : props.size || "24px"};
920
- color: ${(props) => props.color || "currentColor"};
921
-
922
- /* Icons paint themselves — each icon's own SVG sets its fill/stroke
923
- (icons-base via inline "fill: currentColor", Lucide via "fill"/"stroke"
924
- attributes). Do not add fill/stroke here: it re-strokes fill-based icons
925
- and thickens the glyph. See FEP-877. */
926
- svg {
927
- width: 100%;
928
- height: 100%;
929
- }
930
- `;
931
- var Icon4 = ({
932
- children,
933
- testID,
934
- "data-testid": dataTestId,
935
- ...props
936
- }) => {
937
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(StyledIcon3, { "data-testid": dataTestId || testID, ...props, children });
938
- };
939
- var Tag = ({
940
- size = "md",
941
- tone = "primary",
942
- type = "solid",
943
- children,
944
- iconLeft,
945
- iconRight,
946
- onRemove,
947
- testID,
948
- themeMode,
949
- themeProductContext
950
- }) => {
951
- const { theme } = (0, import_xui_core.useResolvedTheme)({ themeMode, themeProductContext });
952
- const sizeStyles = theme.sizing.tag(size);
953
- const resolveColors = () => {
954
- const isOutlined = type === "outlined";
955
- switch (tone) {
956
- case "primary":
957
- return {
958
- bg: isOutlined ? "transparent" : theme.colors.background.primary,
959
- text: theme.colors.content.primary,
960
- border: theme.colors.border.secondary
961
- };
962
- case "brand":
963
- return {
964
- bg: isOutlined ? "transparent" : theme.colors.background.brand.primary,
965
- text: isOutlined ? theme.colors.content.brand.primary : theme.colors.content.on.brand,
966
- border: theme.colors.border.brand
967
- };
968
- case "brandExtra":
969
- return {
970
- bg: isOutlined ? "transparent" : theme.colors.background.brandExtra.primary,
971
- text: isOutlined ? theme.colors.content.brandExtra.primary : theme.colors.content.on.brandExtra,
972
- border: theme.colors.border.brandExtra
973
- };
974
- case "success":
975
- return {
976
- bg: isOutlined ? "transparent" : theme.colors.background.success.primary,
977
- text: isOutlined ? theme.colors.content.success.primary : theme.colors.content.on.success,
978
- border: theme.colors.border.success
979
- };
980
- case "warning":
981
- return {
982
- bg: isOutlined ? "transparent" : theme.colors.background.warning.primary,
983
- text: isOutlined ? theme.colors.content.warning.primary : theme.colors.content.on.warning,
984
- border: theme.colors.border.warning
985
- };
986
- case "alert":
987
- return {
988
- bg: isOutlined ? "transparent" : theme.colors.background.alert.primary,
989
- text: isOutlined ? theme.colors.content.alert.primary : theme.colors.content.on.alert,
990
- border: theme.colors.border.alert
991
- };
992
- case "neutral":
993
- return {
994
- bg: isOutlined ? "transparent" : theme.colors.background.neutral.primary,
995
- text: isOutlined ? theme.colors.content.neutral.primary : theme.colors.content.on.neutral,
996
- border: theme.colors.border.neutral
997
- };
998
- default:
999
- return {
1000
- bg: isOutlined ? "transparent" : theme.colors.background.primary,
1001
- text: theme.colors.content.primary,
1002
- border: theme.colors.border.secondary
1003
- };
1004
- }
1005
- };
1006
- const { bg, text, border } = resolveColors();
1007
- const isIconOnly = !children && (!!iconLeft || !!iconRight);
1008
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1009
- Box2,
1010
- {
1011
- testID,
1012
- backgroundColor: bg,
1013
- borderRadius: sizeStyles.radius,
1014
- height: sizeStyles.height,
1015
- width: isIconOnly ? sizeStyles.height : void 0,
1016
- paddingHorizontal: isIconOnly ? 0 : sizeStyles.padding,
1017
- flexDirection: "row",
1018
- alignItems: "center",
1019
- justifyContent: "center",
1020
- gap: sizeStyles.gap,
1021
- borderWidth: sizeStyles.borderWidth,
1022
- borderColor: border,
1023
- borderStyle: "solid",
1024
- style: {
1025
- overflow: "hidden",
1026
- textOverflow: "ellipsis",
1027
- whiteSpace: "nowrap"
1028
- },
1029
- children: [
1030
- iconLeft && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon4, { size: sizeStyles.iconSize, color: text, children: iconLeft }),
1031
- children && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1032
- Text2,
1033
- {
1034
- color: text,
1035
- fontSize: sizeStyles.fontSize,
1036
- fontWeight: "500",
1037
- whiteSpace: "nowrap",
1038
- style: {
1039
- overflow: "hidden",
1040
- textOverflow: "ellipsis"
1041
- },
1042
- children
1043
- }
1044
- ),
1045
- iconRight && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon4, { size: sizeStyles.iconSize, color: text, children: iconRight }),
1046
- onRemove && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Box2, { onPress: onRemove, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(X2, { size: sizeStyles.iconSize, color: text }) })
1047
- ]
1048
- }
1049
- );
1050
- };
1051
-
1052
- // src/useMultiSelectControl.tsx
1053
- var import_xui_core2 = require("@xsolla/xui-core");
1054
- var import_jsx_runtime10 = require("react/jsx-runtime");
1055
418
  var COUNT_ITEM_VALUE = "count-item";
1056
419
  var useMultiSelectControl = ({
1057
420
  variant,
@@ -1067,16 +430,16 @@ var useMultiSelectControl = ({
1067
430
  themeMode,
1068
431
  themeProductContext
1069
432
  }) => {
1070
- const { theme } = (0, import_xui_core2.useResolvedTheme)({ themeMode, themeProductContext });
1071
- const displayStateRef = (0, import_react8.useRef)(0 /* Placeholder */);
1072
- const savedWidthsRef = (0, import_react8.useRef)(null);
1073
- const itemsRef = (0, import_react8.useRef)(null);
1074
- const [itemsWidth, setItemsWidth] = (0, import_react8.useState)(0);
1075
- const [selectedContent, setSelectedContent] = (0, import_react8.useState)(
433
+ const { theme } = (0, import_xui_core.useResolvedTheme)({ themeMode, themeProductContext });
434
+ const displayStateRef = (0, import_react3.useRef)(0 /* Placeholder */);
435
+ const savedWidthsRef = (0, import_react3.useRef)(null);
436
+ const itemsRef = (0, import_react3.useRef)(null);
437
+ const [itemsWidth, setItemsWidth] = (0, import_react3.useState)(0);
438
+ const [selectedContent, setSelectedContent] = (0, import_react3.useState)(
1076
439
  null
1077
440
  );
1078
441
  const isPlaceholder = !selectedItems || selectedItems.length === 0;
1079
- (0, import_react8.useEffect)(() => {
442
+ (0, import_react3.useEffect)(() => {
1080
443
  if (!containerRef.current) return;
1081
444
  let rafId = null;
1082
445
  const syncItemsWidth = () => {
@@ -1096,7 +459,7 @@ var useMultiSelectControl = ({
1096
459
  resizeObserver.disconnect();
1097
460
  };
1098
461
  }, [containerRef]);
1099
- const widthsDependencies = (0, import_react8.useMemo)(
462
+ const widthsDependencies = (0, import_react3.useMemo)(
1100
463
  () => ({
1101
464
  stateList: stateList.map((item) => item.value),
1102
465
  variant,
@@ -1123,7 +486,7 @@ var useMultiSelectControl = ({
1123
486
  };
1124
487
  const setPlaceholder = () => {
1125
488
  setSelectedContent(
1126
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
489
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1127
490
  Text,
1128
491
  {
1129
492
  color: theme.colors.control.input.placeholder,
@@ -1170,11 +533,11 @@ var useMultiSelectControl = ({
1170
533
  const countText = displayStateRef.current === 1 /* PreRender */ ? `+${itemsList.length}` : `+${itemsList.length - displayedItems.length}`;
1171
534
  displayedItems.push({ value: COUNT_ITEM_VALUE, label: countText });
1172
535
  }
1173
- const content = displayedItems.map((item, index4) => {
536
+ const content = displayedItems.map((item, index2) => {
1174
537
  const isCount = item.value === COUNT_ITEM_VALUE;
1175
- const isReducable = index4 === 0 && displayStateRef.current === 3 /* Render */ && displayedItemsCount === 0 || flexible;
538
+ const isReducable = index2 === 0 && displayStateRef.current === 3 /* Render */ && displayedItemsCount === 0 || flexible;
1176
539
  if (variant === "tag") {
1177
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
540
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1178
541
  Box,
1179
542
  {
1180
543
  onPress: !isCount ? (e) => {
@@ -1186,8 +549,8 @@ var useMultiSelectControl = ({
1186
549
  opacity: disabled ? 0.5 : 1,
1187
550
  cursor: disabled || isCount ? "not-allowed" : "pointer"
1188
551
  },
1189
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1190
- Tag,
552
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
553
+ import_xui_tag.Tag,
1191
554
  {
1192
555
  size,
1193
556
  tone: "primary",
@@ -1203,8 +566,8 @@ var useMultiSelectControl = ({
1203
566
  );
1204
567
  }
1205
568
  const isCountItem = hasHidden;
1206
- const needsComma = index4 < displayedItems.length - 2 || index4 < displayedItems.length - 1 && !isCountItem;
1207
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
569
+ const needsComma = index2 < displayedItems.length - 2 || index2 < displayedItems.length - 1 && !isCountItem;
570
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
1208
571
  Text,
1209
572
  {
1210
573
  color: theme.colors.content.primary,
@@ -1239,11 +602,11 @@ var useMultiSelectControl = ({
1239
602
  const countItemWidth = countEl.getBoundingClientRect().width;
1240
603
  const columnGap = parseInt(getComputedStyle(itemsRef.current).columnGap || "0", 10) || 0;
1241
604
  const tagsWidths = {};
1242
- let index4 = 0;
605
+ let index2 = 0;
1243
606
  for (const el of allItems) {
1244
- const key = index4 < allItems.length - 1 ? stateList[index4].value : COUNT_ITEM_VALUE;
607
+ const key = index2 < allItems.length - 1 ? stateList[index2].value : COUNT_ITEM_VALUE;
1245
608
  tagsWidths[key] = el.getBoundingClientRect().width;
1246
- index4++;
609
+ index2++;
1247
610
  }
1248
611
  savedWidthsRef.current = {
1249
612
  tagsWidths,
@@ -1254,7 +617,7 @@ var useMultiSelectControl = ({
1254
617
  displayStateRef.current = 3 /* Render */;
1255
618
  setItemsRender();
1256
619
  };
1257
- (0, import_react8.useEffect)(() => {
620
+ (0, import_react3.useEffect)(() => {
1258
621
  if (isPlaceholder) {
1259
622
  displayStateRef.current = 0 /* Placeholder */;
1260
623
  setPlaceholder();
@@ -1288,7 +651,7 @@ var useMultiSelectControl = ({
1288
651
  widthsDependencies,
1289
652
  stateList
1290
653
  ]);
1291
- (0, import_react8.useEffect)(() => {
654
+ (0, import_react3.useEffect)(() => {
1292
655
  if (displayStateRef.current !== 2 /* Calculation */) return;
1293
656
  const rafId = requestAnimationFrame(() => {
1294
657
  if (displayStateRef.current === 2 /* Calculation */) {
@@ -1306,8 +669,8 @@ var useMultiSelectControl = ({
1306
669
  };
1307
670
 
1308
671
  // src/MultiSelectControl.tsx
1309
- var import_jsx_runtime11 = require("react/jsx-runtime");
1310
- var MultiSelectControl = (0, import_react9.forwardRef)(
672
+ var import_jsx_runtime5 = require("react/jsx-runtime");
673
+ var MultiSelectControl = (0, import_react4.forwardRef)(
1311
674
  ({
1312
675
  variant = "tag",
1313
676
  flexible = true,
@@ -1331,12 +694,12 @@ var MultiSelectControl = (0, import_react9.forwardRef)(
1331
694
  themeMode,
1332
695
  themeProductContext
1333
696
  }, ref) => {
1334
- const { theme } = (0, import_xui_core3.useResolvedTheme)({ themeMode, themeProductContext });
697
+ const { theme } = (0, import_xui_core2.useResolvedTheme)({ themeMode, themeProductContext });
1335
698
  const sizeStyles = theme.sizing.input(size);
1336
699
  const inputColors = theme.colors.control.input;
1337
700
  const state = externalState || (disabled ? "disable" : "default");
1338
701
  const isDisable = state === "disable" || disabled;
1339
- const containerRef = (0, import_react9.useRef)(null);
702
+ const containerRef = (0, import_react4.useRef)(null);
1340
703
  const { itemsRef, selectedContent, isCalculating } = useMultiSelectControl({
1341
704
  variant,
1342
705
  flexible,
@@ -1366,7 +729,7 @@ var MultiSelectControl = (0, import_react9.forwardRef)(
1366
729
  borderColor = inputColors.borderHover;
1367
730
  }
1368
731
  const iconColor = isDisable ? inputColors.textDisable : inputColors.placeholder;
1369
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
732
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1370
733
  Box,
1371
734
  {
1372
735
  ref,
@@ -1394,7 +757,7 @@ var MultiSelectControl = (0, import_react9.forwardRef)(
1394
757
  borderColor: inputColors.borderHover
1395
758
  } : void 0,
1396
759
  children: [
1397
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
760
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1398
761
  Box,
1399
762
  {
1400
763
  ref: containerRef,
@@ -1404,8 +767,8 @@ var MultiSelectControl = (0, import_react9.forwardRef)(
1404
767
  gap: 8,
1405
768
  style: { minWidth: 0 },
1406
769
  children: [
1407
- iconLeft && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Icon, { size: sizeStyles.iconSize, color: iconColor, variant: "line", children: iconLeft }),
1408
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
770
+ iconLeft && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { size: sizeStyles.iconSize, color: iconColor, variant: "line", children: iconLeft }),
771
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1409
772
  Box,
1410
773
  {
1411
774
  ref: itemsRef,
@@ -1421,8 +784,8 @@ var MultiSelectControl = (0, import_react9.forwardRef)(
1421
784
  ]
1422
785
  }
1423
786
  ),
1424
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Box, { flexDirection: "row", alignItems: "center", gap: 4, children: [
1425
- extraClear && selectedItems.length > 0 && !isDisable && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
787
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box, { flexDirection: "row", alignItems: "center", gap: 4, children: [
788
+ extraClear && selectedItems.length > 0 && !isDisable && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1426
789
  Box,
1427
790
  {
1428
791
  onPress: (e) => {
@@ -1430,11 +793,11 @@ var MultiSelectControl = (0, import_react9.forwardRef)(
1430
793
  removeAllValues();
1431
794
  },
1432
795
  style: { cursor: "pointer" },
1433
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_xui_icons_base.Remove, { size: 18, color: iconColor, variant: "line" })
796
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_xui_icons_base.Remove, { size: 18, color: iconColor, variant: "line" })
1434
797
  }
1435
798
  ),
1436
- isError && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_xui_icons_base.ExclamationMarkCr, { size: 18, color: theme.colors.content.alert.primary }),
1437
- 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" })
799
+ isError && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_xui_icons_base.ExclamationMarkCr, { size: 18, color: theme.colors.content.alert.primary }),
800
+ 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" })
1438
801
  ] })
1439
802
  ]
1440
803
  }
@@ -1444,7 +807,7 @@ var MultiSelectControl = (0, import_react9.forwardRef)(
1444
807
  MultiSelectControl.displayName = "MultiSelectControl";
1445
808
 
1446
809
  // src/useMultiSelect.ts
1447
- var import_react10 = require("react");
810
+ var import_react5 = require("react");
1448
811
  var initialState = {
1449
812
  values: [],
1450
813
  selectedItems: [],
@@ -1455,12 +818,12 @@ var useMultiSelect = ({
1455
818
  value = [],
1456
819
  onChange
1457
820
  }) => {
1458
- const [state, setState] = (0, import_react10.useState)(initialState);
1459
- const optionsRef = (0, import_react10.useRef)(options);
1460
- (0, import_react10.useEffect)(() => {
821
+ const [state, setState] = (0, import_react5.useState)(initialState);
822
+ const optionsRef = (0, import_react5.useRef)(options);
823
+ (0, import_react5.useEffect)(() => {
1461
824
  optionsRef.current = options;
1462
825
  }, [options]);
1463
- (0, import_react10.useEffect)(() => {
826
+ (0, import_react5.useEffect)(() => {
1464
827
  const selectedItems = options.filter((opt) => value.includes(opt.value));
1465
828
  setState((prevState) => ({
1466
829
  ...prevState,
@@ -1468,7 +831,7 @@ var useMultiSelect = ({
1468
831
  selectedItems
1469
832
  }));
1470
833
  }, [options, value]);
1471
- const onChoose = (0, import_react10.useCallback)(
834
+ const onChoose = (0, import_react5.useCallback)(
1472
835
  (selectedIds) => {
1473
836
  const newValues = optionsRef.current.filter((opt) => selectedIds.includes(String(opt.value))).map((opt) => opt.value);
1474
837
  const newSelectedItems = optionsRef.current.filter(
@@ -1483,7 +846,7 @@ var useMultiSelect = ({
1483
846
  },
1484
847
  [onChange]
1485
848
  );
1486
- const onRemove = (0, import_react10.useCallback)(
849
+ const onRemove = (0, import_react5.useCallback)(
1487
850
  (value2, event) => {
1488
851
  event?.stopPropagation();
1489
852
  setState((prev) => {
@@ -1501,7 +864,7 @@ var useMultiSelect = ({
1501
864
  },
1502
865
  [onChange]
1503
866
  );
1504
- const onRemoveAll = (0, import_react10.useCallback)(() => {
867
+ const onRemoveAll = (0, import_react5.useCallback)(() => {
1505
868
  setState((prevState) => ({
1506
869
  ...prevState,
1507
870
  values: [],
@@ -1509,13 +872,13 @@ var useMultiSelect = ({
1509
872
  }));
1510
873
  onChange?.([]);
1511
874
  }, [onChange]);
1512
- const onSelectClick = (0, import_react10.useCallback)(() => {
875
+ const onSelectClick = (0, import_react5.useCallback)(() => {
1513
876
  setState((prevState) => ({
1514
877
  ...prevState,
1515
878
  isOpen: !prevState.isOpen
1516
879
  }));
1517
880
  }, []);
1518
- const onClose = (0, import_react10.useCallback)(() => {
881
+ const onClose = (0, import_react5.useCallback)(() => {
1519
882
  setState((prevState) => ({
1520
883
  ...prevState,
1521
884
  isOpen: false
@@ -1535,19 +898,19 @@ var useMultiSelect = ({
1535
898
  };
1536
899
 
1537
900
  // src/Portal.web.tsx
1538
- var import_react11 = require("react");
901
+ var import_react6 = require("react");
1539
902
  var import_react_dom = require("react-dom");
1540
903
  var Portal = ({ children }) => {
1541
- const [mountNode, setMountNode] = (0, import_react11.useState)(null);
1542
- (0, import_react11.useEffect)(() => setMountNode(document.body), []);
904
+ const [mountNode, setMountNode] = (0, import_react6.useState)(null);
905
+ (0, import_react6.useEffect)(() => setMountNode(document.body), []);
1543
906
  if (!mountNode) return null;
1544
907
  return (0, import_react_dom.createPortal)(children, mountNode);
1545
908
  };
1546
909
 
1547
910
  // src/MultiSelect.tsx
1548
- var import_jsx_runtime12 = require("react/jsx-runtime");
911
+ var import_jsx_runtime6 = require("react/jsx-runtime");
1549
912
  var EXTERNAL_MENU_MIN_WIDTH_DEFAULT = 540;
1550
- var MultiSelect = (0, import_react12.forwardRef)(
913
+ var MultiSelect = (0, import_react7.forwardRef)(
1551
914
  ({
1552
915
  options,
1553
916
  errorMessage,
@@ -1577,15 +940,15 @@ var MultiSelect = (0, import_react12.forwardRef)(
1577
940
  themeMode,
1578
941
  themeProductContext
1579
942
  }, ref) => {
1580
- const { theme } = (0, import_xui_core4.useResolvedTheme)({ themeMode, themeProductContext });
1581
- const modalId = (0, import_xui_core4.useModalId)();
1582
- const overlayLayer = (0, import_xui_core4.useOverlayLayer)();
1583
- const controlRef = (0, import_react12.useRef)(null);
1584
- const menuRef = (0, import_react12.useRef)(null);
1585
- const containerRef = (0, import_react12.useRef)(null);
1586
- const searchInputRef = (0, import_react12.useRef)(null);
1587
- const [menuPosition, setMenuPosition] = (0, import_react12.useState)(null);
1588
- const [searchValue, setSearchValue] = (0, import_react12.useState)("");
943
+ const { theme } = (0, import_xui_core3.useResolvedTheme)({ themeMode, themeProductContext });
944
+ const modalId = (0, import_xui_core3.useModalId)();
945
+ const overlayLayer = (0, import_xui_core3.useOverlayLayer)();
946
+ const controlRef = (0, import_react7.useRef)(null);
947
+ const menuRef = (0, import_react7.useRef)(null);
948
+ const containerRef = (0, import_react7.useRef)(null);
949
+ const searchInputRef = (0, import_react7.useRef)(null);
950
+ const [menuPosition, setMenuPosition] = (0, import_react7.useState)(null);
951
+ const [searchValue, setSearchValue] = (0, import_react7.useState)("");
1589
952
  const sizeStyles = theme.sizing.input(size);
1590
953
  const inputColors = theme.colors.control.input;
1591
954
  const state = externalState || (disabled ? "disable" : "default");
@@ -1607,17 +970,17 @@ var MultiSelect = (0, import_react12.forwardRef)(
1607
970
  value,
1608
971
  onChange
1609
972
  });
1610
- (0, import_react12.useEffect)(() => {
973
+ (0, import_react7.useEffect)(() => {
1611
974
  if (isDisable || !dropdownMenu) {
1612
975
  onClose();
1613
976
  }
1614
977
  }, [isDisable, dropdownMenu, onClose]);
1615
- (0, import_react12.useEffect)(() => {
978
+ (0, import_react7.useEffect)(() => {
1616
979
  if (isOpen && searchable && isWeb) {
1617
980
  searchInputRef.current?.focus();
1618
981
  }
1619
982
  }, [isOpen, searchable]);
1620
- (0, import_react12.useEffect)(() => {
983
+ (0, import_react7.useEffect)(() => {
1621
984
  if (!isOpen) setSearchValue("");
1622
985
  }, [isOpen]);
1623
986
  const getOptionText = (opt) => typeof opt.label === "string" ? opt.label : String(opt.value);
@@ -1658,7 +1021,7 @@ var MultiSelect = (0, import_react12.forwardRef)(
1658
1021
  overflow: "hidden",
1659
1022
  textOverflow: "ellipsis"
1660
1023
  };
1661
- (0, import_react12.useEffect)(() => {
1024
+ (0, import_react7.useEffect)(() => {
1662
1025
  if (!isWeb || !controlMenuOpen || isDisable || !dropdownMenu) return;
1663
1026
  let rafId = null;
1664
1027
  const repositionMenu = () => {
@@ -1684,7 +1047,7 @@ var MultiSelect = (0, import_react12.forwardRef)(
1684
1047
  window.removeEventListener("scroll", scheduleUpdate, true);
1685
1048
  };
1686
1049
  }, [controlMenuOpen, dropdownMenu, isDisable]);
1687
- (0, import_react12.useEffect)(() => {
1050
+ (0, import_react7.useEffect)(() => {
1688
1051
  if (!isWeb || !dropdownMenu || !isOpen || isDisable) return;
1689
1052
  const handleOutsideMouseDown = (event) => {
1690
1053
  const path = typeof event.composedPath === "function" ? event.composedPath() : [];
@@ -1701,8 +1064,8 @@ var MultiSelect = (0, import_react12.forwardRef)(
1701
1064
  minWidth: menuMinWidth ?? EXTERNAL_MENU_MIN_WIDTH_DEFAULT,
1702
1065
  boxSizing: "border-box"
1703
1066
  } : void 0;
1704
- const dropdown = dropdownMenu && isOpen && !isDisable && (!isWeb || menuPosition) && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
1705
- !isWeb && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1067
+ const dropdown = dropdownMenu && isOpen && !isDisable && (!isWeb || menuPosition) && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
1068
+ !isWeb && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1706
1069
  Box,
1707
1070
  {
1708
1071
  "data-modal-id": modalId,
@@ -1712,13 +1075,13 @@ var MultiSelect = (0, import_react12.forwardRef)(
1712
1075
  left: 0,
1713
1076
  right: 0,
1714
1077
  bottom: 0,
1715
- zIndex: overlayLayer + import_xui_core4.LAYER_OFFSET.menu,
1078
+ zIndex: overlayLayer + import_xui_core3.LAYER_OFFSET.menu,
1716
1079
  cursor: "default"
1717
1080
  },
1718
1081
  onPress: onClose
1719
1082
  }
1720
1083
  ),
1721
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
1084
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1722
1085
  Box,
1723
1086
  {
1724
1087
  ref: menuRef,
@@ -1737,18 +1100,18 @@ var MultiSelect = (0, import_react12.forwardRef)(
1737
1100
  right: isWeb ? void 0 : 0,
1738
1101
  width: isWeb ? menuPosition?.width : void 0,
1739
1102
  marginTop: isWeb ? void 0 : 4,
1740
- zIndex: overlayLayer + import_xui_core4.LAYER_OFFSET.popover,
1103
+ zIndex: overlayLayer + import_xui_core3.LAYER_OFFSET.popover,
1741
1104
  boxShadow: theme.shadow.popover
1742
1105
  },
1743
1106
  children: [
1744
- searchable && isWeb && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1107
+ searchable && isWeb && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1745
1108
  Box,
1746
1109
  {
1747
1110
  paddingHorizontal: sizeStyles.paddingHorizontal,
1748
1111
  paddingVertical: sizeStyles.paddingVertical,
1749
1112
  borderBottomWidth: 1,
1750
1113
  borderColor: theme.colors.border.secondary,
1751
- children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
1114
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1752
1115
  Box,
1753
1116
  {
1754
1117
  flexDirection: "row",
@@ -1756,15 +1119,15 @@ var MultiSelect = (0, import_react12.forwardRef)(
1756
1119
  gap: sizeStyles.paddingHorizontal / 2,
1757
1120
  paddingHorizontal: 4,
1758
1121
  children: [
1759
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1122
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1760
1123
  Icon,
1761
1124
  {
1762
1125
  size: sizeStyles.iconSize - 2,
1763
1126
  color: inputColors.placeholder,
1764
- children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_xui_icons_base2.Search, {})
1127
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_xui_icons_base2.Search, {})
1765
1128
  }
1766
1129
  ),
1767
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1130
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1768
1131
  Box,
1769
1132
  {
1770
1133
  as: "input",
@@ -1791,7 +1154,7 @@ var MultiSelect = (0, import_react12.forwardRef)(
1791
1154
  )
1792
1155
  }
1793
1156
  ),
1794
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1157
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1795
1158
  Box,
1796
1159
  {
1797
1160
  paddingVertical: 4,
@@ -1801,13 +1164,13 @@ var MultiSelect = (0, import_react12.forwardRef)(
1801
1164
  overflowX: optionListOverflowX,
1802
1165
  scrollbarWidth: "none"
1803
1166
  },
1804
- children: menuItems.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1167
+ children: menuItems.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1805
1168
  Box,
1806
1169
  {
1807
1170
  paddingVertical: sizeStyles.paddingVertical * 2,
1808
1171
  paddingHorizontal: sizeStyles.paddingHorizontal,
1809
1172
  alignItems: "center",
1810
- children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1173
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1811
1174
  Text,
1812
1175
  {
1813
1176
  color: theme.colors.content.tertiary,
@@ -1819,7 +1182,7 @@ var MultiSelect = (0, import_react12.forwardRef)(
1819
1182
  ) : menuItems.map((item, _index) => {
1820
1183
  const brandColors = theme.colors.control.brand.primary;
1821
1184
  const contentColors = theme.colors.content;
1822
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1185
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1823
1186
  Box,
1824
1187
  {
1825
1188
  testID,
@@ -1842,7 +1205,7 @@ var MultiSelect = (0, import_react12.forwardRef)(
1842
1205
  opacity: item.disabled ? 0.5 : 1,
1843
1206
  minWidth: optionRowMinWidth
1844
1207
  },
1845
- children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1208
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1846
1209
  Text,
1847
1210
  {
1848
1211
  color: item.checked ? contentColors.on.brand : theme.colors.content.secondary,
@@ -1863,7 +1226,7 @@ var MultiSelect = (0, import_react12.forwardRef)(
1863
1226
  }
1864
1227
  )
1865
1228
  ] });
1866
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
1229
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1867
1230
  Box,
1868
1231
  {
1869
1232
  ref: containerRef,
@@ -1872,7 +1235,7 @@ var MultiSelect = (0, import_react12.forwardRef)(
1872
1235
  gap: sizeStyles.fieldGap,
1873
1236
  style: externalFieldLayout,
1874
1237
  children: [
1875
- label && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1238
+ label && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1876
1239
  Text,
1877
1240
  {
1878
1241
  color: theme.colors.content.secondary,
@@ -1881,7 +1244,7 @@ var MultiSelect = (0, import_react12.forwardRef)(
1881
1244
  children: label
1882
1245
  }
1883
1246
  ),
1884
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
1247
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1885
1248
  Box,
1886
1249
  {
1887
1250
  ref,
@@ -1890,7 +1253,7 @@ var MultiSelect = (0, import_react12.forwardRef)(
1890
1253
  ...externalFieldLayout ? { width: "100%" } : {}
1891
1254
  },
1892
1255
  children: [
1893
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1256
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1894
1257
  MultiSelectControl,
1895
1258
  {
1896
1259
  ref: controlRef,
@@ -1915,11 +1278,11 @@ var MultiSelect = (0, import_react12.forwardRef)(
1915
1278
  extraClear
1916
1279
  }
1917
1280
  ),
1918
- isWeb ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Portal, { children: dropdown }) : dropdown
1281
+ isWeb ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Portal, { children: dropdown }) : dropdown
1919
1282
  ]
1920
1283
  }
1921
1284
  ),
1922
- errorMessage && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1285
+ errorMessage && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1923
1286
  Text,
1924
1287
  {
1925
1288
  color: theme.colors.content.alert.primary,
@@ -1938,19 +1301,4 @@ MultiSelect.displayName = "MultiSelect";
1938
1301
  0 && (module.exports = {
1939
1302
  MultiSelect
1940
1303
  });
1941
- /*! Bundled license information:
1942
-
1943
- lucide-react/dist/esm/shared/src/utils.js:
1944
- lucide-react/dist/esm/defaultAttributes.js:
1945
- lucide-react/dist/esm/Icon.js:
1946
- lucide-react/dist/esm/createLucideIcon.js:
1947
- lucide-react/dist/esm/icons/x.js:
1948
- lucide-react/dist/esm/lucide-react.js:
1949
- (**
1950
- * @license lucide-react v0.470.0 - ISC
1951
- *
1952
- * This source code is licensed under the ISC license.
1953
- * See the LICENSE file in the root directory of this source tree.
1954
- *)
1955
- */
1956
1304
  //# sourceMappingURL=index.js.map