@buildnbuzz/buzzform 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Parth Lad / BuildnBuzz
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,138 @@
1
+ # BuzzForm
2
+
3
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
4
+
5
+ A schema-driven form library for React + shadcn/ui. Declare fields once, get validated forms with minimal boilerplate.
6
+
7
+ ## Features
8
+
9
+ - 🎯 **Schema-Driven** – Define fields as data, render forms automatically
10
+ - 🧩 **17+ Field Types** – Text, password, select, date, upload, arrays, tabs, and more
11
+ - ⚡ **Auto Validation** – Generates Zod schemas from your field definitions
12
+ - 🎨 **shadcn/ui Native** – Beautiful, accessible components out of the box
13
+ - 🔌 **Adapter Pattern** – Built for React Hook Form, extensible to others
14
+ - 📦 **Registry Ready** – Install components individually via shadcn CLI
15
+
16
+ ## Installation
17
+
18
+ ```bash
19
+ # Install the core package
20
+ npm install @buildnbuzz/buzzform
21
+
22
+ # Install peer dependencies
23
+ npm install react-hook-form zod
24
+
25
+ # Install components via shadcn registry
26
+ npx shadcn@latest add https://form.buildnbuzz.com/r/starter
27
+ ```
28
+
29
+ ## Quick Start
30
+
31
+ ```tsx
32
+ import { createSchema, type InferSchema } from "@buildnbuzz/buzzform";
33
+ import { Form } from "@/components/buzzform/form";
34
+
35
+ const schema = createSchema([
36
+ { type: "text", name: "name", label: "Name", required: true },
37
+ { type: "email", name: "email", label: "Email", required: true },
38
+ { type: "password", name: "password", label: "Password", minLength: 8 },
39
+ ]);
40
+
41
+ type FormData = InferSchema<typeof schema>;
42
+
43
+ export function LoginForm() {
44
+ const handleSubmit = async (data: FormData) => {
45
+ console.log(data);
46
+ };
47
+
48
+ return <Form schema={schema} onSubmit={handleSubmit} submitLabel="Sign In" />;
49
+ }
50
+ ```
51
+
52
+ ## Field Types
53
+
54
+ ### Data Fields
55
+
56
+ | Type | Description |
57
+ | ---------- | -------------------------------------------------------- |
58
+ | `text` | Single-line text input |
59
+ | `email` | Email input with validation |
60
+ | `password` | Password with strength indicator, requirements, generate |
61
+ | `textarea` | Multi-line text with auto-resize |
62
+ | `number` | Numeric input with steppers, formatting |
63
+ | `date` | Date picker with presets |
64
+ | `datetime` | Date + time picker |
65
+ | `select` | Dropdown with search, multi-select, async options |
66
+ | `checkbox` | Boolean checkbox |
67
+ | `switch` | Toggle switch |
68
+ | `radio` | Radio button group with card variant |
69
+ | `tags` | Tag/chip input |
70
+ | `upload` | File upload with drag-drop, previews |
71
+
72
+ ### Layout Fields
73
+
74
+ | Type | Description |
75
+ | ------------- | ---------------------------------------- |
76
+ | `row` | Horizontal field layout |
77
+ | `group` | Named object container |
78
+ | `collapsible` | Expandable section |
79
+ | `tabs` | Tabbed interface |
80
+ | `array` | Repeatable fields with drag-drop sorting |
81
+
82
+ ## Advanced Usage
83
+
84
+ ### Conditional Fields
85
+
86
+ ```tsx
87
+ const fields: Field[] = [
88
+ { type: "checkbox", name: "hasCompany", label: "I represent a company" },
89
+ {
90
+ type: "text",
91
+ name: "companyName",
92
+ label: "Company Name",
93
+ condition: (data) => data.hasCompany === true,
94
+ },
95
+ ];
96
+ ```
97
+
98
+ ### Dynamic Options
99
+
100
+ ```tsx
101
+ const fields: Field[] = [
102
+ { type: "select", name: "country", label: "Country", options: countries },
103
+ {
104
+ type: "select",
105
+ name: "city",
106
+ label: "City",
107
+ dependencies: ["country"],
108
+ options: async ({ data }) => {
109
+ const cities = await fetchCities(data.country);
110
+ return cities;
111
+ },
112
+ },
113
+ ];
114
+ ```
115
+
116
+ ### Custom Validation
117
+
118
+ ```tsx
119
+ const fields: Field[] = [
120
+ {
121
+ type: "text",
122
+ name: "username",
123
+ label: "Username",
124
+ validate: async (value, { data }) => {
125
+ const available = await checkUsername(value);
126
+ return available || "Username is taken";
127
+ },
128
+ },
129
+ ];
130
+ ```
131
+
132
+ ## Documentation
133
+
134
+ Full documentation and examples: **[form.buildnbuzz.com](https://form.buildnbuzz.com)**
135
+
136
+ ## License
137
+
138
+ MIT © [Parth Lad / BuildnBuzz](https://buildnbuzz.com)