fina-react-ds 1.0.16 → 1.0.18

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,29 @@
1
+ var i = Object.defineProperty;
2
+ var m = (o, e) => i(o, "name", { value: e, configurable: !0 });
3
+ import { jsx as r, jsxs as c } from "react/jsx-runtime";
4
+ import { HexColorPicker as s } from "react-colorful";
5
+ import { useFormContext as F } from "react-hook-form";
6
+ import { FormField as f, FormItem as p, FormLabel as x, FormControl as a, FormMessage as d } from "./form.js";
7
+ function P({
8
+ name: o,
9
+ label: e,
10
+ required: l = !1
11
+ }) {
12
+ const { control: n } = F();
13
+ return /* @__PURE__ */ r(
14
+ f,
15
+ {
16
+ control: n,
17
+ name: o,
18
+ render: /* @__PURE__ */ m(({ field: t }) => /* @__PURE__ */ c(p, { children: [
19
+ /* @__PURE__ */ r(x, { required: l, children: e }),
20
+ /* @__PURE__ */ r(a, { children: /* @__PURE__ */ r(s, { color: t.value ?? "", ...t }) }),
21
+ /* @__PURE__ */ r(d, {})
22
+ ] }), "render")
23
+ }
24
+ );
25
+ }
26
+ m(P, "FormColorPicker");
27
+ export {
28
+ P as FormColorPicker
29
+ };
package/dist/index.d.ts CHANGED
@@ -32,6 +32,7 @@ export { Tabs, TabsList, TabsTrigger, TabsContent } from "./components/tabs";
32
32
  export { Textarea } from "./components/textarea";
33
33
  export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider, } from "./components/tooltip";
34
34
  export { FormDate } from "./components/form-date";
35
+ export { FormColorPicker } from "./components/form-color-picker";
35
36
  export { FormFileUploader } from "./components/form-file-uploader";
36
37
  export { FormInput } from "./components/form-input";
37
38
  export { FormSelect } from "./components/form-select";
@@ -40,3 +41,4 @@ export { FormTextarea } from "./components/form-textarea";
40
41
  export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, } from "./components/form";
41
42
  export { ThemeProvider, useTheme } from "./providers/theme-provider";
42
43
  export { LoaderProvider, useLoader } from "./providers/loader-provider";
44
+ export { formatDate } from "./lib/date";
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
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
2
  import { Alert as u, AlertDescription as x, AlertTitle as D } from "./components/alert.js";
3
3
  import { Badge as T } from "./components/badge.js";
4
- import { Button as s, buttonVariants as M } from "./components/button.js";
5
- import { Avatar as c, AvatarFallback as A, AvatarImage as P } from "./components/avatar.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
6
  import { Calendar as h } from "./components/calendar.js";
7
- import { Card as I, CardAction as H, CardContent as L, CardDescription as k, CardFooter as B, CardHeader as G, CardTitle as R } from "./components/card.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
8
  import { Checkbox as O } from "./components/checkbox.js";
9
9
  import { DatePicker as E } 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";
@@ -12,18 +12,18 @@ 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 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
13
  import { FileUploader as De } from "./components/file-uploader.js";
14
14
  import { HoverCard as Te, HoverCardContent as Ce, HoverCardTrigger as se } from "./components/hover-card.js";
15
- import { Input as Fe } from "./components/input.js";
16
- import { Label as Ae } from "./components/label.js";
15
+ import { Input as Me } from "./components/input.js";
16
+ import { Label as Pe } from "./components/label.js";
17
17
  import { ModeToggle as we } from "./components/mode-toggle.js";
18
- import { Pagination as ve, PaginationContent as Ie, PaginationEllipsis as He, PaginationItem as Le, PaginationLink as ke, PaginationNext as Be, PaginationPrevious as Ge } from "./components/pagination.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
19
  import { PasswordRulesChecker as ye } from "./components/password-rules-checker.js";
20
20
  import { Popover as Ue, PopoverAnchor as Ee, PopoverContent as Ne, PopoverTrigger as Ve } from "./components/popover.js";
21
21
  import { Select as qe } from "./components/select.js";
22
22
  import { Separator as Je } from "./components/separator.js";
23
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 Mo, SidebarMenuSubItem as Fo, SidebarProvider as co, SidebarRail as Ao, SidebarSeparator as Po, SidebarTrigger as wo, useSidebar as ho } from "./components/sidebar.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
25
  import { SimplePagination as Io } from "./components/simple-pagination.js";
26
- import { SimpleTooltip as Lo } from "./components/simple-tooltip.js";
26
+ import { SimpleTooltip as ko } from "./components/simple-tooltip.js";
27
27
  import { Skeleton as Bo } from "./components/skeleton.js";
28
28
  import { Switch as Ro } from "./components/switch.js";
29
29
  import { Toaster as Oo } from "./components/sonner.js";
@@ -32,14 +32,16 @@ import { Tabs as Wo, TabsContent as Xo, TabsList as Yo, TabsTrigger as Zo } from
32
32
  import { Textarea as $o } from "./components/textarea.js";
33
33
  import { Tooltip as or, TooltipContent as rr, TooltipProvider as tr, TooltipTrigger as ar } from "./components/tooltip.js";
34
34
  import { FormDate as nr } from "./components/form-date.js";
35
- import { FormFileUploader as lr } from "./components/form-file-uploader.js";
36
- import { FormInput as mr } from "./components/form-input.js";
37
- import { FormSelect as Sr } from "./components/form-select.js";
38
- import { FormSwitch as ur } from "./components/form-switch.js";
39
- import { FormTextarea as Dr } from "./components/form-textarea.js";
40
- import { Form as Tr, FormControl as Cr, FormDescription as sr, FormField as Mr, FormItem as Fr, FormLabel as cr, FormMessage as Ar, useFormField as Pr } from "./components/form.js";
41
- import { ThemeProvider as hr, useTheme as vr } from "./providers/theme-provider.js";
42
- import { LoaderProvider as Hr, useLoader as Lr } from "./providers/loader-provider.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";
43
45
  export {
44
46
  u as Alert,
45
47
  x as AlertDescription,
@@ -56,15 +58,15 @@ export {
56
58
  S as AlertDialogTrigger,
57
59
  D as AlertTitle,
58
60
  c as Avatar,
59
- A as AvatarFallback,
60
- P as AvatarImage,
61
+ P as AvatarFallback,
62
+ A as AvatarImage,
61
63
  T as Badge,
62
64
  s as Button,
63
65
  h as Calendar,
64
66
  I as Card,
65
67
  H as CardAction,
66
- L as CardContent,
67
- k as CardDescription,
68
+ k as CardContent,
69
+ L as CardDescription,
68
70
  B as CardFooter,
69
71
  G as CardHeader,
70
72
  R as CardTitle,
@@ -97,31 +99,32 @@ export {
97
99
  be as DropdownMenuSubTrigger,
98
100
  ue as DropdownMenuTrigger,
99
101
  De as FileUploader,
100
- Tr as Form,
101
- Cr as FormControl,
102
+ sr as Form,
103
+ lr as FormColorPicker,
104
+ Fr as FormControl,
102
105
  nr as FormDate,
103
- sr as FormDescription,
104
- Mr as FormField,
105
- lr as FormFileUploader,
106
- mr as FormInput,
107
- Fr as FormItem,
108
- cr as FormLabel,
109
- Ar as FormMessage,
110
- Sr as FormSelect,
111
- ur as FormSwitch,
112
- Dr as FormTextarea,
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,
113
116
  Te as HoverCard,
114
117
  Ce as HoverCardContent,
115
118
  se as HoverCardTrigger,
116
- Fe as Input,
117
- Ae as Label,
118
- Hr as LoaderProvider,
119
+ Me as Input,
120
+ Pe as Label,
121
+ Lr as LoaderProvider,
119
122
  we as ModeToggle,
120
123
  ve as Pagination,
121
124
  Ie as PaginationContent,
122
125
  He as PaginationEllipsis,
123
- Le as PaginationItem,
124
- ke as PaginationLink,
126
+ ke as PaginationItem,
127
+ Le as PaginationLink,
125
128
  Be as PaginationNext,
126
129
  Ge as PaginationPrevious,
127
130
  ye as PasswordRulesChecker,
@@ -157,14 +160,14 @@ export {
157
160
  To as SidebarMenuItem,
158
161
  Co as SidebarMenuSkeleton,
159
162
  so as SidebarMenuSub,
160
- Mo as SidebarMenuSubButton,
161
- Fo as SidebarMenuSubItem,
163
+ Fo as SidebarMenuSubButton,
164
+ Mo as SidebarMenuSubItem,
162
165
  co as SidebarProvider,
163
- Ao as SidebarRail,
164
- Po as SidebarSeparator,
166
+ Po as SidebarRail,
167
+ Ao as SidebarSeparator,
165
168
  wo as SidebarTrigger,
166
169
  Io as SimplePagination,
167
- Lo as SimpleTooltip,
170
+ ko as SimpleTooltip,
168
171
  Bo as Skeleton,
169
172
  Ro as Switch,
170
173
  Eo as Table,
@@ -180,15 +183,16 @@ export {
180
183
  Yo as TabsList,
181
184
  Zo as TabsTrigger,
182
185
  $o as Textarea,
183
- hr as ThemeProvider,
186
+ Ir as ThemeProvider,
184
187
  Oo as Toaster,
185
188
  or as Tooltip,
186
189
  rr as TooltipContent,
187
190
  tr as TooltipProvider,
188
191
  ar as TooltipTrigger,
189
- M as buttonVariants,
190
- Pr as useFormField,
191
- Lr as useLoader,
192
+ F as buttonVariants,
193
+ Rr as formatDate,
194
+ hr as useFormField,
195
+ Br as useLoader,
192
196
  ho as useSidebar,
193
- vr as useTheme
197
+ Hr as useTheme
194
198
  };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Format date based on the provided pattern.
3
+ * @param {Date} date - The date to format
4
+ * @param {"api" | "displayDate" | "displayDateTime" | "displayTime" | string} pattern - The formatting pattern. Can be:
5
+ * - `"api"`: returns the date in format `"YYYY-MM-DD"`,
6
+ * - `"displayDate"`: returns the date in format `"DD/MM/YYYY",
7
+ * - `"displayDateTime"`: returns the date in format `"DD/MM/YYYY" HH:mm"`,
8
+ * - `"displayTime"`: returns the date in format `"HH:mm",
9
+ * - or a custom date format string (e.g. `"YYYY-MM-DD"`).
10
+ * @returns {string} The formatted date
11
+ */
12
+ declare const formatDate: (date: Date, pattern: "api" | "displayDate" | "displayDateTime" | "displayTime" | string) => string;
13
+ export { formatDate };
@@ -0,0 +1,21 @@
1
+ var m = Object.defineProperty;
2
+ var o = (r, a) => m(r, "name", { value: a, configurable: !0 });
3
+ import { format as e } from "date-fns";
4
+ import { fr as l } from "../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/fr.js";
5
+ const s = /* @__PURE__ */ o((r, a) => {
6
+ switch (a) {
7
+ case "api":
8
+ return e(r, "YYYY-MM-DD", { locale: l });
9
+ case "display":
10
+ return e(r, "DD/MM/YYYY", { locale: l });
11
+ case "displayDateTime":
12
+ return e(r, "DD/MM/YYYY HH:mm", { locale: l });
13
+ case "displayTime":
14
+ return e(r, "HH:mm", { locale: l });
15
+ default:
16
+ return e(r, a, { locale: l });
17
+ }
18
+ }, "formatDate");
19
+ export {
20
+ s as formatDate
21
+ };
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.16",
8
+ "version": "1.0.18",
9
9
  "type": "module",
10
10
  "files": [
11
11
  "dist"