Skip to content

Commit 600a849

Browse files
committed
[FEAT]: Add types API page
1 parent d126df9 commit 600a849

17 files changed

+757
-389
lines changed

src/components/demo-components/dropzone-demo/CodeDemoDropzoneActionButtons.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import ShowDemoCode from "../../show-demo-code/ShowDemoCode";
2-
const CodeDemoDropzoneActionButtons = ({ splittedOnly = false, button }) => {
2+
const CodeDemoActionButtons = ({ splittedOnly = false, button }) => {
33
if (button)
44
return (
55
<ShowDemoCode
@@ -24,7 +24,7 @@ const CodeDemoDropzoneActionButtons = ({ splittedOnly = false, button }) => {
2424
/>
2525
);
2626
};
27-
export default CodeDemoDropzoneActionButtons;
27+
export default CodeDemoActionButtons;
2828

2929
const splittedCodeJSButton = `<FileInputButton
3030
onChange={updateFiles}

src/components/demo-components/dropzone-demo/DemoDropzoneActionButtons.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from "react";
22
import { Dropzone, FileCard, FileInputButton, FileMosaic } from "../../../files-ui";
33

4-
const DemoDropzoneActionButtons = ({ button }) => {
4+
const DemoActionButtons = ({ button }) => {
55
const [files, setFiles] = React.useState([]);
66
const updateFiles = (incommingFiles) => {
77
//do something with the files
@@ -83,4 +83,4 @@ const DemoDropzoneActionButtons = ({ button }) => {
8383
</Dropzone>
8484
);
8585
};
86-
export default DemoDropzoneActionButtons;
86+
export default DemoActionButtons;

src/components/show-demo-code/ShowDemoCode.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,11 @@ const ShowDemoCode: React.FC<ShowDemoCodeProps> = (
112112
console.log("code copied to clipboard: ");
113113
console.log(code_);
114114
}}
115-
style={{
115+
style={{
116116
margin: "20px 0",
117-
fontSize:"15px",
118-
lineHeight:"",
119-
}}
117+
fontSize: "15px",
118+
lineHeight: "",
119+
}}
120120
>
121121
{code}
122122
</Highlighter>
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
import TypeHighlight from "../components/typeHighlight/TypeHighlight";
2+
3+
export const ActionButtonItemAPIRows = [
4+
{
5+
name: "children",
6+
type: <TypeHighlight np>React.ReactNode</TypeHighlight>,
7+
default: <TypeHighlight np></TypeHighlight>,
8+
description: <>The content of the button.</>,
9+
},
10+
{
11+
name: "label",
12+
type: <TypeHighlight np>string</TypeHighlight>,
13+
default: <TypeHighlight np></TypeHighlight>,
14+
description: <>The label of the button.</>,
15+
},
16+
17+
{
18+
name: "style",
19+
type: <TypeHighlight np>React.CSSProperties</TypeHighlight>,
20+
default: <TypeHighlight np></TypeHighlight>,
21+
description: <>The in-line style object applied to the main container.</>,
22+
},
23+
{
24+
name: "className",
25+
type: <TypeHighlight np>string</TypeHighlight>,
26+
default: <TypeHighlight np></TypeHighlight>,
27+
description: (
28+
<>
29+
The classname to override the css styles in .css or .sass file instead
30+
of using in-line styles. Classname is applied to the main container.
31+
</>
32+
),
33+
},
34+
{
35+
name: "resetStyles",
36+
type: <TypeHighlight np>boolean</TypeHighlight>,
37+
default: <TypeHighlight np></TypeHighlight>,
38+
description: (
39+
<>
40+
If true, the given class name and style properties will replace the
41+
default ones instead of overriding them.
42+
</>
43+
),
44+
},
45+
{
46+
name: "onClick",
47+
type: <TypeHighlight np>func</TypeHighlight>,
48+
default: <TypeHighlight np></TypeHighlight>,
49+
description: (
50+
<>
51+
Callback fired when the button is clicked. If given, will replace the
52+
default behaviour.{" "}
53+
</>
54+
),
55+
},
56+
{
57+
name: "disabled",
58+
type: <TypeHighlight np>boolean</TypeHighlight>,
59+
default: <TypeHighlight np>false</TypeHighlight>,
60+
description: <>If true, the component is disabled.</>,
61+
},
62+
];

src/data/ActionButtonsAPIRows.tsx

Lines changed: 97 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,100 @@
11
import TypeHighlight from "../components/typeHighlight/TypeHighlight";
2+
import AnchorToTab from "../components/util-components/AnchorToTab";
23

3-
export const ActionButtonsAPIRows =[
4-
{
5-
name: "position",
6-
type: <>
7-
<TypeHighlight np>{'"before"'}</TypeHighlight>{" | "}
4+
export const ActionButtonsAPIRows = [
5+
{
6+
name: "position",
7+
type: (
8+
<>
9+
<TypeHighlight np>{'"before"'}</TypeHighlight>
10+
{" | "}
811
<TypeHighlight np>{'"after"'}</TypeHighlight>
9-
</>,
10-
default: <TypeHighlight np></TypeHighlight>,
11-
description: (
12-
<>
13-
The position of the action buttons. Before or after the component.
14-
</>
15-
),
16-
},
17-
{
18-
name: "style",
19-
type: <TypeHighlight np>React.CSSProperties</TypeHighlight>,
20-
default: <TypeHighlight np></TypeHighlight>,
21-
description: <>The in-line style object applied to the main container.</>,
22-
},
23-
{
24-
name: "className",
25-
type: <TypeHighlight np>string</TypeHighlight>,
26-
default: <TypeHighlight np></TypeHighlight>,
27-
description: (
28-
<>
29-
The classname to override the css styles in .css or .sass file instead
30-
of using in-line styles. Classname is applied to the main container.
31-
</>
32-
),
33-
},
34-
{
35-
name: "uploadingMessage",
36-
type: <TypeHighlight np>{"string"}</TypeHighlight>,
37-
default: <TypeHighlight np></TypeHighlight>,
38-
description: (
39-
<>
40-
A message to show in the footer when the uploading process takes place.
41-
</>
42-
),
43-
},
44-
]
12+
</>
13+
),
14+
default: <TypeHighlight np></TypeHighlight>,
15+
description: (
16+
<>The position of the action buttons. Before or after the component.</>
17+
),
18+
},
19+
{
20+
name: "style",
21+
type: <TypeHighlight np>React.CSSProperties</TypeHighlight>,
22+
default: <TypeHighlight np></TypeHighlight>,
23+
description: <>The in-line style object applied to the main container.</>,
24+
},
25+
{
26+
name: "className",
27+
type: <TypeHighlight np>string</TypeHighlight>,
28+
default: <TypeHighlight np></TypeHighlight>,
29+
description: (
30+
<>
31+
The classname to override the css styles in .css or .sass file instead
32+
of using in-line styles. Classname is applied to the main container.
33+
</>
34+
),
35+
},
36+
{
37+
name: "uploadButton",
38+
type: (
39+
<TypeHighlight np>
40+
<AnchorToTab href="/types#actionbuttonitem">{"ActionButtonItem"}</AnchorToTab>
41+
</TypeHighlight>
42+
),
43+
default: <TypeHighlight np></TypeHighlight>,
44+
description: (
45+
<>
46+
If set, the upload button will be shown. Specific props applied to the upload button.
47+
Type definition can be found{" "}
48+
<AnchorToTab href="/types#actionbuttonitem">{"here"}</AnchorToTab>.
49+
</>
50+
),
51+
},
52+
{
53+
name: "abortButton",
54+
type: (
55+
<TypeHighlight np>
56+
<AnchorToTab href="/types#actionbuttonitem">{"ActionButtonItem"}</AnchorToTab>
57+
</TypeHighlight>
58+
),
59+
default: <TypeHighlight np></TypeHighlight>,
60+
description: (
61+
<>
62+
If set, the abort button will be shown. Specific props applied to the abort button.
63+
Type definition can be found{" "}
64+
<AnchorToTab href="/types#actionbuttonitem">{"here"}</AnchorToTab>.
65+
</>
66+
),
67+
},
68+
{
69+
name: "deleteButton",
70+
type: (
71+
<TypeHighlight np>
72+
<AnchorToTab href="/types#actionbuttonitem">{"ActionButtonItem"}</AnchorToTab>
73+
</TypeHighlight>
74+
),
75+
default: <TypeHighlight np></TypeHighlight>,
76+
description: (
77+
<>
78+
If set, the delete button will be shown. Specific props applied to the delete button.
79+
Type definition can be found{" "}
80+
<AnchorToTab href="/types#actionbuttonitem">{"here"}</AnchorToTab>.
81+
</>
82+
),
83+
},
84+
{
85+
name: "cleanButton",
86+
type: (
87+
<TypeHighlight np>
88+
<AnchorToTab href="/types#actionbuttonitem">{"ActionButtonItem"}</AnchorToTab>
89+
</TypeHighlight>
90+
),
91+
default: <TypeHighlight np></TypeHighlight>,
92+
description: (
93+
<>
94+
If set, the clean button will be shown. Specific props applied to the clean button.
95+
Type definition can be found{" "}
96+
<AnchorToTab href="/types#actionbuttonitem">{"here"}</AnchorToTab>.
97+
</>
98+
),
99+
},
100+
];

src/data/DropzoneAPIPropsRows.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export const DropzoneAPIPropsRows = [
7676
<br />
7777
<CodeHighlight>
7878
{"(f: File) => "}{" "}
79-
<AnchorToTab href="/api/types#validatefileresponse">
79+
<AnchorToTab href="/types#validatefileresponse">
8080
ValidateFileResponse
8181
</AnchorToTab>
8282
</CodeHighlight>
@@ -123,7 +123,7 @@ export const DropzoneAPIPropsRows = [
123123
name: "uploadConfig",
124124
type: (
125125
<TypeHighlight np>
126-
<AnchorToTab href="/api/types#uploadconfig">UploadConfig</AnchorToTab>
126+
<AnchorToTab href="/types#uploadconfig">UploadConfig</AnchorToTab>
127127
</TypeHighlight>
128128
),
129129
default: <TypeHighlight np></TypeHighlight>,
@@ -311,9 +311,7 @@ export const DropzoneAPIPropsRows = [
311311
name: "actionButtons",
312312
type: (
313313
<TypeHighlight np>
314-
<AnchorToTab href="/api/types#actionbuttons">
315-
ActionButtons
316-
</AnchorToTab>
314+
<AnchorToTab href="/types#actionbuttons">ActionButtons</AnchorToTab>
317315
</TypeHighlight>
318316
),
319317
default: <TypeHighlight np></TypeHighlight>,
@@ -353,7 +351,7 @@ export const DropzoneAPIPropsRows = [
353351
name: "headerConfig",
354352
type: (
355353
<TypeHighlight np>
356-
<AnchorToTab href="/api/types#headerconfig">HeaderConfig</AnchorToTab>
354+
<AnchorToTab href="/types#headerconfig">HeaderConfig</AnchorToTab>
357355
</TypeHighlight>
358356
),
359357
default: <TypeHighlight np></TypeHighlight>,
@@ -363,7 +361,7 @@ export const DropzoneAPIPropsRows = [
363361
name: "footerConfig",
364362
type: (
365363
<TypeHighlight np>
366-
<AnchorToTab href="/api/types#footerconfig">FooterConfig</AnchorToTab>
364+
<AnchorToTab href="/types#footerconfig">FooterConfig</AnchorToTab>
367365
</TypeHighlight>
368366
),
369367
default: <TypeHighlight np></TypeHighlight>,

src/data/ExtFileAPIRows.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export const ExtFileAPIRows = [
6565
name: "uploadStatus",
6666
type: (
6767
<TypeHighlight np>
68-
<AnchorToTab href="/api/dropzone#uploadstatus">
68+
<AnchorToTab href="/types#uploadstatus">
6969
{"UPLOADSTATUS"}
7070
</AnchorToTab>
7171
</TypeHighlight>

0 commit comments

Comments
 (0)