@xsolla/xui-select 0.89.0 → 0.90.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/native/index.js +49 -297
- package/native/index.js.map +1 -1
- package/native/index.mjs +31 -279
- package/native/index.mjs.map +1 -1
- package/package.json +4 -3
- package/web/index.js +49 -277
- package/web/index.js.map +1 -1
- package/web/index.mjs +32 -260
- package/web/index.mjs.map +1 -1
package/web/index.js
CHANGED
|
@@ -35,7 +35,7 @@ __export(index_exports, {
|
|
|
35
35
|
module.exports = __toCommonJS(index_exports);
|
|
36
36
|
|
|
37
37
|
// src/Select.tsx
|
|
38
|
-
var
|
|
38
|
+
var import_react2 = __toESM(require("react"));
|
|
39
39
|
|
|
40
40
|
// ../primitives-web/src/Box.tsx
|
|
41
41
|
var import_react = __toESM(require("react"));
|
|
@@ -238,54 +238,10 @@ var Text = ({
|
|
|
238
238
|
);
|
|
239
239
|
};
|
|
240
240
|
|
|
241
|
-
// ../primitives-web/src/
|
|
241
|
+
// ../primitives-web/src/Icon.tsx
|
|
242
242
|
var import_styled_components3 = __toESM(require("styled-components"));
|
|
243
243
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
244
|
-
var
|
|
245
|
-
from {
|
|
246
|
-
transform: rotate(0deg);
|
|
247
|
-
}
|
|
248
|
-
to {
|
|
249
|
-
transform: rotate(360deg);
|
|
250
|
-
}
|
|
251
|
-
`;
|
|
252
|
-
var StyledSpinner = import_styled_components3.default.div`
|
|
253
|
-
width: ${(props) => typeof props.size === "number" ? `${props.size}px` : props.size || "24px"};
|
|
254
|
-
height: ${(props) => typeof props.size === "number" ? `${props.size}px` : props.size || "24px"};
|
|
255
|
-
border: ${(props) => props.strokeWidth || 2}px solid
|
|
256
|
-
${(props) => props.color || "currentColor"};
|
|
257
|
-
border-bottom-color: transparent;
|
|
258
|
-
border-radius: 50%;
|
|
259
|
-
display: inline-block;
|
|
260
|
-
box-sizing: border-box;
|
|
261
|
-
animation: ${rotate} 1s linear infinite;
|
|
262
|
-
`;
|
|
263
|
-
var Spinner = ({
|
|
264
|
-
role = "status",
|
|
265
|
-
"aria-label": ariaLabel,
|
|
266
|
-
"aria-live": ariaLive = "polite",
|
|
267
|
-
"aria-describedby": ariaDescribedBy,
|
|
268
|
-
testID,
|
|
269
|
-
...props
|
|
270
|
-
}) => {
|
|
271
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
272
|
-
StyledSpinner,
|
|
273
|
-
{
|
|
274
|
-
role,
|
|
275
|
-
"aria-label": ariaLabel,
|
|
276
|
-
"aria-live": ariaLive,
|
|
277
|
-
"aria-describedby": ariaDescribedBy,
|
|
278
|
-
"data-testid": testID,
|
|
279
|
-
...props
|
|
280
|
-
}
|
|
281
|
-
);
|
|
282
|
-
};
|
|
283
|
-
Spinner.displayName = "Spinner";
|
|
284
|
-
|
|
285
|
-
// ../primitives-web/src/Icon.tsx
|
|
286
|
-
var import_styled_components4 = __toESM(require("styled-components"));
|
|
287
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
288
|
-
var StyledIcon = import_styled_components4.default.div`
|
|
244
|
+
var StyledIcon = import_styled_components3.default.div`
|
|
289
245
|
display: flex;
|
|
290
246
|
align-items: center;
|
|
291
247
|
justify-content: center;
|
|
@@ -301,197 +257,13 @@ var StyledIcon = import_styled_components4.default.div`
|
|
|
301
257
|
}
|
|
302
258
|
`;
|
|
303
259
|
var Icon = ({ children, ...props }) => {
|
|
304
|
-
return /* @__PURE__ */ (0,
|
|
260
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(StyledIcon, { ...props, children });
|
|
305
261
|
};
|
|
306
262
|
|
|
307
|
-
// ../primitives-web/src/Divider.tsx
|
|
308
|
-
var import_styled_components5 = __toESM(require("styled-components"));
|
|
309
|
-
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
310
|
-
var StyledDivider = import_styled_components5.default.div`
|
|
311
|
-
background-color: ${(props) => props.dashStroke ? "transparent" : props.color || "rgba(255, 255, 255, 0.15)"};
|
|
312
|
-
width: ${(props) => props.vertical ? typeof props.width === "number" ? `${props.width}px` : props.width || "1px" : "100%"};
|
|
313
|
-
height: ${(props) => props.vertical ? "100%" : typeof props.height === "number" ? `${props.height}px` : props.height || "1px"};
|
|
314
|
-
|
|
315
|
-
${(props) => props.dashStroke && `
|
|
316
|
-
border-style: dashed;
|
|
317
|
-
border-color: ${props.color || "rgba(255, 255, 255, 0.15)"};
|
|
318
|
-
border-width: 0;
|
|
319
|
-
${props.vertical ? `
|
|
320
|
-
border-left-width: ${typeof props.width === "number" ? `${props.width}px` : props.width || "1px"};
|
|
321
|
-
height: 100%;
|
|
322
|
-
` : `
|
|
323
|
-
border-top-width: ${typeof props.height === "number" ? `${props.height}px` : props.height || "1px"};
|
|
324
|
-
width: 100%;
|
|
325
|
-
`}
|
|
326
|
-
`}
|
|
327
|
-
`;
|
|
328
|
-
|
|
329
|
-
// ../primitives-web/src/Input.tsx
|
|
330
|
-
var import_react2 = require("react");
|
|
331
|
-
var import_styled_components6 = __toESM(require("styled-components"));
|
|
332
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
333
|
-
var StyledInput = import_styled_components6.default.input`
|
|
334
|
-
background: transparent;
|
|
335
|
-
border: none;
|
|
336
|
-
outline: none;
|
|
337
|
-
width: 100%;
|
|
338
|
-
height: 100%;
|
|
339
|
-
padding: 0;
|
|
340
|
-
margin: 0;
|
|
341
|
-
color: ${(props) => props.color || "inherit"};
|
|
342
|
-
font-size: ${(props) => typeof props.fontSize === "number" ? `${props.fontSize}px` : props.fontSize || "inherit"};
|
|
343
|
-
font-family: inherit;
|
|
344
|
-
text-align: inherit;
|
|
345
|
-
|
|
346
|
-
&::placeholder {
|
|
347
|
-
color: ${(props) => props.placeholderTextColor || "rgba(255, 255, 255, 0.5)"};
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
&:disabled {
|
|
351
|
-
cursor: not-allowed;
|
|
352
|
-
}
|
|
353
|
-
`;
|
|
354
|
-
var InputPrimitive = (0, import_react2.forwardRef)(
|
|
355
|
-
({
|
|
356
|
-
value,
|
|
357
|
-
placeholder,
|
|
358
|
-
onChange,
|
|
359
|
-
onChangeText,
|
|
360
|
-
onFocus,
|
|
361
|
-
onBlur,
|
|
362
|
-
onKeyDown,
|
|
363
|
-
disabled,
|
|
364
|
-
secureTextEntry,
|
|
365
|
-
style,
|
|
366
|
-
color,
|
|
367
|
-
fontSize,
|
|
368
|
-
placeholderTextColor,
|
|
369
|
-
maxLength,
|
|
370
|
-
name,
|
|
371
|
-
type,
|
|
372
|
-
inputMode,
|
|
373
|
-
autoComplete,
|
|
374
|
-
id,
|
|
375
|
-
"aria-invalid": ariaInvalid,
|
|
376
|
-
"aria-describedby": ariaDescribedBy,
|
|
377
|
-
"aria-labelledby": ariaLabelledBy,
|
|
378
|
-
"aria-label": ariaLabel,
|
|
379
|
-
"aria-disabled": ariaDisabled,
|
|
380
|
-
"data-testid": dataTestId,
|
|
381
|
-
...rest
|
|
382
|
-
}, ref) => {
|
|
383
|
-
const handleChange = (e) => {
|
|
384
|
-
if (onChange) {
|
|
385
|
-
onChange(e);
|
|
386
|
-
}
|
|
387
|
-
if (onChangeText) {
|
|
388
|
-
onChangeText(e.target.value);
|
|
389
|
-
}
|
|
390
|
-
};
|
|
391
|
-
const inputValue = value !== void 0 ? value : "";
|
|
392
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
393
|
-
StyledInput,
|
|
394
|
-
{
|
|
395
|
-
ref,
|
|
396
|
-
id,
|
|
397
|
-
value: inputValue,
|
|
398
|
-
name,
|
|
399
|
-
placeholder,
|
|
400
|
-
onChange: handleChange,
|
|
401
|
-
onFocus,
|
|
402
|
-
onBlur,
|
|
403
|
-
onKeyDown,
|
|
404
|
-
disabled,
|
|
405
|
-
type: secureTextEntry ? "password" : type || "text",
|
|
406
|
-
inputMode,
|
|
407
|
-
autoComplete,
|
|
408
|
-
style,
|
|
409
|
-
color,
|
|
410
|
-
fontSize,
|
|
411
|
-
placeholderTextColor,
|
|
412
|
-
maxLength,
|
|
413
|
-
"aria-invalid": ariaInvalid,
|
|
414
|
-
"aria-describedby": ariaDescribedBy,
|
|
415
|
-
"aria-labelledby": ariaLabelledBy,
|
|
416
|
-
"aria-label": ariaLabel,
|
|
417
|
-
"aria-disabled": ariaDisabled,
|
|
418
|
-
"data-testid": dataTestId,
|
|
419
|
-
...rest
|
|
420
|
-
}
|
|
421
|
-
);
|
|
422
|
-
}
|
|
423
|
-
);
|
|
424
|
-
InputPrimitive.displayName = "InputPrimitive";
|
|
425
|
-
|
|
426
|
-
// ../primitives-web/src/TextArea.tsx
|
|
427
|
-
var import_react3 = require("react");
|
|
428
|
-
var import_styled_components7 = __toESM(require("styled-components"));
|
|
429
|
-
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
430
|
-
var StyledTextArea = import_styled_components7.default.textarea`
|
|
431
|
-
background: transparent;
|
|
432
|
-
border: none;
|
|
433
|
-
outline: none;
|
|
434
|
-
width: 100%;
|
|
435
|
-
height: 100%;
|
|
436
|
-
padding: 0;
|
|
437
|
-
margin: 0;
|
|
438
|
-
color: ${(props) => props.color || "inherit"};
|
|
439
|
-
font-size: ${(props) => typeof props.fontSize === "number" ? `${props.fontSize}px` : props.fontSize || "inherit"};
|
|
440
|
-
font-family: inherit;
|
|
441
|
-
text-align: inherit;
|
|
442
|
-
resize: none;
|
|
443
|
-
|
|
444
|
-
&::placeholder {
|
|
445
|
-
color: ${(props) => props.placeholderTextColor || "rgba(255, 255, 255, 0.5)"};
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
&:disabled {
|
|
449
|
-
cursor: not-allowed;
|
|
450
|
-
}
|
|
451
|
-
`;
|
|
452
|
-
var TextAreaPrimitive = (0, import_react3.forwardRef)(
|
|
453
|
-
({
|
|
454
|
-
value,
|
|
455
|
-
placeholder,
|
|
456
|
-
onChangeText,
|
|
457
|
-
onFocus,
|
|
458
|
-
onBlur,
|
|
459
|
-
onKeyDown,
|
|
460
|
-
disabled,
|
|
461
|
-
style,
|
|
462
|
-
color,
|
|
463
|
-
fontSize,
|
|
464
|
-
placeholderTextColor,
|
|
465
|
-
maxLength,
|
|
466
|
-
rows
|
|
467
|
-
}, ref) => {
|
|
468
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
469
|
-
StyledTextArea,
|
|
470
|
-
{
|
|
471
|
-
ref,
|
|
472
|
-
value,
|
|
473
|
-
placeholder,
|
|
474
|
-
onChange: (e) => onChangeText?.(e.target.value),
|
|
475
|
-
onFocus,
|
|
476
|
-
onBlur,
|
|
477
|
-
onKeyDown,
|
|
478
|
-
disabled,
|
|
479
|
-
style,
|
|
480
|
-
color,
|
|
481
|
-
fontSize,
|
|
482
|
-
placeholderTextColor,
|
|
483
|
-
maxLength,
|
|
484
|
-
rows
|
|
485
|
-
}
|
|
486
|
-
);
|
|
487
|
-
}
|
|
488
|
-
);
|
|
489
|
-
TextAreaPrimitive.displayName = "TextAreaPrimitive";
|
|
490
|
-
|
|
491
263
|
// src/Select.tsx
|
|
492
264
|
var import_xui_core = require("@xsolla/xui-core");
|
|
493
|
-
var
|
|
494
|
-
var ChevronDown = () => /* @__PURE__ */ (0,
|
|
265
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
266
|
+
var ChevronDown = () => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
495
267
|
"svg",
|
|
496
268
|
{
|
|
497
269
|
width: "100%",
|
|
@@ -499,7 +271,7 @@ var ChevronDown = () => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
|
499
271
|
viewBox: "0 0 18 18",
|
|
500
272
|
fill: "none",
|
|
501
273
|
xmlns: "http://www.w3.org/2000/svg",
|
|
502
|
-
children: /* @__PURE__ */ (0,
|
|
274
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
503
275
|
"path",
|
|
504
276
|
{
|
|
505
277
|
d: "M4.5 6.75L9 11.25L13.5 6.75",
|
|
@@ -511,7 +283,7 @@ var ChevronDown = () => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
|
511
283
|
)
|
|
512
284
|
}
|
|
513
285
|
);
|
|
514
|
-
var ChevronUp = () => /* @__PURE__ */ (0,
|
|
286
|
+
var ChevronUp = () => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
515
287
|
"svg",
|
|
516
288
|
{
|
|
517
289
|
width: "100%",
|
|
@@ -519,7 +291,7 @@ var ChevronUp = () => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
|
519
291
|
viewBox: "0 0 18 18",
|
|
520
292
|
fill: "none",
|
|
521
293
|
xmlns: "http://www.w3.org/2000/svg",
|
|
522
|
-
children: /* @__PURE__ */ (0,
|
|
294
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
523
295
|
"path",
|
|
524
296
|
{
|
|
525
297
|
d: "M13.5 11.25L9 6.75L4.5 11.25",
|
|
@@ -531,7 +303,7 @@ var ChevronUp = () => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
|
531
303
|
)
|
|
532
304
|
}
|
|
533
305
|
);
|
|
534
|
-
var ExclamationMarkCr = () => /* @__PURE__ */ (0,
|
|
306
|
+
var ExclamationMarkCr = () => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
535
307
|
"svg",
|
|
536
308
|
{
|
|
537
309
|
width: "100%",
|
|
@@ -541,15 +313,15 @@ var ExclamationMarkCr = () => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
|
541
313
|
style: { stroke: "none" },
|
|
542
314
|
xmlns: "http://www.w3.org/2000/svg",
|
|
543
315
|
children: [
|
|
544
|
-
/* @__PURE__ */ (0,
|
|
316
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
545
317
|
"path",
|
|
546
318
|
{
|
|
547
319
|
d: "M9.75 12.75C9.75 13.16 9.41 13.5 9 13.5C8.59 13.5 8.25 13.16 8.25 12.75C8.25 12.34 8.59 12 9 12C9.41 12 9.75 12.34 9.75 12.75Z",
|
|
548
320
|
fill: "currentColor"
|
|
549
321
|
}
|
|
550
322
|
),
|
|
551
|
-
/* @__PURE__ */ (0,
|
|
552
|
-
/* @__PURE__ */ (0,
|
|
323
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M9.75 10.5H8.25V4.5H9.75V10.5Z", fill: "currentColor" }),
|
|
324
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
553
325
|
"path",
|
|
554
326
|
{
|
|
555
327
|
fillRule: "evenodd",
|
|
@@ -561,7 +333,7 @@ var ExclamationMarkCr = () => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
|
561
333
|
]
|
|
562
334
|
}
|
|
563
335
|
);
|
|
564
|
-
var SearchIcon = () => /* @__PURE__ */ (0,
|
|
336
|
+
var SearchIcon = () => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
565
337
|
"svg",
|
|
566
338
|
{
|
|
567
339
|
width: "100%",
|
|
@@ -570,7 +342,7 @@ var SearchIcon = () => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
|
570
342
|
fill: "none",
|
|
571
343
|
xmlns: "http://www.w3.org/2000/svg",
|
|
572
344
|
children: [
|
|
573
|
-
/* @__PURE__ */ (0,
|
|
345
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
574
346
|
"path",
|
|
575
347
|
{
|
|
576
348
|
d: "M8.25 14.25C11.5637 14.25 14.25 11.5637 14.25 8.25C14.25 4.93629 11.5637 2.25 8.25 2.25C4.93629 2.25 2.25 4.93629 2.25 8.25C2.25 11.5637 4.93629 14.25 8.25 14.25Z",
|
|
@@ -580,7 +352,7 @@ var SearchIcon = () => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
|
580
352
|
strokeLinejoin: "round"
|
|
581
353
|
}
|
|
582
354
|
),
|
|
583
|
-
/* @__PURE__ */ (0,
|
|
355
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
584
356
|
"path",
|
|
585
357
|
{
|
|
586
358
|
d: "M15.75 15.75L12.4875 12.4875",
|
|
@@ -614,22 +386,22 @@ var Select = ({
|
|
|
614
386
|
maxHeight = 300
|
|
615
387
|
}) => {
|
|
616
388
|
const { theme } = (0, import_xui_core.useDesignSystem)();
|
|
617
|
-
const [isOpen, setIsOpen] = (0,
|
|
618
|
-
const [selectedValue, setSelectedValue] = (0,
|
|
619
|
-
const [searchValue, setSearchValue] = (0,
|
|
620
|
-
const containerRef = (0,
|
|
621
|
-
const dropdownRef = (0,
|
|
622
|
-
const selectedItemRef = (0,
|
|
623
|
-
const searchInputRef = (0,
|
|
389
|
+
const [isOpen, setIsOpen] = (0, import_react2.useState)(false);
|
|
390
|
+
const [selectedValue, setSelectedValue] = (0, import_react2.useState)(value);
|
|
391
|
+
const [searchValue, setSearchValue] = (0, import_react2.useState)("");
|
|
392
|
+
const containerRef = (0, import_react2.useRef)(null);
|
|
393
|
+
const dropdownRef = (0, import_react2.useRef)(null);
|
|
394
|
+
const selectedItemRef = (0, import_react2.useRef)(null);
|
|
395
|
+
const searchInputRef = (0, import_react2.useRef)(null);
|
|
624
396
|
const isDisable = externalState === "disable" || disabled;
|
|
625
397
|
const isError = externalState === "error" || !!errorMessage;
|
|
626
398
|
const isFocus = externalState === "focus" || isOpen;
|
|
627
|
-
|
|
399
|
+
import_react2.default.useEffect(() => {
|
|
628
400
|
if (value !== void 0) {
|
|
629
401
|
setSelectedValue(value);
|
|
630
402
|
}
|
|
631
403
|
}, [value]);
|
|
632
|
-
(0,
|
|
404
|
+
(0, import_react2.useEffect)(() => {
|
|
633
405
|
if (isFocus && selectedItemRef.current && dropdownRef.current) {
|
|
634
406
|
const timeoutId = setTimeout(() => {
|
|
635
407
|
const selectedItem = selectedItemRef.current;
|
|
@@ -640,17 +412,17 @@ var Select = ({
|
|
|
640
412
|
return () => clearTimeout(timeoutId);
|
|
641
413
|
}
|
|
642
414
|
}, [isFocus]);
|
|
643
|
-
(0,
|
|
415
|
+
(0, import_react2.useEffect)(() => {
|
|
644
416
|
if (isFocus && searchable) {
|
|
645
417
|
searchInputRef.current?.focus();
|
|
646
418
|
}
|
|
647
419
|
}, [isFocus, searchable]);
|
|
648
|
-
(0,
|
|
420
|
+
(0, import_react2.useEffect)(() => {
|
|
649
421
|
if (!isFocus) {
|
|
650
422
|
setSearchValue("");
|
|
651
423
|
}
|
|
652
424
|
}, [isFocus]);
|
|
653
|
-
(0,
|
|
425
|
+
(0, import_react2.useEffect)(() => {
|
|
654
426
|
if (import_xui_core.isNative || !isOpen) return;
|
|
655
427
|
const handleClickOutside = (event) => {
|
|
656
428
|
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
@@ -714,7 +486,7 @@ var Select = ({
|
|
|
714
486
|
) : placeholder;
|
|
715
487
|
const textColor = isDisable ? inputColors.textDisable : selectedValue ? inputColors.text : inputColors.placeholder;
|
|
716
488
|
const iconColor = isDisable ? inputColors.textDisable : inputColors.text;
|
|
717
|
-
return /* @__PURE__ */ (0,
|
|
489
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
718
490
|
Box,
|
|
719
491
|
{
|
|
720
492
|
ref: containerRef,
|
|
@@ -723,7 +495,7 @@ var Select = ({
|
|
|
723
495
|
width: "100%",
|
|
724
496
|
position: "relative",
|
|
725
497
|
children: [
|
|
726
|
-
label && /* @__PURE__ */ (0,
|
|
498
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
727
499
|
Text,
|
|
728
500
|
{
|
|
729
501
|
color: theme.colors.content.secondary,
|
|
@@ -732,7 +504,7 @@ var Select = ({
|
|
|
732
504
|
children: label
|
|
733
505
|
}
|
|
734
506
|
),
|
|
735
|
-
/* @__PURE__ */ (0,
|
|
507
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
736
508
|
Box,
|
|
737
509
|
{
|
|
738
510
|
onPress: handlePress,
|
|
@@ -753,8 +525,8 @@ var Select = ({
|
|
|
753
525
|
borderColor: inputColors.borderHover
|
|
754
526
|
} : void 0,
|
|
755
527
|
children: [
|
|
756
|
-
iconLeft && /* @__PURE__ */ (0,
|
|
757
|
-
!iconOnly && /* @__PURE__ */ (0,
|
|
528
|
+
iconLeft && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Box, { alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { size: sizeStyles.iconSize, color: iconColor, children: iconLeft }) }),
|
|
529
|
+
!iconOnly && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Box, { flex: 1, height: "100%", justifyContent: "center", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
758
530
|
Text,
|
|
759
531
|
{
|
|
760
532
|
color: textColor,
|
|
@@ -763,21 +535,21 @@ var Select = ({
|
|
|
763
535
|
children: currentLabel
|
|
764
536
|
}
|
|
765
537
|
) }),
|
|
766
|
-
/* @__PURE__ */ (0,
|
|
767
|
-
isError && /* @__PURE__ */ (0,
|
|
538
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Box, { flexDirection: "row", alignItems: "center", gap: 4, children: [
|
|
539
|
+
isError && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
768
540
|
Icon,
|
|
769
541
|
{
|
|
770
542
|
size: sizeStyles.iconSize,
|
|
771
543
|
color: theme.colors.content.alert.primary,
|
|
772
|
-
children: /* @__PURE__ */ (0,
|
|
544
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ExclamationMarkCr, {})
|
|
773
545
|
}
|
|
774
546
|
),
|
|
775
|
-
/* @__PURE__ */ (0,
|
|
547
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { size: sizeStyles.iconSize, color: iconColor, children: iconRight !== void 0 ? iconRight : isFocus ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ChevronUp, {}) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ChevronDown, {}) })
|
|
776
548
|
] })
|
|
777
549
|
]
|
|
778
550
|
}
|
|
779
551
|
),
|
|
780
|
-
isFocus && options.length > 0 && /* @__PURE__ */ (0,
|
|
552
|
+
isFocus && options.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
781
553
|
Box,
|
|
782
554
|
{
|
|
783
555
|
ref: dropdownRef,
|
|
@@ -794,14 +566,14 @@ var Select = ({
|
|
|
794
566
|
minWidth: iconOnly ? sizeStyles.height * 3 : void 0
|
|
795
567
|
},
|
|
796
568
|
children: [
|
|
797
|
-
searchable && /* @__PURE__ */ (0,
|
|
569
|
+
searchable && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
798
570
|
Box,
|
|
799
571
|
{
|
|
800
572
|
paddingHorizontal: sizeStyles.paddingHorizontal,
|
|
801
573
|
paddingVertical: sizeStyles.paddingVertical,
|
|
802
574
|
borderBottomWidth: 1,
|
|
803
575
|
borderColor: theme.colors.border.secondary,
|
|
804
|
-
children: /* @__PURE__ */ (0,
|
|
576
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
805
577
|
Box,
|
|
806
578
|
{
|
|
807
579
|
flexDirection: "row",
|
|
@@ -809,15 +581,15 @@ var Select = ({
|
|
|
809
581
|
gap: sizeStyles.paddingHorizontal / 2,
|
|
810
582
|
paddingHorizontal: 4,
|
|
811
583
|
children: [
|
|
812
|
-
/* @__PURE__ */ (0,
|
|
584
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
813
585
|
Icon,
|
|
814
586
|
{
|
|
815
587
|
size: sizeStyles.iconSize - 2,
|
|
816
588
|
color: inputColors.placeholder,
|
|
817
|
-
children: /* @__PURE__ */ (0,
|
|
589
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SearchIcon, {})
|
|
818
590
|
}
|
|
819
591
|
),
|
|
820
|
-
/* @__PURE__ */ (0,
|
|
592
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
821
593
|
Box,
|
|
822
594
|
{
|
|
823
595
|
as: "input",
|
|
@@ -842,7 +614,7 @@ var Select = ({
|
|
|
842
614
|
)
|
|
843
615
|
}
|
|
844
616
|
),
|
|
845
|
-
/* @__PURE__ */ (0,
|
|
617
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
846
618
|
Box,
|
|
847
619
|
{
|
|
848
620
|
paddingVertical: 4,
|
|
@@ -850,13 +622,13 @@ var Select = ({
|
|
|
850
622
|
maxHeight: searchable ? maxHeight - 60 : maxHeight,
|
|
851
623
|
overflowY: "auto"
|
|
852
624
|
},
|
|
853
|
-
children: filteredOptions.length === 0 ? /* @__PURE__ */ (0,
|
|
625
|
+
children: filteredOptions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
854
626
|
Box,
|
|
855
627
|
{
|
|
856
628
|
paddingVertical: sizeStyles.paddingVertical * 2,
|
|
857
629
|
paddingHorizontal: sizeStyles.paddingHorizontal,
|
|
858
630
|
alignItems: "center",
|
|
859
|
-
children: /* @__PURE__ */ (0,
|
|
631
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
860
632
|
Text,
|
|
861
633
|
{
|
|
862
634
|
color: theme.colors.content.tertiary,
|
|
@@ -872,7 +644,7 @@ var Select = ({
|
|
|
872
644
|
const isSelected = optionValue === selectedValue;
|
|
873
645
|
const brandColors = theme.colors.control.brand.primary;
|
|
874
646
|
const contentColors = theme.colors.content;
|
|
875
|
-
return /* @__PURE__ */ (0,
|
|
647
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
876
648
|
Box,
|
|
877
649
|
{
|
|
878
650
|
ref: isSelected ? selectedItemRef : void 0,
|
|
@@ -890,7 +662,7 @@ var Select = ({
|
|
|
890
662
|
hoverStyle: !isSelected && !isOptionDisabled ? {
|
|
891
663
|
backgroundColor: theme.colors.control.input.bgHover
|
|
892
664
|
} : void 0,
|
|
893
|
-
children: /* @__PURE__ */ (0,
|
|
665
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
894
666
|
Text,
|
|
895
667
|
{
|
|
896
668
|
color: isSelected ? contentColors.on.brand : theme.colors.content.secondary,
|
|
@@ -908,7 +680,7 @@ var Select = ({
|
|
|
908
680
|
]
|
|
909
681
|
}
|
|
910
682
|
),
|
|
911
|
-
isError && errorMessage && /* @__PURE__ */ (0,
|
|
683
|
+
isError && errorMessage && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
912
684
|
Text,
|
|
913
685
|
{
|
|
914
686
|
color: theme.colors.content.alert.primary,
|