@solibo/solibo-ui 0.2.18 → 0.3.0
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/dist/assets/index.css +1 -1
- package/dist/assets/index10.css +1 -1
- package/dist/assets/index11.css +1 -1
- package/dist/assets/index12.css +1 -1
- package/dist/assets/index13.css +1 -1
- package/dist/assets/index14.css +1 -1
- package/dist/assets/index15.css +1 -1
- package/dist/assets/index16.css +1 -1
- package/dist/assets/index17.css +1 -1
- package/dist/assets/index18.css +1 -1
- package/dist/assets/index19.css +1 -1
- package/dist/assets/index20.css +1 -1
- package/dist/assets/index21.css +1 -1
- package/dist/assets/index22.css +1 -1
- package/dist/assets/index23.css +1 -1
- package/dist/assets/index25.css +1 -0
- package/dist/assets/index26.css +1 -0
- package/dist/assets/index3.css +1 -1
- package/dist/assets/index4.css +1 -1
- package/dist/assets/index5.css +1 -1
- package/dist/assets/index6.css +1 -1
- package/dist/assets/index7.css +1 -1
- package/dist/assets/index8.css +1 -1
- package/dist/components/_card/index.cjs +2 -0
- package/dist/components/_card/index.cjs.map +1 -0
- package/dist/components/_card/index.js +19 -0
- package/dist/components/_card/index.js.map +1 -0
- package/dist/components/_dropzone/index.cjs +2 -0
- package/dist/components/_dropzone/index.cjs.map +1 -0
- package/dist/components/_dropzone/index.js +28 -0
- package/dist/components/_dropzone/index.js.map +1 -0
- package/dist/components/{editor → _editor}/index.cjs +2 -2
- package/dist/components/_editor/index.cjs.map +1 -0
- package/dist/components/{editor → _editor}/index.js +56 -112
- package/dist/components/_editor/index.js.map +1 -0
- package/dist/components/_portal/index.cjs +2 -0
- package/dist/components/_portal/index.cjs.map +1 -0
- package/dist/components/_portal/index.js +19 -0
- package/dist/components/_portal/index.js.map +1 -0
- package/dist/components/accordion/index.cjs +1 -1
- package/dist/components/accordion/index.cjs.map +1 -1
- package/dist/components/accordion/index.js +17 -24
- package/dist/components/accordion/index.js.map +1 -1
- package/dist/components/aside/index.cjs +1 -1
- package/dist/components/aside/index.cjs.map +1 -1
- package/dist/components/aside/index.js +13 -21
- package/dist/components/aside/index.js.map +1 -1
- package/dist/components/banner/index.cjs +1 -1
- package/dist/components/banner/index.cjs.map +1 -1
- package/dist/components/banner/index.js +14 -8
- package/dist/components/banner/index.js.map +1 -1
- package/dist/components/branding/index.cjs +1 -1
- package/dist/components/branding/index.cjs.map +1 -1
- package/dist/components/branding/index.js +21 -25
- package/dist/components/branding/index.js.map +1 -1
- package/dist/components/button/index.cjs +1 -1
- package/dist/components/button/index.cjs.map +1 -1
- package/dist/components/button/index.js +16 -26
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/checkbox/index.cjs +1 -1
- package/dist/components/checkbox/index.cjs.map +1 -1
- package/dist/components/checkbox/index.js +5 -15
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/dialog/index.cjs +1 -1
- package/dist/components/dialog/index.cjs.map +1 -1
- package/dist/components/dialog/index.js +9 -13
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/figure/index.cjs +1 -1
- package/dist/components/figure/index.cjs.map +1 -1
- package/dist/components/figure/index.js +18 -6
- package/dist/components/figure/index.js.map +1 -1
- package/dist/components/file/index.cjs +1 -1
- package/dist/components/file/index.cjs.map +1 -1
- package/dist/components/file/index.js +11 -23
- package/dist/components/file/index.js.map +1 -1
- package/dist/components/form/index.cjs +1 -1
- package/dist/components/form/index.cjs.map +1 -1
- package/dist/components/form/index.js +11 -13
- package/dist/components/form/index.js.map +1 -1
- package/dist/components/group/index.cjs +2 -0
- package/dist/components/group/index.cjs.map +1 -0
- package/dist/components/group/index.js +13 -0
- package/dist/components/group/index.js.map +1 -0
- package/dist/components/header/index.cjs +1 -1
- package/dist/components/header/index.cjs.map +1 -1
- package/dist/components/header/index.js +7 -13
- package/dist/components/header/index.js.map +1 -1
- package/dist/components/icon/index.cjs +1 -1
- package/dist/components/icon/index.cjs.map +1 -1
- package/dist/components/icon/index.js +29 -54
- package/dist/components/icon/index.js.map +1 -1
- package/dist/components/input/index.cjs +1 -1
- package/dist/components/input/index.cjs.map +1 -1
- package/dist/components/input/index.js +12 -17
- package/dist/components/input/index.js.map +1 -1
- package/dist/components/layout/index.cjs +1 -1
- package/dist/components/layout/index.cjs.map +1 -1
- package/dist/components/layout/index.js +10 -13
- package/dist/components/layout/index.js.map +1 -1
- package/dist/components/link/index.cjs +1 -1
- package/dist/components/link/index.cjs.map +1 -1
- package/dist/components/link/index.js +14 -13
- package/dist/components/link/index.js.map +1 -1
- package/dist/components/list/index.cjs +1 -1
- package/dist/components/list/index.cjs.map +1 -1
- package/dist/components/list/index.js +8 -5
- package/dist/components/list/index.js.map +1 -1
- package/dist/components/nav/index.cjs +1 -1
- package/dist/components/nav/index.cjs.map +1 -1
- package/dist/components/nav/index.js +18 -93
- package/dist/components/nav/index.js.map +1 -1
- package/dist/components/select/index.cjs +2 -0
- package/dist/components/select/index.cjs.map +1 -0
- package/dist/components/select/index.js +26 -0
- package/dist/components/select/index.js.map +1 -0
- package/dist/components/sortable/index.cjs +2 -0
- package/dist/components/sortable/index.cjs.map +1 -0
- package/dist/components/sortable/index.js +35 -0
- package/dist/components/sortable/index.js.map +1 -0
- package/dist/components/toggle/index.cjs +1 -1
- package/dist/components/toggle/index.cjs.map +1 -1
- package/dist/components/toggle/index.js +13 -22
- package/dist/components/toggle/index.js.map +1 -1
- package/dist/icons-BhMCiRwT.cjs +2 -0
- package/dist/icons-BhMCiRwT.cjs.map +1 -0
- package/dist/icons-uK6EFyq8.js +32 -0
- package/dist/icons-uK6EFyq8.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +53 -47
- package/dist/index.js +48 -45
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/card/index.cjs +0 -2
- package/dist/components/card/index.cjs.map +0 -1
- package/dist/components/card/index.js +0 -20
- package/dist/components/card/index.js.map +0 -1
- package/dist/components/dropdown/index.cjs +0 -2
- package/dist/components/dropdown/index.cjs.map +0 -1
- package/dist/components/dropdown/index.js +0 -34
- package/dist/components/dropdown/index.js.map +0 -1
- package/dist/components/dropzone/index.cjs +0 -2
- package/dist/components/dropzone/index.cjs.map +0 -1
- package/dist/components/dropzone/index.js +0 -63
- package/dist/components/dropzone/index.js.map +0 -1
- package/dist/components/editor/index.cjs.map +0 -1
- package/dist/components/editor/index.js.map +0 -1
- package/dist/components/footer/index.cjs +0 -2
- package/dist/components/footer/index.cjs.map +0 -1
- package/dist/components/footer/index.js +0 -15
- package/dist/components/footer/index.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { default as default_2 } from 'react';
|
|
1
2
|
import { DetailedHTMLProps } from 'react';
|
|
2
3
|
import { ForwardRefExoticComponent } from 'react';
|
|
3
4
|
import { InputHTMLAttributes } from 'react';
|
|
@@ -6,14 +7,6 @@ import { RefAttributes } from 'react';
|
|
|
6
7
|
|
|
7
8
|
export declare const Accordion: ({ children, icon, label, open }: AccordionProps) => JSX.Element;
|
|
8
9
|
|
|
9
|
-
export declare function AccordionGroup({ animation, children, className }: AccordionGroupProps): JSX.Element;
|
|
10
|
-
|
|
11
|
-
declare type AccordionGroupProps = {
|
|
12
|
-
animation?: AnimationName;
|
|
13
|
-
children: React.ReactNode;
|
|
14
|
-
className?: string;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
10
|
declare type AccordionProps = {
|
|
18
11
|
children: React.ReactNode;
|
|
19
12
|
icon?: IconName;
|
|
@@ -27,7 +20,7 @@ export declare const Aside: ({ children, className, sticky, variant }: AsideProp
|
|
|
27
20
|
|
|
28
21
|
declare type AsideProps = {
|
|
29
22
|
className?: string;
|
|
30
|
-
children
|
|
23
|
+
children: React.ReactNode;
|
|
31
24
|
open?: boolean;
|
|
32
25
|
sticky?: boolean;
|
|
33
26
|
variant?: keyof typeof variants;
|
|
@@ -90,25 +83,13 @@ declare type DialogProps = React.DialogHTMLAttributes<HTMLDialogElement> & {
|
|
|
90
83
|
children: React.ReactNode;
|
|
91
84
|
};
|
|
92
85
|
|
|
93
|
-
export declare const
|
|
94
|
-
|
|
95
|
-
declare type DropdownProps = React.SelectHTMLAttributes<HTMLSelectElement> & {
|
|
96
|
-
children?: React.ReactNode;
|
|
97
|
-
inline?: boolean;
|
|
98
|
-
label?: string;
|
|
99
|
-
placeholder?: string;
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
export declare const Dropzone: (props: DropzoneProps) => JSX.Element;
|
|
86
|
+
export declare const Dropzone: ({ accepts, label, multiple, onChange, ...props }: DropzoneProps) => JSX.Element;
|
|
103
87
|
|
|
104
88
|
declare type DropzoneProps = {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
maxFileSizeMB?: number;
|
|
110
|
-
mimeTypes?: string[];
|
|
111
|
-
onUpload: (uploadContent: File[] | FileList) => void;
|
|
89
|
+
accepts?: string;
|
|
90
|
+
label: string;
|
|
91
|
+
multiple?: boolean;
|
|
92
|
+
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
112
93
|
};
|
|
113
94
|
|
|
114
95
|
export declare const Editor: ({ autofocus, autolink, content, inline, onChange, }: EditorProps) => JSX.Element;
|
|
@@ -121,11 +102,12 @@ declare type EditorProps = {
|
|
|
121
102
|
onChange?: (html: string) => void;
|
|
122
103
|
};
|
|
123
104
|
|
|
124
|
-
export declare const Figure: ({ children, label }: FigureProps) => JSX.Element;
|
|
105
|
+
export declare const Figure: ({ children, label, offset }: FigureProps) => JSX.Element;
|
|
125
106
|
|
|
126
107
|
declare type FigureProps = {
|
|
127
108
|
children?: React.ReactNode;
|
|
128
109
|
label?: string;
|
|
110
|
+
offset?: 'left' | 'right';
|
|
129
111
|
};
|
|
130
112
|
|
|
131
113
|
declare const File_2: ({ name, url }: FileProps) => JSX.Element;
|
|
@@ -136,12 +118,6 @@ declare type FileProps = {
|
|
|
136
118
|
url: string;
|
|
137
119
|
};
|
|
138
120
|
|
|
139
|
-
export declare const Footer: ({ children, ...props }: FooterProps) => JSX.Element;
|
|
140
|
-
|
|
141
|
-
declare type FooterProps = {
|
|
142
|
-
children?: React.ReactNode;
|
|
143
|
-
};
|
|
144
|
-
|
|
145
121
|
export declare const Form: ({ animation, children, inline, ...props }: FormProps) => JSX.Element;
|
|
146
122
|
|
|
147
123
|
declare type FormProps = React.FormHTMLAttributes<HTMLFormElement> & {
|
|
@@ -150,14 +126,18 @@ declare type FormProps = React.FormHTMLAttributes<HTMLFormElement> & {
|
|
|
150
126
|
inline?: boolean;
|
|
151
127
|
};
|
|
152
128
|
|
|
153
|
-
export declare const
|
|
129
|
+
export declare const Group: ({ animation, children, className }: GroupProps) => JSX.Element;
|
|
130
|
+
|
|
131
|
+
declare type GroupProps = {
|
|
132
|
+
animation?: AnimationName;
|
|
133
|
+
children: React.ReactNode;
|
|
134
|
+
className?: string;
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
export declare const Header: ({ children }: HeaderProps) => JSX.Element;
|
|
154
138
|
|
|
155
139
|
declare type HeaderProps = {
|
|
156
|
-
children
|
|
157
|
-
label?: string;
|
|
158
|
-
size?: 1 | 2 | 3;
|
|
159
|
-
superHeader?: string;
|
|
160
|
-
subHeader?: string;
|
|
140
|
+
children: React.ReactNode;
|
|
161
141
|
};
|
|
162
142
|
|
|
163
143
|
export declare const Icon: ({ name, size, variant }: IconProps) => JSX.Element;
|
|
@@ -173,6 +153,7 @@ declare const iconPaths: {
|
|
|
173
153
|
gear: string;
|
|
174
154
|
document: string;
|
|
175
155
|
home: string;
|
|
156
|
+
image: string;
|
|
176
157
|
italic: string;
|
|
177
158
|
link: string;
|
|
178
159
|
list: string;
|
|
@@ -181,7 +162,6 @@ declare const iconPaths: {
|
|
|
181
162
|
phone: string;
|
|
182
163
|
plus: string;
|
|
183
164
|
search: string;
|
|
184
|
-
toDocument: string;
|
|
185
165
|
upload: string;
|
|
186
166
|
user: string;
|
|
187
167
|
x: string;
|
|
@@ -213,7 +193,7 @@ export declare const Link: ({ children, className, to, label, ...props }: LinkPr
|
|
|
213
193
|
declare type LinkProps = React.AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
214
194
|
children?: React.ReactNode;
|
|
215
195
|
className?: string;
|
|
216
|
-
label
|
|
196
|
+
label: string;
|
|
217
197
|
to?: string;
|
|
218
198
|
};
|
|
219
199
|
|
|
@@ -224,24 +204,52 @@ declare type ListProps = {
|
|
|
224
204
|
className?: string;
|
|
225
205
|
};
|
|
226
206
|
|
|
227
|
-
export declare const Nav: ({ animation, children, horizontal, variant
|
|
207
|
+
export declare const Nav: ({ animation, children, horizontal, variant }: NavProps) => JSX.Element;
|
|
228
208
|
|
|
229
209
|
declare type NavProps = {
|
|
230
210
|
animation?: AnimationName;
|
|
231
211
|
children?: React.ReactNode;
|
|
232
212
|
horizontal?: boolean;
|
|
233
|
-
isResultsPage?: boolean;
|
|
234
|
-
isSearchable?: boolean;
|
|
235
|
-
onSearchSubmit?: (value: string) => void;
|
|
236
213
|
variant?: keyof typeof variants_5;
|
|
237
214
|
};
|
|
238
215
|
|
|
216
|
+
export declare const Portal: ({ children, portals }: PortalProps) => JSX.Element;
|
|
217
|
+
|
|
218
|
+
declare type PortalProps = {
|
|
219
|
+
children?: React.ReactNode;
|
|
220
|
+
portals?: React.ReactNode;
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
export declare const Select: ({ children, inline, label, placeholder, ...props }: SelectProps) => JSX.Element;
|
|
224
|
+
|
|
225
|
+
declare type SelectProps = React.SelectHTMLAttributes<HTMLSelectElement> & {
|
|
226
|
+
children: React.ReactNode;
|
|
227
|
+
inline?: boolean;
|
|
228
|
+
label?: string;
|
|
229
|
+
placeholder?: string;
|
|
230
|
+
};
|
|
231
|
+
|
|
239
232
|
declare const sizes: {
|
|
240
233
|
large: string;
|
|
241
234
|
medium: string;
|
|
242
235
|
small: string;
|
|
243
236
|
};
|
|
244
237
|
|
|
238
|
+
/**
|
|
239
|
+
* Children must provide a stable `data-id` for emits `{ id, weight }` and `key` (reconciliation).
|
|
240
|
+
*/
|
|
241
|
+
export declare function Sortable({ children, onChangeOrder }: SortableProps): JSX.Element;
|
|
242
|
+
|
|
243
|
+
declare type SortableProps = {
|
|
244
|
+
children?: default_2.ReactNode;
|
|
245
|
+
onChangeOrder?: (order: SortItem[]) => void;
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
declare type SortItem = {
|
|
249
|
+
id: string;
|
|
250
|
+
weight: number;
|
|
251
|
+
};
|
|
252
|
+
|
|
245
253
|
export declare const Toggle: ({ checked, disabled, isLoading, label, onChange }: ToggleProps) => JSX.Element;
|
|
246
254
|
|
|
247
255
|
declare type ToggleProps = {
|
|
@@ -254,13 +262,11 @@ declare type ToggleProps = {
|
|
|
254
262
|
|
|
255
263
|
declare const variants: {
|
|
256
264
|
default: string;
|
|
257
|
-
nav: string;
|
|
258
265
|
meta: string;
|
|
259
266
|
};
|
|
260
267
|
|
|
261
268
|
declare const variants_2: {
|
|
262
269
|
default: string;
|
|
263
|
-
gradient: string;
|
|
264
270
|
white: string;
|
|
265
271
|
};
|
|
266
272
|
|
package/dist/index.js
CHANGED
|
@@ -1,50 +1,53 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { Card as e } from "./components/_card/index.js";
|
|
2
|
+
import { Dropzone as p } from "./components/_dropzone/index.js";
|
|
3
|
+
import { Editor as x } from "./components/_editor/index.js";
|
|
4
|
+
import { Portal as n } from "./components/_portal/index.js";
|
|
5
|
+
import { Accordion as i } from "./components/accordion/index.js";
|
|
6
|
+
import { Aside as l } from "./components/aside/index.js";
|
|
7
|
+
import { Banner as g } from "./components/banner/index.js";
|
|
8
|
+
import { Branding as B } from "./components/branding/index.js";
|
|
9
|
+
import { Button as L } from "./components/button/index.js";
|
|
10
|
+
import { Checkbox as k } from "./components/checkbox/index.js";
|
|
8
11
|
import { Dialog as A } from "./components/dialog/index.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import { Toggle as V } from "./components/toggle/index.js";
|
|
12
|
+
import { Figure as D } from "./components/figure/index.js";
|
|
13
|
+
import { File as S } from "./components/file/index.js";
|
|
14
|
+
import { Form as v } from "./components/form/index.js";
|
|
15
|
+
import { Group as z } from "./components/group/index.js";
|
|
16
|
+
import { Header as G } from "./components/header/index.js";
|
|
17
|
+
import { Icon as N } from "./components/icon/index.js";
|
|
18
|
+
import { Input as T } from "./components/input/index.js";
|
|
19
|
+
import { Layout as q } from "./components/layout/index.js";
|
|
20
|
+
import { Link as J } from "./components/link/index.js";
|
|
21
|
+
import { List as M } from "./components/list/index.js";
|
|
22
|
+
import { Nav as Q } from "./components/nav/index.js";
|
|
23
|
+
import { Select as U } from "./components/select/index.js";
|
|
24
|
+
import { Sortable as W } from "./components/sortable/index.js";
|
|
25
|
+
import { Toggle as Y } from "./components/toggle/index.js";
|
|
24
26
|
import './assets/index.css';export {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
F as Checkbox,
|
|
27
|
+
i as Accordion,
|
|
28
|
+
l as Aside,
|
|
29
|
+
g as Banner,
|
|
30
|
+
B as Branding,
|
|
31
|
+
L as Button,
|
|
32
|
+
e as Card,
|
|
33
|
+
k as Checkbox,
|
|
33
34
|
A as Dialog,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
v as
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
T as
|
|
43
|
-
q as
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
Q as
|
|
47
|
-
|
|
48
|
-
|
|
35
|
+
p as Dropzone,
|
|
36
|
+
x as Editor,
|
|
37
|
+
D as Figure,
|
|
38
|
+
S as File,
|
|
39
|
+
v as Form,
|
|
40
|
+
z as Group,
|
|
41
|
+
G as Header,
|
|
42
|
+
N as Icon,
|
|
43
|
+
T as Input,
|
|
44
|
+
q as Layout,
|
|
45
|
+
J as Link,
|
|
46
|
+
M as List,
|
|
47
|
+
Q as Nav,
|
|
48
|
+
n as Portal,
|
|
49
|
+
U as Select,
|
|
50
|
+
W as Sortable,
|
|
51
|
+
Y as Toggle
|
|
49
52
|
};
|
|
50
53
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index18.css');const c=require("react/jsx-runtime"),d=require("../../classix-5H4IWnMA.cjs"),n="_card_19834_1",o="_draft_19834_7",r={card:n,draft:o},i=({children:t,draft:e,image:s,onClick:a})=>c.jsxs("article",{className:d.t(r.card,e&&r.draft),onClick:a,children:[s,t]});exports.Card=i;
|
|
2
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/components/card/index.tsx"],"sourcesContent":["import cx from 'classix';\n\nimport styles from './styles.module.css';\n\nexport type CardProps = {\n children: React.ReactNode;\n draft?: boolean;\n image?: React.ReactNode;\n onClick?: React.MouseEventHandler<HTMLElement>;\n};\n\nexport const Card = ({ children, draft, image, onClick }: CardProps) => {\n return (\n <article\n className={cx(styles.card, draft && styles.draft)}\n onClick={onClick}\n >\n {image}\n {children}\n </article>\n );\n};\n"],"names":["Card","children","draft","image","onClick","jsxs","cx","styles"],"mappings":"qNAWaA,EAAO,CAAC,CAAE,SAAAC,EAAU,MAAAC,EAAO,MAAAC,EAAO,QAAAC,KAE3CC,EAAAA,KAAC,UAAA,CACC,UAAWC,EAAAA,EAAGC,EAAO,KAAML,GAASK,EAAO,KAAK,EAChD,QAAAH,EAEC,SAAA,CAAAD,EACAF,CAAA,CAAA,CAAA"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { jsxs as s } from "react/jsx-runtime";
|
|
2
|
-
import { t as o } from "../../classix-DG18itHa.js";
|
|
3
|
-
import '../../assets/index18.css';const e = "_card_19834_1", f = "_draft_19834_7", r = {
|
|
4
|
-
card: e,
|
|
5
|
-
draft: f
|
|
6
|
-
}, m = ({ children: t, draft: a, image: c, onClick: d }) => /* @__PURE__ */ s(
|
|
7
|
-
"article",
|
|
8
|
-
{
|
|
9
|
-
className: o(r.card, a && r.draft),
|
|
10
|
-
onClick: d,
|
|
11
|
-
children: [
|
|
12
|
-
c,
|
|
13
|
-
t
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
);
|
|
17
|
-
export {
|
|
18
|
-
m as Card
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/card/index.tsx"],"sourcesContent":["import cx from 'classix';\n\nimport styles from './styles.module.css';\n\nexport type CardProps = {\n children: React.ReactNode;\n draft?: boolean;\n image?: React.ReactNode;\n onClick?: React.MouseEventHandler<HTMLElement>;\n};\n\nexport const Card = ({ children, draft, image, onClick }: CardProps) => {\n return (\n <article\n className={cx(styles.card, draft && styles.draft)}\n onClick={onClick}\n >\n {image}\n {children}\n </article>\n );\n};\n"],"names":["Card","children","draft","image","onClick","jsxs","cx","styles"],"mappings":";;;;;GAWaA,IAAO,CAAC,EAAE,UAAAC,GAAU,OAAAC,GAAO,OAAAC,GAAO,SAAAC,QAE3C,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWC,EAAGC,EAAO,MAAML,KAASK,EAAO,KAAK;AAAA,IAChD,SAAAH;AAAA,IAEC,UAAA;AAAA,MAAAD;AAAA,MACAF;AAAA,IAAA;AAAA,EAAA;AAAA;"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index15.css');const n=require("react/jsx-runtime"),c=require("../../classix-5H4IWnMA.cjs"),d="_dropdown_128nx_1",a="_inline_128nx_15",u="_label_128nx_25",e={dropdown:d,inline:a,label:u},_=({children:t,inline:i,label:s,placeholder:o,...r})=>{const l=n.jsxs("select",{className:c.t(e.dropdown,i&&e.inline),...r,children:[o&&n.jsx("option",{value:"",hidden:!0,children:o}),t]});return s?n.jsxs("label",{className:e.label,children:[s,l]}):l};exports.Dropdown=_;
|
|
2
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/components/dropdown/index.tsx"],"sourcesContent":["import cx from 'classix';\n\nimport styles from './styles.module.css';\n\nexport type DropdownProps = React.SelectHTMLAttributes<HTMLSelectElement> & {\n children?: React.ReactNode;\n inline?: boolean;\n label?: string;\n placeholder?: string;\n};\n\nexport const Dropdown = ({ children, inline, label, placeholder, ...props }: DropdownProps) => {\n const selectElement = (\n <select\n className={cx(styles.dropdown, inline && styles.inline)}\n {...props}\n >\n {placeholder && (\n <option\n value={''}\n hidden\n >\n {placeholder}\n </option>\n )}\n {children}\n </select>\n );\n\n if (!label) {\n return selectElement;\n }\n\n return (\n <label className={styles.label}>\n {label}\n {selectElement}\n </label>\n );\n};\n"],"names":["Dropdown","children","inline","label","placeholder","props","selectElement","jsxs","cx","styles","jsx"],"mappings":"4PAWaA,EAAW,CAAC,CAAE,SAAAC,EAAU,OAAAC,EAAQ,MAAAC,EAAO,YAAAC,EAAa,GAAGC,KAA2B,CAC7F,MAAMC,EACJC,EAAAA,KAAC,SAAA,CACC,UAAWC,EAAAA,EAAGC,EAAO,SAAUP,GAAUO,EAAO,MAAM,EACrD,GAAGJ,EAEH,SAAA,CAAAD,GACCM,EAAAA,IAAC,SAAA,CACC,MAAO,GACP,OAAM,GAEL,SAAAN,CAAA,CAAA,EAGJH,CAAA,CAAA,CAAA,EAIL,OAAKE,EAKHI,EAAAA,KAAC,QAAA,CAAM,UAAWE,EAAO,MACtB,SAAA,CAAAN,EACAG,CAAA,EACH,EAPOA,CASX"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { jsxs as t, jsx as d } from "react/jsx-runtime";
|
|
2
|
-
import { t as c } from "../../classix-DG18itHa.js";
|
|
3
|
-
import '../../assets/index15.css';const _ = "_dropdown_128nx_1", a = "_inline_128nx_15", p = "_label_128nx_25", n = {
|
|
4
|
-
dropdown: _,
|
|
5
|
-
inline: a,
|
|
6
|
-
label: p
|
|
7
|
-
}, w = ({ children: r, inline: s, label: e, placeholder: o, ...i }) => {
|
|
8
|
-
const l = /* @__PURE__ */ t(
|
|
9
|
-
"select",
|
|
10
|
-
{
|
|
11
|
-
className: c(n.dropdown, s && n.inline),
|
|
12
|
-
...i,
|
|
13
|
-
children: [
|
|
14
|
-
o && /* @__PURE__ */ d(
|
|
15
|
-
"option",
|
|
16
|
-
{
|
|
17
|
-
value: "",
|
|
18
|
-
hidden: !0,
|
|
19
|
-
children: o
|
|
20
|
-
}
|
|
21
|
-
),
|
|
22
|
-
r
|
|
23
|
-
]
|
|
24
|
-
}
|
|
25
|
-
);
|
|
26
|
-
return e ? /* @__PURE__ */ t("label", { className: n.label, children: [
|
|
27
|
-
e,
|
|
28
|
-
l
|
|
29
|
-
] }) : l;
|
|
30
|
-
};
|
|
31
|
-
export {
|
|
32
|
-
w as Dropdown
|
|
33
|
-
};
|
|
34
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/dropdown/index.tsx"],"sourcesContent":["import cx from 'classix';\n\nimport styles from './styles.module.css';\n\nexport type DropdownProps = React.SelectHTMLAttributes<HTMLSelectElement> & {\n children?: React.ReactNode;\n inline?: boolean;\n label?: string;\n placeholder?: string;\n};\n\nexport const Dropdown = ({ children, inline, label, placeholder, ...props }: DropdownProps) => {\n const selectElement = (\n <select\n className={cx(styles.dropdown, inline && styles.inline)}\n {...props}\n >\n {placeholder && (\n <option\n value={''}\n hidden\n >\n {placeholder}\n </option>\n )}\n {children}\n </select>\n );\n\n if (!label) {\n return selectElement;\n }\n\n return (\n <label className={styles.label}>\n {label}\n {selectElement}\n </label>\n );\n};\n"],"names":["Dropdown","children","inline","label","placeholder","props","selectElement","jsxs","cx","styles","jsx"],"mappings":";;;;;;GAWaA,IAAW,CAAC,EAAE,UAAAC,GAAU,QAAAC,GAAQ,OAAAC,GAAO,aAAAC,GAAa,GAAGC,QAA2B;AAC7F,QAAMC,IACJ,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAGC,EAAO,UAAUP,KAAUO,EAAO,MAAM;AAAA,MACrD,GAAGJ;AAAA,MAEH,UAAA;AAAA,QAAAD,KACC,gBAAAM;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,OAAO;AAAA,YACP,QAAM;AAAA,YAEL,UAAAN;AAAA,UAAA;AAAA,QAAA;AAAA,QAGJH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIL,SAAKE,IAKH,gBAAAI,EAAC,SAAA,EAAM,WAAWE,EAAO,OACtB,UAAA;AAAA,IAAAN;AAAA,IACAG;AAAA,EAAA,GACH,IAPOA;AASX;"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index14.css');const l=require("react/jsx-runtime"),T=require("../../classix-5H4IWnMA.cjs"),o=require("react"),_=require("../icon/index.cjs"),q="_dropzone_1cqsl_1",M="_highlight_1cqsl_41",z={dropzone:q,highlight:M},I=e=>{var d;const[f,y]=o.useState(!1),[F,v]=o.useState({empty:[],oversize:[],wrongType:[]}),[p,x]=o.useState([]),[D,a]=o.useState(!1),r=(t,i)=>s=>{s.preventDefault(),s.stopPropagation(),t(i)},c=r(a,!0),S=r(a,!1),g=t=>{if(!t)return;const i=Array.from(t),s=i.filter(n=>n.size===0),u=e.maxFileSizeMB?i.filter(n=>n.size>e.maxFileSizeMB*1024*1024):[],m=e.mimeTypes?i.filter(n=>{var h;return!((h=e.mimeTypes)!=null&&h.includes(n.type))}):[],j=i.filter(n=>n.size>0&&(e.maxFileSizeMB?n.size<=e.maxFileSizeMB*1024*1024:!0)&&(e.mimeTypes?e.mimeTypes.includes(n.type):!0));x(j),s.length>0||u.length>0||m.length>0?(v({empty:s,oversize:u,wrongType:m}),y(!0),console.log("validFiles",p),console.log("invalidFiles",F)):e.onUpload(t),a(!1)};return l.jsxs("div",{className:T.t(z.dropzone,D?z.highlight:""),onDragEnter:c,onDragLeave:S,onDragOver:c,onDrop:t=>{var i;t.preventDefault(),g((i=t.dataTransfer)==null?void 0:i.files)},children:[f&&l.jsx(l.Fragment,{}),l.jsxs("label",{htmlFor:e.inputId??"file-upload",children:[l.jsx(_.Icon,{name:"upload",size:"large"}),l.jsx("span",{children:e.label}),l.jsx("input",{type:"file",multiple:e.isMultiple,accept:(d=e.mimeTypes)==null?void 0:d.join(", "),id:e.inputId??"file-upload",onChange:t=>g(t.target.files)})]})]})};exports.Dropzone=I;
|
|
2
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/components/dropzone/index.tsx"],"sourcesContent":["import cx from 'classix';\nimport { useState } from 'react';\n\nimport { Icon } from '@/components/icon';\n\nimport styles from './styles.module.css';\n\nexport type DropzoneProps = {\n allowDirectoryUpload?: boolean;\n inputId?: string;\n isMultiple?: boolean;\n label?: string;\n maxFileSizeMB?: number;\n mimeTypes?: string[];\n onUpload: (uploadContent: File[] | FileList) => void;\n};\n\nexport const Dropzone = (props: DropzoneProps) => {\n const [showWarning, setShowWarning] = useState(false);\n const [invalidFiles, setInvalidFiles] = useState<{\n empty: File[];\n oversize: File[];\n wrongType: File[];\n }>({ empty: [], oversize: [], wrongType: [] });\n const [validFiles, setValidFiles] = useState<File[]>([]);\n const [dragging, setDragging] = useState(false);\n\n const makeDragHandler = (set: (v: boolean) => void, value: boolean) => (e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n set(value);\n };\n\n const onDragIn = makeDragHandler(setDragging, true);\n const onDragOut = makeDragHandler(setDragging, false);\n\n const handleUpload = (files: FileList | null) => {\n if (!files) {\n return;\n }\n\n const fileList = Array.from(files);\n\n const emptyFiles = fileList.filter((file) => file.size === 0);\n const oversizeFiles = props.maxFileSizeMB\n ? fileList.filter((file) => file.size > props.maxFileSizeMB! * 1024 * 1024)\n : [];\n const unsupportedFiles = props.mimeTypes\n ? fileList.filter((file) => !props.mimeTypes?.includes(file.type))\n : [];\n const validatedFiles = fileList.filter(\n (file) =>\n file.size > 0 &&\n (props.maxFileSizeMB ? file.size <= props.maxFileSizeMB * 1024 * 1024 : true) &&\n (props.mimeTypes ? props.mimeTypes.includes(file.type) : true)\n );\n\n setValidFiles(validatedFiles);\n\n if (emptyFiles.length > 0 || oversizeFiles.length > 0 || unsupportedFiles.length > 0) {\n setInvalidFiles({ empty: emptyFiles, oversize: oversizeFiles, wrongType: unsupportedFiles });\n setShowWarning(true);\n console.log('validFiles', validFiles);\n console.log('invalidFiles', invalidFiles);\n } else {\n props.onUpload(files);\n }\n\n setDragging(false);\n };\n\n return (\n <div\n className={cx(styles.dropzone, dragging ? styles.highlight : '')}\n onDragEnter={onDragIn}\n onDragLeave={onDragOut}\n onDragOver={onDragIn}\n onDrop={(e) => {\n e.preventDefault();\n handleUpload(e.dataTransfer?.files);\n }}\n >\n {/*TODO: show invalid files*/}\n {showWarning && <></>}\n\n <label htmlFor={props.inputId ?? 'file-upload'}>\n <Icon\n name={'upload'}\n size={'large'}\n />\n <span>{props.label}</span>\n <input\n type='file'\n multiple={props.isMultiple}\n accept={props.mimeTypes?.join(', ')}\n id={props.inputId ?? 'file-upload'}\n onChange={(e) => handleUpload(e.target.files)}\n />\n </label>\n </div>\n );\n};\n"],"names":["Dropzone","props","showWarning","setShowWarning","useState","invalidFiles","setInvalidFiles","validFiles","setValidFiles","dragging","setDragging","makeDragHandler","set","value","e","onDragIn","onDragOut","handleUpload","files","fileList","emptyFiles","file","oversizeFiles","unsupportedFiles","_a","validatedFiles","jsxs","cx","styles","jsx","Fragment","Icon"],"mappings":"wRAiBaA,EAAYC,GAAyB,OAChD,KAAM,CAACC,EAAaC,CAAc,EAAIC,EAAAA,SAAS,EAAK,EAC9C,CAACC,EAAcC,CAAe,EAAIF,EAAAA,SAIrC,CAAE,MAAO,CAAA,EAAI,SAAU,CAAA,EAAI,UAAW,CAAA,EAAI,EACvC,CAACG,EAAYC,CAAa,EAAIJ,EAAAA,SAAiB,CAAA,CAAE,EACjD,CAACK,EAAUC,CAAW,EAAIN,EAAAA,SAAS,EAAK,EAExCO,EAAkB,CAACC,EAA2BC,IAAoBC,GAAuB,CAC7FA,EAAE,eAAA,EACFA,EAAE,gBAAA,EACFF,EAAIC,CAAK,CACX,EAEME,EAAWJ,EAAgBD,EAAa,EAAI,EAC5CM,EAAYL,EAAgBD,EAAa,EAAK,EAE9CO,EAAgBC,GAA2B,CAC/C,GAAI,CAACA,EACH,OAGF,MAAMC,EAAW,MAAM,KAAKD,CAAK,EAE3BE,EAAaD,EAAS,OAAQE,GAASA,EAAK,OAAS,CAAC,EACtDC,EAAgBrB,EAAM,cACxBkB,EAAS,OAAQE,GAASA,EAAK,KAAOpB,EAAM,cAAiB,KAAO,IAAI,EACxE,CAAA,EACEsB,EAAmBtB,EAAM,UAC3BkB,EAAS,OAAQE,GAAA,OAAS,SAACG,EAAAvB,EAAM,YAAN,MAAAuB,EAAiB,SAASH,EAAK,OAAK,EAC/D,CAAA,EACEI,EAAiBN,EAAS,OAC7BE,GACCA,EAAK,KAAO,IACXpB,EAAM,cAAgBoB,EAAK,MAAQpB,EAAM,cAAgB,KAAO,KAAO,MACvEA,EAAM,UAAYA,EAAM,UAAU,SAASoB,EAAK,IAAI,EAAI,GAAA,EAG7Db,EAAciB,CAAc,EAExBL,EAAW,OAAS,GAAKE,EAAc,OAAS,GAAKC,EAAiB,OAAS,GACjFjB,EAAgB,CAAE,MAAOc,EAAY,SAAUE,EAAe,UAAWC,EAAkB,EAC3FpB,EAAe,EAAI,EACnB,QAAQ,IAAI,aAAcI,CAAU,EACpC,QAAQ,IAAI,eAAgBF,CAAY,GAExCJ,EAAM,SAASiB,CAAK,EAGtBR,EAAY,EAAK,CACnB,EAEA,OACEgB,EAAAA,KAAC,MAAA,CACC,UAAWC,EAAAA,EAAGC,EAAO,SAAUnB,EAAWmB,EAAO,UAAY,EAAE,EAC/D,YAAab,EACb,YAAaC,EACb,WAAYD,EACZ,OAASD,GAAM,OACbA,EAAE,eAAA,EACFG,GAAaO,EAAAV,EAAE,eAAF,YAAAU,EAAgB,KAAK,CACpC,EAGC,SAAA,CAAAtB,GAAe2B,EAAAA,IAAAC,EAAAA,SAAA,EAAE,EAElBJ,EAAAA,KAAC,QAAA,CAAM,QAASzB,EAAM,SAAW,cAC/B,SAAA,CAAA4B,EAAAA,IAACE,EAAAA,KAAA,CACC,KAAM,SACN,KAAM,OAAA,CAAA,EAERF,EAAAA,IAAC,OAAA,CAAM,SAAA5B,EAAM,KAAA,CAAM,EACnB4B,EAAAA,IAAC,QAAA,CACC,KAAK,OACL,SAAU5B,EAAM,WAChB,QAAQuB,EAAAvB,EAAM,YAAN,YAAAuB,EAAiB,KAAK,MAC9B,GAAIvB,EAAM,SAAW,cACrB,SAAWa,GAAMG,EAAaH,EAAE,OAAO,KAAK,CAAA,CAAA,CAC9C,CAAA,CACF,CAAA,CAAA,CAAA,CAGN"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { jsxs as f, jsx as o, Fragment as I } from "react/jsx-runtime";
|
|
2
|
-
import { t as M } from "../../classix-DG18itHa.js";
|
|
3
|
-
import { useState as s } from "react";
|
|
4
|
-
import { Icon as w } from "../icon/index.js";
|
|
5
|
-
import '../../assets/index14.css';const B = "_dropzone_1cqsl_1", j = "_highlight_1cqsl_41", z = {
|
|
6
|
-
dropzone: B,
|
|
7
|
-
highlight: j
|
|
8
|
-
}, U = (e) => {
|
|
9
|
-
var d;
|
|
10
|
-
const [p, F] = s(!1), [y, v] = s({ empty: [], oversize: [], wrongType: [] }), [D, T] = s([]), [x, a] = s(!1), r = (i, t) => (n) => {
|
|
11
|
-
n.preventDefault(), n.stopPropagation(), i(t);
|
|
12
|
-
}, g = r(a, !0), S = r(a, !1), m = (i) => {
|
|
13
|
-
if (!i)
|
|
14
|
-
return;
|
|
15
|
-
const t = Array.from(i), n = t.filter((l) => l.size === 0), c = e.maxFileSizeMB ? t.filter((l) => l.size > e.maxFileSizeMB * 1024 * 1024) : [], h = e.mimeTypes ? t.filter((l) => {
|
|
16
|
-
var u;
|
|
17
|
-
return !((u = e.mimeTypes) != null && u.includes(l.type));
|
|
18
|
-
}) : [], _ = t.filter(
|
|
19
|
-
(l) => l.size > 0 && (e.maxFileSizeMB ? l.size <= e.maxFileSizeMB * 1024 * 1024 : !0) && (e.mimeTypes ? e.mimeTypes.includes(l.type) : !0)
|
|
20
|
-
);
|
|
21
|
-
T(_), n.length > 0 || c.length > 0 || h.length > 0 ? (v({ empty: n, oversize: c, wrongType: h }), F(!0), console.log("validFiles", D), console.log("invalidFiles", y)) : e.onUpload(i), a(!1);
|
|
22
|
-
};
|
|
23
|
-
return /* @__PURE__ */ f(
|
|
24
|
-
"div",
|
|
25
|
-
{
|
|
26
|
-
className: M(z.dropzone, x ? z.highlight : ""),
|
|
27
|
-
onDragEnter: g,
|
|
28
|
-
onDragLeave: S,
|
|
29
|
-
onDragOver: g,
|
|
30
|
-
onDrop: (i) => {
|
|
31
|
-
var t;
|
|
32
|
-
i.preventDefault(), m((t = i.dataTransfer) == null ? void 0 : t.files);
|
|
33
|
-
},
|
|
34
|
-
children: [
|
|
35
|
-
p && /* @__PURE__ */ o(I, {}),
|
|
36
|
-
/* @__PURE__ */ f("label", { htmlFor: e.inputId ?? "file-upload", children: [
|
|
37
|
-
/* @__PURE__ */ o(
|
|
38
|
-
w,
|
|
39
|
-
{
|
|
40
|
-
name: "upload",
|
|
41
|
-
size: "large"
|
|
42
|
-
}
|
|
43
|
-
),
|
|
44
|
-
/* @__PURE__ */ o("span", { children: e.label }),
|
|
45
|
-
/* @__PURE__ */ o(
|
|
46
|
-
"input",
|
|
47
|
-
{
|
|
48
|
-
type: "file",
|
|
49
|
-
multiple: e.isMultiple,
|
|
50
|
-
accept: (d = e.mimeTypes) == null ? void 0 : d.join(", "),
|
|
51
|
-
id: e.inputId ?? "file-upload",
|
|
52
|
-
onChange: (i) => m(i.target.files)
|
|
53
|
-
}
|
|
54
|
-
)
|
|
55
|
-
] })
|
|
56
|
-
]
|
|
57
|
-
}
|
|
58
|
-
);
|
|
59
|
-
};
|
|
60
|
-
export {
|
|
61
|
-
U as Dropzone
|
|
62
|
-
};
|
|
63
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/dropzone/index.tsx"],"sourcesContent":["import cx from 'classix';\nimport { useState } from 'react';\n\nimport { Icon } from '@/components/icon';\n\nimport styles from './styles.module.css';\n\nexport type DropzoneProps = {\n allowDirectoryUpload?: boolean;\n inputId?: string;\n isMultiple?: boolean;\n label?: string;\n maxFileSizeMB?: number;\n mimeTypes?: string[];\n onUpload: (uploadContent: File[] | FileList) => void;\n};\n\nexport const Dropzone = (props: DropzoneProps) => {\n const [showWarning, setShowWarning] = useState(false);\n const [invalidFiles, setInvalidFiles] = useState<{\n empty: File[];\n oversize: File[];\n wrongType: File[];\n }>({ empty: [], oversize: [], wrongType: [] });\n const [validFiles, setValidFiles] = useState<File[]>([]);\n const [dragging, setDragging] = useState(false);\n\n const makeDragHandler = (set: (v: boolean) => void, value: boolean) => (e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n set(value);\n };\n\n const onDragIn = makeDragHandler(setDragging, true);\n const onDragOut = makeDragHandler(setDragging, false);\n\n const handleUpload = (files: FileList | null) => {\n if (!files) {\n return;\n }\n\n const fileList = Array.from(files);\n\n const emptyFiles = fileList.filter((file) => file.size === 0);\n const oversizeFiles = props.maxFileSizeMB\n ? fileList.filter((file) => file.size > props.maxFileSizeMB! * 1024 * 1024)\n : [];\n const unsupportedFiles = props.mimeTypes\n ? fileList.filter((file) => !props.mimeTypes?.includes(file.type))\n : [];\n const validatedFiles = fileList.filter(\n (file) =>\n file.size > 0 &&\n (props.maxFileSizeMB ? file.size <= props.maxFileSizeMB * 1024 * 1024 : true) &&\n (props.mimeTypes ? props.mimeTypes.includes(file.type) : true)\n );\n\n setValidFiles(validatedFiles);\n\n if (emptyFiles.length > 0 || oversizeFiles.length > 0 || unsupportedFiles.length > 0) {\n setInvalidFiles({ empty: emptyFiles, oversize: oversizeFiles, wrongType: unsupportedFiles });\n setShowWarning(true);\n console.log('validFiles', validFiles);\n console.log('invalidFiles', invalidFiles);\n } else {\n props.onUpload(files);\n }\n\n setDragging(false);\n };\n\n return (\n <div\n className={cx(styles.dropzone, dragging ? styles.highlight : '')}\n onDragEnter={onDragIn}\n onDragLeave={onDragOut}\n onDragOver={onDragIn}\n onDrop={(e) => {\n e.preventDefault();\n handleUpload(e.dataTransfer?.files);\n }}\n >\n {/*TODO: show invalid files*/}\n {showWarning && <></>}\n\n <label htmlFor={props.inputId ?? 'file-upload'}>\n <Icon\n name={'upload'}\n size={'large'}\n />\n <span>{props.label}</span>\n <input\n type='file'\n multiple={props.isMultiple}\n accept={props.mimeTypes?.join(', ')}\n id={props.inputId ?? 'file-upload'}\n onChange={(e) => handleUpload(e.target.files)}\n />\n </label>\n </div>\n );\n};\n"],"names":["Dropzone","props","showWarning","setShowWarning","useState","invalidFiles","setInvalidFiles","validFiles","setValidFiles","dragging","setDragging","makeDragHandler","set","value","e","onDragIn","onDragOut","handleUpload","files","fileList","emptyFiles","file","oversizeFiles","unsupportedFiles","_a","validatedFiles","jsxs","cx","styles","jsx","Fragment","Icon"],"mappings":";;;;;;;GAiBaA,IAAW,CAACC,MAAyB;;AAChD,QAAM,CAACC,GAAaC,CAAc,IAAIC,EAAS,EAAK,GAC9C,CAACC,GAAcC,CAAe,IAAIF,EAIrC,EAAE,OAAO,CAAA,GAAI,UAAU,CAAA,GAAI,WAAW,CAAA,GAAI,GACvC,CAACG,GAAYC,CAAa,IAAIJ,EAAiB,CAAA,CAAE,GACjD,CAACK,GAAUC,CAAW,IAAIN,EAAS,EAAK,GAExCO,IAAkB,CAACC,GAA2BC,MAAmB,CAACC,MAAuB;AAC7F,IAAAA,EAAE,eAAA,GACFA,EAAE,gBAAA,GACFF,EAAIC,CAAK;AAAA,EACX,GAEME,IAAWJ,EAAgBD,GAAa,EAAI,GAC5CM,IAAYL,EAAgBD,GAAa,EAAK,GAE9CO,IAAe,CAACC,MAA2B;AAC/C,QAAI,CAACA;AACH;AAGF,UAAMC,IAAW,MAAM,KAAKD,CAAK,GAE3BE,IAAaD,EAAS,OAAO,CAACE,MAASA,EAAK,SAAS,CAAC,GACtDC,IAAgBrB,EAAM,gBACxBkB,EAAS,OAAO,CAACE,MAASA,EAAK,OAAOpB,EAAM,gBAAiB,OAAO,IAAI,IACxE,CAAA,GACEsB,IAAmBtB,EAAM,YAC3BkB,EAAS,OAAO,CAACE,MAAA;;AAAS,gBAACG,IAAAvB,EAAM,cAAN,QAAAuB,EAAiB,SAASH,EAAK;AAAA,KAAK,IAC/D,CAAA,GACEI,IAAiBN,EAAS;AAAA,MAC9B,CAACE,MACCA,EAAK,OAAO,MACXpB,EAAM,gBAAgBoB,EAAK,QAAQpB,EAAM,gBAAgB,OAAO,OAAO,QACvEA,EAAM,YAAYA,EAAM,UAAU,SAASoB,EAAK,IAAI,IAAI;AAAA,IAAA;AAG7D,IAAAb,EAAciB,CAAc,GAExBL,EAAW,SAAS,KAAKE,EAAc,SAAS,KAAKC,EAAiB,SAAS,KACjFjB,EAAgB,EAAE,OAAOc,GAAY,UAAUE,GAAe,WAAWC,GAAkB,GAC3FpB,EAAe,EAAI,GACnB,QAAQ,IAAI,cAAcI,CAAU,GACpC,QAAQ,IAAI,gBAAgBF,CAAY,KAExCJ,EAAM,SAASiB,CAAK,GAGtBR,EAAY,EAAK;AAAA,EACnB;AAEA,SACE,gBAAAgB;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAGC,EAAO,UAAUnB,IAAWmB,EAAO,YAAY,EAAE;AAAA,MAC/D,aAAab;AAAA,MACb,aAAaC;AAAA,MACb,YAAYD;AAAA,MACZ,QAAQ,CAACD,MAAM;;AACb,QAAAA,EAAE,eAAA,GACFG,GAAaO,IAAAV,EAAE,iBAAF,gBAAAU,EAAgB,KAAK;AAAA,MACpC;AAAA,MAGC,UAAA;AAAA,QAAAtB,KAAe,gBAAA2B,EAAAC,GAAA,EAAE;AAAA,QAElB,gBAAAJ,EAAC,SAAA,EAAM,SAASzB,EAAM,WAAW,eAC/B,UAAA;AAAA,UAAA,gBAAA4B;AAAA,YAACE;AAAA,YAAA;AAAA,cACC,MAAM;AAAA,cACN,MAAM;AAAA,YAAA;AAAA,UAAA;AAAA,UAER,gBAAAF,EAAC,QAAA,EAAM,UAAA5B,EAAM,MAAA,CAAM;AAAA,UACnB,gBAAA4B;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,UAAU5B,EAAM;AAAA,cAChB,SAAQuB,IAAAvB,EAAM,cAAN,gBAAAuB,EAAiB,KAAK;AAAA,cAC9B,IAAIvB,EAAM,WAAW;AAAA,cACrB,UAAU,CAACa,MAAMG,EAAaH,EAAE,OAAO,KAAK;AAAA,YAAA;AAAA,UAAA;AAAA,QAC9C,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|