@shipfox/react-ui 0.6.0 → 0.8.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.
- package/.storybook/main.ts +12 -5
- package/.turbo/turbo-build.log +5 -5
- package/.turbo/turbo-check.log +2 -2
- package/.turbo/turbo-type.log +1 -1
- package/CHANGELOG.md +13 -0
- package/dist/components/button/button.d.ts +2 -1
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/button.js +17 -2
- package/dist/components/button/button.js.map +1 -1
- package/dist/components/button/button.stories.js +25 -0
- package/dist/components/button/button.stories.js.map +1 -1
- package/dist/components/button/icon-button.d.ts +2 -1
- package/dist/components/button/icon-button.d.ts.map +1 -1
- package/dist/components/button/icon-button.js +17 -2
- package/dist/components/button/icon-button.js.map +1 -1
- package/dist/components/button/icon-button.stories.js +90 -0
- package/dist/components/button/icon-button.stories.js.map +1 -1
- package/dist/components/dot-grid/dot-grid.d.ts +18 -0
- package/dist/components/dot-grid/dot-grid.d.ts.map +1 -0
- package/dist/components/dot-grid/dot-grid.js +295 -0
- package/dist/components/dot-grid/dot-grid.js.map +1 -0
- package/dist/components/dot-grid/index.d.ts +2 -0
- package/dist/components/dot-grid/index.d.ts.map +1 -0
- package/dist/components/dot-grid/index.js +3 -0
- package/dist/components/dot-grid/index.js.map +1 -0
- package/dist/components/form/form.d.ts +11 -0
- package/dist/components/form/form.d.ts.map +1 -0
- package/dist/components/form/form.js +106 -0
- package/dist/components/form/form.js.map +1 -0
- package/dist/components/form/form.stories.js +582 -0
- package/dist/components/form/form.stories.js.map +1 -0
- package/dist/components/form/index.d.ts +2 -0
- package/dist/components/form/index.d.ts.map +1 -0
- package/dist/components/form/index.js +3 -0
- package/dist/components/form/index.js.map +1 -0
- package/dist/components/icon/custom/spinner.d.ts +1 -1
- package/dist/components/icon/custom/spinner.d.ts.map +1 -1
- package/dist/components/icon/custom/spinner.js +84 -30
- package/dist/components/icon/custom/spinner.js.map +1 -1
- package/dist/components/icon/icon.d.ts +19 -18
- package/dist/components/icon/icon.d.ts.map +1 -1
- package/dist/components/icon/icon.js +17 -17
- package/dist/components/icon/icon.js.map +1 -1
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +3 -0
- package/dist/components/index.js.map +1 -1
- package/dist/onboarding/sign-in.stories.js +16 -8
- package/dist/onboarding/sign-in.stories.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +13 -10
- package/src/components/button/button.stories.tsx +18 -0
- package/src/components/button/button.tsx +27 -2
- package/src/components/button/icon-button.stories.tsx +46 -0
- package/src/components/button/icon-button.tsx +26 -1
- package/src/components/dot-grid/dot-grid.tsx +325 -0
- package/src/components/dot-grid/index.ts +1 -0
- package/src/components/form/form.stories.tsx +500 -0
- package/src/components/form/form.tsx +154 -0
- package/src/components/form/index.ts +1 -0
- package/src/components/icon/custom/spinner.tsx +64 -18
- package/src/components/icon/icon.tsx +18 -18
- package/src/components/index.ts +3 -0
- package/src/onboarding/sign-in.stories.tsx +20 -8
|
@@ -0,0 +1,582 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { zodResolver } from '@hookform/resolvers/zod';
|
|
3
|
+
import { Button } from '../../components/button/index.js';
|
|
4
|
+
import { Checkbox, CheckboxLabel, CheckboxLinks } from '../../components/checkbox/index.js';
|
|
5
|
+
import { Input } from '../../components/input/index.js';
|
|
6
|
+
import { Textarea } from '../../components/textarea/index.js';
|
|
7
|
+
import { Code, Header } from '../../components/typography/index.js';
|
|
8
|
+
import { useForm } from 'react-hook-form';
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
import { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage } from './form.js';
|
|
11
|
+
const meta = {
|
|
12
|
+
title: 'Components/Form',
|
|
13
|
+
tags: [
|
|
14
|
+
'autodocs'
|
|
15
|
+
]
|
|
16
|
+
};
|
|
17
|
+
export default meta;
|
|
18
|
+
const basicFormSchema = z.object({
|
|
19
|
+
username: z.string().min(3, 'Username must be at least 3 characters'),
|
|
20
|
+
email: z.string().email('Invalid email address')
|
|
21
|
+
});
|
|
22
|
+
function BasicFormExample() {
|
|
23
|
+
const form = useForm({
|
|
24
|
+
resolver: zodResolver(basicFormSchema),
|
|
25
|
+
defaultValues: {
|
|
26
|
+
username: '',
|
|
27
|
+
email: ''
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
function onSubmit(data) {
|
|
31
|
+
// biome-ignore lint/suspicious/noConsole: <we need to log the data for the story>
|
|
32
|
+
console.log(data);
|
|
33
|
+
}
|
|
34
|
+
return /*#__PURE__*/ _jsx(Form, {
|
|
35
|
+
...form,
|
|
36
|
+
children: /*#__PURE__*/ _jsxs("form", {
|
|
37
|
+
onSubmit: form.handleSubmit(onSubmit),
|
|
38
|
+
className: "space-y-8 w-full max-w-md",
|
|
39
|
+
children: [
|
|
40
|
+
/*#__PURE__*/ _jsx(FormField, {
|
|
41
|
+
control: form.control,
|
|
42
|
+
name: "username",
|
|
43
|
+
render: ({ field })=>/*#__PURE__*/ _jsxs(FormItem, {
|
|
44
|
+
children: [
|
|
45
|
+
/*#__PURE__*/ _jsx(FormLabel, {
|
|
46
|
+
children: "Username"
|
|
47
|
+
}),
|
|
48
|
+
/*#__PURE__*/ _jsx(FormControl, {
|
|
49
|
+
children: /*#__PURE__*/ _jsx(Input, {
|
|
50
|
+
placeholder: "shadcn",
|
|
51
|
+
...field
|
|
52
|
+
})
|
|
53
|
+
}),
|
|
54
|
+
/*#__PURE__*/ _jsx(FormDescription, {
|
|
55
|
+
children: "This is your public display name."
|
|
56
|
+
}),
|
|
57
|
+
/*#__PURE__*/ _jsx(FormMessage, {})
|
|
58
|
+
]
|
|
59
|
+
})
|
|
60
|
+
}),
|
|
61
|
+
/*#__PURE__*/ _jsx(FormField, {
|
|
62
|
+
control: form.control,
|
|
63
|
+
name: "email",
|
|
64
|
+
render: ({ field })=>/*#__PURE__*/ _jsxs(FormItem, {
|
|
65
|
+
children: [
|
|
66
|
+
/*#__PURE__*/ _jsx(FormLabel, {
|
|
67
|
+
children: "Email"
|
|
68
|
+
}),
|
|
69
|
+
/*#__PURE__*/ _jsx(FormControl, {
|
|
70
|
+
children: /*#__PURE__*/ _jsx(Input, {
|
|
71
|
+
type: "email",
|
|
72
|
+
placeholder: "email@example.com",
|
|
73
|
+
...field
|
|
74
|
+
})
|
|
75
|
+
}),
|
|
76
|
+
/*#__PURE__*/ _jsx(FormDescription, {
|
|
77
|
+
children: "We'll never share your email."
|
|
78
|
+
}),
|
|
79
|
+
/*#__PURE__*/ _jsx(FormMessage, {})
|
|
80
|
+
]
|
|
81
|
+
})
|
|
82
|
+
}),
|
|
83
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
84
|
+
type: "submit",
|
|
85
|
+
children: "Submit"
|
|
86
|
+
})
|
|
87
|
+
]
|
|
88
|
+
})
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
export const Basic = {
|
|
92
|
+
render: ()=>/*#__PURE__*/ _jsx(BasicFormExample, {})
|
|
93
|
+
};
|
|
94
|
+
const componentsFormSchema = z.object({
|
|
95
|
+
example: z.string().min(1, 'This field is required'),
|
|
96
|
+
exampleTextarea: z.string().min(1, 'This field is required')
|
|
97
|
+
});
|
|
98
|
+
function FormComponentsExample() {
|
|
99
|
+
const form = useForm({
|
|
100
|
+
resolver: zodResolver(componentsFormSchema),
|
|
101
|
+
defaultValues: {
|
|
102
|
+
example: '',
|
|
103
|
+
exampleTextarea: ''
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
return /*#__PURE__*/ _jsx(Form, {
|
|
107
|
+
...form,
|
|
108
|
+
children: /*#__PURE__*/ _jsxs("div", {
|
|
109
|
+
className: "flex flex-col gap-32 w-full max-w-md",
|
|
110
|
+
children: [
|
|
111
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
112
|
+
className: "flex flex-col gap-16",
|
|
113
|
+
children: [
|
|
114
|
+
/*#__PURE__*/ _jsx(Header, {
|
|
115
|
+
variant: "h3",
|
|
116
|
+
children: "Form Components"
|
|
117
|
+
}),
|
|
118
|
+
/*#__PURE__*/ _jsx(Code, {
|
|
119
|
+
variant: "label",
|
|
120
|
+
className: "text-foreground-neutral-subtle",
|
|
121
|
+
children: "Individual form components work together within FormField"
|
|
122
|
+
})
|
|
123
|
+
]
|
|
124
|
+
}),
|
|
125
|
+
/*#__PURE__*/ _jsxs("form", {
|
|
126
|
+
className: "space-y-8",
|
|
127
|
+
children: [
|
|
128
|
+
/*#__PURE__*/ _jsx(FormField, {
|
|
129
|
+
control: form.control,
|
|
130
|
+
name: "example",
|
|
131
|
+
render: ({ field })=>/*#__PURE__*/ _jsxs(FormItem, {
|
|
132
|
+
children: [
|
|
133
|
+
/*#__PURE__*/ _jsx(FormLabel, {
|
|
134
|
+
children: "Form Label"
|
|
135
|
+
}),
|
|
136
|
+
/*#__PURE__*/ _jsx(FormControl, {
|
|
137
|
+
children: /*#__PURE__*/ _jsx(Input, {
|
|
138
|
+
placeholder: "Form Control with Input",
|
|
139
|
+
...field
|
|
140
|
+
})
|
|
141
|
+
}),
|
|
142
|
+
/*#__PURE__*/ _jsx(FormDescription, {
|
|
143
|
+
children: "This is a form description."
|
|
144
|
+
}),
|
|
145
|
+
/*#__PURE__*/ _jsx(FormMessage, {})
|
|
146
|
+
]
|
|
147
|
+
})
|
|
148
|
+
}),
|
|
149
|
+
/*#__PURE__*/ _jsx(FormField, {
|
|
150
|
+
control: form.control,
|
|
151
|
+
name: "exampleTextarea",
|
|
152
|
+
render: ({ field })=>/*#__PURE__*/ _jsxs(FormItem, {
|
|
153
|
+
children: [
|
|
154
|
+
/*#__PURE__*/ _jsx(FormLabel, {
|
|
155
|
+
children: "Form Label"
|
|
156
|
+
}),
|
|
157
|
+
/*#__PURE__*/ _jsx(FormControl, {
|
|
158
|
+
children: /*#__PURE__*/ _jsx(Textarea, {
|
|
159
|
+
placeholder: "Form Control with Textarea",
|
|
160
|
+
...field
|
|
161
|
+
})
|
|
162
|
+
}),
|
|
163
|
+
/*#__PURE__*/ _jsx(FormDescription, {
|
|
164
|
+
children: "This is a form description."
|
|
165
|
+
}),
|
|
166
|
+
/*#__PURE__*/ _jsx(FormMessage, {})
|
|
167
|
+
]
|
|
168
|
+
})
|
|
169
|
+
})
|
|
170
|
+
]
|
|
171
|
+
})
|
|
172
|
+
]
|
|
173
|
+
})
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
export const Components = {
|
|
177
|
+
render: ()=>/*#__PURE__*/ _jsx(FormComponentsExample, {})
|
|
178
|
+
};
|
|
179
|
+
const checkboxFormSchema = z.object({
|
|
180
|
+
username: z.string().min(3, 'Username must be at least 3 characters'),
|
|
181
|
+
email: z.string().email('Invalid email address'),
|
|
182
|
+
newsletter: z.boolean(),
|
|
183
|
+
notifications: z.boolean()
|
|
184
|
+
});
|
|
185
|
+
function FormWithCheckboxExample() {
|
|
186
|
+
const form = useForm({
|
|
187
|
+
resolver: zodResolver(checkboxFormSchema),
|
|
188
|
+
defaultValues: {
|
|
189
|
+
username: '',
|
|
190
|
+
email: '',
|
|
191
|
+
newsletter: false,
|
|
192
|
+
notifications: false
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
function onSubmit(data) {
|
|
196
|
+
// biome-ignore lint/suspicious/noConsole: <we need to log the data for the story>
|
|
197
|
+
console.log(data);
|
|
198
|
+
}
|
|
199
|
+
return /*#__PURE__*/ _jsx(Form, {
|
|
200
|
+
...form,
|
|
201
|
+
children: /*#__PURE__*/ _jsxs("form", {
|
|
202
|
+
onSubmit: form.handleSubmit(onSubmit),
|
|
203
|
+
className: "space-y-8 w-full max-w-md",
|
|
204
|
+
children: [
|
|
205
|
+
/*#__PURE__*/ _jsx(FormField, {
|
|
206
|
+
control: form.control,
|
|
207
|
+
name: "username",
|
|
208
|
+
render: ({ field })=>/*#__PURE__*/ _jsxs(FormItem, {
|
|
209
|
+
children: [
|
|
210
|
+
/*#__PURE__*/ _jsx(FormLabel, {
|
|
211
|
+
children: "Username"
|
|
212
|
+
}),
|
|
213
|
+
/*#__PURE__*/ _jsx(FormControl, {
|
|
214
|
+
children: /*#__PURE__*/ _jsx(Input, {
|
|
215
|
+
placeholder: "shadcn",
|
|
216
|
+
...field
|
|
217
|
+
})
|
|
218
|
+
}),
|
|
219
|
+
/*#__PURE__*/ _jsx(FormDescription, {
|
|
220
|
+
children: "This is your public display name."
|
|
221
|
+
}),
|
|
222
|
+
/*#__PURE__*/ _jsx(FormMessage, {})
|
|
223
|
+
]
|
|
224
|
+
})
|
|
225
|
+
}),
|
|
226
|
+
/*#__PURE__*/ _jsx(FormField, {
|
|
227
|
+
control: form.control,
|
|
228
|
+
name: "email",
|
|
229
|
+
render: ({ field })=>/*#__PURE__*/ _jsxs(FormItem, {
|
|
230
|
+
children: [
|
|
231
|
+
/*#__PURE__*/ _jsx(FormLabel, {
|
|
232
|
+
children: "Email"
|
|
233
|
+
}),
|
|
234
|
+
/*#__PURE__*/ _jsx(FormControl, {
|
|
235
|
+
children: /*#__PURE__*/ _jsx(Input, {
|
|
236
|
+
type: "email",
|
|
237
|
+
placeholder: "email@example.com",
|
|
238
|
+
...field
|
|
239
|
+
})
|
|
240
|
+
}),
|
|
241
|
+
/*#__PURE__*/ _jsx(FormDescription, {
|
|
242
|
+
children: "We'll never share your email."
|
|
243
|
+
}),
|
|
244
|
+
/*#__PURE__*/ _jsx(FormMessage, {})
|
|
245
|
+
]
|
|
246
|
+
})
|
|
247
|
+
}),
|
|
248
|
+
/*#__PURE__*/ _jsx(FormField, {
|
|
249
|
+
control: form.control,
|
|
250
|
+
name: "newsletter",
|
|
251
|
+
render: ({ field })=>/*#__PURE__*/ _jsxs(FormItem, {
|
|
252
|
+
className: "flex flex-row items-center gap-8 pt-4",
|
|
253
|
+
children: [
|
|
254
|
+
/*#__PURE__*/ _jsx(FormControl, {
|
|
255
|
+
children: /*#__PURE__*/ _jsx(Checkbox, {
|
|
256
|
+
checked: field.value,
|
|
257
|
+
onCheckedChange: field.onChange
|
|
258
|
+
})
|
|
259
|
+
}),
|
|
260
|
+
/*#__PURE__*/ _jsx(FormLabel, {
|
|
261
|
+
children: "Subscribe to newsletter"
|
|
262
|
+
})
|
|
263
|
+
]
|
|
264
|
+
})
|
|
265
|
+
}),
|
|
266
|
+
/*#__PURE__*/ _jsx(FormField, {
|
|
267
|
+
control: form.control,
|
|
268
|
+
name: "notifications",
|
|
269
|
+
render: ({ field })=>/*#__PURE__*/ _jsxs(FormItem, {
|
|
270
|
+
className: "flex flex-row items-center gap-8 pt-4 pb-8",
|
|
271
|
+
children: [
|
|
272
|
+
/*#__PURE__*/ _jsx(FormControl, {
|
|
273
|
+
children: /*#__PURE__*/ _jsx(Checkbox, {
|
|
274
|
+
checked: field.value,
|
|
275
|
+
onCheckedChange: field.onChange
|
|
276
|
+
})
|
|
277
|
+
}),
|
|
278
|
+
/*#__PURE__*/ _jsx(FormLabel, {
|
|
279
|
+
children: "Enable notifications"
|
|
280
|
+
})
|
|
281
|
+
]
|
|
282
|
+
})
|
|
283
|
+
}),
|
|
284
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
285
|
+
type: "submit",
|
|
286
|
+
children: "Submit"
|
|
287
|
+
})
|
|
288
|
+
]
|
|
289
|
+
})
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
export const WithCheckbox = {
|
|
293
|
+
render: ()=>/*#__PURE__*/ _jsx(FormWithCheckboxExample, {})
|
|
294
|
+
};
|
|
295
|
+
const checkboxLabelSchema = z.object({
|
|
296
|
+
username: z.string().min(1, 'Username is required'),
|
|
297
|
+
email: z.string().email('Invalid email address'),
|
|
298
|
+
terms: z.boolean().refine((val)=>val === true, {
|
|
299
|
+
message: 'You must accept the terms and conditions'
|
|
300
|
+
}),
|
|
301
|
+
marketing: z.boolean()
|
|
302
|
+
});
|
|
303
|
+
function FormWithCheckboxLabelExample() {
|
|
304
|
+
const form = useForm({
|
|
305
|
+
resolver: zodResolver(checkboxLabelSchema),
|
|
306
|
+
defaultValues: {
|
|
307
|
+
username: '',
|
|
308
|
+
email: '',
|
|
309
|
+
terms: false,
|
|
310
|
+
marketing: false
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
function onSubmit(data) {
|
|
314
|
+
// biome-ignore lint/suspicious/noConsole: <we need to log the data for the story>
|
|
315
|
+
console.log(data);
|
|
316
|
+
}
|
|
317
|
+
return /*#__PURE__*/ _jsx(Form, {
|
|
318
|
+
...form,
|
|
319
|
+
children: /*#__PURE__*/ _jsxs("form", {
|
|
320
|
+
onSubmit: form.handleSubmit(onSubmit),
|
|
321
|
+
className: "space-y-8 w-full max-w-md",
|
|
322
|
+
children: [
|
|
323
|
+
/*#__PURE__*/ _jsx(FormField, {
|
|
324
|
+
control: form.control,
|
|
325
|
+
name: "username",
|
|
326
|
+
render: ({ field })=>/*#__PURE__*/ _jsxs(FormItem, {
|
|
327
|
+
children: [
|
|
328
|
+
/*#__PURE__*/ _jsx(FormLabel, {
|
|
329
|
+
children: "Username"
|
|
330
|
+
}),
|
|
331
|
+
/*#__PURE__*/ _jsx(FormControl, {
|
|
332
|
+
children: /*#__PURE__*/ _jsx(Input, {
|
|
333
|
+
placeholder: "shadcn",
|
|
334
|
+
...field
|
|
335
|
+
})
|
|
336
|
+
}),
|
|
337
|
+
/*#__PURE__*/ _jsx(FormMessage, {})
|
|
338
|
+
]
|
|
339
|
+
})
|
|
340
|
+
}),
|
|
341
|
+
/*#__PURE__*/ _jsx(FormField, {
|
|
342
|
+
control: form.control,
|
|
343
|
+
name: "email",
|
|
344
|
+
render: ({ field })=>/*#__PURE__*/ _jsxs(FormItem, {
|
|
345
|
+
children: [
|
|
346
|
+
/*#__PURE__*/ _jsx(FormLabel, {
|
|
347
|
+
children: "Email"
|
|
348
|
+
}),
|
|
349
|
+
/*#__PURE__*/ _jsx(FormControl, {
|
|
350
|
+
children: /*#__PURE__*/ _jsx(Input, {
|
|
351
|
+
type: "email",
|
|
352
|
+
placeholder: "email@example.com",
|
|
353
|
+
...field
|
|
354
|
+
})
|
|
355
|
+
}),
|
|
356
|
+
/*#__PURE__*/ _jsx(FormMessage, {})
|
|
357
|
+
]
|
|
358
|
+
})
|
|
359
|
+
}),
|
|
360
|
+
/*#__PURE__*/ _jsx(FormField, {
|
|
361
|
+
control: form.control,
|
|
362
|
+
name: "terms",
|
|
363
|
+
render: ({ field })=>/*#__PURE__*/ _jsxs(FormItem, {
|
|
364
|
+
children: [
|
|
365
|
+
/*#__PURE__*/ _jsx(FormControl, {
|
|
366
|
+
children: /*#__PURE__*/ _jsx(CheckboxLabel, {
|
|
367
|
+
label: "I agree to the terms and conditions",
|
|
368
|
+
description: "By checking this box, you agree to our terms of service and privacy policy.",
|
|
369
|
+
checked: field.value,
|
|
370
|
+
onCheckedChange: field.onChange
|
|
371
|
+
})
|
|
372
|
+
}),
|
|
373
|
+
/*#__PURE__*/ _jsx(FormMessage, {})
|
|
374
|
+
]
|
|
375
|
+
})
|
|
376
|
+
}),
|
|
377
|
+
/*#__PURE__*/ _jsx(FormField, {
|
|
378
|
+
control: form.control,
|
|
379
|
+
name: "marketing",
|
|
380
|
+
render: ({ field })=>/*#__PURE__*/ _jsxs(FormItem, {
|
|
381
|
+
children: [
|
|
382
|
+
/*#__PURE__*/ _jsx(FormControl, {
|
|
383
|
+
children: /*#__PURE__*/ _jsx(CheckboxLabel, {
|
|
384
|
+
label: "I want to receive marketing emails",
|
|
385
|
+
description: "Stay updated with our latest products and offers.",
|
|
386
|
+
optional: true,
|
|
387
|
+
checked: field.value,
|
|
388
|
+
onCheckedChange: field.onChange
|
|
389
|
+
})
|
|
390
|
+
}),
|
|
391
|
+
/*#__PURE__*/ _jsx(FormMessage, {})
|
|
392
|
+
]
|
|
393
|
+
})
|
|
394
|
+
}),
|
|
395
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
396
|
+
type: "submit",
|
|
397
|
+
children: "Submit"
|
|
398
|
+
})
|
|
399
|
+
]
|
|
400
|
+
})
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
export const WithCheckboxLabel = {
|
|
404
|
+
render: ()=>/*#__PURE__*/ _jsx(FormWithCheckboxLabelExample, {})
|
|
405
|
+
};
|
|
406
|
+
const checkboxLinksSchema = z.object({
|
|
407
|
+
username: z.string().min(1, 'Username is required'),
|
|
408
|
+
email: z.string().email('Invalid email address'),
|
|
409
|
+
acceptPolicies: z.boolean().refine((val)=>val === true, {
|
|
410
|
+
message: 'You must accept the policies to continue'
|
|
411
|
+
})
|
|
412
|
+
});
|
|
413
|
+
function FormWithCheckboxLinksExample() {
|
|
414
|
+
const form = useForm({
|
|
415
|
+
resolver: zodResolver(checkboxLinksSchema),
|
|
416
|
+
defaultValues: {
|
|
417
|
+
username: '',
|
|
418
|
+
email: '',
|
|
419
|
+
acceptPolicies: false
|
|
420
|
+
}
|
|
421
|
+
});
|
|
422
|
+
function onSubmit(data) {
|
|
423
|
+
// biome-ignore lint/suspicious/noConsole: <we need to log the data for the story>
|
|
424
|
+
console.log(data);
|
|
425
|
+
}
|
|
426
|
+
return /*#__PURE__*/ _jsx(Form, {
|
|
427
|
+
...form,
|
|
428
|
+
children: /*#__PURE__*/ _jsxs("form", {
|
|
429
|
+
onSubmit: form.handleSubmit(onSubmit),
|
|
430
|
+
className: "space-y-8 w-full max-w-md",
|
|
431
|
+
children: [
|
|
432
|
+
/*#__PURE__*/ _jsx(FormField, {
|
|
433
|
+
control: form.control,
|
|
434
|
+
name: "username",
|
|
435
|
+
render: ({ field })=>/*#__PURE__*/ _jsxs(FormItem, {
|
|
436
|
+
children: [
|
|
437
|
+
/*#__PURE__*/ _jsx(FormLabel, {
|
|
438
|
+
children: "Username"
|
|
439
|
+
}),
|
|
440
|
+
/*#__PURE__*/ _jsx(FormControl, {
|
|
441
|
+
children: /*#__PURE__*/ _jsx(Input, {
|
|
442
|
+
placeholder: "shadcn",
|
|
443
|
+
...field
|
|
444
|
+
})
|
|
445
|
+
}),
|
|
446
|
+
/*#__PURE__*/ _jsx(FormMessage, {})
|
|
447
|
+
]
|
|
448
|
+
})
|
|
449
|
+
}),
|
|
450
|
+
/*#__PURE__*/ _jsx(FormField, {
|
|
451
|
+
control: form.control,
|
|
452
|
+
name: "email",
|
|
453
|
+
render: ({ field })=>/*#__PURE__*/ _jsxs(FormItem, {
|
|
454
|
+
children: [
|
|
455
|
+
/*#__PURE__*/ _jsx(FormLabel, {
|
|
456
|
+
children: "Email"
|
|
457
|
+
}),
|
|
458
|
+
/*#__PURE__*/ _jsx(FormControl, {
|
|
459
|
+
children: /*#__PURE__*/ _jsx(Input, {
|
|
460
|
+
type: "email",
|
|
461
|
+
placeholder: "email@example.com",
|
|
462
|
+
...field
|
|
463
|
+
})
|
|
464
|
+
}),
|
|
465
|
+
/*#__PURE__*/ _jsx(FormMessage, {})
|
|
466
|
+
]
|
|
467
|
+
})
|
|
468
|
+
}),
|
|
469
|
+
/*#__PURE__*/ _jsx(FormField, {
|
|
470
|
+
control: form.control,
|
|
471
|
+
name: "acceptPolicies",
|
|
472
|
+
render: ({ field })=>/*#__PURE__*/ _jsxs(FormItem, {
|
|
473
|
+
children: [
|
|
474
|
+
/*#__PURE__*/ _jsx(FormControl, {
|
|
475
|
+
children: /*#__PURE__*/ _jsx(CheckboxLinks, {
|
|
476
|
+
label: "Accept policies",
|
|
477
|
+
links: [
|
|
478
|
+
{
|
|
479
|
+
label: 'Terms of use',
|
|
480
|
+
href: '#'
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
label: 'Privacy Policy',
|
|
484
|
+
href: '#'
|
|
485
|
+
}
|
|
486
|
+
],
|
|
487
|
+
checked: field.value,
|
|
488
|
+
onCheckedChange: field.onChange
|
|
489
|
+
})
|
|
490
|
+
}),
|
|
491
|
+
/*#__PURE__*/ _jsx(FormMessage, {})
|
|
492
|
+
]
|
|
493
|
+
})
|
|
494
|
+
}),
|
|
495
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
496
|
+
type: "submit",
|
|
497
|
+
children: "Submit"
|
|
498
|
+
})
|
|
499
|
+
]
|
|
500
|
+
})
|
|
501
|
+
});
|
|
502
|
+
}
|
|
503
|
+
export const WithCheckboxLinks = {
|
|
504
|
+
render: ()=>/*#__PURE__*/ _jsx(FormWithCheckboxLinksExample, {})
|
|
505
|
+
};
|
|
506
|
+
const checkboxLabelBorderSchema = z.object({
|
|
507
|
+
plan: z.string().min(1, 'Plan name is required'),
|
|
508
|
+
newsletter: z.boolean()
|
|
509
|
+
});
|
|
510
|
+
function FormWithCheckboxLabelBorderExample() {
|
|
511
|
+
const form = useForm({
|
|
512
|
+
resolver: zodResolver(checkboxLabelBorderSchema),
|
|
513
|
+
defaultValues: {
|
|
514
|
+
plan: '',
|
|
515
|
+
newsletter: false
|
|
516
|
+
}
|
|
517
|
+
});
|
|
518
|
+
function onSubmit(data) {
|
|
519
|
+
// biome-ignore lint/suspicious/noConsole: <we need to log the data for the story>
|
|
520
|
+
console.log(data);
|
|
521
|
+
}
|
|
522
|
+
return /*#__PURE__*/ _jsx(Form, {
|
|
523
|
+
...form,
|
|
524
|
+
children: /*#__PURE__*/ _jsxs("form", {
|
|
525
|
+
onSubmit: form.handleSubmit(onSubmit),
|
|
526
|
+
className: "space-y-8 w-full max-w-md",
|
|
527
|
+
children: [
|
|
528
|
+
/*#__PURE__*/ _jsx(FormField, {
|
|
529
|
+
control: form.control,
|
|
530
|
+
name: "plan",
|
|
531
|
+
render: ({ field })=>/*#__PURE__*/ _jsxs(FormItem, {
|
|
532
|
+
children: [
|
|
533
|
+
/*#__PURE__*/ _jsx(FormLabel, {
|
|
534
|
+
children: "Select a plan"
|
|
535
|
+
}),
|
|
536
|
+
/*#__PURE__*/ _jsx(FormControl, {
|
|
537
|
+
children: /*#__PURE__*/ _jsx(Input, {
|
|
538
|
+
placeholder: "Enter plan name",
|
|
539
|
+
...field
|
|
540
|
+
})
|
|
541
|
+
}),
|
|
542
|
+
/*#__PURE__*/ _jsx(FormDescription, {
|
|
543
|
+
children: "Choose the plan that best fits your needs."
|
|
544
|
+
}),
|
|
545
|
+
/*#__PURE__*/ _jsx(FormMessage, {})
|
|
546
|
+
]
|
|
547
|
+
})
|
|
548
|
+
}),
|
|
549
|
+
/*#__PURE__*/ _jsx(FormField, {
|
|
550
|
+
control: form.control,
|
|
551
|
+
name: "newsletter",
|
|
552
|
+
render: ({ field })=>/*#__PURE__*/ _jsxs(FormItem, {
|
|
553
|
+
children: [
|
|
554
|
+
/*#__PURE__*/ _jsx(FormControl, {
|
|
555
|
+
children: /*#__PURE__*/ _jsx(CheckboxLabel, {
|
|
556
|
+
label: "Subscribe to our newsletter",
|
|
557
|
+
description: "Get weekly updates, tips, and exclusive content delivered to your inbox.",
|
|
558
|
+
optional: true,
|
|
559
|
+
showInfoIcon: true,
|
|
560
|
+
border: true,
|
|
561
|
+
checked: field.value,
|
|
562
|
+
onCheckedChange: field.onChange
|
|
563
|
+
})
|
|
564
|
+
}),
|
|
565
|
+
/*#__PURE__*/ _jsx(FormMessage, {})
|
|
566
|
+
]
|
|
567
|
+
})
|
|
568
|
+
}),
|
|
569
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
570
|
+
type: "submit",
|
|
571
|
+
className: "mt-4",
|
|
572
|
+
children: "Submit"
|
|
573
|
+
})
|
|
574
|
+
]
|
|
575
|
+
})
|
|
576
|
+
});
|
|
577
|
+
}
|
|
578
|
+
export const WithCheckboxLabelBorder = {
|
|
579
|
+
render: ()=>/*#__PURE__*/ _jsx(FormWithCheckboxLabelBorderExample, {})
|
|
580
|
+
};
|
|
581
|
+
|
|
582
|
+
//# sourceMappingURL=form.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/form/form.stories.tsx"],"sourcesContent":["import {zodResolver} from '@hookform/resolvers/zod';\nimport type {Meta, StoryObj} from '@storybook/react';\nimport {Button} from 'components/button';\nimport {Checkbox, CheckboxLabel, CheckboxLinks} from 'components/checkbox';\nimport {Input} from 'components/input';\nimport {Textarea} from 'components/textarea';\nimport {Code, Header} from 'components/typography';\nimport {useForm} from 'react-hook-form';\nimport {z} from 'zod';\nimport {\n Form,\n FormControl,\n FormDescription,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n} from './form';\n\nconst meta = {\n title: 'Components/Form',\n tags: ['autodocs'],\n} satisfies Meta;\n\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nconst basicFormSchema = z.object({\n username: z.string().min(3, 'Username must be at least 3 characters'),\n email: z.string().email('Invalid email address'),\n});\n\ntype BasicFormValues = z.infer<typeof basicFormSchema>;\n\nfunction BasicFormExample() {\n const form = useForm<BasicFormValues>({\n resolver: zodResolver(basicFormSchema),\n defaultValues: {\n username: '',\n email: '',\n },\n });\n\n function onSubmit(data: BasicFormValues) {\n // biome-ignore lint/suspicious/noConsole: <we need to log the data for the story>\n console.log(data);\n }\n\n return (\n <Form {...form}>\n <form onSubmit={form.handleSubmit(onSubmit)} className=\"space-y-8 w-full max-w-md\">\n <FormField\n control={form.control}\n name=\"username\"\n render={({field}) => (\n <FormItem>\n <FormLabel>Username</FormLabel>\n <FormControl>\n <Input placeholder=\"shadcn\" {...field} />\n </FormControl>\n <FormDescription>This is your public display name.</FormDescription>\n <FormMessage />\n </FormItem>\n )}\n />\n <FormField\n control={form.control}\n name=\"email\"\n render={({field}) => (\n <FormItem>\n <FormLabel>Email</FormLabel>\n <FormControl>\n <Input type=\"email\" placeholder=\"email@example.com\" {...field} />\n </FormControl>\n <FormDescription>We'll never share your email.</FormDescription>\n <FormMessage />\n </FormItem>\n )}\n />\n <Button type=\"submit\">Submit</Button>\n </form>\n </Form>\n );\n}\n\nexport const Basic: Story = {\n render: () => <BasicFormExample />,\n};\n\nconst componentsFormSchema = z.object({\n example: z.string().min(1, 'This field is required'),\n exampleTextarea: z.string().min(1, 'This field is required'),\n});\n\ntype ComponentsFormValues = z.infer<typeof componentsFormSchema>;\n\nfunction FormComponentsExample() {\n const form = useForm<ComponentsFormValues>({\n resolver: zodResolver(componentsFormSchema),\n defaultValues: {\n example: '',\n exampleTextarea: '',\n },\n });\n\n return (\n <Form {...form}>\n <div className=\"flex flex-col gap-32 w-full max-w-md\">\n <div className=\"flex flex-col gap-16\">\n <Header variant=\"h3\">Form Components</Header>\n <Code variant=\"label\" className=\"text-foreground-neutral-subtle\">\n Individual form components work together within FormField\n </Code>\n </div>\n\n <form className=\"space-y-8\">\n <FormField\n control={form.control}\n name=\"example\"\n render={({field}) => (\n <FormItem>\n <FormLabel>Form Label</FormLabel>\n <FormControl>\n <Input placeholder=\"Form Control with Input\" {...field} />\n </FormControl>\n <FormDescription>This is a form description.</FormDescription>\n <FormMessage />\n </FormItem>\n )}\n />\n\n <FormField\n control={form.control}\n name=\"exampleTextarea\"\n render={({field}) => (\n <FormItem>\n <FormLabel>Form Label</FormLabel>\n <FormControl>\n <Textarea placeholder=\"Form Control with Textarea\" {...field} />\n </FormControl>\n <FormDescription>This is a form description.</FormDescription>\n <FormMessage />\n </FormItem>\n )}\n />\n </form>\n </div>\n </Form>\n );\n}\n\nexport const Components: Story = {\n render: () => <FormComponentsExample />,\n};\n\nconst checkboxFormSchema = z.object({\n username: z.string().min(3, 'Username must be at least 3 characters'),\n email: z.string().email('Invalid email address'),\n newsletter: z.boolean(),\n notifications: z.boolean(),\n});\n\ntype CheckboxFormValues = z.infer<typeof checkboxFormSchema>;\n\nfunction FormWithCheckboxExample() {\n const form = useForm<CheckboxFormValues>({\n resolver: zodResolver(checkboxFormSchema),\n defaultValues: {\n username: '',\n email: '',\n newsletter: false,\n notifications: false,\n },\n });\n\n function onSubmit(data: CheckboxFormValues) {\n // biome-ignore lint/suspicious/noConsole: <we need to log the data for the story>\n console.log(data);\n }\n\n return (\n <Form {...form}>\n <form onSubmit={form.handleSubmit(onSubmit)} className=\"space-y-8 w-full max-w-md\">\n <FormField\n control={form.control}\n name=\"username\"\n render={({field}) => (\n <FormItem>\n <FormLabel>Username</FormLabel>\n <FormControl>\n <Input placeholder=\"shadcn\" {...field} />\n </FormControl>\n <FormDescription>This is your public display name.</FormDescription>\n <FormMessage />\n </FormItem>\n )}\n />\n <FormField\n control={form.control}\n name=\"email\"\n render={({field}) => (\n <FormItem>\n <FormLabel>Email</FormLabel>\n <FormControl>\n <Input type=\"email\" placeholder=\"email@example.com\" {...field} />\n </FormControl>\n <FormDescription>We'll never share your email.</FormDescription>\n <FormMessage />\n </FormItem>\n )}\n />\n <FormField\n control={form.control}\n name=\"newsletter\"\n render={({field}) => (\n <FormItem className=\"flex flex-row items-center gap-8 pt-4\">\n <FormControl>\n <Checkbox checked={field.value} onCheckedChange={field.onChange} />\n </FormControl>\n <FormLabel>Subscribe to newsletter</FormLabel>\n </FormItem>\n )}\n />\n <FormField\n control={form.control}\n name=\"notifications\"\n render={({field}) => (\n <FormItem className=\"flex flex-row items-center gap-8 pt-4 pb-8\">\n <FormControl>\n <Checkbox checked={field.value} onCheckedChange={field.onChange} />\n </FormControl>\n <FormLabel>Enable notifications</FormLabel>\n </FormItem>\n )}\n />\n <Button type=\"submit\">Submit</Button>\n </form>\n </Form>\n );\n}\n\nexport const WithCheckbox: Story = {\n render: () => <FormWithCheckboxExample />,\n};\n\nconst checkboxLabelSchema = z.object({\n username: z.string().min(1, 'Username is required'),\n email: z.string().email('Invalid email address'),\n terms: z.boolean().refine((val) => val === true, {\n message: 'You must accept the terms and conditions',\n }),\n marketing: z.boolean(),\n});\n\ntype CheckboxLabelFormValues = z.infer<typeof checkboxLabelSchema>;\n\nfunction FormWithCheckboxLabelExample() {\n const form = useForm<CheckboxLabelFormValues>({\n resolver: zodResolver(checkboxLabelSchema),\n defaultValues: {\n username: '',\n email: '',\n terms: false,\n marketing: false,\n },\n });\n\n function onSubmit(data: CheckboxLabelFormValues) {\n // biome-ignore lint/suspicious/noConsole: <we need to log the data for the story>\n console.log(data);\n }\n\n return (\n <Form {...form}>\n <form onSubmit={form.handleSubmit(onSubmit)} className=\"space-y-8 w-full max-w-md\">\n <FormField\n control={form.control}\n name=\"username\"\n render={({field}) => (\n <FormItem>\n <FormLabel>Username</FormLabel>\n <FormControl>\n <Input placeholder=\"shadcn\" {...field} />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n <FormField\n control={form.control}\n name=\"email\"\n render={({field}) => (\n <FormItem>\n <FormLabel>Email</FormLabel>\n <FormControl>\n <Input type=\"email\" placeholder=\"email@example.com\" {...field} />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n <FormField\n control={form.control}\n name=\"terms\"\n render={({field}) => (\n <FormItem>\n <FormControl>\n <CheckboxLabel\n label=\"I agree to the terms and conditions\"\n description=\"By checking this box, you agree to our terms of service and privacy policy.\"\n checked={field.value}\n onCheckedChange={field.onChange}\n />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n <FormField\n control={form.control}\n name=\"marketing\"\n render={({field}) => (\n <FormItem>\n <FormControl>\n <CheckboxLabel\n label=\"I want to receive marketing emails\"\n description=\"Stay updated with our latest products and offers.\"\n optional\n checked={field.value}\n onCheckedChange={field.onChange}\n />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n <Button type=\"submit\">Submit</Button>\n </form>\n </Form>\n );\n}\n\nexport const WithCheckboxLabel: Story = {\n render: () => <FormWithCheckboxLabelExample />,\n};\n\nconst checkboxLinksSchema = z.object({\n username: z.string().min(1, 'Username is required'),\n email: z.string().email('Invalid email address'),\n acceptPolicies: z.boolean().refine((val) => val === true, {\n message: 'You must accept the policies to continue',\n }),\n});\n\ntype CheckboxLinksFormValues = z.infer<typeof checkboxLinksSchema>;\n\nfunction FormWithCheckboxLinksExample() {\n const form = useForm<CheckboxLinksFormValues>({\n resolver: zodResolver(checkboxLinksSchema),\n defaultValues: {\n username: '',\n email: '',\n acceptPolicies: false,\n },\n });\n\n function onSubmit(data: CheckboxLinksFormValues) {\n // biome-ignore lint/suspicious/noConsole: <we need to log the data for the story>\n console.log(data);\n }\n\n return (\n <Form {...form}>\n <form onSubmit={form.handleSubmit(onSubmit)} className=\"space-y-8 w-full max-w-md\">\n <FormField\n control={form.control}\n name=\"username\"\n render={({field}) => (\n <FormItem>\n <FormLabel>Username</FormLabel>\n <FormControl>\n <Input placeholder=\"shadcn\" {...field} />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n <FormField\n control={form.control}\n name=\"email\"\n render={({field}) => (\n <FormItem>\n <FormLabel>Email</FormLabel>\n <FormControl>\n <Input type=\"email\" placeholder=\"email@example.com\" {...field} />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n <FormField\n control={form.control}\n name=\"acceptPolicies\"\n render={({field}) => (\n <FormItem>\n <FormControl>\n <CheckboxLinks\n label=\"Accept policies\"\n links={[\n {label: 'Terms of use', href: '#'},\n {label: 'Privacy Policy', href: '#'},\n ]}\n checked={field.value}\n onCheckedChange={field.onChange}\n />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n <Button type=\"submit\">Submit</Button>\n </form>\n </Form>\n );\n}\n\nexport const WithCheckboxLinks: Story = {\n render: () => <FormWithCheckboxLinksExample />,\n};\n\nconst checkboxLabelBorderSchema = z.object({\n plan: z.string().min(1, 'Plan name is required'),\n newsletter: z.boolean(),\n});\n\ntype CheckboxLabelBorderFormValues = z.infer<typeof checkboxLabelBorderSchema>;\n\nfunction FormWithCheckboxLabelBorderExample() {\n const form = useForm<CheckboxLabelBorderFormValues>({\n resolver: zodResolver(checkboxLabelBorderSchema),\n defaultValues: {\n plan: '',\n newsletter: false,\n },\n });\n\n function onSubmit(data: CheckboxLabelBorderFormValues) {\n // biome-ignore lint/suspicious/noConsole: <we need to log the data for the story>\n console.log(data);\n }\n\n return (\n <Form {...form}>\n <form onSubmit={form.handleSubmit(onSubmit)} className=\"space-y-8 w-full max-w-md\">\n <FormField\n control={form.control}\n name=\"plan\"\n render={({field}) => (\n <FormItem>\n <FormLabel>Select a plan</FormLabel>\n <FormControl>\n <Input placeholder=\"Enter plan name\" {...field} />\n </FormControl>\n <FormDescription>Choose the plan that best fits your needs.</FormDescription>\n <FormMessage />\n </FormItem>\n )}\n />\n <FormField\n control={form.control}\n name=\"newsletter\"\n render={({field}) => (\n <FormItem>\n <FormControl>\n <CheckboxLabel\n label=\"Subscribe to our newsletter\"\n description=\"Get weekly updates, tips, and exclusive content delivered to your inbox.\"\n optional\n showInfoIcon\n border\n checked={field.value}\n onCheckedChange={field.onChange}\n />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n <Button type=\"submit\" className=\"mt-4\">\n Submit\n </Button>\n </form>\n </Form>\n );\n}\n\nexport const WithCheckboxLabelBorder: Story = {\n render: () => <FormWithCheckboxLabelBorderExample />,\n};\n"],"names":["zodResolver","Button","Checkbox","CheckboxLabel","CheckboxLinks","Input","Textarea","Code","Header","useForm","z","Form","FormControl","FormDescription","FormField","FormItem","FormLabel","FormMessage","meta","title","tags","basicFormSchema","object","username","string","min","email","BasicFormExample","form","resolver","defaultValues","onSubmit","data","console","log","handleSubmit","className","control","name","render","field","placeholder","type","Basic","componentsFormSchema","example","exampleTextarea","FormComponentsExample","div","variant","Components","checkboxFormSchema","newsletter","boolean","notifications","FormWithCheckboxExample","checked","value","onCheckedChange","onChange","WithCheckbox","checkboxLabelSchema","terms","refine","val","message","marketing","FormWithCheckboxLabelExample","label","description","optional","WithCheckboxLabel","checkboxLinksSchema","acceptPolicies","FormWithCheckboxLinksExample","links","href","WithCheckboxLinks","checkboxLabelBorderSchema","plan","FormWithCheckboxLabelBorderExample","showInfoIcon","border","WithCheckboxLabelBorder"],"mappings":";AAAA,SAAQA,WAAW,QAAO,0BAA0B;AAEpD,SAAQC,MAAM,QAAO,oBAAoB;AACzC,SAAQC,QAAQ,EAAEC,aAAa,EAAEC,aAAa,QAAO,sBAAsB;AAC3E,SAAQC,KAAK,QAAO,mBAAmB;AACvC,SAAQC,QAAQ,QAAO,sBAAsB;AAC7C,SAAQC,IAAI,EAAEC,MAAM,QAAO,wBAAwB;AACnD,SAAQC,O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uC;QAClDoB,UAAU7B,YAAY8E;QACtBhD,eAAe;YACbiD,MAAM;YACN3B,YAAY;QACd;IACF;IAEA,SAASrB,SAASC,IAAmC;QACnD,kFAAkF;QAClFC,QAAQC,GAAG,CAACF;IACd;IAEA,qBACE,KAACrB;QAAM,GAAGiB,IAAI;kBACZ,cAAA,MAACA;YAAKG,UAAUH,KAAKO,YAAY,CAACJ;YAAWK,WAAU;;8BACrD,KAACtB;oBACCuB,SAAST,KAAKS,OAAO;oBACrBC,MAAK;oBACLC,QAAQ,CAAC,EAACC,KAAK,EAAC,iBACd,MAACzB;;8CACC,KAACC;8CAAU;;8CACX,KAACJ;8CACC,cAAA,KAACP;wCAAMoC,aAAY;wCAAmB,GAAGD,KAAK;;;8CAEhD,KAAC3B;8CAAgB;;8CACjB,KAACI;;;;8BAIP,KAACH;oBACCuB,SAAST,KAAKS,OAAO;oBACrBC,MAAK;oBACLC,QAAQ,CAAC,EAACC,KAAK,EAAC,iBACd,MAACzB;;8CACC,KAACH;8CACC,cAAA,KAACT;wCACCiE,OAAM;wCACNC,aAAY;wCACZC,QAAQ;wCACRW,YAAY;wCACZC,MAAM;wCACN1B,SAAShB,MAAMiB,KAAK;wCACpBC,iBAAiBlB,MAAMmB,QAAQ;;;8CAGnC,KAAC1C;;;;8BAIP,KAAChB;oBAAOyC,MAAK;oBAASN,WAAU;8BAAO;;;;;AAM/C;AAEA,OAAO,MAAM+C,0BAAiC;IAC5C5C,QAAQ,kBAAM,KAACyC;AACjB,EAAE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/form/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/form/index.ts"],"sourcesContent":["export * from './form';\n"],"names":[],"mappings":"AAAA,cAAc,SAAS"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { RemixiconComponentType } from '@remixicon/react';
|
|
2
2
|
import type { ComponentProps } from 'react';
|
|
3
|
-
export declare function SpinnerIcon(
|
|
3
|
+
export declare function SpinnerIcon(props: ComponentProps<RemixiconComponentType>): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
//# sourceMappingURL=spinner.d.ts.map
|