@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/README.md
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# @react-solutions/input
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@react-solutions/input)
|
|
6
|
+
[](https://www.npmjs.com/package/@react-solutions/input)
|
|
7
|
+
[](https://bundlephobia.com/package/@react-solutions/input)
|
|
8
|
+
|
|
9
|
+
</div>
|
|
10
|
+
Lightweight React form input components and react-hook-form wrappers.
|
|
11
|
+
|
|
12
|
+
Quick highlights:
|
|
13
|
+
|
|
14
|
+
- Exports two families: direct controlled components and react-hook-form wrappers.
|
|
15
|
+
- Built with TypeScript. Declarations are emitted on build.
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
Install the package and peer dependencies in the consuming app:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install @react-solutions/input
|
|
23
|
+
# ensure peer deps exist in the host app:
|
|
24
|
+
npm install react react-dom @mui/material @emotion/react @emotion/styled react-hook-form date-fns
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
1. controlled components (use with useState)
|
|
30
|
+
|
|
31
|
+
Example: `@react-solutions/input` demonstrates using components like `TextInputField` and `SelectInputField` with `value` / `onChange` props.
|
|
32
|
+
|
|
33
|
+
```tsx
|
|
34
|
+
import { TextInputField, SelectInputField } from "@react-solutions/input";
|
|
35
|
+
// in component:
|
|
36
|
+
<TextInputField
|
|
37
|
+
name="name"
|
|
38
|
+
value={name}
|
|
39
|
+
onChange={(e) => setName(e.target.value)}
|
|
40
|
+
/>;
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
2. react-hook-form wrappers (preferred when using react-hook-form)
|
|
44
|
+
|
|
45
|
+
Example: `@react-solutions/input` shows usage of `FormInputTextField`, `FormInputSelect`, etc.
|
|
46
|
+
|
|
47
|
+
```tsx
|
|
48
|
+
import { FormInputTextField, FormInputSelect } from "@react-solutions/input";
|
|
49
|
+
// inside a form using react-hook-form's control:
|
|
50
|
+
<FormInputTextField
|
|
51
|
+
name="email"
|
|
52
|
+
label="Email"
|
|
53
|
+
control={control}
|
|
54
|
+
errors={errors}
|
|
55
|
+
/>;
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Peer dependencies
|
|
59
|
+
|
|
60
|
+
This package declares several peerDependencies. Consumers must provide compatible versions of:
|
|
61
|
+
|
|
62
|
+
- react, react-dom
|
|
63
|
+
- @mui/material, @emotion/react, @emotion/styled
|
|
64
|
+
- @mui/x-date-pickers (for date/time inputs)
|
|
65
|
+
- react-hook-form (for HookForm wrappers)
|
|
66
|
+
- date-fns
|
|
67
|
+
|
|
68
|
+
See `package.json` for exact version ranges.
|
|
69
|
+
|
|
70
|
+
## 🌍 **Browser Support**
|
|
71
|
+
|
|
72
|
+
<div align="left">
|
|
73
|
+
|
|
74
|
+
| Browser | Version | Status |
|
|
75
|
+
| ----------------------------------------------------------------------------- | ------- | ------------ |
|
|
76
|
+
|  | 60+ | ✅ Supported |
|
|
77
|
+
|  | 60+ | ✅ Supported |
|
|
78
|
+
|  | 12+ | ✅ Supported |
|
|
79
|
+
|  | 79+ | ✅ Supported |
|
|
80
|
+
|
|
81
|
+
</div>
|
|
82
|
+
|
|
83
|
+
## License
|
|
84
|
+
|
|
85
|
+
MIT
|
|
86
|
+
|
|
87
|
+
<div align="center">
|
|
88
|
+
|
|
89
|
+

|
|
90
|
+

|
|
91
|
+
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
## 📝 TypeScript Support
|
|
95
|
+
|
|
96
|
+
This package is written in TypeScript and includes full type definitions. All exported functions and hooks are fully typed.
|
|
97
|
+
|
|
98
|
+
Made with ❤️ for React developers
|