@xsolla/xui-select 0.89.0 → 0.91.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/native/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-native/src/Box.tsx
|
|
41
41
|
var import_react_native = require("react-native");
|
|
@@ -238,41 +238,10 @@ var Text = ({
|
|
|
238
238
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_native2.Text, { style, testID: id, accessibilityRole, children });
|
|
239
239
|
};
|
|
240
240
|
|
|
241
|
-
// ../primitives-native/src/Spinner.tsx
|
|
242
|
-
var import_react_native3 = require("react-native");
|
|
243
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
244
|
-
var Spinner = ({
|
|
245
|
-
color,
|
|
246
|
-
size,
|
|
247
|
-
role,
|
|
248
|
-
"aria-label": ariaLabel,
|
|
249
|
-
"aria-live": ariaLive,
|
|
250
|
-
testID
|
|
251
|
-
}) => {
|
|
252
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
253
|
-
import_react_native3.View,
|
|
254
|
-
{
|
|
255
|
-
accessible: true,
|
|
256
|
-
accessibilityRole: role === "status" ? "none" : void 0,
|
|
257
|
-
accessibilityLabel: ariaLabel,
|
|
258
|
-
accessibilityLiveRegion: ariaLive === "polite" ? "polite" : ariaLive === "assertive" ? "assertive" : "none",
|
|
259
|
-
testID,
|
|
260
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
261
|
-
import_react_native3.ActivityIndicator,
|
|
262
|
-
{
|
|
263
|
-
color,
|
|
264
|
-
size: typeof size === "number" ? size : "small"
|
|
265
|
-
}
|
|
266
|
-
)
|
|
267
|
-
}
|
|
268
|
-
);
|
|
269
|
-
};
|
|
270
|
-
Spinner.displayName = "Spinner";
|
|
271
|
-
|
|
272
241
|
// ../primitives-native/src/Icon.tsx
|
|
273
242
|
var import_react = __toESM(require("react"));
|
|
274
|
-
var
|
|
275
|
-
var
|
|
243
|
+
var import_react_native3 = require("react-native");
|
|
244
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
276
245
|
var Icon = ({ children, color, size }) => {
|
|
277
246
|
const style = {
|
|
278
247
|
width: typeof size === "number" ? size : void 0,
|
|
@@ -290,230 +259,13 @@ var Icon = ({ children, color, size }) => {
|
|
|
290
259
|
}
|
|
291
260
|
return child;
|
|
292
261
|
});
|
|
293
|
-
return /* @__PURE__ */ (0,
|
|
262
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.View, { style, children: childrenWithProps });
|
|
294
263
|
};
|
|
295
264
|
|
|
296
|
-
// ../primitives-native/src/Divider.tsx
|
|
297
|
-
var import_react_native5 = require("react-native");
|
|
298
|
-
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
299
|
-
|
|
300
|
-
// ../primitives-native/src/Input.tsx
|
|
301
|
-
var import_react2 = require("react");
|
|
302
|
-
var import_react_native6 = require("react-native");
|
|
303
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
304
|
-
var keyboardTypeMap = {
|
|
305
|
-
text: "default",
|
|
306
|
-
number: "numeric",
|
|
307
|
-
email: "email-address",
|
|
308
|
-
tel: "phone-pad",
|
|
309
|
-
url: "url",
|
|
310
|
-
decimal: "decimal-pad"
|
|
311
|
-
};
|
|
312
|
-
var inputModeToKeyboardType = {
|
|
313
|
-
none: "default",
|
|
314
|
-
text: "default",
|
|
315
|
-
decimal: "decimal-pad",
|
|
316
|
-
numeric: "number-pad",
|
|
317
|
-
tel: "phone-pad",
|
|
318
|
-
search: "default",
|
|
319
|
-
email: "email-address",
|
|
320
|
-
url: "url"
|
|
321
|
-
};
|
|
322
|
-
var autoCompleteToTextContentType = {
|
|
323
|
-
"one-time-code": "oneTimeCode",
|
|
324
|
-
email: "emailAddress",
|
|
325
|
-
username: "username",
|
|
326
|
-
password: "password",
|
|
327
|
-
"new-password": "newPassword",
|
|
328
|
-
tel: "telephoneNumber",
|
|
329
|
-
"postal-code": "postalCode",
|
|
330
|
-
name: "name"
|
|
331
|
-
};
|
|
332
|
-
var InputPrimitive = (0, import_react2.forwardRef)(
|
|
333
|
-
({
|
|
334
|
-
value,
|
|
335
|
-
placeholder,
|
|
336
|
-
onChange,
|
|
337
|
-
onChangeText,
|
|
338
|
-
onFocus,
|
|
339
|
-
onBlur,
|
|
340
|
-
onKeyDown,
|
|
341
|
-
disabled,
|
|
342
|
-
secureTextEntry,
|
|
343
|
-
style,
|
|
344
|
-
color,
|
|
345
|
-
fontSize,
|
|
346
|
-
placeholderTextColor,
|
|
347
|
-
maxLength,
|
|
348
|
-
type,
|
|
349
|
-
inputMode,
|
|
350
|
-
autoComplete,
|
|
351
|
-
id,
|
|
352
|
-
"aria-describedby": ariaDescribedBy,
|
|
353
|
-
"aria-label": ariaLabel,
|
|
354
|
-
"aria-disabled": ariaDisabled,
|
|
355
|
-
"data-testid": dataTestId
|
|
356
|
-
}, ref) => {
|
|
357
|
-
const handleChangeText = (text) => {
|
|
358
|
-
onChangeText?.(text);
|
|
359
|
-
if (onChange) {
|
|
360
|
-
const syntheticEvent = {
|
|
361
|
-
target: { value: text },
|
|
362
|
-
currentTarget: { value: text },
|
|
363
|
-
type: "change",
|
|
364
|
-
nativeEvent: { text },
|
|
365
|
-
preventDefault: () => {
|
|
366
|
-
},
|
|
367
|
-
stopPropagation: () => {
|
|
368
|
-
},
|
|
369
|
-
isTrusted: false
|
|
370
|
-
};
|
|
371
|
-
onChange(syntheticEvent);
|
|
372
|
-
}
|
|
373
|
-
};
|
|
374
|
-
const keyboardType = inputMode ? inputModeToKeyboardType[inputMode] || "default" : type ? keyboardTypeMap[type] || "default" : "default";
|
|
375
|
-
const textContentType = autoComplete ? autoCompleteToTextContentType[autoComplete] : void 0;
|
|
376
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
377
|
-
import_react_native6.TextInput,
|
|
378
|
-
{
|
|
379
|
-
ref,
|
|
380
|
-
value,
|
|
381
|
-
placeholder,
|
|
382
|
-
onChangeText: handleChangeText,
|
|
383
|
-
onFocus,
|
|
384
|
-
onBlur,
|
|
385
|
-
onKeyPress: (e) => {
|
|
386
|
-
if (onKeyDown) {
|
|
387
|
-
onKeyDown({
|
|
388
|
-
key: e.nativeEvent.key,
|
|
389
|
-
preventDefault: () => {
|
|
390
|
-
}
|
|
391
|
-
});
|
|
392
|
-
}
|
|
393
|
-
},
|
|
394
|
-
editable: !disabled,
|
|
395
|
-
secureTextEntry: secureTextEntry || type === "password",
|
|
396
|
-
keyboardType,
|
|
397
|
-
textContentType,
|
|
398
|
-
style: [
|
|
399
|
-
{
|
|
400
|
-
color,
|
|
401
|
-
fontSize: typeof fontSize === "number" ? fontSize : void 0,
|
|
402
|
-
flex: 1,
|
|
403
|
-
padding: 0,
|
|
404
|
-
textAlign: style?.textAlign || "left"
|
|
405
|
-
},
|
|
406
|
-
style
|
|
407
|
-
],
|
|
408
|
-
placeholderTextColor,
|
|
409
|
-
maxLength,
|
|
410
|
-
testID: dataTestId || id,
|
|
411
|
-
accessibilityLabel: ariaLabel,
|
|
412
|
-
accessibilityHint: ariaDescribedBy,
|
|
413
|
-
accessibilityState: {
|
|
414
|
-
disabled: disabled || ariaDisabled
|
|
415
|
-
},
|
|
416
|
-
accessible: true
|
|
417
|
-
}
|
|
418
|
-
);
|
|
419
|
-
}
|
|
420
|
-
);
|
|
421
|
-
InputPrimitive.displayName = "InputPrimitive";
|
|
422
|
-
|
|
423
|
-
// ../primitives-native/src/TextArea.tsx
|
|
424
|
-
var import_react3 = require("react");
|
|
425
|
-
var import_react_native7 = require("react-native");
|
|
426
|
-
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
427
|
-
var TextAreaPrimitive = (0, import_react3.forwardRef)(
|
|
428
|
-
({
|
|
429
|
-
value,
|
|
430
|
-
placeholder,
|
|
431
|
-
onChange,
|
|
432
|
-
onChangeText,
|
|
433
|
-
onFocus,
|
|
434
|
-
onBlur,
|
|
435
|
-
onKeyDown,
|
|
436
|
-
disabled,
|
|
437
|
-
style,
|
|
438
|
-
color,
|
|
439
|
-
fontSize,
|
|
440
|
-
placeholderTextColor,
|
|
441
|
-
maxLength,
|
|
442
|
-
rows,
|
|
443
|
-
id,
|
|
444
|
-
"aria-describedby": ariaDescribedBy,
|
|
445
|
-
"aria-label": ariaLabel,
|
|
446
|
-
"aria-disabled": ariaDisabled,
|
|
447
|
-
"data-testid": dataTestId
|
|
448
|
-
}, ref) => {
|
|
449
|
-
const handleChangeText = (text) => {
|
|
450
|
-
onChangeText?.(text);
|
|
451
|
-
if (onChange) {
|
|
452
|
-
const syntheticEvent = {
|
|
453
|
-
target: { value: text },
|
|
454
|
-
currentTarget: { value: text },
|
|
455
|
-
type: "change",
|
|
456
|
-
nativeEvent: { text },
|
|
457
|
-
preventDefault: () => {
|
|
458
|
-
},
|
|
459
|
-
stopPropagation: () => {
|
|
460
|
-
},
|
|
461
|
-
isTrusted: false
|
|
462
|
-
};
|
|
463
|
-
onChange(syntheticEvent);
|
|
464
|
-
}
|
|
465
|
-
};
|
|
466
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
467
|
-
import_react_native7.TextInput,
|
|
468
|
-
{
|
|
469
|
-
ref,
|
|
470
|
-
value,
|
|
471
|
-
placeholder,
|
|
472
|
-
onChangeText: handleChangeText,
|
|
473
|
-
onFocus,
|
|
474
|
-
onBlur,
|
|
475
|
-
onKeyPress: (e) => {
|
|
476
|
-
if (onKeyDown) {
|
|
477
|
-
onKeyDown({
|
|
478
|
-
key: e.nativeEvent.key,
|
|
479
|
-
preventDefault: () => {
|
|
480
|
-
}
|
|
481
|
-
});
|
|
482
|
-
}
|
|
483
|
-
},
|
|
484
|
-
editable: !disabled,
|
|
485
|
-
multiline: true,
|
|
486
|
-
numberOfLines: rows || 4,
|
|
487
|
-
style: [
|
|
488
|
-
{
|
|
489
|
-
color,
|
|
490
|
-
fontSize: typeof fontSize === "number" ? fontSize : void 0,
|
|
491
|
-
flex: 1,
|
|
492
|
-
padding: 0,
|
|
493
|
-
textAlignVertical: "top",
|
|
494
|
-
textAlign: style?.textAlign || "left"
|
|
495
|
-
},
|
|
496
|
-
style
|
|
497
|
-
],
|
|
498
|
-
placeholderTextColor,
|
|
499
|
-
maxLength,
|
|
500
|
-
testID: dataTestId || id,
|
|
501
|
-
accessibilityLabel: ariaLabel,
|
|
502
|
-
accessibilityHint: ariaDescribedBy,
|
|
503
|
-
accessibilityState: {
|
|
504
|
-
disabled: disabled || ariaDisabled
|
|
505
|
-
},
|
|
506
|
-
accessible: true
|
|
507
|
-
}
|
|
508
|
-
);
|
|
509
|
-
}
|
|
510
|
-
);
|
|
511
|
-
TextAreaPrimitive.displayName = "TextAreaPrimitive";
|
|
512
|
-
|
|
513
265
|
// src/Select.tsx
|
|
514
266
|
var import_xui_core = require("@xsolla/xui-core");
|
|
515
|
-
var
|
|
516
|
-
var ChevronDown = () => /* @__PURE__ */ (0,
|
|
267
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
268
|
+
var ChevronDown = () => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
517
269
|
"svg",
|
|
518
270
|
{
|
|
519
271
|
width: "100%",
|
|
@@ -521,7 +273,7 @@ var ChevronDown = () => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
|
521
273
|
viewBox: "0 0 18 18",
|
|
522
274
|
fill: "none",
|
|
523
275
|
xmlns: "http://www.w3.org/2000/svg",
|
|
524
|
-
children: /* @__PURE__ */ (0,
|
|
276
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
525
277
|
"path",
|
|
526
278
|
{
|
|
527
279
|
d: "M4.5 6.75L9 11.25L13.5 6.75",
|
|
@@ -533,7 +285,7 @@ var ChevronDown = () => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
|
533
285
|
)
|
|
534
286
|
}
|
|
535
287
|
);
|
|
536
|
-
var ChevronUp = () => /* @__PURE__ */ (0,
|
|
288
|
+
var ChevronUp = () => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
537
289
|
"svg",
|
|
538
290
|
{
|
|
539
291
|
width: "100%",
|
|
@@ -541,7 +293,7 @@ var ChevronUp = () => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
|
541
293
|
viewBox: "0 0 18 18",
|
|
542
294
|
fill: "none",
|
|
543
295
|
xmlns: "http://www.w3.org/2000/svg",
|
|
544
|
-
children: /* @__PURE__ */ (0,
|
|
296
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
545
297
|
"path",
|
|
546
298
|
{
|
|
547
299
|
d: "M13.5 11.25L9 6.75L4.5 11.25",
|
|
@@ -553,7 +305,7 @@ var ChevronUp = () => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
|
553
305
|
)
|
|
554
306
|
}
|
|
555
307
|
);
|
|
556
|
-
var ExclamationMarkCr = () => /* @__PURE__ */ (0,
|
|
308
|
+
var ExclamationMarkCr = () => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
557
309
|
"svg",
|
|
558
310
|
{
|
|
559
311
|
width: "100%",
|
|
@@ -563,15 +315,15 @@ var ExclamationMarkCr = () => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
|
563
315
|
style: { stroke: "none" },
|
|
564
316
|
xmlns: "http://www.w3.org/2000/svg",
|
|
565
317
|
children: [
|
|
566
|
-
/* @__PURE__ */ (0,
|
|
318
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
567
319
|
"path",
|
|
568
320
|
{
|
|
569
321
|
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",
|
|
570
322
|
fill: "currentColor"
|
|
571
323
|
}
|
|
572
324
|
),
|
|
573
|
-
/* @__PURE__ */ (0,
|
|
574
|
-
/* @__PURE__ */ (0,
|
|
325
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M9.75 10.5H8.25V4.5H9.75V10.5Z", fill: "currentColor" }),
|
|
326
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
575
327
|
"path",
|
|
576
328
|
{
|
|
577
329
|
fillRule: "evenodd",
|
|
@@ -583,7 +335,7 @@ var ExclamationMarkCr = () => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
|
583
335
|
]
|
|
584
336
|
}
|
|
585
337
|
);
|
|
586
|
-
var SearchIcon = () => /* @__PURE__ */ (0,
|
|
338
|
+
var SearchIcon = () => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
587
339
|
"svg",
|
|
588
340
|
{
|
|
589
341
|
width: "100%",
|
|
@@ -592,7 +344,7 @@ var SearchIcon = () => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
|
592
344
|
fill: "none",
|
|
593
345
|
xmlns: "http://www.w3.org/2000/svg",
|
|
594
346
|
children: [
|
|
595
|
-
/* @__PURE__ */ (0,
|
|
347
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
596
348
|
"path",
|
|
597
349
|
{
|
|
598
350
|
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",
|
|
@@ -602,7 +354,7 @@ var SearchIcon = () => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
|
602
354
|
strokeLinejoin: "round"
|
|
603
355
|
}
|
|
604
356
|
),
|
|
605
|
-
/* @__PURE__ */ (0,
|
|
357
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
606
358
|
"path",
|
|
607
359
|
{
|
|
608
360
|
d: "M15.75 15.75L12.4875 12.4875",
|
|
@@ -636,22 +388,22 @@ var Select = ({
|
|
|
636
388
|
maxHeight = 300
|
|
637
389
|
}) => {
|
|
638
390
|
const { theme } = (0, import_xui_core.useDesignSystem)();
|
|
639
|
-
const [isOpen, setIsOpen] = (0,
|
|
640
|
-
const [selectedValue, setSelectedValue] = (0,
|
|
641
|
-
const [searchValue, setSearchValue] = (0,
|
|
642
|
-
const containerRef = (0,
|
|
643
|
-
const dropdownRef = (0,
|
|
644
|
-
const selectedItemRef = (0,
|
|
645
|
-
const searchInputRef = (0,
|
|
391
|
+
const [isOpen, setIsOpen] = (0, import_react2.useState)(false);
|
|
392
|
+
const [selectedValue, setSelectedValue] = (0, import_react2.useState)(value);
|
|
393
|
+
const [searchValue, setSearchValue] = (0, import_react2.useState)("");
|
|
394
|
+
const containerRef = (0, import_react2.useRef)(null);
|
|
395
|
+
const dropdownRef = (0, import_react2.useRef)(null);
|
|
396
|
+
const selectedItemRef = (0, import_react2.useRef)(null);
|
|
397
|
+
const searchInputRef = (0, import_react2.useRef)(null);
|
|
646
398
|
const isDisable = externalState === "disable" || disabled;
|
|
647
399
|
const isError = externalState === "error" || !!errorMessage;
|
|
648
400
|
const isFocus = externalState === "focus" || isOpen;
|
|
649
|
-
|
|
401
|
+
import_react2.default.useEffect(() => {
|
|
650
402
|
if (value !== void 0) {
|
|
651
403
|
setSelectedValue(value);
|
|
652
404
|
}
|
|
653
405
|
}, [value]);
|
|
654
|
-
(0,
|
|
406
|
+
(0, import_react2.useEffect)(() => {
|
|
655
407
|
if (isFocus && selectedItemRef.current && dropdownRef.current) {
|
|
656
408
|
const timeoutId = setTimeout(() => {
|
|
657
409
|
const selectedItem = selectedItemRef.current;
|
|
@@ -662,17 +414,17 @@ var Select = ({
|
|
|
662
414
|
return () => clearTimeout(timeoutId);
|
|
663
415
|
}
|
|
664
416
|
}, [isFocus]);
|
|
665
|
-
(0,
|
|
417
|
+
(0, import_react2.useEffect)(() => {
|
|
666
418
|
if (isFocus && searchable) {
|
|
667
419
|
searchInputRef.current?.focus();
|
|
668
420
|
}
|
|
669
421
|
}, [isFocus, searchable]);
|
|
670
|
-
(0,
|
|
422
|
+
(0, import_react2.useEffect)(() => {
|
|
671
423
|
if (!isFocus) {
|
|
672
424
|
setSearchValue("");
|
|
673
425
|
}
|
|
674
426
|
}, [isFocus]);
|
|
675
|
-
(0,
|
|
427
|
+
(0, import_react2.useEffect)(() => {
|
|
676
428
|
if (import_xui_core.isNative || !isOpen) return;
|
|
677
429
|
const handleClickOutside = (event) => {
|
|
678
430
|
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
@@ -736,7 +488,7 @@ var Select = ({
|
|
|
736
488
|
) : placeholder;
|
|
737
489
|
const textColor = isDisable ? inputColors.textDisable : selectedValue ? inputColors.text : inputColors.placeholder;
|
|
738
490
|
const iconColor = isDisable ? inputColors.textDisable : inputColors.text;
|
|
739
|
-
return /* @__PURE__ */ (0,
|
|
491
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
740
492
|
Box,
|
|
741
493
|
{
|
|
742
494
|
ref: containerRef,
|
|
@@ -745,7 +497,7 @@ var Select = ({
|
|
|
745
497
|
width: "100%",
|
|
746
498
|
position: "relative",
|
|
747
499
|
children: [
|
|
748
|
-
label && /* @__PURE__ */ (0,
|
|
500
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
749
501
|
Text,
|
|
750
502
|
{
|
|
751
503
|
color: theme.colors.content.secondary,
|
|
@@ -754,7 +506,7 @@ var Select = ({
|
|
|
754
506
|
children: label
|
|
755
507
|
}
|
|
756
508
|
),
|
|
757
|
-
/* @__PURE__ */ (0,
|
|
509
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
758
510
|
Box,
|
|
759
511
|
{
|
|
760
512
|
onPress: handlePress,
|
|
@@ -775,8 +527,8 @@ var Select = ({
|
|
|
775
527
|
borderColor: inputColors.borderHover
|
|
776
528
|
} : void 0,
|
|
777
529
|
children: [
|
|
778
|
-
iconLeft && /* @__PURE__ */ (0,
|
|
779
|
-
!iconOnly && /* @__PURE__ */ (0,
|
|
530
|
+
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 }) }),
|
|
531
|
+
!iconOnly && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Box, { flex: 1, height: "100%", justifyContent: "center", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
780
532
|
Text,
|
|
781
533
|
{
|
|
782
534
|
color: textColor,
|
|
@@ -785,21 +537,21 @@ var Select = ({
|
|
|
785
537
|
children: currentLabel
|
|
786
538
|
}
|
|
787
539
|
) }),
|
|
788
|
-
/* @__PURE__ */ (0,
|
|
789
|
-
isError && /* @__PURE__ */ (0,
|
|
540
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Box, { flexDirection: "row", alignItems: "center", gap: 4, children: [
|
|
541
|
+
isError && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
790
542
|
Icon,
|
|
791
543
|
{
|
|
792
544
|
size: sizeStyles.iconSize,
|
|
793
545
|
color: theme.colors.content.alert.primary,
|
|
794
|
-
children: /* @__PURE__ */ (0,
|
|
546
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ExclamationMarkCr, {})
|
|
795
547
|
}
|
|
796
548
|
),
|
|
797
|
-
/* @__PURE__ */ (0,
|
|
549
|
+
/* @__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, {}) })
|
|
798
550
|
] })
|
|
799
551
|
]
|
|
800
552
|
}
|
|
801
553
|
),
|
|
802
|
-
isFocus && options.length > 0 && /* @__PURE__ */ (0,
|
|
554
|
+
isFocus && options.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
803
555
|
Box,
|
|
804
556
|
{
|
|
805
557
|
ref: dropdownRef,
|
|
@@ -816,14 +568,14 @@ var Select = ({
|
|
|
816
568
|
minWidth: iconOnly ? sizeStyles.height * 3 : void 0
|
|
817
569
|
},
|
|
818
570
|
children: [
|
|
819
|
-
searchable && /* @__PURE__ */ (0,
|
|
571
|
+
searchable && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
820
572
|
Box,
|
|
821
573
|
{
|
|
822
574
|
paddingHorizontal: sizeStyles.paddingHorizontal,
|
|
823
575
|
paddingVertical: sizeStyles.paddingVertical,
|
|
824
576
|
borderBottomWidth: 1,
|
|
825
577
|
borderColor: theme.colors.border.secondary,
|
|
826
|
-
children: /* @__PURE__ */ (0,
|
|
578
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
827
579
|
Box,
|
|
828
580
|
{
|
|
829
581
|
flexDirection: "row",
|
|
@@ -831,15 +583,15 @@ var Select = ({
|
|
|
831
583
|
gap: sizeStyles.paddingHorizontal / 2,
|
|
832
584
|
paddingHorizontal: 4,
|
|
833
585
|
children: [
|
|
834
|
-
/* @__PURE__ */ (0,
|
|
586
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
835
587
|
Icon,
|
|
836
588
|
{
|
|
837
589
|
size: sizeStyles.iconSize - 2,
|
|
838
590
|
color: inputColors.placeholder,
|
|
839
|
-
children: /* @__PURE__ */ (0,
|
|
591
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SearchIcon, {})
|
|
840
592
|
}
|
|
841
593
|
),
|
|
842
|
-
/* @__PURE__ */ (0,
|
|
594
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
843
595
|
Box,
|
|
844
596
|
{
|
|
845
597
|
as: "input",
|
|
@@ -864,7 +616,7 @@ var Select = ({
|
|
|
864
616
|
)
|
|
865
617
|
}
|
|
866
618
|
),
|
|
867
|
-
/* @__PURE__ */ (0,
|
|
619
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
868
620
|
Box,
|
|
869
621
|
{
|
|
870
622
|
paddingVertical: 4,
|
|
@@ -872,13 +624,13 @@ var Select = ({
|
|
|
872
624
|
maxHeight: searchable ? maxHeight - 60 : maxHeight,
|
|
873
625
|
overflowY: "auto"
|
|
874
626
|
},
|
|
875
|
-
children: filteredOptions.length === 0 ? /* @__PURE__ */ (0,
|
|
627
|
+
children: filteredOptions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
876
628
|
Box,
|
|
877
629
|
{
|
|
878
630
|
paddingVertical: sizeStyles.paddingVertical * 2,
|
|
879
631
|
paddingHorizontal: sizeStyles.paddingHorizontal,
|
|
880
632
|
alignItems: "center",
|
|
881
|
-
children: /* @__PURE__ */ (0,
|
|
633
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
882
634
|
Text,
|
|
883
635
|
{
|
|
884
636
|
color: theme.colors.content.tertiary,
|
|
@@ -894,7 +646,7 @@ var Select = ({
|
|
|
894
646
|
const isSelected = optionValue === selectedValue;
|
|
895
647
|
const brandColors = theme.colors.control.brand.primary;
|
|
896
648
|
const contentColors = theme.colors.content;
|
|
897
|
-
return /* @__PURE__ */ (0,
|
|
649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
898
650
|
Box,
|
|
899
651
|
{
|
|
900
652
|
ref: isSelected ? selectedItemRef : void 0,
|
|
@@ -912,7 +664,7 @@ var Select = ({
|
|
|
912
664
|
hoverStyle: !isSelected && !isOptionDisabled ? {
|
|
913
665
|
backgroundColor: theme.colors.control.input.bgHover
|
|
914
666
|
} : void 0,
|
|
915
|
-
children: /* @__PURE__ */ (0,
|
|
667
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
916
668
|
Text,
|
|
917
669
|
{
|
|
918
670
|
color: isSelected ? contentColors.on.brand : theme.colors.content.secondary,
|
|
@@ -930,7 +682,7 @@ var Select = ({
|
|
|
930
682
|
]
|
|
931
683
|
}
|
|
932
684
|
),
|
|
933
|
-
isError && errorMessage && /* @__PURE__ */ (0,
|
|
685
|
+
isError && errorMessage && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
934
686
|
Text,
|
|
935
687
|
{
|
|
936
688
|
color: theme.colors.content.alert.primary,
|