@xsolla/xui-multi-select 0.216.0 → 0.216.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/native/index.js +89 -741
- package/native/index.js.map +1 -1
- package/native/index.mjs +53 -705
- package/native/index.mjs.map +1 -1
- package/package.json +7 -6
- package/web/index.js +90 -742
- package/web/index.js.map +1 -1
- package/web/index.mjs +51 -703
- package/web/index.mjs.map +1 -1
package/web/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/MultiSelect.tsx
|
|
2
2
|
import {
|
|
3
|
-
forwardRef as
|
|
3
|
+
forwardRef as forwardRef2,
|
|
4
4
|
useRef as useRef4,
|
|
5
5
|
useEffect as useEffect4,
|
|
6
6
|
useState as useState4
|
|
@@ -373,15 +373,15 @@ var isWeb = true;
|
|
|
373
373
|
// src/MultiSelect.tsx
|
|
374
374
|
import {
|
|
375
375
|
useModalId,
|
|
376
|
-
useResolvedTheme as
|
|
376
|
+
useResolvedTheme as useResolvedTheme3,
|
|
377
377
|
useOverlayLayer,
|
|
378
378
|
LAYER_OFFSET
|
|
379
379
|
} from "@xsolla/xui-core";
|
|
380
380
|
import { Search as SearchIcon } from "@xsolla/xui-icons-base";
|
|
381
381
|
|
|
382
382
|
// src/MultiSelectControl.tsx
|
|
383
|
-
import { forwardRef
|
|
384
|
-
import { useResolvedTheme as
|
|
383
|
+
import { forwardRef, useRef as useRef2 } from "react";
|
|
384
|
+
import { useResolvedTheme as useResolvedTheme2 } from "@xsolla/xui-core";
|
|
385
385
|
import {
|
|
386
386
|
ChevronDown,
|
|
387
387
|
ChevronUp,
|
|
@@ -396,646 +396,9 @@ import {
|
|
|
396
396
|
useRef,
|
|
397
397
|
useState
|
|
398
398
|
} from "react";
|
|
399
|
-
|
|
400
|
-
// ../tag/dist/web/index.mjs
|
|
401
|
-
import React22 from "react";
|
|
402
|
-
import styled5 from "styled-components";
|
|
403
|
-
import React4 from "react";
|
|
404
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
405
|
-
import styled22 from "styled-components";
|
|
406
|
-
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
407
|
-
import styled32 from "styled-components";
|
|
408
|
-
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
399
|
+
import { Tag } from "@xsolla/xui-tag";
|
|
409
400
|
import { useResolvedTheme } from "@xsolla/xui-core";
|
|
410
|
-
|
|
411
|
-
// ../../foundation/icons/dist/web/index.mjs
|
|
412
|
-
import React3 from "react";
|
|
413
|
-
import styled4 from "styled-components";
|
|
414
|
-
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
415
|
-
|
|
416
|
-
// ../../../node_modules/lucide-react/dist/esm/createLucideIcon.js
|
|
417
|
-
import { forwardRef as forwardRef2, createElement as createElement2 } from "react";
|
|
418
|
-
|
|
419
|
-
// ../../../node_modules/lucide-react/dist/esm/shared/src/utils.js
|
|
420
|
-
var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
421
|
-
var mergeClasses = (...classes) => classes.filter((className, index4, array) => {
|
|
422
|
-
return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index4;
|
|
423
|
-
}).join(" ").trim();
|
|
424
|
-
|
|
425
|
-
// ../../../node_modules/lucide-react/dist/esm/Icon.js
|
|
426
|
-
import { forwardRef, createElement } from "react";
|
|
427
|
-
|
|
428
|
-
// ../../../node_modules/lucide-react/dist/esm/defaultAttributes.js
|
|
429
|
-
var defaultAttributes = {
|
|
430
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
431
|
-
width: 24,
|
|
432
|
-
height: 24,
|
|
433
|
-
viewBox: "0 0 24 24",
|
|
434
|
-
fill: "none",
|
|
435
|
-
stroke: "currentColor",
|
|
436
|
-
strokeWidth: 2,
|
|
437
|
-
strokeLinecap: "round",
|
|
438
|
-
strokeLinejoin: "round"
|
|
439
|
-
};
|
|
440
|
-
|
|
441
|
-
// ../../../node_modules/lucide-react/dist/esm/Icon.js
|
|
442
|
-
var Icon2 = forwardRef(
|
|
443
|
-
({
|
|
444
|
-
color = "currentColor",
|
|
445
|
-
size = 24,
|
|
446
|
-
strokeWidth = 2,
|
|
447
|
-
absoluteStrokeWidth,
|
|
448
|
-
className = "",
|
|
449
|
-
children,
|
|
450
|
-
iconNode,
|
|
451
|
-
...rest
|
|
452
|
-
}, ref) => {
|
|
453
|
-
return createElement(
|
|
454
|
-
"svg",
|
|
455
|
-
{
|
|
456
|
-
ref,
|
|
457
|
-
...defaultAttributes,
|
|
458
|
-
width: size,
|
|
459
|
-
height: size,
|
|
460
|
-
stroke: color,
|
|
461
|
-
strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
|
|
462
|
-
className: mergeClasses("lucide", className),
|
|
463
|
-
...rest
|
|
464
|
-
},
|
|
465
|
-
[
|
|
466
|
-
...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),
|
|
467
|
-
...Array.isArray(children) ? children : [children]
|
|
468
|
-
]
|
|
469
|
-
);
|
|
470
|
-
}
|
|
471
|
-
);
|
|
472
|
-
|
|
473
|
-
// ../../../node_modules/lucide-react/dist/esm/createLucideIcon.js
|
|
474
|
-
var createLucideIcon = (iconName, iconNode) => {
|
|
475
|
-
const Component = forwardRef2(
|
|
476
|
-
({ className, ...props }, ref) => createElement2(Icon2, {
|
|
477
|
-
ref,
|
|
478
|
-
iconNode,
|
|
479
|
-
className: mergeClasses(`lucide-${toKebabCase(iconName)}`, className),
|
|
480
|
-
...props
|
|
481
|
-
})
|
|
482
|
-
);
|
|
483
|
-
Component.displayName = `${iconName}`;
|
|
484
|
-
return Component;
|
|
485
|
-
};
|
|
486
|
-
|
|
487
|
-
// ../../../node_modules/lucide-react/dist/esm/icons/x.js
|
|
488
|
-
var X = createLucideIcon("X", [
|
|
489
|
-
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
490
|
-
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
491
|
-
]);
|
|
492
|
-
|
|
493
|
-
// ../../foundation/icons/dist/web/index.mjs
|
|
494
|
-
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
495
|
-
function memoize2(fn) {
|
|
496
|
-
var cache = {};
|
|
497
|
-
return function(arg) {
|
|
498
|
-
if (cache[arg] === void 0) cache[arg] = fn(arg);
|
|
499
|
-
return cache[arg];
|
|
500
|
-
};
|
|
501
|
-
}
|
|
502
|
-
var memoize_esm_default2 = memoize2;
|
|
503
|
-
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)-.*))$/;
|
|
504
|
-
var index2 = memoize_esm_default2(
|
|
505
|
-
function(prop) {
|
|
506
|
-
return reactPropsRegex2.test(prop) || prop.charCodeAt(0) === 111 && prop.charCodeAt(1) === 110 && prop.charCodeAt(2) < 91;
|
|
507
|
-
}
|
|
508
|
-
/* Z+1 */
|
|
509
|
-
);
|
|
510
|
-
var is_prop_valid_esm_default2 = index2;
|
|
511
|
-
var ADDITIONAL_BLOCKED_PROPS2 = /* @__PURE__ */ new Set([
|
|
512
|
-
// RN-only event handlers (pass isPropValid's on* pattern)
|
|
513
|
-
"onPress",
|
|
514
|
-
"onChangeText",
|
|
515
|
-
"onLayout",
|
|
516
|
-
"onMoveShouldSetResponder",
|
|
517
|
-
"onResponderGrant",
|
|
518
|
-
"onResponderMove",
|
|
519
|
-
"onResponderRelease",
|
|
520
|
-
"onResponderTerminate",
|
|
521
|
-
// SVG attributes that pass isPropValid
|
|
522
|
-
"strokeWidth",
|
|
523
|
-
// CSS properties that pass isPropValid but are used as component props
|
|
524
|
-
"overflow",
|
|
525
|
-
"opacity",
|
|
526
|
-
"cursor",
|
|
527
|
-
"fontSize",
|
|
528
|
-
"fontWeight",
|
|
529
|
-
"fontFamily",
|
|
530
|
-
"textDecoration",
|
|
531
|
-
// Cross-platform layout prop that Text consumes as CSS, never as an
|
|
532
|
-
// attribute. Pinned explicitly because it is now spread into the styled
|
|
533
|
-
// component rather than destructured away before it can reach the DOM.
|
|
534
|
-
"numberOfLines"
|
|
535
|
-
]);
|
|
536
|
-
function shouldForwardProp2(key) {
|
|
537
|
-
if (ADDITIONAL_BLOCKED_PROPS2.has(key)) return false;
|
|
538
|
-
return is_prop_valid_esm_default2(key);
|
|
539
|
-
}
|
|
540
|
-
function createFilteredElement2(defaultTag) {
|
|
541
|
-
const Component = React3.forwardRef(
|
|
542
|
-
({ children, elementType, ...props }, ref) => {
|
|
543
|
-
const Tag2 = elementType || defaultTag;
|
|
544
|
-
const htmlProps = {};
|
|
545
|
-
for (const key of Object.keys(props)) {
|
|
546
|
-
if (shouldForwardProp2(key)) {
|
|
547
|
-
htmlProps[key] = props[key];
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
return React3.createElement(
|
|
551
|
-
Tag2,
|
|
552
|
-
{ ref, ...htmlProps },
|
|
553
|
-
children
|
|
554
|
-
);
|
|
555
|
-
}
|
|
556
|
-
);
|
|
557
|
-
Component.displayName = `Filtered(${defaultTag})`;
|
|
558
|
-
return Component;
|
|
559
|
-
}
|
|
560
|
-
var FilteredDiv3 = createFilteredElement2("div");
|
|
561
|
-
var StyledIcon2 = styled4(FilteredDiv3)`
|
|
562
|
-
display: flex;
|
|
563
|
-
align-items: center;
|
|
564
|
-
justify-content: center;
|
|
565
|
-
width: ${(props) => typeof props.size === "number" ? `${props.size}px` : props.size || "24px"};
|
|
566
|
-
height: ${(props) => typeof props.size === "number" ? `${props.size}px` : props.size || "24px"};
|
|
567
|
-
color: ${(props) => props.color || "currentColor"};
|
|
568
|
-
|
|
569
|
-
/* Icons paint themselves — each icon's own SVG sets its fill/stroke
|
|
570
|
-
(icons-base via inline "fill: currentColor", Lucide via "fill"/"stroke"
|
|
571
|
-
attributes). Do not add fill/stroke here: it re-strokes fill-based icons
|
|
572
|
-
and thickens the glyph. See FEP-877. */
|
|
573
|
-
svg {
|
|
574
|
-
width: 100%;
|
|
575
|
-
height: 100%;
|
|
576
|
-
}
|
|
577
|
-
`;
|
|
578
|
-
var Icon3 = ({
|
|
579
|
-
children,
|
|
580
|
-
testID,
|
|
581
|
-
"data-testid": dataTestId,
|
|
582
|
-
...props
|
|
583
|
-
}) => {
|
|
584
|
-
return /* @__PURE__ */ jsx4(StyledIcon2, { "data-testid": dataTestId || testID, ...props, children });
|
|
585
|
-
};
|
|
586
|
-
var X2 = (props) => /* @__PURE__ */ jsx22(Icon3, { ...props, children: /* @__PURE__ */ jsx22(X, { size: "100%" }) });
|
|
587
|
-
|
|
588
|
-
// ../tag/dist/web/index.mjs
|
|
589
|
-
import { jsx as jsx42, jsxs } from "react/jsx-runtime";
|
|
590
|
-
function memoize3(fn) {
|
|
591
|
-
var cache = {};
|
|
592
|
-
return function(arg) {
|
|
593
|
-
if (cache[arg] === void 0) cache[arg] = fn(arg);
|
|
594
|
-
return cache[arg];
|
|
595
|
-
};
|
|
596
|
-
}
|
|
597
|
-
var memoize_esm_default3 = memoize3;
|
|
598
|
-
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)-.*))$/;
|
|
599
|
-
var index3 = memoize_esm_default3(
|
|
600
|
-
function(prop) {
|
|
601
|
-
return reactPropsRegex3.test(prop) || prop.charCodeAt(0) === 111 && prop.charCodeAt(1) === 110 && prop.charCodeAt(2) < 91;
|
|
602
|
-
}
|
|
603
|
-
/* Z+1 */
|
|
604
|
-
);
|
|
605
|
-
var is_prop_valid_esm_default3 = index3;
|
|
606
|
-
var ADDITIONAL_BLOCKED_PROPS3 = /* @__PURE__ */ new Set([
|
|
607
|
-
// RN-only event handlers (pass isPropValid's on* pattern)
|
|
608
|
-
"onPress",
|
|
609
|
-
"onChangeText",
|
|
610
|
-
"onLayout",
|
|
611
|
-
"onMoveShouldSetResponder",
|
|
612
|
-
"onResponderGrant",
|
|
613
|
-
"onResponderMove",
|
|
614
|
-
"onResponderRelease",
|
|
615
|
-
"onResponderTerminate",
|
|
616
|
-
// SVG attributes that pass isPropValid
|
|
617
|
-
"strokeWidth",
|
|
618
|
-
// CSS properties that pass isPropValid but are used as component props
|
|
619
|
-
"overflow",
|
|
620
|
-
"opacity",
|
|
621
|
-
"cursor",
|
|
622
|
-
"fontSize",
|
|
623
|
-
"fontWeight",
|
|
624
|
-
"fontFamily",
|
|
625
|
-
"textDecoration",
|
|
626
|
-
// Cross-platform layout prop that Text consumes as CSS, never as an
|
|
627
|
-
// attribute. Pinned explicitly because it is now spread into the styled
|
|
628
|
-
// component rather than destructured away before it can reach the DOM.
|
|
629
|
-
"numberOfLines"
|
|
630
|
-
]);
|
|
631
|
-
function shouldForwardProp3(key) {
|
|
632
|
-
if (ADDITIONAL_BLOCKED_PROPS3.has(key)) return false;
|
|
633
|
-
return is_prop_valid_esm_default3(key);
|
|
634
|
-
}
|
|
635
|
-
function createFilteredElement3(defaultTag) {
|
|
636
|
-
const Component = React4.forwardRef(
|
|
637
|
-
({ children, elementType, ...props }, ref) => {
|
|
638
|
-
const Tag2 = elementType || defaultTag;
|
|
639
|
-
const htmlProps = {};
|
|
640
|
-
for (const key of Object.keys(props)) {
|
|
641
|
-
if (shouldForwardProp3(key)) {
|
|
642
|
-
htmlProps[key] = props[key];
|
|
643
|
-
}
|
|
644
|
-
}
|
|
645
|
-
return React4.createElement(
|
|
646
|
-
Tag2,
|
|
647
|
-
{ ref, ...htmlProps },
|
|
648
|
-
children
|
|
649
|
-
);
|
|
650
|
-
}
|
|
651
|
-
);
|
|
652
|
-
Component.displayName = `Filtered(${defaultTag})`;
|
|
653
|
-
return Component;
|
|
654
|
-
}
|
|
655
|
-
var FilteredDiv4 = createFilteredElement3("div");
|
|
656
|
-
var StyledBox2 = styled5(FilteredDiv4)`
|
|
657
|
-
display: flex;
|
|
658
|
-
box-sizing: border-box;
|
|
659
|
-
background-color: ${(props) => props.backgroundColor || "transparent"};
|
|
660
|
-
border-color: ${(props) => props.borderColor || "transparent"};
|
|
661
|
-
border-width: ${(props) => typeof props.borderWidth === "number" ? `${props.borderWidth}px` : props.borderWidth || 0};
|
|
662
|
-
|
|
663
|
-
${(props) => props.borderBottomWidth !== void 0 && `
|
|
664
|
-
border-bottom-width: ${typeof props.borderBottomWidth === "number" ? `${props.borderBottomWidth}px` : props.borderBottomWidth};
|
|
665
|
-
border-bottom-color: ${props.borderBottomColor || props.borderColor || "transparent"};
|
|
666
|
-
border-bottom-style: solid;
|
|
667
|
-
`}
|
|
668
|
-
${(props) => props.borderTopWidth !== void 0 && `
|
|
669
|
-
border-top-width: ${typeof props.borderTopWidth === "number" ? `${props.borderTopWidth}px` : props.borderTopWidth};
|
|
670
|
-
border-top-color: ${props.borderTopColor || props.borderColor || "transparent"};
|
|
671
|
-
border-top-style: solid;
|
|
672
|
-
`}
|
|
673
|
-
${(props) => props.borderLeftWidth !== void 0 && `
|
|
674
|
-
border-left-width: ${typeof props.borderLeftWidth === "number" ? `${props.borderLeftWidth}px` : props.borderLeftWidth};
|
|
675
|
-
border-left-color: ${props.borderLeftColor || props.borderColor || "transparent"};
|
|
676
|
-
border-left-style: solid;
|
|
677
|
-
`}
|
|
678
|
-
${(props) => props.borderRightWidth !== void 0 && `
|
|
679
|
-
border-right-width: ${typeof props.borderRightWidth === "number" ? `${props.borderRightWidth}px` : props.borderRightWidth};
|
|
680
|
-
border-right-color: ${props.borderRightColor || props.borderColor || "transparent"};
|
|
681
|
-
border-right-style: solid;
|
|
682
|
-
`}
|
|
683
|
-
|
|
684
|
-
border-style: ${(props) => props.borderStyle || (props.borderWidth || props.borderBottomWidth || props.borderTopWidth || props.borderLeftWidth || props.borderRightWidth ? "solid" : "none")};
|
|
685
|
-
border-radius: ${(props) => typeof props.borderRadius === "number" ? `${props.borderRadius}px` : props.borderRadius || 0};
|
|
686
|
-
height: ${(props) => typeof props.height === "number" ? `${props.height}px` : props.height || "auto"};
|
|
687
|
-
width: ${(props) => typeof props.width === "number" ? `${props.width}px` : props.width || "auto"};
|
|
688
|
-
min-width: ${(props) => typeof props.minWidth === "number" ? `${props.minWidth}px` : props.minWidth || "auto"};
|
|
689
|
-
min-height: ${(props) => typeof props.minHeight === "number" ? `${props.minHeight}px` : props.minHeight || "auto"};
|
|
690
|
-
max-width: ${(props) => typeof props.maxWidth === "number" ? `${props.maxWidth}px` : props.maxWidth || "none"};
|
|
691
|
-
max-height: ${(props) => typeof props.maxHeight === "number" ? `${props.maxHeight}px` : props.maxHeight || "none"};
|
|
692
|
-
|
|
693
|
-
padding: ${(props) => typeof props.padding === "number" ? `${props.padding}px` : props.padding || 0};
|
|
694
|
-
${(props) => props.paddingHorizontal && `
|
|
695
|
-
padding-left: ${typeof props.paddingHorizontal === "number" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};
|
|
696
|
-
padding-right: ${typeof props.paddingHorizontal === "number" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};
|
|
697
|
-
`}
|
|
698
|
-
${(props) => props.paddingVertical && `
|
|
699
|
-
padding-top: ${typeof props.paddingVertical === "number" ? `${props.paddingVertical}px` : props.paddingVertical};
|
|
700
|
-
padding-bottom: ${typeof props.paddingVertical === "number" ? `${props.paddingVertical}px` : props.paddingVertical};
|
|
701
|
-
`}
|
|
702
|
-
${(props) => props.paddingTop !== void 0 && `padding-top: ${typeof props.paddingTop === "number" ? `${props.paddingTop}px` : props.paddingTop};`}
|
|
703
|
-
${(props) => props.paddingBottom !== void 0 && `padding-bottom: ${typeof props.paddingBottom === "number" ? `${props.paddingBottom}px` : props.paddingBottom};`}
|
|
704
|
-
${(props) => props.paddingLeft !== void 0 && `padding-left: ${typeof props.paddingLeft === "number" ? `${props.paddingLeft}px` : props.paddingLeft};`}
|
|
705
|
-
${(props) => props.paddingRight !== void 0 && `padding-right: ${typeof props.paddingRight === "number" ? `${props.paddingRight}px` : props.paddingRight};`}
|
|
706
|
-
|
|
707
|
-
margin: ${(props) => typeof props.margin === "number" ? `${props.margin}px` : props.margin || 0};
|
|
708
|
-
${(props) => props.marginTop !== void 0 && `margin-top: ${typeof props.marginTop === "number" ? `${props.marginTop}px` : props.marginTop};`}
|
|
709
|
-
${(props) => props.marginBottom !== void 0 && `margin-bottom: ${typeof props.marginBottom === "number" ? `${props.marginBottom}px` : props.marginBottom};`}
|
|
710
|
-
${(props) => props.marginLeft !== void 0 && `margin-left: ${typeof props.marginLeft === "number" ? `${props.marginLeft}px` : props.marginLeft};`}
|
|
711
|
-
${(props) => props.marginRight !== void 0 && `margin-right: ${typeof props.marginRight === "number" ? `${props.marginRight}px` : props.marginRight};`}
|
|
712
|
-
|
|
713
|
-
flex-direction: ${(props) => props.flexDirection || "column"};
|
|
714
|
-
flex-wrap: ${(props) => props.flexWrap || "nowrap"};
|
|
715
|
-
align-items: ${(props) => props.alignItems || "stretch"};
|
|
716
|
-
justify-content: ${(props) => props.justifyContent || "flex-start"};
|
|
717
|
-
cursor: ${(props) => props.cursor ? props.cursor : props.onClick || props.onPress ? "pointer" : "inherit"};
|
|
718
|
-
position: ${(props) => props.position || "static"};
|
|
719
|
-
top: ${(props) => typeof props.top === "number" ? `${props.top}px` : props.top};
|
|
720
|
-
bottom: ${(props) => typeof props.bottom === "number" ? `${props.bottom}px` : props.bottom};
|
|
721
|
-
left: ${(props) => typeof props.left === "number" ? `${props.left}px` : props.left};
|
|
722
|
-
right: ${(props) => typeof props.right === "number" ? `${props.right}px` : props.right};
|
|
723
|
-
flex: ${(props) => props.flex};
|
|
724
|
-
flex-shrink: ${(props) => props.flexShrink ?? 1};
|
|
725
|
-
gap: ${(props) => typeof props.gap === "number" ? `${props.gap}px` : props.gap || 0};
|
|
726
|
-
align-self: ${(props) => props.alignSelf || "auto"};
|
|
727
|
-
/* Only emit overflow-x/y when explicitly set. Defaulting them to
|
|
728
|
-
visible after overflow would override the shorthand and break
|
|
729
|
-
clipping (e.g. OtherCard bottom-right promo image). */
|
|
730
|
-
overflow: ${(props) => props.overflow || "visible"};
|
|
731
|
-
${(props) => props.overflowX != null ? `overflow-x: ${props.overflowX};` : ""}
|
|
732
|
-
${(props) => props.overflowY != null ? `overflow-y: ${props.overflowY};` : ""}
|
|
733
|
-
z-index: ${(props) => props.zIndex};
|
|
734
|
-
opacity: ${(props) => props.opacity != null ? props.opacity : props.disabled ? 0.5 : 1};
|
|
735
|
-
pointer-events: ${(props) => props.disabled ? "none" : "auto"};
|
|
736
|
-
|
|
737
|
-
/* \`background\` is emitted before \`background-color\` so a caller passing
|
|
738
|
-
both still gets backgroundColor as the winner. Use the shorthand for a
|
|
739
|
-
layered fill (e.g. an overlay tint over a resting surface colour), which
|
|
740
|
-
a single background-color cannot express. */
|
|
741
|
-
&:hover {
|
|
742
|
-
${(props) => props.hoverStyle?.background && `background: ${props.hoverStyle.background};`}
|
|
743
|
-
${(props) => props.hoverStyle?.backgroundColor && `background-color: ${props.hoverStyle.backgroundColor};`}
|
|
744
|
-
${(props) => props.hoverStyle?.borderColor && `border-color: ${props.hoverStyle.borderColor};`}
|
|
745
|
-
}
|
|
746
|
-
|
|
747
|
-
&:active {
|
|
748
|
-
${(props) => props.pressStyle?.background && `background: ${props.pressStyle.background};`}
|
|
749
|
-
${(props) => props.pressStyle?.backgroundColor && `background-color: ${props.pressStyle.backgroundColor};`}
|
|
750
|
-
}
|
|
751
|
-
`;
|
|
752
|
-
var Box2 = React22.forwardRef(
|
|
753
|
-
({
|
|
754
|
-
children,
|
|
755
|
-
onPress,
|
|
756
|
-
onKeyDown,
|
|
757
|
-
onKeyUp,
|
|
758
|
-
role,
|
|
759
|
-
"aria-label": ariaLabel,
|
|
760
|
-
"aria-labelledby": ariaLabelledBy,
|
|
761
|
-
"aria-current": ariaCurrent,
|
|
762
|
-
"aria-disabled": ariaDisabled,
|
|
763
|
-
"aria-live": ariaLive,
|
|
764
|
-
"aria-busy": ariaBusy,
|
|
765
|
-
"aria-describedby": ariaDescribedBy,
|
|
766
|
-
"aria-expanded": ariaExpanded,
|
|
767
|
-
"aria-haspopup": ariaHasPopup,
|
|
768
|
-
"aria-pressed": ariaPressed,
|
|
769
|
-
"aria-controls": ariaControls,
|
|
770
|
-
tabIndex,
|
|
771
|
-
as,
|
|
772
|
-
src,
|
|
773
|
-
alt,
|
|
774
|
-
onError,
|
|
775
|
-
onLoad,
|
|
776
|
-
type,
|
|
777
|
-
disabled,
|
|
778
|
-
id,
|
|
779
|
-
testID,
|
|
780
|
-
"data-testid": dataTestId,
|
|
781
|
-
...props
|
|
782
|
-
}, ref) => {
|
|
783
|
-
if (as === "img" && src) {
|
|
784
|
-
return /* @__PURE__ */ jsx5(
|
|
785
|
-
"img",
|
|
786
|
-
{
|
|
787
|
-
src,
|
|
788
|
-
alt: alt || "",
|
|
789
|
-
onError,
|
|
790
|
-
onLoad,
|
|
791
|
-
"data-testid": dataTestId || testID,
|
|
792
|
-
style: {
|
|
793
|
-
display: "block",
|
|
794
|
-
objectFit: "cover",
|
|
795
|
-
width: typeof props.width === "number" ? `${props.width}px` : props.width,
|
|
796
|
-
height: typeof props.height === "number" ? `${props.height}px` : props.height,
|
|
797
|
-
borderRadius: typeof props.borderRadius === "number" ? `${props.borderRadius}px` : props.borderRadius,
|
|
798
|
-
position: props.position,
|
|
799
|
-
top: typeof props.top === "number" ? `${props.top}px` : props.top,
|
|
800
|
-
left: typeof props.left === "number" ? `${props.left}px` : props.left,
|
|
801
|
-
right: typeof props.right === "number" ? `${props.right}px` : props.right,
|
|
802
|
-
bottom: typeof props.bottom === "number" ? `${props.bottom}px` : props.bottom,
|
|
803
|
-
...props.style
|
|
804
|
-
}
|
|
805
|
-
}
|
|
806
|
-
);
|
|
807
|
-
}
|
|
808
|
-
return /* @__PURE__ */ jsx5(
|
|
809
|
-
StyledBox2,
|
|
810
|
-
{
|
|
811
|
-
ref,
|
|
812
|
-
elementType: as,
|
|
813
|
-
id,
|
|
814
|
-
type: as === "button" ? type || "button" : void 0,
|
|
815
|
-
disabled: as === "button" ? disabled : void 0,
|
|
816
|
-
onClick: onPress,
|
|
817
|
-
onKeyDown,
|
|
818
|
-
onKeyUp,
|
|
819
|
-
role,
|
|
820
|
-
"aria-label": ariaLabel,
|
|
821
|
-
"aria-labelledby": ariaLabelledBy,
|
|
822
|
-
"aria-current": ariaCurrent,
|
|
823
|
-
"aria-disabled": ariaDisabled,
|
|
824
|
-
"aria-busy": ariaBusy,
|
|
825
|
-
"aria-describedby": ariaDescribedBy,
|
|
826
|
-
"aria-expanded": ariaExpanded,
|
|
827
|
-
"aria-haspopup": ariaHasPopup,
|
|
828
|
-
"aria-pressed": ariaPressed,
|
|
829
|
-
"aria-controls": ariaControls,
|
|
830
|
-
"aria-live": ariaLive,
|
|
831
|
-
tabIndex: tabIndex !== void 0 ? tabIndex : void 0,
|
|
832
|
-
"data-testid": dataTestId || testID,
|
|
833
|
-
...props,
|
|
834
|
-
children
|
|
835
|
-
}
|
|
836
|
-
);
|
|
837
|
-
}
|
|
838
|
-
);
|
|
839
|
-
Box2.displayName = "Box";
|
|
840
|
-
var truncationStyles2 = (numberOfLines) => {
|
|
841
|
-
if (!numberOfLines || numberOfLines < 1) return "";
|
|
842
|
-
if (numberOfLines === 1) {
|
|
843
|
-
return `
|
|
844
|
-
display: block;
|
|
845
|
-
max-width: 100%;
|
|
846
|
-
min-width: 0;
|
|
847
|
-
overflow: hidden;
|
|
848
|
-
text-overflow: ellipsis;
|
|
849
|
-
white-space: nowrap;
|
|
850
|
-
`;
|
|
851
|
-
}
|
|
852
|
-
return `
|
|
853
|
-
display: -webkit-box;
|
|
854
|
-
-webkit-box-orient: vertical;
|
|
855
|
-
-webkit-line-clamp: ${numberOfLines};
|
|
856
|
-
line-clamp: ${numberOfLines};
|
|
857
|
-
max-width: 100%;
|
|
858
|
-
min-width: 0;
|
|
859
|
-
overflow: hidden;
|
|
860
|
-
`;
|
|
861
|
-
};
|
|
862
|
-
var FilteredSpan2 = createFilteredElement3("span");
|
|
863
|
-
var StyledText2 = styled22(FilteredSpan2)`
|
|
864
|
-
color: ${(props) => props.color || "inherit"};
|
|
865
|
-
font-size: ${(props) => typeof props.fontSize === "number" ? `${props.fontSize}px` : props.fontSize || "inherit"};
|
|
866
|
-
font-weight: ${(props) => props.fontWeight || "normal"};
|
|
867
|
-
font-family: ${(props) => props.fontFamily || '"Aktiv Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif'};
|
|
868
|
-
line-height: ${(props) => typeof props.lineHeight === "number" ? `${props.lineHeight}px` : props.lineHeight || "inherit"};
|
|
869
|
-
white-space: ${(props) => props.whiteSpace || "normal"};
|
|
870
|
-
text-align: ${(props) => props.textAlign || "inherit"};
|
|
871
|
-
text-decoration: ${(props) => props.textDecoration || "none"};
|
|
872
|
-
|
|
873
|
-
/* Keep last: single-line truncation has to win over white-space above. */
|
|
874
|
-
${(props) => truncationStyles2(props.numberOfLines)}
|
|
875
|
-
`;
|
|
876
|
-
var Text2 = ({
|
|
877
|
-
style,
|
|
878
|
-
className,
|
|
879
|
-
id,
|
|
880
|
-
role,
|
|
881
|
-
testID,
|
|
882
|
-
"data-testid": dataTestId,
|
|
883
|
-
...props
|
|
884
|
-
}) => {
|
|
885
|
-
return /* @__PURE__ */ jsx23(
|
|
886
|
-
StyledText2,
|
|
887
|
-
{
|
|
888
|
-
...props,
|
|
889
|
-
style,
|
|
890
|
-
className,
|
|
891
|
-
id,
|
|
892
|
-
role,
|
|
893
|
-
"data-testid": dataTestId || testID
|
|
894
|
-
}
|
|
895
|
-
);
|
|
896
|
-
};
|
|
897
|
-
var FilteredDiv22 = createFilteredElement3("div");
|
|
898
|
-
var StyledIcon3 = styled32(FilteredDiv22)`
|
|
899
|
-
display: flex;
|
|
900
|
-
align-items: center;
|
|
901
|
-
justify-content: center;
|
|
902
|
-
width: ${(props) => typeof props.size === "number" ? `${props.size}px` : props.size || "24px"};
|
|
903
|
-
height: ${(props) => typeof props.size === "number" ? `${props.size}px` : props.size || "24px"};
|
|
904
|
-
color: ${(props) => props.color || "currentColor"};
|
|
905
|
-
|
|
906
|
-
/* Icons paint themselves — each icon's own SVG sets its fill/stroke
|
|
907
|
-
(icons-base via inline "fill: currentColor", Lucide via "fill"/"stroke"
|
|
908
|
-
attributes). Do not add fill/stroke here: it re-strokes fill-based icons
|
|
909
|
-
and thickens the glyph. See FEP-877. */
|
|
910
|
-
svg {
|
|
911
|
-
width: 100%;
|
|
912
|
-
height: 100%;
|
|
913
|
-
}
|
|
914
|
-
`;
|
|
915
|
-
var Icon4 = ({
|
|
916
|
-
children,
|
|
917
|
-
testID,
|
|
918
|
-
"data-testid": dataTestId,
|
|
919
|
-
...props
|
|
920
|
-
}) => {
|
|
921
|
-
return /* @__PURE__ */ jsx32(StyledIcon3, { "data-testid": dataTestId || testID, ...props, children });
|
|
922
|
-
};
|
|
923
|
-
var Tag = ({
|
|
924
|
-
size = "md",
|
|
925
|
-
tone = "primary",
|
|
926
|
-
type = "solid",
|
|
927
|
-
children,
|
|
928
|
-
iconLeft,
|
|
929
|
-
iconRight,
|
|
930
|
-
onRemove,
|
|
931
|
-
testID,
|
|
932
|
-
themeMode,
|
|
933
|
-
themeProductContext
|
|
934
|
-
}) => {
|
|
935
|
-
const { theme } = useResolvedTheme({ themeMode, themeProductContext });
|
|
936
|
-
const sizeStyles = theme.sizing.tag(size);
|
|
937
|
-
const resolveColors = () => {
|
|
938
|
-
const isOutlined = type === "outlined";
|
|
939
|
-
switch (tone) {
|
|
940
|
-
case "primary":
|
|
941
|
-
return {
|
|
942
|
-
bg: isOutlined ? "transparent" : theme.colors.background.primary,
|
|
943
|
-
text: theme.colors.content.primary,
|
|
944
|
-
border: theme.colors.border.secondary
|
|
945
|
-
};
|
|
946
|
-
case "brand":
|
|
947
|
-
return {
|
|
948
|
-
bg: isOutlined ? "transparent" : theme.colors.background.brand.primary,
|
|
949
|
-
text: isOutlined ? theme.colors.content.brand.primary : theme.colors.content.on.brand,
|
|
950
|
-
border: theme.colors.border.brand
|
|
951
|
-
};
|
|
952
|
-
case "brandExtra":
|
|
953
|
-
return {
|
|
954
|
-
bg: isOutlined ? "transparent" : theme.colors.background.brandExtra.primary,
|
|
955
|
-
text: isOutlined ? theme.colors.content.brandExtra.primary : theme.colors.content.on.brandExtra,
|
|
956
|
-
border: theme.colors.border.brandExtra
|
|
957
|
-
};
|
|
958
|
-
case "success":
|
|
959
|
-
return {
|
|
960
|
-
bg: isOutlined ? "transparent" : theme.colors.background.success.primary,
|
|
961
|
-
text: isOutlined ? theme.colors.content.success.primary : theme.colors.content.on.success,
|
|
962
|
-
border: theme.colors.border.success
|
|
963
|
-
};
|
|
964
|
-
case "warning":
|
|
965
|
-
return {
|
|
966
|
-
bg: isOutlined ? "transparent" : theme.colors.background.warning.primary,
|
|
967
|
-
text: isOutlined ? theme.colors.content.warning.primary : theme.colors.content.on.warning,
|
|
968
|
-
border: theme.colors.border.warning
|
|
969
|
-
};
|
|
970
|
-
case "alert":
|
|
971
|
-
return {
|
|
972
|
-
bg: isOutlined ? "transparent" : theme.colors.background.alert.primary,
|
|
973
|
-
text: isOutlined ? theme.colors.content.alert.primary : theme.colors.content.on.alert,
|
|
974
|
-
border: theme.colors.border.alert
|
|
975
|
-
};
|
|
976
|
-
case "neutral":
|
|
977
|
-
return {
|
|
978
|
-
bg: isOutlined ? "transparent" : theme.colors.background.neutral.primary,
|
|
979
|
-
text: isOutlined ? theme.colors.content.neutral.primary : theme.colors.content.on.neutral,
|
|
980
|
-
border: theme.colors.border.neutral
|
|
981
|
-
};
|
|
982
|
-
default:
|
|
983
|
-
return {
|
|
984
|
-
bg: isOutlined ? "transparent" : theme.colors.background.primary,
|
|
985
|
-
text: theme.colors.content.primary,
|
|
986
|
-
border: theme.colors.border.secondary
|
|
987
|
-
};
|
|
988
|
-
}
|
|
989
|
-
};
|
|
990
|
-
const { bg, text, border } = resolveColors();
|
|
991
|
-
const isIconOnly = !children && (!!iconLeft || !!iconRight);
|
|
992
|
-
return /* @__PURE__ */ jsxs(
|
|
993
|
-
Box2,
|
|
994
|
-
{
|
|
995
|
-
testID,
|
|
996
|
-
backgroundColor: bg,
|
|
997
|
-
borderRadius: sizeStyles.radius,
|
|
998
|
-
height: sizeStyles.height,
|
|
999
|
-
width: isIconOnly ? sizeStyles.height : void 0,
|
|
1000
|
-
paddingHorizontal: isIconOnly ? 0 : sizeStyles.padding,
|
|
1001
|
-
flexDirection: "row",
|
|
1002
|
-
alignItems: "center",
|
|
1003
|
-
justifyContent: "center",
|
|
1004
|
-
gap: sizeStyles.gap,
|
|
1005
|
-
borderWidth: sizeStyles.borderWidth,
|
|
1006
|
-
borderColor: border,
|
|
1007
|
-
borderStyle: "solid",
|
|
1008
|
-
style: {
|
|
1009
|
-
overflow: "hidden",
|
|
1010
|
-
textOverflow: "ellipsis",
|
|
1011
|
-
whiteSpace: "nowrap"
|
|
1012
|
-
},
|
|
1013
|
-
children: [
|
|
1014
|
-
iconLeft && /* @__PURE__ */ jsx42(Icon4, { size: sizeStyles.iconSize, color: text, children: iconLeft }),
|
|
1015
|
-
children && /* @__PURE__ */ jsx42(
|
|
1016
|
-
Text2,
|
|
1017
|
-
{
|
|
1018
|
-
color: text,
|
|
1019
|
-
fontSize: sizeStyles.fontSize,
|
|
1020
|
-
fontWeight: "500",
|
|
1021
|
-
whiteSpace: "nowrap",
|
|
1022
|
-
style: {
|
|
1023
|
-
overflow: "hidden",
|
|
1024
|
-
textOverflow: "ellipsis"
|
|
1025
|
-
},
|
|
1026
|
-
children
|
|
1027
|
-
}
|
|
1028
|
-
),
|
|
1029
|
-
iconRight && /* @__PURE__ */ jsx42(Icon4, { size: sizeStyles.iconSize, color: text, children: iconRight }),
|
|
1030
|
-
onRemove && /* @__PURE__ */ jsx42(Box2, { onPress: onRemove, children: /* @__PURE__ */ jsx42(X2, { size: sizeStyles.iconSize, color: text }) })
|
|
1031
|
-
]
|
|
1032
|
-
}
|
|
1033
|
-
);
|
|
1034
|
-
};
|
|
1035
|
-
|
|
1036
|
-
// src/useMultiSelectControl.tsx
|
|
1037
|
-
import { useResolvedTheme as useResolvedTheme2 } from "@xsolla/xui-core";
|
|
1038
|
-
import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
401
|
+
import { jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
1039
402
|
var COUNT_ITEM_VALUE = "count-item";
|
|
1040
403
|
var useMultiSelectControl = ({
|
|
1041
404
|
variant,
|
|
@@ -1051,7 +414,7 @@ var useMultiSelectControl = ({
|
|
|
1051
414
|
themeMode,
|
|
1052
415
|
themeProductContext
|
|
1053
416
|
}) => {
|
|
1054
|
-
const { theme } =
|
|
417
|
+
const { theme } = useResolvedTheme({ themeMode, themeProductContext });
|
|
1055
418
|
const displayStateRef = useRef(0 /* Placeholder */);
|
|
1056
419
|
const savedWidthsRef = useRef(null);
|
|
1057
420
|
const itemsRef = useRef(null);
|
|
@@ -1107,7 +470,7 @@ var useMultiSelectControl = ({
|
|
|
1107
470
|
};
|
|
1108
471
|
const setPlaceholder = () => {
|
|
1109
472
|
setSelectedContent(
|
|
1110
|
-
/* @__PURE__ */
|
|
473
|
+
/* @__PURE__ */ jsx4(
|
|
1111
474
|
Text,
|
|
1112
475
|
{
|
|
1113
476
|
color: theme.colors.control.input.placeholder,
|
|
@@ -1154,11 +517,11 @@ var useMultiSelectControl = ({
|
|
|
1154
517
|
const countText = displayStateRef.current === 1 /* PreRender */ ? `+${itemsList.length}` : `+${itemsList.length - displayedItems.length}`;
|
|
1155
518
|
displayedItems.push({ value: COUNT_ITEM_VALUE, label: countText });
|
|
1156
519
|
}
|
|
1157
|
-
const content = displayedItems.map((item,
|
|
520
|
+
const content = displayedItems.map((item, index2) => {
|
|
1158
521
|
const isCount = item.value === COUNT_ITEM_VALUE;
|
|
1159
|
-
const isReducable =
|
|
522
|
+
const isReducable = index2 === 0 && displayStateRef.current === 3 /* Render */ && displayedItemsCount === 0 || flexible;
|
|
1160
523
|
if (variant === "tag") {
|
|
1161
|
-
return /* @__PURE__ */
|
|
524
|
+
return /* @__PURE__ */ jsx4(
|
|
1162
525
|
Box,
|
|
1163
526
|
{
|
|
1164
527
|
onPress: !isCount ? (e) => {
|
|
@@ -1170,7 +533,7 @@ var useMultiSelectControl = ({
|
|
|
1170
533
|
opacity: disabled ? 0.5 : 1,
|
|
1171
534
|
cursor: disabled || isCount ? "not-allowed" : "pointer"
|
|
1172
535
|
},
|
|
1173
|
-
children: /* @__PURE__ */
|
|
536
|
+
children: /* @__PURE__ */ jsx4(
|
|
1174
537
|
Tag,
|
|
1175
538
|
{
|
|
1176
539
|
size,
|
|
@@ -1187,8 +550,8 @@ var useMultiSelectControl = ({
|
|
|
1187
550
|
);
|
|
1188
551
|
}
|
|
1189
552
|
const isCountItem = hasHidden;
|
|
1190
|
-
const needsComma =
|
|
1191
|
-
return /* @__PURE__ */
|
|
553
|
+
const needsComma = index2 < displayedItems.length - 2 || index2 < displayedItems.length - 1 && !isCountItem;
|
|
554
|
+
return /* @__PURE__ */ jsxs(
|
|
1192
555
|
Text,
|
|
1193
556
|
{
|
|
1194
557
|
color: theme.colors.content.primary,
|
|
@@ -1223,11 +586,11 @@ var useMultiSelectControl = ({
|
|
|
1223
586
|
const countItemWidth = countEl.getBoundingClientRect().width;
|
|
1224
587
|
const columnGap = parseInt(getComputedStyle(itemsRef.current).columnGap || "0", 10) || 0;
|
|
1225
588
|
const tagsWidths = {};
|
|
1226
|
-
let
|
|
589
|
+
let index2 = 0;
|
|
1227
590
|
for (const el of allItems) {
|
|
1228
|
-
const key =
|
|
591
|
+
const key = index2 < allItems.length - 1 ? stateList[index2].value : COUNT_ITEM_VALUE;
|
|
1229
592
|
tagsWidths[key] = el.getBoundingClientRect().width;
|
|
1230
|
-
|
|
593
|
+
index2++;
|
|
1231
594
|
}
|
|
1232
595
|
savedWidthsRef.current = {
|
|
1233
596
|
tagsWidths,
|
|
@@ -1290,8 +653,8 @@ var useMultiSelectControl = ({
|
|
|
1290
653
|
};
|
|
1291
654
|
|
|
1292
655
|
// src/MultiSelectControl.tsx
|
|
1293
|
-
import { jsx as
|
|
1294
|
-
var MultiSelectControl =
|
|
656
|
+
import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
657
|
+
var MultiSelectControl = forwardRef(
|
|
1295
658
|
({
|
|
1296
659
|
variant = "tag",
|
|
1297
660
|
flexible = true,
|
|
@@ -1315,7 +678,7 @@ var MultiSelectControl = forwardRef3(
|
|
|
1315
678
|
themeMode,
|
|
1316
679
|
themeProductContext
|
|
1317
680
|
}, ref) => {
|
|
1318
|
-
const { theme } =
|
|
681
|
+
const { theme } = useResolvedTheme2({ themeMode, themeProductContext });
|
|
1319
682
|
const sizeStyles = theme.sizing.input(size);
|
|
1320
683
|
const inputColors = theme.colors.control.input;
|
|
1321
684
|
const state = externalState || (disabled ? "disable" : "default");
|
|
@@ -1350,7 +713,7 @@ var MultiSelectControl = forwardRef3(
|
|
|
1350
713
|
borderColor = inputColors.borderHover;
|
|
1351
714
|
}
|
|
1352
715
|
const iconColor = isDisable ? inputColors.textDisable : inputColors.placeholder;
|
|
1353
|
-
return /* @__PURE__ */
|
|
716
|
+
return /* @__PURE__ */ jsxs2(
|
|
1354
717
|
Box,
|
|
1355
718
|
{
|
|
1356
719
|
ref,
|
|
@@ -1378,7 +741,7 @@ var MultiSelectControl = forwardRef3(
|
|
|
1378
741
|
borderColor: inputColors.borderHover
|
|
1379
742
|
} : void 0,
|
|
1380
743
|
children: [
|
|
1381
|
-
/* @__PURE__ */
|
|
744
|
+
/* @__PURE__ */ jsxs2(
|
|
1382
745
|
Box,
|
|
1383
746
|
{
|
|
1384
747
|
ref: containerRef,
|
|
@@ -1388,8 +751,8 @@ var MultiSelectControl = forwardRef3(
|
|
|
1388
751
|
gap: 8,
|
|
1389
752
|
style: { minWidth: 0 },
|
|
1390
753
|
children: [
|
|
1391
|
-
iconLeft && /* @__PURE__ */
|
|
1392
|
-
/* @__PURE__ */
|
|
754
|
+
iconLeft && /* @__PURE__ */ jsx5(Icon, { size: sizeStyles.iconSize, color: iconColor, variant: "line", children: iconLeft }),
|
|
755
|
+
/* @__PURE__ */ jsx5(
|
|
1393
756
|
Box,
|
|
1394
757
|
{
|
|
1395
758
|
ref: itemsRef,
|
|
@@ -1405,8 +768,8 @@ var MultiSelectControl = forwardRef3(
|
|
|
1405
768
|
]
|
|
1406
769
|
}
|
|
1407
770
|
),
|
|
1408
|
-
/* @__PURE__ */
|
|
1409
|
-
extraClear && selectedItems.length > 0 && !isDisable && /* @__PURE__ */
|
|
771
|
+
/* @__PURE__ */ jsxs2(Box, { flexDirection: "row", alignItems: "center", gap: 4, children: [
|
|
772
|
+
extraClear && selectedItems.length > 0 && !isDisable && /* @__PURE__ */ jsx5(
|
|
1410
773
|
Box,
|
|
1411
774
|
{
|
|
1412
775
|
onPress: (e) => {
|
|
@@ -1414,11 +777,11 @@ var MultiSelectControl = forwardRef3(
|
|
|
1414
777
|
removeAllValues();
|
|
1415
778
|
},
|
|
1416
779
|
style: { cursor: "pointer" },
|
|
1417
|
-
children: /* @__PURE__ */
|
|
780
|
+
children: /* @__PURE__ */ jsx5(Remove, { size: 18, color: iconColor, variant: "line" })
|
|
1418
781
|
}
|
|
1419
782
|
),
|
|
1420
|
-
isError && /* @__PURE__ */
|
|
1421
|
-
iconRight ? iconRight : isOpen ? /* @__PURE__ */
|
|
783
|
+
isError && /* @__PURE__ */ jsx5(ExclamationMarkCr, { size: 18, color: theme.colors.content.alert.primary }),
|
|
784
|
+
iconRight ? iconRight : isOpen ? /* @__PURE__ */ jsx5(ChevronUp, { size: 18, color: iconColor, variant: "line" }) : /* @__PURE__ */ jsx5(ChevronDown, { size: 18, color: iconColor, variant: "line" })
|
|
1422
785
|
] })
|
|
1423
786
|
]
|
|
1424
787
|
}
|
|
@@ -1529,9 +892,9 @@ var Portal = ({ children }) => {
|
|
|
1529
892
|
};
|
|
1530
893
|
|
|
1531
894
|
// src/MultiSelect.tsx
|
|
1532
|
-
import { Fragment, jsx as
|
|
895
|
+
import { Fragment, jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1533
896
|
var EXTERNAL_MENU_MIN_WIDTH_DEFAULT = 540;
|
|
1534
|
-
var MultiSelect =
|
|
897
|
+
var MultiSelect = forwardRef2(
|
|
1535
898
|
({
|
|
1536
899
|
options,
|
|
1537
900
|
errorMessage,
|
|
@@ -1561,7 +924,7 @@ var MultiSelect = forwardRef4(
|
|
|
1561
924
|
themeMode,
|
|
1562
925
|
themeProductContext
|
|
1563
926
|
}, ref) => {
|
|
1564
|
-
const { theme } =
|
|
927
|
+
const { theme } = useResolvedTheme3({ themeMode, themeProductContext });
|
|
1565
928
|
const modalId = useModalId();
|
|
1566
929
|
const overlayLayer = useOverlayLayer();
|
|
1567
930
|
const controlRef = useRef4(null);
|
|
@@ -1685,8 +1048,8 @@ var MultiSelect = forwardRef4(
|
|
|
1685
1048
|
minWidth: menuMinWidth ?? EXTERNAL_MENU_MIN_WIDTH_DEFAULT,
|
|
1686
1049
|
boxSizing: "border-box"
|
|
1687
1050
|
} : void 0;
|
|
1688
|
-
const dropdown = dropdownMenu && isOpen && !isDisable && (!isWeb || menuPosition) && /* @__PURE__ */
|
|
1689
|
-
!isWeb && /* @__PURE__ */
|
|
1051
|
+
const dropdown = dropdownMenu && isOpen && !isDisable && (!isWeb || menuPosition) && /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
1052
|
+
!isWeb && /* @__PURE__ */ jsx6(
|
|
1690
1053
|
Box,
|
|
1691
1054
|
{
|
|
1692
1055
|
"data-modal-id": modalId,
|
|
@@ -1702,7 +1065,7 @@ var MultiSelect = forwardRef4(
|
|
|
1702
1065
|
onPress: onClose
|
|
1703
1066
|
}
|
|
1704
1067
|
),
|
|
1705
|
-
/* @__PURE__ */
|
|
1068
|
+
/* @__PURE__ */ jsxs3(
|
|
1706
1069
|
Box,
|
|
1707
1070
|
{
|
|
1708
1071
|
ref: menuRef,
|
|
@@ -1725,14 +1088,14 @@ var MultiSelect = forwardRef4(
|
|
|
1725
1088
|
boxShadow: theme.shadow.popover
|
|
1726
1089
|
},
|
|
1727
1090
|
children: [
|
|
1728
|
-
searchable && isWeb && /* @__PURE__ */
|
|
1091
|
+
searchable && isWeb && /* @__PURE__ */ jsx6(
|
|
1729
1092
|
Box,
|
|
1730
1093
|
{
|
|
1731
1094
|
paddingHorizontal: sizeStyles.paddingHorizontal,
|
|
1732
1095
|
paddingVertical: sizeStyles.paddingVertical,
|
|
1733
1096
|
borderBottomWidth: 1,
|
|
1734
1097
|
borderColor: theme.colors.border.secondary,
|
|
1735
|
-
children: /* @__PURE__ */
|
|
1098
|
+
children: /* @__PURE__ */ jsxs3(
|
|
1736
1099
|
Box,
|
|
1737
1100
|
{
|
|
1738
1101
|
flexDirection: "row",
|
|
@@ -1740,15 +1103,15 @@ var MultiSelect = forwardRef4(
|
|
|
1740
1103
|
gap: sizeStyles.paddingHorizontal / 2,
|
|
1741
1104
|
paddingHorizontal: 4,
|
|
1742
1105
|
children: [
|
|
1743
|
-
/* @__PURE__ */
|
|
1106
|
+
/* @__PURE__ */ jsx6(
|
|
1744
1107
|
Icon,
|
|
1745
1108
|
{
|
|
1746
1109
|
size: sizeStyles.iconSize - 2,
|
|
1747
1110
|
color: inputColors.placeholder,
|
|
1748
|
-
children: /* @__PURE__ */
|
|
1111
|
+
children: /* @__PURE__ */ jsx6(SearchIcon, {})
|
|
1749
1112
|
}
|
|
1750
1113
|
),
|
|
1751
|
-
/* @__PURE__ */
|
|
1114
|
+
/* @__PURE__ */ jsx6(
|
|
1752
1115
|
Box,
|
|
1753
1116
|
{
|
|
1754
1117
|
as: "input",
|
|
@@ -1775,7 +1138,7 @@ var MultiSelect = forwardRef4(
|
|
|
1775
1138
|
)
|
|
1776
1139
|
}
|
|
1777
1140
|
),
|
|
1778
|
-
/* @__PURE__ */
|
|
1141
|
+
/* @__PURE__ */ jsx6(
|
|
1779
1142
|
Box,
|
|
1780
1143
|
{
|
|
1781
1144
|
paddingVertical: 4,
|
|
@@ -1785,13 +1148,13 @@ var MultiSelect = forwardRef4(
|
|
|
1785
1148
|
overflowX: optionListOverflowX,
|
|
1786
1149
|
scrollbarWidth: "none"
|
|
1787
1150
|
},
|
|
1788
|
-
children: menuItems.length === 0 ? /* @__PURE__ */
|
|
1151
|
+
children: menuItems.length === 0 ? /* @__PURE__ */ jsx6(
|
|
1789
1152
|
Box,
|
|
1790
1153
|
{
|
|
1791
1154
|
paddingVertical: sizeStyles.paddingVertical * 2,
|
|
1792
1155
|
paddingHorizontal: sizeStyles.paddingHorizontal,
|
|
1793
1156
|
alignItems: "center",
|
|
1794
|
-
children: /* @__PURE__ */
|
|
1157
|
+
children: /* @__PURE__ */ jsx6(
|
|
1795
1158
|
Text,
|
|
1796
1159
|
{
|
|
1797
1160
|
color: theme.colors.content.tertiary,
|
|
@@ -1803,7 +1166,7 @@ var MultiSelect = forwardRef4(
|
|
|
1803
1166
|
) : menuItems.map((item, _index) => {
|
|
1804
1167
|
const brandColors = theme.colors.control.brand.primary;
|
|
1805
1168
|
const contentColors = theme.colors.content;
|
|
1806
|
-
return /* @__PURE__ */
|
|
1169
|
+
return /* @__PURE__ */ jsx6(
|
|
1807
1170
|
Box,
|
|
1808
1171
|
{
|
|
1809
1172
|
testID,
|
|
@@ -1826,7 +1189,7 @@ var MultiSelect = forwardRef4(
|
|
|
1826
1189
|
opacity: item.disabled ? 0.5 : 1,
|
|
1827
1190
|
minWidth: optionRowMinWidth
|
|
1828
1191
|
},
|
|
1829
|
-
children: /* @__PURE__ */
|
|
1192
|
+
children: /* @__PURE__ */ jsx6(
|
|
1830
1193
|
Text,
|
|
1831
1194
|
{
|
|
1832
1195
|
color: item.checked ? contentColors.on.brand : theme.colors.content.secondary,
|
|
@@ -1847,7 +1210,7 @@ var MultiSelect = forwardRef4(
|
|
|
1847
1210
|
}
|
|
1848
1211
|
)
|
|
1849
1212
|
] });
|
|
1850
|
-
return /* @__PURE__ */
|
|
1213
|
+
return /* @__PURE__ */ jsxs3(
|
|
1851
1214
|
Box,
|
|
1852
1215
|
{
|
|
1853
1216
|
ref: containerRef,
|
|
@@ -1856,7 +1219,7 @@ var MultiSelect = forwardRef4(
|
|
|
1856
1219
|
gap: sizeStyles.fieldGap,
|
|
1857
1220
|
style: externalFieldLayout,
|
|
1858
1221
|
children: [
|
|
1859
|
-
label && /* @__PURE__ */
|
|
1222
|
+
label && /* @__PURE__ */ jsx6(
|
|
1860
1223
|
Text,
|
|
1861
1224
|
{
|
|
1862
1225
|
color: theme.colors.content.secondary,
|
|
@@ -1865,7 +1228,7 @@ var MultiSelect = forwardRef4(
|
|
|
1865
1228
|
children: label
|
|
1866
1229
|
}
|
|
1867
1230
|
),
|
|
1868
|
-
/* @__PURE__ */
|
|
1231
|
+
/* @__PURE__ */ jsxs3(
|
|
1869
1232
|
Box,
|
|
1870
1233
|
{
|
|
1871
1234
|
ref,
|
|
@@ -1874,7 +1237,7 @@ var MultiSelect = forwardRef4(
|
|
|
1874
1237
|
...externalFieldLayout ? { width: "100%" } : {}
|
|
1875
1238
|
},
|
|
1876
1239
|
children: [
|
|
1877
|
-
/* @__PURE__ */
|
|
1240
|
+
/* @__PURE__ */ jsx6(
|
|
1878
1241
|
MultiSelectControl,
|
|
1879
1242
|
{
|
|
1880
1243
|
ref: controlRef,
|
|
@@ -1899,11 +1262,11 @@ var MultiSelect = forwardRef4(
|
|
|
1899
1262
|
extraClear
|
|
1900
1263
|
}
|
|
1901
1264
|
),
|
|
1902
|
-
isWeb ? /* @__PURE__ */
|
|
1265
|
+
isWeb ? /* @__PURE__ */ jsx6(Portal, { children: dropdown }) : dropdown
|
|
1903
1266
|
]
|
|
1904
1267
|
}
|
|
1905
1268
|
),
|
|
1906
|
-
errorMessage && /* @__PURE__ */
|
|
1269
|
+
errorMessage && /* @__PURE__ */ jsx6(
|
|
1907
1270
|
Text,
|
|
1908
1271
|
{
|
|
1909
1272
|
color: theme.colors.content.alert.primary,
|
|
@@ -1921,19 +1284,4 @@ MultiSelect.displayName = "MultiSelect";
|
|
|
1921
1284
|
export {
|
|
1922
1285
|
MultiSelect
|
|
1923
1286
|
};
|
|
1924
|
-
/*! Bundled license information:
|
|
1925
|
-
|
|
1926
|
-
lucide-react/dist/esm/shared/src/utils.js:
|
|
1927
|
-
lucide-react/dist/esm/defaultAttributes.js:
|
|
1928
|
-
lucide-react/dist/esm/Icon.js:
|
|
1929
|
-
lucide-react/dist/esm/createLucideIcon.js:
|
|
1930
|
-
lucide-react/dist/esm/icons/x.js:
|
|
1931
|
-
lucide-react/dist/esm/lucide-react.js:
|
|
1932
|
-
(**
|
|
1933
|
-
* @license lucide-react v0.470.0 - ISC
|
|
1934
|
-
*
|
|
1935
|
-
* This source code is licensed under the ISC license.
|
|
1936
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
1937
|
-
*)
|
|
1938
|
-
*/
|
|
1939
1287
|
//# sourceMappingURL=index.mjs.map
|