formik-form-components 0.2.7
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/LICENSE +21 -0
- package/README.md +423 -0
- package/dist/index.d.ts +270 -0
- package/dist/index.js +11907 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +11858 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +134 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 SMS
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,423 @@
|
|
|
1
|
+
# formik-form-components
|
|
2
|
+
|
|
3
|
+
A comprehensive collection of reusable, accessible, and customizable form components built with React, Material-UI, Formik, and Tiptap. Streamline your form development with pre-built, production-ready form elements that follow Material Design principles.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
- [Installation](#installation)
|
|
8
|
+
- [Peer Dependencies](#peer-dependencies)
|
|
9
|
+
- [Getting Started](#getting-started)
|
|
10
|
+
- [Available Components](#available-components)
|
|
11
|
+
- [Component Documentation](#component-documentation)
|
|
12
|
+
- [Theming](#theming)
|
|
13
|
+
- [TypeScript Support](#typescript-support)
|
|
14
|
+
- [Contributing](#contributing)
|
|
15
|
+
- [License](#license)
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# Using npm
|
|
21
|
+
npm install formik-form-components
|
|
22
|
+
|
|
23
|
+
# Using yarn
|
|
24
|
+
yarn add formik-form-components
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Peer Dependencies
|
|
28
|
+
|
|
29
|
+
This package requires the following peer dependencies. Make sure they are installed in your project:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
# Core React
|
|
33
|
+
react@^17.0.0 || ^18.0.0
|
|
34
|
+
react-dom@^17.0.0 || ^18.0.0
|
|
35
|
+
|
|
36
|
+
# Material-UI v5+
|
|
37
|
+
@emotion/react@^11.0.0
|
|
38
|
+
@emotion/styled@^11.0.0
|
|
39
|
+
@mui/material@^5.0.0 || ^6.0.0
|
|
40
|
+
@mui/lab@^5.0.0 || ^6.0.0
|
|
41
|
+
@mui/x-date-pickers@^6.0.0
|
|
42
|
+
|
|
43
|
+
# Form Management
|
|
44
|
+
formik@^2.0.0
|
|
45
|
+
|
|
46
|
+
yup@^0.32.0 # Recommended for validation
|
|
47
|
+
|
|
48
|
+
# Rich Text Editor (for AppRichTextEditor)
|
|
49
|
+
@tiptap/react@^2.0.0
|
|
50
|
+
@tiptap/starter-kit@^2.0.0
|
|
51
|
+
@tiptap/extension-link@^2.0.0
|
|
52
|
+
@tiptap/extension-text-align@^2.0.0
|
|
53
|
+
|
|
54
|
+
# Icons (optional but recommended)
|
|
55
|
+
@mui/icons-material@^5.0.0 || ^6.0.0
|
|
56
|
+
@iconify/react@^4.0.0
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Getting Started
|
|
60
|
+
|
|
61
|
+
1. **Install the package and dependencies**:
|
|
62
|
+
```bash
|
|
63
|
+
yarn add formik-form-components @mui/material @emotion/react @emotion/styled formik yup
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
2. **Wrap your app with ThemeProvider (optional but recommended)**:
|
|
67
|
+
```tsx
|
|
68
|
+
import { ThemeProvider, createTheme } from '@mui/material/styles';
|
|
69
|
+
|
|
70
|
+
const theme = createTheme({
|
|
71
|
+
// Your theme configuration
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
function App() {
|
|
75
|
+
return (
|
|
76
|
+
<ThemeProvider theme={theme}>
|
|
77
|
+
<YourApp />
|
|
78
|
+
</ThemeProvider>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
3. **Basic Form Example**:
|
|
84
|
+
```tsx
|
|
85
|
+
import { Formik, Form } from 'formik';
|
|
86
|
+
import * as Yup from 'yup';
|
|
87
|
+
import {
|
|
88
|
+
AppInputField,
|
|
89
|
+
AppCheckBox,
|
|
90
|
+
AppDatePicker,
|
|
91
|
+
AppPhoneNoInput,
|
|
92
|
+
AppSearchableSelect,
|
|
93
|
+
AppRichTextEditor,
|
|
94
|
+
AppRating,
|
|
95
|
+
AppRadioGroup,
|
|
96
|
+
AppMultiSelector
|
|
97
|
+
} from '@tkturners/form-components';
|
|
98
|
+
import { Button, Box } from '@mui/material';
|
|
99
|
+
|
|
100
|
+
const validationSchema = Yup.object({
|
|
101
|
+
name: Yup.string().required('Name is required'),
|
|
102
|
+
email: Yup.string().email('Invalid email').required('Email is required'),
|
|
103
|
+
phone: Yup.string().required('Phone number is required'),
|
|
104
|
+
dob: Yup.date().required('Date of birth is required'),
|
|
105
|
+
bio: Yup.string().required('Bio is required'),
|
|
106
|
+
rating: Yup.number().required('Rating is required'),
|
|
107
|
+
gender: Yup.string().required('Gender is required'),
|
|
108
|
+
interests: Yup.array().min(1, 'Select at least one interest'),
|
|
109
|
+
terms: Yup.boolean().oneOf([true], 'You must accept the terms')
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
const interests = [
|
|
113
|
+
{ value: 'sports', label: 'Sports' },
|
|
114
|
+
{ value: 'music', label: 'Music' },
|
|
115
|
+
{ value: 'reading', label: 'Reading' },
|
|
116
|
+
{ value: 'travel', label: 'Travel' },
|
|
117
|
+
];
|
|
118
|
+
|
|
119
|
+
const genderOptions = [
|
|
120
|
+
{ value: 'male', label: 'Male' },
|
|
121
|
+
{ value: 'female', label: 'Female' },
|
|
122
|
+
{ value: 'other', label: 'Other' },
|
|
123
|
+
];
|
|
124
|
+
|
|
125
|
+
function MyForm() {
|
|
126
|
+
const initialValues = {
|
|
127
|
+
name: '',
|
|
128
|
+
email: '',
|
|
129
|
+
phone: '',
|
|
130
|
+
dob: null,
|
|
131
|
+
bio: '',
|
|
132
|
+
rating: 0,
|
|
133
|
+
gender: '',
|
|
134
|
+
interests: [],
|
|
135
|
+
terms: false
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
const handleSubmit = (values, { setSubmitting }) => {
|
|
139
|
+
console.log('Form submitted:', values);
|
|
140
|
+
setSubmitting(false);
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
return (
|
|
144
|
+
<Formik
|
|
145
|
+
initialValues={initialValues}
|
|
146
|
+
validationSchema={validationSchema}
|
|
147
|
+
onSubmit={handleSubmit}
|
|
148
|
+
>
|
|
149
|
+
{({ isSubmitting, setFieldValue, values }) => (
|
|
150
|
+
<Form>
|
|
151
|
+
<Box sx={{ maxWidth: 600, mx: 'auto', p: 3 }}>
|
|
152
|
+
<AppInputField
|
|
153
|
+
name="name"
|
|
154
|
+
label="Full Name"
|
|
155
|
+
placeholder="Enter your full name"
|
|
156
|
+
fullWidth
|
|
157
|
+
margin="normal"
|
|
158
|
+
/>
|
|
159
|
+
|
|
160
|
+
<AppInputField
|
|
161
|
+
name="email"
|
|
162
|
+
label="Email Address"
|
|
163
|
+
type="email"
|
|
164
|
+
placeholder="your.email@example.com"
|
|
165
|
+
fullWidth
|
|
166
|
+
margin="normal"
|
|
167
|
+
/>
|
|
168
|
+
|
|
169
|
+
<AppPhoneNoInput
|
|
170
|
+
name="phone"
|
|
171
|
+
label="Phone Number"
|
|
172
|
+
fullWidth
|
|
173
|
+
margin="normal"
|
|
174
|
+
/>
|
|
175
|
+
|
|
176
|
+
<AppDatePicker
|
|
177
|
+
name="dob"
|
|
178
|
+
label="Date of Birth"
|
|
179
|
+
fullWidth
|
|
180
|
+
margin="normal"
|
|
181
|
+
/>
|
|
182
|
+
|
|
183
|
+
<AppRichTextEditor
|
|
184
|
+
name="bio"
|
|
185
|
+
label="Biography"
|
|
186
|
+
placeholder="Tell us about yourself..."
|
|
187
|
+
fullWidth
|
|
188
|
+
margin="normal"
|
|
189
|
+
/>
|
|
190
|
+
|
|
191
|
+
<AppRating
|
|
192
|
+
name="rating"
|
|
193
|
+
label="How would you rate your experience?"
|
|
194
|
+
precision={0.5}
|
|
195
|
+
size="large"
|
|
196
|
+
margin="normal"
|
|
197
|
+
/>
|
|
198
|
+
|
|
199
|
+
<AppRadioGroup
|
|
200
|
+
name="gender"
|
|
201
|
+
label="Gender"
|
|
202
|
+
options={genderOptions}
|
|
203
|
+
row
|
|
204
|
+
margin="normal"
|
|
205
|
+
/>
|
|
206
|
+
|
|
207
|
+
<AppMultiSelector
|
|
208
|
+
name="interests"
|
|
209
|
+
label="Interests"
|
|
210
|
+
options={interests}
|
|
211
|
+
fullWidth
|
|
212
|
+
margin="normal"
|
|
213
|
+
/>
|
|
214
|
+
|
|
215
|
+
<AppCheckBox
|
|
216
|
+
name="terms"
|
|
217
|
+
label="I agree to the terms and conditions"
|
|
218
|
+
margin="normal"
|
|
219
|
+
/>
|
|
220
|
+
|
|
221
|
+
<Box sx={{ mt: 3, display: 'flex', justifyContent: 'flex-end' }}>
|
|
222
|
+
<Button
|
|
223
|
+
type="submit"
|
|
224
|
+
variant="contained"
|
|
225
|
+
color="primary"
|
|
226
|
+
disabled={isSubmitting}
|
|
227
|
+
>
|
|
228
|
+
{isSubmitting ? 'Submitting...' : 'Submit'}
|
|
229
|
+
</Button>
|
|
230
|
+
</Box>
|
|
231
|
+
</Box>
|
|
232
|
+
</Form>
|
|
233
|
+
)}
|
|
234
|
+
</Formik>
|
|
235
|
+
);
|
|
236
|
+
}
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
## Available Components
|
|
240
|
+
|
|
241
|
+
### Form Controls
|
|
242
|
+
- `AppInputField` - Text input field with validation
|
|
243
|
+
- `AppCheckBox` - Checkbox input with label
|
|
244
|
+
- `AppRadioGroup` - Group of radio buttons
|
|
245
|
+
- `AppSwitch` - Toggle switch component
|
|
246
|
+
|
|
247
|
+
### Selectors
|
|
248
|
+
- `AppSelect` - Basic select dropdown
|
|
249
|
+
- `AppSearchableSelect` - Searchable select dropdown
|
|
250
|
+
- `AppMultiSelector` - Multi-select dropdown with chips
|
|
251
|
+
- `AppSearchableMultiSelector` - Searchable multi-select
|
|
252
|
+
|
|
253
|
+
### Date & Time
|
|
254
|
+
- `AppDatePicker` - Date picker
|
|
255
|
+
- `AppTimePicker` - Time picker
|
|
256
|
+
- `AppDateTimePicker` - Combined date and time picker
|
|
257
|
+
- `AppDateRangePicker` - Date range picker
|
|
258
|
+
|
|
259
|
+
### Rich Content
|
|
260
|
+
- `AppRichTextEditor` - Rich text editor with formatting options
|
|
261
|
+
- `AppFileUpload` - File upload component with preview
|
|
262
|
+
- `AppImageUpload` - Image upload with crop and preview
|
|
263
|
+
|
|
264
|
+
### Advanced
|
|
265
|
+
- `AppPhoneNoInput` - Phone number input with country code selector
|
|
266
|
+
- `AppRating` - Star rating component
|
|
267
|
+
- `AppAutocomplete` - Autocomplete input with suggestions
|
|
268
|
+
- `AppSlider` - Range slider input
|
|
269
|
+
- `AppFormErrorMessage` - Displays form validation errors
|
|
270
|
+
|
|
271
|
+
## Component Documentation
|
|
272
|
+
|
|
273
|
+
### AppInputField
|
|
274
|
+
|
|
275
|
+
A versatile text input field with built-in validation and Material-UI styling.
|
|
276
|
+
|
|
277
|
+
```tsx
|
|
278
|
+
import { AppInputField } from 'formik-form-components';
|
|
279
|
+
|
|
280
|
+
<AppInputField
|
|
281
|
+
name="username"
|
|
282
|
+
label="Username"
|
|
283
|
+
placeholder="Enter your username"
|
|
284
|
+
fullWidth
|
|
285
|
+
margin="normal"
|
|
286
|
+
required
|
|
287
|
+
helperText="Choose a unique username"
|
|
288
|
+
InputProps={{
|
|
289
|
+
startAdornment: <InputAdornment position="start">@</InputAdornment>,
|
|
290
|
+
}}
|
|
291
|
+
/>
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
#### Props
|
|
295
|
+
|
|
296
|
+
| Prop | Type | Default | Description |
|
|
297
|
+
|------|------|---------|-------------|
|
|
298
|
+
| name | string | required | Field name for Formik |
|
|
299
|
+
| label | string | '' | Field label |
|
|
300
|
+
| type | string | 'text' | Input type (text, email, password, etc.) |
|
|
301
|
+
| fullWidth | boolean | false | If true, the input will take up the full width |
|
|
302
|
+
| required | boolean | false | If true, adds required asterisk |
|
|
303
|
+
| disabled | boolean | false | If true, the input will be disabled |
|
|
304
|
+
| multiline | boolean | false | If true, renders a textarea |
|
|
305
|
+
| rows | number | 4 | Number of rows to display when multiline is true |
|
|
306
|
+
| InputProps | object | {} | Props applied to the Input component |
|
|
307
|
+
| ...other | any | - | Any other props will be passed to the underlying MUI TextField |
|
|
308
|
+
|
|
309
|
+
### AppRichTextEditor
|
|
310
|
+
|
|
311
|
+
A powerful rich text editor built with TipTap.
|
|
312
|
+
|
|
313
|
+
```tsx
|
|
314
|
+
import { AppRichTextEditor } from '@tkturners/form-components';
|
|
315
|
+
|
|
316
|
+
<AppRichTextEditor
|
|
317
|
+
name="content"
|
|
318
|
+
label="Content"
|
|
319
|
+
placeholder="Start writing here..."
|
|
320
|
+
fullWidth
|
|
321
|
+
margin="normal"
|
|
322
|
+
toolbarItems={['bold', 'italic', 'underline', 'link', 'bulletList', 'orderedList']}
|
|
323
|
+
/>
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
#### Props
|
|
327
|
+
|
|
328
|
+
| Prop | Type | Default | Description |
|
|
329
|
+
|------|------|---------|-------------|
|
|
330
|
+
| name | string | required | Field name for Formik |
|
|
331
|
+
| label | string | '' | Field label |
|
|
332
|
+
| placeholder | string | '' | Placeholder text |
|
|
333
|
+
| toolbarItems | string[] | All available items | Array of toolbar items to display |
|
|
334
|
+
| ...other | any | - | Any other props will be passed to the underlying MUI TextField |
|
|
335
|
+
|
|
336
|
+
## Theming
|
|
337
|
+
|
|
338
|
+
All components can be customized using Material-UI's theming system. You can override styles, default props, and more.
|
|
339
|
+
|
|
340
|
+
```tsx
|
|
341
|
+
import { createTheme } from '@mui/material/styles';
|
|
342
|
+
|
|
343
|
+
const theme = createTheme({
|
|
344
|
+
components: {
|
|
345
|
+
MuiTextField: {
|
|
346
|
+
defaultProps: {
|
|
347
|
+
variant: 'outlined',
|
|
348
|
+
fullWidth: true,
|
|
349
|
+
margin: 'normal',
|
|
350
|
+
},
|
|
351
|
+
},
|
|
352
|
+
// Override specific component styles
|
|
353
|
+
MuiFormControl: {
|
|
354
|
+
styleOverrides: {
|
|
355
|
+
root: {
|
|
356
|
+
marginBottom: '1rem',
|
|
357
|
+
},
|
|
358
|
+
},
|
|
359
|
+
},
|
|
360
|
+
},
|
|
361
|
+
// Custom palette
|
|
362
|
+
palette: {
|
|
363
|
+
primary: {
|
|
364
|
+
main: '#1976d2',
|
|
365
|
+
},
|
|
366
|
+
secondary: {
|
|
367
|
+
main: '#dc004e',
|
|
368
|
+
},
|
|
369
|
+
},
|
|
370
|
+
});
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
## TypeScript Support
|
|
374
|
+
|
|
375
|
+
All components are written in TypeScript and include type definitions. The form values should be properly typed when using with Formik:
|
|
376
|
+
|
|
377
|
+
```tsx
|
|
378
|
+
type FormValues = {
|
|
379
|
+
name: string;
|
|
380
|
+
email: string;
|
|
381
|
+
// ... other fields
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
const validationSchema = Yup.object<FormValues>({
|
|
385
|
+
name: Yup.string().required('Required'),
|
|
386
|
+
email: Yup.string().email('Invalid email').required('Required'),
|
|
387
|
+
// ... other validations
|
|
388
|
+
});
|
|
389
|
+
|
|
390
|
+
// In your component
|
|
391
|
+
<Formik<FormValues>
|
|
392
|
+
initialValues={{
|
|
393
|
+
name: '',
|
|
394
|
+
email: '',
|
|
395
|
+
// ... other initial values
|
|
396
|
+
}}
|
|
397
|
+
validationSchema={validationSchema}
|
|
398
|
+
onSubmit={(values) => {
|
|
399
|
+
// values is properly typed as FormValues
|
|
400
|
+
console.log(values);
|
|
401
|
+
}}
|
|
402
|
+
>
|
|
403
|
+
{/* ... */}
|
|
404
|
+
</Formik>
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
## Contributing
|
|
408
|
+
|
|
409
|
+
Contributions are welcome! Please follow these steps:
|
|
410
|
+
|
|
411
|
+
1. Fork the repository
|
|
412
|
+
2. Create a feature branch
|
|
413
|
+
3. Commit your changes
|
|
414
|
+
4. Push to the branch
|
|
415
|
+
5. Create a new Pull Request
|
|
416
|
+
|
|
417
|
+
## License
|
|
418
|
+
|
|
419
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
420
|
+
|
|
421
|
+
## Support
|
|
422
|
+
|
|
423
|
+
If you encounter any issues or have questions, please [open an issue](https://github.com/tkturners/formik-form-components/issues) on GitHub.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
|
+
import React__default, { ReactElement, ReactNode, SetStateAction } from 'react';
|
|
3
|
+
import { FormikValues, FormikConfig, FormikProps } from 'formik';
|
|
4
|
+
import { SelectProps } from '@mui/material/Select';
|
|
5
|
+
import { Dayjs } from 'dayjs';
|
|
6
|
+
import { StandardTextFieldProps, RadioGroupProps, AutocompleteProps, SxProps, BoxProps } from '@mui/material';
|
|
7
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
8
|
+
import { Theme } from '@mui/material/styles';
|
|
9
|
+
import { DropzoneOptions } from 'react-dropzone';
|
|
10
|
+
import { IconifyIcon } from '@iconify/react';
|
|
11
|
+
|
|
12
|
+
interface Props$e {
|
|
13
|
+
name: string;
|
|
14
|
+
label: string;
|
|
15
|
+
required?: boolean;
|
|
16
|
+
minDate?: Dayjs;
|
|
17
|
+
disablePast?: boolean;
|
|
18
|
+
[key: string]: unknown;
|
|
19
|
+
}
|
|
20
|
+
declare const AppDatePicker: ({ name, label, required, disablePast, ...otherProps }: Props$e) => React__default.JSX.Element;
|
|
21
|
+
|
|
22
|
+
interface AppSelectOptions$4 {
|
|
23
|
+
label: string;
|
|
24
|
+
value: string | number;
|
|
25
|
+
}
|
|
26
|
+
interface Props$d extends Omit<SelectProps, 'name' | 'label' | 'value' | 'onChange'> {
|
|
27
|
+
name: string;
|
|
28
|
+
label?: string;
|
|
29
|
+
placeholder?: string;
|
|
30
|
+
options: AppSelectOptions$4[];
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
}
|
|
33
|
+
declare function AppAutoCompleter({ placeholder, name, label, options, disabled }: Props$d): React.JSX.Element;
|
|
34
|
+
|
|
35
|
+
interface Props$c {
|
|
36
|
+
name: string;
|
|
37
|
+
label?: string;
|
|
38
|
+
placeholder?: string;
|
|
39
|
+
required?: boolean;
|
|
40
|
+
[key: string]: unknown;
|
|
41
|
+
}
|
|
42
|
+
declare const AppDateAndTimePicker: ({ name, label, required, ...otherProps }: Props$c) => React__default.JSX.Element;
|
|
43
|
+
|
|
44
|
+
interface Props$b {
|
|
45
|
+
name: string;
|
|
46
|
+
alwaysShow?: boolean;
|
|
47
|
+
}
|
|
48
|
+
declare function AppFormErrorMessage({ name, alwaysShow }: Props$b): React.JSX.Element | null;
|
|
49
|
+
|
|
50
|
+
interface AppTextAreaProps {
|
|
51
|
+
name: string;
|
|
52
|
+
label: string;
|
|
53
|
+
}
|
|
54
|
+
declare function AppTextArea({ name, label }: AppTextAreaProps): React.JSX.Element;
|
|
55
|
+
|
|
56
|
+
interface Props$a extends Omit<SelectProps, 'name' | 'label' | 'value' | 'onChange'> {
|
|
57
|
+
name: string;
|
|
58
|
+
freeSolo?: boolean;
|
|
59
|
+
multiple?: boolean;
|
|
60
|
+
label?: string;
|
|
61
|
+
placeholder?: string;
|
|
62
|
+
options: string[];
|
|
63
|
+
disabled?: boolean;
|
|
64
|
+
}
|
|
65
|
+
declare function AppTagsCreator({ placeholder, name, multiple, label, options, disabled, }: Props$a): React.JSX.Element;
|
|
66
|
+
|
|
67
|
+
interface AppSwitchInputProps {
|
|
68
|
+
name: string;
|
|
69
|
+
label?: string;
|
|
70
|
+
className?: string;
|
|
71
|
+
style?: React__default.CSSProperties;
|
|
72
|
+
inputStyle?: React__default.CSSProperties;
|
|
73
|
+
[key: string]: unknown;
|
|
74
|
+
}
|
|
75
|
+
declare function AppSwitchInput({ name, label, className, style, inputStyle, ...otherProps }: AppSwitchInputProps): React__default.JSX.Element;
|
|
76
|
+
|
|
77
|
+
interface AppSwitchProps {
|
|
78
|
+
name: string;
|
|
79
|
+
label: string;
|
|
80
|
+
}
|
|
81
|
+
declare function AppSwitch({ name, label }: AppSwitchProps): React.JSX.Element;
|
|
82
|
+
|
|
83
|
+
interface FormProps<T> extends FormikConfig<T> {
|
|
84
|
+
children?: ((props: FormikProps<T>) => ReactNode) | ReactNode;
|
|
85
|
+
className?: string;
|
|
86
|
+
}
|
|
87
|
+
declare const Form: <T extends FormikValues>({ children, className, ...props }: FormProps<T>) => ReactElement;
|
|
88
|
+
|
|
89
|
+
interface Props$9 extends Omit<SelectProps, 'name' | 'label' | 'value' | 'onChange'> {
|
|
90
|
+
name: string;
|
|
91
|
+
freeSolo?: boolean;
|
|
92
|
+
label?: string;
|
|
93
|
+
placeholder?: string;
|
|
94
|
+
options: string[];
|
|
95
|
+
}
|
|
96
|
+
declare function AppAutoComplete({ placeholder, name, label, options }: Props$9): React.JSX.Element;
|
|
97
|
+
|
|
98
|
+
interface Props$8 {
|
|
99
|
+
option: {
|
|
100
|
+
label: string;
|
|
101
|
+
name: string;
|
|
102
|
+
}[];
|
|
103
|
+
name: string;
|
|
104
|
+
}
|
|
105
|
+
declare const CheckboxField: React__default.FC<Props$8>;
|
|
106
|
+
|
|
107
|
+
interface Props$7 extends StandardTextFieldProps {
|
|
108
|
+
name: string;
|
|
109
|
+
label: ReactNode;
|
|
110
|
+
tagUser?: string;
|
|
111
|
+
hasReply?: boolean;
|
|
112
|
+
required?: boolean;
|
|
113
|
+
}
|
|
114
|
+
declare function AppInputField({ name, label, type, InputProps, required, ...otherProps }: Props$7): React__default.JSX.Element;
|
|
115
|
+
|
|
116
|
+
interface AppSelectOptions$3 {
|
|
117
|
+
label: string;
|
|
118
|
+
value: string | number;
|
|
119
|
+
}
|
|
120
|
+
interface Props$6 extends Omit<SelectProps<(string | number)[]>, 'name' | 'label' | 'value' | 'onChange'> {
|
|
121
|
+
name: string;
|
|
122
|
+
label: string;
|
|
123
|
+
multiple?: boolean;
|
|
124
|
+
options: AppSelectOptions$3[];
|
|
125
|
+
required?: boolean;
|
|
126
|
+
}
|
|
127
|
+
declare function AppMultiSelector({ multiple, name, label, options, required, ...otherProps }: Props$6): React.JSX.Element;
|
|
128
|
+
|
|
129
|
+
interface AppPhoneNoInputProps {
|
|
130
|
+
name: string;
|
|
131
|
+
label?: string;
|
|
132
|
+
required?: boolean;
|
|
133
|
+
[key: string]: unknown;
|
|
134
|
+
}
|
|
135
|
+
declare const AppPhoneNoInput: React__default.FC<AppPhoneNoInputProps>;
|
|
136
|
+
|
|
137
|
+
type Props$5 = RadioGroupProps & {
|
|
138
|
+
name: string;
|
|
139
|
+
options: {
|
|
140
|
+
label: string;
|
|
141
|
+
value: string | number;
|
|
142
|
+
}[];
|
|
143
|
+
};
|
|
144
|
+
declare function AppRadioGroup({ name, options, ...rest }: Props$5): React.JSX.Element;
|
|
145
|
+
|
|
146
|
+
interface AppRatingProps {
|
|
147
|
+
name: string;
|
|
148
|
+
label: string;
|
|
149
|
+
}
|
|
150
|
+
declare function AppRating({ name, label }: AppRatingProps): React.JSX.Element;
|
|
151
|
+
|
|
152
|
+
interface Props$4 {
|
|
153
|
+
name: string;
|
|
154
|
+
label?: string;
|
|
155
|
+
placeholder?: string;
|
|
156
|
+
required?: boolean;
|
|
157
|
+
}
|
|
158
|
+
declare const AppRichTextEditor: ({ name, label, required, placeholder }: Props$4) => react_jsx_runtime.JSX.Element | null;
|
|
159
|
+
|
|
160
|
+
interface AppSelectOptions$2 {
|
|
161
|
+
label: string;
|
|
162
|
+
value: number;
|
|
163
|
+
searchAbleValue1?: string;
|
|
164
|
+
searchAbleValue2?: string;
|
|
165
|
+
searchAbleValue3?: string;
|
|
166
|
+
}
|
|
167
|
+
interface Props$3 {
|
|
168
|
+
name: string;
|
|
169
|
+
label: string;
|
|
170
|
+
multiple?: boolean;
|
|
171
|
+
options: AppSelectOptions$2[];
|
|
172
|
+
setSearchQuery: React__default.Dispatch<SetStateAction<string>>;
|
|
173
|
+
required?: boolean;
|
|
174
|
+
}
|
|
175
|
+
declare function AppSearchableMultiSelector({ multiple, name, label, options, required, setSearchQuery, }: Props$3): React__default.JSX.Element;
|
|
176
|
+
|
|
177
|
+
interface AppSelectOptions$1 {
|
|
178
|
+
label: string;
|
|
179
|
+
value: string | number;
|
|
180
|
+
searchAbleValue1?: string;
|
|
181
|
+
searchAbleValue2?: string;
|
|
182
|
+
searchAbleValue3?: string;
|
|
183
|
+
}
|
|
184
|
+
interface Props$2 extends Omit<AutocompleteProps<AppSelectOptions$1, false, false, false>, 'options' | 'renderInput' | 'value' | 'onChange'> {
|
|
185
|
+
name: string;
|
|
186
|
+
label: string;
|
|
187
|
+
options: AppSelectOptions$1[];
|
|
188
|
+
setSearchQuery?: React__default.Dispatch<SetStateAction<string>> | undefined;
|
|
189
|
+
required?: boolean;
|
|
190
|
+
placeholder?: string;
|
|
191
|
+
isResetRequired?: boolean;
|
|
192
|
+
}
|
|
193
|
+
declare function AppSearchableSelectInput({ name, label, required, options, placeholder, setSearchQuery, isResetRequired, ...otherProps }: Props$2): React__default.JSX.Element;
|
|
194
|
+
|
|
195
|
+
interface AppSelectOptions {
|
|
196
|
+
label: string;
|
|
197
|
+
value: string | number;
|
|
198
|
+
}
|
|
199
|
+
interface Props$1 extends Omit<SelectProps, 'name' | 'label' | 'value' | 'onChange'> {
|
|
200
|
+
name: string;
|
|
201
|
+
label: string;
|
|
202
|
+
options: AppSelectOptions[];
|
|
203
|
+
required?: boolean;
|
|
204
|
+
fullWidth?: boolean;
|
|
205
|
+
}
|
|
206
|
+
declare function AppSelectInput({ name, label, fullWidth, required, options, ...otherProps }: Props$1): React.JSX.Element;
|
|
207
|
+
|
|
208
|
+
interface AppSimpleUploadFilePropTypes {
|
|
209
|
+
name: string;
|
|
210
|
+
label?: string;
|
|
211
|
+
multiple?: boolean;
|
|
212
|
+
}
|
|
213
|
+
declare const AppSimpleUploadFile: ({ name, multiple }: AppSimpleUploadFilePropTypes) => React.JSX.Element;
|
|
214
|
+
|
|
215
|
+
interface FileItem extends File {
|
|
216
|
+
id?: number | string;
|
|
217
|
+
preview?: string;
|
|
218
|
+
url?: string;
|
|
219
|
+
is_private?: boolean;
|
|
220
|
+
[key: string]: unknown;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
interface CustomFile extends File {
|
|
224
|
+
path?: string;
|
|
225
|
+
preview?: string;
|
|
226
|
+
lastModifiedDate?: Date;
|
|
227
|
+
}
|
|
228
|
+
interface UploadProps extends DropzoneOptions {
|
|
229
|
+
error?: boolean;
|
|
230
|
+
sx?: SxProps<Theme>;
|
|
231
|
+
thumbnail?: boolean;
|
|
232
|
+
isClickable?: boolean;
|
|
233
|
+
placeholder?: React.ReactNode;
|
|
234
|
+
helperText?: React.ReactNode;
|
|
235
|
+
disableMultiple?: boolean;
|
|
236
|
+
isEditable?: boolean;
|
|
237
|
+
onDeleteButtonClick?: (file: FileItem) => void;
|
|
238
|
+
onPrivacyUpdateClick?: (file: FileItem) => void;
|
|
239
|
+
file?: CustomFile | string | File;
|
|
240
|
+
onDelete?: VoidFunction;
|
|
241
|
+
files?: (File | string | {
|
|
242
|
+
name: string;
|
|
243
|
+
url: string;
|
|
244
|
+
})[];
|
|
245
|
+
onUpload?: VoidFunction;
|
|
246
|
+
onRemove?: (file: CustomFile | string) => void;
|
|
247
|
+
onRemoveAll?: VoidFunction;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
interface AppUploadFilePropTypes extends UploadProps {
|
|
251
|
+
name: string;
|
|
252
|
+
label?: string;
|
|
253
|
+
}
|
|
254
|
+
declare const AppUploadFile: ({ name, ...rest }: AppUploadFilePropTypes) => react_jsx_runtime.JSX.Element;
|
|
255
|
+
|
|
256
|
+
interface SubmitButtonProps {
|
|
257
|
+
children: React__default.ReactNode;
|
|
258
|
+
loading?: boolean;
|
|
259
|
+
[key: string]: any;
|
|
260
|
+
}
|
|
261
|
+
declare const SubmitButton: ({ children, loading, disabled, ...rest }: SubmitButtonProps) => React__default.JSX.Element;
|
|
262
|
+
|
|
263
|
+
type IconifyProps = IconifyIcon | string;
|
|
264
|
+
|
|
265
|
+
interface Props extends BoxProps {
|
|
266
|
+
icon: IconifyProps;
|
|
267
|
+
}
|
|
268
|
+
declare const Iconify: React$1.ForwardRefExoticComponent<Omit<Props, "ref"> & React$1.RefAttributes<SVGElement>>;
|
|
269
|
+
|
|
270
|
+
export { AppAutoComplete, AppAutoCompleter, CheckboxField as AppCheckBox, AppDateAndTimePicker, AppDatePicker, AppFormErrorMessage, AppInputField, AppMultiSelector, AppPhoneNoInput, AppRadioGroup, AppRating, AppRichTextEditor, AppSearchableMultiSelector, AppSearchableSelectInput, AppSelectInput, AppSimpleUploadFile, AppSwitch, AppSwitchInput, AppTagsCreator, AppTextArea, AppUploadFile, Form, Iconify, IconifyProps, SubmitButton, UploadProps };
|