fina-react-ds 1.0.3 → 1.0.5

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
+ };
@@ -0,0 +1,3 @@
1
+ export declare function PasswordRulesChecker({ password }: {
2
+ password: string;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,44 @@
1
+ var m = Object.defineProperty;
2
+ var t = (c, i) => m(c, "name", { value: i, configurable: !0 });
3
+ import { jsxs as s, jsx as e } from "react/jsx-runtime";
4
+ import { CheckIcon as h, XIcon as a } from "lucide-react";
5
+ const l = /* @__PURE__ */ t(({
6
+ password: c,
7
+ children: i,
8
+ test: n
9
+ }) => {
10
+ const r = c && n && n(c);
11
+ return /* @__PURE__ */ s(
12
+ "div",
13
+ {
14
+ className: `flex flex-row items-center gap-x-2 gap-4 ${r ? "text-success" : ""}`,
15
+ children: [
16
+ /* @__PURE__ */ e("div", { className: "flex-none text-lg", children: r ? /* @__PURE__ */ e(h, { className: "size-4" }) : /* @__PURE__ */ e(a, { className: "size-4" }) }),
17
+ /* @__PURE__ */ e("div", { children: i })
18
+ ]
19
+ }
20
+ );
21
+ }, "RuleItem");
22
+ function x({ password: c }) {
23
+ return /* @__PURE__ */ s("div", { className: "text-sm", children: [
24
+ /* @__PURE__ */ e("p", { className: "mb-2", children: "Votre mot de passe doit contenir :" }),
25
+ /* @__PURE__ */ s("ul", { children: [
26
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(l, { password: c, test: /* @__PURE__ */ t((i) => i.length >= 8, "test"), children: "Au moins 8 caractères" }) }),
27
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(l, { password: c, test: /* @__PURE__ */ t((i) => /[a-z]+/.test(i), "test"), children: "Au moins 1 minuscule" }) }),
28
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(l, { password: c, test: /* @__PURE__ */ t((i) => /[A-Z]+/.test(i), "test"), children: "Au moins 1 majuscule" }) }),
29
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(l, { password: c, test: /* @__PURE__ */ t((i) => /[0-9]+/.test(i), "test"), children: "Au moins 1 chiffre" }) }),
30
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
31
+ l,
32
+ {
33
+ password: c,
34
+ test: /* @__PURE__ */ t((i) => /[@_=\-$£*?./!:>%&#]+/.test(i), "test"),
35
+ children: "Au moins un caractère spécial : @ _ = - $ £ * ? . / ! : > % & #"
36
+ }
37
+ ) })
38
+ ] })
39
+ ] });
40
+ }
41
+ t(x, "PasswordRulesChecker");
42
+ export {
43
+ x as PasswordRulesChecker
44
+ };
package/dist/index.d.ts CHANGED
@@ -8,10 +8,12 @@ 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";
14
15
  export { Pagination, PaginationContent, PaginationLink, PaginationItem, PaginationPrevious, PaginationNext, PaginationEllipsis, } from "./components/pagination";
16
+ export { PasswordRulesChecker } from "./components/password-rules-checker";
15
17
  export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor, } from "./components/popover";
16
18
  export { Select } from "./components/select";
17
19
  export { Separator } from "./components/separator";
package/dist/index.js CHANGED
@@ -1,31 +1,33 @@
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
- import { Button as M, buttonVariants as A } from "./components/button.js";
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 k, CardAction as B, CardContent as F, CardDescription as H, CardFooter as G, CardHeader as L, CardTitle as y } from "./components/card.js";
7
+ import { Card as k, CardAction as B, CardContent as F, CardDescription as H, 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
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 se, PaginationEllipsis as Ae, PaginationItem as Pe, PaginationLink as ce, PaginationNext as we, PaginationPrevious as he } from "./components/pagination.js";
16
+ import { PasswordRulesChecker as Ie } from "./components/password-rules-checker.js";
17
+ import { Popover as Be, PopoverAnchor as Fe, PopoverContent as He, PopoverTrigger as Ge } from "./components/popover.js";
18
+ import { Select as Re } from "./components/select.js";
19
+ import { Separator as Oe } from "./components/separator.js";
20
+ import { Sheet as Ne, SheetBody as Ve, SheetClose as je, SheetContent as qe, SheetDescription as ze, SheetFooter as Je, SheetHeader as Ke, SheetTitle as Qe, SheetTrigger as Ue } from "./components/sheet.js";
21
+ import { Sidebar as Xe, SidebarContent as Ye, SidebarFooter as Ze, SidebarGroup as _e, SidebarGroupAction as $e, SidebarGroupContent as eo, SidebarGroupLabel as oo, SidebarHeader as ro, SidebarInput as to, SidebarInset as ao, SidebarMenu as io, SidebarMenuAction as no, SidebarMenuBadge as lo, SidebarMenuButton as po, SidebarMenuItem as go, SidebarMenuSkeleton as bo, SidebarMenuSub as So, SidebarMenuSubButton as uo, SidebarMenuSubItem as Do, SidebarProvider as mo, SidebarRail as xo, SidebarSeparator as To, SidebarTrigger as fo, useSidebar as Co } from "./components/sidebar.js";
22
+ import { SimplePagination as so } from "./components/simple-pagination.js";
23
+ import { SimpleTooltip as Po } from "./components/simple-tooltip.js";
24
+ import { Skeleton as wo } from "./components/skeleton.js";
25
+ import { Switch as vo } from "./components/switch.js";
26
+ import { Toaster as ko } from "./components/sonner.js";
27
+ import { Table as Fo, TableBody as Ho, TableCaption as Go, TableCell as Lo, TableFooter as Ro, TableHead as yo, TableHeader as Oo, TableRow as Eo } from "./components/table.js";
28
+ import { Tabs as Vo, TabsContent as jo, TabsList as qo, TabsTrigger as zo } from "./components/tabs.js";
29
+ import { Textarea as Ko } from "./components/textarea.js";
30
+ import { Tooltip as Uo, TooltipContent as Wo, TooltipProvider as Xo, TooltipTrigger as Yo } from "./components/tooltip.js";
29
31
  export {
30
32
  D as Alert,
31
33
  m as AlertDescription,
@@ -40,7 +42,7 @@ export {
40
42
  g as AlertDialogPortal,
41
43
  b as AlertDialogTitle,
42
44
  S as AlertDialogTrigger,
43
- T as AlertTitle,
45
+ x as AlertTitle,
44
46
  P as Avatar,
45
47
  c as AvatarFallback,
46
48
  w as AvatarImage,
@@ -53,8 +55,9 @@ export {
53
55
  H as CardDescription,
54
56
  G as CardFooter,
55
57
  L as CardHeader,
56
- y as CardTitle,
58
+ R as CardTitle,
57
59
  O as Checkbox,
60
+ _ as DataLoader,
58
61
  N as DatePicker,
59
62
  j as Dialog,
60
63
  q as DialogClose,
@@ -66,90 +69,91 @@ export {
66
69
  W as DialogPortal,
67
70
  X as DialogTitle,
68
71
  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,
153
- A as buttonVariants,
154
- mo as useSidebar
72
+ ee as DropdownMenu,
73
+ oe as DropdownMenuCheckboxItem,
74
+ re as DropdownMenuContent,
75
+ te as DropdownMenuGroup,
76
+ ae as DropdownMenuItem,
77
+ ie as DropdownMenuLabel,
78
+ ne as DropdownMenuPortal,
79
+ le as DropdownMenuRadioGroup,
80
+ pe as DropdownMenuRadioItem,
81
+ de as DropdownMenuSeparator,
82
+ ge as DropdownMenuShortcut,
83
+ be as DropdownMenuSub,
84
+ Se as DropdownMenuSubContent,
85
+ ue as DropdownMenuSubTrigger,
86
+ De as DropdownMenuTrigger,
87
+ xe as Input,
88
+ fe as Label,
89
+ Me as Pagination,
90
+ se as PaginationContent,
91
+ Ae as PaginationEllipsis,
92
+ Pe as PaginationItem,
93
+ ce as PaginationLink,
94
+ we as PaginationNext,
95
+ he as PaginationPrevious,
96
+ Ie as PasswordRulesChecker,
97
+ Be as Popover,
98
+ Fe as PopoverAnchor,
99
+ He as PopoverContent,
100
+ Ge as PopoverTrigger,
101
+ Re as Select,
102
+ Oe as Separator,
103
+ Ne as Sheet,
104
+ Ve as SheetBody,
105
+ je as SheetClose,
106
+ qe as SheetContent,
107
+ ze as SheetDescription,
108
+ Je as SheetFooter,
109
+ Ke as SheetHeader,
110
+ Qe as SheetTitle,
111
+ Ue as SheetTrigger,
112
+ Xe as Sidebar,
113
+ Ye as SidebarContent,
114
+ Ze as SidebarFooter,
115
+ _e as SidebarGroup,
116
+ $e as SidebarGroupAction,
117
+ eo as SidebarGroupContent,
118
+ oo as SidebarGroupLabel,
119
+ ro as SidebarHeader,
120
+ to as SidebarInput,
121
+ ao as SidebarInset,
122
+ io as SidebarMenu,
123
+ no as SidebarMenuAction,
124
+ lo as SidebarMenuBadge,
125
+ po as SidebarMenuButton,
126
+ go as SidebarMenuItem,
127
+ bo as SidebarMenuSkeleton,
128
+ So as SidebarMenuSub,
129
+ uo as SidebarMenuSubButton,
130
+ Do as SidebarMenuSubItem,
131
+ mo as SidebarProvider,
132
+ xo as SidebarRail,
133
+ To as SidebarSeparator,
134
+ fo as SidebarTrigger,
135
+ so as SimplePagination,
136
+ Po as SimpleTooltip,
137
+ wo as Skeleton,
138
+ vo as Switch,
139
+ Fo as Table,
140
+ Ho as TableBody,
141
+ Go as TableCaption,
142
+ Lo as TableCell,
143
+ Ro as TableFooter,
144
+ yo as TableHead,
145
+ Oo as TableHeader,
146
+ Eo as TableRow,
147
+ Vo as Tabs,
148
+ jo as TabsContent,
149
+ qo as TabsList,
150
+ zo as TabsTrigger,
151
+ Ko as Textarea,
152
+ ko as Toaster,
153
+ Uo as Tooltip,
154
+ Wo as TooltipContent,
155
+ Xo as TooltipProvider,
156
+ Yo as TooltipTrigger,
157
+ s as buttonVariants,
158
+ Co as useSidebar
155
159
  };
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.5",
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",