fina-react-ds 1.0.20 → 1.0.22

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/index.d.ts CHANGED
@@ -41,4 +41,7 @@ export { FormTextarea } from "./components/form-textarea";
41
41
  export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, } from "./components/form";
42
42
  export { ThemeProvider, useTheme } from "./providers/theme-provider";
43
43
  export { LoaderProvider, useLoader } from "./providers/loader-provider";
44
- export { formatDate } from "./lib/date";
44
+ export { formatDate } from "./lib/dates";
45
+ export { isNullOrEmptyString } from "./lib/strings";
46
+ export { orderByText, orderBy } from "./lib/arrays";
47
+ export { cn, apiErrorDescription, manageApiFormErrors } from "./lib/utils";
package/dist/index.js CHANGED
@@ -1,51 +1,54 @@
1
- import { AlertDialog as r, AlertDialogAction as t, AlertDialogCancel as a, AlertDialogContent as i, AlertDialogDescription as n, AlertDialogFooter as p, AlertDialogHeader as l, AlertDialogOverlay as d, AlertDialogPortal as m, AlertDialogTitle as g, AlertDialogTrigger as S } from "./components/alert-dialog.js";
2
- import { Alert as u, AlertDescription as x, AlertTitle as D } from "./components/alert.js";
1
+ import { AlertDialog as e, AlertDialogAction as t, AlertDialogCancel as a, AlertDialogContent as i, AlertDialogDescription as n, AlertDialogFooter as p, AlertDialogHeader as l, AlertDialogOverlay as d, AlertDialogPortal as m, AlertDialogTitle as g, AlertDialogTrigger as x } from "./components/alert-dialog.js";
2
+ import { Alert as u, AlertDescription as b, AlertTitle as f } from "./components/alert.js";
3
3
  import { Badge as T } from "./components/badge.js";
4
4
  import { Button as s, buttonVariants as F } from "./components/button.js";
5
- import { Avatar as c, AvatarFallback as P, AvatarImage as A } from "./components/avatar.js";
5
+ import { Avatar as c, AvatarFallback as A, AvatarImage as P } from "./components/avatar.js";
6
6
  import { Calendar as h } from "./components/calendar.js";
7
- import { Card as I, CardAction as H, CardContent as k, CardDescription as L, CardFooter as B, CardHeader as G, CardTitle as R } from "./components/card.js";
8
- import { Checkbox as O } from "./components/checkbox.js";
9
- import { DatePicker as E } from "./components/date-picker.js";
7
+ import { Card as I, CardAction as H, CardContent as k, CardDescription as B, CardFooter as L, CardHeader as y, CardTitle as G } from "./components/card.js";
8
+ import { Checkbox as E } from "./components/checkbox.js";
9
+ import { DatePicker as N } from "./components/date-picker.js";
10
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
- import { DropdownMenu as ee, DropdownMenuCheckboxItem as oe, DropdownMenuContent as re, DropdownMenuGroup as te, DropdownMenuItem as ae, DropdownMenuLabel as ie, DropdownMenuPortal as ne, DropdownMenuRadioGroup as pe, DropdownMenuRadioItem as le, DropdownMenuSeparator as de, DropdownMenuShortcut as me, DropdownMenuSub as ge, DropdownMenuSubContent as Se, DropdownMenuSubTrigger as be, DropdownMenuTrigger as ue } from "./components/dropdown-menu.js";
13
- import { FileUploader as De } from "./components/file-uploader.js";
14
- import { HoverCard as Te, HoverCardContent as Ce, HoverCardTrigger as se } from "./components/hover-card.js";
15
- import { Input as Me } from "./components/input.js";
16
- import { Label as Pe } from "./components/label.js";
17
- import { ModeToggle as we } from "./components/mode-toggle.js";
18
- import { Pagination as ve, PaginationContent as Ie, PaginationEllipsis as He, PaginationItem as ke, PaginationLink as Le, PaginationNext as Be, PaginationPrevious as Ge } from "./components/pagination.js";
19
- import { PasswordRulesChecker as ye } from "./components/password-rules-checker.js";
20
- import { Popover as Ue, PopoverAnchor as Ee, PopoverContent as Ne, 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 po, SidebarGroupContent as lo, SidebarGroupLabel as mo, SidebarHeader as go, SidebarInput as So, SidebarInset as bo, SidebarMenu as uo, SidebarMenuAction as xo, SidebarMenuBadge as Do, SidebarMenuButton as fo, SidebarMenuItem as To, SidebarMenuSkeleton as Co, SidebarMenuSub as so, SidebarMenuSubButton as Fo, SidebarMenuSubItem as Mo, SidebarProvider as co, SidebarRail as Po, SidebarSeparator as Ao, SidebarTrigger as wo, useSidebar as ho } from "./components/sidebar.js";
25
- import { SimplePagination as Io } from "./components/simple-pagination.js";
26
- import { SimpleTooltip as ko } from "./components/simple-tooltip.js";
27
- import { Skeleton as Bo } 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 Eo, TableBody as No, 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 { FormDate as nr } from "./components/form-date.js";
35
- import { FormColorPicker as lr } from "./components/form-color-picker.js";
36
- import { FormFileUploader as mr } from "./components/form-file-uploader.js";
37
- import { FormInput as Sr } from "./components/form-input.js";
38
- import { FormSelect as ur } from "./components/form-select.js";
39
- import { FormSwitch as Dr } from "./components/form-switch.js";
40
- import { FormTextarea as Tr } from "./components/form-textarea.js";
41
- import { Form as sr, FormControl as Fr, FormDescription as Mr, FormField as cr, FormItem as Pr, FormLabel as Ar, FormMessage as wr, useFormField as hr } from "./components/form.js";
42
- import { ThemeProvider as Ir, useTheme as Hr } from "./providers/theme-provider.js";
43
- import { LoaderProvider as Lr, useLoader as Br } from "./providers/loader-provider.js";
44
- import { formatDate as Rr } from "./lib/date.js";
12
+ import { DropdownMenu as oo, DropdownMenuCheckboxItem as ro, DropdownMenuContent as eo, DropdownMenuGroup as to, DropdownMenuItem as ao, DropdownMenuLabel as io, DropdownMenuPortal as no, DropdownMenuRadioGroup as po, DropdownMenuRadioItem as lo, DropdownMenuSeparator as mo, DropdownMenuShortcut as go, DropdownMenuSub as xo, DropdownMenuSubContent as So, DropdownMenuSubTrigger as uo, DropdownMenuTrigger as bo } from "./components/dropdown-menu.js";
13
+ import { FileUploader as Do } from "./components/file-uploader.js";
14
+ import { HoverCard as Co, HoverCardContent as so, HoverCardTrigger as Fo } from "./components/hover-card.js";
15
+ import { Input as co } from "./components/input.js";
16
+ import { Label as Po } from "./components/label.js";
17
+ import { ModeToggle as ho } from "./components/mode-toggle.js";
18
+ import { Pagination as Io, PaginationContent as Ho, PaginationEllipsis as ko, PaginationItem as Bo, PaginationLink as Lo, PaginationNext as yo, PaginationPrevious as Go } from "./components/pagination.js";
19
+ import { PasswordRulesChecker as Eo } from "./components/password-rules-checker.js";
20
+ import { Popover as No, PopoverAnchor as Uo, PopoverContent as Vo, PopoverTrigger as jo } from "./components/popover.js";
21
+ import { Select as zo } from "./components/select.js";
22
+ import { Separator as Ko } from "./components/separator.js";
23
+ import { Sheet as Wo, SheetBody as Xo, SheetClose as Yo, SheetContent as Zo, SheetDescription as _o, SheetFooter as $o, SheetHeader as or, SheetTitle as rr, SheetTrigger as er } from "./components/sheet.js";
24
+ import { Sidebar as ar, SidebarContent as ir, SidebarFooter as nr, SidebarGroup as pr, SidebarGroupAction as lr, SidebarGroupContent as dr, SidebarGroupLabel as mr, SidebarHeader as gr, SidebarInput as xr, SidebarInset as Sr, SidebarMenu as ur, SidebarMenuAction as br, SidebarMenuBadge as fr, SidebarMenuButton as Dr, SidebarMenuItem as Tr, SidebarMenuSkeleton as Cr, SidebarMenuSub as sr, SidebarMenuSubButton as Fr, SidebarMenuSubItem as Mr, SidebarProvider as cr, SidebarRail as Ar, SidebarSeparator as Pr, SidebarTrigger as wr, useSidebar as hr } from "./components/sidebar.js";
25
+ import { SimplePagination as Ir } from "./components/simple-pagination.js";
26
+ import { SimpleTooltip as kr } from "./components/simple-tooltip.js";
27
+ import { Skeleton as Lr } from "./components/skeleton.js";
28
+ import { Switch as Gr } from "./components/switch.js";
29
+ import { Toaster as Er } from "./components/sonner.js";
30
+ import { Table as Nr, TableBody as Ur, TableCaption as Vr, TableCell as jr, TableFooter as qr, TableHead as zr, TableHeader as Jr, TableRow as Kr } from "./components/table.js";
31
+ import { Tabs as Wr, TabsContent as Xr, TabsList as Yr, TabsTrigger as Zr } from "./components/tabs.js";
32
+ import { Textarea as $r } from "./components/textarea.js";
33
+ import { Tooltip as re, TooltipContent as ee, TooltipProvider as te, TooltipTrigger as ae } from "./components/tooltip.js";
34
+ import { FormDate as ne } from "./components/form-date.js";
35
+ import { FormColorPicker as le } from "./components/form-color-picker.js";
36
+ import { FormFileUploader as me } from "./components/form-file-uploader.js";
37
+ import { FormInput as xe } from "./components/form-input.js";
38
+ import { FormSelect as ue } from "./components/form-select.js";
39
+ import { FormSwitch as fe } from "./components/form-switch.js";
40
+ import { FormTextarea as Te } from "./components/form-textarea.js";
41
+ import { Form as se, FormControl as Fe, FormDescription as Me, FormField as ce, FormItem as Ae, FormLabel as Pe, FormMessage as we, useFormField as he } from "./components/form.js";
42
+ import { ThemeProvider as Ie, useTheme as He } from "./providers/theme-provider.js";
43
+ import { LoaderProvider as Be, useLoader as Le } from "./providers/loader-provider.js";
44
+ import { formatDate as Ge } from "./lib/dates.js";
45
+ import { isNullOrEmptyString as Ee } from "./lib/strings.js";
46
+ import { orderBy as Ne, orderByText as Ue } from "./lib/arrays.js";
47
+ import { apiErrorDescription as je, cn as qe, manageApiFormErrors as ze } from "./lib/utils.js";
45
48
  export {
46
49
  u as Alert,
47
- x as AlertDescription,
48
- r as AlertDialog,
50
+ b as AlertDescription,
51
+ e as AlertDialog,
49
52
  t as AlertDialogAction,
50
53
  a as AlertDialogCancel,
51
54
  i as AlertDialogContent,
@@ -55,24 +58,24 @@ export {
55
58
  d as AlertDialogOverlay,
56
59
  m as AlertDialogPortal,
57
60
  g as AlertDialogTitle,
58
- S as AlertDialogTrigger,
59
- D as AlertTitle,
61
+ x as AlertDialogTrigger,
62
+ f as AlertTitle,
60
63
  c as Avatar,
61
- P as AvatarFallback,
62
- A as AvatarImage,
64
+ A as AvatarFallback,
65
+ P as AvatarImage,
63
66
  T as Badge,
64
67
  s as Button,
65
68
  h as Calendar,
66
69
  I as Card,
67
70
  H as CardAction,
68
71
  k as CardContent,
69
- L as CardDescription,
70
- B as CardFooter,
71
- G as CardHeader,
72
- R as CardTitle,
73
- O as Checkbox,
72
+ B as CardDescription,
73
+ L as CardFooter,
74
+ y as CardHeader,
75
+ G as CardTitle,
76
+ E as Checkbox,
74
77
  _ as DataLoader,
75
- E as DatePicker,
78
+ N as DatePicker,
76
79
  V as Dialog,
77
80
  j as DialogClose,
78
81
  q as DialogContent,
@@ -83,116 +86,122 @@ export {
83
86
  W as DialogPortal,
84
87
  X as DialogTitle,
85
88
  Y as DialogTrigger,
86
- ee as DropdownMenu,
87
- oe as DropdownMenuCheckboxItem,
88
- re as DropdownMenuContent,
89
- te as DropdownMenuGroup,
90
- ae as DropdownMenuItem,
91
- ie as DropdownMenuLabel,
92
- ne as DropdownMenuPortal,
93
- pe as DropdownMenuRadioGroup,
94
- le as DropdownMenuRadioItem,
95
- de as DropdownMenuSeparator,
96
- me as DropdownMenuShortcut,
97
- ge as DropdownMenuSub,
98
- Se as DropdownMenuSubContent,
99
- be as DropdownMenuSubTrigger,
100
- ue as DropdownMenuTrigger,
101
- De as FileUploader,
102
- sr as Form,
103
- lr as FormColorPicker,
104
- Fr as FormControl,
105
- nr as FormDate,
106
- Mr as FormDescription,
107
- cr as FormField,
108
- mr as FormFileUploader,
109
- Sr as FormInput,
110
- Pr as FormItem,
111
- Ar as FormLabel,
112
- wr as FormMessage,
113
- ur as FormSelect,
114
- Dr as FormSwitch,
115
- Tr as FormTextarea,
116
- Te as HoverCard,
117
- Ce as HoverCardContent,
118
- se as HoverCardTrigger,
119
- Me as Input,
120
- Pe as Label,
121
- Lr as LoaderProvider,
122
- we as ModeToggle,
123
- ve as Pagination,
124
- Ie as PaginationContent,
125
- He as PaginationEllipsis,
126
- ke as PaginationItem,
127
- Le as PaginationLink,
128
- Be as PaginationNext,
129
- Ge as PaginationPrevious,
130
- ye as PasswordRulesChecker,
131
- Ue as Popover,
132
- Ee as PopoverAnchor,
133
- Ne as PopoverContent,
134
- Ve as PopoverTrigger,
135
- qe as Select,
136
- Je as Separator,
137
- Qe as Sheet,
138
- We as SheetBody,
139
- Xe as SheetClose,
140
- Ye as SheetContent,
141
- Ze as SheetDescription,
142
- _e as SheetFooter,
143
- $e as SheetHeader,
144
- eo as SheetTitle,
145
- oo as SheetTrigger,
146
- to as Sidebar,
147
- ao as SidebarContent,
148
- io as SidebarFooter,
149
- no as SidebarGroup,
150
- po as SidebarGroupAction,
151
- lo as SidebarGroupContent,
152
- mo as SidebarGroupLabel,
153
- go as SidebarHeader,
154
- So as SidebarInput,
155
- bo as SidebarInset,
156
- uo as SidebarMenu,
157
- xo as SidebarMenuAction,
158
- Do as SidebarMenuBadge,
159
- fo as SidebarMenuButton,
160
- To as SidebarMenuItem,
161
- Co as SidebarMenuSkeleton,
162
- so as SidebarMenuSub,
163
- Fo as SidebarMenuSubButton,
164
- Mo as SidebarMenuSubItem,
165
- co as SidebarProvider,
166
- Po as SidebarRail,
167
- Ao as SidebarSeparator,
168
- wo as SidebarTrigger,
169
- Io as SimplePagination,
170
- ko as SimpleTooltip,
171
- Bo as Skeleton,
172
- Ro as Switch,
173
- Eo as Table,
174
- No as TableBody,
175
- Vo as TableCaption,
176
- jo as TableCell,
177
- qo as TableFooter,
178
- zo as TableHead,
179
- Jo as TableHeader,
180
- Ko as TableRow,
181
- Wo as Tabs,
182
- Xo as TabsContent,
183
- Yo as TabsList,
184
- Zo as TabsTrigger,
185
- $o as Textarea,
186
- Ir as ThemeProvider,
187
- Oo as Toaster,
188
- or as Tooltip,
189
- rr as TooltipContent,
190
- tr as TooltipProvider,
191
- ar as TooltipTrigger,
89
+ oo as DropdownMenu,
90
+ ro as DropdownMenuCheckboxItem,
91
+ eo as DropdownMenuContent,
92
+ to as DropdownMenuGroup,
93
+ ao as DropdownMenuItem,
94
+ io as DropdownMenuLabel,
95
+ no as DropdownMenuPortal,
96
+ po as DropdownMenuRadioGroup,
97
+ lo as DropdownMenuRadioItem,
98
+ mo as DropdownMenuSeparator,
99
+ go as DropdownMenuShortcut,
100
+ xo as DropdownMenuSub,
101
+ So as DropdownMenuSubContent,
102
+ uo as DropdownMenuSubTrigger,
103
+ bo as DropdownMenuTrigger,
104
+ Do as FileUploader,
105
+ se as Form,
106
+ le as FormColorPicker,
107
+ Fe as FormControl,
108
+ ne as FormDate,
109
+ Me as FormDescription,
110
+ ce as FormField,
111
+ me as FormFileUploader,
112
+ xe as FormInput,
113
+ Ae as FormItem,
114
+ Pe as FormLabel,
115
+ we as FormMessage,
116
+ ue as FormSelect,
117
+ fe as FormSwitch,
118
+ Te as FormTextarea,
119
+ Co as HoverCard,
120
+ so as HoverCardContent,
121
+ Fo as HoverCardTrigger,
122
+ co as Input,
123
+ Po as Label,
124
+ Be as LoaderProvider,
125
+ ho as ModeToggle,
126
+ Io as Pagination,
127
+ Ho as PaginationContent,
128
+ ko as PaginationEllipsis,
129
+ Bo as PaginationItem,
130
+ Lo as PaginationLink,
131
+ yo as PaginationNext,
132
+ Go as PaginationPrevious,
133
+ Eo as PasswordRulesChecker,
134
+ No as Popover,
135
+ Uo as PopoverAnchor,
136
+ Vo as PopoverContent,
137
+ jo as PopoverTrigger,
138
+ zo as Select,
139
+ Ko as Separator,
140
+ Wo as Sheet,
141
+ Xo as SheetBody,
142
+ Yo as SheetClose,
143
+ Zo as SheetContent,
144
+ _o as SheetDescription,
145
+ $o as SheetFooter,
146
+ or as SheetHeader,
147
+ rr as SheetTitle,
148
+ er as SheetTrigger,
149
+ ar as Sidebar,
150
+ ir as SidebarContent,
151
+ nr as SidebarFooter,
152
+ pr as SidebarGroup,
153
+ lr as SidebarGroupAction,
154
+ dr as SidebarGroupContent,
155
+ mr as SidebarGroupLabel,
156
+ gr as SidebarHeader,
157
+ xr as SidebarInput,
158
+ Sr as SidebarInset,
159
+ ur as SidebarMenu,
160
+ br as SidebarMenuAction,
161
+ fr as SidebarMenuBadge,
162
+ Dr as SidebarMenuButton,
163
+ Tr as SidebarMenuItem,
164
+ Cr as SidebarMenuSkeleton,
165
+ sr as SidebarMenuSub,
166
+ Fr as SidebarMenuSubButton,
167
+ Mr as SidebarMenuSubItem,
168
+ cr as SidebarProvider,
169
+ Ar as SidebarRail,
170
+ Pr as SidebarSeparator,
171
+ wr as SidebarTrigger,
172
+ Ir as SimplePagination,
173
+ kr as SimpleTooltip,
174
+ Lr as Skeleton,
175
+ Gr as Switch,
176
+ Nr as Table,
177
+ Ur as TableBody,
178
+ Vr as TableCaption,
179
+ jr as TableCell,
180
+ qr as TableFooter,
181
+ zr as TableHead,
182
+ Jr as TableHeader,
183
+ Kr as TableRow,
184
+ Wr as Tabs,
185
+ Xr as TabsContent,
186
+ Yr as TabsList,
187
+ Zr as TabsTrigger,
188
+ $r as Textarea,
189
+ Ie as ThemeProvider,
190
+ Er as Toaster,
191
+ re as Tooltip,
192
+ ee as TooltipContent,
193
+ te as TooltipProvider,
194
+ ae as TooltipTrigger,
195
+ je as apiErrorDescription,
192
196
  F as buttonVariants,
193
- Rr as formatDate,
194
- hr as useFormField,
195
- Br as useLoader,
196
- ho as useSidebar,
197
- Hr as useTheme
197
+ qe as cn,
198
+ Ge as formatDate,
199
+ Ee as isNullOrEmptyString,
200
+ ze as manageApiFormErrors,
201
+ Ne as orderBy,
202
+ Ue as orderByText,
203
+ he as useFormField,
204
+ Le as useLoader,
205
+ hr as useSidebar,
206
+ He as useTheme
198
207
  };
@@ -0,0 +1,3 @@
1
+ declare const orderByText: (array: Array<object>, propName: keyof object) => object[];
2
+ declare const orderBy: (array: Array<object>, propName: keyof object) => object[];
3
+ export { orderByText, orderBy };
@@ -0,0 +1,7 @@
1
+ var s = Object.defineProperty;
2
+ var o = (t, r) => s(t, "name", { value: r, configurable: !0 });
3
+ const f = /* @__PURE__ */ o((t, r) => t.sort((e, n) => e[r].toLowerCase() < n[r].toLowerCase() ? -1 : e[r].toLowerCase() > n[r].toLowerCase() ? 1 : 0), "orderByText"), i = /* @__PURE__ */ o((t, r) => t.sort((e, n) => e[r] < n[r] ? -1 : e[r] > n[r] ? 1 : 0), "orderBy");
4
+ export {
5
+ i as orderBy,
6
+ f as orderByText
7
+ };
@@ -0,0 +1,2 @@
1
+ declare const isNullOrEmptyString: (value: string | null | undefined) => boolean;
2
+ export { isNullOrEmptyString };
@@ -0,0 +1,6 @@
1
+ var n = Object.defineProperty;
2
+ var t = (r, i) => n(r, "name", { value: i, configurable: !0 });
3
+ const l = /* @__PURE__ */ t((r) => r == null || r.trim() === "", "isNullOrEmptyString");
4
+ export {
5
+ l as isNullOrEmptyString
6
+ };
@@ -1,2 +1,16 @@
1
1
  import { type ClassValue } from "clsx";
2
- export declare function cn(...inputs: ClassValue[]): string;
2
+ import { UseFormReturn } from "react-hook-form";
3
+ declare const cn: (...inputs: ClassValue[]) => string;
4
+ declare const apiErrorDescription: (error: {
5
+ status: number;
6
+ raw?: {
7
+ error?: string;
8
+ };
9
+ }) => string;
10
+ declare const manageApiFormErrors: (error: {
11
+ status: number;
12
+ raw?: {
13
+ error?: string;
14
+ };
15
+ }, form: UseFormReturn) => void;
16
+ export { cn, apiErrorDescription, manageApiFormErrors };
package/dist/lib/utils.js CHANGED
@@ -1,11 +1,31 @@
1
- var e = Object.defineProperty;
2
- var o = (r, t) => e(r, "name", { value: t, configurable: !0 });
3
- import { clsx as m } from "clsx";
4
- import { twMerge as n } from "tailwind-merge";
5
- function p(...r) {
6
- return n(m(r));
7
- }
8
- o(p, "cn");
1
+ var a = Object.defineProperty;
2
+ var t = (r, e) => a(r, "name", { value: e, configurable: !0 });
3
+ import { clsx as c } from "clsx";
4
+ import { twMerge as f } from "tailwind-merge";
5
+ const w = /* @__PURE__ */ t((...r) => f(c(r)), "cn"), y = /* @__PURE__ */ t((r) => {
6
+ let e = "Une erreur est survenue";
7
+ return r.status === 400 ? e = "Données invalides" : typeof r.raw == "object" && r.raw.error && (e = r.raw.error), e;
8
+ }, "apiErrorDescription"), E = /* @__PURE__ */ t((r, e) => {
9
+ if (r.status === 400 && e && typeof r.raw == "object") {
10
+ let i = !0;
11
+ Object.entries(r.raw).forEach(([n, s]) => {
12
+ let o = "";
13
+ Array.isArray(s) ? o = s.join(`
14
+ `) : o = s, e.setError(
15
+ n,
16
+ {
17
+ type: "server",
18
+ message: o
19
+ },
20
+ {
21
+ shouldFocus: i
22
+ }
23
+ ), i = !1;
24
+ });
25
+ }
26
+ }, "manageApiFormErrors");
9
27
  export {
10
- p as cn
28
+ y as apiErrorDescription,
29
+ w as cn,
30
+ E as manageApiFormErrors
11
31
  };
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.20",
8
+ "version": "1.0.22",
9
9
  "type": "module",
10
10
  "files": [
11
11
  "dist"
File without changes
File without changes