@timeax/form-palette 0.0.1
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/.scaffold-cache.json +537 -0
- package/package.json +42 -0
- package/src/.scaffold-cache.json +544 -0
- package/src/adapters/axios.ts +117 -0
- package/src/adapters/index.ts +91 -0
- package/src/adapters/inertia.ts +187 -0
- package/src/core/adapter-registry.ts +87 -0
- package/src/core/bound/bind-host.ts +14 -0
- package/src/core/bound/observe-bound-field.ts +172 -0
- package/src/core/bound/wait-for-bound-field.ts +57 -0
- package/src/core/context.ts +23 -0
- package/src/core/core-provider.tsx +818 -0
- package/src/core/core-root.tsx +72 -0
- package/src/core/core-shell.tsx +44 -0
- package/src/core/errors/error-strip.tsx +71 -0
- package/src/core/errors/index.ts +2 -0
- package/src/core/errors/map-error-bag.ts +51 -0
- package/src/core/errors/map-zod.ts +39 -0
- package/src/core/hooks/use-button.ts +220 -0
- package/src/core/hooks/use-core-context.ts +20 -0
- package/src/core/hooks/use-core-utility.ts +0 -0
- package/src/core/hooks/use-core.ts +13 -0
- package/src/core/hooks/use-field.ts +497 -0
- package/src/core/hooks/use-optional-field.ts +28 -0
- package/src/core/index.ts +0 -0
- package/src/core/registry/binder-registry.ts +82 -0
- package/src/core/registry/field-registry.ts +187 -0
- package/src/core/test.tsx +17 -0
- package/src/global.d.ts +14 -0
- package/src/index.ts +68 -0
- package/src/input/index.ts +4 -0
- package/src/input/input-field.tsx +854 -0
- package/src/input/input-layout-graph.ts +230 -0
- package/src/input/input-props.ts +190 -0
- package/src/lib/get-global-countries.ts +87 -0
- package/src/lib/utils.ts +6 -0
- package/src/presets/index.ts +0 -0
- package/src/presets/shadcn-preset.ts +0 -0
- package/src/presets/shadcn-variants/checkbox.tsx +849 -0
- package/src/presets/shadcn-variants/chips.tsx +756 -0
- package/src/presets/shadcn-variants/color.tsx +284 -0
- package/src/presets/shadcn-variants/custom.tsx +227 -0
- package/src/presets/shadcn-variants/date.tsx +796 -0
- package/src/presets/shadcn-variants/file.tsx +764 -0
- package/src/presets/shadcn-variants/keyvalue.tsx +556 -0
- package/src/presets/shadcn-variants/multiselect.tsx +1132 -0
- package/src/presets/shadcn-variants/number.tsx +176 -0
- package/src/presets/shadcn-variants/password.tsx +737 -0
- package/src/presets/shadcn-variants/phone.tsx +628 -0
- package/src/presets/shadcn-variants/radio.tsx +578 -0
- package/src/presets/shadcn-variants/select.tsx +956 -0
- package/src/presets/shadcn-variants/slider.tsx +622 -0
- package/src/presets/shadcn-variants/text.tsx +343 -0
- package/src/presets/shadcn-variants/textarea.tsx +66 -0
- package/src/presets/shadcn-variants/toggle.tsx +218 -0
- package/src/presets/shadcn-variants/treeselect.tsx +784 -0
- package/src/presets/ui/badge.tsx +46 -0
- package/src/presets/ui/button.tsx +60 -0
- package/src/presets/ui/calendar.tsx +214 -0
- package/src/presets/ui/checkbox.tsx +115 -0
- package/src/presets/ui/custom.tsx +0 -0
- package/src/presets/ui/dialog.tsx +141 -0
- package/src/presets/ui/field.tsx +246 -0
- package/src/presets/ui/input-mask.tsx +739 -0
- package/src/presets/ui/input-otp.tsx +77 -0
- package/src/presets/ui/input.tsx +1011 -0
- package/src/presets/ui/label.tsx +22 -0
- package/src/presets/ui/number.tsx +1370 -0
- package/src/presets/ui/popover.tsx +46 -0
- package/src/presets/ui/radio-group.tsx +43 -0
- package/src/presets/ui/scroll-area.tsx +56 -0
- package/src/presets/ui/select.tsx +190 -0
- package/src/presets/ui/separator.tsx +28 -0
- package/src/presets/ui/slider.tsx +61 -0
- package/src/presets/ui/switch.tsx +32 -0
- package/src/presets/ui/textarea.tsx +634 -0
- package/src/presets/ui/time-dropdowns.tsx +350 -0
- package/src/schema/adapter.ts +217 -0
- package/src/schema/core.ts +429 -0
- package/src/schema/field-map.ts +0 -0
- package/src/schema/field.ts +224 -0
- package/src/schema/index.ts +0 -0
- package/src/schema/input-field.ts +260 -0
- package/src/schema/presets.ts +0 -0
- package/src/schema/variant.ts +216 -0
- package/src/variants/core/checkbox.tsx +54 -0
- package/src/variants/core/chips.tsx +22 -0
- package/src/variants/core/color.tsx +16 -0
- package/src/variants/core/custom.tsx +18 -0
- package/src/variants/core/date.tsx +25 -0
- package/src/variants/core/file.tsx +9 -0
- package/src/variants/core/keyvalue.tsx +12 -0
- package/src/variants/core/multiselect.tsx +28 -0
- package/src/variants/core/number.tsx +115 -0
- package/src/variants/core/password.tsx +35 -0
- package/src/variants/core/phone.tsx +16 -0
- package/src/variants/core/radio.tsx +38 -0
- package/src/variants/core/select.tsx +15 -0
- package/src/variants/core/slider.tsx +55 -0
- package/src/variants/core/text.tsx +114 -0
- package/src/variants/core/textarea.tsx +22 -0
- package/src/variants/core/toggle.tsx +50 -0
- package/src/variants/core/treeselect.tsx +11 -0
- package/src/variants/helpers/selection-summary.tsx +236 -0
- package/src/variants/index.ts +75 -0
- package/src/variants/registry.ts +38 -0
- package/src/variants/select-shared.ts +0 -0
- package/src/variants/shared.ts +126 -0
- package/tsconfig.json +14 -0
|
@@ -0,0 +1,544 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"entries": {
|
|
4
|
+
"schema/index.ts": {
|
|
5
|
+
"path": "schema/index.ts",
|
|
6
|
+
"createdAt": "2025-11-28T17:28:01.941Z",
|
|
7
|
+
"sizeAtCreate": 0,
|
|
8
|
+
"groupName": "schema",
|
|
9
|
+
"groupRoot": "./"
|
|
10
|
+
},
|
|
11
|
+
"schema/adapter.ts": {
|
|
12
|
+
"path": "schema/adapter.ts",
|
|
13
|
+
"createdAt": "2025-11-28T17:28:01.957Z",
|
|
14
|
+
"sizeAtCreate": 0,
|
|
15
|
+
"groupName": "schema",
|
|
16
|
+
"groupRoot": "./"
|
|
17
|
+
},
|
|
18
|
+
"schema/field.ts": {
|
|
19
|
+
"path": "schema/field.ts",
|
|
20
|
+
"createdAt": "2025-11-28T17:28:01.960Z",
|
|
21
|
+
"sizeAtCreate": 0,
|
|
22
|
+
"groupName": "schema",
|
|
23
|
+
"groupRoot": "./"
|
|
24
|
+
},
|
|
25
|
+
"schema/field-map.ts": {
|
|
26
|
+
"path": "schema/field-map.ts",
|
|
27
|
+
"createdAt": "2025-11-28T17:28:01.964Z",
|
|
28
|
+
"sizeAtCreate": 0,
|
|
29
|
+
"groupName": "schema",
|
|
30
|
+
"groupRoot": "./"
|
|
31
|
+
},
|
|
32
|
+
"schema/core.ts": {
|
|
33
|
+
"path": "schema/core.ts",
|
|
34
|
+
"createdAt": "2025-11-28T17:28:01.967Z",
|
|
35
|
+
"sizeAtCreate": 0,
|
|
36
|
+
"groupName": "schema",
|
|
37
|
+
"groupRoot": "./"
|
|
38
|
+
},
|
|
39
|
+
"schema/input-field.ts": {
|
|
40
|
+
"path": "schema/input-field.ts",
|
|
41
|
+
"createdAt": "2025-11-28T17:28:01.970Z",
|
|
42
|
+
"sizeAtCreate": 0,
|
|
43
|
+
"groupName": "schema",
|
|
44
|
+
"groupRoot": "./"
|
|
45
|
+
},
|
|
46
|
+
"schema/presets.ts": {
|
|
47
|
+
"path": "schema/presets.ts",
|
|
48
|
+
"createdAt": "2025-11-28T17:28:01.974Z",
|
|
49
|
+
"sizeAtCreate": 0,
|
|
50
|
+
"groupName": "schema",
|
|
51
|
+
"groupRoot": "./"
|
|
52
|
+
},
|
|
53
|
+
"schema/variant.ts": {
|
|
54
|
+
"path": "schema/variant.ts",
|
|
55
|
+
"createdAt": "2025-11-28T17:28:01.981Z",
|
|
56
|
+
"sizeAtCreate": 0,
|
|
57
|
+
"groupName": "schema",
|
|
58
|
+
"groupRoot": "./"
|
|
59
|
+
},
|
|
60
|
+
"core/index.ts": {
|
|
61
|
+
"path": "core/index.ts",
|
|
62
|
+
"createdAt": "2025-11-28T17:28:01.988Z",
|
|
63
|
+
"sizeAtCreate": 0,
|
|
64
|
+
"groupName": "core",
|
|
65
|
+
"groupRoot": "./"
|
|
66
|
+
},
|
|
67
|
+
"core/context.ts": {
|
|
68
|
+
"path": "core/context.ts",
|
|
69
|
+
"createdAt": "2025-11-28T17:28:01.996Z",
|
|
70
|
+
"sizeAtCreate": 0,
|
|
71
|
+
"groupName": "core",
|
|
72
|
+
"groupRoot": "./"
|
|
73
|
+
},
|
|
74
|
+
"core/core-provider.tsx": {
|
|
75
|
+
"path": "core/core-provider.tsx",
|
|
76
|
+
"createdAt": "2025-11-28T17:28:02.000Z",
|
|
77
|
+
"sizeAtCreate": 0,
|
|
78
|
+
"groupName": "core",
|
|
79
|
+
"groupRoot": "./"
|
|
80
|
+
},
|
|
81
|
+
"core/core-root.tsx": {
|
|
82
|
+
"path": "core/core-root.tsx",
|
|
83
|
+
"createdAt": "2025-11-28T17:28:02.004Z",
|
|
84
|
+
"sizeAtCreate": 0,
|
|
85
|
+
"groupName": "core",
|
|
86
|
+
"groupRoot": "./"
|
|
87
|
+
},
|
|
88
|
+
"core/core-shell.tsx": {
|
|
89
|
+
"path": "core/core-shell.tsx",
|
|
90
|
+
"createdAt": "2025-11-28T17:28:02.007Z",
|
|
91
|
+
"sizeAtCreate": 0,
|
|
92
|
+
"groupName": "core",
|
|
93
|
+
"groupRoot": "./"
|
|
94
|
+
},
|
|
95
|
+
"core/registry/field-registry.ts": {
|
|
96
|
+
"path": "core/registry/field-registry.ts",
|
|
97
|
+
"createdAt": "2025-11-28T17:28:02.011Z",
|
|
98
|
+
"sizeAtCreate": 0,
|
|
99
|
+
"groupName": "core",
|
|
100
|
+
"groupRoot": "./"
|
|
101
|
+
},
|
|
102
|
+
"core/registry/binder-registry.ts": {
|
|
103
|
+
"path": "core/registry/binder-registry.ts",
|
|
104
|
+
"createdAt": "2025-11-28T17:28:02.015Z",
|
|
105
|
+
"sizeAtCreate": 0,
|
|
106
|
+
"groupName": "core",
|
|
107
|
+
"groupRoot": "./"
|
|
108
|
+
},
|
|
109
|
+
"core/bound/observe-bound-field.ts": {
|
|
110
|
+
"path": "core/bound/observe-bound-field.ts",
|
|
111
|
+
"createdAt": "2025-11-28T17:28:02.018Z",
|
|
112
|
+
"sizeAtCreate": 0,
|
|
113
|
+
"groupName": "core",
|
|
114
|
+
"groupRoot": "./"
|
|
115
|
+
},
|
|
116
|
+
"core/bound/wait-for-bound-field.ts": {
|
|
117
|
+
"path": "core/bound/wait-for-bound-field.ts",
|
|
118
|
+
"createdAt": "2025-11-28T17:28:02.021Z",
|
|
119
|
+
"sizeAtCreate": 0,
|
|
120
|
+
"groupName": "core",
|
|
121
|
+
"groupRoot": "./"
|
|
122
|
+
},
|
|
123
|
+
"core/hooks/use-core.ts": {
|
|
124
|
+
"path": "core/hooks/use-core.ts",
|
|
125
|
+
"createdAt": "2025-11-28T17:28:02.024Z",
|
|
126
|
+
"sizeAtCreate": 0,
|
|
127
|
+
"groupName": "core",
|
|
128
|
+
"groupRoot": "./"
|
|
129
|
+
},
|
|
130
|
+
"core/hooks/use-core-context.ts": {
|
|
131
|
+
"path": "core/hooks/use-core-context.ts",
|
|
132
|
+
"createdAt": "2025-11-28T17:28:02.034Z",
|
|
133
|
+
"sizeAtCreate": 0,
|
|
134
|
+
"groupName": "core",
|
|
135
|
+
"groupRoot": "./"
|
|
136
|
+
},
|
|
137
|
+
"core/hooks/use-field.ts": {
|
|
138
|
+
"path": "core/hooks/use-field.ts",
|
|
139
|
+
"createdAt": "2025-11-28T17:28:02.038Z",
|
|
140
|
+
"sizeAtCreate": 0,
|
|
141
|
+
"groupName": "core",
|
|
142
|
+
"groupRoot": "./"
|
|
143
|
+
},
|
|
144
|
+
"core/hooks/use-optional-field.ts": {
|
|
145
|
+
"path": "core/hooks/use-optional-field.ts",
|
|
146
|
+
"createdAt": "2025-11-28T17:28:02.042Z",
|
|
147
|
+
"sizeAtCreate": 0,
|
|
148
|
+
"groupName": "core",
|
|
149
|
+
"groupRoot": "./"
|
|
150
|
+
},
|
|
151
|
+
"core/hooks/use-button.ts": {
|
|
152
|
+
"path": "core/hooks/use-button.ts",
|
|
153
|
+
"createdAt": "2025-11-28T17:28:02.046Z",
|
|
154
|
+
"sizeAtCreate": 0,
|
|
155
|
+
"groupName": "core",
|
|
156
|
+
"groupRoot": "./"
|
|
157
|
+
},
|
|
158
|
+
"core/hooks/use-core-utility.ts": {
|
|
159
|
+
"path": "core/hooks/use-core-utility.ts",
|
|
160
|
+
"createdAt": "2025-11-28T17:28:02.049Z",
|
|
161
|
+
"sizeAtCreate": 0,
|
|
162
|
+
"groupName": "core",
|
|
163
|
+
"groupRoot": "./"
|
|
164
|
+
},
|
|
165
|
+
"core/errors/map-zod.ts": {
|
|
166
|
+
"path": "core/errors/map-zod.ts",
|
|
167
|
+
"createdAt": "2025-11-28T17:28:02.052Z",
|
|
168
|
+
"sizeAtCreate": 0,
|
|
169
|
+
"groupName": "core",
|
|
170
|
+
"groupRoot": "./"
|
|
171
|
+
},
|
|
172
|
+
"core/errors/map-error-bag.ts": {
|
|
173
|
+
"path": "core/errors/map-error-bag.ts",
|
|
174
|
+
"createdAt": "2025-11-28T17:28:02.056Z",
|
|
175
|
+
"sizeAtCreate": 0,
|
|
176
|
+
"groupName": "core",
|
|
177
|
+
"groupRoot": "./"
|
|
178
|
+
},
|
|
179
|
+
"adapters/index.ts": {
|
|
180
|
+
"path": "adapters/index.ts",
|
|
181
|
+
"createdAt": "2025-11-28T17:28:02.063Z",
|
|
182
|
+
"sizeAtCreate": 0,
|
|
183
|
+
"groupName": "adapters",
|
|
184
|
+
"groupRoot": "./"
|
|
185
|
+
},
|
|
186
|
+
"adapters/axios.ts": {
|
|
187
|
+
"path": "adapters/axios.ts",
|
|
188
|
+
"createdAt": "2025-11-28T17:28:02.066Z",
|
|
189
|
+
"sizeAtCreate": 0,
|
|
190
|
+
"groupName": "adapters",
|
|
191
|
+
"groupRoot": "./"
|
|
192
|
+
},
|
|
193
|
+
"input/index.ts": {
|
|
194
|
+
"path": "input/index.ts",
|
|
195
|
+
"createdAt": "2025-11-28T17:28:02.074Z",
|
|
196
|
+
"sizeAtCreate": 0,
|
|
197
|
+
"groupName": "input",
|
|
198
|
+
"groupRoot": "./"
|
|
199
|
+
},
|
|
200
|
+
"input/input-field.tsx": {
|
|
201
|
+
"path": "input/input-field.tsx",
|
|
202
|
+
"createdAt": "2025-11-28T17:28:02.077Z",
|
|
203
|
+
"sizeAtCreate": 0,
|
|
204
|
+
"groupName": "input",
|
|
205
|
+
"groupRoot": "./"
|
|
206
|
+
},
|
|
207
|
+
"input/input-props.ts": {
|
|
208
|
+
"path": "input/input-props.ts",
|
|
209
|
+
"createdAt": "2025-11-28T17:28:02.081Z",
|
|
210
|
+
"sizeAtCreate": 0,
|
|
211
|
+
"groupName": "input",
|
|
212
|
+
"groupRoot": "./"
|
|
213
|
+
},
|
|
214
|
+
"variants/index.ts": {
|
|
215
|
+
"path": "variants/index.ts",
|
|
216
|
+
"createdAt": "2025-11-28T17:28:02.088Z",
|
|
217
|
+
"sizeAtCreate": 0,
|
|
218
|
+
"groupName": "variants",
|
|
219
|
+
"groupRoot": "./"
|
|
220
|
+
},
|
|
221
|
+
"variants/shared.ts": {
|
|
222
|
+
"path": "variants/shared.ts",
|
|
223
|
+
"createdAt": "2025-11-28T17:28:02.092Z",
|
|
224
|
+
"sizeAtCreate": 0,
|
|
225
|
+
"groupName": "variants",
|
|
226
|
+
"groupRoot": "./"
|
|
227
|
+
},
|
|
228
|
+
"variants/select-shared.ts": {
|
|
229
|
+
"path": "variants/select-shared.ts",
|
|
230
|
+
"createdAt": "2025-11-28T17:28:02.096Z",
|
|
231
|
+
"sizeAtCreate": 0,
|
|
232
|
+
"groupName": "variants",
|
|
233
|
+
"groupRoot": "./"
|
|
234
|
+
},
|
|
235
|
+
"variants/registry.ts": {
|
|
236
|
+
"path": "variants/registry.ts",
|
|
237
|
+
"createdAt": "2025-11-28T17:28:02.099Z",
|
|
238
|
+
"sizeAtCreate": 0,
|
|
239
|
+
"groupName": "variants",
|
|
240
|
+
"groupRoot": "./"
|
|
241
|
+
},
|
|
242
|
+
"variants/core/text.tsx": {
|
|
243
|
+
"path": "variants/core/text.tsx",
|
|
244
|
+
"createdAt": "2025-11-28T17:28:02.105Z",
|
|
245
|
+
"sizeAtCreate": 0,
|
|
246
|
+
"groupName": "variants",
|
|
247
|
+
"groupRoot": "./"
|
|
248
|
+
},
|
|
249
|
+
"variants/core/textarea.tsx": {
|
|
250
|
+
"path": "variants/core/textarea.tsx",
|
|
251
|
+
"createdAt": "2025-11-28T17:28:02.108Z",
|
|
252
|
+
"sizeAtCreate": 0,
|
|
253
|
+
"groupName": "variants",
|
|
254
|
+
"groupRoot": "./"
|
|
255
|
+
},
|
|
256
|
+
"variants/core/number.tsx": {
|
|
257
|
+
"path": "variants/core/number.tsx",
|
|
258
|
+
"createdAt": "2025-11-28T17:28:02.112Z",
|
|
259
|
+
"sizeAtCreate": 0,
|
|
260
|
+
"groupName": "variants",
|
|
261
|
+
"groupRoot": "./"
|
|
262
|
+
},
|
|
263
|
+
"variants/core/select.tsx": {
|
|
264
|
+
"path": "variants/core/select.tsx",
|
|
265
|
+
"createdAt": "2025-11-28T17:28:02.116Z",
|
|
266
|
+
"sizeAtCreate": 0,
|
|
267
|
+
"groupName": "variants",
|
|
268
|
+
"groupRoot": "./"
|
|
269
|
+
},
|
|
270
|
+
"variants/core/multiselect.tsx": {
|
|
271
|
+
"path": "variants/core/multiselect.tsx",
|
|
272
|
+
"createdAt": "2025-11-28T17:28:02.119Z",
|
|
273
|
+
"sizeAtCreate": 0,
|
|
274
|
+
"groupName": "variants",
|
|
275
|
+
"groupRoot": "./"
|
|
276
|
+
},
|
|
277
|
+
"variants/core/checkbox.tsx": {
|
|
278
|
+
"path": "variants/core/checkbox.tsx",
|
|
279
|
+
"createdAt": "2025-11-28T17:28:02.123Z",
|
|
280
|
+
"sizeAtCreate": 0,
|
|
281
|
+
"groupName": "variants",
|
|
282
|
+
"groupRoot": "./"
|
|
283
|
+
},
|
|
284
|
+
"variants/core/toggle.tsx": {
|
|
285
|
+
"path": "variants/core/toggle.tsx",
|
|
286
|
+
"createdAt": "2025-11-28T17:28:02.126Z",
|
|
287
|
+
"sizeAtCreate": 0,
|
|
288
|
+
"groupName": "variants",
|
|
289
|
+
"groupRoot": "./"
|
|
290
|
+
},
|
|
291
|
+
"variants/core/radio.tsx": {
|
|
292
|
+
"path": "variants/core/radio.tsx",
|
|
293
|
+
"createdAt": "2025-11-28T17:28:02.129Z",
|
|
294
|
+
"sizeAtCreate": 0,
|
|
295
|
+
"groupName": "variants",
|
|
296
|
+
"groupRoot": "./"
|
|
297
|
+
},
|
|
298
|
+
"variants/core/chips.tsx": {
|
|
299
|
+
"path": "variants/core/chips.tsx",
|
|
300
|
+
"createdAt": "2025-11-28T17:28:02.142Z",
|
|
301
|
+
"sizeAtCreate": 0,
|
|
302
|
+
"groupName": "variants",
|
|
303
|
+
"groupRoot": "./"
|
|
304
|
+
},
|
|
305
|
+
"variants/core/treeselect.tsx": {
|
|
306
|
+
"path": "variants/core/treeselect.tsx",
|
|
307
|
+
"createdAt": "2025-11-28T17:28:02.146Z",
|
|
308
|
+
"sizeAtCreate": 0,
|
|
309
|
+
"groupName": "variants",
|
|
310
|
+
"groupRoot": "./"
|
|
311
|
+
},
|
|
312
|
+
"variants/core/date.tsx": {
|
|
313
|
+
"path": "variants/core/date.tsx",
|
|
314
|
+
"createdAt": "2025-11-28T17:28:02.152Z",
|
|
315
|
+
"sizeAtCreate": 0,
|
|
316
|
+
"groupName": "variants",
|
|
317
|
+
"groupRoot": "./"
|
|
318
|
+
},
|
|
319
|
+
"variants/core/file.tsx": {
|
|
320
|
+
"path": "variants/core/file.tsx",
|
|
321
|
+
"createdAt": "2025-11-28T17:28:02.155Z",
|
|
322
|
+
"sizeAtCreate": 0,
|
|
323
|
+
"groupName": "variants",
|
|
324
|
+
"groupRoot": "./"
|
|
325
|
+
},
|
|
326
|
+
"variants/core/color.tsx": {
|
|
327
|
+
"path": "variants/core/color.tsx",
|
|
328
|
+
"createdAt": "2025-11-28T17:28:02.158Z",
|
|
329
|
+
"sizeAtCreate": 0,
|
|
330
|
+
"groupName": "variants",
|
|
331
|
+
"groupRoot": "./"
|
|
332
|
+
},
|
|
333
|
+
"variants/core/phone.tsx": {
|
|
334
|
+
"path": "variants/core/phone.tsx",
|
|
335
|
+
"createdAt": "2025-11-28T17:28:02.161Z",
|
|
336
|
+
"sizeAtCreate": 0,
|
|
337
|
+
"groupName": "variants",
|
|
338
|
+
"groupRoot": "./"
|
|
339
|
+
},
|
|
340
|
+
"variants/core/password.tsx": {
|
|
341
|
+
"path": "variants/core/password.tsx",
|
|
342
|
+
"createdAt": "2025-11-28T17:28:02.165Z",
|
|
343
|
+
"sizeAtCreate": 0,
|
|
344
|
+
"groupName": "variants",
|
|
345
|
+
"groupRoot": "./"
|
|
346
|
+
},
|
|
347
|
+
"variants/core/keyvalue.tsx": {
|
|
348
|
+
"path": "variants/core/keyvalue.tsx",
|
|
349
|
+
"createdAt": "2025-11-28T17:28:02.170Z",
|
|
350
|
+
"sizeAtCreate": 0,
|
|
351
|
+
"groupName": "variants",
|
|
352
|
+
"groupRoot": "./"
|
|
353
|
+
},
|
|
354
|
+
"variants/core/custom.tsx": {
|
|
355
|
+
"path": "variants/core/custom.tsx",
|
|
356
|
+
"createdAt": "2025-11-28T17:28:02.174Z",
|
|
357
|
+
"sizeAtCreate": 0,
|
|
358
|
+
"groupName": "variants",
|
|
359
|
+
"groupRoot": "./"
|
|
360
|
+
},
|
|
361
|
+
"presets/index.ts": {
|
|
362
|
+
"path": "presets/index.ts",
|
|
363
|
+
"createdAt": "2025-11-28T17:28:02.179Z",
|
|
364
|
+
"sizeAtCreate": 0,
|
|
365
|
+
"groupName": "presets",
|
|
366
|
+
"groupRoot": "./"
|
|
367
|
+
},
|
|
368
|
+
"presets/shadcn-preset.ts": {
|
|
369
|
+
"path": "presets/shadcn-preset.ts",
|
|
370
|
+
"createdAt": "2025-11-28T17:28:02.184Z",
|
|
371
|
+
"sizeAtCreate": 0,
|
|
372
|
+
"groupName": "presets",
|
|
373
|
+
"groupRoot": "./"
|
|
374
|
+
},
|
|
375
|
+
"presets/ui/custom.tsx": {
|
|
376
|
+
"path": "presets/ui/custom.tsx",
|
|
377
|
+
"createdAt": "2025-11-28T17:28:02.187Z",
|
|
378
|
+
"sizeAtCreate": 0,
|
|
379
|
+
"groupName": "presets",
|
|
380
|
+
"groupRoot": "./"
|
|
381
|
+
},
|
|
382
|
+
"core/adapter-registry.ts": {
|
|
383
|
+
"path": "core/adapter-registry.ts",
|
|
384
|
+
"createdAt": "2025-11-28T18:57:00.080Z",
|
|
385
|
+
"sizeAtCreate": 0,
|
|
386
|
+
"groupName": "core",
|
|
387
|
+
"groupRoot": "./"
|
|
388
|
+
},
|
|
389
|
+
"core/errors/index.ts": {
|
|
390
|
+
"path": "core/errors/index.ts",
|
|
391
|
+
"createdAt": "2025-11-28T19:14:17.971Z",
|
|
392
|
+
"sizeAtCreate": 0,
|
|
393
|
+
"groupName": "core",
|
|
394
|
+
"groupRoot": "./"
|
|
395
|
+
},
|
|
396
|
+
"core/bound/bind-host.ts": {
|
|
397
|
+
"path": "core/bound/bind-host.ts",
|
|
398
|
+
"createdAt": "2025-11-29T07:21:41.695Z",
|
|
399
|
+
"sizeAtCreate": 0,
|
|
400
|
+
"groupName": "core",
|
|
401
|
+
"groupRoot": "./"
|
|
402
|
+
},
|
|
403
|
+
"core/errors/error-strip.tsx": {
|
|
404
|
+
"path": "core/errors/error-strip.tsx",
|
|
405
|
+
"createdAt": "2025-11-29T07:30:21.798Z",
|
|
406
|
+
"sizeAtCreate": 0,
|
|
407
|
+
"groupName": "core",
|
|
408
|
+
"groupRoot": "./"
|
|
409
|
+
},
|
|
410
|
+
"presets/shadcn-variants/text.tsx": {
|
|
411
|
+
"path": "presets/shadcn-variants/text.tsx",
|
|
412
|
+
"createdAt": "2025-11-29T08:33:53.367Z",
|
|
413
|
+
"sizeAtCreate": 0,
|
|
414
|
+
"groupName": "presets",
|
|
415
|
+
"groupRoot": "./"
|
|
416
|
+
},
|
|
417
|
+
"presets/shadcn-variants/select.tsx": {
|
|
418
|
+
"path": "presets/shadcn-variants/select.tsx",
|
|
419
|
+
"createdAt": "2025-12-02T04:12:47.804Z",
|
|
420
|
+
"sizeAtCreate": 0,
|
|
421
|
+
"groupName": "presets",
|
|
422
|
+
"groupRoot": "./"
|
|
423
|
+
},
|
|
424
|
+
"presets/shadcn-variants/checkbox.tsx": {
|
|
425
|
+
"path": "presets/shadcn-variants/checkbox.tsx",
|
|
426
|
+
"createdAt": "2025-12-02T04:12:47.806Z",
|
|
427
|
+
"sizeAtCreate": 0,
|
|
428
|
+
"groupName": "presets",
|
|
429
|
+
"groupRoot": "./"
|
|
430
|
+
},
|
|
431
|
+
"presets/shadcn-variants/toggle.tsx": {
|
|
432
|
+
"path": "presets/shadcn-variants/toggle.tsx",
|
|
433
|
+
"createdAt": "2025-12-02T04:12:47.807Z",
|
|
434
|
+
"sizeAtCreate": 0,
|
|
435
|
+
"groupName": "presets",
|
|
436
|
+
"groupRoot": "./"
|
|
437
|
+
},
|
|
438
|
+
"presets/shadcn-variants/radio.tsx": {
|
|
439
|
+
"path": "presets/shadcn-variants/radio.tsx",
|
|
440
|
+
"createdAt": "2025-12-02T04:12:47.808Z",
|
|
441
|
+
"sizeAtCreate": 0,
|
|
442
|
+
"groupName": "presets",
|
|
443
|
+
"groupRoot": "./"
|
|
444
|
+
},
|
|
445
|
+
"presets/shadcn-variants/date.tsx": {
|
|
446
|
+
"path": "presets/shadcn-variants/date.tsx",
|
|
447
|
+
"createdAt": "2025-12-02T04:12:47.814Z",
|
|
448
|
+
"sizeAtCreate": 0,
|
|
449
|
+
"groupName": "presets",
|
|
450
|
+
"groupRoot": "./"
|
|
451
|
+
},
|
|
452
|
+
"presets/shadcn-variants/file.tsx": {
|
|
453
|
+
"path": "presets/shadcn-variants/file.tsx",
|
|
454
|
+
"createdAt": "2025-12-02T04:12:47.815Z",
|
|
455
|
+
"sizeAtCreate": 0,
|
|
456
|
+
"groupName": "presets",
|
|
457
|
+
"groupRoot": "./"
|
|
458
|
+
},
|
|
459
|
+
"presets/shadcn-variants/color.tsx": {
|
|
460
|
+
"path": "presets/shadcn-variants/color.tsx",
|
|
461
|
+
"createdAt": "2025-12-02T04:12:47.817Z",
|
|
462
|
+
"sizeAtCreate": 0,
|
|
463
|
+
"groupName": "presets",
|
|
464
|
+
"groupRoot": "./"
|
|
465
|
+
},
|
|
466
|
+
"presets/shadcn-variants/password.tsx": {
|
|
467
|
+
"path": "presets/shadcn-variants/password.tsx",
|
|
468
|
+
"createdAt": "2025-12-02T04:12:47.818Z",
|
|
469
|
+
"sizeAtCreate": 0,
|
|
470
|
+
"groupName": "presets",
|
|
471
|
+
"groupRoot": "./"
|
|
472
|
+
},
|
|
473
|
+
"presets/shadcn-variants/keyvalue.tsx": {
|
|
474
|
+
"path": "presets/shadcn-variants/keyvalue.tsx",
|
|
475
|
+
"createdAt": "2025-12-02T04:12:47.820Z",
|
|
476
|
+
"sizeAtCreate": 0,
|
|
477
|
+
"groupName": "presets",
|
|
478
|
+
"groupRoot": "./"
|
|
479
|
+
},
|
|
480
|
+
"presets/shadcn-variants/custom.tsx": {
|
|
481
|
+
"path": "presets/shadcn-variants/custom.tsx",
|
|
482
|
+
"createdAt": "2025-12-02T04:12:47.821Z",
|
|
483
|
+
"sizeAtCreate": 0,
|
|
484
|
+
"groupName": "presets",
|
|
485
|
+
"groupRoot": "./"
|
|
486
|
+
},
|
|
487
|
+
"presets/shadcn-variants/textarea.tsx": {
|
|
488
|
+
"path": "presets/shadcn-variants/textarea.tsx",
|
|
489
|
+
"createdAt": "2025-12-02T04:12:47.822Z",
|
|
490
|
+
"sizeAtCreate": 0,
|
|
491
|
+
"groupName": "presets",
|
|
492
|
+
"groupRoot": "./"
|
|
493
|
+
},
|
|
494
|
+
"presets/shadcn-variants/multiselect.tsx": {
|
|
495
|
+
"path": "presets/shadcn-variants/multiselect.tsx",
|
|
496
|
+
"createdAt": "2025-12-02T04:12:47.823Z",
|
|
497
|
+
"sizeAtCreate": 0,
|
|
498
|
+
"groupName": "presets",
|
|
499
|
+
"groupRoot": "./"
|
|
500
|
+
},
|
|
501
|
+
"presets/shadcn-variants/chips.tsx": {
|
|
502
|
+
"path": "presets/shadcn-variants/chips.tsx",
|
|
503
|
+
"createdAt": "2025-12-02T04:12:47.824Z",
|
|
504
|
+
"sizeAtCreate": 0,
|
|
505
|
+
"groupName": "presets",
|
|
506
|
+
"groupRoot": "./"
|
|
507
|
+
},
|
|
508
|
+
"presets/shadcn-variants/treeselect.tsx": {
|
|
509
|
+
"path": "presets/shadcn-variants/treeselect.tsx",
|
|
510
|
+
"createdAt": "2025-12-02T04:12:47.825Z",
|
|
511
|
+
"sizeAtCreate": 0,
|
|
512
|
+
"groupName": "presets",
|
|
513
|
+
"groupRoot": "./"
|
|
514
|
+
},
|
|
515
|
+
"presets/shadcn-variants/phone.tsx": {
|
|
516
|
+
"path": "presets/shadcn-variants/phone.tsx",
|
|
517
|
+
"createdAt": "2025-12-02T04:12:47.826Z",
|
|
518
|
+
"sizeAtCreate": 0,
|
|
519
|
+
"groupName": "presets",
|
|
520
|
+
"groupRoot": "./"
|
|
521
|
+
},
|
|
522
|
+
"presets/shadcn-variants/slider.tsx": {
|
|
523
|
+
"path": "presets/shadcn-variants/slider.tsx",
|
|
524
|
+
"createdAt": "2025-12-02T04:12:47.828Z",
|
|
525
|
+
"sizeAtCreate": 0,
|
|
526
|
+
"groupName": "presets",
|
|
527
|
+
"groupRoot": "./"
|
|
528
|
+
},
|
|
529
|
+
"variants/helpers/selection-summary.tsx": {
|
|
530
|
+
"path": "variants/helpers/selection-summary.tsx",
|
|
531
|
+
"createdAt": "2025-12-05T10:58:43.283Z",
|
|
532
|
+
"sizeAtCreate": 0,
|
|
533
|
+
"groupName": "variants",
|
|
534
|
+
"groupRoot": "./"
|
|
535
|
+
},
|
|
536
|
+
"variants/core/slider.tsx": {
|
|
537
|
+
"path": "variants/core/slider.tsx",
|
|
538
|
+
"createdAt": "2025-12-05T12:04:13.785Z",
|
|
539
|
+
"sizeAtCreate": 0,
|
|
540
|
+
"groupName": "variants",
|
|
541
|
+
"groupRoot": "./"
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
// src/adapters/axios.ts
|
|
2
|
+
import axios, {
|
|
3
|
+
type AxiosError,
|
|
4
|
+
type AxiosRequestConfig,
|
|
5
|
+
type AxiosResponse,
|
|
6
|
+
} from "axios";
|
|
7
|
+
import type {
|
|
8
|
+
NamedAdapterFactory,
|
|
9
|
+
AdapterResult,
|
|
10
|
+
AdapterOk,
|
|
11
|
+
AdapterError,
|
|
12
|
+
} from "@/schema/adapter";
|
|
13
|
+
|
|
14
|
+
// (Adapters augmentation is above in the same file)
|
|
15
|
+
|
|
16
|
+
export const createAxiosAdapter: NamedAdapterFactory<"axios"> = (config): AdapterResult<AdapterOk<"axios">> => {
|
|
17
|
+
const { method, url, data, callbacks } = config;
|
|
18
|
+
|
|
19
|
+
function buildRequestConfig(
|
|
20
|
+
options?: unknown
|
|
21
|
+
): AxiosRequestConfig<any> {
|
|
22
|
+
return {
|
|
23
|
+
method,
|
|
24
|
+
url,
|
|
25
|
+
data,
|
|
26
|
+
...(options as AxiosRequestConfig<any> | undefined),
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function submit(options?: unknown): void {
|
|
31
|
+
let finished = false;
|
|
32
|
+
const finish = () => {
|
|
33
|
+
if (finished) return;
|
|
34
|
+
finished = true;
|
|
35
|
+
callbacks?.onFinish?.();
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
axios
|
|
39
|
+
.request(buildRequestConfig(options))
|
|
40
|
+
.then((response: AxiosResponse<unknown>) => {
|
|
41
|
+
callbacks?.onSuccess?.(response as AdapterOk<"axios">);
|
|
42
|
+
})
|
|
43
|
+
.catch((error: AxiosError | unknown) => {
|
|
44
|
+
const axiosErr = error as AxiosError<unknown>;
|
|
45
|
+
// Prefer response.data; this is usually where Laravel
|
|
46
|
+
// puts `{ errors: {...} }` for validation failures.
|
|
47
|
+
const payload =
|
|
48
|
+
axiosErr?.response?.data ?? error;
|
|
49
|
+
|
|
50
|
+
callbacks?.onError?.(payload as AdapterError<"axios">);
|
|
51
|
+
})
|
|
52
|
+
.finally(() => {
|
|
53
|
+
finish();
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function send(options?: unknown): Promise<AdapterOk<"axios">> {
|
|
58
|
+
return new Promise((resolve, reject) => {
|
|
59
|
+
let finished = false;
|
|
60
|
+
const finish = () => {
|
|
61
|
+
if (finished) return;
|
|
62
|
+
finished = true;
|
|
63
|
+
callbacks?.onFinish?.();
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
axios
|
|
67
|
+
.request(buildRequestConfig(options))
|
|
68
|
+
.then((response: AxiosResponse<unknown>) => {
|
|
69
|
+
callbacks?.onSuccess?.(response as AdapterOk<"axios">);
|
|
70
|
+
resolve(response as AdapterOk<"axios">);
|
|
71
|
+
})
|
|
72
|
+
.catch((error: AxiosError | unknown) => {
|
|
73
|
+
const axiosErr = error as AxiosError<unknown>;
|
|
74
|
+
const payload =
|
|
75
|
+
axiosErr?.response?.data ?? error;
|
|
76
|
+
|
|
77
|
+
callbacks?.onError?.(payload as AdapterError<"axios">);
|
|
78
|
+
reject(payload as AdapterError<"axios">);
|
|
79
|
+
})
|
|
80
|
+
.finally(() => {
|
|
81
|
+
finish();
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function run(options?: unknown): Promise<AdapterOk<"axios">> {
|
|
87
|
+
// "Smart" default: same as send(), so you can `await run()`.
|
|
88
|
+
return send(options);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return {
|
|
92
|
+
submit,
|
|
93
|
+
send,
|
|
94
|
+
run,
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
// src/adapters/axios.ts
|
|
99
|
+
|
|
100
|
+
declare module "@/schema/adapter" {
|
|
101
|
+
interface Adapters {
|
|
102
|
+
axios: {
|
|
103
|
+
/**
|
|
104
|
+
* What adapter.send() resolves with for Axios.
|
|
105
|
+
*/
|
|
106
|
+
ok: AxiosResponse<unknown>;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* What callbacks.onError receives for Axios.
|
|
110
|
+
*
|
|
111
|
+
* We pass the *payload* (e.g. response.data), not the raw AxiosError,
|
|
112
|
+
* so Form Palette's autoErr branch can see `.errors`.
|
|
113
|
+
*/
|
|
114
|
+
err: unknown;
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
}
|