@twintag/twintag-form 1.0.3 → 1.1.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.
Files changed (68) hide show
  1. package/.turbo/turbo-build.log +14 -14
  2. package/CHANGELOG.md +12 -0
  3. package/README.md +57 -0
  4. package/dev/index.css +32 -30
  5. package/dev/main.tsx +50 -27
  6. package/dist/common/accordion.d.ts +7 -0
  7. package/dist/common/button.d.ts +28 -0
  8. package/dist/common/calendar.d.ts +9 -0
  9. package/dist/common/form.d.ts +1 -1
  10. package/dist/common/icon.d.ts +7 -0
  11. package/dist/common/popover.d.ts +6 -0
  12. package/dist/common/scroll-area.d.ts +5 -0
  13. package/dist/common/select.d.ts +13 -0
  14. package/dist/components/config.d.ts +4 -0
  15. package/dist/components/containers/accordion.d.ts +8 -0
  16. package/dist/components/fields/date-picker.d.ts +3 -0
  17. package/dist/components/{Input/simple.d.ts → fields/input.d.ts} +1 -1
  18. package/dist/components/form.d.ts +3 -1
  19. package/dist/components/index.d.ts +1 -2
  20. package/dist/index.d.ts +2 -0
  21. package/dist/twintag-form.react.js +19843 -6458
  22. package/dist/twintag-form.webcomponent.js +314 -299
  23. package/dist/types/index.d.ts +6 -5
  24. package/dist/utils/data.d.ts +2 -0
  25. package/dist/utils/string.d.ts +3 -0
  26. package/dist/utils/style.d.ts +2 -0
  27. package/index.html +15 -13
  28. package/lib/common/accordion.tsx +77 -0
  29. package/lib/common/button.tsx +3 -0
  30. package/lib/common/calendar.tsx +110 -0
  31. package/lib/common/form.tsx +14 -1
  32. package/lib/common/icon.tsx +35 -0
  33. package/lib/common/input.tsx +2 -1
  34. package/lib/common/popover.tsx +30 -0
  35. package/lib/common/scroll-area.tsx +46 -0
  36. package/lib/common/select.tsx +159 -0
  37. package/lib/common/textarea.tsx +1 -1
  38. package/lib/components/Render/index.tsx +4 -2
  39. package/lib/components/config.tsx +44 -0
  40. package/lib/components/containers/accordion.tsx +105 -0
  41. package/lib/components/containers/category.tsx +48 -0
  42. package/lib/components/fields/date-picker.tsx +114 -0
  43. package/lib/components/{Input → fields}/file.tsx +1 -1
  44. package/lib/components/{Input/simple.tsx → fields/input.tsx} +5 -5
  45. package/lib/components/{Input → fields}/textarea.tsx +2 -2
  46. package/lib/components/form.tsx +19 -3
  47. package/lib/components/index.tsx +0 -3
  48. package/lib/index.tsx +7 -8
  49. package/lib/types/index.ts +13 -11
  50. package/lib/utils/data.ts +18 -0
  51. package/lib/utils/string.ts +12 -0
  52. package/lib/utils/style.ts +8 -0
  53. package/package.json +11 -3
  54. package/tailwind.config.ts +19 -1
  55. package/dist/components/Input/index.d.ts +0 -8
  56. package/lib/components/Input/index.tsx +0 -32
  57. package/lib/components/category.tsx +0 -31
  58. /package/dist/components/{category.d.ts → containers/category.d.ts} +0 -0
  59. /package/dist/components/{Input → fields}/checkbox.d.ts +0 -0
  60. /package/dist/components/{Input → fields}/file.d.ts +0 -0
  61. /package/dist/components/{Input → fields}/radiogroup.d.ts +0 -0
  62. /package/dist/components/{Input → fields}/submit.d.ts +0 -0
  63. /package/dist/components/{Input → fields}/textarea.d.ts +0 -0
  64. /package/dist/components/{Input → fields}/toggle.d.ts +0 -0
  65. /package/lib/components/{Input → fields}/checkbox.tsx +0 -0
  66. /package/lib/components/{Input → fields}/radiogroup.tsx +0 -0
  67. /package/lib/components/{Input → fields}/submit.tsx +0 -0
  68. /package/lib/components/{Input → fields}/toggle.tsx +0 -0
@@ -1,21 +1,21 @@
1
1
 
2
- > @twintag/twintag-form@1.0.3 build /home/runner/work/twintag-admin/twintag-admin/packages/twintag-form
2
+ > @twintag/twintag-form@1.1.1 build C:\Users\daryl\Desktop\twintag-projects\twintag-admin\packages\twintag-form
3
3
  > tsc && vite build
4
4
 
5
5
  vite v4.4.9 building for production...
6
6
  transforming...
7
- ✓ 1358 modules transformed.
7
+ ✓ 2526 modules transformed.
8
8
  rendering chunks...
9
- 
10
- [vite:dts] Start generate declaration files...
9
+
10
+ [vite:dts] Start generate declaration files...
11
11
  computing gzip size...
12
- dist/twintag-form.webcomponent.js 119.25 kB │ gzip: 33.41 kB
13
- dist/twintag-form.react.js 247.12 kB │ gzip: 56.97 kB
14
- [vite:dts] Outside emitted: /home/runner/work/twintag-admin/twintag-admin/packages/twintag-form/tailwind.config.d.ts
15
- [vite:dts] Outside emitted: /home/runner/work/twintag-admin/twintag-admin/packages/twintag-form/.eslintrc.d.cts
16
- [vite:dts] Outside emitted: /home/runner/work/twintag-admin/twintag-admin/packages/twintag-form/prettier.config.d.mts
17
- [vite:dts] Outside emitted: /home/runner/work/twintag-admin/twintag-admin/packages/twintag-form/dev/main.d.ts
18
- [vite:dts] Outside emitted: /home/runner/work/twintag-admin/twintag-admin/packages/twintag-form/vite.config.d.ts
19
- [vite:dts] Declaration files built in 6505ms.
20
- 
21
- ✓ built in 11.13s
12
+ [vite:dts] Outside emitted: C:/Users/daryl/Desktop/twintag-projects/twintag-admin/packages/twintag-form/tailwind.config.d.ts
13
+ [vite:dts] Outside emitted: C:/Users/daryl/Desktop/twintag-projects/twintag-admin/packages/twintag-form/.eslintrc.d.cts
14
+ [vite:dts] Outside emitted: C:/Users/daryl/Desktop/twintag-projects/twintag-admin/packages/twintag-form/prettier.config.d.mts
15
+ [vite:dts] Outside emitted: C:/Users/daryl/Desktop/twintag-projects/twintag-admin/packages/twintag-form/dev/main.d.ts
16
+ [vite:dts] Outside emitted: C:/Users/daryl/Desktop/twintag-projects/twintag-admin/packages/twintag-form/vite.config.d.ts
17
+ [vite:dts] Declaration files built in 4729ms.
18
+
19
+ dist/twintag-form.webcomponent.js 119.72 kB │ gzip: 33.42 kB
20
+ dist/twintag-form.react.js 687.57 kB │ gzip: 139.88 kB
21
+ ✓ built in 10.13s
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @twintag/twintag-form
2
2
 
3
+ ## 1.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - fix: (date-picker) remove harcoded value
8
+
9
+ ## 1.1.0
10
+
11
+ ### Minor Changes
12
+
13
+ - feat: `datepicker`, `accordion` and `defaultValues`
14
+
3
15
  ## 1.0.3
4
16
 
5
17
  ### Patch Changes
package/README.md CHANGED
@@ -74,6 +74,7 @@ Twintag Form provides some options to customize the form:
74
74
  | --------------- | -------------- | ------------------------------------------------------------------------- |
75
75
  | `variant` | `default/beta` | Variant of the form. |
76
76
  | `resetOnSubmit` | `boolean` | If `true`, the form will be reset after submitting. (`false` per default) |
77
+ | `defaultValues` | `object` | The properties are the same as the bind values in your config. |
77
78
 
78
79
  ### **Inputs**
79
80
 
@@ -189,6 +190,60 @@ Each input can be customized with the following optional options:
189
190
  }
190
191
  ```
191
192
 
193
+ - Date picker
194
+
195
+ ```json
196
+ {
197
+ "type": "input",
198
+ "subtype": "datepicker",
199
+ "label": "Pick a date"
200
+ }
201
+ ```
202
+
203
+ ## **Containers**
204
+
205
+ - Accordion
206
+
207
+ ```json
208
+ {
209
+ "type": "accordion",
210
+ "children": [
211
+ {
212
+ "type": "accordion",
213
+ "subtype": "item",
214
+ "label": "Your label",
215
+ "icon": "archive-box-x-mark",
216
+ "children": [
217
+ {
218
+ "type": "input",
219
+ "subtype": "simple",
220
+ "bind": "first-item"
221
+ },
222
+ ...
223
+ ]
224
+ },
225
+ ...
226
+ ]
227
+ }
228
+ ```
229
+
230
+ - Category
231
+
232
+ ```json
233
+ {
234
+ "type": "category",
235
+ "label": "Category",
236
+ "children": [
237
+ {
238
+ "type": "input",
239
+ "subtype": "simple",
240
+ "label": "Your label"
241
+ },
242
+ ...
243
+ ]
244
+ }
245
+ ```
246
+
192
247
  ## **Event Handling**
193
248
 
194
249
  ```html
@@ -230,7 +285,9 @@ The form component exposes the following CSS variables:
230
285
  | ----------------------- | ----------------------------------------------------------------------------------------- |
231
286
  | --tf-label | Color used for the inputs `label`. |
232
287
  | --tf-category | Color used for the `category` labels. |
288
+ | | |
233
289
  | --tf-background | Background color for the input fields. |
290
+ | --tf-foreground | Text color for the input fields. |
234
291
  | | |
235
292
  | --tf-muted | Used for `switch` background when value is false. |
236
293
  | --tf-muted-foreground | Color used for `placeholder` text (inputs) and description text. |
package/dev/index.css CHANGED
@@ -1,30 +1,32 @@
1
- @import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');
2
-
3
- @tailwind base;
4
- @tailwind components;
5
- @tailwind utilities;
6
-
7
- :root {
8
- --tf-label: 222.2 47.4% 11.2%;
9
- --tf-category: 222.2 47.4% 11.2%;
10
- --tf-background: 0 0% 100%;
11
-
12
- --tf-muted: 210 40% 96.1%;
13
- --tf-muted-foreground: 215.4 16.3% 46.9%;
14
-
15
- --tf-primary: 210 40% 98%;
16
- --tf-primary-foreground: 222.2 47.4% 11.2%;
17
-
18
- --tf-accent: 222.2 47.4% 11.2%;
19
- --tf-accent-foreground: 210 40% 96.1%;
20
-
21
- --tf-destructive: 0 100% 50%;
22
- --tf-destructive-foreground: 210 40% 98%;
23
-
24
- --tf-input: 214.3 31.8% 91.4%;
25
- --tf-ring: 215 20.2% 65.1%;
26
-
27
- --tf-radius: 0.5rem;
28
-
29
- --tf-font: 'Roboto', sans-serif;
30
- }
1
+ @import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');
2
+
3
+ @tailwind base;
4
+ @tailwind components;
5
+ @tailwind utilities;
6
+
7
+ :root {
8
+ --tf-label: 222.2 47.4% 11.2%;
9
+ --tf-category: 222.2 47.4% 11.2%;
10
+
11
+ --tf-background: 0 0% 100%;
12
+ --tf-foreground: 0 0% 0%;
13
+
14
+ --tf-muted: 210 40% 96.1%;
15
+ --tf-muted-foreground: 215.4 16.3% 46.9%;
16
+
17
+ --tf-primary: 210 40% 98%;
18
+ --tf-primary-foreground: 222.2 47.4% 11.2%;
19
+
20
+ --tf-accent: 222.2 47.4% 11.2%;
21
+ --tf-accent-foreground: 210 40% 96.1%;
22
+
23
+ --tf-destructive: 0 100% 50%;
24
+ --tf-destructive-foreground: 210 40% 98%;
25
+
26
+ --tf-input: 214.3 31.8% 91.4%;
27
+ --tf-ring: 215 20.2% 65.1%;
28
+
29
+ --tf-radius: 0.5rem;
30
+
31
+ --tf-font: 'Roboto', sans-serif;
32
+ }
package/dev/main.tsx CHANGED
@@ -1,10 +1,7 @@
1
- import React from 'react';
2
- import install from '@twind/with-react';
3
- import ReactDOM from 'react-dom/client';
4
-
5
- import { Form } from '../lib';
6
- import tw from '../twind.config';
1
+ import type { ComponentProps } from 'react';
2
+ import type { Form } from '../lib';
7
3
 
4
+ import '../lib/webcomponent';
8
5
  import './index.css';
9
6
 
10
7
  const config = [
@@ -17,14 +14,40 @@ const config = [
17
14
  {
18
15
  type: 'input',
19
16
  props: {
20
- subtype: 'toggle',
21
- label: 'Required',
22
- bind: 'required',
17
+ subtype: 'datepicker',
18
+ label: 'Date picker',
19
+ bind: 'datepicker',
23
20
  options: {
24
- description: 'This field is required',
21
+ description: 'this field is required',
25
22
  },
26
23
  },
27
24
  },
25
+ {
26
+ type: 'accordion',
27
+ children: [
28
+ {
29
+ type: 'accordion',
30
+ props: {
31
+ subtype: 'item',
32
+ label: 'Required',
33
+ icon: 'archive-box-x-mark',
34
+ },
35
+ children: [
36
+ {
37
+ type: 'input',
38
+ props: {
39
+ subtype: 'toggle',
40
+ label: 'Required',
41
+ bind: 'required',
42
+ options: {
43
+ description: 'this field is required',
44
+ },
45
+ },
46
+ },
47
+ ],
48
+ },
49
+ ],
50
+ },
28
51
  ],
29
52
  },
30
53
  {
@@ -40,6 +63,7 @@ const config = [
40
63
  label: 'Email',
41
64
  bind: 'email',
42
65
  options: {
66
+ error: 'This field is required',
43
67
  description: 'This field is required',
44
68
  },
45
69
  },
@@ -95,6 +119,7 @@ const config = [
95
119
  label: 'File',
96
120
  bind: 'file',
97
121
  options: {
122
+ error: 'This field is required',
98
123
  description: 'This field is required',
99
124
  },
100
125
  },
@@ -134,30 +159,28 @@ const config = [
134
159
  ],
135
160
  },
136
161
  {
137
- type: 'input:submit',
162
+ type: 'input',
138
163
  props: {
164
+ subtype: 'submit',
139
165
  label: 'Submit',
140
166
  },
141
167
  },
142
168
  ] satisfies React.ComponentProps<typeof Form>['config'];
143
169
 
144
170
  const options = {
145
- variant: 'beta',
171
+ defaultValues: {
172
+ required: 'true',
173
+ email: 'This should work',
174
+ radiogroup: 'mote',
175
+ checkbox: true,
176
+ textarea: 'This is a textarea',
177
+ },
146
178
  resetOnSubmit: true,
147
- } as const;
148
-
149
- const App = () => {
150
- return (
151
- <div className='mx-auto max-w-lg bg-background p-8'>
152
- <Form config={config} options={options} />
153
- </div>
154
- );
155
- };
179
+ variant: 'beta',
180
+ } as ComponentProps<typeof Form>['options'];
156
181
 
157
- install(tw);
182
+ // the key properties for the defaultValues object are the same as the bind properties
183
+ const form = document.querySelector('twintag-form');
158
184
 
159
- ReactDOM.createRoot(document.getElementById('root')!).render(
160
- <React.StrictMode>
161
- <App />
162
- </React.StrictMode>,
163
- );
185
+ form?.setAttribute('config', JSON.stringify(config));
186
+ form?.setAttribute('options', JSON.stringify(options));
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ import * as AccordionPrimitive from '@radix-ui/react-accordion';
3
+ declare const Accordion: React.ForwardRefExoticComponent<(AccordionPrimitive.AccordionSingleProps | AccordionPrimitive.AccordionMultipleProps) & React.RefAttributes<HTMLDivElement>>;
4
+ declare const AccordionItem: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
5
+ declare const AccordionTrigger: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
6
+ declare const AccordionContent: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
7
+ export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
@@ -4,6 +4,8 @@ import * as React from 'react';
4
4
  declare const buttonVariants: TVReturnType<{
5
5
  variant: {
6
6
  default: string;
7
+ outline: string;
8
+ ghost: string;
7
9
  };
8
10
  size: {
9
11
  default: string;
@@ -13,6 +15,8 @@ declare const buttonVariants: TVReturnType<{
13
15
  }, undefined, string[], TVConfig<{
14
16
  variant: {
15
17
  default: string;
18
+ outline: string;
19
+ ghost: string;
16
20
  };
17
21
  size: {
18
22
  default: string;
@@ -22,6 +26,8 @@ declare const buttonVariants: TVReturnType<{
22
26
  }, {
23
27
  variant: {
24
28
  default: string;
29
+ outline: string;
30
+ ghost: string;
25
31
  };
26
32
  size: {
27
33
  default: string;
@@ -31,6 +37,8 @@ declare const buttonVariants: TVReturnType<{
31
37
  }>, {
32
38
  variant: {
33
39
  default: string;
40
+ outline: string;
41
+ ghost: string;
34
42
  };
35
43
  size: {
36
44
  default: string;
@@ -40,6 +48,8 @@ declare const buttonVariants: TVReturnType<{
40
48
  }, undefined, TVReturnType<{
41
49
  variant: {
42
50
  default: string;
51
+ outline: string;
52
+ ghost: string;
43
53
  };
44
54
  size: {
45
55
  default: string;
@@ -49,6 +59,8 @@ declare const buttonVariants: TVReturnType<{
49
59
  }, undefined, string[], TVConfig<{
50
60
  variant: {
51
61
  default: string;
62
+ outline: string;
63
+ ghost: string;
52
64
  };
53
65
  size: {
54
66
  default: string;
@@ -58,6 +70,8 @@ declare const buttonVariants: TVReturnType<{
58
70
  }, {
59
71
  variant: {
60
72
  default: string;
73
+ outline: string;
74
+ ghost: string;
61
75
  };
62
76
  size: {
63
77
  default: string;
@@ -71,6 +85,8 @@ export type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & Varian
71
85
  declare const Button: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<TVReturnType<{
72
86
  variant: {
73
87
  default: string;
88
+ outline: string;
89
+ ghost: string;
74
90
  };
75
91
  size: {
76
92
  default: string;
@@ -80,6 +96,8 @@ declare const Button: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes
80
96
  }, undefined, string[], TVConfig<{
81
97
  variant: {
82
98
  default: string;
99
+ outline: string;
100
+ ghost: string;
83
101
  };
84
102
  size: {
85
103
  default: string;
@@ -89,6 +107,8 @@ declare const Button: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes
89
107
  }, {
90
108
  variant: {
91
109
  default: string;
110
+ outline: string;
111
+ ghost: string;
92
112
  };
93
113
  size: {
94
114
  default: string;
@@ -98,6 +118,8 @@ declare const Button: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes
98
118
  }>, {
99
119
  variant: {
100
120
  default: string;
121
+ outline: string;
122
+ ghost: string;
101
123
  };
102
124
  size: {
103
125
  default: string;
@@ -107,6 +129,8 @@ declare const Button: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes
107
129
  }, undefined, TVReturnType<{
108
130
  variant: {
109
131
  default: string;
132
+ outline: string;
133
+ ghost: string;
110
134
  };
111
135
  size: {
112
136
  default: string;
@@ -116,6 +140,8 @@ declare const Button: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes
116
140
  }, undefined, string[], TVConfig<{
117
141
  variant: {
118
142
  default: string;
143
+ outline: string;
144
+ ghost: string;
119
145
  };
120
146
  size: {
121
147
  default: string;
@@ -125,6 +151,8 @@ declare const Button: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes
125
151
  }, {
126
152
  variant: {
127
153
  default: string;
154
+ outline: string;
155
+ ghost: string;
128
156
  };
129
157
  size: {
130
158
  default: string;
@@ -0,0 +1,9 @@
1
+ import { JSX } from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import { DayPicker } from 'react-day-picker';
4
+ export type CalendarProps = React.ComponentProps<typeof DayPicker>;
5
+ declare function Calendar({ className, classNames, showOutsideDays, ...props }: CalendarProps): JSX.Element;
6
+ declare namespace Calendar {
7
+ var displayName: string;
8
+ }
9
+ export { Calendar };
@@ -3,7 +3,7 @@ import { JSX } from 'react/jsx-runtime';
3
3
  import type * as LabelPrimitive from '@radix-ui/react-label';
4
4
  import { FormProviderProps, FieldError, ControllerProps, FieldPath, FieldValues } from 'react-hook-form';
5
5
  import * as React from 'react';
6
- declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues extends FieldValues | undefined = undefined>(props: FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
6
+ declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues extends FieldValues = TFieldValues>(props: FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
7
7
  declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => JSX.Element;
8
8
  declare const useFormField: () => {
9
9
  invalid: boolean;
@@ -0,0 +1,7 @@
1
+ import type { FC } from 'react';
2
+ type Props = {
3
+ name: string;
4
+ className?: string;
5
+ };
6
+ export declare const Icon: FC<Props>;
7
+ export {};
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ import * as PopoverPrimitive from '@radix-ui/react-popover';
3
+ declare const Popover: React.FC<PopoverPrimitive.PopoverProps>;
4
+ declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
+ declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
6
+ export { Popover, PopoverTrigger, PopoverContent };
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
3
+ declare const ScrollArea: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
4
+ declare const ScrollBar: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaScrollbarProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
5
+ export { ScrollArea, ScrollBar };
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ import * as SelectPrimitive from '@radix-ui/react-select';
3
+ declare const Select: React.FC<SelectPrimitive.SelectProps>;
4
+ declare const SelectGroup: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
5
+ declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
6
+ declare const SelectTrigger: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
7
+ declare const SelectScrollUpButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
8
+ declare const SelectScrollDownButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
9
+ declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
10
+ declare const SelectLabel: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
11
+ declare const SelectItem: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
12
+ declare const SelectSeparator: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
13
+ export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton, };
@@ -0,0 +1,4 @@
1
+ import type { ElementType } from 'react';
2
+ export declare const Inputs: Map<string, ElementType>;
3
+ export declare const Containers: Map<string, ElementType>;
4
+ export declare const components: Map<string, ElementType>;
@@ -0,0 +1,8 @@
1
+ import type { WithChildren } from 'twintag-types/dom';
2
+ import { type FC } from 'react';
3
+ type AccordionProps = {
4
+ subtype?: 'item' | 'multiple' | 'single';
5
+ label?: string;
6
+ } & WithChildren;
7
+ declare const Accordion: FC<AccordionProps>;
8
+ export { Accordion };
@@ -0,0 +1,3 @@
1
+ import type { Props } from '../../types';
2
+ import * as React from 'react';
3
+ export declare const DatePicker: React.FC<Props>;
@@ -1,3 +1,3 @@
1
1
  import type { FC } from 'react';
2
2
  import type { Props } from '../../types';
3
- export declare const Simple: FC<Props>;
3
+ export declare const Input: FC<Props>;
@@ -1,7 +1,9 @@
1
1
  import { JSX } from 'react/jsx-runtime';
2
+ import type { FieldValues } from 'react-hook-form';
2
3
  import type { WithChildren } from 'twintag-types/dom';
3
4
  type Props = {
5
+ defaultValues?: FieldValues;
4
6
  resetOnSubmit?: boolean;
5
7
  } & WithChildren;
6
- export declare const TwintagForm: ({ resetOnSubmit, children }: Props) => JSX.Element;
8
+ export declare const TwintagForm: ({ defaultValues, resetOnSubmit, children, }: Props) => JSX.Element;
7
9
  export {};
@@ -1,8 +1,7 @@
1
1
  import { JSX } from 'react/jsx-runtime';
2
2
  import type { RawJsonComponent } from '../types';
3
- export { Input } from './Input';
4
- export { Category } from './category';
5
3
  type Props = {
6
4
  config: RawJsonComponent | RawJsonComponent[];
7
5
  };
8
6
  export declare const TwintagJsonRenderer: ({ config }: Props) => JSX.Element;
7
+ export {};
package/dist/index.d.ts CHANGED
@@ -1,10 +1,12 @@
1
1
  import { JSX } from 'react/jsx-runtime';
2
2
  import type { ComponentProps } from 'react';
3
3
  import type { RawJsonComponent } from './types';
4
+ import { TwintagForm } from './components/form';
4
5
  import { TwintagFormProvider } from './provider';
5
6
  type Props = {
6
7
  config: RawJsonComponent[];
7
8
  options?: Partial<{
9
+ defaultValues?: ComponentProps<typeof TwintagForm>['defaultValues'];
8
10
  variant?: ComponentProps<typeof TwintagFormProvider>['variant'];
9
11
  resetOnSubmit?: boolean;
10
12
  }>;