fina-react-ds 1.0.3 → 1.0.4

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,13 @@
1
+ type QueryType = {
2
+ isPending: boolean;
3
+ isRefetching: boolean;
4
+ isError: boolean;
5
+ isRefetchError: boolean;
6
+ };
7
+ export declare function DataLoader({ errorPlaceholder, queries, loadingText, children, }: {
8
+ errorPlaceholder?: React.ReactNode;
9
+ queries?: Array<QueryType>;
10
+ loadingText?: string;
11
+ children: React.ReactNode | (() => React.ReactNode);
12
+ }): string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | null | undefined;
13
+ export {};
@@ -0,0 +1,24 @@
1
+ var f = Object.defineProperty;
2
+ var s = (i, t) => f(i, "name", { value: t, configurable: !0 });
3
+ import { jsx as r, jsxs as d } from "react/jsx-runtime";
4
+ import { ScaleLoader as m } from "react-spinners";
5
+ import { Alert as h, AlertTitle as u } from "./alert.js";
6
+ function j({
7
+ errorPlaceholder: i,
8
+ queries: t,
9
+ loadingText: l = "Chargement",
10
+ children: n
11
+ }) {
12
+ const a = /* @__PURE__ */ s((e) => {
13
+ c || (c = e.isPending || e.isRefetching), o || (o = e.isError || e.isRefetchError);
14
+ }, "checkQuery");
15
+ let c = !1, o = !1;
16
+ return t && Array.isArray(t) && t.forEach((e) => a(e)), c ? /* @__PURE__ */ r("div", { className: "min-h-[90px]", children: /* @__PURE__ */ r("div", { className: "flex items-center justify-center text-gray-500", children: /* @__PURE__ */ d("div", { className: "flex items-center justify-center flex-col", children: [
17
+ /* @__PURE__ */ r(m, { color: "#405189" }),
18
+ /* @__PURE__ */ r("div", { children: l })
19
+ ] }) }) }) : o ? i ?? /* @__PURE__ */ r(h, { color: "destructive", children: /* @__PURE__ */ r(u, { children: "Une erreur est survenue lors du chargement des données." }) }) : typeof n == "function" ? n() : n;
20
+ }
21
+ s(j, "DataLoader");
22
+ export {
23
+ j as DataLoader
24
+ };
package/dist/index.d.ts CHANGED
@@ -8,6 +8,7 @@ export { Card, CardHeader, CardAction, CardTitle, CardDescription, CardContent,
8
8
  export { Checkbox } from "./components/checkbox";
9
9
  export { DatePicker } from "./components/date-picker";
10
10
  export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from "./components/dialog";
11
+ export { DataLoader } from "./components/data-loader";
11
12
  export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, } from "./components/dropdown-menu";
12
13
  export { Input } from "./components/input";
13
14
  export { Label } from "./components/label";
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { AlertDialog as r, AlertDialogAction as t, AlertDialogCancel as a, AlertDialogContent as i, AlertDialogDescription as n, AlertDialogFooter as l, AlertDialogHeader as p, AlertDialogOverlay as d, AlertDialogPortal as g, AlertDialogTitle as b, AlertDialogTrigger as S } from "./components/alert-dialog.js";
2
- import { Alert as D, AlertDescription as m, AlertTitle as T } from "./components/alert.js";
2
+ import { Alert as D, AlertDescription as m, AlertTitle as x } from "./components/alert.js";
3
3
  import { Badge as f } from "./components/badge.js";
4
4
  import { Button as M, buttonVariants as A } from "./components/button.js";
5
5
  import { Avatar as P, AvatarFallback as c, AvatarImage as w } from "./components/avatar.js";
@@ -8,24 +8,25 @@ import { Card as k, CardAction as B, CardContent as F, CardDescription as H, Car
8
8
  import { Checkbox as O } from "./components/checkbox.js";
9
9
  import { DatePicker as N } from "./components/date-picker.js";
10
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";
11
- import { DropdownMenu as _, DropdownMenuCheckboxItem as $, DropdownMenuContent as ee, DropdownMenuGroup as oe, DropdownMenuItem as re, DropdownMenuLabel as te, DropdownMenuPortal as ae, DropdownMenuRadioGroup as ie, DropdownMenuRadioItem as ne, DropdownMenuSeparator as le, DropdownMenuShortcut as pe, DropdownMenuSub as de, DropdownMenuSubContent as ge, DropdownMenuSubTrigger as be, DropdownMenuTrigger as Se } from "./components/dropdown-menu.js";
12
- import { Input as De } from "./components/input.js";
13
- import { Label as Te } from "./components/label.js";
14
- import { Pagination as fe, PaginationContent as Ce, PaginationEllipsis as Me, PaginationItem as Ae, PaginationLink as se, PaginationNext as Pe, PaginationPrevious as ce } from "./components/pagination.js";
15
- import { Popover as he, PopoverAnchor as ve, PopoverContent as Ie, PopoverTrigger as ke } from "./components/popover.js";
16
- import { Select as Fe } from "./components/select.js";
17
- import { Separator as Ge } from "./components/separator.js";
18
- import { Sheet as ye, SheetBody as Re, SheetClose as Oe, SheetContent as Ee, SheetDescription as Ne, SheetFooter as Ve, SheetHeader as je, SheetTitle as qe, SheetTrigger as ze } from "./components/sheet.js";
19
- import { Sidebar as Ke, SidebarContent as Qe, SidebarFooter as Ue, SidebarGroup as We, SidebarGroupAction as Xe, SidebarGroupContent as Ye, SidebarGroupLabel as Ze, SidebarHeader as _e, SidebarInput as $e, SidebarInset as eo, SidebarMenu as oo, SidebarMenuAction as ro, SidebarMenuBadge as to, SidebarMenuButton as ao, SidebarMenuItem as io, SidebarMenuSkeleton as no, SidebarMenuSub as lo, SidebarMenuSubButton as po, SidebarMenuSubItem as go, SidebarProvider as bo, SidebarRail as So, SidebarSeparator as uo, SidebarTrigger as Do, useSidebar as mo } from "./components/sidebar.js";
20
- import { SimplePagination as xo } from "./components/simple-pagination.js";
21
- import { SimpleTooltip as Co } from "./components/simple-tooltip.js";
22
- import { Skeleton as Ao } from "./components/skeleton.js";
23
- import { Switch as Po } from "./components/switch.js";
24
- import { Toaster as wo } from "./components/sonner.js";
25
- import { Table as vo, TableBody as Io, TableCaption as ko, TableCell as Bo, TableFooter as Fo, TableHead as Ho, TableHeader as Go, TableRow as Lo } from "./components/table.js";
26
- import { Tabs as Ro, TabsContent as Oo, TabsList as Eo, TabsTrigger as No } from "./components/tabs.js";
27
- import { Textarea as jo } from "./components/textarea.js";
28
- import { Tooltip as zo, TooltipContent as Jo, TooltipProvider as Ko, TooltipTrigger as Qo } from "./components/tooltip.js";
11
+ import { DataLoader as _ } from "./components/data-loader.js";
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 De } from "./components/dropdown-menu.js";
13
+ import { Input as xe } from "./components/input.js";
14
+ import { Label as fe } from "./components/label.js";
15
+ import { Pagination as Me, PaginationContent as Ae, PaginationEllipsis as se, PaginationItem as Pe, PaginationLink as ce, PaginationNext as we, PaginationPrevious as he } from "./components/pagination.js";
16
+ import { Popover as Ie, PopoverAnchor as ke, PopoverContent as Be, PopoverTrigger as Fe } from "./components/popover.js";
17
+ import { Select as Ge } from "./components/select.js";
18
+ import { Separator as ye } from "./components/separator.js";
19
+ import { Sheet as Oe, SheetBody as Ee, SheetClose as Ne, SheetContent as Ve, SheetDescription as je, SheetFooter as qe, SheetHeader as ze, SheetTitle as Je, SheetTrigger as Ke } from "./components/sheet.js";
20
+ import { Sidebar as Ue, SidebarContent as We, SidebarFooter as Xe, SidebarGroup as Ye, SidebarGroupAction as Ze, SidebarGroupContent as _e, SidebarGroupLabel as $e, SidebarHeader as eo, SidebarInput as oo, SidebarInset as ro, SidebarMenu as to, SidebarMenuAction as ao, SidebarMenuBadge as io, SidebarMenuButton as no, SidebarMenuItem as lo, SidebarMenuSkeleton as po, SidebarMenuSub as go, SidebarMenuSubButton as bo, SidebarMenuSubItem as So, SidebarProvider as uo, SidebarRail as Do, SidebarSeparator as mo, SidebarTrigger as xo, useSidebar as To } from "./components/sidebar.js";
21
+ import { SimplePagination as Co } from "./components/simple-pagination.js";
22
+ import { SimpleTooltip as Ao } from "./components/simple-tooltip.js";
23
+ import { Skeleton as Po } from "./components/skeleton.js";
24
+ import { Switch as wo } from "./components/switch.js";
25
+ import { Toaster as vo } from "./components/sonner.js";
26
+ import { Table as ko, TableBody as Bo, TableCaption as Fo, TableCell as Ho, TableFooter as Go, TableHead as Lo, TableHeader as yo, TableRow as Ro } from "./components/table.js";
27
+ import { Tabs as Eo, TabsContent as No, TabsList as Vo, TabsTrigger as jo } from "./components/tabs.js";
28
+ import { Textarea as zo } from "./components/textarea.js";
29
+ import { Tooltip as Ko, TooltipContent as Qo, TooltipProvider as Uo, TooltipTrigger as Wo } from "./components/tooltip.js";
29
30
  export {
30
31
  D as Alert,
31
32
  m as AlertDescription,
@@ -40,7 +41,7 @@ export {
40
41
  g as AlertDialogPortal,
41
42
  b as AlertDialogTitle,
42
43
  S as AlertDialogTrigger,
43
- T as AlertTitle,
44
+ x as AlertTitle,
44
45
  P as Avatar,
45
46
  c as AvatarFallback,
46
47
  w as AvatarImage,
@@ -55,6 +56,7 @@ export {
55
56
  L as CardHeader,
56
57
  y as CardTitle,
57
58
  O as Checkbox,
59
+ _ as DataLoader,
58
60
  N as DatePicker,
59
61
  j as Dialog,
60
62
  q as DialogClose,
@@ -66,90 +68,90 @@ export {
66
68
  W as DialogPortal,
67
69
  X as DialogTitle,
68
70
  Y as DialogTrigger,
69
- _ as DropdownMenu,
70
- $ as DropdownMenuCheckboxItem,
71
- ee as DropdownMenuContent,
72
- oe as DropdownMenuGroup,
73
- re as DropdownMenuItem,
74
- te as DropdownMenuLabel,
75
- ae as DropdownMenuPortal,
76
- ie as DropdownMenuRadioGroup,
77
- ne as DropdownMenuRadioItem,
78
- le as DropdownMenuSeparator,
79
- pe as DropdownMenuShortcut,
80
- de as DropdownMenuSub,
81
- ge as DropdownMenuSubContent,
82
- be as DropdownMenuSubTrigger,
83
- Se as DropdownMenuTrigger,
84
- De as Input,
85
- Te as Label,
86
- fe as Pagination,
87
- Ce as PaginationContent,
88
- Me as PaginationEllipsis,
89
- Ae as PaginationItem,
90
- se as PaginationLink,
91
- Pe as PaginationNext,
92
- ce as PaginationPrevious,
93
- he as Popover,
94
- ve as PopoverAnchor,
95
- Ie as PopoverContent,
96
- ke as PopoverTrigger,
97
- Fe as Select,
98
- Ge as Separator,
99
- ye as Sheet,
100
- Re as SheetBody,
101
- Oe as SheetClose,
102
- Ee as SheetContent,
103
- Ne as SheetDescription,
104
- Ve as SheetFooter,
105
- je as SheetHeader,
106
- qe as SheetTitle,
107
- ze as SheetTrigger,
108
- Ke as Sidebar,
109
- Qe as SidebarContent,
110
- Ue as SidebarFooter,
111
- We as SidebarGroup,
112
- Xe as SidebarGroupAction,
113
- Ye as SidebarGroupContent,
114
- Ze as SidebarGroupLabel,
115
- _e as SidebarHeader,
116
- $e as SidebarInput,
117
- eo as SidebarInset,
118
- oo as SidebarMenu,
119
- ro as SidebarMenuAction,
120
- to as SidebarMenuBadge,
121
- ao as SidebarMenuButton,
122
- io as SidebarMenuItem,
123
- no as SidebarMenuSkeleton,
124
- lo as SidebarMenuSub,
125
- po as SidebarMenuSubButton,
126
- go as SidebarMenuSubItem,
127
- bo as SidebarProvider,
128
- So as SidebarRail,
129
- uo as SidebarSeparator,
130
- Do as SidebarTrigger,
131
- xo as SimplePagination,
132
- Co as SimpleTooltip,
133
- Ao as Skeleton,
134
- Po as Switch,
135
- vo as Table,
136
- Io as TableBody,
137
- ko as TableCaption,
138
- Bo as TableCell,
139
- Fo as TableFooter,
140
- Ho as TableHead,
141
- Go as TableHeader,
142
- Lo as TableRow,
143
- Ro as Tabs,
144
- Oo as TabsContent,
145
- Eo as TabsList,
146
- No as TabsTrigger,
147
- jo as Textarea,
148
- wo as Toaster,
149
- zo as Tooltip,
150
- Jo as TooltipContent,
151
- Ko as TooltipProvider,
152
- Qo as TooltipTrigger,
71
+ ee as DropdownMenu,
72
+ oe as DropdownMenuCheckboxItem,
73
+ re as DropdownMenuContent,
74
+ te as DropdownMenuGroup,
75
+ ae as DropdownMenuItem,
76
+ ie as DropdownMenuLabel,
77
+ ne as DropdownMenuPortal,
78
+ le as DropdownMenuRadioGroup,
79
+ pe as DropdownMenuRadioItem,
80
+ de as DropdownMenuSeparator,
81
+ ge as DropdownMenuShortcut,
82
+ be as DropdownMenuSub,
83
+ Se as DropdownMenuSubContent,
84
+ ue as DropdownMenuSubTrigger,
85
+ De as DropdownMenuTrigger,
86
+ xe as Input,
87
+ fe as Label,
88
+ Me as Pagination,
89
+ Ae as PaginationContent,
90
+ se as PaginationEllipsis,
91
+ Pe as PaginationItem,
92
+ ce as PaginationLink,
93
+ we as PaginationNext,
94
+ he as PaginationPrevious,
95
+ Ie as Popover,
96
+ ke as PopoverAnchor,
97
+ Be as PopoverContent,
98
+ Fe as PopoverTrigger,
99
+ Ge as Select,
100
+ ye as Separator,
101
+ Oe as Sheet,
102
+ Ee as SheetBody,
103
+ Ne as SheetClose,
104
+ Ve as SheetContent,
105
+ je as SheetDescription,
106
+ qe as SheetFooter,
107
+ ze as SheetHeader,
108
+ Je as SheetTitle,
109
+ Ke as SheetTrigger,
110
+ Ue as Sidebar,
111
+ We as SidebarContent,
112
+ Xe as SidebarFooter,
113
+ Ye as SidebarGroup,
114
+ Ze as SidebarGroupAction,
115
+ _e as SidebarGroupContent,
116
+ $e as SidebarGroupLabel,
117
+ eo as SidebarHeader,
118
+ oo as SidebarInput,
119
+ ro as SidebarInset,
120
+ to as SidebarMenu,
121
+ ao as SidebarMenuAction,
122
+ io as SidebarMenuBadge,
123
+ no as SidebarMenuButton,
124
+ lo as SidebarMenuItem,
125
+ po as SidebarMenuSkeleton,
126
+ go as SidebarMenuSub,
127
+ bo as SidebarMenuSubButton,
128
+ So as SidebarMenuSubItem,
129
+ uo as SidebarProvider,
130
+ Do as SidebarRail,
131
+ mo as SidebarSeparator,
132
+ xo as SidebarTrigger,
133
+ Co as SimplePagination,
134
+ Ao as SimpleTooltip,
135
+ Po as Skeleton,
136
+ wo as Switch,
137
+ ko as Table,
138
+ Bo as TableBody,
139
+ Fo as TableCaption,
140
+ Ho as TableCell,
141
+ Go as TableFooter,
142
+ Lo as TableHead,
143
+ yo as TableHeader,
144
+ Ro as TableRow,
145
+ Eo as Tabs,
146
+ No as TabsContent,
147
+ Vo as TabsList,
148
+ jo as TabsTrigger,
149
+ zo as Textarea,
150
+ vo as Toaster,
151
+ Ko as Tooltip,
152
+ Qo as TooltipContent,
153
+ Uo as TooltipProvider,
154
+ Wo as TooltipTrigger,
153
155
  A as buttonVariants,
154
- mo as useSidebar
156
+ To as useSidebar
155
157
  };
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.3",
8
+ "version": "1.0.4",
9
9
  "type": "module",
10
10
  "files": [
11
11
  "dist"
@@ -35,6 +35,7 @@
35
35
  "react-day-picker": "9.7.0",
36
36
  "react-dom": "^19.0.0",
37
37
  "react-select": "^5.10.1",
38
+ "react-spinners": "^0.17.0",
38
39
  "sonner": "^2.0.5",
39
40
  "tailwind-merge": "^3.3.1",
40
41
  "tailwindcss": "^4.0.0",