@xaui/native 0.0.21 → 0.0.24

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.
Files changed (113) hide show
  1. package/README.md +195 -2
  2. package/dist/alert/index.js +1 -2
  3. package/dist/app-bar/index.cjs +217 -0
  4. package/dist/app-bar/index.d.cts +52 -0
  5. package/dist/app-bar/index.d.ts +52 -0
  6. package/dist/app-bar/index.js +142 -0
  7. package/dist/autocomplete/index.js +48 -36
  8. package/dist/avatar/index.js +1 -2
  9. package/dist/badge/index.js +1 -2
  10. package/dist/bottom-sheet/index.js +1 -2
  11. package/dist/bottom-tab-bar/index.cjs +571 -0
  12. package/dist/bottom-tab-bar/index.d.cts +211 -0
  13. package/dist/bottom-tab-bar/index.d.ts +211 -0
  14. package/dist/bottom-tab-bar/index.js +497 -0
  15. package/dist/button/index.d.cts +102 -5
  16. package/dist/button/index.d.ts +102 -5
  17. package/dist/button/index.js +2 -3
  18. package/dist/button.type-j1ZdkkSl.d.cts +4 -0
  19. package/dist/button.type-j1ZdkkSl.d.ts +4 -0
  20. package/dist/card/index.cjs +2 -0
  21. package/dist/card/index.d.cts +6 -1
  22. package/dist/card/index.d.ts +6 -1
  23. package/dist/card/index.js +4 -2
  24. package/dist/carousel/index.js +1 -1
  25. package/dist/chart/index.cjs +1067 -0
  26. package/dist/chart/index.d.cts +218 -0
  27. package/dist/chart/index.d.ts +218 -0
  28. package/dist/chart/index.js +1026 -0
  29. package/dist/checkbox/index.js +1 -2
  30. package/dist/chip/index.js +1 -2
  31. package/dist/chunk-3XSXTM3G.js +661 -0
  32. package/dist/chunk-4KSZLONZ.js +79 -0
  33. package/dist/{chunk-DXXNBF5P.js → chunk-CZFDZPAS.js} +0 -5
  34. package/dist/{chunk-LTKYHG5V.js → chunk-GHCVNQET.js} +12 -5
  35. package/dist/chunk-I4V5Y5GD.js +76 -0
  36. package/dist/{chunk-F7WH4DMG.js → chunk-UI5L26KD.js} +1 -1
  37. package/dist/{chunk-LUBWRVI2.js → chunk-ULJSCNPE.js} +1 -1
  38. package/dist/chunk-URBEEDFX.js +79 -0
  39. package/dist/core/index.js +3 -5
  40. package/dist/datepicker/index.js +1 -2
  41. package/dist/divider/index.js +2 -3
  42. package/dist/drawer/index.cjs +310 -0
  43. package/dist/drawer/index.d.cts +58 -0
  44. package/dist/drawer/index.d.ts +58 -0
  45. package/dist/drawer/index.js +236 -0
  46. package/dist/{accordion → expansion-panel}/index.cjs +45 -45
  47. package/dist/{accordion → expansion-panel}/index.d.cts +30 -30
  48. package/dist/{accordion → expansion-panel}/index.d.ts +30 -30
  49. package/dist/{accordion → expansion-panel}/index.js +40 -41
  50. package/dist/fab/index.d.cts +3 -3
  51. package/dist/fab/index.d.ts +3 -3
  52. package/dist/fab/index.js +3 -4
  53. package/dist/fab-menu/index.d.cts +2 -2
  54. package/dist/fab-menu/index.d.ts +2 -2
  55. package/dist/fab-menu/index.js +3 -4
  56. package/dist/{fab.type-Ba0QMprb.d.ts → fab.type-CgIYqQlT.d.ts} +1 -1
  57. package/dist/{fab.type-U09H8B7D.d.cts → fab.type-l2vjG8-p.d.cts} +1 -1
  58. package/dist/feature-discovery/index.cjs +531 -0
  59. package/dist/feature-discovery/index.d.cts +82 -0
  60. package/dist/feature-discovery/index.d.ts +82 -0
  61. package/dist/feature-discovery/index.js +464 -0
  62. package/dist/indicator/index.js +2 -3
  63. package/dist/input/index.cjs +258 -164
  64. package/dist/input/index.d.cts +15 -1
  65. package/dist/input/index.d.ts +15 -1
  66. package/dist/input/index.js +219 -126
  67. package/dist/list/index.js +1 -2
  68. package/dist/menu/index.js +2 -2
  69. package/dist/menubox/index.cjs +369 -0
  70. package/dist/menubox/index.d.cts +98 -0
  71. package/dist/menubox/index.d.ts +98 -0
  72. package/dist/menubox/index.js +296 -0
  73. package/dist/pager/index.cjs +243 -0
  74. package/dist/pager/index.d.cts +93 -0
  75. package/dist/pager/index.d.ts +93 -0
  76. package/dist/pager/index.js +205 -0
  77. package/dist/progress/index.js +1 -2
  78. package/dist/radio/index.cjs +537 -0
  79. package/dist/radio/index.d.cts +145 -0
  80. package/dist/radio/index.d.ts +145 -0
  81. package/dist/radio/index.js +464 -0
  82. package/dist/segment-button/index.js +2 -2
  83. package/dist/select/index.js +22 -10
  84. package/dist/skeleton/index.js +2 -2
  85. package/dist/slider/index.cjs +655 -0
  86. package/dist/slider/index.d.cts +171 -0
  87. package/dist/slider/index.d.ts +171 -0
  88. package/dist/slider/index.js +575 -0
  89. package/dist/stepper/index.cjs +624 -0
  90. package/dist/stepper/index.d.cts +137 -0
  91. package/dist/stepper/index.d.ts +137 -0
  92. package/dist/stepper/index.js +549 -0
  93. package/dist/switch/index.js +1 -2
  94. package/dist/tabs/index.cjs +523 -0
  95. package/dist/tabs/index.d.cts +176 -0
  96. package/dist/tabs/index.d.ts +176 -0
  97. package/dist/tabs/index.js +438 -0
  98. package/dist/timepicker/index.cjs +1280 -0
  99. package/dist/timepicker/index.d.cts +215 -0
  100. package/dist/timepicker/index.d.ts +215 -0
  101. package/dist/timepicker/index.js +1181 -0
  102. package/dist/toolbar/index.cjs +395 -0
  103. package/dist/toolbar/index.d.cts +100 -0
  104. package/dist/toolbar/index.d.ts +100 -0
  105. package/dist/toolbar/index.js +325 -0
  106. package/dist/typography/index.js +1 -2
  107. package/dist/view/index.cjs +16 -2
  108. package/dist/view/index.js +16 -2
  109. package/package.json +73 -8
  110. package/dist/button.type-D8tzEBo7.d.ts +0 -104
  111. package/dist/button.type-ikaWzhIg.d.cts +0 -104
  112. package/dist/chunk-GBHQCAKW.js +0 -19
  113. package/dist/chunk-JEGEPGVU.js +0 -287
@@ -34,6 +34,7 @@ __export(input_exports, {
34
34
  DateTimeInput: () => DateTimeInput,
35
35
  NumberInput: () => NumberInput,
36
36
  OTPInput: () => OTPInput,
37
+ TextArea: () => TextArea,
37
38
  TextInput: () => TextInput,
38
39
  TimeInput: () => TimeInput,
39
40
  getDateOrder: () => getDateOrder
@@ -360,98 +361,115 @@ var TextInput = (0, import_react7.forwardRef)(
360
361
  ]
361
362
  },
362
363
  label
363
- ), /* @__PURE__ */ import_react7.default.createElement(import_react_native5.Pressable, { onPress: handleWrapperPress, disabled: isDisabled || isReadOnly }, /* @__PURE__ */ import_react7.default.createElement(
364
- import_react_native5.Animated.View,
364
+ ), /* @__PURE__ */ import_react7.default.createElement(
365
+ import_react_native5.Pressable,
365
366
  {
366
- style: [
367
- styles.inputWrapper,
368
- {
369
- minHeight: sizeStyles.minHeight,
370
- paddingVertical: sizeStyles.paddingVertical,
371
- paddingHorizontal: sizeStyles.paddingHorizontal,
372
- gap: sizeStyles.slotGap,
373
- backgroundColor: variantStyles.container.backgroundColor,
374
- borderWidth: variant === "underlined" ? 0 : variantStyles.container.borderWidth,
375
- ...variant === "underlined" && {
376
- borderBottomWidth: variantStyles.container.borderBottomWidth
377
- },
378
- borderRadius: variant === "underlined" ? 0 : radiusStyles.borderRadius,
379
- ...variant === "underlined" ? {
380
- borderBottomColor: borderAnimation.interpolate({
381
- inputRange: [0, 1],
382
- outputRange: [
383
- variantStyles.unfocusedBorderColor,
384
- variantStyles.focusedBorderColor
385
- ]
386
- })
387
- } : {
388
- borderColor: borderAnimation.interpolate({
389
- inputRange: [0, 1],
390
- outputRange: [
391
- variantStyles.unfocusedBorderColor,
392
- variantStyles.focusedBorderColor
393
- ]
394
- })
395
- }
396
- },
397
- variant === "underlined" && styles.underlinedWrapper,
398
- customAppearance?.inputWrapper
399
- ]
367
+ onPress: handleWrapperPress,
368
+ disabled: isDisabled || isReadOnly
400
369
  },
401
- startContent && /* @__PURE__ */ import_react7.default.createElement(import_react_native5.View, { style: styles.slot }, startContent),
402
- /* @__PURE__ */ import_react7.default.createElement(import_react_native5.View, { style: { flex: 1, gap: labelPlacement === "inside" && label ? 2 : 0 } }, label && labelPlacement === "inside" && /* @__PURE__ */ import_react7.default.createElement(
403
- import_react_native5.Text,
370
+ /* @__PURE__ */ import_react7.default.createElement(
371
+ import_react_native5.Animated.View,
404
372
  {
405
373
  style: [
406
- styles.label,
374
+ styles.inputWrapper,
407
375
  {
408
- color: variantStyles.labelColor,
409
- fontSize: sizeStyles.helperSize,
410
- paddingBottom: 2
376
+ minHeight: sizeStyles.minHeight,
377
+ paddingVertical: sizeStyles.paddingVertical,
378
+ paddingHorizontal: sizeStyles.paddingHorizontal,
379
+ gap: sizeStyles.slotGap,
380
+ backgroundColor: variantStyles.container.backgroundColor,
381
+ borderWidth: variant === "underlined" ? 0 : variantStyles.container.borderWidth,
382
+ ...variant === "underlined" && {
383
+ borderBottomWidth: variantStyles.container.borderBottomWidth
384
+ },
385
+ borderRadius: variant === "underlined" ? 0 : radiusStyles.borderRadius,
386
+ ...variant === "underlined" ? {
387
+ borderBottomColor: borderAnimation.interpolate({
388
+ inputRange: [0, 1],
389
+ outputRange: [
390
+ variantStyles.unfocusedBorderColor,
391
+ variantStyles.focusedBorderColor
392
+ ]
393
+ })
394
+ } : {
395
+ borderColor: borderAnimation.interpolate({
396
+ inputRange: [0, 1],
397
+ outputRange: [
398
+ variantStyles.unfocusedBorderColor,
399
+ variantStyles.focusedBorderColor
400
+ ]
401
+ })
402
+ }
411
403
  },
412
- customAppearance?.label
404
+ variant === "underlined" && styles.underlinedWrapper,
405
+ customAppearance?.inputWrapper
413
406
  ]
414
407
  },
415
- label
416
- ), /* @__PURE__ */ import_react7.default.createElement(
417
- import_react_native5.TextInput,
418
- {
419
- ref: typeof forwardedRef === "function" ? internalRef : forwardedRef || internalRef,
420
- value: inputValue,
421
- onChangeText: handleChangeText,
422
- onFocus: (event) => {
423
- setIsFocused(true);
424
- onFocus?.(event);
425
- },
426
- onBlur: (event) => {
427
- setIsFocused(false);
428
- onBlur?.(event);
408
+ startContent && /* @__PURE__ */ import_react7.default.createElement(import_react_native5.View, { style: styles.slot }, startContent),
409
+ /* @__PURE__ */ import_react7.default.createElement(
410
+ import_react_native5.View,
411
+ {
412
+ style: {
413
+ flex: 1,
414
+ gap: labelPlacement === "inside" && label ? 2 : 0
415
+ }
429
416
  },
430
- editable,
431
- secureTextEntry,
432
- placeholderTextColor: variantStyles.placeholderColor,
433
- style: [
434
- styles.input,
417
+ label && labelPlacement === "inside" && /* @__PURE__ */ import_react7.default.createElement(
418
+ import_react_native5.Text,
435
419
  {
436
- color: variantStyles.textColor,
437
- fontSize: sizeStyles.fontSize
420
+ style: [
421
+ styles.label,
422
+ {
423
+ color: variantStyles.labelColor,
424
+ fontSize: sizeStyles.helperSize,
425
+ paddingBottom: 2
426
+ },
427
+ customAppearance?.label
428
+ ]
438
429
  },
439
- customAppearance?.input
440
- ],
441
- ...nativeProps
442
- }
443
- )),
444
- showClearButton ? /* @__PURE__ */ import_react7.default.createElement(
445
- import_react_native5.Pressable,
446
- {
447
- onPress: handleClear,
448
- accessibilityLabel: "Clear input",
449
- accessibilityRole: "button",
450
- style: styles.clearButton
451
- },
452
- /* @__PURE__ */ import_react7.default.createElement(import_icons.CloseIcon, { size: 16, color: variantStyles.placeholderColor })
453
- ) : endContent && /* @__PURE__ */ import_react7.default.createElement(import_react_native5.View, { style: styles.slot }, endContent)
454
- ))),
430
+ label
431
+ ),
432
+ /* @__PURE__ */ import_react7.default.createElement(
433
+ import_react_native5.TextInput,
434
+ {
435
+ ref: typeof forwardedRef === "function" ? internalRef : forwardedRef || internalRef,
436
+ value: inputValue,
437
+ onChangeText: handleChangeText,
438
+ onFocus: (event) => {
439
+ setIsFocused(true);
440
+ onFocus?.(event);
441
+ },
442
+ onBlur: (event) => {
443
+ setIsFocused(false);
444
+ onBlur?.(event);
445
+ },
446
+ editable,
447
+ secureTextEntry,
448
+ placeholderTextColor: variantStyles.placeholderColor,
449
+ style: [
450
+ styles.input,
451
+ {
452
+ color: variantStyles.textColor,
453
+ fontSize: sizeStyles.fontSize
454
+ },
455
+ customAppearance?.input
456
+ ],
457
+ ...nativeProps
458
+ }
459
+ )
460
+ ),
461
+ showClearButton ? /* @__PURE__ */ import_react7.default.createElement(
462
+ import_react_native5.Pressable,
463
+ {
464
+ onPress: handleClear,
465
+ accessibilityLabel: "Clear input",
466
+ accessibilityRole: "button",
467
+ style: styles.clearButton
468
+ },
469
+ /* @__PURE__ */ import_react7.default.createElement(import_icons.CloseIcon, { size: 16, color: variantStyles.placeholderColor })
470
+ ) : endContent && /* @__PURE__ */ import_react7.default.createElement(import_react_native5.View, { style: styles.slot }, endContent)
471
+ )
472
+ )),
455
473
  helperText && /* @__PURE__ */ import_react7.default.createElement(
456
474
  import_react_native5.Text,
457
475
  {
@@ -471,9 +489,71 @@ var TextInput = (0, import_react7.forwardRef)(
471
489
  );
472
490
  TextInput.displayName = "TextInput";
473
491
 
474
- // src/components/input/date-time-input.tsx
492
+ // src/components/input/textarea.tsx
475
493
  var import_react8 = __toESM(require("react"), 1);
476
494
 
495
+ // src/components/input/textarea.style.ts
496
+ var import_react_native6 = require("react-native");
497
+ var textAreaStyles = import_react_native6.StyleSheet.create({
498
+ inputWrapper: {
499
+ alignItems: "flex-start"
500
+ },
501
+ input: {
502
+ textAlignVertical: "top"
503
+ }
504
+ });
505
+
506
+ // src/components/input/textarea.tsx
507
+ var TextArea = ({
508
+ minRows = 3,
509
+ maxRows,
510
+ size = "md",
511
+ customAppearance,
512
+ numberOfLines,
513
+ textAlignVertical,
514
+ scrollEnabled,
515
+ ...props
516
+ }) => {
517
+ const sizeStyles = useTextInputSizeStyles(size);
518
+ const lineHeight = Math.round(sizeStyles.fontSize * 1.35);
519
+ const verticalPadding = sizeStyles.paddingVertical * 2;
520
+ const normalizedMaxRows = typeof maxRows === "number" ? Math.max(maxRows, minRows) : void 0;
521
+ const minHeight = minRows * lineHeight + verticalPadding;
522
+ const maxHeight = typeof normalizedMaxRows === "number" ? normalizedMaxRows * lineHeight + verticalPadding : void 0;
523
+ return /* @__PURE__ */ import_react8.default.createElement(
524
+ TextInput,
525
+ {
526
+ ...props,
527
+ size,
528
+ multiline: true,
529
+ numberOfLines: numberOfLines ?? minRows,
530
+ textAlignVertical: textAlignVertical ?? "top",
531
+ scrollEnabled: scrollEnabled ?? !!maxHeight,
532
+ customAppearance: {
533
+ ...customAppearance,
534
+ inputWrapper: [
535
+ textAreaStyles.inputWrapper,
536
+ {
537
+ minHeight,
538
+ ...maxHeight ? { maxHeight } : {}
539
+ },
540
+ customAppearance?.inputWrapper
541
+ ],
542
+ input: [
543
+ textAreaStyles.input,
544
+ {
545
+ lineHeight
546
+ },
547
+ customAppearance?.input
548
+ ]
549
+ }
550
+ }
551
+ );
552
+ };
553
+
554
+ // src/components/input/date-time-input.tsx
555
+ var import_react9 = __toESM(require("react"), 1);
556
+
477
557
  // src/components/input/date-time-input.hook.ts
478
558
  var YMD_LOCALES = ["ja", "zh", "ko", "hu", "lt", "mn"];
479
559
  var MDY_LOCALES = ["en-US", "en-PH", "en-BZ"];
@@ -581,7 +661,7 @@ var getDateTimeMaxLength = (separator, granularity, hourCycle) => {
581
661
  };
582
662
 
583
663
  // src/components/input/date-time-input.tsx
584
- var DateInput = (0, import_react8.forwardRef)(
664
+ var DateInput = (0, import_react9.forwardRef)(
585
665
  ({
586
666
  separator = "-",
587
667
  dateOrder,
@@ -592,11 +672,11 @@ var DateInput = (0, import_react8.forwardRef)(
592
672
  onValueChange,
593
673
  ...props
594
674
  }, ref) => {
595
- const resolvedOrder = (0, import_react8.useMemo)(
675
+ const resolvedOrder = (0, import_react9.useMemo)(
596
676
  () => dateOrder ?? getDateOrder(locale),
597
677
  [dateOrder, locale]
598
678
  );
599
- const handleChangeText = (0, import_react8.useCallback)(
679
+ const handleChangeText = (0, import_react9.useCallback)(
600
680
  (text) => {
601
681
  const formatted = formatDateInput(text, resolvedOrder, separator);
602
682
  onChangeText?.(formatted);
@@ -604,7 +684,7 @@ var DateInput = (0, import_react8.forwardRef)(
604
684
  },
605
685
  [resolvedOrder, separator, onChangeText, onValueChange]
606
686
  );
607
- return /* @__PURE__ */ import_react8.default.createElement(
687
+ return /* @__PURE__ */ import_react9.default.createElement(
608
688
  TextInput,
609
689
  {
610
690
  ref,
@@ -619,7 +699,7 @@ var DateInput = (0, import_react8.forwardRef)(
619
699
  );
620
700
  }
621
701
  );
622
- var TimeInput = (0, import_react8.forwardRef)(
702
+ var TimeInput = (0, import_react9.forwardRef)(
623
703
  ({
624
704
  granularity = "minute",
625
705
  hourCycle = 24,
@@ -629,7 +709,7 @@ var TimeInput = (0, import_react8.forwardRef)(
629
709
  onValueChange,
630
710
  ...props
631
711
  }, ref) => {
632
- const handleChangeText = (0, import_react8.useCallback)(
712
+ const handleChangeText = (0, import_react9.useCallback)(
633
713
  (text) => {
634
714
  const formatted = formatTimeInput(text, granularity, hourCycle);
635
715
  onChangeText?.(formatted);
@@ -637,7 +717,7 @@ var TimeInput = (0, import_react8.forwardRef)(
637
717
  },
638
718
  [granularity, hourCycle, onChangeText, onValueChange]
639
719
  );
640
- return /* @__PURE__ */ import_react8.default.createElement(
720
+ return /* @__PURE__ */ import_react9.default.createElement(
641
721
  TextInput,
642
722
  {
643
723
  ref,
@@ -652,7 +732,7 @@ var TimeInput = (0, import_react8.forwardRef)(
652
732
  );
653
733
  }
654
734
  );
655
- var DateTimeInput = (0, import_react8.forwardRef)(
735
+ var DateTimeInput = (0, import_react9.forwardRef)(
656
736
  ({
657
737
  separator = "-",
658
738
  dateOrder,
@@ -665,11 +745,11 @@ var DateTimeInput = (0, import_react8.forwardRef)(
665
745
  onValueChange,
666
746
  ...props
667
747
  }, ref) => {
668
- const resolvedOrder = (0, import_react8.useMemo)(
748
+ const resolvedOrder = (0, import_react9.useMemo)(
669
749
  () => dateOrder ?? getDateOrder(locale),
670
750
  [dateOrder, locale]
671
751
  );
672
- const handleChangeText = (0, import_react8.useCallback)(
752
+ const handleChangeText = (0, import_react9.useCallback)(
673
753
  (text) => {
674
754
  const formatted = formatDateTimeInput(
675
755
  text,
@@ -683,7 +763,7 @@ var DateTimeInput = (0, import_react8.forwardRef)(
683
763
  },
684
764
  [resolvedOrder, separator, granularity, hourCycle, onChangeText, onValueChange]
685
765
  );
686
- return /* @__PURE__ */ import_react8.default.createElement(
766
+ return /* @__PURE__ */ import_react9.default.createElement(
687
767
  TextInput,
688
768
  {
689
769
  ref,
@@ -703,18 +783,18 @@ TimeInput.displayName = "TimeInput";
703
783
  DateTimeInput.displayName = "DateTimeInput";
704
784
 
705
785
  // src/components/input/otp-input.tsx
706
- var import_react10 = __toESM(require("react"), 1);
707
- var import_react_native7 = require("react-native");
786
+ var import_react11 = __toESM(require("react"), 1);
787
+ var import_react_native8 = require("react-native");
708
788
 
709
789
  // src/components/input/otp-input.hook.ts
710
- var import_react9 = require("react");
790
+ var import_react10 = require("react");
711
791
  var segmentSizeMap = {
712
792
  sm: { width: 40, height: 40, fontSize: 16 },
713
793
  md: { width: 48, height: 48, fontSize: 20 },
714
794
  lg: { width: 56, height: 56, fontSize: 24 }
715
795
  };
716
796
  var useOTPSegmentSizeStyles = (size) => {
717
- return (0, import_react9.useMemo)(() => segmentSizeMap[size], [size]);
797
+ return (0, import_react10.useMemo)(() => segmentSizeMap[size], [size]);
718
798
  };
719
799
  var useOTPInputState = ({
720
800
  length,
@@ -725,17 +805,15 @@ var useOTPInputState = ({
725
805
  allowedKeys
726
806
  }) => {
727
807
  const isControlled = typeof value === "string";
728
- const [internalValue, setInternalValue] = (0, import_react9.useState)(
729
- defaultValue ?? ""
730
- );
731
- const [activeIndex, setActiveIndex] = (0, import_react9.useState)(-1);
732
- const refs = (0, import_react9.useRef)([]);
808
+ const [internalValue, setInternalValue] = (0, import_react10.useState)(defaultValue ?? "");
809
+ const [activeIndex, setActiveIndex] = (0, import_react10.useState)(-1);
810
+ const refs = (0, import_react10.useRef)([]);
733
811
  const currentValue = isControlled ? value : internalValue;
734
- const segments = (0, import_react9.useMemo)(() => {
812
+ const segments = (0, import_react10.useMemo)(() => {
735
813
  const chars = currentValue.split("");
736
814
  return Array.from({ length }, (_, i) => chars[i] ?? "");
737
815
  }, [currentValue, length]);
738
- const updateValue = (0, import_react9.useCallback)(
816
+ const updateValue = (0, import_react10.useCallback)(
739
817
  (newValue) => {
740
818
  if (!isControlled) {
741
819
  setInternalValue(newValue);
@@ -747,7 +825,7 @@ var useOTPInputState = ({
747
825
  },
748
826
  [isControlled, length, onValueChange, onComplete]
749
827
  );
750
- const handleSegmentChange = (0, import_react9.useCallback)(
828
+ const handleSegmentChange = (0, import_react10.useCallback)(
751
829
  (index, text) => {
752
830
  if (!text) return;
753
831
  const char = text.slice(-1);
@@ -763,7 +841,7 @@ var useOTPInputState = ({
763
841
  },
764
842
  [allowedKeys, currentValue, length, updateValue]
765
843
  );
766
- const handleSegmentKeyPress = (0, import_react9.useCallback)(
844
+ const handleSegmentKeyPress = (0, import_react10.useCallback)(
767
845
  (index, key) => {
768
846
  if (key !== "Backspace") return;
769
847
  const chars = currentValue.split("");
@@ -781,10 +859,10 @@ var useOTPInputState = ({
781
859
  },
782
860
  [currentValue, length, updateValue]
783
861
  );
784
- const handleSegmentFocus = (0, import_react9.useCallback)((index) => {
862
+ const handleSegmentFocus = (0, import_react10.useCallback)((index) => {
785
863
  setActiveIndex(index);
786
864
  }, []);
787
- const handleSegmentBlur = (0, import_react9.useCallback)(() => {
865
+ const handleSegmentBlur = (0, import_react10.useCallback)(() => {
788
866
  setActiveIndex(-1);
789
867
  }, []);
790
868
  return {
@@ -799,8 +877,8 @@ var useOTPInputState = ({
799
877
  };
800
878
 
801
879
  // src/components/input/otp-input.style.ts
802
- var import_react_native6 = require("react-native");
803
- var otpStyles = import_react_native6.StyleSheet.create({
880
+ var import_react_native7 = require("react-native");
881
+ var otpStyles = import_react_native7.StyleSheet.create({
804
882
  container: {
805
883
  gap: 6
806
884
  },
@@ -857,29 +935,29 @@ var OTPSegment = ({
857
935
  onChangeText,
858
936
  onKeyPress,
859
937
  onFocus,
860
- onBlur
938
+ onBlur,
939
+ onPress
861
940
  }) => {
862
- const borderAnimation = (0, import_react10.useRef)(new import_react_native7.Animated.Value(0)).current;
863
- (0, import_react10.useEffect)(() => {
864
- import_react_native7.Animated.timing(borderAnimation, {
941
+ const borderAnimation = (0, import_react11.useRef)(new import_react_native8.Animated.Value(0)).current;
942
+ (0, import_react11.useEffect)(() => {
943
+ import_react_native8.Animated.timing(borderAnimation, {
865
944
  toValue: isActive ? 1 : 0,
866
945
  duration: 200,
867
946
  useNativeDriver: false
868
947
  }).start();
869
948
  }, [borderAnimation, isActive]);
870
- return /* @__PURE__ */ import_react10.default.createElement(
871
- import_react_native7.Pressable,
949
+ return /* @__PURE__ */ import_react11.default.createElement(
950
+ import_react_native8.Pressable,
872
951
  {
873
952
  onPress: () => {
874
953
  if (!isDisabled) {
875
- const inputEl = inputRef;
876
- if (typeof inputEl !== "function") return;
954
+ onPress();
877
955
  }
878
956
  },
879
957
  disabled: isDisabled
880
958
  },
881
- /* @__PURE__ */ import_react10.default.createElement(
882
- import_react_native7.Animated.View,
959
+ /* @__PURE__ */ import_react11.default.createElement(
960
+ import_react_native8.Animated.View,
883
961
  {
884
962
  style: [
885
963
  otpStyles.segment,
@@ -900,16 +978,16 @@ var OTPSegment = ({
900
978
  customSegment?.segment
901
979
  ]
902
980
  },
903
- char && isSecured ? /* @__PURE__ */ import_react10.default.createElement(
904
- import_react_native7.View,
981
+ char && isSecured ? /* @__PURE__ */ import_react11.default.createElement(
982
+ import_react_native8.View,
905
983
  {
906
984
  style: [
907
985
  otpStyles.securedDot,
908
986
  { backgroundColor: variantStyles.textColor }
909
987
  ]
910
988
  }
911
- ) : /* @__PURE__ */ import_react10.default.createElement(
912
- import_react_native7.Text,
989
+ ) : /* @__PURE__ */ import_react11.default.createElement(
990
+ import_react_native8.Text,
913
991
  {
914
992
  style: [
915
993
  otpStyles.segmentText,
@@ -922,8 +1000,8 @@ var OTPSegment = ({
922
1000
  },
923
1001
  char
924
1002
  ),
925
- /* @__PURE__ */ import_react10.default.createElement(
926
- import_react_native7.TextInput,
1003
+ /* @__PURE__ */ import_react11.default.createElement(
1004
+ import_react_native8.TextInput,
927
1005
  {
928
1006
  ref: inputRef,
929
1007
  style: otpStyles.hiddenInput,
@@ -995,8 +1073,20 @@ var OTPInput = ({
995
1073
  isInvalid,
996
1074
  isDisabled
997
1075
  });
998
- return /* @__PURE__ */ import_react10.default.createElement(
999
- import_react_native7.View,
1076
+ const focusSegment = (0, import_react11.useCallback)(
1077
+ (index) => {
1078
+ if (isDisabled) return;
1079
+ refs.current[index]?.focus();
1080
+ },
1081
+ [isDisabled, refs]
1082
+ );
1083
+ const handleContainerPress = (0, import_react11.useCallback)(() => {
1084
+ const firstEmptyIndex = segments.findIndex((segment) => !segment);
1085
+ const targetIndex = firstEmptyIndex === -1 ? length - 1 : firstEmptyIndex;
1086
+ focusSegment(targetIndex);
1087
+ }, [focusSegment, length, segments]);
1088
+ return /* @__PURE__ */ import_react11.default.createElement(
1089
+ import_react_native8.View,
1000
1090
  {
1001
1091
  style: [
1002
1092
  otpStyles.container,
@@ -1005,8 +1095,8 @@ var OTPInput = ({
1005
1095
  customAppearance?.container
1006
1096
  ]
1007
1097
  },
1008
- label && /* @__PURE__ */ import_react10.default.createElement(
1009
- import_react_native7.Text,
1098
+ label && /* @__PURE__ */ import_react11.default.createElement(
1099
+ import_react_native8.Text,
1010
1100
  {
1011
1101
  style: [
1012
1102
  otpStyles.label,
@@ -1019,12 +1109,14 @@ var OTPInput = ({
1019
1109
  },
1020
1110
  label
1021
1111
  ),
1022
- /* @__PURE__ */ import_react10.default.createElement(
1023
- import_react_native7.View,
1112
+ /* @__PURE__ */ import_react11.default.createElement(
1113
+ import_react_native8.Pressable,
1024
1114
  {
1115
+ onPress: handleContainerPress,
1116
+ disabled: isDisabled,
1025
1117
  style: [otpStyles.segmentContainer, customAppearance?.segmentContainer]
1026
1118
  },
1027
- segments.map((char, index) => /* @__PURE__ */ import_react10.default.createElement(
1119
+ segments.map((char, index) => /* @__PURE__ */ import_react11.default.createElement(
1028
1120
  OTPSegment,
1029
1121
  {
1030
1122
  key: index,
@@ -1043,12 +1135,13 @@ var OTPInput = ({
1043
1135
  onChangeText: (text) => handleSegmentChange(index, text),
1044
1136
  onKeyPress: (key) => handleSegmentKeyPress(index, key),
1045
1137
  onFocus: () => handleSegmentFocus(index),
1046
- onBlur: handleSegmentBlur
1138
+ onBlur: handleSegmentBlur,
1139
+ onPress: () => focusSegment(index)
1047
1140
  }
1048
1141
  ))
1049
1142
  ),
1050
- helperText && /* @__PURE__ */ import_react10.default.createElement(
1051
- import_react_native7.Text,
1143
+ helperText && /* @__PURE__ */ import_react11.default.createElement(
1144
+ import_react_native8.Text,
1052
1145
  {
1053
1146
  style: [
1054
1147
  otpStyles.helperText,
@@ -1063,13 +1156,13 @@ var OTPInput = ({
1063
1156
  OTPInput.displayName = "OTPInput";
1064
1157
 
1065
1158
  // src/components/input/number-input.tsx
1066
- var import_react12 = __toESM(require("react"), 1);
1067
- var import_react_native9 = require("react-native");
1159
+ var import_react13 = __toESM(require("react"), 1);
1160
+ var import_react_native10 = require("react-native");
1068
1161
  var import_icons2 = require("@xaui/icons");
1069
1162
  var import_core3 = require("@xaui/core");
1070
1163
 
1071
1164
  // src/components/input/number-input.hook.ts
1072
- var import_react11 = require("react");
1165
+ var import_react12 = require("react");
1073
1166
  var useNumberInputState = ({
1074
1167
  value,
1075
1168
  defaultValue,
@@ -1081,23 +1174,23 @@ var useNumberInputState = ({
1081
1174
  locale
1082
1175
  }) => {
1083
1176
  const isControlled = typeof value === "number";
1084
- const [internalValue, setInternalValue] = (0, import_react11.useState)(
1177
+ const [internalValue, setInternalValue] = (0, import_react12.useState)(
1085
1178
  defaultValue
1086
1179
  );
1087
- const [isEditing, setIsEditing] = (0, import_react11.useState)(false);
1088
- const [rawText, setRawText] = (0, import_react11.useState)("");
1180
+ const [isEditing, setIsEditing] = (0, import_react12.useState)(false);
1181
+ const [rawText, setRawText] = (0, import_react12.useState)("");
1089
1182
  const currentValue = isControlled ? value : internalValue;
1090
- const formatter = (0, import_react11.useMemo)(() => {
1183
+ const formatter = (0, import_react12.useMemo)(() => {
1091
1184
  if (!formatOptions) return null;
1092
1185
  return new Intl.NumberFormat(locale, formatOptions);
1093
1186
  }, [formatOptions, locale]);
1094
- const displayValue = (0, import_react11.useMemo)(() => {
1187
+ const displayValue = (0, import_react12.useMemo)(() => {
1095
1188
  if (isEditing) return rawText;
1096
1189
  if (currentValue === void 0) return "";
1097
1190
  if (formatter) return formatter.format(currentValue);
1098
1191
  return String(currentValue);
1099
1192
  }, [currentValue, formatter, isEditing, rawText]);
1100
- const updateValue = (0, import_react11.useCallback)(
1193
+ const updateValue = (0, import_react12.useCallback)(
1101
1194
  (newValue) => {
1102
1195
  if (!isControlled) {
1103
1196
  setInternalValue(newValue);
@@ -1106,7 +1199,7 @@ var useNumberInputState = ({
1106
1199
  },
1107
1200
  [isControlled, onValueChange]
1108
1201
  );
1109
- const clamp = (0, import_react11.useCallback)(
1202
+ const clamp = (0, import_react12.useCallback)(
1110
1203
  (num) => {
1111
1204
  let clamped = num;
1112
1205
  if (minValue !== void 0 && clamped < minValue) clamped = minValue;
@@ -1115,7 +1208,7 @@ var useNumberInputState = ({
1115
1208
  },
1116
1209
  [minValue, maxValue]
1117
1210
  );
1118
- const handleTextChange = (0, import_react11.useCallback)(
1211
+ const handleTextChange = (0, import_react12.useCallback)(
1119
1212
  (text) => {
1120
1213
  setRawText(text);
1121
1214
  if (text === "" || text === "-") return;
@@ -1125,11 +1218,11 @@ var useNumberInputState = ({
1125
1218
  },
1126
1219
  [updateValue]
1127
1220
  );
1128
- const handleFocus = (0, import_react11.useCallback)(() => {
1221
+ const handleFocus = (0, import_react12.useCallback)(() => {
1129
1222
  setIsEditing(true);
1130
1223
  setRawText(currentValue !== void 0 ? String(currentValue) : "");
1131
1224
  }, [currentValue]);
1132
- const handleBlur = (0, import_react11.useCallback)(() => {
1225
+ const handleBlur = (0, import_react12.useCallback)(() => {
1133
1226
  setIsEditing(false);
1134
1227
  if (rawText === "" || rawText === "-") {
1135
1228
  updateValue(void 0);
@@ -1142,18 +1235,18 @@ var useNumberInputState = ({
1142
1235
  }
1143
1236
  updateValue(clamp(parsed));
1144
1237
  }, [rawText, clamp, updateValue]);
1145
- const handleClear = (0, import_react11.useCallback)(() => {
1238
+ const handleClear = (0, import_react12.useCallback)(() => {
1146
1239
  setRawText("");
1147
1240
  updateValue(void 0);
1148
1241
  }, [updateValue]);
1149
1242
  const canIncrement = maxValue === void 0 || (currentValue ?? 0) + step <= maxValue;
1150
1243
  const canDecrement = minValue === void 0 || (currentValue ?? 0) - step >= minValue;
1151
- const handleIncrement = (0, import_react11.useCallback)(() => {
1244
+ const handleIncrement = (0, import_react12.useCallback)(() => {
1152
1245
  const base = currentValue ?? 0;
1153
1246
  const newValue = clamp(base + step);
1154
1247
  updateValue(newValue);
1155
1248
  }, [currentValue, step, clamp, updateValue]);
1156
- const handleDecrement = (0, import_react11.useCallback)(() => {
1249
+ const handleDecrement = (0, import_react12.useCallback)(() => {
1157
1250
  const base = currentValue ?? 0;
1158
1251
  const newValue = clamp(base - step);
1159
1252
  updateValue(newValue);
@@ -1172,8 +1265,8 @@ var useNumberInputState = ({
1172
1265
  };
1173
1266
 
1174
1267
  // src/components/input/number-input.style.ts
1175
- var import_react_native8 = require("react-native");
1176
- var numberInputStyles = import_react_native8.StyleSheet.create({
1268
+ var import_react_native9 = require("react-native");
1269
+ var numberInputStyles = import_react_native9.StyleSheet.create({
1177
1270
  stepperContainer: {
1178
1271
  flexDirection: "row",
1179
1272
  alignItems: "center",
@@ -1192,7 +1285,7 @@ var numberInputStyles = import_react_native8.StyleSheet.create({
1192
1285
  });
1193
1286
 
1194
1287
  // src/components/input/number-input.tsx
1195
- var NumberInput = (0, import_react12.forwardRef)(
1288
+ var NumberInput = (0, import_react13.forwardRef)(
1196
1289
  ({
1197
1290
  value,
1198
1291
  defaultValue,
@@ -1240,16 +1333,16 @@ var NumberInput = (0, import_react12.forwardRef)(
1240
1333
  locale
1241
1334
  });
1242
1335
  const iconColor = (0, import_core3.withOpacity)(theme.colors.foreground, 0.7);
1243
- const stepperContent = hideStepper || isReadOnly ? void 0 : /* @__PURE__ */ import_react12.default.createElement(
1244
- import_react_native9.View,
1336
+ const stepperContent = hideStepper || isReadOnly ? void 0 : /* @__PURE__ */ import_react13.default.createElement(
1337
+ import_react_native10.View,
1245
1338
  {
1246
1339
  style: [
1247
1340
  numberInputStyles.stepperContainer,
1248
1341
  customAppearance?.stepperContainer
1249
1342
  ]
1250
1343
  },
1251
- /* @__PURE__ */ import_react12.default.createElement(
1252
- import_react_native9.Pressable,
1344
+ /* @__PURE__ */ import_react13.default.createElement(
1345
+ import_react_native10.Pressable,
1253
1346
  {
1254
1347
  onPress: handleDecrement,
1255
1348
  disabled: isDisabled || !canDecrement,
@@ -1261,10 +1354,10 @@ var NumberInput = (0, import_react12.forwardRef)(
1261
1354
  customAppearance?.stepperButton
1262
1355
  ]
1263
1356
  },
1264
- /* @__PURE__ */ import_react12.default.createElement(import_icons2.RemoveIcon, { size: 16, color: iconColor })
1357
+ /* @__PURE__ */ import_react13.default.createElement(import_icons2.RemoveIcon, { size: 16, color: iconColor })
1265
1358
  ),
1266
- /* @__PURE__ */ import_react12.default.createElement(
1267
- import_react_native9.Pressable,
1359
+ /* @__PURE__ */ import_react13.default.createElement(
1360
+ import_react_native10.Pressable,
1268
1361
  {
1269
1362
  onPress: handleIncrement,
1270
1363
  disabled: isDisabled || !canIncrement,
@@ -1276,10 +1369,10 @@ var NumberInput = (0, import_react12.forwardRef)(
1276
1369
  customAppearance?.stepperButton
1277
1370
  ]
1278
1371
  },
1279
- /* @__PURE__ */ import_react12.default.createElement(import_icons2.AddIcon, { size: 16, color: iconColor })
1372
+ /* @__PURE__ */ import_react13.default.createElement(import_icons2.AddIcon, { size: 16, color: iconColor })
1280
1373
  )
1281
1374
  );
1282
- return /* @__PURE__ */ import_react12.default.createElement(
1375
+ return /* @__PURE__ */ import_react13.default.createElement(
1283
1376
  TextInput,
1284
1377
  {
1285
1378
  ref,
@@ -1315,6 +1408,7 @@ NumberInput.displayName = "NumberInput";
1315
1408
  DateTimeInput,
1316
1409
  NumberInput,
1317
1410
  OTPInput,
1411
+ TextArea,
1318
1412
  TextInput,
1319
1413
  TimeInput,
1320
1414
  getDateOrder