fina-react-ds 1.0.13 → 1.0.15

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.
@@ -2,5 +2,5 @@ export declare function DatePicker({ placeholder, onChange, value, isClearable,
2
2
  placeholder?: string;
3
3
  onChange?: (date: Date | null) => void;
4
4
  value?: Date | null | undefined;
5
- isClearable: boolean;
5
+ isClearable?: boolean;
6
6
  }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { DatePicker } from "./date-picker";
2
+ export declare function FormDate({ name, label, required, ...props }: {
3
+ name: string;
4
+ label: string;
5
+ required?: boolean;
6
+ } & React.ComponentProps<typeof DatePicker>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,30 @@
1
+ var s = Object.defineProperty;
2
+ var m = (o, e) => s(o, "name", { value: e, configurable: !0 });
3
+ import { jsx as r, jsxs as F } from "react/jsx-runtime";
4
+ import { useFormContext as a } from "react-hook-form";
5
+ import { FormField as c, FormItem as f, FormLabel as d, FormControl as p, FormMessage as u } from "./form.js";
6
+ import { DatePicker as x } from "./date-picker.js";
7
+ function g({
8
+ name: o,
9
+ label: e,
10
+ required: t = !1,
11
+ ...i
12
+ }) {
13
+ const { control: n } = a();
14
+ return /* @__PURE__ */ r(
15
+ c,
16
+ {
17
+ control: n,
18
+ name: o,
19
+ render: /* @__PURE__ */ m(({ field: l }) => /* @__PURE__ */ F(f, { children: [
20
+ /* @__PURE__ */ r(d, { required: t, children: e }),
21
+ /* @__PURE__ */ r(p, { children: /* @__PURE__ */ r(x, { ...l, ...i, isClearable: !0 }) }),
22
+ /* @__PURE__ */ r(u, {})
23
+ ] }), "render")
24
+ }
25
+ );
26
+ }
27
+ m(g, "FormDate");
28
+ export {
29
+ g as FormDate
30
+ };
@@ -0,0 +1,6 @@
1
+ import { FileUploader } from "./file-uploader";
2
+ export declare function FormFileUploader({ name, label, required, ...props }: {
3
+ name: string;
4
+ label: string;
5
+ required?: boolean;
6
+ } & React.ComponentProps<typeof FileUploader>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,30 @@
1
+ var F = Object.defineProperty;
2
+ var m = (o, e) => F(o, "name", { value: e, configurable: !0 });
3
+ import { jsx as r, jsxs as d } from "react/jsx-runtime";
4
+ import { useFormContext as s } from "react-hook-form";
5
+ import { FormField as f, FormItem as p, FormLabel as a, FormControl as c, FormMessage as u } from "./form.js";
6
+ import { FileUploader as x } from "./file-uploader.js";
7
+ function v({
8
+ name: o,
9
+ label: e,
10
+ required: l = !1,
11
+ ...t
12
+ }) {
13
+ const { control: i } = s();
14
+ return /* @__PURE__ */ r(
15
+ f,
16
+ {
17
+ control: i,
18
+ name: o,
19
+ render: /* @__PURE__ */ m(({ field: { value: h, ...n } }) => /* @__PURE__ */ d(p, { children: [
20
+ /* @__PURE__ */ r(a, { required: l, children: e }),
21
+ /* @__PURE__ */ r(c, { children: /* @__PURE__ */ r(x, { ...n, ...t }) }),
22
+ /* @__PURE__ */ r(u, {})
23
+ ] }), "render")
24
+ }
25
+ );
26
+ }
27
+ m(v, "FormFileUploader");
28
+ export {
29
+ v as FormFileUploader
30
+ };
@@ -0,0 +1,6 @@
1
+ import { Input } from "./input";
2
+ export declare function FormInput({ name, label, required, ...props }: {
3
+ name: string;
4
+ label: string;
5
+ required: boolean;
6
+ } & React.ComponentProps<typeof Input>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,33 @@
1
+ var u = Object.defineProperty;
2
+ var t = (o, e) => u(o, "name", { value: e, configurable: !0 });
3
+ import { jsx as r, jsxs as F } from "react/jsx-runtime";
4
+ import { useFormContext as c } from "react-hook-form";
5
+ import { FormField as f, FormItem as d, FormLabel as a, FormControl as x, FormMessage as h } from "./form.js";
6
+ import { Input as I } from "./input.js";
7
+ function L({
8
+ name: o,
9
+ label: e,
10
+ required: m = !1,
11
+ ...n
12
+ }) {
13
+ const { control: l } = c();
14
+ return /* @__PURE__ */ r(
15
+ f,
16
+ {
17
+ control: l,
18
+ name: o,
19
+ render: /* @__PURE__ */ t(({ field: i }) => {
20
+ const { value: s, ...p } = i;
21
+ return /* @__PURE__ */ F(d, { children: [
22
+ /* @__PURE__ */ r(a, { required: m, children: e }),
23
+ /* @__PURE__ */ r(x, { children: /* @__PURE__ */ r(I, { value: s ?? "", ...p, ...n }) }),
24
+ /* @__PURE__ */ r(h, {})
25
+ ] });
26
+ }, "render")
27
+ }
28
+ );
29
+ }
30
+ t(L, "FormInput");
31
+ export {
32
+ L as FormInput
33
+ };
@@ -0,0 +1,13 @@
1
+ import { Select } from "./select";
2
+ export declare function FormSelect({ name, label, required, options, isMulti, isClearable, onChange, ...props }: {
3
+ name: string;
4
+ label: string;
5
+ required?: boolean;
6
+ options: {
7
+ value: string;
8
+ label: string;
9
+ }[];
10
+ isMulti?: boolean;
11
+ isClearable?: boolean;
12
+ onChange?: (value: unknown) => void;
13
+ } & React.ComponentProps<typeof Select>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,49 @@
1
+ var h = Object.defineProperty;
2
+ var o = (e, t) => h(e, "name", { value: t, configurable: !0 });
3
+ import { jsx as r, jsxs as u } from "react/jsx-runtime";
4
+ import { useFormContext as x } from "react-hook-form";
5
+ import { FormField as C, FormItem as g, FormLabel as j, FormControl as S, FormMessage as b } from "./form.js";
6
+ import { Select as I } from "./select.js";
7
+ function q({
8
+ name: e,
9
+ label: t,
10
+ required: i = !1,
11
+ options: l,
12
+ isMulti: s = !1,
13
+ isClearable: f = !0,
14
+ onChange: n = void 0,
15
+ ...c
16
+ }) {
17
+ const { control: d } = x();
18
+ return /* @__PURE__ */ r(
19
+ C,
20
+ {
21
+ control: d,
22
+ name: e,
23
+ render: /* @__PURE__ */ o(({ field: F }) => {
24
+ const { onChange: p, ...a } = F;
25
+ return /* @__PURE__ */ u(g, { children: [
26
+ /* @__PURE__ */ r(j, { required: i, children: t }),
27
+ /* @__PURE__ */ r(S, { children: /* @__PURE__ */ r(
28
+ I,
29
+ {
30
+ onChange: /* @__PURE__ */ o((m) => {
31
+ p(m), n && n(m);
32
+ }, "onChange"),
33
+ ...a,
34
+ options: l,
35
+ isMulti: s,
36
+ isClearable: f,
37
+ ...c
38
+ }
39
+ ) }),
40
+ /* @__PURE__ */ r(b, {})
41
+ ] });
42
+ }, "render")
43
+ }
44
+ );
45
+ }
46
+ o(q, "FormSelect");
47
+ export {
48
+ q as FormSelect
49
+ };
@@ -0,0 +1,4 @@
1
+ export declare function FormSwitch({ name, label }: {
2
+ name: string;
3
+ label: string;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,35 @@
1
+ var s = Object.defineProperty;
2
+ var o = (r, e) => s(r, "name", { value: e, configurable: !0 });
3
+ import { jsx as m, jsxs as f } from "react/jsx-runtime";
4
+ import { useId as h } from "react";
5
+ import { FormField as l, FormItem as d } from "./form.js";
6
+ import { Switch as p } from "./switch.js";
7
+ import { Label as a } from "./label.js";
8
+ import { useFormContext as F } from "react-hook-form";
9
+ function I({ name: r, label: e }) {
10
+ const { control: n } = F(), t = h();
11
+ return /* @__PURE__ */ m(
12
+ l,
13
+ {
14
+ control: n,
15
+ name: r,
16
+ render: /* @__PURE__ */ o(({ field: c }) => /* @__PURE__ */ f(d, { className: "fc:flex fc:items-center", children: [
17
+ /* @__PURE__ */ m(
18
+ p,
19
+ {
20
+ id: t,
21
+ checked: c.value,
22
+ onCheckedChange: /* @__PURE__ */ o((i) => {
23
+ c.onChange(i);
24
+ }, "onCheckedChange")
25
+ }
26
+ ),
27
+ /* @__PURE__ */ m(a, { htmlFor: t, children: e })
28
+ ] }), "render")
29
+ }
30
+ );
31
+ }
32
+ o(I, "FormSwitch");
33
+ export {
34
+ I as FormSwitch
35
+ };
@@ -0,0 +1,6 @@
1
+ import { Textarea } from "./textarea";
2
+ export declare function FormTextarea({ name, label, required, ...props }: {
3
+ name: string;
4
+ label: string;
5
+ required?: boolean;
6
+ } & React.ComponentProps<typeof Textarea>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,33 @@
1
+ var F = Object.defineProperty;
2
+ var t = (o, e) => F(o, "name", { value: e, configurable: !0 });
3
+ import { jsx as r, jsxs as c } from "react/jsx-runtime";
4
+ import { useFormContext as f } from "react-hook-form";
5
+ import { FormField as d, FormItem as p, FormLabel as u, FormControl as x, FormMessage as h } from "./form.js";
6
+ import { Textarea as j } from "./textarea.js";
7
+ function I({
8
+ name: o,
9
+ label: e,
10
+ required: m = !1,
11
+ ...n
12
+ }) {
13
+ const { control: l } = f();
14
+ return /* @__PURE__ */ r(
15
+ d,
16
+ {
17
+ control: l,
18
+ name: o,
19
+ render: /* @__PURE__ */ t(({ field: i }) => {
20
+ const { value: s, ...a } = i;
21
+ return /* @__PURE__ */ c(p, { children: [
22
+ /* @__PURE__ */ r(u, { required: m, children: e }),
23
+ /* @__PURE__ */ r(x, { children: /* @__PURE__ */ r(j, { value: s ?? "", ...a, ...n }) }),
24
+ /* @__PURE__ */ r(h, {})
25
+ ] });
26
+ }, "render")
27
+ }
28
+ );
29
+ }
30
+ t(I, "FormTextarea");
31
+ export {
32
+ I as FormTextarea
33
+ };
@@ -0,0 +1,26 @@
1
+ import * as React from "react";
2
+ import * as LabelPrimitive from "@radix-ui/react-label";
3
+ import { Slot } from "@radix-ui/react-slot";
4
+ import { type ControllerProps, type FieldPath, type FieldValues } from "react-hook-form";
5
+ declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: import("react-hook-form").FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
6
+ declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => import("react/jsx-runtime").JSX.Element;
7
+ declare const useFormField: () => {
8
+ invalid: boolean;
9
+ isDirty: boolean;
10
+ isTouched: boolean;
11
+ isValidating: boolean;
12
+ error?: import("react-hook-form").FieldError;
13
+ id: string;
14
+ name: string;
15
+ formItemId: string;
16
+ formDescriptionId: string;
17
+ formMessageId: string;
18
+ };
19
+ declare function FormItem({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
20
+ declare function FormLabel({ className, required, ...props }: React.ComponentProps<typeof LabelPrimitive.Root> & {
21
+ required: boolean;
22
+ }): import("react/jsx-runtime").JSX.Element;
23
+ declare function FormControl({ ...props }: React.ComponentProps<typeof Slot>): import("react/jsx-runtime").JSX.Element;
24
+ declare function FormDescription({ className, ...props }: React.ComponentProps<"p">): import("react/jsx-runtime").JSX.Element;
25
+ declare function FormMessage({ className, ...props }: React.ComponentProps<"p">): import("react/jsx-runtime").JSX.Element | null;
26
+ export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, };
@@ -0,0 +1,110 @@
1
+ var u = Object.defineProperty;
2
+ var n = (t, e) => u(t, "name", { value: e, configurable: !0 });
3
+ import { jsx as s } from "react/jsx-runtime";
4
+ import * as i from "react";
5
+ import { Root as F } from "../node_modules/@radix-ui/react-slot/dist/index.js";
6
+ import { FormProvider as x, useFormContext as I, useFormState as p, Controller as g } from "react-hook-form";
7
+ import { cn as c } from "../lib/utils.js";
8
+ import { Label as C } from "./label.js";
9
+ const M = x, f = i.createContext(
10
+ {}
11
+ ), N = /* @__PURE__ */ n(({
12
+ ...t
13
+ }) => /* @__PURE__ */ s(f.Provider, { value: { name: t.name }, children: /* @__PURE__ */ s(g, { ...t }) }), "FormField"), d = /* @__PURE__ */ n(() => {
14
+ const t = i.useContext(f), e = i.useContext(l), { getFieldState: o } = I(), r = p({ name: t.name }), m = o(t.name, r);
15
+ if (!t)
16
+ throw new Error("useFormField should be used within <FormField>");
17
+ const { id: a } = e;
18
+ return {
19
+ id: a,
20
+ name: t.name,
21
+ formItemId: `${a}-form-item`,
22
+ formDescriptionId: `${a}-form-item-description`,
23
+ formMessageId: `${a}-form-item-message`,
24
+ ...m
25
+ };
26
+ }, "useFormField"), l = i.createContext(
27
+ {}
28
+ );
29
+ function w({ className: t, ...e }) {
30
+ const o = i.useId();
31
+ return /* @__PURE__ */ s(l.Provider, { value: { id: o }, children: /* @__PURE__ */ s(
32
+ "div",
33
+ {
34
+ "data-slot": "form-item",
35
+ className: c("fc:grid fc:gap-2", t),
36
+ ...e
37
+ }
38
+ ) });
39
+ }
40
+ n(w, "FormItem");
41
+ function P({
42
+ className: t,
43
+ required: e = !1,
44
+ ...o
45
+ }) {
46
+ const { error: r, formItemId: m } = d();
47
+ return /* @__PURE__ */ s(
48
+ C,
49
+ {
50
+ "data-slot": "form-label",
51
+ "data-error": !!r,
52
+ className: c("fc:data-[error=true]:text-destructive", t),
53
+ htmlFor: m,
54
+ required: e,
55
+ ...o
56
+ }
57
+ );
58
+ }
59
+ n(P, "FormLabel");
60
+ function y({ ...t }) {
61
+ const { error: e, formItemId: o, formDescriptionId: r, formMessageId: m } = d();
62
+ return /* @__PURE__ */ s(
63
+ F,
64
+ {
65
+ "data-slot": "form-control",
66
+ id: o,
67
+ "aria-describedby": e ? `${r} ${m}` : `${r}`,
68
+ "aria-invalid": !!e,
69
+ ...t
70
+ }
71
+ );
72
+ }
73
+ n(y, "FormControl");
74
+ function L({ className: t, ...e }) {
75
+ const { formDescriptionId: o } = d();
76
+ return /* @__PURE__ */ s(
77
+ "p",
78
+ {
79
+ "data-slot": "form-description",
80
+ id: o,
81
+ className: c("fc:text-muted fc:text-sm", t),
82
+ ...e
83
+ }
84
+ );
85
+ }
86
+ n(L, "FormDescription");
87
+ function R({ className: t, ...e }) {
88
+ const { error: o, formMessageId: r } = d(), m = o ? String((o == null ? void 0 : o.message) ?? "") : e.children;
89
+ return m ? /* @__PURE__ */ s(
90
+ "p",
91
+ {
92
+ "data-slot": "form-message",
93
+ id: r,
94
+ className: c("fc:text-destructive fc:text-sm", t),
95
+ ...e,
96
+ children: m
97
+ }
98
+ ) : null;
99
+ }
100
+ n(R, "FormMessage");
101
+ export {
102
+ M as Form,
103
+ y as FormControl,
104
+ L as FormDescription,
105
+ N as FormField,
106
+ w as FormItem,
107
+ P as FormLabel,
108
+ R as FormMessage,
109
+ d as useFormField
110
+ };
package/dist/index.d.ts CHANGED
@@ -31,4 +31,12 @@ export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableC
31
31
  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
+ export { FormDate } from "./components/form-date";
35
+ export { FormFileUploader } from "./components/form-file-uploader";
36
+ export { FormInput } from "./components/form-input";
37
+ export { FormSelect } from "./components/form-select";
38
+ export { FormSwitch } from "./components/form-switch";
39
+ export { FormTextarea } from "./components/form-textarea";
40
+ export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, } from "./components/form";
34
41
  export { ThemeProvider, useTheme } from "./providers/theme-provider";
42
+ export { LoaderProvider, useLoader } from "./providers/loader-provider";
package/dist/index.js CHANGED
@@ -1,68 +1,76 @@
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 m, AlertDescription as D, AlertTitle as x } from "./components/alert.js";
3
- import { Badge as f } from "./components/badge.js";
4
- import { Button as M, buttonVariants as s } from "./components/button.js";
5
- import { Avatar as P, AvatarFallback as c, AvatarImage as w } from "./components/avatar.js";
6
- import { Calendar as v } from "./components/calendar.js";
7
- import { Card as I, CardAction as k, CardContent as F, CardDescription as B, CardFooter as G, CardHeader as L, CardTitle as R } from "./components/card.js";
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";
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";
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";
8
8
  import { Checkbox as O } from "./components/checkbox.js";
9
- import { DatePicker as N } from "./components/date-picker.js";
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";
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 le, DropdownMenuRadioItem as pe, DropdownMenuSeparator as de, DropdownMenuShortcut as ge, DropdownMenuSub as be, DropdownMenuSubContent as Se, DropdownMenuSubTrigger as ue, DropdownMenuTrigger as me } from "./components/dropdown-menu.js";
13
- import { FileUploader as xe } from "./components/file-uploader.js";
14
- import { HoverCard as fe, HoverCardContent as Ce, HoverCardTrigger as Me } from "./components/hover-card.js";
15
- import { Input as Ae } from "./components/input.js";
16
- import { Label as ce } from "./components/label.js";
17
- import { ModeToggle as he } from "./components/mode-toggle.js";
18
- import { Pagination as He, PaginationContent as Ie, PaginationEllipsis as ke, PaginationItem as Fe, PaginationLink as Be, PaginationNext as Ge, PaginationPrevious as Le } from "./components/pagination.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 Fe } from "./components/input.js";
16
+ import { Label as Ae } 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 Le, PaginationLink as ke, PaginationNext as Be, PaginationPrevious as Ge } from "./components/pagination.js";
19
19
  import { PasswordRulesChecker as ye } from "./components/password-rules-checker.js";
20
- import { Popover as Ee, PopoverAnchor as Ne, PopoverContent as Ue, PopoverTrigger as Ve } from "./components/popover.js";
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 lo, SidebarGroupContent as po, SidebarGroupLabel as go, SidebarHeader as bo, SidebarInput as So, SidebarInset as uo, SidebarMenu as mo, SidebarMenuAction as Do, SidebarMenuBadge as xo, SidebarMenuButton as To, SidebarMenuItem as fo, SidebarMenuSkeleton as Co, SidebarMenuSub as Mo, SidebarMenuSubButton as so, SidebarMenuSubItem as Ao, SidebarProvider as Po, SidebarRail as co, SidebarSeparator as wo, SidebarTrigger as ho, useSidebar as vo } 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 Mo, SidebarMenuSubItem as Fo, SidebarProvider as co, SidebarRail as Ao, SidebarSeparator as Po, 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 Fo } from "./components/simple-tooltip.js";
27
- import { Skeleton as Go } from "./components/skeleton.js";
26
+ import { SimpleTooltip as Lo } from "./components/simple-tooltip.js";
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";
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";
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
31
  import { Tabs as Wo, TabsContent as Xo, TabsList as Yo, TabsTrigger as Zo } from "./components/tabs.js";
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
- import { ThemeProvider as nr, useTheme as lr } from "./providers/theme-provider.js";
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
43
  export {
36
- m as Alert,
37
- D as AlertDescription,
44
+ u as Alert,
45
+ x as AlertDescription,
38
46
  r as AlertDialog,
39
47
  t as AlertDialogAction,
40
48
  a as AlertDialogCancel,
41
49
  i as AlertDialogContent,
42
50
  n as AlertDialogDescription,
43
- l as AlertDialogFooter,
44
- p as AlertDialogHeader,
51
+ p as AlertDialogFooter,
52
+ l as AlertDialogHeader,
45
53
  d as AlertDialogOverlay,
46
- g as AlertDialogPortal,
47
- b as AlertDialogTitle,
54
+ m as AlertDialogPortal,
55
+ g as AlertDialogTitle,
48
56
  S as AlertDialogTrigger,
49
- x as AlertTitle,
50
- P as Avatar,
51
- c as AvatarFallback,
52
- w as AvatarImage,
53
- f as Badge,
54
- M as Button,
55
- v as Calendar,
57
+ D as AlertTitle,
58
+ c as Avatar,
59
+ A as AvatarFallback,
60
+ P as AvatarImage,
61
+ T as Badge,
62
+ s as Button,
63
+ h as Calendar,
56
64
  I as Card,
57
- k as CardAction,
58
- F as CardContent,
59
- B as CardDescription,
60
- G as CardFooter,
61
- L as CardHeader,
65
+ H as CardAction,
66
+ L as CardContent,
67
+ k as CardDescription,
68
+ B as CardFooter,
69
+ G as CardHeader,
62
70
  R as CardTitle,
63
71
  O as Checkbox,
64
72
  _ as DataLoader,
65
- N as DatePicker,
73
+ E as DatePicker,
66
74
  V as Dialog,
67
75
  j as DialogClose,
68
76
  q as DialogContent,
@@ -80,32 +88,46 @@ export {
80
88
  ae as DropdownMenuItem,
81
89
  ie as DropdownMenuLabel,
82
90
  ne as DropdownMenuPortal,
83
- le as DropdownMenuRadioGroup,
84
- pe as DropdownMenuRadioItem,
91
+ pe as DropdownMenuRadioGroup,
92
+ le as DropdownMenuRadioItem,
85
93
  de as DropdownMenuSeparator,
86
- ge as DropdownMenuShortcut,
87
- be as DropdownMenuSub,
94
+ me as DropdownMenuShortcut,
95
+ ge as DropdownMenuSub,
88
96
  Se as DropdownMenuSubContent,
89
- ue as DropdownMenuSubTrigger,
90
- me as DropdownMenuTrigger,
91
- xe as FileUploader,
92
- fe as HoverCard,
97
+ be as DropdownMenuSubTrigger,
98
+ ue as DropdownMenuTrigger,
99
+ De as FileUploader,
100
+ Tr as Form,
101
+ Cr as FormControl,
102
+ 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,
113
+ Te as HoverCard,
93
114
  Ce as HoverCardContent,
94
- Me as HoverCardTrigger,
95
- Ae as Input,
96
- ce as Label,
97
- he as ModeToggle,
98
- He as Pagination,
115
+ se as HoverCardTrigger,
116
+ Fe as Input,
117
+ Ae as Label,
118
+ Hr as LoaderProvider,
119
+ we as ModeToggle,
120
+ ve as Pagination,
99
121
  Ie as PaginationContent,
100
- ke as PaginationEllipsis,
101
- Fe as PaginationItem,
102
- Be as PaginationLink,
103
- Ge as PaginationNext,
104
- Le as PaginationPrevious,
122
+ He as PaginationEllipsis,
123
+ Le as PaginationItem,
124
+ ke as PaginationLink,
125
+ Be as PaginationNext,
126
+ Ge as PaginationPrevious,
105
127
  ye as PasswordRulesChecker,
106
- Ee as Popover,
107
- Ne as PopoverAnchor,
108
- Ue as PopoverContent,
128
+ Ue as Popover,
129
+ Ee as PopoverAnchor,
130
+ Ne as PopoverContent,
109
131
  Ve as PopoverTrigger,
110
132
  qe as Select,
111
133
  Je as Separator,
@@ -122,31 +144,31 @@ export {
122
144
  ao as SidebarContent,
123
145
  io as SidebarFooter,
124
146
  no as SidebarGroup,
125
- lo as SidebarGroupAction,
126
- po as SidebarGroupContent,
127
- go as SidebarGroupLabel,
128
- bo as SidebarHeader,
147
+ po as SidebarGroupAction,
148
+ lo as SidebarGroupContent,
149
+ mo as SidebarGroupLabel,
150
+ go as SidebarHeader,
129
151
  So as SidebarInput,
130
- uo as SidebarInset,
131
- mo as SidebarMenu,
132
- Do as SidebarMenuAction,
133
- xo as SidebarMenuBadge,
134
- To as SidebarMenuButton,
135
- fo as SidebarMenuItem,
152
+ bo as SidebarInset,
153
+ uo as SidebarMenu,
154
+ xo as SidebarMenuAction,
155
+ Do as SidebarMenuBadge,
156
+ fo as SidebarMenuButton,
157
+ To as SidebarMenuItem,
136
158
  Co as SidebarMenuSkeleton,
137
- Mo as SidebarMenuSub,
138
- so as SidebarMenuSubButton,
139
- Ao as SidebarMenuSubItem,
140
- Po as SidebarProvider,
141
- co as SidebarRail,
142
- wo as SidebarSeparator,
143
- ho as SidebarTrigger,
159
+ so as SidebarMenuSub,
160
+ Mo as SidebarMenuSubButton,
161
+ Fo as SidebarMenuSubItem,
162
+ co as SidebarProvider,
163
+ Ao as SidebarRail,
164
+ Po as SidebarSeparator,
165
+ wo as SidebarTrigger,
144
166
  Io as SimplePagination,
145
- Fo as SimpleTooltip,
146
- Go as Skeleton,
167
+ Lo as SimpleTooltip,
168
+ Bo as Skeleton,
147
169
  Ro as Switch,
148
- No as Table,
149
- Uo as TableBody,
170
+ Eo as Table,
171
+ No as TableBody,
150
172
  Vo as TableCaption,
151
173
  jo as TableCell,
152
174
  qo as TableFooter,
@@ -158,13 +180,15 @@ export {
158
180
  Yo as TabsList,
159
181
  Zo as TabsTrigger,
160
182
  $o as Textarea,
161
- nr as ThemeProvider,
183
+ hr as ThemeProvider,
162
184
  Oo as Toaster,
163
185
  or as Tooltip,
164
186
  rr as TooltipContent,
165
187
  tr as TooltipProvider,
166
188
  ar as TooltipTrigger,
167
- s as buttonVariants,
168
- vo as useSidebar,
169
- lr as useTheme
189
+ M as buttonVariants,
190
+ Pr as useFormField,
191
+ Lr as useLoader,
192
+ ho as useSidebar,
193
+ vr as useTheme
170
194
  };
@@ -0,0 +1,27 @@
1
+ import { ToastT } from "sonner";
2
+ interface PromiseIExtendedResult extends ExternalToast {
3
+ message: React.ReactNode;
4
+ }
5
+ type ExternalToast = Omit<ToastT, "id" | "type" | "title" | "jsx" | "delete" | "promise"> & {
6
+ id?: number | string;
7
+ };
8
+ type PromiseExternalToast = Omit<ExternalToast, "description">;
9
+ type PromiseTExtendedResult<Data = any> = PromiseIExtendedResult | ((data: Data) => PromiseIExtendedResult | Promise<PromiseIExtendedResult>);
10
+ type PromiseTResult<Data = any> = string | React.ReactNode | ((data: Data) => React.ReactNode | string | Promise<React.ReactNode | string>);
11
+ type PromiseData<ToastData = any> = PromiseExternalToast & {
12
+ loading?: string | React.ReactNode;
13
+ success?: PromiseTResult<ToastData> | PromiseTExtendedResult<ToastData>;
14
+ error?: PromiseTResult | PromiseTExtendedResult;
15
+ description?: PromiseTResult;
16
+ finally?: () => void | Promise<void>;
17
+ };
18
+ type LoaderProviderProps = {
19
+ children: React.ReactNode;
20
+ };
21
+ type LoaderProviderState = {
22
+ isLoading: boolean;
23
+ loadingWithToast: (promise: Promise<unknown>, options: PromiseData<unknown>) => void;
24
+ };
25
+ export declare function LoaderProvider({ children, ...props }: LoaderProviderProps): import("react/jsx-runtime").JSX.Element;
26
+ export declare const useLoader: () => LoaderProviderState;
27
+ export {};
@@ -0,0 +1,34 @@
1
+ var c = Object.defineProperty;
2
+ var t = (e, o) => c(e, "name", { value: o, configurable: !0 });
3
+ import { jsxs as f, jsx as l } from "react/jsx-runtime";
4
+ import { useState as u, createContext as m, useContext as g } from "react";
5
+ import { toast as h } from "sonner";
6
+ const v = {
7
+ isLoading: !1,
8
+ loadingWithToast: /* @__PURE__ */ t(() => null, "loadingWithToast")
9
+ }, s = m(v);
10
+ function P({ children: e, ...o }) {
11
+ const [r, i] = u(!1), d = {
12
+ isLoading: r,
13
+ loadingWithToast: /* @__PURE__ */ t((a, n) => {
14
+ i(!0), n.loading || (n.loading = "Chargement en cours"), h.promise(a, n), a.finally(() => {
15
+ i(!1);
16
+ });
17
+ }, "loadingWithToast")
18
+ };
19
+ return /* @__PURE__ */ f(s.Provider, { ...o, value: d, children: [
20
+ e,
21
+ r && /* @__PURE__ */ l("div", { className: "fc:fixed fc:inset-0 fc:z-9999 fc:bg-transparent fc:pointer-events-auto" })
22
+ ] });
23
+ }
24
+ t(P, "LoaderProvider");
25
+ const w = /* @__PURE__ */ t(() => {
26
+ const e = g(s);
27
+ if (e === void 0)
28
+ throw new Error("useTheme must be used within a ThemeProvider");
29
+ return e;
30
+ }, "useLoader");
31
+ export {
32
+ P as LoaderProvider,
33
+ w as useLoader
34
+ };
@@ -188,6 +188,9 @@
188
188
  container-type: inline-size;
189
189
  container-name: card-header;
190
190
  }
191
+ .fc\:pointer-events-auto {
192
+ pointer-events: auto;
193
+ }
191
194
  .fc\:pointer-events-none {
192
195
  pointer-events: none;
193
196
  }
@@ -265,6 +268,9 @@
265
268
  .fc\:z-50 {
266
269
  z-index: 50;
267
270
  }
271
+ .fc\:z-9999 {
272
+ z-index: 9999;
273
+ }
268
274
  .fc\:col-start-2 {
269
275
  grid-column-start: 2;
270
276
  }
@@ -623,13 +629,6 @@
623
629
  .fc\:gap-6 {
624
630
  gap: calc(var(--fc-spacing) * 6);
625
631
  }
626
- .fc\:space-y-2 {
627
- :where(& > :not(:last-child)) {
628
- --tw-space-y-reverse: 0;
629
- margin-block-start: calc(calc(var(--fc-spacing) * 2) * var(--tw-space-y-reverse));
630
- margin-block-end: calc(calc(var(--fc-spacing) * 2) * calc(1 - var(--tw-space-y-reverse)));
631
- }
632
- }
633
632
  .fc\:space-y-4 {
634
633
  :where(& > :not(:last-child)) {
635
634
  --tw-space-y-reverse: 0;
@@ -2111,6 +2110,11 @@
2111
2110
  opacity: 50%;
2112
2111
  }
2113
2112
  }
2113
+ .fc\:data-\[error\=true\]\:text-destructive {
2114
+ &[data-error="true"] {
2115
+ color: var(--destructive);
2116
+ }
2117
+ }
2114
2118
  .fc\:data-\[inset\]\:pl-8 {
2115
2119
  &[data-inset] {
2116
2120
  padding-left: calc(var(--fc-spacing) * 8);
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.13",
8
+ "version": "1.0.15",
9
9
  "type": "module",
10
10
  "files": [
11
11
  "dist"
@@ -54,6 +54,7 @@
54
54
  "globals": "^15.15.0",
55
55
  "react": "^19.1.0",
56
56
  "react-dom": "^19.1.0",
57
+ "react-hook-form": "^7.60.0",
57
58
  "rimraf": "^6.0.1",
58
59
  "rollup": "^4.43.0",
59
60
  "tailwindcss": "^4.1.11",
@@ -74,6 +75,7 @@
74
75
  "react-colorful": "^5.6.1",
75
76
  "react-day-picker": "9.7.0",
76
77
  "react-dom": "^19.1.0",
78
+ "react-hook-form": "^7.60.0",
77
79
  "react-select": "^5.10.1",
78
80
  "sonner": "^2.0.5",
79
81
  "tailwind-merge": "^3.3.1"