@twintag/twintag-form 0.4.2 → 0.6.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.
Files changed (77) hide show
  1. package/.eslintrc.cjs +1 -1
  2. package/.turbo/turbo-build.log +11 -55
  3. package/CHANGELOG.md +28 -0
  4. package/README.md +9 -9
  5. package/dist/components/Category/__styles.d.ts +29 -0
  6. package/dist/{lib/components → components}/Category/index.d.ts +2 -3
  7. package/dist/components/Form/index.d.ts +12 -0
  8. package/dist/{lib/types/index.d.ts → components/Input/__props.d.ts} +0 -6
  9. package/dist/components/Input/__styles.d.ts +460 -0
  10. package/dist/{lib/components → components}/Input/checkbox.d.ts +2 -3
  11. package/dist/{lib/components → components}/Input/file.d.ts +2 -3
  12. package/dist/{lib/components → components}/Input/index.d.ts +0 -1
  13. package/dist/{lib/components → components}/Input/simple.d.ts +2 -3
  14. package/dist/{lib/components → components}/Input/submit.d.ts +2 -3
  15. package/dist/{lib/components → components}/Input/textarea.d.ts +2 -3
  16. package/dist/{lib/components → components}/Input/toggle.d.ts +2 -3
  17. package/dist/{lib/components → components}/Label/index.d.ts +0 -1
  18. package/dist/components/index.d.ts +4 -0
  19. package/dist/index.d.ts +14 -0
  20. package/dist/react.d.ts +1 -0
  21. package/dist/styles.d.ts +487 -0
  22. package/dist/twintag-form.react.js +8726 -0
  23. package/dist/twintag-form.webcomponent.js +4503 -0
  24. package/dist/webcomponent.d.ts +1 -0
  25. package/lib/__stories__/Form.stories.tsx +104 -12
  26. package/lib/components/Category/__styles.ts +12 -0
  27. package/lib/components/Category/index.tsx +5 -8
  28. package/lib/components/Form/index.tsx +33 -34
  29. package/lib/{types/index.ts → components/Input/__props.ts} +0 -6
  30. package/lib/components/Input/__styles.ts +132 -0
  31. package/lib/components/Input/checkbox.tsx +9 -12
  32. package/lib/components/Input/file.tsx +10 -13
  33. package/lib/components/Input/simple.tsx +9 -11
  34. package/lib/components/Input/submit.tsx +3 -9
  35. package/lib/components/Input/textarea.tsx +9 -11
  36. package/lib/components/Input/toggle.tsx +11 -12
  37. package/lib/components/Label/index.tsx +3 -2
  38. package/lib/components/index.tsx +4 -6
  39. package/lib/index.tsx +39 -161
  40. package/lib/styles.ts +19 -18
  41. package/lib/webcomponent.ts +3 -3
  42. package/package.json +14 -17
  43. package/tsconfig.json +12 -3
  44. package/twind.config.ts +7 -7
  45. package/vite.config.ts +47 -0
  46. package/dist/index.es.js +0 -27362
  47. package/dist/index.umd.js +0 -196
  48. package/dist/lib/__stories__/Form.stories.d.ts +0 -7
  49. package/dist/lib/__stories__/Form.stories.d.ts.map +0 -1
  50. package/dist/lib/components/Category/index.d.ts.map +0 -1
  51. package/dist/lib/components/Form/index.d.ts +0 -10
  52. package/dist/lib/components/Form/index.d.ts.map +0 -1
  53. package/dist/lib/components/Form/register.d.ts +0 -12
  54. package/dist/lib/components/Form/register.d.ts.map +0 -1
  55. package/dist/lib/components/Input/checkbox.d.ts.map +0 -1
  56. package/dist/lib/components/Input/file.d.ts.map +0 -1
  57. package/dist/lib/components/Input/index.d.ts.map +0 -1
  58. package/dist/lib/components/Input/simple.d.ts.map +0 -1
  59. package/dist/lib/components/Input/submit.d.ts.map +0 -1
  60. package/dist/lib/components/Input/textarea.d.ts.map +0 -1
  61. package/dist/lib/components/Input/toggle.d.ts.map +0 -1
  62. package/dist/lib/components/Label/index.d.ts.map +0 -1
  63. package/dist/lib/components/index.d.ts +0 -6
  64. package/dist/lib/components/index.d.ts.map +0 -1
  65. package/dist/lib/index.d.ts +0 -20
  66. package/dist/lib/index.d.ts.map +0 -1
  67. package/dist/lib/styles.d.ts +0 -131
  68. package/dist/lib/styles.d.ts.map +0 -1
  69. package/dist/lib/types/index.d.ts.map +0 -1
  70. package/dist/lib/webcomponent.d.ts +0 -2
  71. package/dist/lib/webcomponent.d.ts.map +0 -1
  72. package/dist/twind.config.d.ts +0 -5
  73. package/dist/twind.config.d.ts.map +0 -1
  74. package/dist/webcomponent.es.js +0 -31726
  75. package/dist/webcomponent.umd.js +0 -196
  76. package/lib/components/Form/register.tsx +0 -69
  77. package/scripts/build.js +0 -60
@@ -1,8 +1,7 @@
1
1
  import type { FC } from 'react';
2
2
  import type { VariantProps } from 'tailwind-variants';
3
- import type { CommonProps } from '@twintag-form/types';
4
- import { simpleStyle } from '@twintag-form/styles';
3
+ import { type CommonProps } from './__props';
4
+ import { simpleStyle } from './__styles';
5
5
  type Props = CommonProps<VariantProps<typeof simpleStyle>['variant']>;
6
6
  declare const Simple: FC<Props>;
7
7
  export default Simple;
8
- //# sourceMappingURL=simple.d.ts.map
@@ -1,8 +1,7 @@
1
1
  import type { FC } from 'react';
2
2
  import type { VariantProps } from 'tailwind-variants';
3
- import type { CommonProps } from '@twintag-form/types';
4
- import { submitStyle } from '@twintag-form/styles';
3
+ import { type CommonProps } from './__props';
4
+ import { submitStyle } from './__styles';
5
5
  type Props = CommonProps<VariantProps<typeof submitStyle>['variant']>;
6
6
  declare const Submit: FC<Props>;
7
7
  export default Submit;
8
- //# sourceMappingURL=submit.d.ts.map
@@ -1,8 +1,7 @@
1
1
  import type { FC } from 'react';
2
2
  import type { VariantProps } from 'tailwind-variants';
3
- import type { CommonProps } from '@twintag-form/types';
4
- import { simpleStyle } from '@twintag-form/styles';
3
+ import { type CommonProps } from './__props';
4
+ import { simpleStyle } from './__styles';
5
5
  type Props = CommonProps<VariantProps<typeof simpleStyle>['variant']>;
6
6
  declare const Textarea: FC<Props>;
7
7
  export default Textarea;
8
- //# sourceMappingURL=textarea.d.ts.map
@@ -1,8 +1,7 @@
1
1
  import type { FC } from 'react';
2
2
  import type { VariantProps } from 'tailwind-variants';
3
- import type { CommonProps } from '@twintag-form/types';
4
- import { toggleStyle } from '@twintag-form/styles';
3
+ import { type CommonProps } from './__props';
4
+ import { toggleStyle } from './__styles';
5
5
  type Props = CommonProps<VariantProps<typeof toggleStyle>['variant']>;
6
6
  declare const Toggle: FC<Props>;
7
7
  export default Toggle;
8
- //# sourceMappingURL=toggle.d.ts.map
@@ -6,4 +6,3 @@ type Props = {
6
6
  } & WithChildren;
7
7
  declare const Label: FC<Props>;
8
8
  export default Label;
9
- //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ export { default as Form } from './Form';
2
+ export { default as Input } from './Input';
3
+ export { default as Label } from './Label';
4
+ export { default as Category } from './Category';
@@ -0,0 +1,14 @@
1
+ import { ForwardRefExoticComponent, RefAttributes } from 'react';
2
+ /// <reference types="react" />
3
+ import type { RawJsonComponent } from '@twintag/twintag-json-renderer/types';
4
+ type Props = {
5
+ config: RawJsonComponent[];
6
+ options?: {
7
+ variant?: string;
8
+ resetOnSubmit?: boolean;
9
+ };
10
+ };
11
+ export declare const TwintagForm: ForwardRefExoticComponent<Props & RefAttributes<{
12
+ validate?: (() => void) | undefined;
13
+ }>>;
14
+ export {};
@@ -0,0 +1 @@
1
+ export * from './index'
@@ -0,0 +1,487 @@
1
+ import { TVConfig } from 'tailwind-variants/dist/config.js';
2
+ import { TVReturnType, ClassValue } from 'tailwind-variants';
3
+ export declare const labelStyle: TVReturnType<{
4
+ [key: string]: {
5
+ [key: string]: ClassValue | {
6
+ base?: ClassValue;
7
+ };
8
+ };
9
+ } | {
10
+ [x: string]: {
11
+ [x: string]: ClassValue | {
12
+ base?: ClassValue;
13
+ };
14
+ } | undefined;
15
+ } | {}, undefined, "text-label", TVConfig<unknown, {
16
+ [key: string]: {
17
+ [key: string]: ClassValue | {
18
+ base?: ClassValue;
19
+ };
20
+ };
21
+ } | {}>, {
22
+ [key: string]: {
23
+ [key: string]: ClassValue | {
24
+ base?: ClassValue;
25
+ };
26
+ };
27
+ } | {}, undefined, TVReturnType<unknown, undefined, "text-label", TVConfig<unknown, {
28
+ [key: string]: {
29
+ [key: string]: ClassValue | {
30
+ base?: ClassValue;
31
+ };
32
+ };
33
+ } | {}>, unknown, unknown, undefined>>;
34
+ export declare const containerStyle: TVReturnType<{
35
+ [key: string]: {
36
+ [key: string]: ClassValue | {
37
+ base?: ClassValue;
38
+ };
39
+ };
40
+ } | {
41
+ [x: string]: {
42
+ [x: string]: ClassValue | {
43
+ base?: ClassValue;
44
+ };
45
+ } | undefined;
46
+ } | {}, undefined, "my-2", TVConfig<unknown, {
47
+ [key: string]: {
48
+ [key: string]: ClassValue | {
49
+ base?: ClassValue;
50
+ };
51
+ };
52
+ } | {}>, {
53
+ [key: string]: {
54
+ [key: string]: ClassValue | {
55
+ base?: ClassValue;
56
+ };
57
+ };
58
+ } | {}, undefined, TVReturnType<unknown, undefined, "my-2", TVConfig<unknown, {
59
+ [key: string]: {
60
+ [key: string]: ClassValue | {
61
+ base?: ClassValue;
62
+ };
63
+ };
64
+ } | {}>, unknown, unknown, undefined>>;
65
+ export declare const categoryStyle: TVReturnType<{
66
+ variant: {};
67
+ }, {
68
+ container: string;
69
+ span: string;
70
+ items: string;
71
+ }, undefined, TVConfig<{
72
+ variant: {};
73
+ }, {
74
+ variant: {};
75
+ }>, {
76
+ variant: {};
77
+ }, {
78
+ container: string;
79
+ span: string;
80
+ items: string;
81
+ }, TVReturnType<{
82
+ variant: {};
83
+ }, {
84
+ container: string;
85
+ span: string;
86
+ items: string;
87
+ }, undefined, TVConfig<{
88
+ variant: {};
89
+ }, {
90
+ variant: {};
91
+ }>, unknown, unknown, undefined>>;
92
+ export declare const checkboxStyle: TVReturnType<{
93
+ variant: {
94
+ alpha: {
95
+ checkbox: string;
96
+ };
97
+ beta: {
98
+ checkbox: string;
99
+ };
100
+ };
101
+ }, {
102
+ container: string;
103
+ checkbox: string;
104
+ }, undefined, TVConfig<{
105
+ variant: {
106
+ alpha: {
107
+ checkbox: string;
108
+ };
109
+ beta: {
110
+ checkbox: string;
111
+ };
112
+ };
113
+ }, {
114
+ variant: {
115
+ alpha: {
116
+ checkbox: string;
117
+ };
118
+ beta: {
119
+ checkbox: string;
120
+ };
121
+ };
122
+ }>, {
123
+ variant: {
124
+ alpha: {
125
+ checkbox: string;
126
+ };
127
+ beta: {
128
+ checkbox: string;
129
+ };
130
+ };
131
+ }, {
132
+ container: string;
133
+ checkbox: string;
134
+ }, TVReturnType<{
135
+ variant: {
136
+ alpha: {
137
+ checkbox: string;
138
+ };
139
+ beta: {
140
+ checkbox: string;
141
+ };
142
+ };
143
+ }, {
144
+ container: string;
145
+ checkbox: string;
146
+ }, undefined, TVConfig<{
147
+ variant: {
148
+ alpha: {
149
+ checkbox: string;
150
+ };
151
+ beta: {
152
+ checkbox: string;
153
+ };
154
+ };
155
+ }, {
156
+ variant: {
157
+ alpha: {
158
+ checkbox: string;
159
+ };
160
+ beta: {
161
+ checkbox: string;
162
+ };
163
+ };
164
+ }>, unknown, unknown, undefined>>;
165
+ export declare const fileStyle: TVReturnType<{
166
+ variant: {
167
+ alpha: {
168
+ container: string;
169
+ input: string;
170
+ };
171
+ beta: {
172
+ container: string;
173
+ input: string;
174
+ };
175
+ };
176
+ }, {
177
+ container: string;
178
+ span: string;
179
+ input: string;
180
+ }, undefined, TVConfig<{
181
+ variant: {
182
+ alpha: {
183
+ container: string;
184
+ input: string;
185
+ };
186
+ beta: {
187
+ container: string;
188
+ input: string;
189
+ };
190
+ };
191
+ }, {
192
+ variant: {
193
+ alpha: {
194
+ container: string;
195
+ input: string;
196
+ };
197
+ beta: {
198
+ container: string;
199
+ input: string;
200
+ };
201
+ };
202
+ }>, {
203
+ variant: {
204
+ alpha: {
205
+ container: string;
206
+ input: string;
207
+ };
208
+ beta: {
209
+ container: string;
210
+ input: string;
211
+ };
212
+ };
213
+ }, {
214
+ container: string;
215
+ span: string;
216
+ input: string;
217
+ }, TVReturnType<{
218
+ variant: {
219
+ alpha: {
220
+ container: string;
221
+ input: string;
222
+ };
223
+ beta: {
224
+ container: string;
225
+ input: string;
226
+ };
227
+ };
228
+ }, {
229
+ container: string;
230
+ span: string;
231
+ input: string;
232
+ }, undefined, TVConfig<{
233
+ variant: {
234
+ alpha: {
235
+ container: string;
236
+ input: string;
237
+ };
238
+ beta: {
239
+ container: string;
240
+ input: string;
241
+ };
242
+ };
243
+ }, {
244
+ variant: {
245
+ alpha: {
246
+ container: string;
247
+ input: string;
248
+ };
249
+ beta: {
250
+ container: string;
251
+ input: string;
252
+ };
253
+ };
254
+ }>, unknown, unknown, undefined>>;
255
+ export declare const simpleStyle: TVReturnType<{
256
+ variant: {
257
+ alpha: {
258
+ container: string;
259
+ input: string;
260
+ };
261
+ beta: {
262
+ container: string;
263
+ input: string;
264
+ };
265
+ };
266
+ }, {
267
+ container: string;
268
+ span: string;
269
+ input: string;
270
+ }, undefined, TVConfig<{
271
+ variant: {
272
+ alpha: {
273
+ container: string;
274
+ input: string;
275
+ };
276
+ beta: {
277
+ container: string;
278
+ input: string;
279
+ };
280
+ };
281
+ }, {
282
+ variant: {
283
+ alpha: {
284
+ container: string;
285
+ input: string;
286
+ };
287
+ beta: {
288
+ container: string;
289
+ input: string;
290
+ };
291
+ };
292
+ }>, {
293
+ variant: {
294
+ alpha: {
295
+ container: string;
296
+ input: string;
297
+ };
298
+ beta: {
299
+ container: string;
300
+ input: string;
301
+ };
302
+ };
303
+ }, {
304
+ container: string;
305
+ span: string;
306
+ input: string;
307
+ }, TVReturnType<{
308
+ variant: {
309
+ alpha: {
310
+ container: string;
311
+ input: string;
312
+ };
313
+ beta: {
314
+ container: string;
315
+ input: string;
316
+ };
317
+ };
318
+ }, {
319
+ container: string;
320
+ span: string;
321
+ input: string;
322
+ }, undefined, TVConfig<{
323
+ variant: {
324
+ alpha: {
325
+ container: string;
326
+ input: string;
327
+ };
328
+ beta: {
329
+ container: string;
330
+ input: string;
331
+ };
332
+ };
333
+ }, {
334
+ variant: {
335
+ alpha: {
336
+ container: string;
337
+ input: string;
338
+ };
339
+ beta: {
340
+ container: string;
341
+ input: string;
342
+ };
343
+ };
344
+ }>, unknown, unknown, undefined>>;
345
+ export declare const toggleStyle: TVReturnType<{
346
+ variant: {
347
+ alpha: {
348
+ container: string;
349
+ input: string;
350
+ thumb: string;
351
+ };
352
+ beta: {
353
+ container: string;
354
+ input: string;
355
+ thumb: string;
356
+ };
357
+ };
358
+ }, {
359
+ container: string;
360
+ span: string;
361
+ input: string;
362
+ thumb: string;
363
+ }, undefined, TVConfig<{
364
+ variant: {
365
+ alpha: {
366
+ container: string;
367
+ input: string;
368
+ thumb: string;
369
+ };
370
+ beta: {
371
+ container: string;
372
+ input: string;
373
+ thumb: string;
374
+ };
375
+ };
376
+ }, {
377
+ variant: {
378
+ alpha: {
379
+ container: string;
380
+ input: string;
381
+ thumb: string;
382
+ };
383
+ beta: {
384
+ container: string;
385
+ input: string;
386
+ thumb: string;
387
+ };
388
+ };
389
+ }>, {
390
+ variant: {
391
+ alpha: {
392
+ container: string;
393
+ input: string;
394
+ thumb: string;
395
+ };
396
+ beta: {
397
+ container: string;
398
+ input: string;
399
+ thumb: string;
400
+ };
401
+ };
402
+ }, {
403
+ container: string;
404
+ span: string;
405
+ input: string;
406
+ thumb: string;
407
+ }, TVReturnType<{
408
+ variant: {
409
+ alpha: {
410
+ container: string;
411
+ input: string;
412
+ thumb: string;
413
+ };
414
+ beta: {
415
+ container: string;
416
+ input: string;
417
+ thumb: string;
418
+ };
419
+ };
420
+ }, {
421
+ container: string;
422
+ span: string;
423
+ input: string;
424
+ thumb: string;
425
+ }, undefined, TVConfig<{
426
+ variant: {
427
+ alpha: {
428
+ container: string;
429
+ input: string;
430
+ thumb: string;
431
+ };
432
+ beta: {
433
+ container: string;
434
+ input: string;
435
+ thumb: string;
436
+ };
437
+ };
438
+ }, {
439
+ variant: {
440
+ alpha: {
441
+ container: string;
442
+ input: string;
443
+ thumb: string;
444
+ };
445
+ beta: {
446
+ container: string;
447
+ input: string;
448
+ thumb: string;
449
+ };
450
+ };
451
+ }>, unknown, unknown, undefined>>;
452
+ export declare const submitStyle: TVReturnType<{
453
+ variant: {
454
+ alpha: string;
455
+ beta: string;
456
+ };
457
+ }, undefined, "mt-2 w-max max-w-full", TVConfig<{
458
+ variant: {
459
+ alpha: string;
460
+ beta: string;
461
+ };
462
+ }, {
463
+ variant: {
464
+ alpha: string;
465
+ beta: string;
466
+ };
467
+ }>, {
468
+ variant: {
469
+ alpha: string;
470
+ beta: string;
471
+ };
472
+ }, undefined, TVReturnType<{
473
+ variant: {
474
+ alpha: string;
475
+ beta: string;
476
+ };
477
+ }, undefined, "mt-2 w-max max-w-full", TVConfig<{
478
+ variant: {
479
+ alpha: string;
480
+ beta: string;
481
+ };
482
+ }, {
483
+ variant: {
484
+ alpha: string;
485
+ beta: string;
486
+ };
487
+ }>, unknown, unknown, undefined>>;