@delightui/components 0.1.104 → 0.1.106
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/README.md +104 -1
- package/dist/cjs/components/molecules/Modal/DemoModal.d.ts +8 -0
- package/dist/cjs/components/molecules/Modal/ModalContext/ModalContext.d.ts +41 -0
- package/dist/cjs/components/molecules/Modal/ModalContext/ModalContext.types.d.ts +87 -0
- package/dist/cjs/components/molecules/Modal/ModalContext/index.d.ts +3 -0
- package/dist/cjs/components/molecules/Modal/ModalContext/useModal.d.ts +34 -0
- package/dist/cjs/components/molecules/Modal/index.d.ts +2 -0
- package/dist/cjs/components/molecules/Popover/Popover.presenter.d.ts +26 -0
- package/dist/cjs/components/molecules/Select/Option/Option.types.d.ts +6 -0
- package/dist/cjs/components/molecules/Select/Select.Context.d.ts +1 -1
- package/dist/cjs/components/molecules/Select/Select.d.ts +5 -5
- package/dist/cjs/components/molecules/Select/Select.presenter.d.ts +1 -0
- package/dist/cjs/components/molecules/Select/Select.types.d.ts +5 -0
- package/dist/cjs/components/molecules/Select/index.d.ts +2 -9
- package/dist/cjs/components/molecules/index.d.ts +2 -0
- package/dist/cjs/components/utils/accessibilityUtils.d.ts +41 -0
- package/dist/cjs/components/utils/index.d.ts +2 -0
- package/dist/cjs/library.css +13 -0
- package/dist/cjs/library.js +2 -2
- package/dist/cjs/library.js.map +1 -1
- package/dist/esm/components/molecules/Modal/DemoModal.d.ts +8 -0
- package/dist/esm/components/molecules/Modal/ModalContext/ModalContext.d.ts +41 -0
- package/dist/esm/components/molecules/Modal/ModalContext/ModalContext.types.d.ts +87 -0
- package/dist/esm/components/molecules/Modal/ModalContext/index.d.ts +3 -0
- package/dist/esm/components/molecules/Modal/ModalContext/useModal.d.ts +34 -0
- package/dist/esm/components/molecules/Modal/index.d.ts +2 -0
- package/dist/esm/components/molecules/Popover/Popover.presenter.d.ts +26 -0
- package/dist/esm/components/molecules/Select/Option/Option.types.d.ts +6 -0
- package/dist/esm/components/molecules/Select/Select.Context.d.ts +1 -1
- package/dist/esm/components/molecules/Select/Select.d.ts +5 -5
- package/dist/esm/components/molecules/Select/Select.presenter.d.ts +1 -0
- package/dist/esm/components/molecules/Select/Select.types.d.ts +5 -0
- package/dist/esm/components/molecules/Select/index.d.ts +2 -9
- package/dist/esm/components/molecules/index.d.ts +2 -0
- package/dist/esm/components/utils/accessibilityUtils.d.ts +41 -0
- package/dist/esm/components/utils/index.d.ts +2 -0
- package/dist/esm/library.css +13 -0
- package/dist/esm/library.js +3 -3
- package/dist/esm/library.js.map +1 -1
- package/dist/index.d.ts +156 -12
- package/docs/README.md +264 -0
- package/docs/components/atoms/ActionImage.md +119 -0
- package/docs/components/atoms/Button.md +197 -0
- package/docs/components/atoms/Checkbox.md +299 -0
- package/docs/components/atoms/CheckboxItem.md +314 -0
- package/docs/components/atoms/Chip.md +380 -0
- package/docs/components/atoms/CustomToggle.md +270 -0
- package/docs/components/atoms/Icon.md +365 -0
- package/docs/components/atoms/IconButton.md +407 -0
- package/docs/components/atoms/Image.md +448 -0
- package/docs/components/atoms/Input.md +430 -0
- package/docs/components/atoms/ListItem.md +502 -0
- package/docs/components/atoms/Password.md +472 -0
- package/docs/components/atoms/RadioButton.md +614 -0
- package/docs/components/atoms/RadioButtonItem.md +588 -0
- package/docs/components/atoms/ResponsiveComponent.md +612 -0
- package/docs/components/atoms/SelectListItem.md +609 -0
- package/docs/components/atoms/Slider.md +605 -0
- package/docs/components/atoms/Spinner.md +605 -0
- package/docs/components/atoms/Text.md +463 -0
- package/docs/components/atoms/TextArea.md +670 -0
- package/docs/components/atoms/ToastNotification.md +668 -0
- package/docs/components/atoms/Toggle.md +737 -0
- package/docs/components/atoms/ToggleButton.md +751 -0
- package/docs/components/atoms/Tooltip.md +391 -0
- package/docs/components/molecules/Accordion.md +440 -0
- package/docs/components/molecules/AccordionGroup.md +547 -0
- package/docs/components/molecules/ActionCard.md +546 -0
- package/docs/components/molecules/Breadcrumb.md +403 -0
- package/docs/components/molecules/Breadcrumbs.md +485 -0
- package/docs/components/molecules/ButtonGroup.md +383 -0
- package/docs/components/molecules/Card.md +298 -0
- package/docs/components/molecules/ChipInput.md +646 -0
- package/docs/components/molecules/ContextMenu.md +768 -0
- package/docs/components/molecules/CustomTimeSelector.md +116 -0
- package/docs/components/molecules/DatePicker.md +516 -0
- package/docs/components/molecules/DateTimeSelector.md +166 -0
- package/docs/components/molecules/FormField.md +312 -0
- package/docs/components/molecules/Grid.md +577 -0
- package/docs/components/molecules/GridItem.md +834 -0
- package/docs/components/molecules/GridList.md +244 -0
- package/docs/components/molecules/List.md +485 -0
- package/docs/components/molecules/Modal.md +470 -0
- package/docs/components/molecules/ModalFooter.md +702 -0
- package/docs/components/molecules/ModalHeader.md +756 -0
- package/docs/components/molecules/ModalProvider.md +205 -0
- package/docs/components/molecules/Nav.md +530 -0
- package/docs/components/molecules/NavItem.md +572 -0
- package/docs/components/molecules/NavLink.md +499 -0
- package/docs/components/molecules/Option.md +521 -0
- package/docs/components/molecules/Pagination.md +592 -0
- package/docs/components/molecules/PaginationNumberField.md +722 -0
- package/docs/components/molecules/Popover.md +516 -0
- package/docs/components/molecules/ProgressBar.md +624 -0
- package/docs/components/molecules/RadioGroup.md +831 -0
- package/docs/components/molecules/RepeaterList.md +185 -0
- package/docs/components/molecules/Select.md +402 -0
- package/docs/components/molecules/SortableTrigger.md +82 -0
- package/docs/components/molecules/useModal.md +379 -0
- package/docs/components/organisms/Dropzone.md +346 -0
- package/docs/components/organisms/DropzoneClear.md +135 -0
- package/docs/components/organisms/DropzoneContent.md +216 -0
- package/docs/components/organisms/DropzoneFilename.md +191 -0
- package/docs/components/organisms/DropzoneSupportedFormats.md +184 -0
- package/docs/components/organisms/DropzoneTrigger.md +209 -0
- package/docs/components/organisms/Form.md +533 -0
- package/docs/components/organisms/SlideOutPanel.md +662 -0
- package/docs/components/organisms/TabContent.md +902 -0
- package/docs/components/organisms/TabItem.md +1091 -0
- package/docs/components/organisms/Table.md +611 -0
- package/docs/components/organisms/TableBody.md +679 -0
- package/docs/components/organisms/TableCell.md +482 -0
- package/docs/components/organisms/TableHeader.md +513 -0
- package/docs/components/organisms/TableHeaderCell.md +661 -0
- package/docs/components/organisms/TableRow.md +715 -0
- package/docs/components/organisms/Tabs.md +1330 -0
- package/docs/components/utils/ConditionalView.md +568 -0
- package/docs/components/utils/RenderStateView.md +726 -0
- package/docs/components/utils/WrapTextNodes.md +614 -0
- package/package.json +3 -2
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
# DropzoneSupportedFormats
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
|
|
5
|
+
A text component that automatically displays the supported file formats for a dropzone. It reads the accepted file types from the Dropzone context and formats them into a readable list, helping users understand what file types they can upload.
|
|
6
|
+
|
|
7
|
+
## Aliases
|
|
8
|
+
|
|
9
|
+
- DropzoneSupportedFormats
|
|
10
|
+
- SupportedFormats
|
|
11
|
+
- AcceptedFileTypes
|
|
12
|
+
- FileFormatList
|
|
13
|
+
|
|
14
|
+
## Props Breakdown
|
|
15
|
+
|
|
16
|
+
**Extends:** `Text` component props
|
|
17
|
+
|
|
18
|
+
All `Text` component props are supported (type, size, weight, color, className, etc.).
|
|
19
|
+
|
|
20
|
+
## Examples
|
|
21
|
+
|
|
22
|
+
### Basic Usage
|
|
23
|
+
```tsx
|
|
24
|
+
import { Dropzone, DropzoneSupportedFormats, DropzoneContent } from '@delightui/components';
|
|
25
|
+
|
|
26
|
+
function BasicSupportedFormatsExample() {
|
|
27
|
+
return (
|
|
28
|
+
<Dropzone accept={{ 'image/*': ['.jpg', '.jpeg', '.png', '.gif'] }}>
|
|
29
|
+
<DropzoneContent>
|
|
30
|
+
<p>Upload your images</p>
|
|
31
|
+
<DropzoneSupportedFormats
|
|
32
|
+
type="Caption"
|
|
33
|
+
color="Secondary"
|
|
34
|
+
/>
|
|
35
|
+
</DropzoneContent>
|
|
36
|
+
</Dropzone>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Document Upload with Formats
|
|
42
|
+
```tsx
|
|
43
|
+
function DocumentUploadExample() {
|
|
44
|
+
const documentTypes = {
|
|
45
|
+
'application/pdf': ['.pdf'],
|
|
46
|
+
'application/msword': ['.doc'],
|
|
47
|
+
'application/vnd.openxmlformats-officedocument.wordprocessingml.document': ['.docx'],
|
|
48
|
+
'text/plain': ['.txt']
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<Dropzone accept={documentTypes}>
|
|
53
|
+
<DropzoneContent>
|
|
54
|
+
<div className="upload-area">
|
|
55
|
+
<h3>Upload Documents</h3>
|
|
56
|
+
<p>Drop your files here or click to browse</p>
|
|
57
|
+
|
|
58
|
+
<div className="format-info">
|
|
59
|
+
<DropzoneSupportedFormats
|
|
60
|
+
type="Body"
|
|
61
|
+
size="Small"
|
|
62
|
+
color="Secondary"
|
|
63
|
+
/>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
</DropzoneContent>
|
|
67
|
+
</Dropzone>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Multiple File Type Categories
|
|
73
|
+
```tsx
|
|
74
|
+
function MultipleTypesExample() {
|
|
75
|
+
const mediaTypes = {
|
|
76
|
+
'image/*': ['.jpg', '.jpeg', '.png', '.gif', '.webp'],
|
|
77
|
+
'video/*': ['.mp4', '.avi', '.mov', '.wmv'],
|
|
78
|
+
'audio/*': ['.mp3', '.wav', '.ogg', '.m4a']
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
return (
|
|
82
|
+
<Dropzone accept={mediaTypes} multiple>
|
|
83
|
+
<DropzoneContent>
|
|
84
|
+
<div className="media-upload">
|
|
85
|
+
<h3>Upload Media Files</h3>
|
|
86
|
+
<p>Images, videos, and audio files are supported</p>
|
|
87
|
+
|
|
88
|
+
<DropzoneSupportedFormats
|
|
89
|
+
type="Caption"
|
|
90
|
+
size="Small"
|
|
91
|
+
className="format-list"
|
|
92
|
+
/>
|
|
93
|
+
</div>
|
|
94
|
+
</DropzoneContent>
|
|
95
|
+
</Dropzone>
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Styled Format Display
|
|
101
|
+
```tsx
|
|
102
|
+
function StyledFormatExample() {
|
|
103
|
+
return (
|
|
104
|
+
<Dropzone accept={{ 'image/*': ['.jpg', '.png'], 'application/pdf': ['.pdf'] }}>
|
|
105
|
+
<DropzoneContent>
|
|
106
|
+
<div className="styled-upload">
|
|
107
|
+
<div className="upload-icon">📁</div>
|
|
108
|
+
<h4>Choose Files</h4>
|
|
109
|
+
|
|
110
|
+
<div className="format-display">
|
|
111
|
+
<DropzoneSupportedFormats
|
|
112
|
+
type="Body"
|
|
113
|
+
size="Small"
|
|
114
|
+
weight="Medium"
|
|
115
|
+
className="supported-formats"
|
|
116
|
+
style={{
|
|
117
|
+
padding: '8px 12px',
|
|
118
|
+
backgroundColor: '#f5f5f5',
|
|
119
|
+
borderRadius: '4px',
|
|
120
|
+
border: '1px solid #ddd'
|
|
121
|
+
}}
|
|
122
|
+
/>
|
|
123
|
+
</div>
|
|
124
|
+
</div>
|
|
125
|
+
</DropzoneContent>
|
|
126
|
+
</Dropzone>
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Conditional Format Display
|
|
132
|
+
```tsx
|
|
133
|
+
function ConditionalFormatExample() {
|
|
134
|
+
return (
|
|
135
|
+
<Dropzone accept={{ 'image/*': ['.jpg', '.png', '.gif'] }}>
|
|
136
|
+
<DropzoneContent>
|
|
137
|
+
{({ files, isDragActive }) => (
|
|
138
|
+
<div className="conditional-upload">
|
|
139
|
+
{isDragActive ? (
|
|
140
|
+
<p>Drop files here...</p>
|
|
141
|
+
) : files.length > 0 ? (
|
|
142
|
+
<div className="files-selected">
|
|
143
|
+
<p>{files.length} files selected</p>
|
|
144
|
+
</div>
|
|
145
|
+
) : (
|
|
146
|
+
<div className="upload-prompt">
|
|
147
|
+
<p>Drag & drop images here</p>
|
|
148
|
+
<DropzoneSupportedFormats
|
|
149
|
+
type="Caption"
|
|
150
|
+
color="Tertiary"
|
|
151
|
+
/>
|
|
152
|
+
</div>
|
|
153
|
+
)}
|
|
154
|
+
</div>
|
|
155
|
+
)}
|
|
156
|
+
</DropzoneContent>
|
|
157
|
+
</Dropzone>
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Help Text with Formats
|
|
163
|
+
```tsx
|
|
164
|
+
function HelpTextExample() {
|
|
165
|
+
return (
|
|
166
|
+
<Dropzone accept={{ 'application/pdf': ['.pdf'], 'image/*': ['.jpg', '.png'] }}>
|
|
167
|
+
<DropzoneContent>
|
|
168
|
+
<div className="help-upload">
|
|
169
|
+
<h3>Upload Resume</h3>
|
|
170
|
+
<p>Please upload your resume in PDF format or as an image</p>
|
|
171
|
+
|
|
172
|
+
<div className="help-info">
|
|
173
|
+
<Icon icon="Info" size="Small" />
|
|
174
|
+
<DropzoneSupportedFormats
|
|
175
|
+
type="Caption"
|
|
176
|
+
className="inline-formats"
|
|
177
|
+
/>
|
|
178
|
+
</div>
|
|
179
|
+
</div>
|
|
180
|
+
</DropzoneContent>
|
|
181
|
+
</Dropzone>
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
```
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
# DropzoneTrigger
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
|
|
5
|
+
A button component that triggers the file selection dialog for a dropzone. It integrates with the Dropzone context to provide a clickable interface for users to browse and select files, serving as an alternative or complement to drag-and-drop functionality.
|
|
6
|
+
|
|
7
|
+
## Aliases
|
|
8
|
+
|
|
9
|
+
- DropzoneTrigger
|
|
10
|
+
- FileSelectButton
|
|
11
|
+
- BrowseButton
|
|
12
|
+
- UploadTrigger
|
|
13
|
+
|
|
14
|
+
## Props Breakdown
|
|
15
|
+
|
|
16
|
+
**Extends:** `Button` component props
|
|
17
|
+
|
|
18
|
+
All `Button` component props are supported (size, style, type, appearance, disabled, etc.).
|
|
19
|
+
|
|
20
|
+
## Examples
|
|
21
|
+
|
|
22
|
+
### Basic Usage
|
|
23
|
+
```tsx
|
|
24
|
+
import { Dropzone, DropzoneTrigger, DropzoneContent } from '@delightui/components';
|
|
25
|
+
|
|
26
|
+
function BasicTriggerExample() {
|
|
27
|
+
return (
|
|
28
|
+
<Dropzone>
|
|
29
|
+
<DropzoneContent>
|
|
30
|
+
<p>Drag files here or</p>
|
|
31
|
+
<DropzoneTrigger>
|
|
32
|
+
Choose Files
|
|
33
|
+
</DropzoneTrigger>
|
|
34
|
+
</DropzoneContent>
|
|
35
|
+
</Dropzone>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Styled Upload Button
|
|
41
|
+
```tsx
|
|
42
|
+
function StyledTriggerExample() {
|
|
43
|
+
return (
|
|
44
|
+
<Dropzone accept={{ 'image/*': ['.jpg', '.png', '.gif'] }}>
|
|
45
|
+
<DropzoneContent>
|
|
46
|
+
<div className="upload-area">
|
|
47
|
+
<h3>Upload Images</h3>
|
|
48
|
+
<p>Select images from your device</p>
|
|
49
|
+
|
|
50
|
+
<DropzoneTrigger
|
|
51
|
+
size="Large"
|
|
52
|
+
style="Primary"
|
|
53
|
+
leadingIcon={<Icon icon="Upload" />}
|
|
54
|
+
>
|
|
55
|
+
Browse Images
|
|
56
|
+
</DropzoneTrigger>
|
|
57
|
+
</div>
|
|
58
|
+
</DropzoneContent>
|
|
59
|
+
</Dropzone>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Multiple Upload Options
|
|
65
|
+
```tsx
|
|
66
|
+
function MultipleOptionsExample() {
|
|
67
|
+
return (
|
|
68
|
+
<Dropzone multiple>
|
|
69
|
+
<DropzoneContent>
|
|
70
|
+
{({ files }) => (
|
|
71
|
+
<div className="upload-options">
|
|
72
|
+
<div className="drag-area">
|
|
73
|
+
<p>Drag & drop files here</p>
|
|
74
|
+
<span>or</span>
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
<div className="button-group">
|
|
78
|
+
<DropzoneTrigger
|
|
79
|
+
type="Outlined"
|
|
80
|
+
size="Medium"
|
|
81
|
+
>
|
|
82
|
+
Choose Files
|
|
83
|
+
</DropzoneTrigger>
|
|
84
|
+
|
|
85
|
+
{files.length > 0 && (
|
|
86
|
+
<Button
|
|
87
|
+
style="Primary"
|
|
88
|
+
size="Medium"
|
|
89
|
+
onClick={() => console.log('Upload files')}
|
|
90
|
+
>
|
|
91
|
+
Upload {files.length} Files
|
|
92
|
+
</Button>
|
|
93
|
+
)}
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
)}
|
|
97
|
+
</DropzoneContent>
|
|
98
|
+
</Dropzone>
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Document Upload Interface
|
|
104
|
+
```tsx
|
|
105
|
+
function DocumentUploadExample() {
|
|
106
|
+
return (
|
|
107
|
+
<Dropzone accept={{ 'application/pdf': ['.pdf'], 'application/msword': ['.doc', '.docx'] }}>
|
|
108
|
+
<DropzoneContent>
|
|
109
|
+
{({ files, isDragActive }) => (
|
|
110
|
+
<div className="document-upload">
|
|
111
|
+
{isDragActive ? (
|
|
112
|
+
<div className="drag-active">
|
|
113
|
+
<p>Drop documents here...</p>
|
|
114
|
+
</div>
|
|
115
|
+
) : files.length > 0 ? (
|
|
116
|
+
<div className="files-ready">
|
|
117
|
+
<p>{files.length} document(s) selected</p>
|
|
118
|
+
<DropzoneTrigger
|
|
119
|
+
type="Ghost"
|
|
120
|
+
size="Small"
|
|
121
|
+
>
|
|
122
|
+
Choose Different Files
|
|
123
|
+
</DropzoneTrigger>
|
|
124
|
+
</div>
|
|
125
|
+
) : (
|
|
126
|
+
<div className="upload-prompt">
|
|
127
|
+
<Icon icon="Document" size="Large" />
|
|
128
|
+
<h3>Upload Documents</h3>
|
|
129
|
+
<p>PDF and Word documents supported</p>
|
|
130
|
+
|
|
131
|
+
<DropzoneTrigger
|
|
132
|
+
size="Large"
|
|
133
|
+
style="Primary"
|
|
134
|
+
leadingIcon={<Icon icon="FolderOpen" />}
|
|
135
|
+
>
|
|
136
|
+
Select Documents
|
|
137
|
+
</DropzoneTrigger>
|
|
138
|
+
</div>
|
|
139
|
+
)}
|
|
140
|
+
</div>
|
|
141
|
+
)}
|
|
142
|
+
</DropzoneContent>
|
|
143
|
+
</Dropzone>
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Profile Picture Upload
|
|
149
|
+
```tsx
|
|
150
|
+
function ProfilePictureExample() {
|
|
151
|
+
return (
|
|
152
|
+
<Dropzone accept={{ 'image/*': ['.jpg', '.jpeg', '.png'] }}>
|
|
153
|
+
<DropzoneContent>
|
|
154
|
+
{({ files }) => (
|
|
155
|
+
<div className="profile-upload">
|
|
156
|
+
<div className="avatar-preview">
|
|
157
|
+
{files.length > 0 ? (
|
|
158
|
+
<img src={URL.createObjectURL(files[0])} alt="Preview" />
|
|
159
|
+
) : (
|
|
160
|
+
<div className="avatar-placeholder">
|
|
161
|
+
<Icon icon="Person" size="Large" />
|
|
162
|
+
</div>
|
|
163
|
+
)}
|
|
164
|
+
</div>
|
|
165
|
+
|
|
166
|
+
<div className="upload-controls">
|
|
167
|
+
<DropzoneTrigger
|
|
168
|
+
size="Medium"
|
|
169
|
+
type="Outlined"
|
|
170
|
+
leadingIcon={<Icon icon="Camera" />}
|
|
171
|
+
>
|
|
172
|
+
{files.length > 0 ? 'Change Photo' : 'Upload Photo'}
|
|
173
|
+
</DropzoneTrigger>
|
|
174
|
+
</div>
|
|
175
|
+
</div>
|
|
176
|
+
)}
|
|
177
|
+
</DropzoneContent>
|
|
178
|
+
</Dropzone>
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### Disabled State
|
|
184
|
+
```tsx
|
|
185
|
+
function DisabledTriggerExample() {
|
|
186
|
+
const [isUploading, setIsUploading] = useState(false);
|
|
187
|
+
|
|
188
|
+
return (
|
|
189
|
+
<Dropzone>
|
|
190
|
+
<DropzoneContent>
|
|
191
|
+
<div className="upload-with-status">
|
|
192
|
+
<p>Upload your files</p>
|
|
193
|
+
|
|
194
|
+
<DropzoneTrigger
|
|
195
|
+
disabled={isUploading}
|
|
196
|
+
leadingIcon={isUploading ? <Spinner size="Small" /> : <Icon icon="Upload" />}
|
|
197
|
+
>
|
|
198
|
+
{isUploading ? 'Uploading...' : 'Choose Files'}
|
|
199
|
+
</DropzoneTrigger>
|
|
200
|
+
|
|
201
|
+
{isUploading && (
|
|
202
|
+
<p className="upload-status">Please wait while files are being uploaded...</p>
|
|
203
|
+
)}
|
|
204
|
+
</div>
|
|
205
|
+
</DropzoneContent>
|
|
206
|
+
</Dropzone>
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
```
|