@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,492 @@
1
+ import { T as ThemeColor, R as Radius } from '../index-BOw6tbkc.cjs';
2
+ import React, { ReactNode } from 'react';
3
+ import * as react_native from 'react-native';
4
+ import { StyleProp, ViewStyle, TextStyle, TextInputProps as TextInputProps$1, TextInput as TextInput$1 } from 'react-native';
5
+
6
+ type TextInputVariant = 'flat' | 'faded' | 'bordered' | 'underlined';
7
+ type TextInputSize = 'sm' | 'md' | 'lg';
8
+ type TextInputLabelPlacement = 'outside' | 'inside';
9
+ type TextInputCustomAppearance = {
10
+ container?: StyleProp<ViewStyle>;
11
+ inputContainer?: StyleProp<ViewStyle>;
12
+ inputWrapper?: StyleProp<ViewStyle>;
13
+ label?: StyleProp<TextStyle>;
14
+ input?: StyleProp<TextStyle>;
15
+ helperText?: StyleProp<TextStyle>;
16
+ };
17
+ type TextInputProps = Omit<TextInputProps$1, 'value' | 'defaultValue' | 'style'> & {
18
+ /**
19
+ * Controlled value of the input.
20
+ */
21
+ value?: string;
22
+ /**
23
+ * Uncontrolled default value of the input.
24
+ */
25
+ defaultValue?: string;
26
+ /**
27
+ * Called when the input value changes.
28
+ */
29
+ onValueChange?: (value: string) => void;
30
+ /**
31
+ * Input label.
32
+ */
33
+ label?: ReactNode;
34
+ /**
35
+ * Label position relative to the field.
36
+ * @default 'outside'
37
+ */
38
+ labelPlacement?: TextInputLabelPlacement;
39
+ /**
40
+ * Helper text displayed below the input.
41
+ */
42
+ description?: ReactNode;
43
+ /**
44
+ * Error text displayed below the input when invalid.
45
+ */
46
+ errorMessage?: ReactNode;
47
+ /**
48
+ * Start slot content.
49
+ */
50
+ startContent?: ReactNode;
51
+ /**
52
+ * End slot content.
53
+ */
54
+ endContent?: ReactNode;
55
+ /**
56
+ * Theme color used for focus/active states.
57
+ * @default 'primary'
58
+ */
59
+ themeColor?: ThemeColor;
60
+ /**
61
+ * Visual style variant.
62
+ * @default 'flat'
63
+ */
64
+ variant?: TextInputVariant;
65
+ /**
66
+ * Input size.
67
+ * @default 'md'
68
+ */
69
+ size?: TextInputSize;
70
+ /**
71
+ * Input radius.
72
+ * @default 'md'
73
+ */
74
+ radius?: Radius;
75
+ /**
76
+ * Whether the input should be secured (password mode).
77
+ * @default false
78
+ */
79
+ isSecured?: boolean;
80
+ /**
81
+ * Whether to show a clear button when input has value.
82
+ * @default false
83
+ */
84
+ isClearable?: boolean;
85
+ /**
86
+ * Whether the input is disabled.
87
+ * @default false
88
+ */
89
+ isDisabled?: boolean;
90
+ /**
91
+ * Whether the input is read-only.
92
+ * @default false
93
+ */
94
+ isReadOnly?: boolean;
95
+ /**
96
+ * Whether the input is invalid.
97
+ * @default false
98
+ */
99
+ isInvalid?: boolean;
100
+ /**
101
+ * Whether the component should take full available width.
102
+ * @default true
103
+ */
104
+ fullWidth?: boolean;
105
+ /**
106
+ * Optional custom styles for input parts.
107
+ */
108
+ customAppearance?: TextInputCustomAppearance;
109
+ };
110
+
111
+ declare const TextInput: React.ForwardRefExoticComponent<Omit<react_native.TextInputProps, "value" | "defaultValue" | "style"> & {
112
+ value?: string;
113
+ defaultValue?: string;
114
+ onValueChange?: (value: string) => void;
115
+ label?: React.ReactNode;
116
+ labelPlacement?: TextInputLabelPlacement;
117
+ description?: React.ReactNode;
118
+ errorMessage?: React.ReactNode;
119
+ startContent?: React.ReactNode;
120
+ endContent?: React.ReactNode;
121
+ themeColor?: ThemeColor;
122
+ variant?: TextInputVariant;
123
+ size?: TextInputSize;
124
+ radius?: Radius;
125
+ isSecured?: boolean;
126
+ isClearable?: boolean;
127
+ isDisabled?: boolean;
128
+ isReadOnly?: boolean;
129
+ isInvalid?: boolean;
130
+ fullWidth?: boolean;
131
+ customAppearance?: TextInputCustomAppearance;
132
+ } & React.RefAttributes<TextInput$1>>;
133
+
134
+ type DateSeparator = '-' | '/' | '.';
135
+ type DateOrder = 'YMD' | 'DMY' | 'MDY';
136
+ type TimeInputGranularity = 'minute' | 'second';
137
+ type DateInputProps = TextInputProps & {
138
+ /**
139
+ * Separator character between date segments.
140
+ * @default '-'
141
+ */
142
+ separator?: DateSeparator;
143
+ /**
144
+ * Date segment ordering.
145
+ * Auto-detected from locale if not provided.
146
+ */
147
+ dateOrder?: DateOrder;
148
+ /**
149
+ * Locale string used to auto-detect date order.
150
+ * @default 'en-US'
151
+ */
152
+ locale?: string;
153
+ };
154
+ type TimeInputProps = TextInputProps & {
155
+ /**
156
+ * Smallest time unit shown in the placeholder.
157
+ * @default 'minute'
158
+ */
159
+ granularity?: TimeInputGranularity;
160
+ /**
161
+ * 12-hour or 24-hour format placeholder hint.
162
+ * @default 24
163
+ */
164
+ hourCycle?: 12 | 24;
165
+ };
166
+ type DateTimeInputProps = TextInputProps & {
167
+ /**
168
+ * Separator character between date segments.
169
+ * @default '-'
170
+ */
171
+ separator?: DateSeparator;
172
+ /**
173
+ * Date segment ordering.
174
+ * Auto-detected from locale if not provided.
175
+ */
176
+ dateOrder?: DateOrder;
177
+ /**
178
+ * Locale string used to auto-detect date order.
179
+ * @default 'en-US'
180
+ */
181
+ locale?: string;
182
+ /**
183
+ * Smallest time unit shown in the placeholder.
184
+ * @default 'minute'
185
+ */
186
+ granularity?: TimeInputGranularity;
187
+ /**
188
+ * 12-hour or 24-hour format placeholder hint.
189
+ * @default 24
190
+ */
191
+ hourCycle?: 12 | 24;
192
+ };
193
+
194
+ declare const DateInput: React.ForwardRefExoticComponent<Omit<react_native.TextInputProps, "value" | "defaultValue" | "style"> & {
195
+ value?: string;
196
+ defaultValue?: string;
197
+ onValueChange?: (value: string) => void;
198
+ label?: React.ReactNode;
199
+ labelPlacement?: TextInputLabelPlacement;
200
+ description?: React.ReactNode;
201
+ errorMessage?: React.ReactNode;
202
+ startContent?: React.ReactNode;
203
+ endContent?: React.ReactNode;
204
+ themeColor?: ThemeColor;
205
+ variant?: TextInputVariant;
206
+ size?: TextInputSize;
207
+ radius?: Radius;
208
+ isSecured?: boolean;
209
+ isClearable?: boolean;
210
+ isDisabled?: boolean;
211
+ isReadOnly?: boolean;
212
+ isInvalid?: boolean;
213
+ fullWidth?: boolean;
214
+ customAppearance?: TextInputCustomAppearance;
215
+ } & {
216
+ separator?: DateSeparator;
217
+ dateOrder?: DateOrder;
218
+ locale?: string;
219
+ } & React.RefAttributes<TextInput$1>>;
220
+ declare const TimeInput: React.ForwardRefExoticComponent<Omit<react_native.TextInputProps, "value" | "defaultValue" | "style"> & {
221
+ value?: string;
222
+ defaultValue?: string;
223
+ onValueChange?: (value: string) => void;
224
+ label?: React.ReactNode;
225
+ labelPlacement?: TextInputLabelPlacement;
226
+ description?: React.ReactNode;
227
+ errorMessage?: React.ReactNode;
228
+ startContent?: React.ReactNode;
229
+ endContent?: React.ReactNode;
230
+ themeColor?: ThemeColor;
231
+ variant?: TextInputVariant;
232
+ size?: TextInputSize;
233
+ radius?: Radius;
234
+ isSecured?: boolean;
235
+ isClearable?: boolean;
236
+ isDisabled?: boolean;
237
+ isReadOnly?: boolean;
238
+ isInvalid?: boolean;
239
+ fullWidth?: boolean;
240
+ customAppearance?: TextInputCustomAppearance;
241
+ } & {
242
+ granularity?: TimeInputGranularity;
243
+ hourCycle?: 12 | 24;
244
+ } & React.RefAttributes<TextInput$1>>;
245
+ declare const DateTimeInput: React.ForwardRefExoticComponent<Omit<react_native.TextInputProps, "value" | "defaultValue" | "style"> & {
246
+ value?: string;
247
+ defaultValue?: string;
248
+ onValueChange?: (value: string) => void;
249
+ label?: React.ReactNode;
250
+ labelPlacement?: TextInputLabelPlacement;
251
+ description?: React.ReactNode;
252
+ errorMessage?: React.ReactNode;
253
+ startContent?: React.ReactNode;
254
+ endContent?: React.ReactNode;
255
+ themeColor?: ThemeColor;
256
+ variant?: TextInputVariant;
257
+ size?: TextInputSize;
258
+ radius?: Radius;
259
+ isSecured?: boolean;
260
+ isClearable?: boolean;
261
+ isDisabled?: boolean;
262
+ isReadOnly?: boolean;
263
+ isInvalid?: boolean;
264
+ fullWidth?: boolean;
265
+ customAppearance?: TextInputCustomAppearance;
266
+ } & {
267
+ separator?: DateSeparator;
268
+ dateOrder?: DateOrder;
269
+ locale?: string;
270
+ granularity?: TimeInputGranularity;
271
+ hourCycle?: 12 | 24;
272
+ } & React.RefAttributes<TextInput$1>>;
273
+
274
+ type OTPInputCustomAppearance = {
275
+ container?: StyleProp<ViewStyle>;
276
+ segmentContainer?: StyleProp<ViewStyle>;
277
+ segment?: StyleProp<ViewStyle>;
278
+ segmentText?: StyleProp<TextStyle>;
279
+ label?: StyleProp<TextStyle>;
280
+ helperText?: StyleProp<TextStyle>;
281
+ };
282
+ type OTPInputProps = {
283
+ /**
284
+ * Number of OTP segments.
285
+ * @default 4
286
+ */
287
+ length?: number;
288
+ /**
289
+ * Controlled value of the OTP input.
290
+ */
291
+ value?: string;
292
+ /**
293
+ * Uncontrolled default value.
294
+ */
295
+ defaultValue?: string;
296
+ /**
297
+ * Called when the OTP value changes.
298
+ */
299
+ onValueChange?: (value: string) => void;
300
+ /**
301
+ * Called when all segments are filled.
302
+ */
303
+ onComplete?: (value: string) => void;
304
+ /**
305
+ * Visual style variant.
306
+ * @default 'flat'
307
+ */
308
+ variant?: TextInputVariant;
309
+ /**
310
+ * Input size.
311
+ * @default 'md'
312
+ */
313
+ size?: TextInputSize;
314
+ /**
315
+ * Input radius.
316
+ * @default 'md'
317
+ */
318
+ radius?: Radius;
319
+ /**
320
+ * Theme color used for focus/active states.
321
+ * @default 'primary'
322
+ */
323
+ themeColor?: ThemeColor;
324
+ /**
325
+ * Whether the input is disabled.
326
+ * @default false
327
+ */
328
+ isDisabled?: boolean;
329
+ /**
330
+ * Whether the input is invalid.
331
+ * @default false
332
+ */
333
+ isInvalid?: boolean;
334
+ /**
335
+ * Whether to hide entered characters.
336
+ * @default false
337
+ */
338
+ isSecured?: boolean;
339
+ /**
340
+ * Error text displayed below the input when invalid.
341
+ */
342
+ errorMessage?: string;
343
+ /**
344
+ * Helper text displayed below the input.
345
+ */
346
+ description?: string;
347
+ /**
348
+ * Input label.
349
+ */
350
+ label?: string;
351
+ /**
352
+ * Regex to filter allowed key input.
353
+ * @default /^[0-9]$/
354
+ */
355
+ allowedKeys?: RegExp;
356
+ /**
357
+ * Optional custom styles for input parts.
358
+ */
359
+ customAppearance?: OTPInputCustomAppearance;
360
+ /**
361
+ * Whether the component should take full available width.
362
+ * @default false
363
+ */
364
+ fullWidth?: boolean;
365
+ };
366
+
367
+ declare const OTPInput: {
368
+ ({ length, value, defaultValue, onValueChange, onComplete, variant, size, radius, themeColor, isDisabled, isInvalid, isSecured, errorMessage, description, label, allowedKeys, customAppearance, fullWidth, }: OTPInputProps): React.JSX.Element;
369
+ displayName: string;
370
+ };
371
+
372
+ type NumberInputCustomAppearance = TextInputCustomAppearance & {
373
+ stepperContainer?: StyleProp<ViewStyle>;
374
+ stepperButton?: StyleProp<ViewStyle>;
375
+ };
376
+ type NumberInputProps = {
377
+ /**
378
+ * Controlled numeric value.
379
+ */
380
+ value?: number;
381
+ /**
382
+ * Uncontrolled default numeric value.
383
+ */
384
+ defaultValue?: number;
385
+ /**
386
+ * Called when the numeric value changes.
387
+ */
388
+ onValueChange?: (value: number | undefined) => void;
389
+ /**
390
+ * Minimum allowed value.
391
+ */
392
+ minValue?: number;
393
+ /**
394
+ * Maximum allowed value.
395
+ */
396
+ maxValue?: number;
397
+ /**
398
+ * Step increment/decrement amount.
399
+ * @default 1
400
+ */
401
+ step?: number;
402
+ /**
403
+ * Whether to hide the stepper buttons.
404
+ * @default false
405
+ */
406
+ hideStepper?: boolean;
407
+ /**
408
+ * Intl.NumberFormat options for display formatting.
409
+ */
410
+ formatOptions?: Intl.NumberFormatOptions;
411
+ /**
412
+ * Locale for number formatting.
413
+ * @default 'en-US'
414
+ */
415
+ locale?: string;
416
+ /**
417
+ * Input label.
418
+ */
419
+ label?: string;
420
+ /**
421
+ * Label position relative to the field.
422
+ * @default 'outside'
423
+ */
424
+ labelPlacement?: TextInputLabelPlacement;
425
+ /**
426
+ * Helper text displayed below the input.
427
+ */
428
+ description?: string;
429
+ /**
430
+ * Error text displayed below the input when invalid.
431
+ */
432
+ errorMessage?: string;
433
+ /**
434
+ * Placeholder text.
435
+ */
436
+ placeholder?: string;
437
+ /**
438
+ * Theme color used for focus/active states.
439
+ * @default 'primary'
440
+ */
441
+ themeColor?: ThemeColor;
442
+ /**
443
+ * Visual style variant.
444
+ * @default 'flat'
445
+ */
446
+ variant?: TextInputVariant;
447
+ /**
448
+ * Input size.
449
+ * @default 'md'
450
+ */
451
+ size?: TextInputSize;
452
+ /**
453
+ * Input radius.
454
+ * @default 'md'
455
+ */
456
+ radius?: Radius;
457
+ /**
458
+ * Whether the input is disabled.
459
+ * @default false
460
+ */
461
+ isDisabled?: boolean;
462
+ /**
463
+ * Whether the input is read-only.
464
+ * @default false
465
+ */
466
+ isReadOnly?: boolean;
467
+ /**
468
+ * Whether the input is invalid.
469
+ * @default false
470
+ */
471
+ isInvalid?: boolean;
472
+ /**
473
+ * Whether to show a clear button.
474
+ * @default false
475
+ */
476
+ isClearable?: boolean;
477
+ /**
478
+ * Whether the component should take full available width.
479
+ * @default true
480
+ */
481
+ fullWidth?: boolean;
482
+ /**
483
+ * Optional custom styles for input parts.
484
+ */
485
+ customAppearance?: NumberInputCustomAppearance;
486
+ };
487
+
488
+ declare const NumberInput: React.ForwardRefExoticComponent<NumberInputProps & React.RefAttributes<TextInput$1>>;
489
+
490
+ declare const getDateOrder: (locale: string) => DateOrder;
491
+
492
+ export { DateInput, type DateInputProps, type DateOrder, type DateSeparator, DateTimeInput, type DateTimeInputProps, NumberInput, type NumberInputCustomAppearance, type NumberInputProps, OTPInput, type OTPInputCustomAppearance, type OTPInputProps, TextInput, type TextInputCustomAppearance, type TextInputLabelPlacement, type TextInputProps, type TextInputSize, type TextInputVariant, TimeInput, type TimeInputGranularity, type TimeInputProps, getDateOrder };