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.
@@ -1,53 +1,55 @@
1
- var p = Object.defineProperty;
2
- var c = (i, e) => p(i, "name", { value: e, configurable: !0 });
3
- import { jsxs as a, jsx as r } from "react/jsx-runtime";
4
- import * as m from "react";
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 g } from "./popover.js";
8
- import { Button as h } from "./button.js";
9
- function D({
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: e,
12
- value: t,
13
- isClearable: s = !1,
14
- ...f
13
+ onChange: r,
14
+ value: e,
15
+ isClearable: a = !1,
16
+ ...s
15
17
  }) {
16
- const [d, o] = m.useState(!1), l = /* @__PURE__ */ c((n) => {
17
- e == null || e(n || null), o(!1);
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", t), /* @__PURE__ */ a(b, { onOpenChange: o, open: d, children: [
20
- /* @__PURE__ */ r(v, { asChild: !0, children: /* @__PURE__ */ a(
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": !t,
24
- ...f,
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__ */ r(u, { className: "fc:mr-2 fc:size-4" }),
28
- t ? /* @__PURE__ */ r("span", { children: "Ma date" }) : /* @__PURE__ */ r("span", { className: "fc:text-placeholder", children: i })
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__ */ a(g, { align: "start", className: "fc:w-auto fc:p-0", children: [
33
- /* @__PURE__ */ r(
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: t || void 0,
39
- onSelect: l,
40
+ selected: e || void 0,
41
+ onSelect: d,
40
42
  captionLayout: "dropdown"
41
43
  }
42
44
  ),
43
- t && s && /* @__PURE__ */ r("div", { className: "flex justify-center border-t", children: /* @__PURE__ */ r(
44
- h,
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
- e == null || e(null);
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(D, "DatePicker");
60
+ c(z, "DatePicker");
59
61
  export {
60
- D as DatePicker
62
+ z as DatePicker
61
63
  };
@@ -1,38 +1,38 @@
1
1
  var s = Object.defineProperty;
2
- var r = (c, i) => s(c, "name", { value: i, configurable: !0 });
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: c,
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((e) => {
13
+ const a = /* @__PURE__ */ r((c) => {
14
14
  Array.isArray(c) ? f == null || f(
15
- e.map((t) => t.value)
16
- ) : f == null || f(e == null ? void 0 : e.value);
17
- }, "handleChange"), u = /* @__PURE__ */ r(() => o.isMulti ? Array.isArray(d) ? (c == null ? void 0 : c.filter((e) => d.includes(e.value))) ?? [] : [] : c.find((e) => e.value === d), "getSelectedOptions"), n = /* @__PURE__ */ r((e) => {
18
- const t = e.relatedTarget;
19
- t && (t.tagName === "A" || t.tagName === "BUTTON" || t.tagName === "TEXTAREA" || t.tagName === "INPUT") && t.focus();
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: c,
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((e) => m(
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
- e.isSelected && "fc:bg-input-accent!",
35
- e.isFocused && "fc:bg-input-accent/50"
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"),
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.1",
8
+ "version": "1.0.2",
9
9
  "type": "module",
10
10
  "files": [
11
11
  "dist"