@react-solutions/inputs 1.0.2 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +162 -98
- package/dist/index.d.mts +3116 -60
- package/dist/index.d.ts +3116 -60
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,98 +1,162 @@
|
|
|
1
|
-
# @react-solutions/inputs
|
|
2
|
-
|
|
3
|
-
<div align="center">
|
|
4
|
-
|
|
5
|
-
[](https://www.npmjs.com/package/@react-solutions/inputs)
|
|
6
|
-
[](https://www.npmjs.com/package/@react-solutions/inputs)
|
|
7
|
-
[](https://bundlephobia.com/package/@react-solutions/inputs)
|
|
8
|
-
|
|
9
|
-
</div>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
|
75
|
-
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
1
|
+
# @react-solutions/inputs
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@react-solutions/inputs)
|
|
6
|
+
[](https://www.npmjs.com/package/@react-solutions/inputs)
|
|
7
|
+
[](https://bundlephobia.com/package/@react-solutions/inputs)
|
|
8
|
+
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
A professional, comprehensive library of React form components built on top of **Material UI**. It offers two powerful ways to build forms: **Standard Controlled Components** for manual state management and **HookForm Components** for seamless integration with `react-hook-form`.
|
|
12
|
+
|
|
13
|
+
## 🚀 Key Features
|
|
14
|
+
|
|
15
|
+
- 🏗️ **Dual Architecture** - Choose between pure controlled components or battle-tested `react-hook-form` wrappers.
|
|
16
|
+
- 🎨 **Material UI Based** - Premium look and feel out of the box with full customization support.
|
|
17
|
+
- 🛡️ **Type-Safe** - Written in TypeScript with exhaustive prop definitions and intellisense.
|
|
18
|
+
- 📋 **Dynamic Form Builders** - Includes `DemoForm` and `DemoHookForm` to build entire forms from a simple JSON schema.
|
|
19
|
+
- ⚡ **Optimized Performance** - Lightweight wrappers that minimize re-renders.
|
|
20
|
+
- 🌍 **Next.js & React Ready** - Full compatibility with Next.js App Router (Client Components) and standard React SPAs.
|
|
21
|
+
|
|
22
|
+
## 📦 Compatibility
|
|
23
|
+
|
|
24
|
+
### Next.js (App Router)
|
|
25
|
+
|
|
26
|
+
All components in this library are client components, making them fully compatible with the Next.js App Router. They can be imported and used directly within your client-side components.
|
|
27
|
+
|
|
28
|
+
### React (CRA / Vite)
|
|
29
|
+
|
|
30
|
+
Works out of the box with any React environment. No additional configuration required.
|
|
31
|
+
|
|
32
|
+
## 📦 Installation
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm install @react-solutions/inputs
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Peer Dependencies
|
|
39
|
+
|
|
40
|
+
Ensure the following packages are installed in your project:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npm install @mui/material @emotion/react @emotion/styled react-hook-form date-fns @mui/x-date-pickers
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## 🛠 Available Fields Group-wise
|
|
49
|
+
|
|
50
|
+
### 1. Text & Numeric Inputs
|
|
51
|
+
|
|
52
|
+
Standard text-based inputs with built-in validation support and consistent styling.
|
|
53
|
+
|
|
54
|
+
| Standard Component | HookForm Wrapper | Description |
|
|
55
|
+
| :----------------- | :----------------------- | :-------------------------------------------- |
|
|
56
|
+
| `TextInputField` | `FormInputTextField` | Standard text input for names, emails, etc. |
|
|
57
|
+
| `PasswordField` | `FormInputPasswordField` | Secure password field with visibility toggle. |
|
|
58
|
+
| `NumberField` | `FormInputNumberField` | Optimized for numeric values. |
|
|
59
|
+
| `TelInputField` | `FormInputTelField` | Formatted for telephone numbers. |
|
|
60
|
+
| `SearchInputField` | `FormInputSearchField` | Specialized search input with clear icon. |
|
|
61
|
+
| `OTPField` | `FormInputOTPField` | Multi-digit OTP input for authentication. |
|
|
62
|
+
| `TextArea` | `FormInputTextArea` | Multi-line text input for long descriptions. |
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
### 2. Selection & Dropdowns
|
|
67
|
+
|
|
68
|
+
Powerful selection components ranging from simple selects to complex multi-autocomplete fields.
|
|
69
|
+
|
|
70
|
+
| Standard Component | HookForm Wrapper | Description |
|
|
71
|
+
| :------------------ | :--------------------------- | :------------------------------------- |
|
|
72
|
+
| `SelectInputField` | `FormInputSelect` | Standard dropdown selection. |
|
|
73
|
+
| - | `FormInputMultiSelect` | Multi-select dropdown with chips. |
|
|
74
|
+
| `AutoCompleteField` | `FormInputAutoComplete` | Searchable dropdown with autocomplete. |
|
|
75
|
+
| - | `FormInputMultiAutoComplete` | Searchable multi-selection. |
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
### 3. Choices & Toggles
|
|
80
|
+
|
|
81
|
+
Boolean and multiple-choice inputs for settings and preferences.
|
|
82
|
+
|
|
83
|
+
| Standard Component | HookForm Wrapper | Description |
|
|
84
|
+
| :---------------------- | :-------------------------- | :------------------------------------------- |
|
|
85
|
+
| `CheckBoxField` | `FormInputCheckBox` | Single checkbox for boolean values. |
|
|
86
|
+
| `CheckBoxFieldGroup` | `FormInputCheckBoxGroup` | Group of checkboxes for multiple selections. |
|
|
87
|
+
| `RadioButtonField` | `FormInputSingleRadio` | Single radio button. |
|
|
88
|
+
| `RadioButtonFieldGroup` | `FormInputRadioButtonGroup` | Standard radio group for single choice. |
|
|
89
|
+
| `SwitchField` | `FormInputSwitch` | On/Off toggle switch. |
|
|
90
|
+
| `SliderField` | `FormInputSlider` | Range slider for numeric ranges. |
|
|
91
|
+
| `ToggleButtonField` | `FormInputToggleButton` | Button-style toggle selection. |
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
### 4. Date & Time Pickers
|
|
96
|
+
|
|
97
|
+
Rich date and time selection components using `@mui/x-date-pickers`.
|
|
98
|
+
|
|
99
|
+
| Standard Component | HookForm Wrapper | Description |
|
|
100
|
+
| :------------------ | :-------------------- | :--------------------------------------- |
|
|
101
|
+
| `DatePickerField` | `FormInputDatePicker` | Full date picker with calendar. |
|
|
102
|
+
| `TimePickerField` | `FormInputTimePicker` | Time selection with clock interface. |
|
|
103
|
+
| `TimeClockField` | `FormInputTimeClock` | Dedicated analog-style clock selection. |
|
|
104
|
+
| `DateCalendarField` | `FormInputCalendar` | Inline calendar view for date selection. |
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
### 5. Specialty Inputs
|
|
109
|
+
|
|
110
|
+
| Standard Component | HookForm Wrapper | Description |
|
|
111
|
+
| :----------------- | :--------------------- | :------------------------------------------- |
|
|
112
|
+
| `ColorPickerField` | `FormInputColorPicker` | Visual color selection tool. |
|
|
113
|
+
| `FileUploadField` | `FormInputFileUpload` | Styled file upload and dropzone integration. |
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## 🏗 Dynamic Form Builders (Demo Forms)
|
|
118
|
+
|
|
119
|
+
For rapid development, we provide two high-level components that can render entire forms from a configuration object. This is ideal for checking field behavior or building dynamic admin panels.
|
|
120
|
+
|
|
121
|
+
### Standard Demo Form
|
|
122
|
+
|
|
123
|
+
Used for building forms that manage their own internal state or use external controlled state.
|
|
124
|
+
|
|
125
|
+
```tsx
|
|
126
|
+
import { DemoForm } from "@react-solutions/inputs";
|
|
127
|
+
|
|
128
|
+
<DemoForm />;
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### HookForm Demo Form
|
|
132
|
+
|
|
133
|
+
The ultimate way to build complex, validated forms with `react-hook-form`.
|
|
134
|
+
|
|
135
|
+
```tsx
|
|
136
|
+
import { DemoHookForm } from "@react-solutions/inputs";
|
|
137
|
+
|
|
138
|
+
<DemoHookForm />;
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## 🌍 Browser Support
|
|
144
|
+
|
|
145
|
+
| Browser | Version | Status |
|
|
146
|
+
| :------ | :------ | :----------- |
|
|
147
|
+
| Chrome | 60+ | ✅ Supported |
|
|
148
|
+
| Firefox | 60+ | ✅ Supported |
|
|
149
|
+
| Safari | 12+ | ✅ Supported |
|
|
150
|
+
| Edge | 79+ | ✅ Supported |
|
|
151
|
+
|
|
152
|
+
## 🤝 Contributing
|
|
153
|
+
|
|
154
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
155
|
+
|
|
156
|
+
## 📄 License
|
|
157
|
+
|
|
158
|
+
MIT
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
Made with ❤️ for React developers
|