fina-react-ds 1.0.11 → 1.0.13
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/components/file-uploader.js +109 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +111 -109
- package/package.json +1 -1
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
var F = Object.defineProperty;
|
|
2
|
+
var f = (c, l) => F(c, "name", { value: l, configurable: !0 });
|
|
3
|
+
import { jsxs as t, jsx as r, Fragment as m } from "react/jsx-runtime";
|
|
4
|
+
import { useState as j, useImperativeHandle as k, useCallback as p } from "react";
|
|
5
|
+
import { FileIcon as D, UploadIcon as I } from "lucide-react";
|
|
6
|
+
import { useDropzone as S } from "react-dropzone";
|
|
7
|
+
import { cn as n } from "../lib/utils.js";
|
|
8
|
+
import { Button as w } from "./button.js";
|
|
9
|
+
function T({
|
|
10
|
+
onChange: c,
|
|
11
|
+
"aria-invalid": l,
|
|
12
|
+
fileTypes: b,
|
|
13
|
+
ref: x
|
|
14
|
+
}) {
|
|
15
|
+
const [o, a] = j([]);
|
|
16
|
+
k(x, () => ({
|
|
17
|
+
focus: /* @__PURE__ */ f(() => {
|
|
18
|
+
e != null && e.current && e.current.focus();
|
|
19
|
+
}, "focus")
|
|
20
|
+
}));
|
|
21
|
+
const v = p(
|
|
22
|
+
(i) => {
|
|
23
|
+
a(i), c == null || c(i.length > 0 ? i[0] : null);
|
|
24
|
+
},
|
|
25
|
+
[c]
|
|
26
|
+
), g = /* @__PURE__ */ f(() => {
|
|
27
|
+
e != null && e.current && e.current.focus();
|
|
28
|
+
}, "handleFileDialogCancel"), { getRootProps: h, getInputProps: y, acceptedFiles: d, open: N, rootRef: e } = S({
|
|
29
|
+
maxFiles: 1,
|
|
30
|
+
noClick: !0,
|
|
31
|
+
onDrop: v,
|
|
32
|
+
onFileDialogCancel: g
|
|
33
|
+
}), z = p((i) => {
|
|
34
|
+
let s = 0, u = "ko";
|
|
35
|
+
return s = i.size / 1e3, s > 1e3 && (s /= 1e3, u = "mo"), s.toFixed(2) + " " + u;
|
|
36
|
+
}, []);
|
|
37
|
+
return /* @__PURE__ */ t(
|
|
38
|
+
"div",
|
|
39
|
+
{
|
|
40
|
+
...h(),
|
|
41
|
+
className: n(
|
|
42
|
+
"fc:bg-input fc:border fc:border-input-border fc:flex fc:flex-col fc:h-50 fc:w-full fc:rounded-md fc:px-3 fc:py-1 fc:text-base fc:shadow-xs fc:items-center fc:justify-center fc:md:text-sm fc:outline-none",
|
|
43
|
+
"fc:focus-visible:border-ring fc:focus-visible:ring-ring/50 fc:focus-visible:ring-[3px]",
|
|
44
|
+
"fc:aria-invalid:ring-destructive/20 fc:dark:aria-invalid:ring-destructive/40 fc:aria-invalid:border-destructive"
|
|
45
|
+
),
|
|
46
|
+
"aria-invalid": l,
|
|
47
|
+
children: [
|
|
48
|
+
o.length > 0 && /* @__PURE__ */ t(m, { children: [
|
|
49
|
+
/* @__PURE__ */ r(
|
|
50
|
+
"div",
|
|
51
|
+
{
|
|
52
|
+
className: n(
|
|
53
|
+
"fc:bg-primary fc:text-primary-foreground fc:flex fc:items-center fc:justify-center fc:rounded-full fc:size-10 fc:mb-4"
|
|
54
|
+
),
|
|
55
|
+
children: /* @__PURE__ */ r(D, { className: "fc:size-4" })
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
/* @__PURE__ */ t("div", { className: "fc:mb-4 fc:text-center", children: [
|
|
59
|
+
d[0].name,
|
|
60
|
+
/* @__PURE__ */ r("br", {}),
|
|
61
|
+
z(d[0])
|
|
62
|
+
] }),
|
|
63
|
+
/* @__PURE__ */ r(
|
|
64
|
+
w,
|
|
65
|
+
{
|
|
66
|
+
type: "button",
|
|
67
|
+
color: "destructive",
|
|
68
|
+
variant: "ghost",
|
|
69
|
+
onClick: /* @__PURE__ */ f(() => {
|
|
70
|
+
var i;
|
|
71
|
+
a([]), c == null || c(null), (i = e == null ? void 0 : e.current) == null || i.focus();
|
|
72
|
+
}, "onClick"),
|
|
73
|
+
children: "Supprimer"
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
] }),
|
|
77
|
+
o.length === 0 && /* @__PURE__ */ t(m, { children: [
|
|
78
|
+
/* @__PURE__ */ r(
|
|
79
|
+
"div",
|
|
80
|
+
{
|
|
81
|
+
className: n(
|
|
82
|
+
"fc:bg-primary fc:text-primary-foreground fc:flex fc:items-center fc:justify-center fc:rounded-full fc:size-10 fc:mb-4"
|
|
83
|
+
),
|
|
84
|
+
children: /* @__PURE__ */ r(I, { className: "fc:size-4" })
|
|
85
|
+
}
|
|
86
|
+
),
|
|
87
|
+
/* @__PURE__ */ t("div", { className: "fc:mb-4", children: [
|
|
88
|
+
"Glisser-déposer ou",
|
|
89
|
+
" ",
|
|
90
|
+
/* @__PURE__ */ r("span", { className: "fc:font-bold fc:underline fc:cursor-pointer", onClick: N, children: "Choisir un fichier" }),
|
|
91
|
+
" ",
|
|
92
|
+
"à uploader"
|
|
93
|
+
] }),
|
|
94
|
+
/* @__PURE__ */ t("div", { className: "fc:text-center fc:text-sm fc:md:text-xs", children: [
|
|
95
|
+
"Formats acceptés : ",
|
|
96
|
+
Object.keys(b).join(", "),
|
|
97
|
+
/* @__PURE__ */ r("br", {}),
|
|
98
|
+
"Taille max : 5Mo"
|
|
99
|
+
] })
|
|
100
|
+
] }),
|
|
101
|
+
/* @__PURE__ */ r("input", { ...y() })
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
f(T, "FileUploader");
|
|
107
|
+
export {
|
|
108
|
+
T as FileUploader
|
|
109
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export { DatePicker } from "./components/date-picker";
|
|
|
10
10
|
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from "./components/dialog";
|
|
11
11
|
export { DataLoader } from "./components/data-loader";
|
|
12
12
|
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, } from "./components/dropdown-menu";
|
|
13
|
+
export { FileUploader } from "./components/file-uploader";
|
|
13
14
|
export { HoverCard, HoverCardTrigger, HoverCardContent } from "./components/hover-card";
|
|
14
15
|
export { Input } from "./components/input";
|
|
15
16
|
export { Label } from "./components/label";
|
package/dist/index.js
CHANGED
|
@@ -4,33 +4,34 @@ import { Badge as f } from "./components/badge.js";
|
|
|
4
4
|
import { Button as M, buttonVariants as s } from "./components/button.js";
|
|
5
5
|
import { Avatar as P, AvatarFallback as c, AvatarImage as w } from "./components/avatar.js";
|
|
6
6
|
import { Calendar as v } from "./components/calendar.js";
|
|
7
|
-
import { Card as I, CardAction as k, CardContent as
|
|
7
|
+
import { Card as I, CardAction as k, CardContent as F, CardDescription as B, CardFooter as G, CardHeader as L, CardTitle as R } from "./components/card.js";
|
|
8
8
|
import { Checkbox as O } from "./components/checkbox.js";
|
|
9
9
|
import { DatePicker as N } from "./components/date-picker.js";
|
|
10
|
-
import { Dialog as
|
|
10
|
+
import { Dialog as V, DialogClose as j, DialogContent as q, DialogDescription as z, DialogFooter as J, DialogHeader as K, DialogOverlay as Q, DialogPortal as W, DialogTitle as X, DialogTrigger as Y } from "./components/dialog.js";
|
|
11
11
|
import { DataLoader as _ } from "./components/data-loader.js";
|
|
12
12
|
import { DropdownMenu as ee, DropdownMenuCheckboxItem as oe, DropdownMenuContent as re, DropdownMenuGroup as te, DropdownMenuItem as ae, DropdownMenuLabel as ie, DropdownMenuPortal as ne, DropdownMenuRadioGroup as le, DropdownMenuRadioItem as pe, DropdownMenuSeparator as de, DropdownMenuShortcut as ge, DropdownMenuSub as be, DropdownMenuSubContent as Se, DropdownMenuSubTrigger as ue, DropdownMenuTrigger as me } from "./components/dropdown-menu.js";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
13
|
+
import { FileUploader as xe } from "./components/file-uploader.js";
|
|
14
|
+
import { HoverCard as fe, HoverCardContent as Ce, HoverCardTrigger as Me } from "./components/hover-card.js";
|
|
15
|
+
import { Input as Ae } from "./components/input.js";
|
|
16
|
+
import { Label as ce } from "./components/label.js";
|
|
17
|
+
import { ModeToggle as he } from "./components/mode-toggle.js";
|
|
18
|
+
import { Pagination as He, PaginationContent as Ie, PaginationEllipsis as ke, PaginationItem as Fe, PaginationLink as Be, PaginationNext as Ge, PaginationPrevious as Le } from "./components/pagination.js";
|
|
19
|
+
import { PasswordRulesChecker as ye } from "./components/password-rules-checker.js";
|
|
20
|
+
import { Popover as Ee, PopoverAnchor as Ne, PopoverContent as Ue, PopoverTrigger as Ve } from "./components/popover.js";
|
|
21
|
+
import { Select as qe } from "./components/select.js";
|
|
22
|
+
import { Separator as Je } from "./components/separator.js";
|
|
23
|
+
import { Sheet as Qe, SheetBody as We, SheetClose as Xe, SheetContent as Ye, SheetDescription as Ze, SheetFooter as _e, SheetHeader as $e, SheetTitle as eo, SheetTrigger as oo } from "./components/sheet.js";
|
|
24
|
+
import { Sidebar as to, SidebarContent as ao, SidebarFooter as io, SidebarGroup as no, SidebarGroupAction as lo, SidebarGroupContent as po, SidebarGroupLabel as go, SidebarHeader as bo, SidebarInput as So, SidebarInset as uo, SidebarMenu as mo, SidebarMenuAction as Do, SidebarMenuBadge as xo, SidebarMenuButton as To, SidebarMenuItem as fo, SidebarMenuSkeleton as Co, SidebarMenuSub as Mo, SidebarMenuSubButton as so, SidebarMenuSubItem as Ao, SidebarProvider as Po, SidebarRail as co, SidebarSeparator as wo, SidebarTrigger as ho, useSidebar as vo } from "./components/sidebar.js";
|
|
25
|
+
import { SimplePagination as Io } from "./components/simple-pagination.js";
|
|
26
|
+
import { SimpleTooltip as Fo } from "./components/simple-tooltip.js";
|
|
27
|
+
import { Skeleton as Go } from "./components/skeleton.js";
|
|
28
|
+
import { Switch as Ro } from "./components/switch.js";
|
|
29
|
+
import { Toaster as Oo } from "./components/sonner.js";
|
|
30
|
+
import { Table as No, TableBody as Uo, TableCaption as Vo, TableCell as jo, TableFooter as qo, TableHead as zo, TableHeader as Jo, TableRow as Ko } from "./components/table.js";
|
|
31
|
+
import { Tabs as Wo, TabsContent as Xo, TabsList as Yo, TabsTrigger as Zo } from "./components/tabs.js";
|
|
32
|
+
import { Textarea as $o } from "./components/textarea.js";
|
|
33
|
+
import { Tooltip as or, TooltipContent as rr, TooltipProvider as tr, TooltipTrigger as ar } from "./components/tooltip.js";
|
|
34
|
+
import { ThemeProvider as nr, useTheme as lr } from "./providers/theme-provider.js";
|
|
34
35
|
export {
|
|
35
36
|
m as Alert,
|
|
36
37
|
D as AlertDescription,
|
|
@@ -54,21 +55,21 @@ export {
|
|
|
54
55
|
v as Calendar,
|
|
55
56
|
I as Card,
|
|
56
57
|
k as CardAction,
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
F as CardContent,
|
|
59
|
+
B as CardDescription,
|
|
59
60
|
G as CardFooter,
|
|
60
61
|
L as CardHeader,
|
|
61
62
|
R as CardTitle,
|
|
62
63
|
O as Checkbox,
|
|
63
64
|
_ as DataLoader,
|
|
64
65
|
N as DatePicker,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
66
|
+
V as Dialog,
|
|
67
|
+
j as DialogClose,
|
|
68
|
+
q as DialogContent,
|
|
69
|
+
z as DialogDescription,
|
|
70
|
+
J as DialogFooter,
|
|
71
|
+
K as DialogHeader,
|
|
72
|
+
Q as DialogOverlay,
|
|
72
73
|
W as DialogPortal,
|
|
73
74
|
X as DialogTitle,
|
|
74
75
|
Y as DialogTrigger,
|
|
@@ -87,82 +88,83 @@ export {
|
|
|
87
88
|
Se as DropdownMenuSubContent,
|
|
88
89
|
ue as DropdownMenuSubTrigger,
|
|
89
90
|
me as DropdownMenuTrigger,
|
|
90
|
-
xe as
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
Me as
|
|
94
|
-
Ae as
|
|
95
|
-
ce as
|
|
96
|
-
he as
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
Be as
|
|
102
|
-
|
|
103
|
-
Le as
|
|
104
|
-
ye as
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
Qe as
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
oo as
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
Io as
|
|
144
|
-
|
|
145
|
-
Go as
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
Vo as
|
|
150
|
-
jo as
|
|
151
|
-
qo as
|
|
152
|
-
zo as
|
|
153
|
-
Jo as
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
Zo as
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
91
|
+
xe as FileUploader,
|
|
92
|
+
fe as HoverCard,
|
|
93
|
+
Ce as HoverCardContent,
|
|
94
|
+
Me as HoverCardTrigger,
|
|
95
|
+
Ae as Input,
|
|
96
|
+
ce as Label,
|
|
97
|
+
he as ModeToggle,
|
|
98
|
+
He as Pagination,
|
|
99
|
+
Ie as PaginationContent,
|
|
100
|
+
ke as PaginationEllipsis,
|
|
101
|
+
Fe as PaginationItem,
|
|
102
|
+
Be as PaginationLink,
|
|
103
|
+
Ge as PaginationNext,
|
|
104
|
+
Le as PaginationPrevious,
|
|
105
|
+
ye as PasswordRulesChecker,
|
|
106
|
+
Ee as Popover,
|
|
107
|
+
Ne as PopoverAnchor,
|
|
108
|
+
Ue as PopoverContent,
|
|
109
|
+
Ve as PopoverTrigger,
|
|
110
|
+
qe as Select,
|
|
111
|
+
Je as Separator,
|
|
112
|
+
Qe as Sheet,
|
|
113
|
+
We as SheetBody,
|
|
114
|
+
Xe as SheetClose,
|
|
115
|
+
Ye as SheetContent,
|
|
116
|
+
Ze as SheetDescription,
|
|
117
|
+
_e as SheetFooter,
|
|
118
|
+
$e as SheetHeader,
|
|
119
|
+
eo as SheetTitle,
|
|
120
|
+
oo as SheetTrigger,
|
|
121
|
+
to as Sidebar,
|
|
122
|
+
ao as SidebarContent,
|
|
123
|
+
io as SidebarFooter,
|
|
124
|
+
no as SidebarGroup,
|
|
125
|
+
lo as SidebarGroupAction,
|
|
126
|
+
po as SidebarGroupContent,
|
|
127
|
+
go as SidebarGroupLabel,
|
|
128
|
+
bo as SidebarHeader,
|
|
129
|
+
So as SidebarInput,
|
|
130
|
+
uo as SidebarInset,
|
|
131
|
+
mo as SidebarMenu,
|
|
132
|
+
Do as SidebarMenuAction,
|
|
133
|
+
xo as SidebarMenuBadge,
|
|
134
|
+
To as SidebarMenuButton,
|
|
135
|
+
fo as SidebarMenuItem,
|
|
136
|
+
Co as SidebarMenuSkeleton,
|
|
137
|
+
Mo as SidebarMenuSub,
|
|
138
|
+
so as SidebarMenuSubButton,
|
|
139
|
+
Ao as SidebarMenuSubItem,
|
|
140
|
+
Po as SidebarProvider,
|
|
141
|
+
co as SidebarRail,
|
|
142
|
+
wo as SidebarSeparator,
|
|
143
|
+
ho as SidebarTrigger,
|
|
144
|
+
Io as SimplePagination,
|
|
145
|
+
Fo as SimpleTooltip,
|
|
146
|
+
Go as Skeleton,
|
|
147
|
+
Ro as Switch,
|
|
148
|
+
No as Table,
|
|
149
|
+
Uo as TableBody,
|
|
150
|
+
Vo as TableCaption,
|
|
151
|
+
jo as TableCell,
|
|
152
|
+
qo as TableFooter,
|
|
153
|
+
zo as TableHead,
|
|
154
|
+
Jo as TableHeader,
|
|
155
|
+
Ko as TableRow,
|
|
156
|
+
Wo as Tabs,
|
|
157
|
+
Xo as TabsContent,
|
|
158
|
+
Yo as TabsList,
|
|
159
|
+
Zo as TabsTrigger,
|
|
160
|
+
$o as Textarea,
|
|
161
|
+
nr as ThemeProvider,
|
|
162
|
+
Oo as Toaster,
|
|
163
|
+
or as Tooltip,
|
|
164
|
+
rr as TooltipContent,
|
|
165
|
+
tr as TooltipProvider,
|
|
166
|
+
ar as TooltipTrigger,
|
|
165
167
|
s as buttonVariants,
|
|
166
|
-
|
|
167
|
-
|
|
168
|
+
vo as useSidebar,
|
|
169
|
+
lr as useTheme
|
|
168
170
|
};
|