@xsolla/xui-multi-select 0.216.0 → 0.217.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/web/index.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,12 +459,13 @@ 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,
1103
466
  size,
1104
- removeTagsButtons
467
+ removeTagsButtons,
468
+ lockedList: stateList.filter((item) => item.removable === false).map((item) => item.value)
1105
469
  }),
1106
470
  [stateList, variant, size, removeTagsButtons]
1107
471
  );
@@ -1114,16 +478,23 @@ var useMultiSelectControl = ({
1114
478
  return true;
1115
479
  if (prev.stateList.length !== widthsDependencies.stateList.length)
1116
480
  return true;
481
+ if (prev.lockedList.length !== widthsDependencies.lockedList.length)
482
+ return true;
1117
483
  let i = 0;
1118
484
  for (const v of prev.stateList) {
1119
485
  if (v !== widthsDependencies.stateList[i]) return true;
1120
486
  i++;
1121
487
  }
488
+ let j = 0;
489
+ for (const v of prev.lockedList) {
490
+ if (v !== widthsDependencies.lockedList[j]) return true;
491
+ j++;
492
+ }
1122
493
  return false;
1123
494
  };
1124
495
  const setPlaceholder = () => {
1125
496
  setSelectedContent(
1126
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
497
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1127
498
  Text,
1128
499
  {
1129
500
  color: theme.colors.control.input.placeholder,
@@ -1170,28 +541,30 @@ var useMultiSelectControl = ({
1170
541
  const countText = displayStateRef.current === 1 /* PreRender */ ? `+${itemsList.length}` : `+${itemsList.length - displayedItems.length}`;
1171
542
  displayedItems.push({ value: COUNT_ITEM_VALUE, label: countText });
1172
543
  }
1173
- const content = displayedItems.map((item, index4) => {
544
+ const content = displayedItems.map((item, index2) => {
1174
545
  const isCount = item.value === COUNT_ITEM_VALUE;
1175
- const isReducable = index4 === 0 && displayStateRef.current === 3 /* Render */ && displayedItemsCount === 0 || flexible;
546
+ const isLocked = !isCount && item.removable === false;
547
+ const canRemove = !isCount && !isLocked;
548
+ const isReducable = index2 === 0 && displayStateRef.current === 3 /* Render */ && displayedItemsCount === 0 || flexible;
1176
549
  if (variant === "tag") {
1177
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
550
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1178
551
  Box,
1179
552
  {
1180
- onPress: !isCount ? (e) => {
553
+ onPress: canRemove ? (e) => {
1181
554
  e.stopPropagation();
1182
555
  if (!disabled) removeValue(item.value, e);
1183
556
  } : void 0,
1184
557
  style: {
1185
558
  minWidth: isReducable ? 0 : "fit-content",
1186
559
  opacity: disabled ? 0.5 : 1,
1187
- cursor: disabled || isCount ? "not-allowed" : "pointer"
560
+ cursor: isLocked ? "default" : disabled || isCount ? "not-allowed" : "pointer"
1188
561
  },
1189
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1190
- Tag,
562
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
563
+ import_xui_tag.Tag,
1191
564
  {
1192
565
  size,
1193
566
  tone: "primary",
1194
- onRemove: removeTagsButtons && !isCount ? (e) => {
567
+ onRemove: removeTagsButtons && canRemove ? (e) => {
1195
568
  e?.stopPropagation();
1196
569
  if (!disabled) removeValue(item.value, e);
1197
570
  } : void 0,
@@ -1203,8 +576,8 @@ var useMultiSelectControl = ({
1203
576
  );
1204
577
  }
1205
578
  const isCountItem = hasHidden;
1206
- const needsComma = index4 < displayedItems.length - 2 || index4 < displayedItems.length - 1 && !isCountItem;
1207
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
579
+ const needsComma = index2 < displayedItems.length - 2 || index2 < displayedItems.length - 1 && !isCountItem;
580
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
1208
581
  Text,
1209
582
  {
1210
583
  color: theme.colors.content.primary,
@@ -1239,11 +612,11 @@ var useMultiSelectControl = ({
1239
612
  const countItemWidth = countEl.getBoundingClientRect().width;
1240
613
  const columnGap = parseInt(getComputedStyle(itemsRef.current).columnGap || "0", 10) || 0;
1241
614
  const tagsWidths = {};
1242
- let index4 = 0;
615
+ let index2 = 0;
1243
616
  for (const el of allItems) {
1244
- const key = index4 < allItems.length - 1 ? stateList[index4].value : COUNT_ITEM_VALUE;
617
+ const key = index2 < allItems.length - 1 ? stateList[index2].value : COUNT_ITEM_VALUE;
1245
618
  tagsWidths[key] = el.getBoundingClientRect().width;
1246
- index4++;
619
+ index2++;
1247
620
  }
1248
621
  savedWidthsRef.current = {
1249
622
  tagsWidths,
@@ -1254,7 +627,7 @@ var useMultiSelectControl = ({
1254
627
  displayStateRef.current = 3 /* Render */;
1255
628
  setItemsRender();
1256
629
  };
1257
- (0, import_react8.useEffect)(() => {
630
+ (0, import_react3.useEffect)(() => {
1258
631
  if (isPlaceholder) {
1259
632
  displayStateRef.current = 0 /* Placeholder */;
1260
633
  setPlaceholder();
@@ -1288,7 +661,7 @@ var useMultiSelectControl = ({
1288
661
  widthsDependencies,
1289
662
  stateList
1290
663
  ]);
1291
- (0, import_react8.useEffect)(() => {
664
+ (0, import_react3.useEffect)(() => {
1292
665
  if (displayStateRef.current !== 2 /* Calculation */) return;
1293
666
  const rafId = requestAnimationFrame(() => {
1294
667
  if (displayStateRef.current === 2 /* Calculation */) {
@@ -1306,8 +679,8 @@ var useMultiSelectControl = ({
1306
679
  };
1307
680
 
1308
681
  // src/MultiSelectControl.tsx
1309
- var import_jsx_runtime11 = require("react/jsx-runtime");
1310
- var MultiSelectControl = (0, import_react9.forwardRef)(
682
+ var import_jsx_runtime5 = require("react/jsx-runtime");
683
+ var MultiSelectControl = (0, import_react4.forwardRef)(
1311
684
  ({
1312
685
  variant = "tag",
1313
686
  flexible = true,
@@ -1331,12 +704,12 @@ var MultiSelectControl = (0, import_react9.forwardRef)(
1331
704
  themeMode,
1332
705
  themeProductContext
1333
706
  }, ref) => {
1334
- const { theme } = (0, import_xui_core3.useResolvedTheme)({ themeMode, themeProductContext });
707
+ const { theme } = (0, import_xui_core2.useResolvedTheme)({ themeMode, themeProductContext });
1335
708
  const sizeStyles = theme.sizing.input(size);
1336
709
  const inputColors = theme.colors.control.input;
1337
710
  const state = externalState || (disabled ? "disable" : "default");
1338
711
  const isDisable = state === "disable" || disabled;
1339
- const containerRef = (0, import_react9.useRef)(null);
712
+ const containerRef = (0, import_react4.useRef)(null);
1340
713
  const { itemsRef, selectedContent, isCalculating } = useMultiSelectControl({
1341
714
  variant,
1342
715
  flexible,
@@ -1366,7 +739,7 @@ var MultiSelectControl = (0, import_react9.forwardRef)(
1366
739
  borderColor = inputColors.borderHover;
1367
740
  }
1368
741
  const iconColor = isDisable ? inputColors.textDisable : inputColors.placeholder;
1369
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
742
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1370
743
  Box,
1371
744
  {
1372
745
  ref,
@@ -1394,7 +767,7 @@ var MultiSelectControl = (0, import_react9.forwardRef)(
1394
767
  borderColor: inputColors.borderHover
1395
768
  } : void 0,
1396
769
  children: [
1397
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
770
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1398
771
  Box,
1399
772
  {
1400
773
  ref: containerRef,
@@ -1404,8 +777,8 @@ var MultiSelectControl = (0, import_react9.forwardRef)(
1404
777
  gap: 8,
1405
778
  style: { minWidth: 0 },
1406
779
  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)(
780
+ iconLeft && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { size: sizeStyles.iconSize, color: iconColor, variant: "line", children: iconLeft }),
781
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1409
782
  Box,
1410
783
  {
1411
784
  ref: itemsRef,
@@ -1421,8 +794,8 @@ var MultiSelectControl = (0, import_react9.forwardRef)(
1421
794
  ]
1422
795
  }
1423
796
  ),
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)(
797
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box, { flexDirection: "row", alignItems: "center", gap: 4, children: [
798
+ extraClear && selectedItems.length > 0 && !isDisable && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1426
799
  Box,
1427
800
  {
1428
801
  onPress: (e) => {
@@ -1430,11 +803,11 @@ var MultiSelectControl = (0, import_react9.forwardRef)(
1430
803
  removeAllValues();
1431
804
  },
1432
805
  style: { cursor: "pointer" },
1433
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_xui_icons_base.Remove, { size: 18, color: iconColor, variant: "line" })
806
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_xui_icons_base.Remove, { size: 18, color: iconColor, variant: "line" })
1434
807
  }
1435
808
  ),
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" })
809
+ isError && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_xui_icons_base.ExclamationMarkCr, { size: 18, color: theme.colors.content.alert.primary }),
810
+ 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
811
  ] })
1439
812
  ]
1440
813
  }
@@ -1444,23 +817,28 @@ var MultiSelectControl = (0, import_react9.forwardRef)(
1444
817
  MultiSelectControl.displayName = "MultiSelectControl";
1445
818
 
1446
819
  // src/useMultiSelect.ts
1447
- var import_react10 = require("react");
820
+ var import_react5 = require("react");
1448
821
  var initialState = {
1449
822
  values: [],
1450
823
  selectedItems: [],
1451
824
  isOpen: false
1452
825
  };
826
+ var isLockedOption = (option) => option.removable === false;
1453
827
  var useMultiSelect = ({
1454
828
  options,
1455
829
  value = [],
1456
830
  onChange
1457
831
  }) => {
1458
- const [state, setState] = (0, import_react10.useState)(initialState);
1459
- const optionsRef = (0, import_react10.useRef)(options);
1460
- (0, import_react10.useEffect)(() => {
832
+ const [state, setState] = (0, import_react5.useState)(initialState);
833
+ const optionsRef = (0, import_react5.useRef)(options);
834
+ const valuesRef = (0, import_react5.useRef)(value);
835
+ (0, import_react5.useEffect)(() => {
1461
836
  optionsRef.current = options;
1462
837
  }, [options]);
1463
- (0, import_react10.useEffect)(() => {
838
+ (0, import_react5.useEffect)(() => {
839
+ valuesRef.current = state.values;
840
+ }, [state.values]);
841
+ (0, import_react5.useEffect)(() => {
1464
842
  const selectedItems = options.filter((opt) => value.includes(opt.value));
1465
843
  setState((prevState) => ({
1466
844
  ...prevState,
@@ -1468,9 +846,15 @@ var useMultiSelect = ({
1468
846
  selectedItems
1469
847
  }));
1470
848
  }, [options, value]);
1471
- const onChoose = (0, import_react10.useCallback)(
849
+ const getLockedSelectedValues = () => optionsRef.current.filter(
850
+ (opt) => isLockedOption(opt) && valuesRef.current.includes(opt.value)
851
+ ).map((opt) => opt.value);
852
+ const onChoose = (0, import_react5.useCallback)(
1472
853
  (selectedIds) => {
1473
- const newValues = optionsRef.current.filter((opt) => selectedIds.includes(String(opt.value))).map((opt) => opt.value);
854
+ const lockedValues = getLockedSelectedValues();
855
+ const newValues = optionsRef.current.filter(
856
+ (opt) => selectedIds.includes(String(opt.value)) || lockedValues.includes(opt.value)
857
+ ).map((opt) => opt.value);
1474
858
  const newSelectedItems = optionsRef.current.filter(
1475
859
  (opt) => newValues.includes(opt.value)
1476
860
  );
@@ -1483,9 +867,11 @@ var useMultiSelect = ({
1483
867
  },
1484
868
  [onChange]
1485
869
  );
1486
- const onRemove = (0, import_react10.useCallback)(
870
+ const onRemove = (0, import_react5.useCallback)(
1487
871
  (value2, event) => {
1488
872
  event?.stopPropagation();
873
+ const option = optionsRef.current.find((opt) => opt.value === value2);
874
+ if (option && isLockedOption(option)) return;
1489
875
  setState((prev) => {
1490
876
  const newValues = prev.values.filter((v) => v !== value2);
1491
877
  const newSelectedItems = optionsRef.current.filter(
@@ -1501,21 +887,25 @@ var useMultiSelect = ({
1501
887
  },
1502
888
  [onChange]
1503
889
  );
1504
- const onRemoveAll = (0, import_react10.useCallback)(() => {
890
+ const onRemoveAll = (0, import_react5.useCallback)(() => {
891
+ const keptValues = getLockedSelectedValues();
892
+ const keptItems = optionsRef.current.filter(
893
+ (opt) => keptValues.includes(opt.value)
894
+ );
1505
895
  setState((prevState) => ({
1506
896
  ...prevState,
1507
- values: [],
1508
- selectedItems: []
897
+ values: keptValues,
898
+ selectedItems: keptItems
1509
899
  }));
1510
- onChange?.([]);
900
+ onChange?.(keptValues);
1511
901
  }, [onChange]);
1512
- const onSelectClick = (0, import_react10.useCallback)(() => {
902
+ const onSelectClick = (0, import_react5.useCallback)(() => {
1513
903
  setState((prevState) => ({
1514
904
  ...prevState,
1515
905
  isOpen: !prevState.isOpen
1516
906
  }));
1517
907
  }, []);
1518
- const onClose = (0, import_react10.useCallback)(() => {
908
+ const onClose = (0, import_react5.useCallback)(() => {
1519
909
  setState((prevState) => ({
1520
910
  ...prevState,
1521
911
  isOpen: false
@@ -1535,19 +925,21 @@ var useMultiSelect = ({
1535
925
  };
1536
926
 
1537
927
  // src/Portal.web.tsx
1538
- var import_react11 = require("react");
928
+ var import_react6 = require("react");
1539
929
  var import_react_dom = require("react-dom");
1540
930
  var Portal = ({ children }) => {
1541
- const [mountNode, setMountNode] = (0, import_react11.useState)(null);
1542
- (0, import_react11.useEffect)(() => setMountNode(document.body), []);
931
+ const [mountNode, setMountNode] = (0, import_react6.useState)(null);
932
+ (0, import_react6.useEffect)(() => setMountNode(document.body), []);
1543
933
  if (!mountNode) return null;
1544
934
  return (0, import_react_dom.createPortal)(children, mountNode);
1545
935
  };
1546
936
 
1547
937
  // src/MultiSelect.tsx
1548
- var import_jsx_runtime12 = require("react/jsx-runtime");
938
+ var import_jsx_runtime6 = require("react/jsx-runtime");
1549
939
  var EXTERNAL_MENU_MIN_WIDTH_DEFAULT = 540;
1550
- var MultiSelect = (0, import_react12.forwardRef)(
940
+ var SEARCH_ROW_HEIGHT = 60;
941
+ var SELECT_ALL_ROW_HEIGHT = 37;
942
+ var MultiSelect = (0, import_react7.forwardRef)(
1551
943
  ({
1552
944
  options,
1553
945
  errorMessage,
@@ -1573,19 +965,22 @@ var MultiSelect = (0, import_react12.forwardRef)(
1573
965
  searchable = false,
1574
966
  searchPlaceholder = "Search",
1575
967
  noOptionsMessage = "No results",
968
+ selectAll = false,
969
+ selectAllLabel = "Select all",
970
+ deselectAllLabel = "Deselect all",
1576
971
  testID,
1577
972
  themeMode,
1578
973
  themeProductContext
1579
974
  }, 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)("");
975
+ const { theme } = (0, import_xui_core3.useResolvedTheme)({ themeMode, themeProductContext });
976
+ const modalId = (0, import_xui_core3.useModalId)();
977
+ const overlayLayer = (0, import_xui_core3.useOverlayLayer)();
978
+ const controlRef = (0, import_react7.useRef)(null);
979
+ const menuRef = (0, import_react7.useRef)(null);
980
+ const containerRef = (0, import_react7.useRef)(null);
981
+ const searchInputRef = (0, import_react7.useRef)(null);
982
+ const [menuPosition, setMenuPosition] = (0, import_react7.useState)(null);
983
+ const [searchValue, setSearchValue] = (0, import_react7.useState)("");
1589
984
  const sizeStyles = theme.sizing.input(size);
1590
985
  const inputColors = theme.colors.control.input;
1591
986
  const state = externalState || (disabled ? "disable" : "default");
@@ -1607,39 +1002,50 @@ var MultiSelect = (0, import_react12.forwardRef)(
1607
1002
  value,
1608
1003
  onChange
1609
1004
  });
1610
- (0, import_react12.useEffect)(() => {
1005
+ (0, import_react7.useEffect)(() => {
1611
1006
  if (isDisable || !dropdownMenu) {
1612
1007
  onClose();
1613
1008
  }
1614
1009
  }, [isDisable, dropdownMenu, onClose]);
1615
- (0, import_react12.useEffect)(() => {
1010
+ (0, import_react7.useEffect)(() => {
1616
1011
  if (isOpen && searchable && isWeb) {
1617
1012
  searchInputRef.current?.focus();
1618
1013
  }
1619
1014
  }, [isOpen, searchable]);
1620
- (0, import_react12.useEffect)(() => {
1015
+ (0, import_react7.useEffect)(() => {
1621
1016
  if (!isOpen) setSearchValue("");
1622
1017
  }, [isOpen]);
1623
1018
  const getOptionText = (opt) => typeof opt.label === "string" ? opt.label : String(opt.value);
1624
1019
  const filteredOptions = searchable && searchValue ? options.filter(
1625
1020
  (opt) => getOptionText(opt).toLowerCase().includes(searchValue.toLowerCase())
1626
1021
  ) : options;
1022
+ const selectedIds = values.map(String);
1627
1023
  const menuItems = filteredOptions.map((opt) => {
1628
1024
  const id = String(opt.value);
1629
- const checked = values.map(String).includes(id);
1025
+ const checked = selectedIds.includes(id);
1630
1026
  return {
1631
1027
  id,
1632
1028
  children: opt.label,
1633
1029
  checked,
1634
- disabled: opt.disabled
1030
+ disabled: opt.disabled,
1031
+ locked: opt.removable === false
1635
1032
  };
1636
1033
  });
1637
1034
  const handleItemToggle = (id, checked) => {
1638
- const value2 = options.find((opt) => String(opt.value) === id)?.value;
1639
- if (value2 === void 0) return;
1640
- const newValues = checked ? [...values, value2] : values.filter((v) => v !== value2);
1035
+ const option = options.find((opt) => String(opt.value) === id);
1036
+ if (option === void 0) return;
1037
+ if (!checked && option.removable === false) return;
1038
+ const newValues = checked ? [...values, option.value] : values.filter((v) => v !== option.value);
1641
1039
  onChoose(newValues.map(String));
1642
1040
  };
1041
+ const selectAllTargets = filteredOptions.filter((opt) => !opt.disabled);
1042
+ const showSelectAll = selectAll && dropdownMenu && selectAllTargets.length > 0;
1043
+ const areAllTargetsSelected = showSelectAll && selectAllTargets.every((opt) => selectedIds.includes(String(opt.value)));
1044
+ const handleSelectAllToggle = () => {
1045
+ const targetIds = selectAllTargets.map((opt) => String(opt.value));
1046
+ const nextIds = areAllTargetsSelected ? selectedIds.filter((id) => !targetIds.includes(id)) : Array.from(/* @__PURE__ */ new Set([...selectedIds, ...targetIds]));
1047
+ onChoose(nextIds);
1048
+ };
1643
1049
  const controlMenuOpen = dropdownMenu ? isOpen : Boolean(menuOpen);
1644
1050
  const controlOnClick = dropdownMenu ? onSelectClick : onTriggerPress;
1645
1051
  const isScrollOverflow = optionOverflow === "scroll";
@@ -1658,7 +1064,8 @@ var MultiSelect = (0, import_react12.forwardRef)(
1658
1064
  overflow: "hidden",
1659
1065
  textOverflow: "ellipsis"
1660
1066
  };
1661
- (0, import_react12.useEffect)(() => {
1067
+ const optionsListMaxHeight = maxHeight - (searchable ? SEARCH_ROW_HEIGHT : 0) - (showSelectAll ? SELECT_ALL_ROW_HEIGHT : 0);
1068
+ (0, import_react7.useEffect)(() => {
1662
1069
  if (!isWeb || !controlMenuOpen || isDisable || !dropdownMenu) return;
1663
1070
  let rafId = null;
1664
1071
  const repositionMenu = () => {
@@ -1684,7 +1091,7 @@ var MultiSelect = (0, import_react12.forwardRef)(
1684
1091
  window.removeEventListener("scroll", scheduleUpdate, true);
1685
1092
  };
1686
1093
  }, [controlMenuOpen, dropdownMenu, isDisable]);
1687
- (0, import_react12.useEffect)(() => {
1094
+ (0, import_react7.useEffect)(() => {
1688
1095
  if (!isWeb || !dropdownMenu || !isOpen || isDisable) return;
1689
1096
  const handleOutsideMouseDown = (event) => {
1690
1097
  const path = typeof event.composedPath === "function" ? event.composedPath() : [];
@@ -1701,8 +1108,8 @@ var MultiSelect = (0, import_react12.forwardRef)(
1701
1108
  minWidth: menuMinWidth ?? EXTERNAL_MENU_MIN_WIDTH_DEFAULT,
1702
1109
  boxSizing: "border-box"
1703
1110
  } : 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)(
1111
+ const dropdown = dropdownMenu && isOpen && !isDisable && (!isWeb || menuPosition) && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
1112
+ !isWeb && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1706
1113
  Box,
1707
1114
  {
1708
1115
  "data-modal-id": modalId,
@@ -1712,13 +1119,13 @@ var MultiSelect = (0, import_react12.forwardRef)(
1712
1119
  left: 0,
1713
1120
  right: 0,
1714
1121
  bottom: 0,
1715
- zIndex: overlayLayer + import_xui_core4.LAYER_OFFSET.menu,
1122
+ zIndex: overlayLayer + import_xui_core3.LAYER_OFFSET.menu,
1716
1123
  cursor: "default"
1717
1124
  },
1718
1125
  onPress: onClose
1719
1126
  }
1720
1127
  ),
1721
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
1128
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1722
1129
  Box,
1723
1130
  {
1724
1131
  ref: menuRef,
@@ -1737,18 +1144,18 @@ var MultiSelect = (0, import_react12.forwardRef)(
1737
1144
  right: isWeb ? void 0 : 0,
1738
1145
  width: isWeb ? menuPosition?.width : void 0,
1739
1146
  marginTop: isWeb ? void 0 : 4,
1740
- zIndex: overlayLayer + import_xui_core4.LAYER_OFFSET.popover,
1147
+ zIndex: overlayLayer + import_xui_core3.LAYER_OFFSET.popover,
1741
1148
  boxShadow: theme.shadow.popover
1742
1149
  },
1743
1150
  children: [
1744
- searchable && isWeb && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1151
+ searchable && isWeb && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1745
1152
  Box,
1746
1153
  {
1747
1154
  paddingHorizontal: sizeStyles.paddingHorizontal,
1748
1155
  paddingVertical: sizeStyles.paddingVertical,
1749
1156
  borderBottomWidth: 1,
1750
1157
  borderColor: theme.colors.border.secondary,
1751
- children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
1158
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1752
1159
  Box,
1753
1160
  {
1754
1161
  flexDirection: "row",
@@ -1756,15 +1163,15 @@ var MultiSelect = (0, import_react12.forwardRef)(
1756
1163
  gap: sizeStyles.paddingHorizontal / 2,
1757
1164
  paddingHorizontal: 4,
1758
1165
  children: [
1759
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1166
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1760
1167
  Icon,
1761
1168
  {
1762
1169
  size: sizeStyles.iconSize - 2,
1763
1170
  color: inputColors.placeholder,
1764
- children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_xui_icons_base2.Search, {})
1171
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_xui_icons_base2.Search, {})
1765
1172
  }
1766
1173
  ),
1767
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1174
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1768
1175
  Box,
1769
1176
  {
1770
1177
  as: "input",
@@ -1791,23 +1198,52 @@ var MultiSelect = (0, import_react12.forwardRef)(
1791
1198
  )
1792
1199
  }
1793
1200
  ),
1794
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1201
+ showSelectAll && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1202
+ Box,
1203
+ {
1204
+ role: "button",
1205
+ "aria-label": areAllTargetsSelected ? deselectAllLabel : selectAllLabel,
1206
+ testID: testID ? `${testID}-select-all` : void 0,
1207
+ paddingHorizontal: sizeStyles.paddingHorizontal,
1208
+ paddingVertical: 8,
1209
+ borderBottomWidth: 1,
1210
+ borderColor: theme.colors.border.secondary,
1211
+ flexDirection: "row",
1212
+ alignItems: "center",
1213
+ onPress: handleSelectAllToggle,
1214
+ hoverStyle: {
1215
+ backgroundColor: theme.colors.control.input.bgHover
1216
+ },
1217
+ style: { cursor: "pointer" },
1218
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1219
+ Text,
1220
+ {
1221
+ color: theme.colors.content.brand.primary,
1222
+ fontSize: sizeStyles.fontSize,
1223
+ fontWeight: "500",
1224
+ numberOfLines: 1,
1225
+ children: areAllTargetsSelected ? deselectAllLabel : selectAllLabel
1226
+ }
1227
+ )
1228
+ }
1229
+ ),
1230
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1795
1231
  Box,
1796
1232
  {
1797
1233
  paddingVertical: 4,
1798
1234
  style: {
1799
- maxHeight: searchable ? maxHeight - 60 : maxHeight,
1235
+ maxHeight: optionsListMaxHeight,
1800
1236
  overflowY: "auto",
1801
1237
  overflowX: optionListOverflowX,
1802
1238
  scrollbarWidth: "none"
1803
1239
  },
1804
- children: menuItems.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1240
+ children: menuItems.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1805
1241
  Box,
1806
1242
  {
1807
1243
  paddingVertical: sizeStyles.paddingVertical * 2,
1808
1244
  paddingHorizontal: sizeStyles.paddingHorizontal,
1809
1245
  alignItems: "center",
1810
- children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1246
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1811
1247
  Text,
1812
1248
  {
1813
1249
  color: theme.colors.content.tertiary,
@@ -1819,14 +1255,15 @@ var MultiSelect = (0, import_react12.forwardRef)(
1819
1255
  ) : menuItems.map((item, _index) => {
1820
1256
  const brandColors = theme.colors.control.brand.primary;
1821
1257
  const contentColors = theme.colors.content;
1822
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1258
+ const isInert = item.locked && item.checked;
1259
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1823
1260
  Box,
1824
1261
  {
1825
1262
  testID,
1826
1263
  paddingHorizontal: sizeStyles.paddingHorizontal,
1827
1264
  paddingVertical: 8,
1828
1265
  onPress: () => {
1829
- if (!item.disabled) {
1266
+ if (!item.disabled && !isInert) {
1830
1267
  handleItemToggle(item.id, !item.checked);
1831
1268
  }
1832
1269
  },
@@ -1838,11 +1275,11 @@ var MultiSelect = (0, import_react12.forwardRef)(
1838
1275
  backgroundColor: theme.colors.control.input.bgHover
1839
1276
  } : void 0,
1840
1277
  style: {
1841
- cursor: item.disabled ? "not-allowed" : "pointer",
1278
+ cursor: item.disabled ? "not-allowed" : isInert ? "default" : "pointer",
1842
1279
  opacity: item.disabled ? 0.5 : 1,
1843
1280
  minWidth: optionRowMinWidth
1844
1281
  },
1845
- children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1282
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1846
1283
  Text,
1847
1284
  {
1848
1285
  color: item.checked ? contentColors.on.brand : theme.colors.content.secondary,
@@ -1863,7 +1300,7 @@ var MultiSelect = (0, import_react12.forwardRef)(
1863
1300
  }
1864
1301
  )
1865
1302
  ] });
1866
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
1303
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1867
1304
  Box,
1868
1305
  {
1869
1306
  ref: containerRef,
@@ -1872,7 +1309,7 @@ var MultiSelect = (0, import_react12.forwardRef)(
1872
1309
  gap: sizeStyles.fieldGap,
1873
1310
  style: externalFieldLayout,
1874
1311
  children: [
1875
- label && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1312
+ label && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1876
1313
  Text,
1877
1314
  {
1878
1315
  color: theme.colors.content.secondary,
@@ -1881,7 +1318,7 @@ var MultiSelect = (0, import_react12.forwardRef)(
1881
1318
  children: label
1882
1319
  }
1883
1320
  ),
1884
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
1321
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1885
1322
  Box,
1886
1323
  {
1887
1324
  ref,
@@ -1890,7 +1327,7 @@ var MultiSelect = (0, import_react12.forwardRef)(
1890
1327
  ...externalFieldLayout ? { width: "100%" } : {}
1891
1328
  },
1892
1329
  children: [
1893
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1330
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1894
1331
  MultiSelectControl,
1895
1332
  {
1896
1333
  ref: controlRef,
@@ -1915,11 +1352,11 @@ var MultiSelect = (0, import_react12.forwardRef)(
1915
1352
  extraClear
1916
1353
  }
1917
1354
  ),
1918
- isWeb ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Portal, { children: dropdown }) : dropdown
1355
+ isWeb ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Portal, { children: dropdown }) : dropdown
1919
1356
  ]
1920
1357
  }
1921
1358
  ),
1922
- errorMessage && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1359
+ errorMessage && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1923
1360
  Text,
1924
1361
  {
1925
1362
  color: theme.colors.content.alert.primary,
@@ -1938,19 +1375,4 @@ MultiSelect.displayName = "MultiSelect";
1938
1375
  0 && (module.exports = {
1939
1376
  MultiSelect
1940
1377
  });
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
1378
  //# sourceMappingURL=index.js.map