formix-ui 0.0.2 → 0.0.4
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 +378 -341
- package/dist/bin/index.js +317 -320
- package/dist/components/pages/docs/CliGuidePage.d.ts +1 -0
- package/dist/components/pages/docs/ContributingPage.d.ts +1 -0
- package/dist/components/pages/docs/DocPages.d.ts +5 -0
- package/dist/components/pages/docs/EcosystemPage.d.ts +1 -0
- package/dist/components/pages/docs/TasksPage.d.ts +1 -0
- package/dist/components/pages/docs/UsageGuidePage.d.ts +1 -0
- package/dist/components/theme/types.d.ts +3 -0
- package/dist/index.js +91 -85
- package/package.json +10 -8
- package/CHANGELOG.md +0 -206
package/README.md
CHANGED
|
@@ -1,341 +1,378 @@
|
|
|
1
|
-
# 🚀
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
{
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
```
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
1
|
+
# 🚀 FormixUI
|
|
2
|
+
|
|
3
|
+
<!-- PROJECT_STATUS_START -->
|
|
4
|
+
<div align="center">
|
|
5
|
+
|
|
6
|
+
<h3>🚀 Project Status: 27% Complete</h3>
|
|
7
|
+
|
|
8
|
+
<img src="https://progress-bar.dev/27/?scale=100&title=progress&width=600&color=00ff00&suffix=%25" alt="Progress Bar">
|
|
9
|
+
|
|
10
|
+
<br/>
|
|
11
|
+
|
|
12
|
+
| 📦 Version | ✅ Completed | 🚧 In Progress | 🔄 Recurring | 📅 Upcoming |
|
|
13
|
+
| :--------: | :----------: | :------------: | :----------: | :---------: |
|
|
14
|
+
| **v0.0.2** | **27** | **9** | **3** | **63** |
|
|
15
|
+
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<details open>
|
|
19
|
+
<summary><h3>📅 Recent Activity & Roadmap</h3></summary>
|
|
20
|
+
|
|
21
|
+
| **✨ Recently Completed** | **🚧 In Progress / Planned** |
|
|
22
|
+
| :------------------------ | :--------------------------- |
|
|
23
|
+
|
|
24
|
+
| <ul><li>✅ **Button**: Standard interactive button.</li>
|
|
25
|
+
|
|
26
|
+
<li>✅ **Checkbox**: Binary selection control.</li>
|
|
27
|
+
<li>✅ **Combobox (Autocomplete)**: Input with filtered suggestions.</li>
|
|
28
|
+
<li>✅ **Date Picker**: Date selection interactive calendar.</li>
|
|
29
|
+
<li>✅ **Date Range Picker**: Date range selection.</li></ul> | <ul><li>🚧 Locale switcher UI</li>
|
|
30
|
+
<li>🚧 Week start UI</li>
|
|
31
|
+
<li>🚧 Week number toggle UI</li>
|
|
32
|
+
<li>🚧 Time step UI</li>
|
|
33
|
+
<li>🚧 Focus trapping (modals)</li></ul> |
|
|
34
|
+
|
|
35
|
+
</details>
|
|
36
|
+
|
|
37
|
+
<br/>
|
|
38
|
+
<!-- PROJECT_STATUS_END -->
|
|
39
|
+
|
|
40
|
+
[](https://www.npmjs.com/package/formix-ui)
|
|
41
|
+
[](https://opensource.org/licenses/MIT)
|
|
42
|
+
[](https://www.typescriptlang.org/)
|
|
43
|
+
[](https://reactjs.org/)
|
|
44
|
+
|
|
45
|
+
**A powerful, schema-driven form engine for React with a visual builder, comprehensive validation, and enterprise-grade features.**
|
|
46
|
+
|
|
47
|
+
## ✨ Features
|
|
48
|
+
|
|
49
|
+
### 🎨 **Visual Form Builder**
|
|
50
|
+
|
|
51
|
+
- Drag-and-drop field arrangement
|
|
52
|
+
- 60+ configurable properties per field
|
|
53
|
+
- Real-time preview
|
|
54
|
+
- Schema import/export (JSON)
|
|
55
|
+
- Smart field defaults
|
|
56
|
+
- **Component Playground**: Interactive gallery for all UI components
|
|
57
|
+
|
|
58
|
+
### 📝 **17 Field Types**
|
|
59
|
+
|
|
60
|
+
- Text inputs (text, email, url, tel, password)
|
|
61
|
+
- Number input with constraints
|
|
62
|
+
- Textarea with auto-grow
|
|
63
|
+
- Autocomplete with async support
|
|
64
|
+
- Native select & multi-select
|
|
65
|
+
- Checkbox, Switch, Radio groups
|
|
66
|
+
- File upload with preview
|
|
67
|
+
- Date, Time, DateTime, DateRange pickers (Native components)
|
|
68
|
+
|
|
69
|
+
### ✅ **Advanced Validation**
|
|
70
|
+
|
|
71
|
+
- 20+ validation types
|
|
72
|
+
- Zod integration
|
|
73
|
+
- Custom validation functions
|
|
74
|
+
|
|
75
|
+
## ✨ Features (v3.2.0)
|
|
76
|
+
|
|
77
|
+
- **Framework Agnostic State**: Choose between Native `useForm`, **Formik**, or **React Hook Form**.
|
|
78
|
+
- **Multi-Validation Support**: First-class support for **Zod** and **Yup**.
|
|
79
|
+
- **Themed Variant System**: Default, Outlined, and Covered variants for all inputs.
|
|
80
|
+
- **Smart CLI 3.0**: Select your stack (`npx formix-ui init`) and we'll configure your validation and state management automatically.
|
|
81
|
+
- Dark mode support
|
|
82
|
+
- Fully responsive (12-column grid)
|
|
83
|
+
- Tailwind CSS 4.1
|
|
84
|
+
|
|
85
|
+
### 🛠️ **CLI 3.0 Power Tools**
|
|
86
|
+
|
|
87
|
+
Detailed instructions can be found in the [CLI Guide](CLI_GUIDE.md).
|
|
88
|
+
|
|
89
|
+
- **`init`**: Comprehensive setup with custom package name support
|
|
90
|
+
- **`add`**: Install specific components locally with dependency tracking
|
|
91
|
+
- **`update`**: Keep your local components up-to-date with a single command
|
|
92
|
+
- **`create`**: Scaffold a new project from scratch (`npx formix-ui create`)
|
|
93
|
+
|
|
94
|
+
### 🌐 **Accessibility**
|
|
95
|
+
|
|
96
|
+
- ARIA labels
|
|
97
|
+
- Keyboard navigation
|
|
98
|
+
- Screen reader support
|
|
99
|
+
- Semantic HTML
|
|
100
|
+
|
|
101
|
+
## 📦 Installation
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
npm install formix-ui
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Peer Dependencies
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
npm install react react-dom tailwindcss zod formik yup
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## 🚀 Quick Start
|
|
114
|
+
|
|
115
|
+
### 1. Basic Form
|
|
116
|
+
|
|
117
|
+
```tsx
|
|
118
|
+
import { SchemaForm } from "formix-ui";
|
|
119
|
+
import type { FormSchema } from "formix-ui";
|
|
120
|
+
|
|
121
|
+
const schema: FormSchema = {
|
|
122
|
+
title: "Contact Form",
|
|
123
|
+
description: "Get in touch with us",
|
|
124
|
+
fields: [
|
|
125
|
+
{
|
|
126
|
+
id: "name",
|
|
127
|
+
name: "name",
|
|
128
|
+
label: "Full Name",
|
|
129
|
+
type: "text",
|
|
130
|
+
placeholder: "John Doe",
|
|
131
|
+
validation: [{ type: "required", message: "Name is required" }],
|
|
132
|
+
grid: { colSpan: 12, xs: 12, sm: 6 },
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
id: "email",
|
|
136
|
+
name: "email",
|
|
137
|
+
label: "Email",
|
|
138
|
+
type: "email",
|
|
139
|
+
placeholder: "john@example.com",
|
|
140
|
+
validation: [{ type: "required" }, { type: "email", message: "Invalid email" }],
|
|
141
|
+
grid: { colSpan: 12, xs: 12, sm: 6 },
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
id: "message",
|
|
145
|
+
name: "message",
|
|
146
|
+
label: "Message",
|
|
147
|
+
type: "textarea",
|
|
148
|
+
rows: 4,
|
|
149
|
+
grid: { colSpan: 12 },
|
|
150
|
+
},
|
|
151
|
+
],
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
function App() {
|
|
155
|
+
return (
|
|
156
|
+
<SchemaForm
|
|
157
|
+
schema={schema}
|
|
158
|
+
onSubmit={(values) => {
|
|
159
|
+
console.log("Form submitted:", values);
|
|
160
|
+
}}
|
|
161
|
+
/>
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### 2. Form Builder
|
|
167
|
+
|
|
168
|
+
```tsx
|
|
169
|
+
import { FormBuilder } from "formix-ui";
|
|
170
|
+
|
|
171
|
+
function App() {
|
|
172
|
+
return <FormBuilder />;
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### 3. Advanced Features
|
|
177
|
+
|
|
178
|
+
```tsx
|
|
179
|
+
import { SchemaForm } from "formix-ui";
|
|
180
|
+
import { useRef } from "react";
|
|
181
|
+
import type { SchemaFormHandle } from "formix-ui";
|
|
182
|
+
|
|
183
|
+
function App() {
|
|
184
|
+
const formRef = useRef<SchemaFormHandle>(null);
|
|
185
|
+
|
|
186
|
+
return (
|
|
187
|
+
<>
|
|
188
|
+
<SchemaForm
|
|
189
|
+
ref={formRef}
|
|
190
|
+
schema={schema}
|
|
191
|
+
debug // Show debug panel
|
|
192
|
+
onValidate={(values) => {
|
|
193
|
+
// Custom cross-field validation
|
|
194
|
+
const errors: Record<string, string> = {};
|
|
195
|
+
if (values.password !== values.confirmPassword) {
|
|
196
|
+
errors.confirmPassword = "Passwords don't match";
|
|
197
|
+
}
|
|
198
|
+
return errors;
|
|
199
|
+
}}
|
|
200
|
+
onSubmit={(values) => {
|
|
201
|
+
console.log("Submitted:", values);
|
|
202
|
+
}}
|
|
203
|
+
/>
|
|
204
|
+
|
|
205
|
+
<button onClick={() => formRef.current?.submit()}>Submit Form</button>
|
|
206
|
+
<button onClick={() => formRef.current?.reset()}>Reset Form</button>
|
|
207
|
+
</>
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
## 📚 Documentation
|
|
213
|
+
|
|
214
|
+
### Field Types
|
|
215
|
+
|
|
216
|
+
| Type | Description | Special Props |
|
|
217
|
+
| -------------- | ----------------- | ---------------------------------------------- |
|
|
218
|
+
| `text` | Single-line text | `minLength`, `maxLength`, `pattern` |
|
|
219
|
+
| `email` | Email input | Auto email validation |
|
|
220
|
+
| `url` | URL input | Auto URL validation |
|
|
221
|
+
| `tel` | Phone number | `pattern` for format |
|
|
222
|
+
| `password` | Password input | Masked input |
|
|
223
|
+
| `number` | Numeric input | `min`, `max`, `step` |
|
|
224
|
+
| `textarea` | Multi-line text | `rows`, `autoGrow`, `showCharCount` |
|
|
225
|
+
| `autocomplete` | Searchable select | `options`, `multiple`, `asyncUrl`, `creatable` |
|
|
226
|
+
| `select` | Native select | `options`, `multiple` |
|
|
227
|
+
| `checkbox` | Checkbox | `checkboxLabel` |
|
|
228
|
+
| `switch` | Toggle switch | Boolean value |
|
|
229
|
+
| `radio` | Radio group | `options`, `direction` |
|
|
230
|
+
| `file` | File upload | `accept`, `maxSize`, `maxFiles` |
|
|
231
|
+
| `date` | Date picker | `minDate`, `maxDate`, `dateFormat` |
|
|
232
|
+
| `time` | Time picker | `timeFormat` |
|
|
233
|
+
| `datetime` | Date + Time | `dateFormat`, `timeFormat` |
|
|
234
|
+
| `daterange` | Date range | `minDate`, `maxDate` |
|
|
235
|
+
|
|
236
|
+
### Validation Types
|
|
237
|
+
|
|
238
|
+
```typescript
|
|
239
|
+
type ValidationRule =
|
|
240
|
+
| { type: "required"; message?: string }
|
|
241
|
+
| { type: "email"; message?: string }
|
|
242
|
+
| { type: "url"; message?: string }
|
|
243
|
+
| { type: "minLength"; value: number; message?: string }
|
|
244
|
+
| { type: "maxLength"; value: number; message?: string }
|
|
245
|
+
| { type: "min"; value: number; message?: string }
|
|
246
|
+
| { type: "max"; value: number; message?: string }
|
|
247
|
+
| { type: "pattern"; value: string; message?: string }
|
|
248
|
+
| { type: "regex"; value: RegExp; message?: string }
|
|
249
|
+
| { type: "fileSize"; value: number; message?: string }
|
|
250
|
+
| { type: "fileType"; value: string[]; message?: string }
|
|
251
|
+
| { type: "minDate"; value: Date; message?: string }
|
|
252
|
+
| { type: "maxDate"; value: Date; message?: string }
|
|
253
|
+
| { type: "integer"; message?: string }
|
|
254
|
+
| { type: "positive"; message?: string }
|
|
255
|
+
| { type: "negative"; message?: string }
|
|
256
|
+
| { type: "custom"; validate: (value: any) => boolean; message?: string };
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
### Conditional Visibility
|
|
260
|
+
|
|
261
|
+
```typescript
|
|
262
|
+
{
|
|
263
|
+
id: "other-role",
|
|
264
|
+
name: "otherRole",
|
|
265
|
+
label: "Specify Role",
|
|
266
|
+
type: "text",
|
|
267
|
+
visibilityRules: [
|
|
268
|
+
{ field: "role", operator: "eq", value: "other" }
|
|
269
|
+
],
|
|
270
|
+
reserveSpace: true // Keeps layout stable
|
|
271
|
+
}
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
### Grid Layout
|
|
275
|
+
|
|
276
|
+
```typescript
|
|
277
|
+
{
|
|
278
|
+
grid: {
|
|
279
|
+
colSpan: 6, // Desktop (default)
|
|
280
|
+
xs: 12, // Mobile (<640px)
|
|
281
|
+
sm: 6, // Tablet (640px+)
|
|
282
|
+
lg: 4 // Large desktop (1024px+)
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
## 🎨 Theming
|
|
288
|
+
|
|
289
|
+
FormixUI uses Tailwind CSS 4.1 with CSS variables for theming:
|
|
290
|
+
|
|
291
|
+
```css
|
|
292
|
+
@theme {
|
|
293
|
+
--color-primary: oklch(0.6 0.2 250);
|
|
294
|
+
--color-background: oklch(1 0 0);
|
|
295
|
+
--color-foreground: oklch(0.2 0 0);
|
|
296
|
+
/* ... more variables */
|
|
297
|
+
}
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
Toggle dark mode:
|
|
301
|
+
|
|
302
|
+
```tsx
|
|
303
|
+
import { ThemeProvider, ThemeSwitcher } from "formix-ui";
|
|
304
|
+
|
|
305
|
+
function App() {
|
|
306
|
+
return (
|
|
307
|
+
<ThemeProvider defaultTheme="system">
|
|
308
|
+
<ThemeSwitcher />
|
|
309
|
+
{/* Your forms */}
|
|
310
|
+
</ThemeProvider>
|
|
311
|
+
);
|
|
312
|
+
}
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
## 🔧 Configuration
|
|
316
|
+
|
|
317
|
+
### TypeScript
|
|
318
|
+
|
|
319
|
+
```json
|
|
320
|
+
{
|
|
321
|
+
"compilerOptions": {
|
|
322
|
+
"paths": {
|
|
323
|
+
"@/*": ["./src/*"]
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
### Tailwind CSS
|
|
330
|
+
|
|
331
|
+
```js
|
|
332
|
+
// tailwind.config.js
|
|
333
|
+
export default {
|
|
334
|
+
content: [
|
|
335
|
+
"./index.html",
|
|
336
|
+
"./src/**/*.{js,ts,jsx,tsx}",
|
|
337
|
+
"./node_modules/formix-ui/**/*.{js,ts,jsx,tsx}",
|
|
338
|
+
],
|
|
339
|
+
};
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
## 📖 Examples
|
|
343
|
+
|
|
344
|
+
Check out the `/examples` directory for:
|
|
345
|
+
|
|
346
|
+
- Basic form
|
|
347
|
+
- Multi-step wizard
|
|
348
|
+
- Dynamic fields
|
|
349
|
+
- File upload
|
|
350
|
+
- Async autocomplete
|
|
351
|
+
- Conditional logic
|
|
352
|
+
- Custom validation
|
|
353
|
+
|
|
354
|
+
## 🤝 Contributing
|
|
355
|
+
|
|
356
|
+
Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) for details.
|
|
357
|
+
|
|
358
|
+
## 📄 License
|
|
359
|
+
|
|
360
|
+
MIT © Adarsh A
|
|
361
|
+
|
|
362
|
+
## 🙏 Acknowledgments
|
|
363
|
+
|
|
364
|
+
- Built with [React](https://reactjs.org/)
|
|
365
|
+
- Styled with [Tailwind CSS](https://tailwindcss.com/)
|
|
366
|
+
- Date pickers powered by Custom Native Components
|
|
367
|
+
- Validation with [Zod](https://zod.dev/)
|
|
368
|
+
|
|
369
|
+
## 🔗 Links
|
|
370
|
+
|
|
371
|
+
- [Documentation](https://adarshatl03.github.io/formix-ui/)
|
|
372
|
+
- [GitHub](https://github.com/adarshatl03/formix-ui)
|
|
373
|
+
- [NPM](https://www.npmjs.com/package/formix-ui)
|
|
374
|
+
- [Demo](https://adarshatl03.github.io/formix-ui/)
|
|
375
|
+
|
|
376
|
+
---
|
|
377
|
+
|
|
378
|
+
**Made with ❤️ by the FormixUI team**
|