Skip to content

Commit 53909aa

Browse files
committed
chore: add missing jsdoc for all component
1 parent f7af31b commit 53909aa

File tree

20 files changed

+134
-19
lines changed

20 files changed

+134
-19
lines changed

packages/shadcn/src/AddButton/AddButton.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
11
import { FormContextType, IconButtonProps, RJSFSchema, StrictRJSFSchema, TranslatableString } from '@rjsf/utils';
22
import { PlusCircle } from 'lucide-react';
3+
34
import { Button } from '../components/ui/button';
45

6+
/**
7+
* AddButton component for adding new items in a form
8+
* @template T - The type of data being handled
9+
* @template S - The JSON Schema type, extending StrictRJSFSchema
10+
* @template F - The form context type
11+
* @component
12+
* @param {IconButtonProps<T, S, F>} props - The component props
13+
* @param {Object} props.uiSchema - The UI schema configuration
14+
* @param {Object} props.registry - The registry object containing form utilities
15+
* @returns {JSX.Element} A button component with a plus icon
16+
*/
517
export default function AddButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({
618
uiSchema,
719
registry,

packages/shadcn/src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ import {
77
StrictRJSFSchema,
88
} from '@rjsf/utils';
99

10+
/** The `ArrayFieldItemTemplate` component is the template used to render an items of an array.
11+
*
12+
* @param props - The `ArrayFieldItemTemplateType` props for the component
13+
*/
1014
export default function ArrayFieldItemTemplate<
1115
T = any,
1216
S extends StrictRJSFSchema = RJSFSchema,

packages/shadcn/src/ArrayFieldTemplate/ArrayFieldTemplate.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ import {
99
StrictRJSFSchema,
1010
} from '@rjsf/utils';
1111

12+
/** The `ArrayFieldTemplate` component is the template used to render all items in an array.
13+
*
14+
* @param props - The `ArrayFieldItemTemplateType` props for the component
15+
*/
1216
export default function ArrayFieldTemplate<
1317
T = any,
1418
S extends StrictRJSFSchema = RJSFSchema,

packages/shadcn/src/BaseInputTemplate/BaseInputTemplate.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { ChangeEvent, FocusEvent } from 'react';
21
import {
32
ariaDescribedByIds,
43
BaseInputTemplateProps,
@@ -8,9 +7,17 @@ import {
87
RJSFSchema,
98
StrictRJSFSchema,
109
} from '@rjsf/utils';
11-
import { cn } from '../lib/utils';
10+
import { ChangeEvent, FocusEvent } from 'react';
11+
1212
import { Input } from '../components/ui/input';
13+
import { cn } from '../lib/utils';
1314

15+
/** The `BaseInputTemplate` is the template to use to render the basic `<input>` component for the `core` theme.
16+
* It is used as the template for rendering many of the <input> based widgets that differ by `type` and callbacks only.
17+
* It can be customized/overridden for other themes or individual implementations as needed.
18+
*
19+
* @param props - The `WidgetProps` for this template
20+
*/
1421
export default function BaseInputTemplate<
1522
T = any,
1623
S extends StrictRJSFSchema = RJSFSchema,

packages/shadcn/src/CheckboxWidget/CheckboxWidget.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
import {
22
ariaDescribedByIds,
33
descriptionId,
4+
FormContextType,
45
getTemplate,
56
labelValue,
6-
WidgetProps,
7+
RJSFSchema,
78
schemaRequiresTrueValue,
89
StrictRJSFSchema,
9-
RJSFSchema,
10-
FormContextType,
10+
WidgetProps,
1111
} from '@rjsf/utils';
1212
import { Checkbox } from '../components/ui/checkbox';
1313
import { Label } from '../components/ui/label';
1414

15+
/** The `CheckBoxWidget` is a widget for rendering boolean properties.
16+
* It is typically used to represent a boolean.
17+
*
18+
* @param props - The `WidgetProps` for this component
19+
*/
1520
export default function CheckboxWidget<
1621
T = any,
1722
S extends StrictRJSFSchema = RJSFSchema,

packages/shadcn/src/CheckboxesWidget/CheckboxesWidget.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
1-
import { FocusEvent } from 'react';
21
import {
32
ariaDescribedByIds,
43
enumOptionsDeselectValue,
54
enumOptionsIsSelected,
65
enumOptionsSelectValue,
76
enumOptionsValueForIndex,
8-
optionId,
97
FormContextType,
8+
optionId,
109
RJSFSchema,
1110
StrictRJSFSchema,
1211
WidgetProps,
1312
} from '@rjsf/utils';
13+
import { FocusEvent } from 'react';
14+
1415
import { Checkbox } from '../components/ui/checkbox';
15-
import { cn } from '../lib/utils';
1616
import { Label } from '../components/ui/label';
17+
import { cn } from '../lib/utils';
1718

19+
/** The `CheckboxesWidget` is a widget for rendering checkbox groups.
20+
* It is typically used to represent an array of enums.
21+
*
22+
* @param props - The `WidgetProps` for this component
23+
*/
1824
export default function CheckboxesWidget<
1925
T = any,
2026
S extends StrictRJSFSchema = RJSFSchema,

packages/shadcn/src/DescriptionField/DescriptionField.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import { DescriptionFieldProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
22

3+
/** The `DescriptionField` is the template to use to render the description of a field
4+
*
5+
* @param props - The `DescriptionFieldProps` for this component
6+
*/
37
export default function DescriptionField<
48
T = any,
59
S extends StrictRJSFSchema = RJSFSchema,

packages/shadcn/src/ErrorList/ErrorList.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
import { ErrorListProps, FormContextType, RJSFSchema, StrictRJSFSchema, TranslatableString } from '@rjsf/utils';
22
import { AlertCircle } from 'lucide-react';
3+
34
import { Alert, AlertDescription, AlertTitle } from '../components/ui/alert';
45

6+
/** The `ErrorList` component is the template that renders the all the errors associated with the fields in the `Form`
7+
*
8+
* @param props - The `ErrorListProps` for this component
9+
*/
510
export default function ErrorList<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({
611
errors,
712
registry,

packages/shadcn/src/FieldHelpTemplate/FieldHelpTemplate.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { FieldHelpProps, FormContextType, RJSFSchema, StrictRJSFSchema, helpId } from '@rjsf/utils';
2+
23
import { cn } from '../lib/utils';
34

45
/** The `FieldHelpTemplate` component renders any help desired for a field

packages/shadcn/src/FieldTemplate/FieldTemplate.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,14 @@ import {
66
RJSFSchema,
77
StrictRJSFSchema,
88
} from '@rjsf/utils';
9+
910
import { cn } from '../lib/utils';
1011

12+
/** The `FieldTemplate` component is the template used by `SchemaField` to render any field. It renders the field
13+
* content, (label, description, children, errors and help) inside of a `WrapIfAdditional` component.
14+
*
15+
* @param props - The `FieldTemplateProps` for this component
16+
*/
1117
export default function FieldTemplate<
1218
T = any,
1319
S extends StrictRJSFSchema = RJSFSchema,

0 commit comments

Comments
 (0)