Skip to content

Commit 604594c

Browse files
committed
[ClickPipes] FileUpload component
Some adjustments Fix build Fix error propogation Update
1 parent e14839e commit 604594c

File tree

4 files changed

+543
-1
lines changed

4 files changed

+543
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,5 +121,6 @@
121121
"react": "^18.2.0",
122122
"react-dom": "^18.2.0",
123123
"styled-components": ">= 5"
124-
}
124+
},
125+
"packageManager": "[email protected]+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610"
125126
}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import { StoryFn } from "@storybook/react";
2+
import { FileUpload } from "@/components/FileUpload/FileUpload.tsx";
3+
4+
export default {
5+
component: FileUpload,
6+
title: "Forms/FileUpload",
7+
tags: ["file-upload", "autodocs"],
8+
decorators: [
9+
(Story: StoryFn) => (
10+
<div style={{ width: "800px" }}>
11+
<Story />
12+
</div>
13+
),
14+
],
15+
argTypes: {
16+
size: {
17+
options: ["sm", "md"],
18+
control: { type: "radio" },
19+
},
20+
supportedFileTypes: {
21+
control: "array",
22+
},
23+
progress: {
24+
control: { type: "range", min: 0, max: 100, step: 1 },
25+
},
26+
showProgress: {
27+
control: "boolean",
28+
},
29+
isSuccess: {
30+
control: "boolean",
31+
},
32+
failureMessage: {
33+
control: "text",
34+
},
35+
onFileSelect: { action: "file selected" },
36+
onRetry: { action: "retry requested" },
37+
},
38+
};
39+
40+
export const SmallSize = {
41+
args: {
42+
title: "Upload file",
43+
supportedFileTypes: [".txt", ".csv", ".json", ".sql"],
44+
size: "sm",
45+
progress: 0,
46+
showProgress: false,
47+
isSuccess: false,
48+
},
49+
parameters: {
50+
docs: {
51+
description: {
52+
story: "Shows the `FileUpload` component in small size variant",
53+
},
54+
},
55+
},
56+
};
57+
58+
export const MediumSize = {
59+
args: {
60+
title: "Upload file",
61+
supportedFileTypes: [".txt", ".csv", ".json", ".sql"],
62+
size: "md",
63+
},
64+
parameters: {
65+
docs: {
66+
description: {
67+
story: "Shows the `FileUpload` component in medium size variant",
68+
},
69+
},
70+
},
71+
};

0 commit comments

Comments
 (0)