fina-react-ds 1.0.1 → 1.0.2
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/date-picker.js +30 -28
- package/dist/components/select.js +12 -12
- package/package.json +1 -1
|
@@ -1,53 +1,55 @@
|
|
|
1
|
-
var
|
|
2
|
-
var c = (i,
|
|
3
|
-
import { jsxs as
|
|
4
|
-
import * as
|
|
1
|
+
var m = Object.defineProperty;
|
|
2
|
+
var c = (i, r) => m(i, "name", { value: r, configurable: !0 });
|
|
3
|
+
import { jsxs as o, jsx as t } from "react/jsx-runtime";
|
|
4
|
+
import * as p from "react";
|
|
5
5
|
import { Calendar as u } from "lucide-react";
|
|
6
6
|
import { Calendar as x } from "./calendar.js";
|
|
7
|
-
import { Popover as b, PopoverTrigger as v, PopoverContent as
|
|
8
|
-
import { Button as
|
|
9
|
-
|
|
7
|
+
import { Popover as b, PopoverTrigger as v, PopoverContent as P } from "./popover.js";
|
|
8
|
+
import { Button as g } from "./button.js";
|
|
9
|
+
import { format as h } from "date-fns";
|
|
10
|
+
import { fr as w } from "../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/fr.js";
|
|
11
|
+
function z({
|
|
10
12
|
placeholder: i = "Choisir une date",
|
|
11
|
-
onChange:
|
|
12
|
-
value:
|
|
13
|
-
isClearable:
|
|
14
|
-
...
|
|
13
|
+
onChange: r,
|
|
14
|
+
value: e,
|
|
15
|
+
isClearable: a = !1,
|
|
16
|
+
...s
|
|
15
17
|
}) {
|
|
16
|
-
const [
|
|
17
|
-
|
|
18
|
+
const [l, f] = p.useState(!1), d = /* @__PURE__ */ c((n) => {
|
|
19
|
+
r == null || r(n || null), f(!1);
|
|
18
20
|
}, "onSelect");
|
|
19
|
-
return console.log("DatePicker value",
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
+
return console.log("DatePicker value", e), /* @__PURE__ */ o(b, { onOpenChange: f, open: l, children: [
|
|
22
|
+
/* @__PURE__ */ t(v, { asChild: !0, children: /* @__PURE__ */ o(
|
|
21
23
|
"button",
|
|
22
24
|
{
|
|
23
|
-
"data-empty": !
|
|
24
|
-
...
|
|
25
|
+
"data-empty": !e,
|
|
26
|
+
...s,
|
|
25
27
|
className: "fc:border-input-border fc:flex fc:items-center fc:h-9 fc:w-full fc:min-w-0 fc:rounded-md fc:border fc:bg-input fc:px-3 fc:py-1 fc:text-base fc:shadow-xs fc:focus-visible:border-ring fc:ring-ring/50 fc:focus-visible:ring-[3px] fc:data-[state=open]:ring-[3px] fc:data-[state=open]:border-ring fc:aria-invalid:ring-destructive/20 fc:dark:aria-invalid:ring-destructive/40 fc:aria-invalid:border-destructive! fc:outline-none fc:md:text-sm",
|
|
26
28
|
children: [
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
-
|
|
29
|
+
/* @__PURE__ */ t(u, { className: "fc:mr-2 fc:size-4" }),
|
|
30
|
+
e ? /* @__PURE__ */ t("span", { children: h(e, "PPP", { locale: w }) }) : /* @__PURE__ */ t("span", { className: "fc:text-placeholder", children: i })
|
|
29
31
|
]
|
|
30
32
|
}
|
|
31
33
|
) }),
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
+
/* @__PURE__ */ o(P, { align: "start", className: "fc:w-auto fc:p-0", children: [
|
|
35
|
+
/* @__PURE__ */ t(
|
|
34
36
|
x,
|
|
35
37
|
{
|
|
36
38
|
mode: "single",
|
|
37
39
|
required: !0,
|
|
38
|
-
selected:
|
|
39
|
-
onSelect:
|
|
40
|
+
selected: e || void 0,
|
|
41
|
+
onSelect: d,
|
|
40
42
|
captionLayout: "dropdown"
|
|
41
43
|
}
|
|
42
44
|
),
|
|
43
|
-
|
|
44
|
-
|
|
45
|
+
e && a && /* @__PURE__ */ t("div", { className: "flex justify-center border-t", children: /* @__PURE__ */ t(
|
|
46
|
+
g,
|
|
45
47
|
{
|
|
46
48
|
variant: "ghost",
|
|
47
49
|
color: "dark",
|
|
48
50
|
className: "flex w-full",
|
|
49
51
|
onClick: /* @__PURE__ */ c(() => {
|
|
50
|
-
|
|
52
|
+
r == null || r(null);
|
|
51
53
|
}, "onClick"),
|
|
52
54
|
children: "Effacer"
|
|
53
55
|
}
|
|
@@ -55,7 +57,7 @@ function D({
|
|
|
55
57
|
] })
|
|
56
58
|
] });
|
|
57
59
|
}
|
|
58
|
-
c(
|
|
60
|
+
c(z, "DatePicker");
|
|
59
61
|
export {
|
|
60
|
-
|
|
62
|
+
z as DatePicker
|
|
61
63
|
};
|
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
var s = Object.defineProperty;
|
|
2
|
-
var r = (
|
|
2
|
+
var r = (t, i) => s(t, "name", { value: i, configurable: !0 });
|
|
3
3
|
import { jsx as l } from "react/jsx-runtime";
|
|
4
4
|
import m from "clsx";
|
|
5
5
|
import p from "react-select";
|
|
6
6
|
function y({
|
|
7
|
-
options:
|
|
7
|
+
options: t,
|
|
8
8
|
placeholder: i = "Sélectionner",
|
|
9
9
|
onChange: f,
|
|
10
10
|
value: d,
|
|
11
11
|
...o
|
|
12
12
|
}) {
|
|
13
|
-
const a = /* @__PURE__ */ r((
|
|
13
|
+
const a = /* @__PURE__ */ r((c) => {
|
|
14
14
|
Array.isArray(c) ? f == null || f(
|
|
15
|
-
|
|
16
|
-
) : f == null || f(
|
|
17
|
-
}, "handleChange"), u = /* @__PURE__ */ r(() => o.isMulti ? Array.isArray(d) ? (
|
|
18
|
-
const
|
|
19
|
-
|
|
15
|
+
c.map((e) => e.value)
|
|
16
|
+
) : f == null || f(c == null ? void 0 : c.value);
|
|
17
|
+
}, "handleChange"), u = /* @__PURE__ */ r(() => o.isMulti ? Array.isArray(d) ? (t == null ? void 0 : t.filter((c) => d.includes(c.value))) ?? [] : [] : t.find((c) => c.value === d), "getSelectedOptions"), n = /* @__PURE__ */ r((c) => {
|
|
18
|
+
const e = c.relatedTarget;
|
|
19
|
+
e && (e.tagName === "A" || e.tagName === "BUTTON" || e.tagName === "TEXTAREA" || e.tagName === "INPUT") && e.focus();
|
|
20
20
|
}, "onBlurWorkaround");
|
|
21
21
|
return /* @__PURE__ */ l(
|
|
22
22
|
p,
|
|
23
23
|
{
|
|
24
24
|
...o,
|
|
25
|
-
options:
|
|
25
|
+
options: t,
|
|
26
26
|
onChange: a,
|
|
27
27
|
value: u(),
|
|
28
28
|
classNames: {
|
|
29
29
|
control: /* @__PURE__ */ r(() => "fc:px-3 fc:py-1 fc:border fc:bg-input fc:rounded-md fc:text-base fc:md:text-sm fc:min-h-9 fc:shadow-none fc:border-input-border fc:has-[:focus]:border-ring fc:has-[:focus]:ring-[3px] fc:ring-ring/50 fc:has-aria-invalid:border-destructive! fc:has-aria-invalid:ring-destructive/20! fc:has-aria-invalid:dark:ring-destructive/40!", "control"),
|
|
30
30
|
menu: /* @__PURE__ */ r(() => "fc:bg-popover fc:border fc:rounded-md fc:py-0 fc:overflow-hidden fc:shadow-md fc:mt-2", "menu"),
|
|
31
31
|
menuList: /* @__PURE__ */ r(() => "fc:py-0 fc:bg-popover", "menuList"),
|
|
32
|
-
option: /* @__PURE__ */ r((
|
|
32
|
+
option: /* @__PURE__ */ r((c) => m(
|
|
33
33
|
"fc:py-1 fc:px-2 fc:text-popover-foreground fc:text-base fc:md:text-sm!",
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
c.isSelected && "fc:bg-input-accent!",
|
|
35
|
+
c.isFocused && "fc:bg-input-accent/50"
|
|
36
36
|
), "option"),
|
|
37
37
|
placeholder: /* @__PURE__ */ r(() => "fc:text-placeholder", "placeholder"),
|
|
38
38
|
multiValue: /* @__PURE__ */ r(() => "fc:bg-input-accent fc:text-input-accent-foreground fc:mr-1 fc:px-1 fc:py-0.5 fc:rounded-md fc:flex fc:items-center", "multiValue"),
|