fina-react-ds 1.0.21 → 1.0.23

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.
Files changed (110) hide show
  1. package/dist/components/alert-dialog.d.ts +1 -1
  2. package/dist/components/alert-dialog.js +65 -59
  3. package/dist/components/avatar.d.ts +1 -1
  4. package/dist/components/avatar.js +19 -19
  5. package/dist/components/badge.js +12 -11
  6. package/dist/components/button.js +12 -11
  7. package/dist/components/checkbox.d.ts +1 -1
  8. package/dist/components/checkbox.js +17 -17
  9. package/dist/components/dialog.d.ts +1 -1
  10. package/dist/components/dialog.js +60 -60
  11. package/dist/components/dropdown-menu.d.ts +1 -1
  12. package/dist/components/dropdown-menu.js +93 -93
  13. package/dist/components/form.d.ts +2 -3
  14. package/dist/components/form.js +2 -2
  15. package/dist/components/hover-card.d.ts +1 -1
  16. package/dist/components/hover-card.js +23 -23
  17. package/dist/components/label.d.ts +1 -1
  18. package/dist/components/label.js +12 -12
  19. package/dist/components/popover.d.ts +1 -1
  20. package/dist/components/popover.js +28 -28
  21. package/dist/components/separator.d.ts +1 -1
  22. package/dist/components/separator.js +10 -10
  23. package/dist/components/sheet.d.ts +1 -1
  24. package/dist/components/sheet.js +73 -73
  25. package/dist/components/sidebar.js +73 -69
  26. package/dist/components/switch.d.ts +1 -1
  27. package/dist/components/switch.js +13 -13
  28. package/dist/components/tabs.d.ts +1 -1
  29. package/dist/components/tabs.js +22 -22
  30. package/dist/components/tooltip.d.ts +1 -1
  31. package/dist/components/tooltip.js +27 -27
  32. package/dist/index.d.ts +6 -3
  33. package/dist/index.js +190 -172
  34. package/dist/lib/http.d.ts +13 -0
  35. package/dist/lib/http.js +59 -0
  36. package/dist/lib/utils.d.ts +15 -1
  37. package/dist/lib/utils.js +29 -9
  38. package/dist/lib/yup.d.ts +2 -0
  39. package/dist/lib/yup.js +88 -0
  40. package/package.json +6 -3
  41. package/dist/_virtual/index.js +0 -5
  42. package/dist/_virtual/index2.js +0 -4
  43. package/dist/_virtual/use-sync-external-store-shim.development.js +0 -4
  44. package/dist/_virtual/use-sync-external-store-shim.production.js +0 -4
  45. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +0 -534
  46. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +0 -430
  47. package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +0 -215
  48. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +0 -159
  49. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +0 -149
  50. package/dist/node_modules/@radix-ui/primitive/dist/index.js +0 -12
  51. package/dist/node_modules/@radix-ui/react-alert-dialog/dist/index.js +0 -130
  52. package/dist/node_modules/@radix-ui/react-arrow/dist/index.js +0 -24
  53. package/dist/node_modules/@radix-ui/react-avatar/dist/index.js +0 -80
  54. package/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +0 -258
  55. package/dist/node_modules/@radix-ui/react-collection/dist/index.js +0 -51
  56. package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +0 -34
  57. package/dist/node_modules/@radix-ui/react-context/dist/index.js +0 -76
  58. package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +0 -265
  59. package/dist/node_modules/@radix-ui/react-direction/dist/index.js +0 -12
  60. package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +0 -133
  61. package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +0 -230
  62. package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +0 -21
  63. package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +0 -149
  64. package/dist/node_modules/@radix-ui/react-hover-card/dist/index.js +0 -192
  65. package/dist/node_modules/@radix-ui/react-id/dist/index.js +0 -16
  66. package/dist/node_modules/@radix-ui/react-label/dist/index.js +0 -22
  67. package/dist/node_modules/@radix-ui/react-menu/dist/index.js +0 -663
  68. package/dist/node_modules/@radix-ui/react-popover/dist/index.js +0 -247
  69. package/dist/node_modules/@radix-ui/react-popper/dist/index.js +0 -224
  70. package/dist/node_modules/@radix-ui/react-portal/dist/index.js +0 -16
  71. package/dist/node_modules/@radix-ui/react-presence/dist/index.js +0 -77
  72. package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +0 -39
  73. package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js +0 -189
  74. package/dist/node_modules/@radix-ui/react-separator/dist/index.js +0 -27
  75. package/dist/node_modules/@radix-ui/react-slot/dist/index.js +0 -67
  76. package/dist/node_modules/@radix-ui/react-switch/dist/index.js +0 -136
  77. package/dist/node_modules/@radix-ui/react-tabs/dist/index.js +0 -168
  78. package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +0 -348
  79. package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +0 -16
  80. package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +0 -59
  81. package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +0 -17
  82. package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +0 -19
  83. package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +0 -6
  84. package/dist/node_modules/@radix-ui/react-use-previous/dist/index.js +0 -11
  85. package/dist/node_modules/@radix-ui/react-use-size/dist/index.js +0 -30
  86. package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.js +0 -32
  87. package/dist/node_modules/aria-hidden/dist/es2015/index.js +0 -54
  88. package/dist/node_modules/get-nonce/dist/es2015/index.js +0 -9
  89. package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js +0 -11
  90. package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +0 -116
  91. package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +0 -33
  92. package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +0 -18
  93. package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +0 -70
  94. package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js +0 -5
  95. package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js +0 -7
  96. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js +0 -73
  97. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +0 -7
  98. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +0 -27
  99. package/dist/node_modules/react-style-singleton/dist/es2015/component.js +0 -13
  100. package/dist/node_modules/react-style-singleton/dist/es2015/hook.js +0 -17
  101. package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js +0 -35
  102. package/dist/node_modules/tslib/tslib.es6.js +0 -31
  103. package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js +0 -9
  104. package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +0 -29
  105. package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js +0 -28
  106. package/dist/node_modules/use-sidecar/dist/es2015/exports.js +0 -21
  107. package/dist/node_modules/use-sidecar/dist/es2015/medium.js +0 -72
  108. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +0 -73
  109. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +0 -62
  110. package/dist/node_modules/use-sync-external-store/shim/index.js +0 -13
package/dist/index.js CHANGED
@@ -1,53 +1,56 @@
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 x } from "./components/alert-dialog.js";
2
- import { Alert as u, AlertDescription as b, AlertTitle as f } from "./components/alert.js";
1
+ import { AlertDialog as o, 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 S, AlertTitle as f } from "./components/alert.js";
3
3
  import { Badge as T } from "./components/badge.js";
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";
6
- import { Calendar as h } from "./components/calendar.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 O } from "./components/checkbox.js";
4
+ import { Button as s, buttonVariants as c } from "./components/button.js";
5
+ import { Avatar as M, AvatarFallback as A, AvatarImage as P } from "./components/avatar.js";
6
+ import { Calendar as w } from "./components/calendar.js";
7
+ import { Card as I, CardAction as H, CardContent as k, CardDescription as y, CardFooter as B, CardHeader as L, CardTitle as G } from "./components/card.js";
8
+ import { Checkbox as E } from "./components/checkbox.js";
9
9
  import { DatePicker as N } from "./components/date-picker.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";
10
+ import { Dialog as j, DialogClose as q, DialogContent as z, DialogDescription as V, 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 xe, DropdownMenuSubTrigger as Se, DropdownMenuTrigger as ue } from "./components/dropdown-menu.js";
13
- import { FileUploader as fe } 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 Be, PaginationNext as Le, PaginationPrevious as ye } from "./components/pagination.js";
19
- import { PasswordRulesChecker as Re } 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 po, SidebarGroupContent as lo, SidebarGroupLabel as mo, SidebarHeader as go, SidebarInput as xo, SidebarInset as So, SidebarMenu as uo, SidebarMenuAction as bo, SidebarMenuBadge as fo, SidebarMenuButton as Do, 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 Lo } from "./components/skeleton.js";
28
- import { Switch as Go } 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 { 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 xr } from "./components/form-input.js";
38
- import { FormSelect as ur } from "./components/form-select.js";
39
- import { FormSwitch as fr } 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 Br, useLoader as Lr } from "./providers/loader-provider.js";
44
- import { formatDate as Gr } from "./lib/dates.js";
45
- import { isNullOrEmptyString as Or } from "./lib/strings.js";
46
- import { orderBy as Nr, orderByText as Ur } from "./lib/arrays.js";
12
+ import { DropdownMenu as rr, DropdownMenuCheckboxItem as er, DropdownMenuContent as or, DropdownMenuGroup as tr, DropdownMenuItem as ar, DropdownMenuLabel as ir, DropdownMenuPortal as nr, DropdownMenuRadioGroup as pr, DropdownMenuRadioItem as lr, DropdownMenuSeparator as dr, DropdownMenuShortcut as mr, DropdownMenuSub as gr, DropdownMenuSubContent as xr, DropdownMenuSubTrigger as br, DropdownMenuTrigger as ur } from "./components/dropdown-menu.js";
13
+ import { FileUploader as fr } from "./components/file-uploader.js";
14
+ import { HoverCard as Tr, HoverCardContent as Cr, HoverCardTrigger as sr } from "./components/hover-card.js";
15
+ import { Input as Fr } from "./components/input.js";
16
+ import { Label as Ar } from "./components/label.js";
17
+ import { ModeToggle as hr } from "./components/mode-toggle.js";
18
+ import { Pagination as vr, PaginationContent as Ir, PaginationEllipsis as Hr, PaginationItem as kr, PaginationLink as yr, PaginationNext as Br, PaginationPrevious as Lr } from "./components/pagination.js";
19
+ import { PasswordRulesChecker as Rr } from "./components/password-rules-checker.js";
20
+ import { Popover as Or, PopoverAnchor as Nr, PopoverContent as Ur, PopoverTrigger as jr } from "./components/popover.js";
21
+ import { Select as zr } from "./components/select.js";
22
+ import { Separator as Jr } from "./components/separator.js";
23
+ import { Sheet as Qr, SheetBody as Wr, SheetClose as Xr, SheetContent as Yr, SheetDescription as Zr, SheetFooter as _r, SheetHeader as $r, SheetTitle as re, SheetTrigger as ee } from "./components/sheet.js";
24
+ import { Sidebar as te, SidebarContent as ae, SidebarFooter as ie, SidebarGroup as ne, SidebarGroupAction as pe, SidebarGroupContent as le, SidebarGroupLabel as de, SidebarHeader as me, SidebarInput as ge, SidebarInset as xe, SidebarMenu as be, SidebarMenuAction as ue, SidebarMenuBadge as Se, SidebarMenuButton as fe, SidebarMenuItem as De, SidebarMenuSkeleton as Te, SidebarMenuSub as Ce, SidebarMenuSubButton as se, SidebarMenuSubItem as ce, SidebarProvider as Fe, SidebarRail as Me, SidebarSeparator as Ae, SidebarTrigger as Pe, useSidebar as he } from "./components/sidebar.js";
25
+ import { SimplePagination as ve } from "./components/simple-pagination.js";
26
+ import { SimpleTooltip as He } from "./components/simple-tooltip.js";
27
+ import { Skeleton as ye } from "./components/skeleton.js";
28
+ import { Switch as Le } from "./components/switch.js";
29
+ import { Toaster as Re } from "./components/sonner.js";
30
+ import { Table as Oe, TableBody as Ne, TableCaption as Ue, TableCell as je, TableFooter as qe, TableHead as ze, TableHeader as Ve, TableRow as Je } from "./components/table.js";
31
+ import { Tabs as Qe, TabsContent as We, TabsList as Xe, TabsTrigger as Ye } from "./components/tabs.js";
32
+ import { Textarea as _e } from "./components/textarea.js";
33
+ import { Tooltip as ro, TooltipContent as eo, TooltipProvider as oo, TooltipTrigger as to } from "./components/tooltip.js";
34
+ import { FormDate as io } from "./components/form-date.js";
35
+ import { FormColorPicker as po } from "./components/form-color-picker.js";
36
+ import { FormFileUploader as mo } from "./components/form-file-uploader.js";
37
+ import { FormInput as xo } from "./components/form-input.js";
38
+ import { FormSelect as uo } from "./components/form-select.js";
39
+ import { FormSwitch as fo } from "./components/form-switch.js";
40
+ import { FormTextarea as To } from "./components/form-textarea.js";
41
+ import { Form as so, FormControl as co, FormDescription as Fo, FormField as Mo, FormItem as Ao, FormLabel as Po, FormMessage as ho, useFormField as wo } from "./components/form.js";
42
+ import { ThemeProvider as Io, useTheme as Ho } from "./providers/theme-provider.js";
43
+ import { LoaderProvider as yo, useLoader as Bo } from "./providers/loader-provider.js";
44
+ import { formatDate as Go } from "./lib/dates.js";
45
+ import { requestApi as Eo } from "./lib/http.js";
46
+ import { isNullOrEmptyString as No } from "./lib/strings.js";
47
+ import { orderBy as jo, orderByText as qo } from "./lib/arrays.js";
48
+ import { apiErrorDescription as Vo, cn as Jo, manageApiFormErrors as Ko } from "./lib/utils.js";
49
+ import { addMethod as Wo, array as Xo, boolean as Yo, date as Zo, lazy as _o, mixed as $o, number as rt, object as et, reach as ot, ref as tt, string as at } from "./lib/yup.js";
47
50
  export {
48
51
  u as Alert,
49
- b as AlertDescription,
50
- r as AlertDialog,
52
+ S as AlertDescription,
53
+ o as AlertDialog,
51
54
  t as AlertDialogAction,
52
55
  a as AlertDialogCancel,
53
56
  i as AlertDialogContent,
@@ -59,145 +62,160 @@ export {
59
62
  g as AlertDialogTitle,
60
63
  x as AlertDialogTrigger,
61
64
  f as AlertTitle,
62
- c as Avatar,
63
- P as AvatarFallback,
64
- A as AvatarImage,
65
+ M as Avatar,
66
+ A as AvatarFallback,
67
+ P as AvatarImage,
65
68
  T as Badge,
66
69
  s as Button,
67
- h as Calendar,
70
+ w as Calendar,
68
71
  I as Card,
69
72
  H as CardAction,
70
73
  k as CardContent,
71
- B as CardDescription,
72
- L as CardFooter,
73
- y as CardHeader,
74
+ y as CardDescription,
75
+ B as CardFooter,
76
+ L as CardHeader,
74
77
  G as CardTitle,
75
- O as Checkbox,
78
+ E as Checkbox,
76
79
  _ as DataLoader,
77
80
  N as DatePicker,
78
- V as Dialog,
79
- j as DialogClose,
80
- q as DialogContent,
81
- z as DialogDescription,
81
+ j as Dialog,
82
+ q as DialogClose,
83
+ z as DialogContent,
84
+ V as DialogDescription,
82
85
  J as DialogFooter,
83
86
  K as DialogHeader,
84
87
  Q as DialogOverlay,
85
88
  W as DialogPortal,
86
89
  X as DialogTitle,
87
90
  Y as DialogTrigger,
88
- ee as DropdownMenu,
89
- oe as DropdownMenuCheckboxItem,
90
- re as DropdownMenuContent,
91
- te as DropdownMenuGroup,
92
- ae as DropdownMenuItem,
93
- ie as DropdownMenuLabel,
94
- ne as DropdownMenuPortal,
95
- pe as DropdownMenuRadioGroup,
96
- le as DropdownMenuRadioItem,
97
- de as DropdownMenuSeparator,
98
- me as DropdownMenuShortcut,
99
- ge as DropdownMenuSub,
100
- xe as DropdownMenuSubContent,
101
- Se as DropdownMenuSubTrigger,
102
- ue as DropdownMenuTrigger,
103
- fe as FileUploader,
104
- sr as Form,
105
- lr as FormColorPicker,
106
- Fr as FormControl,
107
- nr as FormDate,
108
- Mr as FormDescription,
109
- cr as FormField,
110
- mr as FormFileUploader,
111
- xr as FormInput,
112
- Pr as FormItem,
113
- Ar as FormLabel,
114
- wr as FormMessage,
115
- ur as FormSelect,
116
- fr as FormSwitch,
117
- Tr as FormTextarea,
118
- Te as HoverCard,
119
- Ce as HoverCardContent,
120
- se as HoverCardTrigger,
121
- Me as Input,
122
- Pe as Label,
123
- Br as LoaderProvider,
124
- we as ModeToggle,
125
- ve as Pagination,
126
- Ie as PaginationContent,
127
- He as PaginationEllipsis,
128
- ke as PaginationItem,
129
- Be as PaginationLink,
130
- Le as PaginationNext,
131
- ye as PaginationPrevious,
132
- Re as PasswordRulesChecker,
133
- Ee as Popover,
134
- Ne as PopoverAnchor,
135
- Ue as PopoverContent,
136
- Ve as PopoverTrigger,
137
- qe as Select,
138
- Je as Separator,
139
- Qe as Sheet,
140
- We as SheetBody,
141
- Xe as SheetClose,
142
- Ye as SheetContent,
143
- Ze as SheetDescription,
144
- _e as SheetFooter,
145
- $e as SheetHeader,
146
- eo as SheetTitle,
147
- oo as SheetTrigger,
148
- to as Sidebar,
149
- ao as SidebarContent,
150
- io as SidebarFooter,
151
- no as SidebarGroup,
152
- po as SidebarGroupAction,
153
- lo as SidebarGroupContent,
154
- mo as SidebarGroupLabel,
155
- go as SidebarHeader,
156
- xo as SidebarInput,
157
- So as SidebarInset,
158
- uo as SidebarMenu,
159
- bo as SidebarMenuAction,
160
- fo as SidebarMenuBadge,
161
- Do as SidebarMenuButton,
162
- To as SidebarMenuItem,
163
- Co as SidebarMenuSkeleton,
164
- so as SidebarMenuSub,
165
- Fo as SidebarMenuSubButton,
166
- Mo as SidebarMenuSubItem,
167
- co as SidebarProvider,
168
- Po as SidebarRail,
169
- Ao as SidebarSeparator,
170
- wo as SidebarTrigger,
171
- Io as SimplePagination,
172
- ko as SimpleTooltip,
173
- Lo as Skeleton,
174
- Go as Switch,
175
- No as Table,
176
- Uo as TableBody,
177
- Vo as TableCaption,
178
- jo as TableCell,
179
- qo as TableFooter,
180
- zo as TableHead,
181
- Jo as TableHeader,
182
- Ko as TableRow,
183
- Wo as Tabs,
184
- Xo as TabsContent,
185
- Yo as TabsList,
186
- Zo as TabsTrigger,
187
- $o as Textarea,
188
- Ir as ThemeProvider,
189
- Oo as Toaster,
190
- or as Tooltip,
191
- rr as TooltipContent,
192
- tr as TooltipProvider,
193
- ar as TooltipTrigger,
194
- F as buttonVariants,
195
- Gr as formatDate,
196
- Or as isNullOrEmptyString,
197
- Nr as orderBy,
198
- Ur as orderByText,
199
- hr as useFormField,
200
- Lr as useLoader,
201
- ho as useSidebar,
202
- Hr as useTheme
91
+ rr as DropdownMenu,
92
+ er as DropdownMenuCheckboxItem,
93
+ or as DropdownMenuContent,
94
+ tr as DropdownMenuGroup,
95
+ ar as DropdownMenuItem,
96
+ ir as DropdownMenuLabel,
97
+ nr as DropdownMenuPortal,
98
+ pr as DropdownMenuRadioGroup,
99
+ lr as DropdownMenuRadioItem,
100
+ dr as DropdownMenuSeparator,
101
+ mr as DropdownMenuShortcut,
102
+ gr as DropdownMenuSub,
103
+ xr as DropdownMenuSubContent,
104
+ br as DropdownMenuSubTrigger,
105
+ ur as DropdownMenuTrigger,
106
+ fr as FileUploader,
107
+ so as Form,
108
+ po as FormColorPicker,
109
+ co as FormControl,
110
+ io as FormDate,
111
+ Fo as FormDescription,
112
+ Mo as FormField,
113
+ mo as FormFileUploader,
114
+ xo as FormInput,
115
+ Ao as FormItem,
116
+ Po as FormLabel,
117
+ ho as FormMessage,
118
+ uo as FormSelect,
119
+ fo as FormSwitch,
120
+ To as FormTextarea,
121
+ Tr as HoverCard,
122
+ Cr as HoverCardContent,
123
+ sr as HoverCardTrigger,
124
+ Fr as Input,
125
+ Ar as Label,
126
+ yo as LoaderProvider,
127
+ hr as ModeToggle,
128
+ vr as Pagination,
129
+ Ir as PaginationContent,
130
+ Hr as PaginationEllipsis,
131
+ kr as PaginationItem,
132
+ yr as PaginationLink,
133
+ Br as PaginationNext,
134
+ Lr as PaginationPrevious,
135
+ Rr as PasswordRulesChecker,
136
+ Or as Popover,
137
+ Nr as PopoverAnchor,
138
+ Ur as PopoverContent,
139
+ jr as PopoverTrigger,
140
+ zr as Select,
141
+ Jr as Separator,
142
+ Qr as Sheet,
143
+ Wr as SheetBody,
144
+ Xr as SheetClose,
145
+ Yr as SheetContent,
146
+ Zr as SheetDescription,
147
+ _r as SheetFooter,
148
+ $r as SheetHeader,
149
+ re as SheetTitle,
150
+ ee as SheetTrigger,
151
+ te as Sidebar,
152
+ ae as SidebarContent,
153
+ ie as SidebarFooter,
154
+ ne as SidebarGroup,
155
+ pe as SidebarGroupAction,
156
+ le as SidebarGroupContent,
157
+ de as SidebarGroupLabel,
158
+ me as SidebarHeader,
159
+ ge as SidebarInput,
160
+ xe as SidebarInset,
161
+ be as SidebarMenu,
162
+ ue as SidebarMenuAction,
163
+ Se as SidebarMenuBadge,
164
+ fe as SidebarMenuButton,
165
+ De as SidebarMenuItem,
166
+ Te as SidebarMenuSkeleton,
167
+ Ce as SidebarMenuSub,
168
+ se as SidebarMenuSubButton,
169
+ ce as SidebarMenuSubItem,
170
+ Fe as SidebarProvider,
171
+ Me as SidebarRail,
172
+ Ae as SidebarSeparator,
173
+ Pe as SidebarTrigger,
174
+ ve as SimplePagination,
175
+ He as SimpleTooltip,
176
+ ye as Skeleton,
177
+ Le as Switch,
178
+ Oe as Table,
179
+ Ne as TableBody,
180
+ Ue as TableCaption,
181
+ je as TableCell,
182
+ qe as TableFooter,
183
+ ze as TableHead,
184
+ Ve as TableHeader,
185
+ Je as TableRow,
186
+ Qe as Tabs,
187
+ We as TabsContent,
188
+ Xe as TabsList,
189
+ Ye as TabsTrigger,
190
+ _e as Textarea,
191
+ Io as ThemeProvider,
192
+ Re as Toaster,
193
+ ro as Tooltip,
194
+ eo as TooltipContent,
195
+ oo as TooltipProvider,
196
+ to as TooltipTrigger,
197
+ Wo as addMethod,
198
+ Vo as apiErrorDescription,
199
+ Xo as array,
200
+ Yo as boolean,
201
+ c as buttonVariants,
202
+ Jo as cn,
203
+ Zo as date,
204
+ Go as formatDate,
205
+ No as isNullOrEmptyString,
206
+ _o as lazy,
207
+ Ko as manageApiFormErrors,
208
+ $o as mixed,
209
+ rt as number,
210
+ et as object,
211
+ jo as orderBy,
212
+ qo as orderByText,
213
+ ot as reach,
214
+ tt as ref,
215
+ Eo as requestApi,
216
+ at as string,
217
+ wo as useFormField,
218
+ Bo as useLoader,
219
+ he as useSidebar,
220
+ Ho as useTheme
203
221
  };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Makes a HTTP request to the API.
3
+ * @param {"GET" | "POST" | "PUT" | "PATCH" | "DELETE"} method - The HTTP method
4
+ * @param {string} route - The route to call (do not include any prefixes, host or port)
5
+ * @param {Object} queryParams - The query params to add to the URL
6
+ * @param {(FormData | Object)} body - The request's body
7
+ * @param {Object} headers - Additional headers to include in the request
8
+ * @param {boolean} isMultipart - Indicates if the request should be multipart/form-data.
9
+ * @returns {Promise<Object>} The response from the API.
10
+ * @throws {ApiClientError} If the request fails, an error object with the status code, raw response, and a message is returned.
11
+ */
12
+ declare const requestApi: (method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", route: string, queryParams?: object | null, body?: FormData | object | null, headers?: object | null, isMultipart?: boolean) => Promise<any>;
13
+ export { requestApi };
@@ -0,0 +1,59 @@
1
+ var p = Object.defineProperty;
2
+ var s = (t, r) => p(t, "name", { value: r, configurable: !0 });
3
+ import m from "qs";
4
+ import { joinURL as j } from "ufo";
5
+ const h = /* @__PURE__ */ s((t) => t != null, "valueExists"), d = /* @__PURE__ */ s((t, r) => {
6
+ if (t) {
7
+ if (t instanceof FormData)
8
+ return t;
9
+ if (r) {
10
+ const e = new FormData();
11
+ for (const a in t)
12
+ Object.keys(t).forEach((n) => {
13
+ if (Array.isArray(t[n]))
14
+ for (const o of t[n])
15
+ e.append(`${a}[]`, o || "");
16
+ else
17
+ e.append(a, h(t[n]) ? t[n] : "");
18
+ });
19
+ return e;
20
+ }
21
+ return JSON.stringify(t);
22
+ }
23
+ }, "formatBodyForRequest"), g = /* @__PURE__ */ s((t, r = null) => {
24
+ let e = j(void 0, t);
25
+ return r && (e += `?${m.stringify(r, { encode: !1 })}`), e;
26
+ }, "formatUrlForRequest"), A = /* @__PURE__ */ s(async (t, r, e = null, a = null, n = null, o = !1) => {
27
+ const u = new Headers({
28
+ Accept: "application/json",
29
+ ...n
30
+ });
31
+ !o && !(a instanceof FormData) && u.append("Content-Type", "application/json");
32
+ const c = {
33
+ method: t,
34
+ headers: u,
35
+ body: d(a, o)
36
+ };
37
+ let i = null;
38
+ const l = await fetch(
39
+ g(r, e),
40
+ c
41
+ ).catch((f) => (i = f, null));
42
+ return i ? Promise.reject(i) : w(l);
43
+ }, "requestApi"), w = /* @__PURE__ */ s(async (t) => {
44
+ if (t.status === 204)
45
+ return Promise.resolve(null);
46
+ const r = await (t.headers.get("Content-Type") === "application/json" ? t.json() : t.blob()).catch(() => "Response parsing error");
47
+ return t.status >= 200 && t.status < 300 ? Promise.resolve(r) : t.status >= 400 && t.status <= 500 ? Promise.reject({
48
+ status: t.status,
49
+ raw: r,
50
+ message: r
51
+ }) : Promise.reject({
52
+ status: t.status,
53
+ raw: "",
54
+ message: ""
55
+ });
56
+ }, "handleResponse");
57
+ export {
58
+ A as requestApi
59
+ };
@@ -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
  };
@@ -0,0 +1,2 @@
1
+ import * as yup from "yup";
2
+ export declare const string: typeof yup.string, number: typeof yup.number, boolean: typeof yup.bool, date: typeof yup.date, array: typeof yup.array, object: typeof yup.object, mixed: typeof yup.mixed, ref: typeof yup.ref, lazy: typeof yup.lazy, reach: typeof yup.reach, addMethod: typeof yup.addMethod;
@@ -0,0 +1,88 @@
1
+ var r = Object.defineProperty;
2
+ var t = (e, i) => r(e, "name", { value: i, configurable: !0 });
3
+ import * as a from "yup";
4
+ a.setLocale({
5
+ mixed: {
6
+ default: "Ce champ est invalide",
7
+ required: "Ce champ est obligatoire",
8
+ defined: "Ce champ doit être défini",
9
+ notNull: "Ce champ ne doit pas être nul",
10
+ oneOf: "Ce champ doit être l’un des suivants : ${values}",
11
+ notOneOf: "Ce champ ne doit pas être l’un des suivants : ${values}",
12
+ notType: /* @__PURE__ */ t(({ type: e }) => {
13
+ switch (e) {
14
+ case "array":
15
+ return "Ce champ doit être un tableau";
16
+ case "date":
17
+ return "Ce champ doit être un date";
18
+ case "number":
19
+ return "Ce champ doit être un nombre";
20
+ case "object":
21
+ return "Ce champ doit être un object";
22
+ case "string":
23
+ return "Ce champ doit être une chaîne de caractères";
24
+ case "boolean":
25
+ return "Ce champ doit être un booléen";
26
+ default:
27
+ return "Type invalide";
28
+ }
29
+ }, "notType")
30
+ },
31
+ string: {
32
+ length: "Ce champ doit contenir exactement ${length} caractères",
33
+ min: "Ce champ doit contenir au minimum ${min} caractères",
34
+ max: "Ce champ doit contenir au maximum ${max} caractères",
35
+ matches: "Ce champ doit correspondre au format requis",
36
+ email: "Veuillez saisir une adresse email valide",
37
+ url: "Veuillez saisir une URL valide",
38
+ uuid: "Veuillez saisir un UUID valide",
39
+ datetime: "Veuillez saisir une date et heure valide",
40
+ trim: "Ce champ ne doit pas contenir d’espaces vides",
41
+ lowercase: "Ce champ doit être en minuscules",
42
+ uppercase: "Ce champ doit être en majuscules"
43
+ },
44
+ number: {
45
+ min: "Ce champ doit être supérieur ou égal à ${min}",
46
+ max: "Ce champ doit être inférieur ou égal à ${max}",
47
+ lessThan: "Ce champ doit être inférieur à ${less}",
48
+ moreThan: "Ce champ doit être supérieur à ${more}",
49
+ positive: "Ce champ doit être un nombre positif",
50
+ negative: "Ce champ doit être un nombre négatif",
51
+ integer: "Ce champ doit être un nombre entier"
52
+ },
53
+ date: {
54
+ min: "Cette date doit être postérieure au ${min}",
55
+ max: "Cette date doit être antérieure au ${max}"
56
+ },
57
+ array: {
58
+ min: "Ce champ doit contenir au minimum ${min} éléments",
59
+ max: "Ce champ doit contenir au maximum ${max} éléments",
60
+ length: "Ce champ doit contenir exactement ${length} éléments"
61
+ }
62
+ });
63
+ const {
64
+ string: m,
65
+ number: o,
66
+ boolean: u,
67
+ date: c,
68
+ array: s,
69
+ object: d,
70
+ mixed: l,
71
+ ref: p,
72
+ lazy: h,
73
+ reach: C,
74
+ addMethod: b
75
+ } = a;
76
+ export {
77
+ b as addMethod,
78
+ s as array,
79
+ u as boolean,
80
+ c as date,
81
+ h as lazy,
82
+ l as mixed,
83
+ o as number,
84
+ d as object,
85
+ C as reach,
86
+ p as ref,
87
+ m as string
88
+ };