@anri1214/dynamic-forms-mui-mcp 0.1.5

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.
Files changed (45) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +214 -0
  3. package/dist/index.d.ts +14 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +394 -0
  6. package/dist/prompts/generateBackendEndpoint.d.ts +5 -0
  7. package/dist/prompts/generateBackendEndpoint.d.ts.map +1 -0
  8. package/dist/prompts/generateBackendEndpoint.js +33 -0
  9. package/dist/prompts/generateFormConfig.d.ts +5 -0
  10. package/dist/prompts/generateFormConfig.d.ts.map +1 -0
  11. package/dist/prompts/generateFormConfig.js +94 -0
  12. package/dist/resources/examples.d.ts +9 -0
  13. package/dist/resources/examples.d.ts.map +1 -0
  14. package/dist/resources/examples.js +16 -0
  15. package/dist/resources/fieldDocs.d.ts +5 -0
  16. package/dist/resources/fieldDocs.d.ts.map +1 -0
  17. package/dist/resources/fieldDocs.js +39 -0
  18. package/dist/resources/jsonSchema.d.ts +5 -0
  19. package/dist/resources/jsonSchema.d.ts.map +1 -0
  20. package/dist/resources/jsonSchema.js +8 -0
  21. package/dist/schema/0.1/examples/crud.json +128 -0
  22. package/dist/schema/0.1/examples/filters.json +82 -0
  23. package/dist/schema/0.1/examples/registration.json +119 -0
  24. package/dist/schema/0.1/fieldTypes.json +213 -0
  25. package/dist/schema/0.1/formSchema.json +806 -0
  26. package/dist/schema/versions.json +6 -0
  27. package/dist/schemaLoader.d.ts +37 -0
  28. package/dist/schemaLoader.d.ts.map +1 -0
  29. package/dist/schemaLoader.js +89 -0
  30. package/dist/tools/generateSchema.d.ts +30 -0
  31. package/dist/tools/generateSchema.d.ts.map +1 -0
  32. package/dist/tools/generateSchema.js +58 -0
  33. package/dist/tools/getFieldConfig.d.ts +18 -0
  34. package/dist/tools/getFieldConfig.d.ts.map +1 -0
  35. package/dist/tools/getFieldConfig.js +25 -0
  36. package/dist/tools/listFieldTypes.d.ts +13 -0
  37. package/dist/tools/listFieldTypes.d.ts.map +1 -0
  38. package/dist/tools/listFieldTypes.js +14 -0
  39. package/dist/tools/validateSchema.d.ts +10 -0
  40. package/dist/tools/validateSchema.d.ts.map +1 -0
  41. package/dist/tools/validateSchema.js +32 -0
  42. package/dist/types.d.ts +19 -0
  43. package/dist/types.d.ts.map +1 -0
  44. package/dist/types.js +1 -0
  45. package/package.json +49 -0
@@ -0,0 +1,213 @@
1
+ {
2
+ "fieldTypes": [
3
+ {
4
+ "type": "text",
5
+ "description": "Single-line text input",
6
+ "config": "TextFieldConfig",
7
+ "specificProps": ["autoComplete"],
8
+ "applicableValidations": ["required", "minLength", "maxLength", "pattern", "matchField", "asyncValidation"],
9
+ "example": {
10
+ "type": "text",
11
+ "label": "Full Name",
12
+ "placeholder": "John Doe",
13
+ "validation": { "required": true, "minLength": 2, "maxLength": 100 }
14
+ }
15
+ },
16
+ {
17
+ "type": "password",
18
+ "description": "Password input with masked characters",
19
+ "config": "TextFieldConfig",
20
+ "specificProps": ["autoComplete"],
21
+ "applicableValidations": ["required", "minLength", "maxLength", "hasUppercase", "hasLowercase", "hasNumber", "hasSpecialChar", "matchField"],
22
+ "example": {
23
+ "type": "password",
24
+ "label": "Password",
25
+ "validation": {
26
+ "required": true,
27
+ "minLength": 8,
28
+ "hasUppercase": true,
29
+ "hasLowercase": true,
30
+ "hasSpecialChar": true,
31
+ "messages": {
32
+ "hasUppercase": "Must contain an uppercase letter",
33
+ "hasSpecialChar": "Must contain a special character"
34
+ }
35
+ }
36
+ }
37
+ },
38
+ {
39
+ "type": "email",
40
+ "description": "Email input with built-in email validation",
41
+ "config": "TextFieldConfig",
42
+ "specificProps": ["autoComplete"],
43
+ "applicableValidations": ["required", "email", "asyncValidation"],
44
+ "example": {
45
+ "type": "email",
46
+ "label": "Email Address",
47
+ "placeholder": "user@example.com",
48
+ "validation": { "required": true, "email": true }
49
+ }
50
+ },
51
+ {
52
+ "type": "number",
53
+ "description": "Numeric input with optional min/max/step constraints",
54
+ "config": "NumberFieldConfig",
55
+ "specificProps": ["min", "max", "step"],
56
+ "applicableValidations": ["required", "min", "max"],
57
+ "example": {
58
+ "type": "number",
59
+ "label": "Age",
60
+ "min": 0,
61
+ "max": 150,
62
+ "step": 1,
63
+ "validation": { "required": true, "min": 18, "max": 120 }
64
+ }
65
+ },
66
+ {
67
+ "type": "textarea",
68
+ "description": "Multi-line text input",
69
+ "config": "TextFieldConfig",
70
+ "specificProps": ["rows"],
71
+ "applicableValidations": ["required", "minLength", "maxLength", "pattern"],
72
+ "example": {
73
+ "type": "textarea",
74
+ "label": "Bio",
75
+ "rows": 4,
76
+ "placeholder": "Tell us about yourself...",
77
+ "validation": { "maxLength": 500 }
78
+ }
79
+ },
80
+ {
81
+ "type": "select",
82
+ "description": "Single-value dropdown select. Options can be static or loaded from an API. Supports initialOptions for pre-selected values.",
83
+ "config": "SelectFieldConfig",
84
+ "specificProps": ["options", "optionsSource", "initialOptions"],
85
+ "applicableValidations": ["required"],
86
+ "example": {
87
+ "type": "select",
88
+ "label": "Country",
89
+ "options": [
90
+ { "value": "us", "label": "United States" },
91
+ { "value": "uk", "label": "United Kingdom" }
92
+ ],
93
+ "validation": { "required": true }
94
+ }
95
+ },
96
+ {
97
+ "type": "multiselect",
98
+ "description": "Multi-value dropdown select (tags / chips). Options can be static or loaded from an API. Supports initialOptions for pre-selected values.",
99
+ "config": "SelectFieldConfig",
100
+ "specificProps": ["options", "optionsSource", "initialOptions"],
101
+ "applicableValidations": ["required"],
102
+ "example": {
103
+ "type": "multiselect",
104
+ "label": "Skills",
105
+ "optionsSource": {
106
+ "apiUrl": "/api/skills",
107
+ "valueKey": "id",
108
+ "labelKey": "name"
109
+ }
110
+ }
111
+ },
112
+ {
113
+ "type": "autocomplete",
114
+ "description": "Single-value autocomplete with typeahead. Supports async search via dependsOnInput in queryParams.",
115
+ "config": "AutocompleteFieldConfig",
116
+ "specificProps": ["options", "optionsSource", "initialOptions"],
117
+ "applicableValidations": ["required", "asyncValidation"],
118
+ "example": {
119
+ "type": "autocomplete",
120
+ "label": "City",
121
+ "optionsSource": {
122
+ "apiUrl": "/api/cities",
123
+ "queryParams": [{ "key": "search", "dependsOnInput": true }],
124
+ "valueKey": "id",
125
+ "labelKey": "name"
126
+ }
127
+ }
128
+ },
129
+ {
130
+ "type": "checkbox",
131
+ "description": "Boolean checkbox (checked / unchecked)",
132
+ "config": "CheckboxFieldConfig",
133
+ "specificProps": [],
134
+ "applicableValidations": ["required"],
135
+ "example": {
136
+ "type": "checkbox",
137
+ "label": "I agree to the Terms of Service",
138
+ "defaultValue": false,
139
+ "validation": { "required": true, "messages": { "required": "You must accept the terms" } }
140
+ }
141
+ },
142
+ {
143
+ "type": "radio",
144
+ "description": "Radio button group — single choice from visible options",
145
+ "config": "RadioFieldConfig",
146
+ "specificProps": ["options", "optionsSource", "direction"],
147
+ "applicableValidations": ["required"],
148
+ "example": {
149
+ "type": "radio",
150
+ "label": "Gender",
151
+ "direction": "row",
152
+ "options": [
153
+ { "value": "male", "label": "Male" },
154
+ { "value": "female", "label": "Female" },
155
+ { "value": "other", "label": "Other" }
156
+ ]
157
+ }
158
+ },
159
+ {
160
+ "type": "switch",
161
+ "description": "Toggle switch (on / off), similar to checkbox but with different UI",
162
+ "config": "CheckboxFieldConfig",
163
+ "specificProps": [],
164
+ "applicableValidations": ["required"],
165
+ "example": {
166
+ "type": "switch",
167
+ "label": "Enable notifications",
168
+ "defaultValue": true
169
+ }
170
+ },
171
+ {
172
+ "type": "date",
173
+ "description": "Date picker (optionally with time)",
174
+ "config": "DateFieldConfig",
175
+ "specificProps": ["includeTime", "minDate", "maxDate", "format"],
176
+ "applicableValidations": ["required", "minDate", "maxDate"],
177
+ "example": {
178
+ "type": "date",
179
+ "label": "Date of Birth",
180
+ "format": "dd/MM/yyyy",
181
+ "validation": { "required": true }
182
+ }
183
+ },
184
+ {
185
+ "type": "dateRange",
186
+ "description": "Date range picker (start and end date)",
187
+ "config": "DateFieldConfig",
188
+ "specificProps": ["includeTime", "minDate", "maxDate", "format"],
189
+ "applicableValidations": ["required", "minDate", "maxDate"],
190
+ "example": {
191
+ "type": "dateRange",
192
+ "label": "Vacation Period",
193
+ "format": "dd/MM/yyyy"
194
+ }
195
+ },
196
+ {
197
+ "type": "file",
198
+ "description": "File upload field (single or multiple)",
199
+ "config": "FileFieldConfig",
200
+ "specificProps": ["accept", "maxSize", "multiple"],
201
+ "applicableValidations": ["required", "maxSize", "minFiles", "maxFiles"],
202
+ "example": {
203
+ "type": "file",
204
+ "label": "Resume",
205
+ "accept": ".pdf,.doc,.docx",
206
+ "maxSize": 5242880,
207
+ "multiple": false,
208
+ "validation": { "required": true, "maxSize": 5242880 }
209
+ }
210
+ }
211
+ ]
212
+ }
213
+