@byhandi/heroui-kit 0.1.1 → 0.1.2
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 +194 -9
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -16,14 +16,34 @@ npm install @byhandi/heroui-kit
|
|
|
16
16
|
|
|
17
17
|
Ensure you have the following peer dependencies installed in your project:
|
|
18
18
|
|
|
19
|
-
- `react` >=
|
|
20
|
-
- `react-dom` >=
|
|
19
|
+
- `react` >= 18
|
|
20
|
+
- `react-dom` >= 18
|
|
21
21
|
- `@heroui/react` >= 2.8
|
|
22
22
|
- `framer-motion` >= 11
|
|
23
23
|
- `react-hook-form` >= 7
|
|
24
|
+
- `@hookform/resolvers` >= 3
|
|
24
25
|
|
|
25
26
|
## Components
|
|
26
27
|
|
|
28
|
+
### Button
|
|
29
|
+
|
|
30
|
+
A customized wrapper around HeroUI's `Button` component.
|
|
31
|
+
|
|
32
|
+
**Default Props:**
|
|
33
|
+
|
|
34
|
+
- `color`: "primary"
|
|
35
|
+
- `type`: "button"
|
|
36
|
+
|
|
37
|
+
**Usage:**
|
|
38
|
+
|
|
39
|
+
```tsx
|
|
40
|
+
import { Button } from "@byhandi/heroui-kit";
|
|
41
|
+
|
|
42
|
+
function App() {
|
|
43
|
+
return <Button onPress={() => console.log("Clicked")}>Click Me</Button>;
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
27
47
|
### InputText
|
|
28
48
|
|
|
29
49
|
A styled wrapper around HeroUI's `Input` component.
|
|
@@ -47,13 +67,6 @@ function App() {
|
|
|
47
67
|
|
|
48
68
|
### InputTextWithRHFControl
|
|
49
69
|
|
|
50
|
-
A wrapper component that integrates `InputText` with `react-hook-form`'s `Controller`. It automatically handles:
|
|
51
|
-
|
|
52
|
-
- State management via `control`
|
|
53
|
-
- Error states (`isInvalid`)
|
|
54
|
-
- Error messages (`errorMessage`)
|
|
55
|
-
- Required validation (if `isRequired` prop is true)
|
|
56
|
-
|
|
57
70
|
**Usage:**
|
|
58
71
|
|
|
59
72
|
```tsx
|
|
@@ -80,6 +93,178 @@ function App() {
|
|
|
80
93
|
}
|
|
81
94
|
```
|
|
82
95
|
|
|
96
|
+
### InputNumber
|
|
97
|
+
|
|
98
|
+
A styled wrapper around HeroUI's `NumberInput`.
|
|
99
|
+
|
|
100
|
+
**Default Props:**
|
|
101
|
+
|
|
102
|
+
- `variant`: "bordered"
|
|
103
|
+
- `labelPlacement`: "outside"
|
|
104
|
+
|
|
105
|
+
**Usage:**
|
|
106
|
+
|
|
107
|
+
```tsx
|
|
108
|
+
import { InputNumber } from "@byhandi/heroui-kit";
|
|
109
|
+
|
|
110
|
+
function App() {
|
|
111
|
+
return <InputNumber label="Age" />;
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### InputNumberWithRHFControl
|
|
116
|
+
|
|
117
|
+
Wrapper for `InputNumber` with React Hook Form integration.
|
|
118
|
+
|
|
119
|
+
**Usage:**
|
|
120
|
+
|
|
121
|
+
```tsx
|
|
122
|
+
<InputNumberWithRHFControl control={control} name="age" label="Age" />
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Textarea
|
|
126
|
+
|
|
127
|
+
A styled wrapper around HeroUI's `Textarea`.
|
|
128
|
+
|
|
129
|
+
**Default Props:**
|
|
130
|
+
|
|
131
|
+
- `variant`: "bordered"
|
|
132
|
+
- `labelPlacement`: "outside"
|
|
133
|
+
|
|
134
|
+
**Usage:**
|
|
135
|
+
|
|
136
|
+
```tsx
|
|
137
|
+
import { Textarea } from "@byhandi/heroui-kit";
|
|
138
|
+
|
|
139
|
+
function App() {
|
|
140
|
+
return <Textarea label="Description" />;
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### TextareaWithRHFControl
|
|
145
|
+
|
|
146
|
+
Wrapper for `Textarea` with React Hook Form integration.
|
|
147
|
+
|
|
148
|
+
**Usage:**
|
|
149
|
+
|
|
150
|
+
```tsx
|
|
151
|
+
<TextareaWithRHFControl control={control} name="description" label="Description" />
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Select
|
|
155
|
+
|
|
156
|
+
A styled wrapper around HeroUI's `Select`.
|
|
157
|
+
|
|
158
|
+
**Default Props:**
|
|
159
|
+
|
|
160
|
+
- `variant`: "bordered"
|
|
161
|
+
- `labelPlacement`: "outside"
|
|
162
|
+
|
|
163
|
+
**Usage:**
|
|
164
|
+
|
|
165
|
+
```tsx
|
|
166
|
+
import { Select } from "@byhandi/heroui-kit";
|
|
167
|
+
|
|
168
|
+
const options = [{ value: "1", label: "Option 1" }];
|
|
169
|
+
|
|
170
|
+
function App() {
|
|
171
|
+
return <Select label="Choose" options={options} />;
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### SelectWithRHFControl
|
|
176
|
+
|
|
177
|
+
Wrapper for `Select` with React Hook Form integration.
|
|
178
|
+
|
|
179
|
+
**Usage:**
|
|
180
|
+
|
|
181
|
+
```tsx
|
|
182
|
+
<SelectWithRHFControl control={control} name="choice" label="Choose" options={options} />
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### Autocomplete
|
|
186
|
+
|
|
187
|
+
A styled wrapper around HeroUI's `Autocomplete`.
|
|
188
|
+
|
|
189
|
+
**Default Props:**
|
|
190
|
+
|
|
191
|
+
- `variant`: "bordered"
|
|
192
|
+
- `labelPlacement`: "outside"
|
|
193
|
+
|
|
194
|
+
**Usage:**
|
|
195
|
+
|
|
196
|
+
```tsx
|
|
197
|
+
import { Autocomplete } from "@byhandi/heroui-kit";
|
|
198
|
+
|
|
199
|
+
const options = [{ value: "1", label: "Option 1" }];
|
|
200
|
+
|
|
201
|
+
function App() {
|
|
202
|
+
return <Autocomplete label="Search" options={options} />;
|
|
203
|
+
}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### AutocompleteWithRHFControl
|
|
207
|
+
|
|
208
|
+
Wrapper for `Autocomplete` with React Hook Form integration.
|
|
209
|
+
|
|
210
|
+
**Usage:**
|
|
211
|
+
|
|
212
|
+
```tsx
|
|
213
|
+
<AutocompleteWithRHFControl control={control} name="search" label="Search" options={options} />
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### Checkbox
|
|
217
|
+
|
|
218
|
+
A styled wrapper around HeroUI's `Checkbox`.
|
|
219
|
+
|
|
220
|
+
**Usage:**
|
|
221
|
+
|
|
222
|
+
```tsx
|
|
223
|
+
import { Checkbox } from "@byhandi/heroui-kit";
|
|
224
|
+
|
|
225
|
+
function App() {
|
|
226
|
+
return <Checkbox>Accept terms</Checkbox>;
|
|
227
|
+
}
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### CheckboxWithRHFControl
|
|
231
|
+
|
|
232
|
+
Wrapper for `Checkbox` with React Hook Form integration.
|
|
233
|
+
|
|
234
|
+
**Usage:**
|
|
235
|
+
|
|
236
|
+
```tsx
|
|
237
|
+
<CheckboxWithRHFControl control={control} name="terms">
|
|
238
|
+
Accept terms
|
|
239
|
+
</CheckboxWithRHFControl>
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### CheckboxGroup
|
|
243
|
+
|
|
244
|
+
A styled wrapper around HeroUI's `CheckboxGroup`.
|
|
245
|
+
|
|
246
|
+
**Usage:**
|
|
247
|
+
|
|
248
|
+
```tsx
|
|
249
|
+
import { CheckboxGroup } from "@byhandi/heroui-kit";
|
|
250
|
+
|
|
251
|
+
const options = [{ value: "1", label: "Option 1" }];
|
|
252
|
+
|
|
253
|
+
function App() {
|
|
254
|
+
return <CheckboxGroup label="Options" options={options} />;
|
|
255
|
+
}
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### CheckboxGroupWithRHFControl
|
|
259
|
+
|
|
260
|
+
Wrapper for `CheckboxGroup` with React Hook Form integration.
|
|
261
|
+
|
|
262
|
+
**Usage:**
|
|
263
|
+
|
|
264
|
+
```tsx
|
|
265
|
+
<CheckboxGroupWithRHFControl control={control} name="options" label="Options" options={options} />
|
|
266
|
+
```
|
|
267
|
+
|
|
83
268
|
## Development
|
|
84
269
|
|
|
85
270
|
This project uses Vite for development and bundling.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@byhandi/heroui-kit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Opinionated HeroUI components",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.es.js",
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
"preview": "vite preview"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"@heroui/react": "
|
|
20
|
-
"@hookform/resolvers": "
|
|
19
|
+
"@heroui/react": ">=2.8",
|
|
20
|
+
"@hookform/resolvers": ">=3",
|
|
21
21
|
"framer-motion": ">=11.5.6 || >=12.0.0",
|
|
22
|
-
"react": "
|
|
23
|
-
"react-dom": "
|
|
24
|
-
"react-hook-form": "
|
|
22
|
+
"react": ">=18",
|
|
23
|
+
"react-dom": ">=18",
|
|
24
|
+
"react-hook-form": ">=7"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@eslint/js": "^9.39.1",
|