Skip to content

Commit 8936d1c

Browse files
Add chromatic stories to RSP DropZone (#5053)
* Add chromatic to RSP DropZone * add chromatic stories --------- Co-authored-by: Robert Snow <rsnow@adobe.com>
1 parent 639548c commit 8936d1c

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/*
2+
* Copyright 2023 Adobe. All rights reserved.
3+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License. You may obtain a copy
5+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
6+
*
7+
* Unless required by applicable law or agreed to in writing, software distributed under
8+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9+
* OF ANY KIND, either express or implied. See the License for the specific language
10+
* governing permissions and limitations under the License.
11+
*/
12+
13+
import {Button} from '@react-spectrum/button';
14+
import {DropZone, SpectrumDropZoneProps} from '../';
15+
import {FileTrigger, Text} from 'react-aria-components';
16+
import {Heading} from '@react-spectrum/text';
17+
import {IllustratedMessage} from '@react-spectrum/illustratedmessage';
18+
import {Meta} from '@storybook/react';
19+
import React from 'react';
20+
import Upload from '@spectrum-icons/illustrations/Upload';
21+
22+
const meta: Meta<SpectrumDropZoneProps> = {
23+
title: 'DropZone',
24+
component: DropZone
25+
};
26+
27+
export default meta;
28+
29+
export const Default = {
30+
args: {
31+
children: (
32+
<>
33+
<IllustratedMessage>
34+
<Upload />
35+
<Heading>
36+
<Text slot="label">
37+
Drag and drop here
38+
</Text>
39+
</Heading>
40+
</IllustratedMessage>
41+
</>
42+
)
43+
}
44+
};
45+
46+
export const WithFileTrigger = {
47+
args: {
48+
children: (
49+
<>
50+
<IllustratedMessage>
51+
<Upload />
52+
<Heading>
53+
<Text slot="label">
54+
Drag and drop here
55+
</Text>
56+
</Heading>
57+
<FileTrigger>
58+
<Button variant="primary">Select a file</Button>
59+
</FileTrigger>
60+
</IllustratedMessage>
61+
</>
62+
)
63+
}
64+
};

0 commit comments

Comments
 (0)