fina-react-ds 1.0.11 → 1.0.12

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.
@@ -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 B, CardDescription as F, CardFooter as G, CardHeader as L, CardTitle as R } from "./components/card.js";
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 j, DialogClose as q, DialogContent as z, DialogDescription as J, DialogFooter as K, DialogHeader as Q, DialogOverlay as U, DialogPortal as W, DialogTitle as X, DialogTrigger as Y } from "./components/dialog.js";
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 { HoverCard as xe, HoverCardContent as Te, HoverCardTrigger as fe } from "./components/hover-card.js";
14
- import { Input as Me } from "./components/input.js";
15
- import { Label as Ae } from "./components/label.js";
16
- import { ModeToggle as ce } from "./components/mode-toggle.js";
17
- import { Pagination as he, PaginationContent as ve, PaginationEllipsis as He, PaginationItem as Ie, PaginationLink as ke, PaginationNext as Be, PaginationPrevious as Fe } from "./components/pagination.js";
18
- import { PasswordRulesChecker as Le } from "./components/password-rules-checker.js";
19
- import { Popover as ye, PopoverAnchor as Oe, PopoverContent as Ee, PopoverTrigger as Ne } from "./components/popover.js";
20
- import { Select as je } from "./components/select.js";
21
- import { Separator as ze } from "./components/separator.js";
22
- import { Sheet as Ke, SheetBody as Qe, SheetClose as Ue, SheetContent as We, SheetDescription as Xe, SheetFooter as Ye, SheetHeader as Ze, SheetTitle as _e, SheetTrigger as $e } from "./components/sheet.js";
23
- import { Sidebar as oo, SidebarContent as ro, SidebarFooter as to, SidebarGroup as ao, SidebarGroupAction as io, SidebarGroupContent as no, SidebarGroupLabel as lo, SidebarHeader as po, SidebarInput as go, SidebarInset as bo, SidebarMenu as So, SidebarMenuAction as uo, SidebarMenuBadge as mo, SidebarMenuButton as Do, SidebarMenuItem as xo, SidebarMenuSkeleton as To, SidebarMenuSub as fo, SidebarMenuSubButton as Co, SidebarMenuSubItem as Mo, SidebarProvider as so, SidebarRail as Ao, SidebarSeparator as Po, SidebarTrigger as co, useSidebar as wo } from "./components/sidebar.js";
24
- import { SimplePagination as vo } from "./components/simple-pagination.js";
25
- import { SimpleTooltip as Io } from "./components/simple-tooltip.js";
26
- import { Skeleton as Bo } from "./components/skeleton.js";
27
- import { Switch as Go } from "./components/switch.js";
28
- import { Toaster as Ro } from "./components/sonner.js";
29
- import { Table as Oo, TableBody as Eo, TableCaption as No, TableCell as Vo, TableFooter as jo, TableHead as qo, TableHeader as zo, TableRow as Jo } from "./components/table.js";
30
- import { Tabs as Qo, TabsContent as Uo, TabsList as Wo, TabsTrigger as Xo } from "./components/tabs.js";
31
- import { Textarea as Zo } from "./components/textarea.js";
32
- import { Tooltip as $o, TooltipContent as er, TooltipProvider as or, TooltipTrigger as rr } from "./components/tooltip.js";
33
- import { ThemeProvider as ar, useTheme as ir } from "./providers/theme-provider.js";
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
- B as CardContent,
58
- F as CardDescription,
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
- j as Dialog,
66
- q as DialogClose,
67
- z as DialogContent,
68
- J as DialogDescription,
69
- K as DialogFooter,
70
- Q as DialogHeader,
71
- U as DialogOverlay,
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 HoverCard,
91
- Te as HoverCardContent,
92
- fe as HoverCardTrigger,
93
- Me as Input,
94
- Ae as Label,
95
- ce as ModeToggle,
96
- he as Pagination,
97
- ve as PaginationContent,
98
- He as PaginationEllipsis,
99
- Ie as PaginationItem,
100
- ke as PaginationLink,
101
- Be as PaginationNext,
102
- Fe as PaginationPrevious,
103
- Le as PasswordRulesChecker,
104
- ye as Popover,
105
- Oe as PopoverAnchor,
106
- Ee as PopoverContent,
107
- Ne as PopoverTrigger,
108
- je as Select,
109
- ze as Separator,
110
- Ke as Sheet,
111
- Qe as SheetBody,
112
- Ue as SheetClose,
113
- We as SheetContent,
114
- Xe as SheetDescription,
115
- Ye as SheetFooter,
116
- Ze as SheetHeader,
117
- _e as SheetTitle,
118
- $e as SheetTrigger,
119
- oo as Sidebar,
120
- ro as SidebarContent,
121
- to as SidebarFooter,
122
- ao as SidebarGroup,
123
- io as SidebarGroupAction,
124
- no as SidebarGroupContent,
125
- lo as SidebarGroupLabel,
126
- po as SidebarHeader,
127
- go as SidebarInput,
128
- bo as SidebarInset,
129
- So as SidebarMenu,
130
- uo as SidebarMenuAction,
131
- mo as SidebarMenuBadge,
132
- Do as SidebarMenuButton,
133
- xo as SidebarMenuItem,
134
- To as SidebarMenuSkeleton,
135
- fo as SidebarMenuSub,
136
- Co as SidebarMenuSubButton,
137
- Mo as SidebarMenuSubItem,
138
- so as SidebarProvider,
139
- Ao as SidebarRail,
140
- Po as SidebarSeparator,
141
- co as SidebarTrigger,
142
- vo as SimplePagination,
143
- Io as SimpleTooltip,
144
- Bo as Skeleton,
145
- Go as Switch,
146
- Oo as Table,
147
- Eo as TableBody,
148
- No as TableCaption,
149
- Vo as TableCell,
150
- jo as TableFooter,
151
- qo as TableHead,
152
- zo as TableHeader,
153
- Jo as TableRow,
154
- Qo as Tabs,
155
- Uo as TabsContent,
156
- Wo as TabsList,
157
- Xo as TabsTrigger,
158
- Zo as Textarea,
159
- ar as ThemeProvider,
160
- Ro as Toaster,
161
- $o as Tooltip,
162
- er as TooltipContent,
163
- or as TooltipProvider,
164
- rr as TooltipTrigger,
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
- wo as useSidebar,
167
- ir as useTheme
168
+ vo as useSidebar,
169
+ lr as useTheme
168
170
  };
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "url": "https://github.com/F1na/fina-react-ds"
6
6
  },
7
7
  "private": false,
8
- "version": "1.0.11",
8
+ "version": "1.0.12",
9
9
  "type": "module",
10
10
  "files": [
11
11
  "dist"