@react-solutions/inputs 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +98 -0
- package/dist/index.d.mts +1333 -0
- package/dist/index.d.ts +1333 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +111 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,1333 @@
|
|
|
1
|
+
import { FieldValues, Control, FieldErrors } from 'react-hook-form';
|
|
2
|
+
import { ComponentType } from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @module @react-solutions/input
|
|
6
|
+
* @description A comprehensive React form input library with React Hook Form integration and Material-UI components.
|
|
7
|
+
* Provides both standalone FormFields and React Hook Form integrated HookFormFields.
|
|
8
|
+
* @version 0.0.0
|
|
9
|
+
* @author React Solutions
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* import { FormInputTextField, useForm } from '@react-solutions/input';
|
|
14
|
+
* import { useForm } from 'react-hook-form';
|
|
15
|
+
*
|
|
16
|
+
* function MyForm() {
|
|
17
|
+
* const { control, handleSubmit, formState: { errors } } = useForm();
|
|
18
|
+
*
|
|
19
|
+
* const onSubmit = (data) => {
|
|
20
|
+
* console.log(data);
|
|
21
|
+
* };
|
|
22
|
+
*
|
|
23
|
+
* return (
|
|
24
|
+
* <form onSubmit={handleSubmit(onSubmit)}>
|
|
25
|
+
* <FormInputTextField
|
|
26
|
+
* name="username"
|
|
27
|
+
* label="Username"
|
|
28
|
+
* control={control}
|
|
29
|
+
* errors={errors}
|
|
30
|
+
* />
|
|
31
|
+
* <button type="submit">Submit</button>
|
|
32
|
+
* </form>
|
|
33
|
+
* );
|
|
34
|
+
* }
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
// ============================================================================
|
|
39
|
+
// HOOK FORM FIELDS - Text Inputs
|
|
40
|
+
// ============================================================================
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @component FormInputTextField
|
|
44
|
+
* @description React Hook Form integrated text input field component.
|
|
45
|
+
* Wraps TextInputField with React Hook Form Controller for form state management.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```typescript
|
|
49
|
+
* import { FormInputTextField } from '@react-solutions/input';
|
|
50
|
+
* import { useForm } from 'react-hook-form';
|
|
51
|
+
*
|
|
52
|
+
* function LoginForm() {
|
|
53
|
+
* const { control, formState: { errors } } = useForm({
|
|
54
|
+
* defaultValues: { email: '' }
|
|
55
|
+
* });
|
|
56
|
+
*
|
|
57
|
+
* return (
|
|
58
|
+
* <FormInputTextField
|
|
59
|
+
* name="email"
|
|
60
|
+
* label="Email Address"
|
|
61
|
+
* control={control}
|
|
62
|
+
* errors={errors}
|
|
63
|
+
* placeholder="Enter your email"
|
|
64
|
+
* required
|
|
65
|
+
* type="email"
|
|
66
|
+
* />
|
|
67
|
+
* );
|
|
68
|
+
* }
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```typescript
|
|
73
|
+
* // With validation
|
|
74
|
+
* <FormInputTextField
|
|
75
|
+
* name="username"
|
|
76
|
+
* label="Username"
|
|
77
|
+
* control={control}
|
|
78
|
+
* errors={errors}
|
|
79
|
+
* defaultValue=""
|
|
80
|
+
* onChange={(value) => console.log('Changed:', value)}
|
|
81
|
+
* disabled={false}
|
|
82
|
+
* fullWidth
|
|
83
|
+
* size="medium"
|
|
84
|
+
* />
|
|
85
|
+
* ```
|
|
86
|
+
*
|
|
87
|
+
* @props {IFormInputFields} props - Component props
|
|
88
|
+
* @props {string} props.name - Field name for form identification (required)
|
|
89
|
+
* @props {string} [props.label] - Label text for the field
|
|
90
|
+
* @props {Control} props.control - React Hook Form control object (required)
|
|
91
|
+
* @props {FieldErrors} props.errors - React Hook Form errors object (required)
|
|
92
|
+
* @props {string} [props.defaultValue=""] - Default value for the field
|
|
93
|
+
* @props {string} [props.placeholder] - Placeholder text
|
|
94
|
+
* @props {"small"|"medium"} [props.size] - Field size
|
|
95
|
+
* @props {boolean} [props.disabled] - Whether the field is disabled
|
|
96
|
+
* @props {boolean} [props.required] - Whether the field is required
|
|
97
|
+
* @props {boolean} [props.fullWidth] - Full width of the field
|
|
98
|
+
* @props {function} [props.onChange] - Callback fired when value changes: (value: any) => void
|
|
99
|
+
*/
|
|
100
|
+
declare const FormInputTextField: ComponentType<any>;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* @component FormInputTextArea
|
|
104
|
+
* @description React Hook Form integrated textarea field component.
|
|
105
|
+
* Supports multiline text input with customizable rows and resize options.
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```typescript
|
|
109
|
+
* import { FormInputTextArea } from '@react-solutions/input';
|
|
110
|
+
*
|
|
111
|
+
* <FormInputTextArea
|
|
112
|
+
* name="description"
|
|
113
|
+
* label="Description"
|
|
114
|
+
* control={control}
|
|
115
|
+
* errors={errors}
|
|
116
|
+
* placeholder="Enter description"
|
|
117
|
+
* rows={4}
|
|
118
|
+
* minRows={3}
|
|
119
|
+
* maxRows={10}
|
|
120
|
+
* resize="vertical"
|
|
121
|
+
* />
|
|
122
|
+
* ```
|
|
123
|
+
*
|
|
124
|
+
* @props {IFormInputTextAreaFields} props - Component props
|
|
125
|
+
* @props {string} props.name - Field name (required)
|
|
126
|
+
* @props {Control} props.control - React Hook Form control (required)
|
|
127
|
+
* @props {FieldErrors} props.errors - React Hook Form errors (required)
|
|
128
|
+
* @props {number} [props.rows] - Number of rows
|
|
129
|
+
* @props {number} [props.minRows] - Minimum number of rows
|
|
130
|
+
* @props {number} [props.maxRows] - Maximum number of rows
|
|
131
|
+
* @props {"none"|"both"|"horizontal"|"vertical"} [props.resize] - Resize option
|
|
132
|
+
*/
|
|
133
|
+
declare const FormInputTextArea: ComponentType<any>;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* @component FormInputPasswordField
|
|
137
|
+
* @description React Hook Form integrated password input field with secure text masking.
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* ```typescript
|
|
141
|
+
* <FormInputPasswordField
|
|
142
|
+
* name="password"
|
|
143
|
+
* label="Password"
|
|
144
|
+
* control={control}
|
|
145
|
+
* errors={errors}
|
|
146
|
+
* placeholder="Enter password"
|
|
147
|
+
* required
|
|
148
|
+
* autoComplete="current-password"
|
|
149
|
+
* />
|
|
150
|
+
* ```
|
|
151
|
+
*/
|
|
152
|
+
declare const FormInputPasswordField: ComponentType<any>;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* @component FormInputNumberField
|
|
156
|
+
* @description React Hook Form integrated number input field with validation.
|
|
157
|
+
* Supports min/max values, decimal places, and custom patterns.
|
|
158
|
+
*
|
|
159
|
+
* @example
|
|
160
|
+
* ```typescript
|
|
161
|
+
* <FormInputNumberField
|
|
162
|
+
* name="age"
|
|
163
|
+
* label="Age"
|
|
164
|
+
* control={control}
|
|
165
|
+
* errors={errors}
|
|
166
|
+
* min={0}
|
|
167
|
+
* max={120}
|
|
168
|
+
* step={1}
|
|
169
|
+
* allowDecimals={false}
|
|
170
|
+
* />
|
|
171
|
+
* ```
|
|
172
|
+
*
|
|
173
|
+
* @props {IFormInputNumberFields} props - Component props
|
|
174
|
+
* @props {number} [props.min] - Minimum value
|
|
175
|
+
* @props {number} [props.max] - Maximum value
|
|
176
|
+
* @props {number} [props.step] - Step value
|
|
177
|
+
* @props {boolean} [props.allowDecimals] - Allow decimal numbers
|
|
178
|
+
* @props {number} [props.decimalPlaces] - Number of decimal places
|
|
179
|
+
*/
|
|
180
|
+
declare const FormInputNumberField: ComponentType<any>;
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* @component FormInputTelField
|
|
184
|
+
* @description React Hook Form integrated telephone number input field.
|
|
185
|
+
*
|
|
186
|
+
* @example
|
|
187
|
+
* ```typescript
|
|
188
|
+
* <FormInputTelField
|
|
189
|
+
* name="phone"
|
|
190
|
+
* label="Phone Number"
|
|
191
|
+
* control={control}
|
|
192
|
+
* errors={errors}
|
|
193
|
+
* placeholder="+1 (555) 123-4567"
|
|
194
|
+
* />
|
|
195
|
+
* ```
|
|
196
|
+
*/
|
|
197
|
+
declare const FormInputTelField: ComponentType<any>;
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* @component FormInputSearchField
|
|
201
|
+
* @description React Hook Form integrated search input field.
|
|
202
|
+
*
|
|
203
|
+
* @example
|
|
204
|
+
* ```typescript
|
|
205
|
+
* <FormInputSearchField
|
|
206
|
+
* name="search"
|
|
207
|
+
* label="Search"
|
|
208
|
+
* control={control}
|
|
209
|
+
* errors={errors}
|
|
210
|
+
* placeholder="Search..."
|
|
211
|
+
* onEnterPress={(value) => handleSearch(value)}
|
|
212
|
+
* />
|
|
213
|
+
* ```
|
|
214
|
+
*/
|
|
215
|
+
declare const FormInputSearchField: ComponentType<any>;
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* @component FormInputOTPField
|
|
219
|
+
* @description React Hook Form integrated OTP (One-Time Password) input field.
|
|
220
|
+
*
|
|
221
|
+
* @example
|
|
222
|
+
* ```typescript
|
|
223
|
+
* <FormInputOTPField
|
|
224
|
+
* name="otp"
|
|
225
|
+
* label="Enter OTP"
|
|
226
|
+
* control={control}
|
|
227
|
+
* errors={errors}
|
|
228
|
+
* length={6}
|
|
229
|
+
* />
|
|
230
|
+
* ```
|
|
231
|
+
*/
|
|
232
|
+
declare const FormInputOTPField: ComponentType<any>;
|
|
233
|
+
|
|
234
|
+
// ============================================================================
|
|
235
|
+
// HOOK FORM FIELDS - Dropdown Inputs
|
|
236
|
+
// ============================================================================
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* @component FormInputSelect
|
|
240
|
+
* @description React Hook Form integrated select dropdown field.
|
|
241
|
+
* Supports single and multiple selection with custom options.
|
|
242
|
+
*
|
|
243
|
+
* @example
|
|
244
|
+
* ```typescript
|
|
245
|
+
* const options = [
|
|
246
|
+
* { name: 'Option 1', value: '1' },
|
|
247
|
+
* { name: 'Option 2', value: '2' },
|
|
248
|
+
* { name: 'Option 3', value: '3' }
|
|
249
|
+
* ];
|
|
250
|
+
*
|
|
251
|
+
* <FormInputSelect
|
|
252
|
+
* name="category"
|
|
253
|
+
* label="Category"
|
|
254
|
+
* control={control}
|
|
255
|
+
* errors={errors}
|
|
256
|
+
* options={options}
|
|
257
|
+
* defaultValue=""
|
|
258
|
+
* />
|
|
259
|
+
* ```
|
|
260
|
+
*
|
|
261
|
+
* @example
|
|
262
|
+
* ```typescript
|
|
263
|
+
* // Multiple selection
|
|
264
|
+
* <FormInputSelect
|
|
265
|
+
* name="tags"
|
|
266
|
+
* label="Tags"
|
|
267
|
+
* control={control}
|
|
268
|
+
* errors={errors}
|
|
269
|
+
* options={options}
|
|
270
|
+
* multiple
|
|
271
|
+
* limitTags={3}
|
|
272
|
+
* />
|
|
273
|
+
* ```
|
|
274
|
+
*
|
|
275
|
+
* @props {IFormInputFieldsWithOptions} props - Component props
|
|
276
|
+
* @props {Option[]} [props.options=[]] - Options array for dropdown
|
|
277
|
+
* @props {number} [props.limitTags] - Limit number of tags displayed (for multi-select)
|
|
278
|
+
* @props {boolean} [props.multiple] - Allow multiple selections
|
|
279
|
+
*/
|
|
280
|
+
declare const FormInputSelect: ComponentType<any>;
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* @component FormInputMultiSelect
|
|
284
|
+
* @description React Hook Form integrated multi-select dropdown field.
|
|
285
|
+
*
|
|
286
|
+
* @example
|
|
287
|
+
* ```typescript
|
|
288
|
+
* <FormInputMultiSelect
|
|
289
|
+
* name="skills"
|
|
290
|
+
* label="Skills"
|
|
291
|
+
* control={control}
|
|
292
|
+
* errors={errors}
|
|
293
|
+
* options={skillOptions}
|
|
294
|
+
* limitTags={5}
|
|
295
|
+
* filterSelectedOptions
|
|
296
|
+
* />
|
|
297
|
+
* ```
|
|
298
|
+
*/
|
|
299
|
+
declare const FormInputMultiSelect: ComponentType<any>;
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* @component FormInputAutoComplete
|
|
303
|
+
* @description React Hook Form integrated autocomplete field with search functionality.
|
|
304
|
+
*
|
|
305
|
+
* @example
|
|
306
|
+
* ```typescript
|
|
307
|
+
* const countries = [
|
|
308
|
+
* { name: 'United States', value: 'US' },
|
|
309
|
+
* { name: 'Canada', value: 'CA' },
|
|
310
|
+
* { name: 'Mexico', value: 'MX' }
|
|
311
|
+
* ];
|
|
312
|
+
*
|
|
313
|
+
* <FormInputAutoComplete
|
|
314
|
+
* name="country"
|
|
315
|
+
* label="Country"
|
|
316
|
+
* control={control}
|
|
317
|
+
* errors={errors}
|
|
318
|
+
* options={countries}
|
|
319
|
+
* placeholder="Select or type country"
|
|
320
|
+
* />
|
|
321
|
+
* ```
|
|
322
|
+
*
|
|
323
|
+
* @props {IFormInputFieldsWithOptions} props - Component props
|
|
324
|
+
* @props {Option[]} [props.options=[]] - Options array
|
|
325
|
+
* @props {function} [props.getOptionLabel] - Custom function to get option label
|
|
326
|
+
* @props {function} [props.renderOption] - Custom render function for options
|
|
327
|
+
*/
|
|
328
|
+
declare const FormInputAutoComplete: ComponentType<any>;
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* @component FormInputMultiAutoComplete
|
|
332
|
+
* @description React Hook Form integrated multi-select autocomplete field.
|
|
333
|
+
*
|
|
334
|
+
* @example
|
|
335
|
+
* ```typescript
|
|
336
|
+
* <FormInputMultiAutoComplete
|
|
337
|
+
* name="ingredients"
|
|
338
|
+
* label="Ingredients"
|
|
339
|
+
* control={control}
|
|
340
|
+
* errors={errors}
|
|
341
|
+
* options={ingredientOptions}
|
|
342
|
+
* limitTags={3}
|
|
343
|
+
* disableCheckBox={false}
|
|
344
|
+
* />
|
|
345
|
+
* ```
|
|
346
|
+
*/
|
|
347
|
+
declare const FormInputMultiAutoComplete: ComponentType<any>;
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* @component FormInputColorPicker
|
|
351
|
+
* @description React Hook Form integrated color picker field.
|
|
352
|
+
*
|
|
353
|
+
* @example
|
|
354
|
+
* ```typescript
|
|
355
|
+
* <FormInputColorPicker
|
|
356
|
+
* name="themeColor"
|
|
357
|
+
* label="Theme Color"
|
|
358
|
+
* control={control}
|
|
359
|
+
* errors={errors}
|
|
360
|
+
* defaultValue="#000000"
|
|
361
|
+
* />
|
|
362
|
+
* ```
|
|
363
|
+
*/
|
|
364
|
+
declare const FormInputColorPicker: ComponentType<any>;
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* @component FormInputFileUpload
|
|
368
|
+
* @description React Hook Form integrated file upload field.
|
|
369
|
+
*
|
|
370
|
+
* @example
|
|
371
|
+
* ```typescript
|
|
372
|
+
* <FormInputFileUpload
|
|
373
|
+
* name="avatar"
|
|
374
|
+
* label="Upload Avatar"
|
|
375
|
+
* control={control}
|
|
376
|
+
* errors={errors}
|
|
377
|
+
* accept="image/*"
|
|
378
|
+
* multiple={false}
|
|
379
|
+
* />
|
|
380
|
+
* ```
|
|
381
|
+
*/
|
|
382
|
+
declare const FormInputFileUpload: ComponentType<any>;
|
|
383
|
+
|
|
384
|
+
// ============================================================================
|
|
385
|
+
// HOOK FORM FIELDS - Date/Time Inputs
|
|
386
|
+
// ============================================================================
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* @component FormInputDatePicker
|
|
390
|
+
* @description React Hook Form integrated date picker field.
|
|
391
|
+
* Uses MUI X Date Pickers with date-fns adapter.
|
|
392
|
+
*
|
|
393
|
+
* @example
|
|
394
|
+
* ```typescript
|
|
395
|
+
* import { useForm } from 'react-hook-form';
|
|
396
|
+
*
|
|
397
|
+
* <FormInputDatePicker
|
|
398
|
+
* name="birthDate"
|
|
399
|
+
* label="Birth Date"
|
|
400
|
+
* control={control}
|
|
401
|
+
* errors={errors}
|
|
402
|
+
* minDate={new Date('1900-01-01')}
|
|
403
|
+
* maxDate={new Date()}
|
|
404
|
+
* disablePast
|
|
405
|
+
* />
|
|
406
|
+
* ```
|
|
407
|
+
*
|
|
408
|
+
* @example
|
|
409
|
+
* ```typescript
|
|
410
|
+
* // With custom date validation
|
|
411
|
+
* <FormInputDatePicker
|
|
412
|
+
* name="appointmentDate"
|
|
413
|
+
* label="Appointment Date"
|
|
414
|
+
* control={control}
|
|
415
|
+
* errors={errors}
|
|
416
|
+
* shouldDisableDate={(date) => {
|
|
417
|
+
* // Disable weekends
|
|
418
|
+
* return date.getDay() === 0 || date.getDay() === 6;
|
|
419
|
+
* }}
|
|
420
|
+
* />
|
|
421
|
+
* ```
|
|
422
|
+
*
|
|
423
|
+
* @props {IFormInputDateFields} props - Component props
|
|
424
|
+
* @props {Date|null} [props.defaultValue=null] - Default date value
|
|
425
|
+
* @props {Date} [props.minDate] - Minimum selectable date
|
|
426
|
+
* @props {Date} [props.maxDate] - Maximum selectable date
|
|
427
|
+
* @props {boolean} [props.readOnly] - Whether the field is read-only
|
|
428
|
+
* @props {boolean} [props.disablePast] - Whether to disable past dates
|
|
429
|
+
* @props {function} [props.shouldDisableDate] - Custom function to disable specific dates: (date: Date) => boolean
|
|
430
|
+
*/
|
|
431
|
+
declare const FormInputDatePicker: ComponentType<any>;
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
* @component FormInputTimePicker
|
|
435
|
+
* @description React Hook Form integrated time picker field.
|
|
436
|
+
*
|
|
437
|
+
* @example
|
|
438
|
+
* ```typescript
|
|
439
|
+
* <FormInputTimePicker
|
|
440
|
+
* name="appointmentTime"
|
|
441
|
+
* label="Appointment Time"
|
|
442
|
+
* control={control}
|
|
443
|
+
* errors={errors}
|
|
444
|
+
* ampm={true}
|
|
445
|
+
* views={['hours', 'minutes']}
|
|
446
|
+
* />
|
|
447
|
+
* ```
|
|
448
|
+
*
|
|
449
|
+
* @props {IFormInputDateFields} props - Component props
|
|
450
|
+
* @props {boolean} [props.ampm] - Whether to use 12-hour format (AM/PM)
|
|
451
|
+
* @props {TimeView[]} [props.views] - Views to show in picker
|
|
452
|
+
*/
|
|
453
|
+
declare const FormInputTimePicker: ComponentType<any>;
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* @component FormInputTimeClock
|
|
457
|
+
* @description React Hook Form integrated time clock field.
|
|
458
|
+
*
|
|
459
|
+
* @example
|
|
460
|
+
* ```typescript
|
|
461
|
+
* <FormInputTimeClock
|
|
462
|
+
* name="alarmTime"
|
|
463
|
+
* label="Alarm Time"
|
|
464
|
+
* control={control}
|
|
465
|
+
* errors={errors}
|
|
466
|
+
* ampm={true}
|
|
467
|
+
* ampmInClock={true}
|
|
468
|
+
* />
|
|
469
|
+
* ```
|
|
470
|
+
*/
|
|
471
|
+
declare const FormInputTimeClock: ComponentType<any>;
|
|
472
|
+
|
|
473
|
+
/**
|
|
474
|
+
* @component FormInputCalendar
|
|
475
|
+
* @description React Hook Form integrated calendar field.
|
|
476
|
+
*
|
|
477
|
+
* @example
|
|
478
|
+
* ```typescript
|
|
479
|
+
* <FormInputCalendar
|
|
480
|
+
* name="selectedDate"
|
|
481
|
+
* label="Select Date"
|
|
482
|
+
* control={control}
|
|
483
|
+
* errors={errors}
|
|
484
|
+
* defaultValue={new Date()}
|
|
485
|
+
* />
|
|
486
|
+
* ```
|
|
487
|
+
*/
|
|
488
|
+
declare const FormInputCalendar: ComponentType<any>;
|
|
489
|
+
|
|
490
|
+
// ============================================================================
|
|
491
|
+
// HOOK FORM FIELDS - Box Inputs
|
|
492
|
+
// ============================================================================
|
|
493
|
+
|
|
494
|
+
/**
|
|
495
|
+
* @component FormInputCheckBox
|
|
496
|
+
* @description React Hook Form integrated single checkbox field.
|
|
497
|
+
*
|
|
498
|
+
* @example
|
|
499
|
+
* ```typescript
|
|
500
|
+
* <FormInputCheckBox
|
|
501
|
+
* name="agreeToTerms"
|
|
502
|
+
* label="I agree to the terms and conditions"
|
|
503
|
+
* control={control}
|
|
504
|
+
* errors={errors}
|
|
505
|
+
* defaultValue={false}
|
|
506
|
+
* color="primary"
|
|
507
|
+
* labelPlacement="end"
|
|
508
|
+
* />
|
|
509
|
+
* ```
|
|
510
|
+
*
|
|
511
|
+
* @props {IFormInputFields} props - Component props
|
|
512
|
+
* @props {boolean} [props.defaultValue=false] - Default checked state
|
|
513
|
+
*/
|
|
514
|
+
declare const FormInputCheckBox: ComponentType<any>;
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* @component FormInputCheckBoxGroup
|
|
518
|
+
* @description React Hook Form integrated checkbox group field.
|
|
519
|
+
* Supports multiple selections from a list of options.
|
|
520
|
+
*
|
|
521
|
+
* @example
|
|
522
|
+
* ```typescript
|
|
523
|
+
* const interests = [
|
|
524
|
+
* { name: 'Sports', value: 'sports' },
|
|
525
|
+
* { name: 'Music', value: 'music' },
|
|
526
|
+
* { name: 'Reading', value: 'reading' }
|
|
527
|
+
* ];
|
|
528
|
+
*
|
|
529
|
+
* <FormInputCheckBoxGroup
|
|
530
|
+
* name="interests"
|
|
531
|
+
* label="Interests"
|
|
532
|
+
* control={control}
|
|
533
|
+
* errors={errors}
|
|
534
|
+
* options={interests}
|
|
535
|
+
* row={true}
|
|
536
|
+
* color="primary"
|
|
537
|
+
* />
|
|
538
|
+
* ```
|
|
539
|
+
*
|
|
540
|
+
* @props {IFormInputCheckBoxGroupFields} props - Component props
|
|
541
|
+
* @props {Option[]} [props.options=[]] - Options array
|
|
542
|
+
* @props {boolean} [props.row] - Whether to display checkboxes in a row
|
|
543
|
+
* @props {"default"|"primary"|"secondary"|"error"|"info"|"success"|"warning"} [props.color] - Checkbox color
|
|
544
|
+
*/
|
|
545
|
+
declare const FormInputCheckBoxGroup: ComponentType<any>;
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* @component FormInputSwitch
|
|
549
|
+
* @description React Hook Form integrated switch/toggle field.
|
|
550
|
+
*
|
|
551
|
+
* @example
|
|
552
|
+
* ```typescript
|
|
553
|
+
* <FormInputSwitch
|
|
554
|
+
* name="notifications"
|
|
555
|
+
* label="Enable Notifications"
|
|
556
|
+
* control={control}
|
|
557
|
+
* errors={errors}
|
|
558
|
+
* defaultValue={false}
|
|
559
|
+
* color="primary"
|
|
560
|
+
* />
|
|
561
|
+
* ```
|
|
562
|
+
*/
|
|
563
|
+
declare const FormInputSwitch: ComponentType<any>;
|
|
564
|
+
|
|
565
|
+
/**
|
|
566
|
+
* @component FormInputSlider
|
|
567
|
+
* @description React Hook Form integrated slider/range field.
|
|
568
|
+
*
|
|
569
|
+
* @example
|
|
570
|
+
* ```typescript
|
|
571
|
+
* <FormInputSlider
|
|
572
|
+
* name="volume"
|
|
573
|
+
* label="Volume"
|
|
574
|
+
* control={control}
|
|
575
|
+
* errors={errors}
|
|
576
|
+
* defaultValue={50}
|
|
577
|
+
* min={0}
|
|
578
|
+
* max={100}
|
|
579
|
+
* step={1}
|
|
580
|
+
* marks
|
|
581
|
+
* />
|
|
582
|
+
* ```
|
|
583
|
+
*/
|
|
584
|
+
declare const FormInputSlider: ComponentType<any>;
|
|
585
|
+
|
|
586
|
+
/**
|
|
587
|
+
* @component FormInputSingleRadio
|
|
588
|
+
* @description React Hook Form integrated single radio button field.
|
|
589
|
+
*
|
|
590
|
+
* @example
|
|
591
|
+
* ```typescript
|
|
592
|
+
* <FormInputSingleRadio
|
|
593
|
+
* name="gender"
|
|
594
|
+
* label="Male"
|
|
595
|
+
* control={control}
|
|
596
|
+
* errors={errors}
|
|
597
|
+
* value="male"
|
|
598
|
+
* checked={watch('gender') === 'male'}
|
|
599
|
+
* />
|
|
600
|
+
* ```
|
|
601
|
+
*/
|
|
602
|
+
declare const FormInputSingleRadio: ComponentType<any>;
|
|
603
|
+
|
|
604
|
+
/**
|
|
605
|
+
* @component FormInputRadioButtonGroup
|
|
606
|
+
* @description React Hook Form integrated radio button group field.
|
|
607
|
+
* Supports single selection from a list of options.
|
|
608
|
+
*
|
|
609
|
+
* @example
|
|
610
|
+
* ```typescript
|
|
611
|
+
* const genderOptions = [
|
|
612
|
+
* { name: 'Male', value: 'male' },
|
|
613
|
+
* { name: 'Female', value: 'female' },
|
|
614
|
+
* { name: 'Other', value: 'other' }
|
|
615
|
+
* ];
|
|
616
|
+
*
|
|
617
|
+
* <FormInputRadioButtonGroup
|
|
618
|
+
* name="gender"
|
|
619
|
+
* label="Gender"
|
|
620
|
+
* control={control}
|
|
621
|
+
* errors={errors}
|
|
622
|
+
* options={genderOptions}
|
|
623
|
+
* row={true}
|
|
624
|
+
* color="primary"
|
|
625
|
+
* />
|
|
626
|
+
* ```
|
|
627
|
+
*
|
|
628
|
+
* @props {IFormInputFieldsWithOptions} props - Component props
|
|
629
|
+
* @props {Option[]} [props.options=[]] - Options array
|
|
630
|
+
* @props {boolean} [props.row] - Whether to display radio buttons in a row
|
|
631
|
+
*/
|
|
632
|
+
declare const FormInputRadioButtonGroup: ComponentType<any>;
|
|
633
|
+
|
|
634
|
+
// ============================================================================
|
|
635
|
+
// FORM FIELDS - Text Inputs (Standalone)
|
|
636
|
+
// ============================================================================
|
|
637
|
+
|
|
638
|
+
/**
|
|
639
|
+
* @component TextInputField
|
|
640
|
+
* @description Standalone text input field component without React Hook Form integration.
|
|
641
|
+
* Use this when you need direct control over the input value and onChange handler.
|
|
642
|
+
*
|
|
643
|
+
* @example
|
|
644
|
+
* ```typescript
|
|
645
|
+
* import { TextInputField } from '@react-solutions/input';
|
|
646
|
+
* import { useState } from 'react';
|
|
647
|
+
*
|
|
648
|
+
* function MyComponent() {
|
|
649
|
+
* const [value, setValue] = useState('');
|
|
650
|
+
*
|
|
651
|
+
* return (
|
|
652
|
+
* <TextInputField
|
|
653
|
+
* name="username"
|
|
654
|
+
* label="Username"
|
|
655
|
+
* value={value}
|
|
656
|
+
* onChange={(e) => setValue(e.target.value)}
|
|
657
|
+
* placeholder="Enter username"
|
|
658
|
+
* required
|
|
659
|
+
* fullWidth
|
|
660
|
+
* />
|
|
661
|
+
* );
|
|
662
|
+
* }
|
|
663
|
+
* ```
|
|
664
|
+
*
|
|
665
|
+
* @example
|
|
666
|
+
* ```typescript
|
|
667
|
+
* // Multiline textarea
|
|
668
|
+
* <TextInputField
|
|
669
|
+
* name="description"
|
|
670
|
+
* label="Description"
|
|
671
|
+
* value={description}
|
|
672
|
+
* onChange={(e) => setDescription(e.target.value)}
|
|
673
|
+
* multiline
|
|
674
|
+
* rows={4}
|
|
675
|
+
* minRows={3}
|
|
676
|
+
* maxRows={10}
|
|
677
|
+
* resize="vertical"
|
|
678
|
+
* />
|
|
679
|
+
* ```
|
|
680
|
+
*
|
|
681
|
+
* @props {ITextInputFieldProps} props - Component props
|
|
682
|
+
* @props {string} props.value - Current text value (required)
|
|
683
|
+
* @props {function} props.onChange - Callback fired when value changes: (event: ChangeEvent) => void (required)
|
|
684
|
+
* @props {string} [props.name] - Field name
|
|
685
|
+
* @props {string} [props.label] - Label text
|
|
686
|
+
* @props {FieldError} [props.error] - Error object with optional message
|
|
687
|
+
* @props {string} [props.helperText] - Helper text to display below field
|
|
688
|
+
* @props {boolean} [props.disabled=false] - Whether the field is disabled
|
|
689
|
+
* @props {string} [props.placeholder] - Placeholder text
|
|
690
|
+
* @props {"outlined"|"filled"|"standard"} [props.variant="outlined"] - TextField variant
|
|
691
|
+
* @props {"small"|"medium"} [props.size] - TextField size
|
|
692
|
+
* @props {boolean} [props.fullWidth=true] - Full width of the field
|
|
693
|
+
* @props {boolean} [props.multiline=false] - Whether to enable multiline input (textarea)
|
|
694
|
+
* @props {number} [props.rows] - Number of rows for multiline input
|
|
695
|
+
* @props {number} [props.minRows] - Minimum number of rows
|
|
696
|
+
* @props {number} [props.maxRows] - Maximum number of rows
|
|
697
|
+
* @props {"none"|"both"|"horizontal"|"vertical"} [props.resize="both"] - Resize option for textarea
|
|
698
|
+
* @props {number} [props.maxLength] - Maximum length of input
|
|
699
|
+
* @props {string} [props.type="text"] - Input type (text, email, number, tel, url, etc.)
|
|
700
|
+
* @props {React.ReactNode} [props.startAdornment] - Start adornment (icon or element before input)
|
|
701
|
+
* @props {React.ReactNode} [props.endAdornment] - End adornment (icon or element after input)
|
|
702
|
+
* @props {function} [props.onEnterPress] - Callback fired on Enter key press: (value: string) => void
|
|
703
|
+
*/
|
|
704
|
+
declare const TextInputField: ComponentType<any>;
|
|
705
|
+
|
|
706
|
+
/**
|
|
707
|
+
* @component PasswordField
|
|
708
|
+
* @description Standalone password input field with secure text masking.
|
|
709
|
+
*
|
|
710
|
+
* @example
|
|
711
|
+
* ```typescript
|
|
712
|
+
* <PasswordField
|
|
713
|
+
* name="password"
|
|
714
|
+
* label="Password"
|
|
715
|
+
* value={password}
|
|
716
|
+
* onChange={(e) => setPassword(e.target.value)}
|
|
717
|
+
* placeholder="Enter password"
|
|
718
|
+
* showPasswordToggle
|
|
719
|
+
* />
|
|
720
|
+
* ```
|
|
721
|
+
*/
|
|
722
|
+
declare const PasswordField: ComponentType<any>;
|
|
723
|
+
|
|
724
|
+
/**
|
|
725
|
+
* @component NumberField
|
|
726
|
+
* @description Standalone number input field with validation.
|
|
727
|
+
*
|
|
728
|
+
* @example
|
|
729
|
+
* ```typescript
|
|
730
|
+
* <NumberField
|
|
731
|
+
* name="age"
|
|
732
|
+
* label="Age"
|
|
733
|
+
* value={age}
|
|
734
|
+
* onChange={(e) => setAge(e.target.value)}
|
|
735
|
+
* min={0}
|
|
736
|
+
* max={120}
|
|
737
|
+
* step={1}
|
|
738
|
+
* />
|
|
739
|
+
* ```
|
|
740
|
+
*/
|
|
741
|
+
declare const NumberField: ComponentType<any>;
|
|
742
|
+
|
|
743
|
+
/**
|
|
744
|
+
* @component TelInputField
|
|
745
|
+
* @description Standalone telephone number input field.
|
|
746
|
+
*
|
|
747
|
+
* @example
|
|
748
|
+
* ```typescript
|
|
749
|
+
* <TelInputField
|
|
750
|
+
* name="phone"
|
|
751
|
+
* label="Phone Number"
|
|
752
|
+
* value={phone}
|
|
753
|
+
* onChange={(e) => setPhone(e.target.value)}
|
|
754
|
+
* placeholder="+1 (555) 123-4567"
|
|
755
|
+
* />
|
|
756
|
+
* ```
|
|
757
|
+
*/
|
|
758
|
+
declare const TelInputField: ComponentType<any>;
|
|
759
|
+
|
|
760
|
+
/**
|
|
761
|
+
* @component SearchInputField
|
|
762
|
+
* @description Standalone search input field.
|
|
763
|
+
*
|
|
764
|
+
* @example
|
|
765
|
+
* ```typescript
|
|
766
|
+
* <SearchInputField
|
|
767
|
+
* name="search"
|
|
768
|
+
* label="Search"
|
|
769
|
+
* value={searchTerm}
|
|
770
|
+
* onChange={(e) => setSearchTerm(e.target.value)}
|
|
771
|
+
* onEnterPress={(value) => handleSearch(value)}
|
|
772
|
+
* />
|
|
773
|
+
* ```
|
|
774
|
+
*/
|
|
775
|
+
declare const SearchInputField: ComponentType<any>;
|
|
776
|
+
|
|
777
|
+
/**
|
|
778
|
+
* @component OTPField
|
|
779
|
+
* @description Standalone OTP (One-Time Password) input field.
|
|
780
|
+
*
|
|
781
|
+
* @example
|
|
782
|
+
* ```typescript
|
|
783
|
+
* <OTPField
|
|
784
|
+
* name="otp"
|
|
785
|
+
* label="Enter OTP"
|
|
786
|
+
* value={otp}
|
|
787
|
+
* onChange={setOtp}
|
|
788
|
+
* length={6}
|
|
789
|
+
* />
|
|
790
|
+
* ```
|
|
791
|
+
*/
|
|
792
|
+
declare const OTPField: ComponentType<any>;
|
|
793
|
+
|
|
794
|
+
// ============================================================================
|
|
795
|
+
// FORM FIELDS - Dropdown Inputs (Standalone)
|
|
796
|
+
// ============================================================================
|
|
797
|
+
|
|
798
|
+
/**
|
|
799
|
+
* @component SelectInputField
|
|
800
|
+
* @description Standalone select dropdown field without React Hook Form integration.
|
|
801
|
+
*
|
|
802
|
+
* @example
|
|
803
|
+
* ```typescript
|
|
804
|
+
* const options = [
|
|
805
|
+
* { name: 'Option 1', value: '1' },
|
|
806
|
+
* { name: 'Option 2', value: '2' }
|
|
807
|
+
* ];
|
|
808
|
+
*
|
|
809
|
+
* <SelectInputField
|
|
810
|
+
* name="category"
|
|
811
|
+
* label="Category"
|
|
812
|
+
* value={selectedValue}
|
|
813
|
+
* onChange={(e) => setSelectedValue(e.target.value)}
|
|
814
|
+
* options={options}
|
|
815
|
+
* fullWidth
|
|
816
|
+
* />
|
|
817
|
+
* ```
|
|
818
|
+
*
|
|
819
|
+
* @props {ISelectInputFieldProps} props - Component props
|
|
820
|
+
* @props {string|number|(string|number)[]|""} props.value - Current selected value(s) (required)
|
|
821
|
+
* @props {function} props.onChange - Callback fired when value changes: (event: SelectChangeEvent) => void (required)
|
|
822
|
+
* @props {SelectOption[]} props.options - Options array to display in dropdown (required)
|
|
823
|
+
* @props {boolean} [props.multiple] - Whether to allow multiple selections
|
|
824
|
+
* @props {function} [props.renderValue] - Custom render function for selected value(s)
|
|
825
|
+
* @props {function} [props.renderMenuItem] - Custom render function for menu items
|
|
826
|
+
*/
|
|
827
|
+
declare const SelectInputField: ComponentType<any>;
|
|
828
|
+
|
|
829
|
+
/**
|
|
830
|
+
* @component AutoCompleteField
|
|
831
|
+
* @description Standalone autocomplete field with search functionality.
|
|
832
|
+
*
|
|
833
|
+
* @example
|
|
834
|
+
* ```typescript
|
|
835
|
+
* const countries = [
|
|
836
|
+
* { name: 'United States', value: 'US' },
|
|
837
|
+
* { name: 'Canada', value: 'CA' }
|
|
838
|
+
* ];
|
|
839
|
+
*
|
|
840
|
+
* <AutoCompleteField
|
|
841
|
+
* name="country"
|
|
842
|
+
* label="Country"
|
|
843
|
+
* value={selectedCountry}
|
|
844
|
+
* onChange={(_, newValue) => setSelectedCountry(newValue)}
|
|
845
|
+
* options={countries}
|
|
846
|
+
* placeholder="Select or type country"
|
|
847
|
+
* />
|
|
848
|
+
* ```
|
|
849
|
+
*/
|
|
850
|
+
declare const AutoCompleteField: ComponentType<any>;
|
|
851
|
+
|
|
852
|
+
/**
|
|
853
|
+
* @component ColorPickerField
|
|
854
|
+
* @description Standalone color picker field.
|
|
855
|
+
*
|
|
856
|
+
* @example
|
|
857
|
+
* ```typescript
|
|
858
|
+
* <ColorPickerField
|
|
859
|
+
* name="themeColor"
|
|
860
|
+
* label="Theme Color"
|
|
861
|
+
* value={color}
|
|
862
|
+
* onChange={setColor}
|
|
863
|
+
* defaultValue="#000000"
|
|
864
|
+
* />
|
|
865
|
+
* ```
|
|
866
|
+
*/
|
|
867
|
+
declare const ColorPickerField: ComponentType<any>;
|
|
868
|
+
|
|
869
|
+
/**
|
|
870
|
+
* @component FileUploadField
|
|
871
|
+
* @description Standalone file upload field.
|
|
872
|
+
*
|
|
873
|
+
* @example
|
|
874
|
+
* ```typescript
|
|
875
|
+
* <FileUploadField
|
|
876
|
+
* name="avatar"
|
|
877
|
+
* label="Upload Avatar"
|
|
878
|
+
* value={file}
|
|
879
|
+
* onChange={setFile}
|
|
880
|
+
* accept="image/*"
|
|
881
|
+
* multiple={false}
|
|
882
|
+
* />
|
|
883
|
+
* ```
|
|
884
|
+
*/
|
|
885
|
+
declare const FileUploadField: ComponentType<any>;
|
|
886
|
+
|
|
887
|
+
// ============================================================================
|
|
888
|
+
// FORM FIELDS - Date/Time Inputs (Standalone)
|
|
889
|
+
// ============================================================================
|
|
890
|
+
|
|
891
|
+
/**
|
|
892
|
+
* @component DatePickerField
|
|
893
|
+
* @description Standalone date picker field without React Hook Form integration.
|
|
894
|
+
* Uses MUI X Date Pickers with date-fns adapter.
|
|
895
|
+
*
|
|
896
|
+
* @example
|
|
897
|
+
* ```typescript
|
|
898
|
+
* <DatePickerField
|
|
899
|
+
* name="birthDate"
|
|
900
|
+
* label="Birth Date"
|
|
901
|
+
* value={date}
|
|
902
|
+
* onChange={setDate}
|
|
903
|
+
* minDate={new Date('1900-01-01')}
|
|
904
|
+
* maxDate={new Date()}
|
|
905
|
+
* disablePast
|
|
906
|
+
* />
|
|
907
|
+
* ```
|
|
908
|
+
*
|
|
909
|
+
* @props {IDatePickerFieldProps} props - Component props
|
|
910
|
+
* @props {Date|null} props.value - Current selected date value (required)
|
|
911
|
+
* @props {function} props.onChange - Callback fired when date changes: (newValue: Date | null) => void (required)
|
|
912
|
+
* @props {Date} [props.minDate] - Minimum selectable date
|
|
913
|
+
* @props {Date} [props.maxDate] - Maximum selectable date
|
|
914
|
+
* @props {boolean} [props.disablePast] - Whether to disable past dates
|
|
915
|
+
* @props {function} [props.shouldDisableDate] - Custom function to disable specific dates: (date: Date) => boolean
|
|
916
|
+
*/
|
|
917
|
+
declare const DatePickerField: ComponentType<any>;
|
|
918
|
+
|
|
919
|
+
/**
|
|
920
|
+
* @component TimePickerField
|
|
921
|
+
* @description Standalone time picker field.
|
|
922
|
+
*
|
|
923
|
+
* @example
|
|
924
|
+
* ```typescript
|
|
925
|
+
* <TimePickerField
|
|
926
|
+
* name="appointmentTime"
|
|
927
|
+
* label="Appointment Time"
|
|
928
|
+
* value={time}
|
|
929
|
+
* onChange={setTime}
|
|
930
|
+
* ampm={true}
|
|
931
|
+
* views={['hours', 'minutes']}
|
|
932
|
+
* />
|
|
933
|
+
* ```
|
|
934
|
+
*/
|
|
935
|
+
declare const TimePickerField: ComponentType<any>;
|
|
936
|
+
|
|
937
|
+
/**
|
|
938
|
+
* @component TimeClockField
|
|
939
|
+
* @description Standalone time clock field.
|
|
940
|
+
*
|
|
941
|
+
* @example
|
|
942
|
+
* ```typescript
|
|
943
|
+
* <TimeClockField
|
|
944
|
+
* name="alarmTime"
|
|
945
|
+
* label="Alarm Time"
|
|
946
|
+
* value={time}
|
|
947
|
+
* onChange={setTime}
|
|
948
|
+
* ampm={true}
|
|
949
|
+
* ampmInClock={true}
|
|
950
|
+
* />
|
|
951
|
+
* ```
|
|
952
|
+
*/
|
|
953
|
+
declare const TimeClockField: ComponentType<any>;
|
|
954
|
+
|
|
955
|
+
/**
|
|
956
|
+
* @component DateCalendarField
|
|
957
|
+
* @description Standalone calendar field.
|
|
958
|
+
*
|
|
959
|
+
* @example
|
|
960
|
+
* ```typescript
|
|
961
|
+
* <DateCalendarField
|
|
962
|
+
* name="selectedDate"
|
|
963
|
+
* label="Select Date"
|
|
964
|
+
* value={date}
|
|
965
|
+
* onChange={setDate}
|
|
966
|
+
* defaultValue={new Date()}
|
|
967
|
+
* />
|
|
968
|
+
* ```
|
|
969
|
+
*/
|
|
970
|
+
declare const DateCalendarField: ComponentType<any>;
|
|
971
|
+
|
|
972
|
+
// ============================================================================
|
|
973
|
+
// FORM FIELDS - Box Inputs (Standalone)
|
|
974
|
+
// ============================================================================
|
|
975
|
+
|
|
976
|
+
/**
|
|
977
|
+
* @component CheckBoxField
|
|
978
|
+
* @description Standalone single checkbox field without React Hook Form integration.
|
|
979
|
+
*
|
|
980
|
+
* @example
|
|
981
|
+
* ```typescript
|
|
982
|
+
* <CheckBoxField
|
|
983
|
+
* name="agreeToTerms"
|
|
984
|
+
* label="I agree to the terms and conditions"
|
|
985
|
+
* value={checked}
|
|
986
|
+
* onChange={setChecked}
|
|
987
|
+
* color="primary"
|
|
988
|
+
* labelPlacement="end"
|
|
989
|
+
* />
|
|
990
|
+
* ```
|
|
991
|
+
*
|
|
992
|
+
* @props {ICheckboxFieldProps} props - Component props
|
|
993
|
+
* @props {boolean} props.value - Current checked state (required)
|
|
994
|
+
* @props {function} props.onChange - Callback fired when checked state changes: (checked: boolean) => void (required)
|
|
995
|
+
* @props {React.ReactNode} [props.label] - Label text or element
|
|
996
|
+
* @props {"default"|"primary"|"secondary"|"error"|"info"|"success"|"warning"} [props.color] - Checkbox color
|
|
997
|
+
* @props {"end"|"start"|"top"|"bottom"} [props.labelPlacement] - Label placement
|
|
998
|
+
*/
|
|
999
|
+
declare const CheckBoxField: ComponentType<any>;
|
|
1000
|
+
|
|
1001
|
+
/**
|
|
1002
|
+
* @component CheckBoxFieldGroup
|
|
1003
|
+
* @description Standalone checkbox group field.
|
|
1004
|
+
* Supports multiple selections from a list of options.
|
|
1005
|
+
*
|
|
1006
|
+
* @example
|
|
1007
|
+
* ```typescript
|
|
1008
|
+
* const interests = [
|
|
1009
|
+
* { name: 'Sports', value: 'sports' },
|
|
1010
|
+
* { name: 'Music', value: 'music' }
|
|
1011
|
+
* ];
|
|
1012
|
+
*
|
|
1013
|
+
* <CheckBoxFieldGroup
|
|
1014
|
+
* name="interests"
|
|
1015
|
+
* label="Interests"
|
|
1016
|
+
* value={selectedInterests}
|
|
1017
|
+
* onChange={setSelectedInterests}
|
|
1018
|
+
* options={interests}
|
|
1019
|
+
* row={true}
|
|
1020
|
+
* color="primary"
|
|
1021
|
+
* />
|
|
1022
|
+
* ```
|
|
1023
|
+
*/
|
|
1024
|
+
declare const CheckBoxFieldGroup: ComponentType<any>;
|
|
1025
|
+
|
|
1026
|
+
/**
|
|
1027
|
+
* @component RadioButtonField
|
|
1028
|
+
* @description Standalone single radio button field.
|
|
1029
|
+
*
|
|
1030
|
+
* @example
|
|
1031
|
+
* ```typescript
|
|
1032
|
+
* <RadioButtonField
|
|
1033
|
+
* name="gender"
|
|
1034
|
+
* label="Male"
|
|
1035
|
+
* value={selectedGender === 'male'}
|
|
1036
|
+
* onChange={() => setSelectedGender('male')}
|
|
1037
|
+
* color="primary"
|
|
1038
|
+
* />
|
|
1039
|
+
* ```
|
|
1040
|
+
*/
|
|
1041
|
+
declare const RadioButtonField: ComponentType<any>;
|
|
1042
|
+
|
|
1043
|
+
/**
|
|
1044
|
+
* @component RadioButtonFieldGroup
|
|
1045
|
+
* @description Standalone radio button group field.
|
|
1046
|
+
* Supports single selection from a list of options.
|
|
1047
|
+
*
|
|
1048
|
+
* @example
|
|
1049
|
+
* ```typescript
|
|
1050
|
+
* const genderOptions = [
|
|
1051
|
+
* { name: 'Male', value: 'male' },
|
|
1052
|
+
* { name: 'Female', value: 'female' }
|
|
1053
|
+
* ];
|
|
1054
|
+
*
|
|
1055
|
+
* <RadioButtonFieldGroup
|
|
1056
|
+
* name="gender"
|
|
1057
|
+
* label="Gender"
|
|
1058
|
+
* value={selectedGender}
|
|
1059
|
+
* onChange={setSelectedGender}
|
|
1060
|
+
* options={genderOptions}
|
|
1061
|
+
* row={true}
|
|
1062
|
+
* color="primary"
|
|
1063
|
+
* />
|
|
1064
|
+
* ```
|
|
1065
|
+
*/
|
|
1066
|
+
declare const RadioButtonFieldGroup: ComponentType<any>;
|
|
1067
|
+
|
|
1068
|
+
/**
|
|
1069
|
+
* @component SwitchField
|
|
1070
|
+
* @description Standalone switch/toggle field.
|
|
1071
|
+
*
|
|
1072
|
+
* @example
|
|
1073
|
+
* ```typescript
|
|
1074
|
+
* <SwitchField
|
|
1075
|
+
* name="notifications"
|
|
1076
|
+
* label="Enable Notifications"
|
|
1077
|
+
* value={enabled}
|
|
1078
|
+
* onChange={setEnabled}
|
|
1079
|
+
* color="primary"
|
|
1080
|
+
* />
|
|
1081
|
+
* ```
|
|
1082
|
+
*/
|
|
1083
|
+
declare const SwitchField: ComponentType<any>;
|
|
1084
|
+
|
|
1085
|
+
/**
|
|
1086
|
+
* @component SliderField
|
|
1087
|
+
* @description Standalone slider/range field.
|
|
1088
|
+
*
|
|
1089
|
+
* @example
|
|
1090
|
+
* ```typescript
|
|
1091
|
+
* <SliderField
|
|
1092
|
+
* name="volume"
|
|
1093
|
+
* label="Volume"
|
|
1094
|
+
* value={volume}
|
|
1095
|
+
* onChange={setVolume}
|
|
1096
|
+
* min={0}
|
|
1097
|
+
* max={100}
|
|
1098
|
+
* step={1}
|
|
1099
|
+
* marks
|
|
1100
|
+
* />
|
|
1101
|
+
* ```
|
|
1102
|
+
*/
|
|
1103
|
+
declare const SliderField: ComponentType<any>;
|
|
1104
|
+
|
|
1105
|
+
// ============================================================================
|
|
1106
|
+
// TYPES
|
|
1107
|
+
// ============================================================================
|
|
1108
|
+
|
|
1109
|
+
/**
|
|
1110
|
+
* @typedef {Object} Option
|
|
1111
|
+
* @description Base option type for dropdown fields
|
|
1112
|
+
* @property {string} name - Display name of the option
|
|
1113
|
+
* @property {string|number} value - Value of the option
|
|
1114
|
+
* @property {boolean} [disabled] - Whether the option is disabled
|
|
1115
|
+
* @property {*} [key] - Additional properties
|
|
1116
|
+
*/
|
|
1117
|
+
type Option = {
|
|
1118
|
+
name: string;
|
|
1119
|
+
value: number | string;
|
|
1120
|
+
disabled?: boolean;
|
|
1121
|
+
[key: string]: unknown;
|
|
1122
|
+
};
|
|
1123
|
+
|
|
1124
|
+
/**
|
|
1125
|
+
* @typedef {Object} IFormInputFields
|
|
1126
|
+
* @description Base interface for all HookForm field components
|
|
1127
|
+
* @property {string} name - Field name for form identification (required)
|
|
1128
|
+
* @property {string} [label] - Label text for the field
|
|
1129
|
+
* @property {Control} control - React Hook Form control object (required)
|
|
1130
|
+
* @property {FieldErrors} errors - React Hook Form errors object (required)
|
|
1131
|
+
* @property {*} [defaultValue] - Default value for the field
|
|
1132
|
+
* @property {string} [placeholder] - Placeholder text
|
|
1133
|
+
* @property {"small"|"medium"} [size] - Field size
|
|
1134
|
+
* @property {boolean} [disabled] - Whether the field is disabled
|
|
1135
|
+
* @property {boolean} [required] - Whether the field is required
|
|
1136
|
+
* @property {boolean} [fullWidth] - Full width of the field
|
|
1137
|
+
* @property {SxProps} [inputStyles] - Custom styles for input
|
|
1138
|
+
* @property {SxProps} [sx] - Custom styles
|
|
1139
|
+
* @property {*} [slotProps] - Custom slot props for MUI v7
|
|
1140
|
+
* @property {*} [slots] - Custom slots for MUI v7
|
|
1141
|
+
* @property {function} [onChange] - Callback fired when the value changes: (value: any) => void
|
|
1142
|
+
*/
|
|
1143
|
+
interface IFormInputFields<TFieldValues extends FieldValues = FieldValues> {
|
|
1144
|
+
name: string;
|
|
1145
|
+
label?: string;
|
|
1146
|
+
control: Control<TFieldValues>;
|
|
1147
|
+
errors: FieldErrors<TFieldValues>;
|
|
1148
|
+
defaultValue?: any;
|
|
1149
|
+
placeholder?: string;
|
|
1150
|
+
size?: "small" | "medium";
|
|
1151
|
+
disabled?: boolean;
|
|
1152
|
+
required?: boolean;
|
|
1153
|
+
fullWidth?: boolean;
|
|
1154
|
+
inputStyles?: any;
|
|
1155
|
+
sx?: any;
|
|
1156
|
+
slotProps?: any;
|
|
1157
|
+
slots?: any;
|
|
1158
|
+
onChange?: (value: any) => void;
|
|
1159
|
+
[key: string]: any;
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
/**
|
|
1163
|
+
* @typedef {Object} IFormInputFieldsWithOptions
|
|
1164
|
+
* @description Interface for fields with options (Select, AutoComplete, etc.)
|
|
1165
|
+
* @extends {IFormInputFields}
|
|
1166
|
+
* @property {Option[]} [options] - Options array for dropdown fields
|
|
1167
|
+
* @property {number} [limitTags] - Limit number of tags displayed (for multi-select)
|
|
1168
|
+
* @property {function} [renderOption] - Custom render function for options
|
|
1169
|
+
* @property {function} [getOptionLabel] - Custom function to get option label
|
|
1170
|
+
* @property {boolean} [isRenderSingle] - Whether to render single option
|
|
1171
|
+
* @property {function} [renderOptionValue] - Custom render function for option value
|
|
1172
|
+
* @property {boolean} [disableCheckBox] - Whether to disable checkbox in multi-select
|
|
1173
|
+
* @property {boolean} [filterSelectedOptions] - Whether to filter selected options
|
|
1174
|
+
*/
|
|
1175
|
+
interface IFormInputFieldsWithOptions<TFieldValues extends FieldValues = FieldValues>
|
|
1176
|
+
extends IFormInputFields<TFieldValues> {
|
|
1177
|
+
options?: Option[];
|
|
1178
|
+
limitTags?: number;
|
|
1179
|
+
renderOption?: any;
|
|
1180
|
+
getOptionLabel?: any;
|
|
1181
|
+
isRenderSingle?: boolean;
|
|
1182
|
+
renderOptionValue?: any;
|
|
1183
|
+
disableCheckBox?: boolean;
|
|
1184
|
+
filterSelectedOptions?: boolean;
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
/**
|
|
1188
|
+
* @typedef {Object} IFormInputDateFields
|
|
1189
|
+
* @description Interface for date/time picker fields
|
|
1190
|
+
* @extends {IFormInputFields}
|
|
1191
|
+
* @property {Date|null} [defaultValue] - Default date value
|
|
1192
|
+
* @property {Date} [minDate] - Minimum selectable date
|
|
1193
|
+
* @property {Date} [maxDate] - Maximum selectable date
|
|
1194
|
+
* @property {boolean} [readOnly] - Whether the field is read-only
|
|
1195
|
+
* @property {*} [timezone] - Timezone setting
|
|
1196
|
+
* @property {boolean} [ampm] - Whether to use 12-hour format (AM/PM)
|
|
1197
|
+
* @property {TimeView[]} [views] - Views to show in picker
|
|
1198
|
+
* @property {boolean} [ampmInClock] - Whether to show AM/PM in clock
|
|
1199
|
+
* @property {boolean} [disablePast] - Whether to disable past dates
|
|
1200
|
+
* @property {function} [shouldDisableDate] - Custom function to disable specific dates: (date: Date) => boolean
|
|
1201
|
+
*/
|
|
1202
|
+
interface IFormInputDateFields<TFieldValues extends FieldValues = FieldValues>
|
|
1203
|
+
extends IFormInputFields<TFieldValues> {
|
|
1204
|
+
defaultValue?: Date | null;
|
|
1205
|
+
minDate?: Date;
|
|
1206
|
+
maxDate?: Date;
|
|
1207
|
+
readOnly?: boolean;
|
|
1208
|
+
timezone?: any;
|
|
1209
|
+
ampm?: boolean;
|
|
1210
|
+
views?: any[];
|
|
1211
|
+
ampmInClock?: boolean;
|
|
1212
|
+
disablePast?: boolean;
|
|
1213
|
+
shouldDisableDate?: (date: Date) => boolean;
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
/**
|
|
1217
|
+
* @typedef {Object} IFormInputNumberFields
|
|
1218
|
+
* @description Interface for number input fields
|
|
1219
|
+
* @extends {IFormInputFields}
|
|
1220
|
+
* @property {string} [pattern] - Number pattern type or custom pattern string
|
|
1221
|
+
* @property {number} [min] - Minimum value
|
|
1222
|
+
* @property {number} [max] - Maximum value
|
|
1223
|
+
* @property {number} [step] - Step value
|
|
1224
|
+
* @property {boolean} [allowDecimals] - Allow decimal numbers
|
|
1225
|
+
* @property {number} [decimalPlaces] - Number of decimal places
|
|
1226
|
+
*/
|
|
1227
|
+
interface IFormInputNumberFields<TFieldValues extends FieldValues = FieldValues>
|
|
1228
|
+
extends IFormInputFields<TFieldValues> {
|
|
1229
|
+
pattern?: string;
|
|
1230
|
+
min?: number;
|
|
1231
|
+
max?: number;
|
|
1232
|
+
step?: number;
|
|
1233
|
+
allowDecimals?: boolean;
|
|
1234
|
+
decimalPlaces?: number;
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
/**
|
|
1238
|
+
* @typedef {Object} IFormInputTextAreaFields
|
|
1239
|
+
* @description Interface for text area fields
|
|
1240
|
+
* @extends {IFormInputFields}
|
|
1241
|
+
* @property {number} [rows] - Number of rows
|
|
1242
|
+
* @property {number} [minRows] - Minimum number of rows
|
|
1243
|
+
* @property {number} [maxRows] - Maximum number of rows
|
|
1244
|
+
* @property {"none"|"both"|"horizontal"|"vertical"} [resize] - Resize option
|
|
1245
|
+
*/
|
|
1246
|
+
interface IFormInputTextAreaFields<TFieldValues extends FieldValues = FieldValues>
|
|
1247
|
+
extends IFormInputFields<TFieldValues> {
|
|
1248
|
+
rows?: number;
|
|
1249
|
+
minRows?: number;
|
|
1250
|
+
maxRows?: number;
|
|
1251
|
+
resize?: "none" | "both" | "horizontal" | "vertical";
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
/**
|
|
1255
|
+
* @typedef {Object} IFormInputRadioFields
|
|
1256
|
+
* @description Interface for radio button fields (single)
|
|
1257
|
+
* @extends {IFormInputFields}
|
|
1258
|
+
* @property {boolean} [checked] - Current checked state
|
|
1259
|
+
* @property {"default"|"primary"|"secondary"|"error"|"info"|"success"|"warning"} [color] - Radio color
|
|
1260
|
+
* @property {"end"|"start"|"top"|"bottom"} [labelPlacement] - Label placement
|
|
1261
|
+
*/
|
|
1262
|
+
interface IFormInputRadioFields<TFieldValues extends FieldValues = FieldValues>
|
|
1263
|
+
extends IFormInputFields<TFieldValues> {
|
|
1264
|
+
checked?: boolean;
|
|
1265
|
+
color?: "default" | "primary" | "secondary" | "error" | "info" | "success" | "warning";
|
|
1266
|
+
labelPlacement?: "end" | "start" | "top" | "bottom";
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
/**
|
|
1270
|
+
* @typedef {Object} IFormInputCheckBoxGroupFields
|
|
1271
|
+
* @description Interface for checkbox group fields
|
|
1272
|
+
* @extends {IFormInputFieldsWithOptions}
|
|
1273
|
+
* @property {boolean} [row] - Whether to display checkboxes in a row
|
|
1274
|
+
* @property {"default"|"primary"|"secondary"|"error"|"info"|"success"|"warning"} [color] - Checkbox color
|
|
1275
|
+
* @property {"end"|"start"|"top"|"bottom"} [labelPlacement] - Label placement
|
|
1276
|
+
*/
|
|
1277
|
+
interface IFormInputCheckBoxGroupFields<TFieldValues extends FieldValues = FieldValues>
|
|
1278
|
+
extends IFormInputFieldsWithOptions<TFieldValues> {
|
|
1279
|
+
row?: boolean;
|
|
1280
|
+
color?: "default" | "primary" | "secondary" | "error" | "info" | "success" | "warning";
|
|
1281
|
+
labelPlacement?: "end" | "start" | "top" | "bottom";
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
// Default export
|
|
1285
|
+
declare const _default: {
|
|
1286
|
+
// HookFormFields
|
|
1287
|
+
FormInputTextField: ComponentType<any>;
|
|
1288
|
+
FormInputTextArea: ComponentType<any>;
|
|
1289
|
+
FormInputPasswordField: ComponentType<any>;
|
|
1290
|
+
FormInputNumberField: ComponentType<any>;
|
|
1291
|
+
FormInputTelField: ComponentType<any>;
|
|
1292
|
+
FormInputSearchField: ComponentType<any>;
|
|
1293
|
+
FormInputOTPField: ComponentType<any>;
|
|
1294
|
+
FormInputSelect: ComponentType<any>;
|
|
1295
|
+
FormInputMultiSelect: ComponentType<any>;
|
|
1296
|
+
FormInputAutoComplete: ComponentType<any>;
|
|
1297
|
+
FormInputMultiAutoComplete: ComponentType<any>;
|
|
1298
|
+
FormInputColorPicker: ComponentType<any>;
|
|
1299
|
+
FormInputFileUpload: ComponentType<any>;
|
|
1300
|
+
FormInputDatePicker: ComponentType<any>;
|
|
1301
|
+
FormInputTimePicker: ComponentType<any>;
|
|
1302
|
+
FormInputTimeClock: ComponentType<any>;
|
|
1303
|
+
FormInputCalendar: ComponentType<any>;
|
|
1304
|
+
FormInputCheckBox: ComponentType<any>;
|
|
1305
|
+
FormInputCheckBoxGroup: ComponentType<any>;
|
|
1306
|
+
FormInputSwitch: ComponentType<any>;
|
|
1307
|
+
FormInputSlider: ComponentType<any>;
|
|
1308
|
+
FormInputSingleRadio: ComponentType<any>;
|
|
1309
|
+
FormInputRadioButtonGroup: ComponentType<any>;
|
|
1310
|
+
// FormFields
|
|
1311
|
+
TextInputField: ComponentType<any>;
|
|
1312
|
+
PasswordField: ComponentType<any>;
|
|
1313
|
+
NumberField: ComponentType<any>;
|
|
1314
|
+
TelInputField: ComponentType<any>;
|
|
1315
|
+
SearchInputField: ComponentType<any>;
|
|
1316
|
+
OTPField: ComponentType<any>;
|
|
1317
|
+
SelectInputField: ComponentType<any>;
|
|
1318
|
+
AutoCompleteField: ComponentType<any>;
|
|
1319
|
+
ColorPickerField: ComponentType<any>;
|
|
1320
|
+
FileUploadField: ComponentType<any>;
|
|
1321
|
+
DatePickerField: ComponentType<any>;
|
|
1322
|
+
TimePickerField: ComponentType<any>;
|
|
1323
|
+
TimeClockField: ComponentType<any>;
|
|
1324
|
+
DateCalendarField: ComponentType<any>;
|
|
1325
|
+
CheckBoxField: ComponentType<any>;
|
|
1326
|
+
CheckBoxFieldGroup: ComponentType<any>;
|
|
1327
|
+
RadioButtonField: ComponentType<any>;
|
|
1328
|
+
RadioButtonFieldGroup: ComponentType<any>;
|
|
1329
|
+
SwitchField: ComponentType<any>;
|
|
1330
|
+
SliderField: ComponentType<any>;
|
|
1331
|
+
};
|
|
1332
|
+
|
|
1333
|
+
export { AutoCompleteField, CheckBoxField, CheckBoxFieldGroup, ColorPickerField, DateCalendarField, DatePickerField, FileUploadField, FormInputAutoComplete, FormInputCalendar, FormInputCheckBox, FormInputCheckBoxGroup, FormInputColorPicker, FormInputDatePicker, FormInputFileUpload, FormInputMultiAutoComplete, FormInputMultiSelect, FormInputNumberField, FormInputOTPField, FormInputPasswordField, FormInputRadioButtonGroup, FormInputSearchField, FormInputSelect, FormInputSingleRadio, FormInputSlider, FormInputSwitch, FormInputTelField, FormInputTextArea, FormInputTextField, FormInputTimeClock, FormInputTimePicker, type IFormInputCheckBoxGroupFields, type IFormInputDateFields, type IFormInputFields, type IFormInputFieldsWithOptions, type IFormInputNumberFields, type IFormInputRadioFields, type IFormInputTextAreaFields, NumberField, OTPField, type Option, PasswordField, RadioButtonField, RadioButtonFieldGroup, SearchInputField, SelectInputField, SliderField, SwitchField, TelInputField, TextInputField, TimeClockField, TimePickerField, _default as default };
|