fina-react-ds 1.0.25 → 1.0.28
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/components/alert-dialog.js +22 -22
- package/dist/components/alert.js +26 -26
- package/dist/components/avatar.js +19 -19
- package/dist/components/badge.js +20 -20
- package/dist/components/button.js +52 -52
- package/dist/components/calendar.js +83 -83
- package/dist/components/card.js +46 -46
- package/dist/components/checkbox.js +21 -21
- package/dist/components/date-picker.js +23 -23
- package/dist/components/dialog.js +38 -38
- package/dist/components/dropdown-menu.js +23 -23
- package/dist/components/file-uploader.js +47 -47
- package/dist/components/form-switch.js +9 -9
- package/dist/components/form.js +15 -15
- package/dist/components/hover-card.js +5 -5
- package/dist/components/input.js +15 -15
- package/dist/components/label.js +17 -17
- package/dist/components/mode-toggle.js +17 -17
- package/dist/components/pagination.js +25 -25
- package/dist/components/popover.js +8 -8
- package/dist/components/select.js +38 -38
- package/dist/components/sheet.js +78 -76
- package/dist/components/sidebar.js +198 -198
- package/dist/components/skeleton.js +7 -7
- package/dist/components/sonner.js +3 -3
- package/dist/components/switch.js +20 -20
- package/dist/components/table.js +44 -44
- package/dist/components/tabs.js +29 -29
- package/dist/components/textarea.js +12 -12
- package/dist/components/tooltip.js +14 -14
- package/dist/providers/loader-provider.js +7 -7
- package/dist/themes/base.css +985 -884
- package/package.json +1 -1
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
var
|
|
2
|
-
var e = (t, a) =>
|
|
3
|
-
import { jsx as o, jsxs as
|
|
4
|
-
import { Dialog as
|
|
5
|
-
import { XIcon as
|
|
6
|
-
import { cn as
|
|
1
|
+
var d = Object.defineProperty;
|
|
2
|
+
var e = (t, a) => d(t, "name", { value: a, configurable: !0 });
|
|
3
|
+
import { jsx as o, jsxs as i } from "react/jsx-runtime";
|
|
4
|
+
import { Dialog as l } from "radix-ui";
|
|
5
|
+
import { XIcon as c } from "lucide-react";
|
|
6
|
+
import { cn as n } from "../lib/utils.js";
|
|
7
7
|
function D({
|
|
8
8
|
...t
|
|
9
9
|
}) {
|
|
10
|
-
return /* @__PURE__ */ o(
|
|
10
|
+
return /* @__PURE__ */ o(l.Root, { "data-slot": "dialog", ...t });
|
|
11
11
|
}
|
|
12
12
|
e(D, "Dialog");
|
|
13
13
|
function h({
|
|
14
14
|
...t
|
|
15
15
|
}) {
|
|
16
|
-
return /* @__PURE__ */ o(
|
|
16
|
+
return /* @__PURE__ */ o(l.Trigger, { "data-slot": "dialog-trigger", ...t });
|
|
17
17
|
}
|
|
18
18
|
e(h, "DialogTrigger");
|
|
19
|
-
function
|
|
19
|
+
function g({
|
|
20
20
|
...t
|
|
21
21
|
}) {
|
|
22
|
-
return /* @__PURE__ */ o(
|
|
22
|
+
return /* @__PURE__ */ o(l.Portal, { "data-slot": "dialog-portal", ...t });
|
|
23
23
|
}
|
|
24
|
-
e(
|
|
24
|
+
e(g, "DialogPortal");
|
|
25
25
|
function b({
|
|
26
26
|
...t
|
|
27
27
|
}) {
|
|
28
|
-
return /* @__PURE__ */ o(
|
|
28
|
+
return /* @__PURE__ */ o(l.Close, { "data-slot": "dialog-close", ...t });
|
|
29
29
|
}
|
|
30
30
|
e(b, "DialogClose");
|
|
31
|
-
function
|
|
31
|
+
function u({
|
|
32
32
|
className: t,
|
|
33
33
|
...a
|
|
34
34
|
}) {
|
|
35
35
|
return /* @__PURE__ */ o(
|
|
36
|
-
|
|
36
|
+
l.Overlay,
|
|
37
37
|
{
|
|
38
38
|
"data-slot": "dialog-overlay",
|
|
39
|
-
className:
|
|
40
|
-
"
|
|
39
|
+
className: n(
|
|
40
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 overflow-auto",
|
|
41
41
|
t
|
|
42
42
|
),
|
|
43
43
|
...a
|
|
44
44
|
}
|
|
45
45
|
);
|
|
46
46
|
}
|
|
47
|
-
e(
|
|
47
|
+
e(u, "DialogOverlay");
|
|
48
48
|
function y({
|
|
49
49
|
className: t,
|
|
50
50
|
children: a,
|
|
51
|
-
showCloseButton:
|
|
52
|
-
...
|
|
51
|
+
showCloseButton: s = !0,
|
|
52
|
+
...r
|
|
53
53
|
}) {
|
|
54
|
-
return /* @__PURE__ */ o(
|
|
55
|
-
|
|
54
|
+
return /* @__PURE__ */ o(g, { "data-slot": "dialog-portal", children: /* @__PURE__ */ o(u, { children: /* @__PURE__ */ i(
|
|
55
|
+
l.Content,
|
|
56
56
|
{
|
|
57
57
|
"data-slot": "dialog-content",
|
|
58
|
-
className:
|
|
59
|
-
"
|
|
58
|
+
className: n(
|
|
59
|
+
"relative bg-card data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 z-50 grid w-full max-w-[calc(100%-2rem)] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg mx-auto my-10",
|
|
60
60
|
t
|
|
61
61
|
),
|
|
62
|
-
...
|
|
62
|
+
...r,
|
|
63
63
|
children: [
|
|
64
64
|
a,
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
s && /* @__PURE__ */ i(
|
|
66
|
+
l.Close,
|
|
67
67
|
{
|
|
68
68
|
"data-slot": "dialog-close",
|
|
69
|
-
className: "
|
|
69
|
+
className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
70
70
|
children: [
|
|
71
|
-
/* @__PURE__ */ o(
|
|
72
|
-
/* @__PURE__ */ o("span", { className: "
|
|
71
|
+
/* @__PURE__ */ o(c, {}),
|
|
72
|
+
/* @__PURE__ */ o("span", { className: "sr-only", children: "Close" })
|
|
73
73
|
]
|
|
74
74
|
}
|
|
75
75
|
)
|
|
@@ -83,7 +83,7 @@ function N({ className: t, ...a }) {
|
|
|
83
83
|
"div",
|
|
84
84
|
{
|
|
85
85
|
"data-slot": "dialog-header",
|
|
86
|
-
className:
|
|
86
|
+
className: n("flex flex-col gap-2 text-center sm:text-left", t),
|
|
87
87
|
...a
|
|
88
88
|
}
|
|
89
89
|
);
|
|
@@ -94,8 +94,8 @@ function w({ className: t, ...a }) {
|
|
|
94
94
|
"div",
|
|
95
95
|
{
|
|
96
96
|
"data-slot": "dialog-footer",
|
|
97
|
-
className:
|
|
98
|
-
"
|
|
97
|
+
className: n(
|
|
98
|
+
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
99
99
|
t
|
|
100
100
|
),
|
|
101
101
|
...a
|
|
@@ -108,10 +108,10 @@ function z({
|
|
|
108
108
|
...a
|
|
109
109
|
}) {
|
|
110
110
|
return /* @__PURE__ */ o(
|
|
111
|
-
|
|
111
|
+
l.Title,
|
|
112
112
|
{
|
|
113
113
|
"data-slot": "dialog-title",
|
|
114
|
-
className:
|
|
114
|
+
className: n("text-lg leading-none font-semibold", t),
|
|
115
115
|
...a
|
|
116
116
|
}
|
|
117
117
|
);
|
|
@@ -122,10 +122,10 @@ function C({
|
|
|
122
122
|
...a
|
|
123
123
|
}) {
|
|
124
124
|
return /* @__PURE__ */ o(
|
|
125
|
-
|
|
125
|
+
l.Description,
|
|
126
126
|
{
|
|
127
127
|
"data-slot": "dialog-description",
|
|
128
|
-
className:
|
|
128
|
+
className: n("text-muted text-sm", t),
|
|
129
129
|
...a
|
|
130
130
|
}
|
|
131
131
|
);
|
|
@@ -138,8 +138,8 @@ export {
|
|
|
138
138
|
C as DialogDescription,
|
|
139
139
|
w as DialogFooter,
|
|
140
140
|
N as DialogHeader,
|
|
141
|
-
|
|
142
|
-
|
|
141
|
+
u as DialogOverlay,
|
|
142
|
+
g as DialogPortal,
|
|
143
143
|
z as DialogTitle,
|
|
144
144
|
h as DialogTrigger
|
|
145
145
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var
|
|
2
|
-
var a = (e, o) =>
|
|
3
|
-
import { jsx as t, jsxs as
|
|
1
|
+
var u = Object.defineProperty;
|
|
2
|
+
var a = (e, o) => u(e, "name", { value: o, configurable: !0 });
|
|
3
|
+
import { jsx as t, jsxs as i } from "react/jsx-runtime";
|
|
4
4
|
import { DropdownMenu as n } from "radix-ui";
|
|
5
|
-
import { CheckIcon as
|
|
5
|
+
import { CheckIcon as c, CircleIcon as l, ChevronRightIcon as p } from "lucide-react";
|
|
6
6
|
import { cn as d } from "../lib/utils.js";
|
|
7
7
|
function x({
|
|
8
8
|
...e
|
|
@@ -39,7 +39,7 @@ function z({
|
|
|
39
39
|
"data-slot": "dropdown-menu-content",
|
|
40
40
|
sideOffset: o,
|
|
41
41
|
className: d(
|
|
42
|
-
"
|
|
42
|
+
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
|
|
43
43
|
e
|
|
44
44
|
),
|
|
45
45
|
...r
|
|
@@ -57,7 +57,7 @@ function M({
|
|
|
57
57
|
className: e,
|
|
58
58
|
inset: o,
|
|
59
59
|
variant: r = "default",
|
|
60
|
-
...
|
|
60
|
+
...s
|
|
61
61
|
}) {
|
|
62
62
|
return /* @__PURE__ */ t(
|
|
63
63
|
n.Item,
|
|
@@ -66,10 +66,10 @@ function M({
|
|
|
66
66
|
"data-inset": o,
|
|
67
67
|
"data-variant": r,
|
|
68
68
|
className: d(
|
|
69
|
-
"
|
|
69
|
+
"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
70
70
|
e
|
|
71
71
|
),
|
|
72
|
-
...
|
|
72
|
+
...s
|
|
73
73
|
}
|
|
74
74
|
);
|
|
75
75
|
}
|
|
@@ -78,9 +78,9 @@ function N({
|
|
|
78
78
|
className: e,
|
|
79
79
|
children: o,
|
|
80
80
|
checked: r,
|
|
81
|
-
...
|
|
81
|
+
...s
|
|
82
82
|
}) {
|
|
83
|
-
return /* @__PURE__ */
|
|
83
|
+
return /* @__PURE__ */ i(
|
|
84
84
|
n.CheckboxItem,
|
|
85
85
|
{
|
|
86
86
|
"data-slot": "dropdown-menu-checkbox-item",
|
|
@@ -89,9 +89,9 @@ function N({
|
|
|
89
89
|
e
|
|
90
90
|
),
|
|
91
91
|
checked: r,
|
|
92
|
-
...
|
|
92
|
+
...s,
|
|
93
93
|
children: [
|
|
94
|
-
/* @__PURE__ */ t("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ t(n.ItemIndicator, { children: /* @__PURE__ */ t(
|
|
94
|
+
/* @__PURE__ */ t("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ t(n.ItemIndicator, { children: /* @__PURE__ */ t(c, { className: "size-4" }) }) }),
|
|
95
95
|
o
|
|
96
96
|
]
|
|
97
97
|
}
|
|
@@ -115,7 +115,7 @@ function y({
|
|
|
115
115
|
children: o,
|
|
116
116
|
...r
|
|
117
117
|
}) {
|
|
118
|
-
return /* @__PURE__ */
|
|
118
|
+
return /* @__PURE__ */ i(
|
|
119
119
|
n.RadioItem,
|
|
120
120
|
{
|
|
121
121
|
"data-slot": "dropdown-menu-radio-item",
|
|
@@ -125,7 +125,7 @@ function y({
|
|
|
125
125
|
),
|
|
126
126
|
...r,
|
|
127
127
|
children: [
|
|
128
|
-
/* @__PURE__ */ t("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ t(n.ItemIndicator, { children: /* @__PURE__ */ t(
|
|
128
|
+
/* @__PURE__ */ t("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ t(n.ItemIndicator, { children: /* @__PURE__ */ t(l, { className: "size-2 fill-current" }) }) }),
|
|
129
129
|
o
|
|
130
130
|
]
|
|
131
131
|
}
|
|
@@ -143,7 +143,7 @@ function _({
|
|
|
143
143
|
"data-slot": "dropdown-menu-label",
|
|
144
144
|
"data-inset": o,
|
|
145
145
|
className: d(
|
|
146
|
-
"
|
|
146
|
+
"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
|
|
147
147
|
e
|
|
148
148
|
),
|
|
149
149
|
...r
|
|
@@ -159,7 +159,7 @@ function k({
|
|
|
159
159
|
n.Separator,
|
|
160
160
|
{
|
|
161
161
|
"data-slot": "dropdown-menu-separator",
|
|
162
|
-
className: d("
|
|
162
|
+
className: d("bg-border -mx-1 my-1 h-px", e),
|
|
163
163
|
...o
|
|
164
164
|
}
|
|
165
165
|
);
|
|
@@ -174,7 +174,7 @@ function C({
|
|
|
174
174
|
{
|
|
175
175
|
"data-slot": "dropdown-menu-shortcut",
|
|
176
176
|
className: d(
|
|
177
|
-
"
|
|
177
|
+
"text-muted ml-auto text-xs tracking-widest",
|
|
178
178
|
e
|
|
179
179
|
),
|
|
180
180
|
...o
|
|
@@ -192,21 +192,21 @@ function R({
|
|
|
192
192
|
className: e,
|
|
193
193
|
inset: o,
|
|
194
194
|
children: r,
|
|
195
|
-
...
|
|
195
|
+
...s
|
|
196
196
|
}) {
|
|
197
|
-
return /* @__PURE__ */
|
|
197
|
+
return /* @__PURE__ */ i(
|
|
198
198
|
n.SubTrigger,
|
|
199
199
|
{
|
|
200
200
|
"data-slot": "dropdown-menu-sub-trigger",
|
|
201
201
|
"data-inset": o,
|
|
202
202
|
className: d(
|
|
203
|
-
"
|
|
203
|
+
"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",
|
|
204
204
|
e
|
|
205
205
|
),
|
|
206
|
-
...
|
|
206
|
+
...s,
|
|
207
207
|
children: [
|
|
208
208
|
r,
|
|
209
|
-
/* @__PURE__ */ t(
|
|
209
|
+
/* @__PURE__ */ t(p, { className: "ml-auto size-4" })
|
|
210
210
|
]
|
|
211
211
|
}
|
|
212
212
|
);
|
|
@@ -221,7 +221,7 @@ function j({
|
|
|
221
221
|
{
|
|
222
222
|
"data-slot": "dropdown-menu-sub-content",
|
|
223
223
|
className: d(
|
|
224
|
-
"
|
|
224
|
+
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
|
|
225
225
|
e
|
|
226
226
|
),
|
|
227
227
|
...o
|
|
@@ -1,109 +1,109 @@
|
|
|
1
1
|
var F = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
import { jsxs as
|
|
4
|
-
import { useState as j, useImperativeHandle as k, useCallback as
|
|
2
|
+
var l = (r, c) => F(r, "name", { value: c, configurable: !0 });
|
|
3
|
+
import { jsxs as s, jsx as i, Fragment as p } from "react/jsx-runtime";
|
|
4
|
+
import { useState as j, useImperativeHandle as k, useCallback as f } from "react";
|
|
5
5
|
import { FileIcon as D, UploadIcon as I } from "lucide-react";
|
|
6
6
|
import { useDropzone as S } from "react-dropzone";
|
|
7
|
-
import { cn as
|
|
7
|
+
import { cn as o } from "../lib/utils.js";
|
|
8
8
|
import { Button as w } from "./button.js";
|
|
9
9
|
function T({
|
|
10
|
-
onChange:
|
|
11
|
-
"aria-invalid":
|
|
10
|
+
onChange: r,
|
|
11
|
+
"aria-invalid": c,
|
|
12
12
|
fileTypes: b,
|
|
13
13
|
ref: x
|
|
14
14
|
}) {
|
|
15
|
-
const [
|
|
15
|
+
const [a, d] = j([]);
|
|
16
16
|
k(x, () => ({
|
|
17
|
-
focus: /* @__PURE__ */
|
|
17
|
+
focus: /* @__PURE__ */ l(() => {
|
|
18
18
|
e != null && e.current && e.current.focus();
|
|
19
19
|
}, "focus")
|
|
20
20
|
}));
|
|
21
|
-
const v =
|
|
22
|
-
(
|
|
23
|
-
|
|
21
|
+
const v = f(
|
|
22
|
+
(t) => {
|
|
23
|
+
d(t), r == null || r(t.length > 0 ? t[0] : null);
|
|
24
24
|
},
|
|
25
|
-
[
|
|
26
|
-
), g = /* @__PURE__ */
|
|
25
|
+
[r]
|
|
26
|
+
), g = /* @__PURE__ */ l(() => {
|
|
27
27
|
e != null && e.current && e.current.focus();
|
|
28
|
-
}, "handleFileDialogCancel"), { getRootProps: h, getInputProps: y, acceptedFiles:
|
|
28
|
+
}, "handleFileDialogCancel"), { getRootProps: h, getInputProps: y, acceptedFiles: u, open: N, rootRef: e } = S({
|
|
29
29
|
maxFiles: 1,
|
|
30
30
|
noClick: !0,
|
|
31
31
|
onDrop: v,
|
|
32
32
|
onFileDialogCancel: g
|
|
33
|
-
}), z =
|
|
34
|
-
let
|
|
35
|
-
return
|
|
33
|
+
}), z = f((t) => {
|
|
34
|
+
let n = 0, m = "ko";
|
|
35
|
+
return n = t.size / 1e3, n > 1e3 && (n /= 1e3, m = "mo"), n.toFixed(2) + " " + m;
|
|
36
36
|
}, []);
|
|
37
|
-
return /* @__PURE__ */
|
|
37
|
+
return /* @__PURE__ */ s(
|
|
38
38
|
"div",
|
|
39
39
|
{
|
|
40
40
|
...h(),
|
|
41
|
-
className:
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
41
|
+
className: o(
|
|
42
|
+
"bg-input border border-input-border flex flex-col h-50 w-full rounded-md px-3 py-1 text-base shadow-xs items-center justify-center md:text-sm outline-none",
|
|
43
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
44
|
+
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive"
|
|
45
45
|
),
|
|
46
|
-
"aria-invalid":
|
|
46
|
+
"aria-invalid": c,
|
|
47
47
|
children: [
|
|
48
|
-
|
|
49
|
-
/* @__PURE__ */
|
|
48
|
+
a.length > 0 && /* @__PURE__ */ s(p, { children: [
|
|
49
|
+
/* @__PURE__ */ i(
|
|
50
50
|
"div",
|
|
51
51
|
{
|
|
52
|
-
className:
|
|
53
|
-
"
|
|
52
|
+
className: o(
|
|
53
|
+
"bg-primary text-primary-foreground flex items-center justify-center rounded-full size-10 mb-4"
|
|
54
54
|
),
|
|
55
|
-
children: /* @__PURE__ */
|
|
55
|
+
children: /* @__PURE__ */ i(D, { className: "size-4" })
|
|
56
56
|
}
|
|
57
57
|
),
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
z(
|
|
58
|
+
/* @__PURE__ */ s("div", { className: "mb-4 text-center", children: [
|
|
59
|
+
u[0].name,
|
|
60
|
+
/* @__PURE__ */ i("br", {}),
|
|
61
|
+
z(u[0])
|
|
62
62
|
] }),
|
|
63
|
-
/* @__PURE__ */
|
|
63
|
+
/* @__PURE__ */ i(
|
|
64
64
|
w,
|
|
65
65
|
{
|
|
66
66
|
type: "button",
|
|
67
67
|
color: "destructive",
|
|
68
68
|
variant: "ghost",
|
|
69
|
-
onClick: /* @__PURE__ */
|
|
70
|
-
var
|
|
71
|
-
|
|
69
|
+
onClick: /* @__PURE__ */ l(() => {
|
|
70
|
+
var t;
|
|
71
|
+
d([]), r == null || r(null), (t = e == null ? void 0 : e.current) == null || t.focus();
|
|
72
72
|
}, "onClick"),
|
|
73
73
|
children: "Supprimer"
|
|
74
74
|
}
|
|
75
75
|
)
|
|
76
76
|
] }),
|
|
77
|
-
|
|
78
|
-
/* @__PURE__ */
|
|
77
|
+
a.length === 0 && /* @__PURE__ */ s(p, { children: [
|
|
78
|
+
/* @__PURE__ */ i(
|
|
79
79
|
"div",
|
|
80
80
|
{
|
|
81
|
-
className:
|
|
82
|
-
"
|
|
81
|
+
className: o(
|
|
82
|
+
"bg-primary text-primary-foreground flex items-center justify-center rounded-full size-10 mb-4"
|
|
83
83
|
),
|
|
84
|
-
children: /* @__PURE__ */
|
|
84
|
+
children: /* @__PURE__ */ i(I, { className: "size-4" })
|
|
85
85
|
}
|
|
86
86
|
),
|
|
87
|
-
/* @__PURE__ */
|
|
87
|
+
/* @__PURE__ */ s("div", { className: "mb-4", children: [
|
|
88
88
|
"Glisser-déposer ou",
|
|
89
89
|
" ",
|
|
90
|
-
/* @__PURE__ */
|
|
90
|
+
/* @__PURE__ */ i("span", { className: "font-bold underline cursor-pointer", onClick: N, children: "Choisir un fichier" }),
|
|
91
91
|
" ",
|
|
92
92
|
"à uploader"
|
|
93
93
|
] }),
|
|
94
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ s("div", { className: "text-center text-sm md:text-xs", children: [
|
|
95
95
|
"Formats acceptés : ",
|
|
96
96
|
Object.keys(b).join(", "),
|
|
97
|
-
/* @__PURE__ */
|
|
97
|
+
/* @__PURE__ */ i("br", {}),
|
|
98
98
|
"Taille max : 5Mo"
|
|
99
99
|
] })
|
|
100
100
|
] }),
|
|
101
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ i("input", { ...y() })
|
|
102
102
|
]
|
|
103
103
|
}
|
|
104
104
|
);
|
|
105
105
|
}
|
|
106
|
-
|
|
106
|
+
l(T, "FileUploader");
|
|
107
107
|
export {
|
|
108
108
|
T as FileUploader
|
|
109
109
|
};
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
var s = Object.defineProperty;
|
|
2
2
|
var o = (r, e) => s(r, "name", { value: e, configurable: !0 });
|
|
3
|
-
import { jsx as m, jsxs as
|
|
4
|
-
import { useId as
|
|
5
|
-
import { FormField as
|
|
3
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
4
|
+
import { useId as l } from "react";
|
|
5
|
+
import { FormField as d, FormItem as f } from "./form.js";
|
|
6
6
|
import { Switch as p } from "./switch.js";
|
|
7
7
|
import { Label as a } from "./label.js";
|
|
8
8
|
import { useFormContext as F } from "react-hook-form";
|
|
9
9
|
function I({ name: r, label: e }) {
|
|
10
|
-
const { control:
|
|
10
|
+
const { control: c } = F(), t = l();
|
|
11
11
|
return /* @__PURE__ */ m(
|
|
12
|
-
|
|
12
|
+
d,
|
|
13
13
|
{
|
|
14
|
-
control:
|
|
14
|
+
control: c,
|
|
15
15
|
name: r,
|
|
16
|
-
render: /* @__PURE__ */ o(({ field:
|
|
16
|
+
render: /* @__PURE__ */ o(({ field: n }) => /* @__PURE__ */ h(f, { className: "flex items-center", children: [
|
|
17
17
|
/* @__PURE__ */ m(
|
|
18
18
|
p,
|
|
19
19
|
{
|
|
20
20
|
id: t,
|
|
21
|
-
checked:
|
|
21
|
+
checked: n.value,
|
|
22
22
|
onCheckedChange: /* @__PURE__ */ o((i) => {
|
|
23
|
-
|
|
23
|
+
n.onChange(i);
|
|
24
24
|
}, "onCheckedChange")
|
|
25
25
|
}
|
|
26
26
|
),
|
package/dist/components/form.js
CHANGED
|
@@ -4,14 +4,14 @@ import { jsx as s } from "react/jsx-runtime";
|
|
|
4
4
|
import * as i from "react";
|
|
5
5
|
import { Slot as F } from "radix-ui";
|
|
6
6
|
import { FormProvider as x, useFormContext as I, useFormState as p, Controller as g } from "react-hook-form";
|
|
7
|
-
import { cn as
|
|
7
|
+
import { cn as d } from "../lib/utils.js";
|
|
8
8
|
import { Label as C } from "./label.js";
|
|
9
|
-
const M = x,
|
|
9
|
+
const M = x, l = i.createContext(
|
|
10
10
|
{}
|
|
11
11
|
), N = /* @__PURE__ */ n(({
|
|
12
12
|
...t
|
|
13
|
-
}) => /* @__PURE__ */ s(
|
|
14
|
-
const t = i.useContext(
|
|
13
|
+
}) => /* @__PURE__ */ s(l.Provider, { value: { name: t.name }, children: /* @__PURE__ */ s(g, { ...t }) }), "FormField"), c = /* @__PURE__ */ n(() => {
|
|
14
|
+
const t = i.useContext(l), e = i.useContext(f), { getFieldState: o } = I(), r = p({ name: t.name }), m = o(t.name, r);
|
|
15
15
|
if (!t)
|
|
16
16
|
throw new Error("useFormField should be used within <FormField>");
|
|
17
17
|
const { id: a } = e;
|
|
@@ -23,16 +23,16 @@ const M = x, f = i.createContext(
|
|
|
23
23
|
formMessageId: `${a}-form-item-message`,
|
|
24
24
|
...m
|
|
25
25
|
};
|
|
26
|
-
}, "useFormField"),
|
|
26
|
+
}, "useFormField"), f = i.createContext(
|
|
27
27
|
{}
|
|
28
28
|
);
|
|
29
29
|
function w({ className: t, ...e }) {
|
|
30
30
|
const o = i.useId();
|
|
31
|
-
return /* @__PURE__ */ s(
|
|
31
|
+
return /* @__PURE__ */ s(f.Provider, { value: { id: o }, children: /* @__PURE__ */ s(
|
|
32
32
|
"div",
|
|
33
33
|
{
|
|
34
34
|
"data-slot": "form-item",
|
|
35
|
-
className:
|
|
35
|
+
className: d("grid gap-2", t),
|
|
36
36
|
...e
|
|
37
37
|
}
|
|
38
38
|
) });
|
|
@@ -43,13 +43,13 @@ function P({
|
|
|
43
43
|
required: e = !1,
|
|
44
44
|
...o
|
|
45
45
|
}) {
|
|
46
|
-
const { error: r, formItemId: m } =
|
|
46
|
+
const { error: r, formItemId: m } = c();
|
|
47
47
|
return /* @__PURE__ */ s(
|
|
48
48
|
C,
|
|
49
49
|
{
|
|
50
50
|
"data-slot": "form-label",
|
|
51
51
|
"data-error": !!r,
|
|
52
|
-
className:
|
|
52
|
+
className: d("data-[error=true]:text-destructive", t),
|
|
53
53
|
htmlFor: m,
|
|
54
54
|
required: e,
|
|
55
55
|
...o
|
|
@@ -58,7 +58,7 @@ function P({
|
|
|
58
58
|
}
|
|
59
59
|
n(P, "FormLabel");
|
|
60
60
|
function y({ ...t }) {
|
|
61
|
-
const { error: e, formItemId: o, formDescriptionId: r, formMessageId: m } =
|
|
61
|
+
const { error: e, formItemId: o, formDescriptionId: r, formMessageId: m } = c();
|
|
62
62
|
return /* @__PURE__ */ s(
|
|
63
63
|
F.Root,
|
|
64
64
|
{
|
|
@@ -72,26 +72,26 @@ function y({ ...t }) {
|
|
|
72
72
|
}
|
|
73
73
|
n(y, "FormControl");
|
|
74
74
|
function L({ className: t, ...e }) {
|
|
75
|
-
const { formDescriptionId: o } =
|
|
75
|
+
const { formDescriptionId: o } = c();
|
|
76
76
|
return /* @__PURE__ */ s(
|
|
77
77
|
"p",
|
|
78
78
|
{
|
|
79
79
|
"data-slot": "form-description",
|
|
80
80
|
id: o,
|
|
81
|
-
className:
|
|
81
|
+
className: d("text-muted text-sm", t),
|
|
82
82
|
...e
|
|
83
83
|
}
|
|
84
84
|
);
|
|
85
85
|
}
|
|
86
86
|
n(L, "FormDescription");
|
|
87
87
|
function R({ className: t, ...e }) {
|
|
88
|
-
const { error: o, formMessageId: r } =
|
|
88
|
+
const { error: o, formMessageId: r } = c(), m = o ? String((o == null ? void 0 : o.message) ?? "") : e.children;
|
|
89
89
|
return m ? /* @__PURE__ */ s(
|
|
90
90
|
"p",
|
|
91
91
|
{
|
|
92
92
|
"data-slot": "form-message",
|
|
93
93
|
id: r,
|
|
94
|
-
className:
|
|
94
|
+
className: d("text-destructive text-sm", t),
|
|
95
95
|
...e,
|
|
96
96
|
children: m
|
|
97
97
|
}
|
|
@@ -106,5 +106,5 @@ export {
|
|
|
106
106
|
w as FormItem,
|
|
107
107
|
P as FormLabel,
|
|
108
108
|
R as FormMessage,
|
|
109
|
-
|
|
109
|
+
c as useFormField
|
|
110
110
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var
|
|
2
|
-
var o = (t, a) =>
|
|
1
|
+
var i = Object.defineProperty;
|
|
2
|
+
var o = (t, a) => i(t, "name", { value: a, configurable: !0 });
|
|
3
3
|
import { jsx as r } from "react/jsx-runtime";
|
|
4
4
|
import { HoverCard as e } from "radix-ui";
|
|
5
|
-
import { cn as
|
|
5
|
+
import { cn as s } from "../lib/utils.js";
|
|
6
6
|
function p({
|
|
7
7
|
...t
|
|
8
8
|
}) {
|
|
@@ -27,8 +27,8 @@ function u({
|
|
|
27
27
|
"data-slot": "hover-card-content",
|
|
28
28
|
align: a,
|
|
29
29
|
sideOffset: d,
|
|
30
|
-
className:
|
|
31
|
-
"
|
|
30
|
+
className: s(
|
|
31
|
+
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
|
|
32
32
|
t
|
|
33
33
|
),
|
|
34
34
|
...n
|