@xaui/native 0.0.19 → 0.0.21

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.
@@ -0,0 +1,1321 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/components/input/index.ts
31
+ var input_exports = {};
32
+ __export(input_exports, {
33
+ DateInput: () => DateInput,
34
+ DateTimeInput: () => DateTimeInput,
35
+ NumberInput: () => NumberInput,
36
+ OTPInput: () => OTPInput,
37
+ TextInput: () => TextInput,
38
+ TimeInput: () => TimeInput,
39
+ getDateOrder: () => getDateOrder
40
+ });
41
+ module.exports = __toCommonJS(input_exports);
42
+
43
+ // src/components/input/input.tsx
44
+ var import_react7 = __toESM(require("react"), 1);
45
+ var import_react_native5 = require("react-native");
46
+ var import_icons = require("@xaui/icons");
47
+
48
+ // src/components/input/input.hook.ts
49
+ var import_react6 = require("react");
50
+ var import_core = require("@xaui/core");
51
+
52
+ // src/core/theme-context.tsx
53
+ var import_react4 = __toESM(require("react"), 1);
54
+ var import_react_native2 = require("react-native");
55
+ var import_theme = require("@xaui/core/theme");
56
+ var import_palette = require("@xaui/core/palette");
57
+
58
+ // src/core/portal/portal.tsx
59
+ var import_react2 = require("react");
60
+
61
+ // src/core/portal/portal-context.ts
62
+ var import_react = require("react");
63
+ var PortalContext = (0, import_react.createContext)(null);
64
+
65
+ // src/core/portal/portal-host.tsx
66
+ var import_react3 = __toESM(require("react"), 1);
67
+ var import_react_native = require("react-native");
68
+ var hostStyles = import_react_native.StyleSheet.create({
69
+ container: {
70
+ flex: 1
71
+ }
72
+ });
73
+
74
+ // src/core/theme-context.tsx
75
+ var XUIThemeContext = (0, import_react4.createContext)(null);
76
+
77
+ // src/core/theme-hooks.ts
78
+ var import_react5 = require("react");
79
+ var import_react_native3 = require("react-native");
80
+ function useXUITheme() {
81
+ const theme = (0, import_react5.useContext)(XUIThemeContext);
82
+ if (!theme) {
83
+ throw new Error("useXUITheme must be used within XUIProvider");
84
+ }
85
+ return theme;
86
+ }
87
+
88
+ // src/core/index.ts
89
+ var import_theme2 = require("@xaui/core/theme");
90
+
91
+ // src/components/input/input.hook.ts
92
+ var sizeMap = {
93
+ sm: {
94
+ minHeight: 40,
95
+ fontSize: 14,
96
+ paddingHorizontal: 12,
97
+ paddingVertical: 8,
98
+ slotGap: 8,
99
+ labelSize: 13,
100
+ helperSize: 12
101
+ },
102
+ md: {
103
+ minHeight: 46,
104
+ fontSize: 16,
105
+ paddingHorizontal: 14,
106
+ paddingVertical: 10,
107
+ slotGap: 10,
108
+ labelSize: 14,
109
+ helperSize: 13
110
+ },
111
+ lg: {
112
+ minHeight: 52,
113
+ fontSize: 17,
114
+ paddingHorizontal: 16,
115
+ paddingVertical: 12,
116
+ slotGap: 12,
117
+ labelSize: 15,
118
+ helperSize: 15
119
+ }
120
+ };
121
+ var useTextInputSizeStyles = (size) => {
122
+ return (0, import_react6.useMemo)(() => sizeMap[size], [size]);
123
+ };
124
+ var useTextInputRadiusStyles = (radius) => {
125
+ const theme = useXUITheme();
126
+ return (0, import_react6.useMemo)(() => {
127
+ if (radius === "full") {
128
+ return { borderRadius: theme.borderRadius.full };
129
+ }
130
+ return { borderRadius: theme.borderRadius[radius] };
131
+ }, [radius, theme.borderRadius]);
132
+ };
133
+ var useTextInputVariantStyles = ({
134
+ themeColor,
135
+ variant,
136
+ isFocused,
137
+ isInvalid,
138
+ isDisabled
139
+ }) => {
140
+ const theme = useXUITheme();
141
+ const safeThemeColor = (0, import_core.getSafeThemeColor)(themeColor);
142
+ const colorScheme = theme.colors[safeThemeColor];
143
+ return (0, import_react6.useMemo)(() => {
144
+ const focusColor = isInvalid ? theme.colors.danger.main : colorScheme.main;
145
+ const neutralBorder = (0, import_core.withOpacity)(theme.colors.foreground, 0.1);
146
+ const textColor = isDisabled ? (0, import_core.withOpacity)(theme.colors.foreground, 0.55) : theme.colors.foreground;
147
+ const placeholderColor = (0, import_core.withOpacity)(theme.colors.foreground, 0.45);
148
+ const labelColor = isInvalid ? theme.colors.danger.main : isFocused ? colorScheme.main : (0, import_core.withOpacity)(theme.colors.foreground, 0.8);
149
+ const helperColor = isInvalid ? theme.colors.danger.main : (0, import_core.withOpacity)(theme.colors.foreground, 0.72);
150
+ if (variant === "underlined") {
151
+ return {
152
+ container: {
153
+ backgroundColor: "transparent",
154
+ borderColor: focusColor,
155
+ borderBottomWidth: isFocused || isInvalid ? 2 : 1
156
+ },
157
+ unfocusedBorderColor: neutralBorder,
158
+ focusedBorderColor: focusColor,
159
+ textColor,
160
+ placeholderColor,
161
+ labelColor,
162
+ helperColor
163
+ };
164
+ }
165
+ if (variant === "bordered") {
166
+ return {
167
+ container: {
168
+ backgroundColor: theme.colors.background,
169
+ borderColor: isFocused || isInvalid ? focusColor : neutralBorder,
170
+ borderWidth: theme.borderWidth.md
171
+ },
172
+ unfocusedBorderColor: neutralBorder,
173
+ focusedBorderColor: focusColor,
174
+ textColor,
175
+ placeholderColor,
176
+ labelColor,
177
+ helperColor
178
+ };
179
+ }
180
+ if (variant === "faded") {
181
+ return {
182
+ container: {
183
+ backgroundColor: (0, import_core.withOpacity)(colorScheme.background, 0.68),
184
+ borderColor: isFocused || isInvalid ? focusColor : "transparent",
185
+ borderWidth: isFocused || isInvalid ? theme.borderWidth.md : 0
186
+ },
187
+ unfocusedBorderColor: "transparent",
188
+ focusedBorderColor: focusColor,
189
+ textColor,
190
+ placeholderColor,
191
+ labelColor,
192
+ helperColor
193
+ };
194
+ }
195
+ return {
196
+ container: {
197
+ backgroundColor: colorScheme.background,
198
+ borderColor: isFocused || isInvalid ? (0, import_core.withPaletteNumber)(focusColor, 500) : "transparent",
199
+ borderWidth: isFocused || isInvalid ? theme.borderWidth.md : 0
200
+ },
201
+ unfocusedBorderColor: "transparent",
202
+ focusedBorderColor: (0, import_core.withPaletteNumber)(focusColor, 500),
203
+ textColor,
204
+ placeholderColor,
205
+ labelColor,
206
+ helperColor
207
+ };
208
+ }, [colorScheme, isDisabled, isFocused, isInvalid, theme, variant]);
209
+ };
210
+
211
+ // src/components/input/input.style.ts
212
+ var import_react_native4 = require("react-native");
213
+ var styles = import_react_native4.StyleSheet.create({
214
+ container: {
215
+ width: "100%",
216
+ gap: 6
217
+ },
218
+ noFullWidth: {
219
+ alignSelf: "flex-start"
220
+ },
221
+ inputContainer: {
222
+ gap: 6
223
+ },
224
+ label: {
225
+ fontWeight: "500"
226
+ },
227
+ inputWrapper: {
228
+ flexDirection: "row",
229
+ alignItems: "center"
230
+ },
231
+ underlinedWrapper: {
232
+ borderBottomLeftRadius: 0,
233
+ borderBottomRightRadius: 0,
234
+ paddingHorizontal: 0
235
+ },
236
+ slot: {
237
+ justifyContent: "center",
238
+ alignItems: "center"
239
+ },
240
+ input: {
241
+ flex: 1,
242
+ padding: 0,
243
+ includeFontPadding: false
244
+ },
245
+ clearButton: {
246
+ justifyContent: "center",
247
+ alignItems: "center",
248
+ marginLeft: 6
249
+ },
250
+ helperText: {
251
+ fontWeight: "400"
252
+ },
253
+ disabled: {
254
+ opacity: 0.6
255
+ }
256
+ });
257
+
258
+ // src/components/input/input.tsx
259
+ var TextInput = (0, import_react7.forwardRef)(
260
+ ({
261
+ value,
262
+ defaultValue,
263
+ onValueChange,
264
+ onChangeText,
265
+ onFocus,
266
+ onBlur,
267
+ label,
268
+ labelPlacement = "outside",
269
+ description,
270
+ errorMessage,
271
+ startContent,
272
+ endContent,
273
+ themeColor = "primary",
274
+ variant = "flat",
275
+ size = "md",
276
+ radius = "md",
277
+ isSecured = false,
278
+ isClearable = false,
279
+ isDisabled = false,
280
+ isReadOnly = false,
281
+ isInvalid = false,
282
+ fullWidth = true,
283
+ customAppearance,
284
+ ...nativeProps
285
+ }, forwardedRef) => {
286
+ const isControlled = typeof value === "string";
287
+ const [internalValue, setInternalValue] = (0, import_react7.useState)(defaultValue ?? "");
288
+ const [isFocused, setIsFocused] = (0, import_react7.useState)(false);
289
+ const internalRef = (0, import_react7.useRef)(null);
290
+ const borderAnimation = (0, import_react7.useRef)(new import_react_native5.Animated.Value(0)).current;
291
+ const inputValue = isControlled ? value ?? "" : internalValue;
292
+ const secureTextEntry = nativeProps.secureTextEntry ?? isSecured;
293
+ const sizeStyles = useTextInputSizeStyles(size);
294
+ const radiusStyles = useTextInputRadiusStyles(radius);
295
+ const variantStyles = useTextInputVariantStyles({
296
+ themeColor,
297
+ variant,
298
+ isFocused,
299
+ isInvalid,
300
+ isDisabled
301
+ });
302
+ (0, import_react7.useEffect)(() => {
303
+ import_react_native5.Animated.timing(borderAnimation, {
304
+ toValue: isFocused || isInvalid ? 1 : 0,
305
+ duration: 200,
306
+ useNativeDriver: false
307
+ }).start();
308
+ }, [borderAnimation, isFocused, isInvalid]);
309
+ const showClearButton = isClearable && !!inputValue && !isDisabled && !isReadOnly && !secureTextEntry && nativeProps.editable !== false;
310
+ const editable = nativeProps.editable ?? (!isDisabled && !isReadOnly);
311
+ const helperText = (0, import_react7.useMemo)(() => {
312
+ if (isInvalid && errorMessage) {
313
+ return errorMessage;
314
+ }
315
+ return description;
316
+ }, [description, errorMessage, isInvalid]);
317
+ const handleChangeText = (text) => {
318
+ if (!isControlled) {
319
+ setInternalValue(text);
320
+ }
321
+ onValueChange?.(text);
322
+ onChangeText?.(text);
323
+ };
324
+ const handleClear = () => {
325
+ if (!isControlled) {
326
+ setInternalValue("");
327
+ }
328
+ onValueChange?.("");
329
+ onChangeText?.("");
330
+ };
331
+ const handleWrapperPress = () => {
332
+ if (isDisabled || isReadOnly || nativeProps.editable === false) return;
333
+ const inputRef = forwardedRef || internalRef;
334
+ if (typeof forwardedRef === "function") {
335
+ internalRef.current?.focus();
336
+ } else if (inputRef?.current) {
337
+ inputRef.current.focus();
338
+ }
339
+ };
340
+ return /* @__PURE__ */ import_react7.default.createElement(
341
+ import_react_native5.View,
342
+ {
343
+ style: [
344
+ styles.container,
345
+ !fullWidth && styles.noFullWidth,
346
+ isDisabled && styles.disabled,
347
+ customAppearance?.container
348
+ ]
349
+ },
350
+ /* @__PURE__ */ import_react7.default.createElement(import_react_native5.View, { style: [styles.inputContainer, customAppearance?.inputContainer] }, label && labelPlacement === "outside" && /* @__PURE__ */ import_react7.default.createElement(
351
+ import_react_native5.Text,
352
+ {
353
+ style: [
354
+ styles.label,
355
+ {
356
+ color: variantStyles.labelColor,
357
+ fontSize: sizeStyles.labelSize
358
+ },
359
+ customAppearance?.label
360
+ ]
361
+ },
362
+ 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,
365
+ {
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
+ ]
400
+ },
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,
404
+ {
405
+ style: [
406
+ styles.label,
407
+ {
408
+ color: variantStyles.labelColor,
409
+ fontSize: sizeStyles.helperSize,
410
+ paddingBottom: 2
411
+ },
412
+ customAppearance?.label
413
+ ]
414
+ },
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);
429
+ },
430
+ editable,
431
+ secureTextEntry,
432
+ placeholderTextColor: variantStyles.placeholderColor,
433
+ style: [
434
+ styles.input,
435
+ {
436
+ color: variantStyles.textColor,
437
+ fontSize: sizeStyles.fontSize
438
+ },
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
+ ))),
455
+ helperText && /* @__PURE__ */ import_react7.default.createElement(
456
+ import_react_native5.Text,
457
+ {
458
+ style: [
459
+ styles.helperText,
460
+ {
461
+ color: variantStyles.helperColor,
462
+ fontSize: sizeStyles.helperSize
463
+ },
464
+ customAppearance?.helperText
465
+ ]
466
+ },
467
+ helperText
468
+ )
469
+ );
470
+ }
471
+ );
472
+ TextInput.displayName = "TextInput";
473
+
474
+ // src/components/input/date-time-input.tsx
475
+ var import_react8 = __toESM(require("react"), 1);
476
+
477
+ // src/components/input/date-time-input.hook.ts
478
+ var YMD_LOCALES = ["ja", "zh", "ko", "hu", "lt", "mn"];
479
+ var MDY_LOCALES = ["en-US", "en-PH", "en-BZ"];
480
+ var getDateOrder = (locale) => {
481
+ try {
482
+ const formatter = new Intl.DateTimeFormat(locale, {
483
+ year: "numeric",
484
+ month: "2-digit",
485
+ day: "2-digit"
486
+ });
487
+ const parts = formatter.formatToParts(new Date(2e3, 0, 2));
488
+ const order = parts.filter((p) => p.type === "year" || p.type === "month" || p.type === "day").map((p) => p.type);
489
+ if (order[0] === "year") return "YMD";
490
+ if (order[0] === "month") return "MDY";
491
+ return "DMY";
492
+ } catch {
493
+ const lang = locale.split("-")[0];
494
+ if (YMD_LOCALES.includes(locale) || YMD_LOCALES.includes(lang)) return "YMD";
495
+ if (MDY_LOCALES.includes(locale)) return "MDY";
496
+ return "DMY";
497
+ }
498
+ };
499
+ var insertAtPositions = (digits, positions, char) => {
500
+ let result = "";
501
+ let digitIndex = 0;
502
+ for (let i = 0; i < positions.length; i++) {
503
+ const segLen = positions[i];
504
+ const segment = digits.slice(digitIndex, digitIndex + segLen);
505
+ if (!segment) break;
506
+ if (i > 0) result += char;
507
+ result += segment;
508
+ digitIndex += segLen;
509
+ }
510
+ return result;
511
+ };
512
+ var formatDateInput = (text, dateOrder, separator) => {
513
+ const digits = text.replace(/\D/g, "").slice(0, 8);
514
+ const segments = dateOrder === "YMD" ? [4, 2, 2] : [2, 2, 4];
515
+ return insertAtPositions(digits, segments, separator);
516
+ };
517
+ var formatTimeInput = (text, granularity, hourCycle) => {
518
+ const cleaned = text.replace(/[^0-9aApPmM ]/g, "");
519
+ const digits = cleaned.replace(/\D/g, "");
520
+ const maxDigits = granularity === "second" ? 6 : 4;
521
+ const trimmed = digits.slice(0, maxDigits);
522
+ const segments = granularity === "second" ? [2, 2, 2] : [2, 2];
523
+ let result = insertAtPositions(trimmed, segments, ":");
524
+ if (hourCycle === 12 && trimmed.length >= 4) {
525
+ const ampmMatch = cleaned.match(/[aApP][mM]?/i);
526
+ if (ampmMatch) {
527
+ const period = ampmMatch[0].toUpperCase().startsWith("P") ? "PM" : "AM";
528
+ result += " " + period;
529
+ }
530
+ }
531
+ return result;
532
+ };
533
+ var formatDateTimeInput = (text, dateOrder, separator, granularity, hourCycle) => {
534
+ const digits = text.replace(/[^0-9aApPmM]/g, "").replace(/[aApPmM]/g, "");
535
+ const dateDigitCount = 8;
536
+ const timeDigitCount = granularity === "second" ? 6 : 4;
537
+ const maxDigits = dateDigitCount + timeDigitCount;
538
+ const trimmed = digits.replace(/\D/g, "").slice(0, maxDigits);
539
+ const datePart = trimmed.slice(0, dateDigitCount);
540
+ const timePart = trimmed.slice(dateDigitCount);
541
+ let result = formatDateInput(datePart, dateOrder, separator);
542
+ if (timePart) {
543
+ const timeSegments = granularity === "second" ? [2, 2, 2] : [2, 2];
544
+ result += " " + insertAtPositions(timePart, timeSegments, ":");
545
+ if (hourCycle === 12 && timePart.length >= 4) {
546
+ const ampmMatch = text.match(/[aApP][mM]?/i);
547
+ if (ampmMatch) {
548
+ const period = ampmMatch[0].toUpperCase().startsWith("P") ? "PM" : "AM";
549
+ result += " " + period;
550
+ }
551
+ }
552
+ }
553
+ return result;
554
+ };
555
+ var getDatePlaceholder = (dateOrder, separator) => {
556
+ const parts = {
557
+ YMD: ["YYYY", "MM", "DD"],
558
+ DMY: ["DD", "MM", "YYYY"],
559
+ MDY: ["MM", "DD", "YYYY"]
560
+ };
561
+ return parts[dateOrder].join(separator);
562
+ };
563
+ var getTimePlaceholder = (granularity, hourCycle) => {
564
+ const hour = hourCycle === 12 ? "hh" : "HH";
565
+ const base = `${hour}:mm`;
566
+ const withSeconds = granularity === "second" ? `${base}:ss` : base;
567
+ return hourCycle === 12 ? `${withSeconds} AM` : withSeconds;
568
+ };
569
+ var getDateTimePlaceholder = (dateOrder, separator, granularity, hourCycle) => {
570
+ return `${getDatePlaceholder(dateOrder, separator)} ${getTimePlaceholder(granularity, hourCycle)}`;
571
+ };
572
+ var getDateMaxLength = (separator) => {
573
+ return 8 + 2 * separator.length;
574
+ };
575
+ var getTimeMaxLength = (granularity, hourCycle) => {
576
+ const base = granularity === "second" ? 8 : 5;
577
+ return hourCycle === 12 ? base + 3 : base;
578
+ };
579
+ var getDateTimeMaxLength = (separator, granularity, hourCycle) => {
580
+ return getDateMaxLength(separator) + 1 + getTimeMaxLength(granularity, hourCycle);
581
+ };
582
+
583
+ // src/components/input/date-time-input.tsx
584
+ var DateInput = (0, import_react8.forwardRef)(
585
+ ({
586
+ separator = "-",
587
+ dateOrder,
588
+ locale = "en-US",
589
+ placeholder,
590
+ maxLength,
591
+ onChangeText,
592
+ onValueChange,
593
+ ...props
594
+ }, ref) => {
595
+ const resolvedOrder = (0, import_react8.useMemo)(
596
+ () => dateOrder ?? getDateOrder(locale),
597
+ [dateOrder, locale]
598
+ );
599
+ const handleChangeText = (0, import_react8.useCallback)(
600
+ (text) => {
601
+ const formatted = formatDateInput(text, resolvedOrder, separator);
602
+ onChangeText?.(formatted);
603
+ onValueChange?.(formatted);
604
+ },
605
+ [resolvedOrder, separator, onChangeText, onValueChange]
606
+ );
607
+ return /* @__PURE__ */ import_react8.default.createElement(
608
+ TextInput,
609
+ {
610
+ ref,
611
+ placeholder: placeholder ?? getDatePlaceholder(resolvedOrder, separator),
612
+ keyboardType: "number-pad",
613
+ autoCapitalize: "none",
614
+ autoCorrect: false,
615
+ maxLength: maxLength ?? getDateMaxLength(separator),
616
+ onChangeText: handleChangeText,
617
+ ...props
618
+ }
619
+ );
620
+ }
621
+ );
622
+ var TimeInput = (0, import_react8.forwardRef)(
623
+ ({
624
+ granularity = "minute",
625
+ hourCycle = 24,
626
+ placeholder,
627
+ maxLength,
628
+ onChangeText,
629
+ onValueChange,
630
+ ...props
631
+ }, ref) => {
632
+ const handleChangeText = (0, import_react8.useCallback)(
633
+ (text) => {
634
+ const formatted = formatTimeInput(text, granularity, hourCycle);
635
+ onChangeText?.(formatted);
636
+ onValueChange?.(formatted);
637
+ },
638
+ [granularity, hourCycle, onChangeText, onValueChange]
639
+ );
640
+ return /* @__PURE__ */ import_react8.default.createElement(
641
+ TextInput,
642
+ {
643
+ ref,
644
+ placeholder: placeholder ?? getTimePlaceholder(granularity, hourCycle),
645
+ keyboardType: "number-pad",
646
+ autoCapitalize: "none",
647
+ autoCorrect: false,
648
+ maxLength: maxLength ?? getTimeMaxLength(granularity, hourCycle),
649
+ onChangeText: handleChangeText,
650
+ ...props
651
+ }
652
+ );
653
+ }
654
+ );
655
+ var DateTimeInput = (0, import_react8.forwardRef)(
656
+ ({
657
+ separator = "-",
658
+ dateOrder,
659
+ locale = "en-US",
660
+ granularity = "minute",
661
+ hourCycle = 24,
662
+ placeholder,
663
+ maxLength,
664
+ onChangeText,
665
+ onValueChange,
666
+ ...props
667
+ }, ref) => {
668
+ const resolvedOrder = (0, import_react8.useMemo)(
669
+ () => dateOrder ?? getDateOrder(locale),
670
+ [dateOrder, locale]
671
+ );
672
+ const handleChangeText = (0, import_react8.useCallback)(
673
+ (text) => {
674
+ const formatted = formatDateTimeInput(
675
+ text,
676
+ resolvedOrder,
677
+ separator,
678
+ granularity,
679
+ hourCycle
680
+ );
681
+ onChangeText?.(formatted);
682
+ onValueChange?.(formatted);
683
+ },
684
+ [resolvedOrder, separator, granularity, hourCycle, onChangeText, onValueChange]
685
+ );
686
+ return /* @__PURE__ */ import_react8.default.createElement(
687
+ TextInput,
688
+ {
689
+ ref,
690
+ placeholder: placeholder ?? getDateTimePlaceholder(resolvedOrder, separator, granularity, hourCycle),
691
+ keyboardType: "number-pad",
692
+ autoCapitalize: "none",
693
+ autoCorrect: false,
694
+ maxLength: maxLength ?? getDateTimeMaxLength(separator, granularity, hourCycle),
695
+ onChangeText: handleChangeText,
696
+ ...props
697
+ }
698
+ );
699
+ }
700
+ );
701
+ DateInput.displayName = "DateInput";
702
+ TimeInput.displayName = "TimeInput";
703
+ DateTimeInput.displayName = "DateTimeInput";
704
+
705
+ // src/components/input/otp-input.tsx
706
+ var import_react10 = __toESM(require("react"), 1);
707
+ var import_react_native7 = require("react-native");
708
+
709
+ // src/components/input/otp-input.hook.ts
710
+ var import_react9 = require("react");
711
+ var segmentSizeMap = {
712
+ sm: { width: 40, height: 40, fontSize: 16 },
713
+ md: { width: 48, height: 48, fontSize: 20 },
714
+ lg: { width: 56, height: 56, fontSize: 24 }
715
+ };
716
+ var useOTPSegmentSizeStyles = (size) => {
717
+ return (0, import_react9.useMemo)(() => segmentSizeMap[size], [size]);
718
+ };
719
+ var useOTPInputState = ({
720
+ length,
721
+ value,
722
+ defaultValue,
723
+ onValueChange,
724
+ onComplete,
725
+ allowedKeys
726
+ }) => {
727
+ 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)([]);
733
+ const currentValue = isControlled ? value : internalValue;
734
+ const segments = (0, import_react9.useMemo)(() => {
735
+ const chars = currentValue.split("");
736
+ return Array.from({ length }, (_, i) => chars[i] ?? "");
737
+ }, [currentValue, length]);
738
+ const updateValue = (0, import_react9.useCallback)(
739
+ (newValue) => {
740
+ if (!isControlled) {
741
+ setInternalValue(newValue);
742
+ }
743
+ onValueChange?.(newValue);
744
+ if (newValue.length === length) {
745
+ onComplete?.(newValue);
746
+ }
747
+ },
748
+ [isControlled, length, onValueChange, onComplete]
749
+ );
750
+ const handleSegmentChange = (0, import_react9.useCallback)(
751
+ (index, text) => {
752
+ if (!text) return;
753
+ const char = text.slice(-1);
754
+ if (!allowedKeys.test(char)) return;
755
+ const chars = currentValue.split("");
756
+ while (chars.length < length) chars.push("");
757
+ chars[index] = char;
758
+ const newValue = chars.join("").replace(/\s+$/, "");
759
+ updateValue(newValue);
760
+ if (index < length - 1) {
761
+ refs.current[index + 1]?.focus();
762
+ }
763
+ },
764
+ [allowedKeys, currentValue, length, updateValue]
765
+ );
766
+ const handleSegmentKeyPress = (0, import_react9.useCallback)(
767
+ (index, key) => {
768
+ if (key !== "Backspace") return;
769
+ const chars = currentValue.split("");
770
+ while (chars.length < length) chars.push("");
771
+ if (chars[index]) {
772
+ chars[index] = "";
773
+ updateValue(chars.join("").replace(/\s+$/, ""));
774
+ return;
775
+ }
776
+ if (index > 0) {
777
+ chars[index - 1] = "";
778
+ updateValue(chars.join("").replace(/\s+$/, ""));
779
+ refs.current[index - 1]?.focus();
780
+ }
781
+ },
782
+ [currentValue, length, updateValue]
783
+ );
784
+ const handleSegmentFocus = (0, import_react9.useCallback)((index) => {
785
+ setActiveIndex(index);
786
+ }, []);
787
+ const handleSegmentBlur = (0, import_react9.useCallback)(() => {
788
+ setActiveIndex(-1);
789
+ }, []);
790
+ return {
791
+ segments,
792
+ activeIndex,
793
+ refs,
794
+ handleSegmentChange,
795
+ handleSegmentKeyPress,
796
+ handleSegmentFocus,
797
+ handleSegmentBlur
798
+ };
799
+ };
800
+
801
+ // src/components/input/otp-input.style.ts
802
+ var import_react_native6 = require("react-native");
803
+ var otpStyles = import_react_native6.StyleSheet.create({
804
+ container: {
805
+ gap: 6
806
+ },
807
+ fullWidth: {
808
+ width: "100%"
809
+ },
810
+ segmentContainer: {
811
+ flexDirection: "row",
812
+ gap: 8
813
+ },
814
+ segment: {
815
+ justifyContent: "center",
816
+ alignItems: "center",
817
+ overflow: "hidden"
818
+ },
819
+ segmentText: {
820
+ fontWeight: "600",
821
+ textAlign: "center"
822
+ },
823
+ securedDot: {
824
+ width: 10,
825
+ height: 10,
826
+ borderRadius: 5
827
+ },
828
+ hiddenInput: {
829
+ position: "absolute",
830
+ width: 1,
831
+ height: 1,
832
+ opacity: 0
833
+ },
834
+ label: {
835
+ fontWeight: "500"
836
+ },
837
+ helperText: {
838
+ fontWeight: "400"
839
+ },
840
+ disabled: {
841
+ opacity: 0.6
842
+ }
843
+ });
844
+
845
+ // src/components/input/otp-input.tsx
846
+ var OTPSegment = ({
847
+ char,
848
+ isActive,
849
+ isSecured,
850
+ isDisabled,
851
+ variantStyles,
852
+ sizeStyles,
853
+ radiusStyles,
854
+ customSegment,
855
+ customSegmentText,
856
+ inputRef,
857
+ onChangeText,
858
+ onKeyPress,
859
+ onFocus,
860
+ onBlur
861
+ }) => {
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, {
865
+ toValue: isActive ? 1 : 0,
866
+ duration: 200,
867
+ useNativeDriver: false
868
+ }).start();
869
+ }, [borderAnimation, isActive]);
870
+ return /* @__PURE__ */ import_react10.default.createElement(
871
+ import_react_native7.Pressable,
872
+ {
873
+ onPress: () => {
874
+ if (!isDisabled) {
875
+ const inputEl = inputRef;
876
+ if (typeof inputEl !== "function") return;
877
+ }
878
+ },
879
+ disabled: isDisabled
880
+ },
881
+ /* @__PURE__ */ import_react10.default.createElement(
882
+ import_react_native7.Animated.View,
883
+ {
884
+ style: [
885
+ otpStyles.segment,
886
+ {
887
+ width: sizeStyles.width,
888
+ height: sizeStyles.height,
889
+ backgroundColor: variantStyles.container.backgroundColor,
890
+ borderWidth: variantStyles.container.borderWidth ?? 0,
891
+ borderRadius: radiusStyles.borderRadius,
892
+ borderColor: borderAnimation.interpolate({
893
+ inputRange: [0, 1],
894
+ outputRange: [
895
+ variantStyles.unfocusedBorderColor,
896
+ variantStyles.focusedBorderColor
897
+ ]
898
+ })
899
+ },
900
+ customSegment?.segment
901
+ ]
902
+ },
903
+ char && isSecured ? /* @__PURE__ */ import_react10.default.createElement(
904
+ import_react_native7.View,
905
+ {
906
+ style: [
907
+ otpStyles.securedDot,
908
+ { backgroundColor: variantStyles.textColor }
909
+ ]
910
+ }
911
+ ) : /* @__PURE__ */ import_react10.default.createElement(
912
+ import_react_native7.Text,
913
+ {
914
+ style: [
915
+ otpStyles.segmentText,
916
+ {
917
+ color: variantStyles.textColor,
918
+ fontSize: sizeStyles.fontSize
919
+ },
920
+ customSegmentText?.segmentText
921
+ ]
922
+ },
923
+ char
924
+ ),
925
+ /* @__PURE__ */ import_react10.default.createElement(
926
+ import_react_native7.TextInput,
927
+ {
928
+ ref: inputRef,
929
+ style: otpStyles.hiddenInput,
930
+ value: char,
931
+ onChangeText,
932
+ onKeyPress: (e) => onKeyPress(e.nativeEvent.key),
933
+ onFocus,
934
+ onBlur,
935
+ maxLength: 2,
936
+ keyboardType: "number-pad",
937
+ editable: !isDisabled,
938
+ caretHidden: true
939
+ }
940
+ )
941
+ )
942
+ );
943
+ };
944
+ var OTPInput = ({
945
+ length = 4,
946
+ value,
947
+ defaultValue,
948
+ onValueChange,
949
+ onComplete,
950
+ variant = "flat",
951
+ size = "md",
952
+ radius = "md",
953
+ themeColor = "primary",
954
+ isDisabled = false,
955
+ isInvalid = false,
956
+ isSecured = false,
957
+ errorMessage,
958
+ description,
959
+ label,
960
+ allowedKeys = /^[0-9]$/,
961
+ customAppearance,
962
+ fullWidth = false
963
+ }) => {
964
+ const sizeStyles = useOTPSegmentSizeStyles(size);
965
+ const radiusStyles = useTextInputRadiusStyles(radius);
966
+ const variantStyles = useTextInputVariantStyles({
967
+ themeColor,
968
+ variant,
969
+ isFocused: false,
970
+ isInvalid,
971
+ isDisabled
972
+ });
973
+ const {
974
+ segments,
975
+ activeIndex,
976
+ refs,
977
+ handleSegmentChange,
978
+ handleSegmentKeyPress,
979
+ handleSegmentFocus,
980
+ handleSegmentBlur
981
+ } = useOTPInputState({
982
+ length,
983
+ value,
984
+ defaultValue,
985
+ onValueChange,
986
+ onComplete,
987
+ allowedKeys
988
+ });
989
+ const helperText = isInvalid && errorMessage ? errorMessage : description;
990
+ const helperColor = isInvalid ? variantStyles.helperColor : variantStyles.helperColor;
991
+ const activeVariantStyles = useTextInputVariantStyles({
992
+ themeColor,
993
+ variant,
994
+ isFocused: true,
995
+ isInvalid,
996
+ isDisabled
997
+ });
998
+ return /* @__PURE__ */ import_react10.default.createElement(
999
+ import_react_native7.View,
1000
+ {
1001
+ style: [
1002
+ otpStyles.container,
1003
+ fullWidth && otpStyles.fullWidth,
1004
+ isDisabled && otpStyles.disabled,
1005
+ customAppearance?.container
1006
+ ]
1007
+ },
1008
+ label && /* @__PURE__ */ import_react10.default.createElement(
1009
+ import_react_native7.Text,
1010
+ {
1011
+ style: [
1012
+ otpStyles.label,
1013
+ {
1014
+ color: variantStyles.labelColor,
1015
+ fontSize: 14
1016
+ },
1017
+ customAppearance?.label
1018
+ ]
1019
+ },
1020
+ label
1021
+ ),
1022
+ /* @__PURE__ */ import_react10.default.createElement(
1023
+ import_react_native7.View,
1024
+ {
1025
+ style: [otpStyles.segmentContainer, customAppearance?.segmentContainer]
1026
+ },
1027
+ segments.map((char, index) => /* @__PURE__ */ import_react10.default.createElement(
1028
+ OTPSegment,
1029
+ {
1030
+ key: index,
1031
+ char,
1032
+ isActive: activeIndex === index,
1033
+ isSecured,
1034
+ isDisabled,
1035
+ variantStyles: activeIndex === index ? activeVariantStyles : variantStyles,
1036
+ sizeStyles,
1037
+ radiusStyles,
1038
+ customSegment: customAppearance,
1039
+ customSegmentText: customAppearance,
1040
+ inputRef: (ref) => {
1041
+ refs.current[index] = ref;
1042
+ },
1043
+ onChangeText: (text) => handleSegmentChange(index, text),
1044
+ onKeyPress: (key) => handleSegmentKeyPress(index, key),
1045
+ onFocus: () => handleSegmentFocus(index),
1046
+ onBlur: handleSegmentBlur
1047
+ }
1048
+ ))
1049
+ ),
1050
+ helperText && /* @__PURE__ */ import_react10.default.createElement(
1051
+ import_react_native7.Text,
1052
+ {
1053
+ style: [
1054
+ otpStyles.helperText,
1055
+ { color: helperColor, fontSize: 13 },
1056
+ customAppearance?.helperText
1057
+ ]
1058
+ },
1059
+ helperText
1060
+ )
1061
+ );
1062
+ };
1063
+ OTPInput.displayName = "OTPInput";
1064
+
1065
+ // src/components/input/number-input.tsx
1066
+ var import_react12 = __toESM(require("react"), 1);
1067
+ var import_react_native9 = require("react-native");
1068
+ var import_icons2 = require("@xaui/icons");
1069
+ var import_core3 = require("@xaui/core");
1070
+
1071
+ // src/components/input/number-input.hook.ts
1072
+ var import_react11 = require("react");
1073
+ var useNumberInputState = ({
1074
+ value,
1075
+ defaultValue,
1076
+ onValueChange,
1077
+ minValue,
1078
+ maxValue,
1079
+ step,
1080
+ formatOptions,
1081
+ locale
1082
+ }) => {
1083
+ const isControlled = typeof value === "number";
1084
+ const [internalValue, setInternalValue] = (0, import_react11.useState)(
1085
+ defaultValue
1086
+ );
1087
+ const [isEditing, setIsEditing] = (0, import_react11.useState)(false);
1088
+ const [rawText, setRawText] = (0, import_react11.useState)("");
1089
+ const currentValue = isControlled ? value : internalValue;
1090
+ const formatter = (0, import_react11.useMemo)(() => {
1091
+ if (!formatOptions) return null;
1092
+ return new Intl.NumberFormat(locale, formatOptions);
1093
+ }, [formatOptions, locale]);
1094
+ const displayValue = (0, import_react11.useMemo)(() => {
1095
+ if (isEditing) return rawText;
1096
+ if (currentValue === void 0) return "";
1097
+ if (formatter) return formatter.format(currentValue);
1098
+ return String(currentValue);
1099
+ }, [currentValue, formatter, isEditing, rawText]);
1100
+ const updateValue = (0, import_react11.useCallback)(
1101
+ (newValue) => {
1102
+ if (!isControlled) {
1103
+ setInternalValue(newValue);
1104
+ }
1105
+ onValueChange?.(newValue);
1106
+ },
1107
+ [isControlled, onValueChange]
1108
+ );
1109
+ const clamp = (0, import_react11.useCallback)(
1110
+ (num) => {
1111
+ let clamped = num;
1112
+ if (minValue !== void 0 && clamped < minValue) clamped = minValue;
1113
+ if (maxValue !== void 0 && clamped > maxValue) clamped = maxValue;
1114
+ return clamped;
1115
+ },
1116
+ [minValue, maxValue]
1117
+ );
1118
+ const handleTextChange = (0, import_react11.useCallback)(
1119
+ (text) => {
1120
+ setRawText(text);
1121
+ if (text === "" || text === "-") return;
1122
+ const parsed = parseFloat(text);
1123
+ if (isNaN(parsed)) return;
1124
+ updateValue(parsed);
1125
+ },
1126
+ [updateValue]
1127
+ );
1128
+ const handleFocus = (0, import_react11.useCallback)(() => {
1129
+ setIsEditing(true);
1130
+ setRawText(currentValue !== void 0 ? String(currentValue) : "");
1131
+ }, [currentValue]);
1132
+ const handleBlur = (0, import_react11.useCallback)(() => {
1133
+ setIsEditing(false);
1134
+ if (rawText === "" || rawText === "-") {
1135
+ updateValue(void 0);
1136
+ return;
1137
+ }
1138
+ const parsed = parseFloat(rawText);
1139
+ if (isNaN(parsed)) {
1140
+ updateValue(void 0);
1141
+ return;
1142
+ }
1143
+ updateValue(clamp(parsed));
1144
+ }, [rawText, clamp, updateValue]);
1145
+ const handleClear = (0, import_react11.useCallback)(() => {
1146
+ setRawText("");
1147
+ updateValue(void 0);
1148
+ }, [updateValue]);
1149
+ const canIncrement = maxValue === void 0 || (currentValue ?? 0) + step <= maxValue;
1150
+ const canDecrement = minValue === void 0 || (currentValue ?? 0) - step >= minValue;
1151
+ const handleIncrement = (0, import_react11.useCallback)(() => {
1152
+ const base = currentValue ?? 0;
1153
+ const newValue = clamp(base + step);
1154
+ updateValue(newValue);
1155
+ }, [currentValue, step, clamp, updateValue]);
1156
+ const handleDecrement = (0, import_react11.useCallback)(() => {
1157
+ const base = currentValue ?? 0;
1158
+ const newValue = clamp(base - step);
1159
+ updateValue(newValue);
1160
+ }, [currentValue, step, clamp, updateValue]);
1161
+ return {
1162
+ displayValue,
1163
+ handleTextChange,
1164
+ handleFocus,
1165
+ handleBlur,
1166
+ handleClear,
1167
+ handleIncrement,
1168
+ handleDecrement,
1169
+ canIncrement,
1170
+ canDecrement
1171
+ };
1172
+ };
1173
+
1174
+ // src/components/input/number-input.style.ts
1175
+ var import_react_native8 = require("react-native");
1176
+ var numberInputStyles = import_react_native8.StyleSheet.create({
1177
+ stepperContainer: {
1178
+ flexDirection: "row",
1179
+ alignItems: "center",
1180
+ gap: 4
1181
+ },
1182
+ stepperButton: {
1183
+ justifyContent: "center",
1184
+ alignItems: "center",
1185
+ width: 28,
1186
+ height: 28,
1187
+ borderRadius: 6
1188
+ },
1189
+ stepperDisabled: {
1190
+ opacity: 0.4
1191
+ }
1192
+ });
1193
+
1194
+ // src/components/input/number-input.tsx
1195
+ var NumberInput = (0, import_react12.forwardRef)(
1196
+ ({
1197
+ value,
1198
+ defaultValue,
1199
+ onValueChange,
1200
+ minValue,
1201
+ maxValue,
1202
+ step = 1,
1203
+ hideStepper = false,
1204
+ formatOptions,
1205
+ locale = "en-US",
1206
+ label,
1207
+ labelPlacement = "outside",
1208
+ description,
1209
+ errorMessage,
1210
+ placeholder,
1211
+ themeColor = "primary",
1212
+ variant = "flat",
1213
+ size = "md",
1214
+ radius = "md",
1215
+ isDisabled = false,
1216
+ isReadOnly = false,
1217
+ isInvalid = false,
1218
+ isClearable = false,
1219
+ fullWidth = true,
1220
+ customAppearance
1221
+ }, ref) => {
1222
+ const theme = useXUITheme();
1223
+ const {
1224
+ displayValue,
1225
+ handleTextChange,
1226
+ handleFocus,
1227
+ handleBlur,
1228
+ handleIncrement,
1229
+ handleDecrement,
1230
+ canIncrement,
1231
+ canDecrement
1232
+ } = useNumberInputState({
1233
+ value,
1234
+ defaultValue,
1235
+ onValueChange,
1236
+ minValue,
1237
+ maxValue,
1238
+ step,
1239
+ formatOptions,
1240
+ locale
1241
+ });
1242
+ 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,
1245
+ {
1246
+ style: [
1247
+ numberInputStyles.stepperContainer,
1248
+ customAppearance?.stepperContainer
1249
+ ]
1250
+ },
1251
+ /* @__PURE__ */ import_react12.default.createElement(
1252
+ import_react_native9.Pressable,
1253
+ {
1254
+ onPress: handleDecrement,
1255
+ disabled: isDisabled || !canDecrement,
1256
+ accessibilityLabel: "Decrease value",
1257
+ accessibilityRole: "button",
1258
+ style: [
1259
+ numberInputStyles.stepperButton,
1260
+ (!canDecrement || isDisabled) && numberInputStyles.stepperDisabled,
1261
+ customAppearance?.stepperButton
1262
+ ]
1263
+ },
1264
+ /* @__PURE__ */ import_react12.default.createElement(import_icons2.RemoveIcon, { size: 16, color: iconColor })
1265
+ ),
1266
+ /* @__PURE__ */ import_react12.default.createElement(
1267
+ import_react_native9.Pressable,
1268
+ {
1269
+ onPress: handleIncrement,
1270
+ disabled: isDisabled || !canIncrement,
1271
+ accessibilityLabel: "Increase value",
1272
+ accessibilityRole: "button",
1273
+ style: [
1274
+ numberInputStyles.stepperButton,
1275
+ (!canIncrement || isDisabled) && numberInputStyles.stepperDisabled,
1276
+ customAppearance?.stepperButton
1277
+ ]
1278
+ },
1279
+ /* @__PURE__ */ import_react12.default.createElement(import_icons2.AddIcon, { size: 16, color: iconColor })
1280
+ )
1281
+ );
1282
+ return /* @__PURE__ */ import_react12.default.createElement(
1283
+ TextInput,
1284
+ {
1285
+ ref,
1286
+ value: displayValue,
1287
+ onChangeText: handleTextChange,
1288
+ onFocus: handleFocus,
1289
+ onBlur: handleBlur,
1290
+ label,
1291
+ labelPlacement,
1292
+ description,
1293
+ errorMessage,
1294
+ placeholder,
1295
+ themeColor,
1296
+ variant,
1297
+ size,
1298
+ radius,
1299
+ isDisabled,
1300
+ isReadOnly,
1301
+ isInvalid,
1302
+ isClearable,
1303
+ fullWidth,
1304
+ keyboardType: "numeric",
1305
+ endContent: stepperContent,
1306
+ customAppearance
1307
+ }
1308
+ );
1309
+ }
1310
+ );
1311
+ NumberInput.displayName = "NumberInput";
1312
+ // Annotate the CommonJS export names for ESM import in node:
1313
+ 0 && (module.exports = {
1314
+ DateInput,
1315
+ DateTimeInput,
1316
+ NumberInput,
1317
+ OTPInput,
1318
+ TextInput,
1319
+ TimeInput,
1320
+ getDateOrder
1321
+ });