fina-react-ds 1.0.0 → 1.0.1

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.
Files changed (30) hide show
  1. package/dist/components/calendar.js +206 -0
  2. package/dist/components/date-picker.js +61 -0
  3. package/dist/components/separator.js +29 -0
  4. package/dist/components/sheet.js +17 -5
  5. package/dist/components/sidebar.js +620 -0
  6. package/dist/components/simple-tooltip.js +17 -0
  7. package/dist/components/skeleton.js +18 -0
  8. package/dist/components/sonner.js +24 -0
  9. package/dist/components/switch.js +34 -0
  10. package/dist/components/textarea.js +23 -0
  11. package/dist/components/tooltip.js +61 -0
  12. package/dist/hooks/use-mobile.js +17 -0
  13. package/dist/index.d.ts +13 -3
  14. package/dist/index.js +140 -93
  15. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +12 -0
  16. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +21 -0
  17. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildMatchFn.js +36 -0
  18. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +18 -0
  19. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/fr/_lib/formatDistance.js +72 -0
  20. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/fr/_lib/formatLong.js +33 -0
  21. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/fr/_lib/formatRelative.js +13 -0
  22. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/fr/_lib/localize.js +123 -0
  23. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/fr/_lib/match.js +112 -0
  24. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/fr.js +21 -0
  25. package/dist/node_modules/@radix-ui/react-separator/dist/index.js +27 -0
  26. package/dist/node_modules/@radix-ui/react-slot/dist/index.js +47 -40
  27. package/dist/node_modules/@radix-ui/react-switch/dist/index.js +136 -0
  28. package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +348 -0
  29. package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.js +32 -0
  30. package/package.json +1 -1
@@ -0,0 +1,206 @@
1
+ var w = Object.defineProperty;
2
+ var n = (f, o) => w(f, "name", { value: o, configurable: !0 });
3
+ import { jsx as c } from "react/jsx-runtime";
4
+ import * as g from "react";
5
+ import { ChevronLeftIcon as h, ChevronRightIcon as y, ChevronDownIcon as _ } from "lucide-react";
6
+ import { getDefaultClassNames as x, DayPicker as v } from "react-day-picker";
7
+ import { cn as e } from "../lib/utils.js";
8
+ import { buttonVariants as p, Button as z } from "./button.js";
9
+ import { fr as k } from "../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/fr.js";
10
+ function q({
11
+ className: f,
12
+ classNames: o,
13
+ showOutsideDays: r = !0,
14
+ captionLayout: s = "label",
15
+ buttonVariant: u = "ghost",
16
+ formatters: i,
17
+ components: m,
18
+ ...b
19
+ }) {
20
+ const t = x();
21
+ return /* @__PURE__ */ c(
22
+ v,
23
+ {
24
+ locale: k,
25
+ showOutsideDays: r,
26
+ className: e(
27
+ "fc:group/calendar fc:p-3 fc:[--cell-size:--spacing(8)]",
28
+ String.raw`fc:rtl:**:[.rdp-button\_next>svg]:rotate-180`,
29
+ String.raw`fc:rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
30
+ f
31
+ ),
32
+ captionLayout: s,
33
+ formatters: {
34
+ formatMonthDropdown: /* @__PURE__ */ n((a) => a.toLocaleString("default", { month: "short" }), "formatMonthDropdown"),
35
+ ...i
36
+ },
37
+ classNames: {
38
+ root: e("fc:w-fit", t.root),
39
+ months: e(
40
+ "fc:flex fc:gap-4 fc:flex-col fc:md:flex-row fc:relative",
41
+ t.months
42
+ ),
43
+ month: e(
44
+ "fc:flex fc:flex-col fc:w-full fc:gap-4",
45
+ t.month
46
+ ),
47
+ nav: e(
48
+ "fc:flex fc:items-center fc:gap-1 fc:w-full fc:absolute fc:top-0 fc:inset-x-0 fc:justify-between",
49
+ t.nav
50
+ ),
51
+ button_previous: e(
52
+ p({
53
+ variant: u,
54
+ color: "dark",
55
+ size: "icon"
56
+ }),
57
+ "fc:size-(--cell-size) fc:aria-disabled:opacity-50 fc:p-0 fc:select-none",
58
+ t.button_previous
59
+ ),
60
+ button_next: e(
61
+ p({
62
+ variant: u,
63
+ color: "dark",
64
+ size: "icon"
65
+ }),
66
+ "fc:size-(--cell-size) fc:aria-disabled:opacity-50 fc:p-0 fc:select-none",
67
+ t.button_next
68
+ ),
69
+ month_caption: e(
70
+ "fc:flex fc:items-center fc:justify-center fc:h-(--cell-size) fc:w-full fc:px-(--cell-size)",
71
+ t.month_caption
72
+ ),
73
+ dropdowns: e(
74
+ "fc:w-full fc:flex fc:items-center fc:text-sm fc:font-medium fc:justify-center fc:h-(--cell-size) fc:gap-1.5",
75
+ t.dropdowns
76
+ ),
77
+ dropdown_root: e(
78
+ "fc:relative fc:has-focus:border-ring fc:border fc:border-input-border fc:shadow-xs fc:has-focus:ring-ring/50 fc:has-focus:ring-[3px] fc:rounded-md",
79
+ t.dropdown_root
80
+ ),
81
+ dropdown: e(
82
+ "fc:absolute fc:bg-popover fc:inset-0 fc:opacity-0",
83
+ t.dropdown
84
+ ),
85
+ caption_label: e(
86
+ "select-none font-medium",
87
+ s === "label" ? "fc:text-sm" : "fc:rounded-md fc:pl-2 fc:pr-1 fc:flex fc:items-center fc:gap-1 fc:text-sm fc:h-8 fc:[&>svg]:text-muted fc:[&>svg]:size-3.5",
88
+ t.caption_label
89
+ ),
90
+ table: "fc:w-full fc:border-collapse",
91
+ weekdays: e("fc:flex", t.weekdays),
92
+ weekday: e(
93
+ "fc:text-muted fc:rounded-md fc:flex-1 fc:font-normal fc:text-[0.8rem] fc:select-none",
94
+ t.weekday
95
+ ),
96
+ week: e("fc:flex fc:w-full fc:mt-2", t.week),
97
+ week_number_header: e(
98
+ "fc:select-none w-(--cell-size)",
99
+ t.week_number_header
100
+ ),
101
+ week_number: e(
102
+ "fc:text-[0.8rem] fc:select-none fc:text-muted",
103
+ t.week_number
104
+ ),
105
+ day: e(
106
+ "fc:relative fc:w-full fc:h-full fc:p-0 fc:text-center fc:[&:first-child[data-selected=true]_button]:rounded-l-md fc:[&:last-child[data-selected=true]_button]:rounded-r-md fc:group/day fc:aspect-square fc:select-none",
107
+ t.day
108
+ ),
109
+ range_start: e(
110
+ "fc:rounded-l-md fc:bg-accent",
111
+ t.range_start
112
+ ),
113
+ range_middle: e("fc:rounded-none", t.range_middle),
114
+ range_end: e(
115
+ "fc:rounded-r-md fc:bg-accent",
116
+ t.range_end
117
+ ),
118
+ today: e(
119
+ "fc:bg-accent fc:text-accent-foreground fc:rounded-md fc:data-[selected=true]:rounded-none",
120
+ t.today
121
+ ),
122
+ outside: e(
123
+ "fc:text-muted fc:aria-selected:text-muted",
124
+ t.outside
125
+ ),
126
+ disabled: e(
127
+ "fc:text-muted fc:opacity-50",
128
+ t.disabled
129
+ ),
130
+ hidden: e("fc:invisible", t.hidden),
131
+ ...o
132
+ },
133
+ components: {
134
+ Root: /* @__PURE__ */ n(({ className: a, rootRef: d, ...l }) => /* @__PURE__ */ c(
135
+ "div",
136
+ {
137
+ "data-slot": "calendar",
138
+ ref: d,
139
+ className: e(a),
140
+ ...l
141
+ }
142
+ ), "Root"),
143
+ Chevron: /* @__PURE__ */ n(({ className: a, orientation: d, ...l }) => d === "left" ? /* @__PURE__ */ c(
144
+ h,
145
+ {
146
+ className: e("fc:size-4", a),
147
+ ...l
148
+ }
149
+ ) : d === "right" ? /* @__PURE__ */ c(
150
+ y,
151
+ {
152
+ className: e("fc:size-4", a),
153
+ ...l
154
+ }
155
+ ) : /* @__PURE__ */ c(
156
+ _,
157
+ {
158
+ className: e("fc:size-4", a),
159
+ ...l
160
+ }
161
+ ), "Chevron"),
162
+ DayButton: N,
163
+ WeekNumber: /* @__PURE__ */ n(({ children: a, ...d }) => /* @__PURE__ */ c("td", { ...d, children: /* @__PURE__ */ c("div", { className: "fc:flex fc:size-(--cell-size) fc:items-center fc:justify-center fc:text-center", children: a }) }), "WeekNumber"),
164
+ ...m
165
+ },
166
+ ...b
167
+ }
168
+ );
169
+ }
170
+ n(q, "Calendar");
171
+ function N({
172
+ className: f,
173
+ day: o,
174
+ modifiers: r,
175
+ ...s
176
+ }) {
177
+ const u = x(), i = g.useRef(null);
178
+ return g.useEffect(() => {
179
+ var m;
180
+ r.focused && ((m = i.current) == null || m.focus());
181
+ }, [r.focused]), /* @__PURE__ */ c(
182
+ z,
183
+ {
184
+ ref: i,
185
+ variant: "ghost",
186
+ size: "icon",
187
+ color: "dark",
188
+ "data-day": o.date.toLocaleDateString(),
189
+ "data-selected-single": r.selected && !r.range_start && !r.range_end && !r.range_middle,
190
+ "data-range-start": r.range_start,
191
+ "data-range-end": r.range_end,
192
+ "data-range-middle": r.range_middle,
193
+ className: e(
194
+ "fc:data-[selected-single=true]:bg-primary! fc:data-[selected-single=true]:text-primary-foreground! data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",
195
+ u.day,
196
+ f
197
+ ),
198
+ ...s
199
+ }
200
+ );
201
+ }
202
+ n(N, "CalendarDayButton");
203
+ export {
204
+ q as Calendar,
205
+ N as CalendarDayButton
206
+ };
@@ -0,0 +1,61 @@
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";
5
+ import { Calendar as u } from "lucide-react";
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({
10
+ placeholder: i = "Choisir une date",
11
+ onChange: e,
12
+ value: t,
13
+ isClearable: s = !1,
14
+ ...f
15
+ }) {
16
+ const [d, o] = m.useState(!1), l = /* @__PURE__ */ c((n) => {
17
+ e == null || e(n || null), o(!1);
18
+ }, "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
+ "button",
22
+ {
23
+ "data-empty": !t,
24
+ ...f,
25
+ 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
+ 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
+ ]
30
+ }
31
+ ) }),
32
+ /* @__PURE__ */ a(g, { align: "start", className: "fc:w-auto fc:p-0", children: [
33
+ /* @__PURE__ */ r(
34
+ x,
35
+ {
36
+ mode: "single",
37
+ required: !0,
38
+ selected: t || void 0,
39
+ onSelect: l,
40
+ captionLayout: "dropdown"
41
+ }
42
+ ),
43
+ t && s && /* @__PURE__ */ r("div", { className: "flex justify-center border-t", children: /* @__PURE__ */ r(
44
+ h,
45
+ {
46
+ variant: "ghost",
47
+ color: "dark",
48
+ className: "flex w-full",
49
+ onClick: /* @__PURE__ */ c(() => {
50
+ e == null || e(null);
51
+ }, "onClick"),
52
+ children: "Effacer"
53
+ }
54
+ ) })
55
+ ] })
56
+ ] });
57
+ }
58
+ c(D, "DatePicker");
59
+ export {
60
+ D as DatePicker
61
+ };
@@ -0,0 +1,29 @@
1
+ var n = Object.defineProperty;
2
+ var r = (t, o) => n(t, "name", { value: o, configurable: !0 });
3
+ import { jsx as e } from "react/jsx-runtime";
4
+ import { Root as l } from "../node_modules/@radix-ui/react-separator/dist/index.js";
5
+ import { cn as p } from "../lib/utils.js";
6
+ function s({
7
+ className: t,
8
+ orientation: o = "horizontal",
9
+ decorative: a = !0,
10
+ ...i
11
+ }) {
12
+ return /* @__PURE__ */ e(
13
+ l,
14
+ {
15
+ "data-slot": "separator",
16
+ decorative: a,
17
+ orientation: o,
18
+ className: p(
19
+ "bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
20
+ t
21
+ ),
22
+ ...i
23
+ }
24
+ );
25
+ }
26
+ r(s, "Separator");
27
+ export {
28
+ s as Separator
29
+ };
@@ -2,7 +2,7 @@ var l = Object.defineProperty;
2
2
  var a = (t, e) => l(t, "name", { value: e, configurable: !0 });
3
3
  import { jsx as c, jsxs as s } from "react/jsx-runtime";
4
4
  import { Root as d, Trigger as u, Close as r, Content as h, Title as m, Description as p, Portal as g, Overlay as x } from "../node_modules/@radix-ui/react-dialog/dist/index.js";
5
- import { XIcon as b } from "lucide-react";
5
+ import { XIcon as y } from "lucide-react";
6
6
  import { cn as f } from "../lib/utils.js";
7
7
  function j({ ...t }) {
8
8
  return /* @__PURE__ */ c(d, { "data-slot": "sheet", ...t });
@@ -20,12 +20,12 @@ function D({
20
20
  return /* @__PURE__ */ c(r, { "data-slot": "sheet-close", ...t });
21
21
  }
22
22
  a(D, "SheetClose");
23
- function y({
23
+ function b({
24
24
  ...t
25
25
  }) {
26
26
  return /* @__PURE__ */ c(g, { "data-slot": "sheet-portal", ...t });
27
27
  }
28
- a(y, "SheetPortal");
28
+ a(b, "SheetPortal");
29
29
  function S({
30
30
  className: t,
31
31
  ...e
@@ -50,7 +50,7 @@ function O({
50
50
  size: o = "s",
51
51
  ...i
52
52
  }) {
53
- return /* @__PURE__ */ s(y, { children: [
53
+ return /* @__PURE__ */ s(b, { children: [
54
54
  /* @__PURE__ */ c(S, {}),
55
55
  /* @__PURE__ */ s(
56
56
  h,
@@ -69,7 +69,7 @@ function O({
69
69
  children: [
70
70
  e,
71
71
  /* @__PURE__ */ s(r, { className: "fc:ring-offset-background fc:focus:ring-ring fc:data-[state=open]:bg-secondary fc:absolute fc:top-4 fc:right-4 fc:rounded-xs fc:opacity-70 fc:transition-opacity fc:hover:opacity-100 fc:focus:ring-2 fc:focus:ring-offset-2 fc:focus:outline-hidden fc:disabled:pointer-events-none", children: [
72
- /* @__PURE__ */ c(b, { className: "fc:size-4" }),
72
+ /* @__PURE__ */ c(y, { className: "fc:size-4" }),
73
73
  /* @__PURE__ */ c("span", { className: "fc:sr-only", children: "Close" })
74
74
  ] })
75
75
  ]
@@ -106,6 +106,17 @@ function z({ className: t, ...e }) {
106
106
  );
107
107
  }
108
108
  a(z, "SheetFooter");
109
+ function B({ className: t, ...e }) {
110
+ return /* @__PURE__ */ c(
111
+ "div",
112
+ {
113
+ "data-slot": "sheet-body",
114
+ className: f("fc:p-4 fc:flex-1 fc:overflow-y-auto", t),
115
+ ...e
116
+ }
117
+ );
118
+ }
119
+ a(B, "SheetBody");
109
120
  function F({
110
121
  className: t,
111
122
  ...e
@@ -136,6 +147,7 @@ function H({
136
147
  a(H, "SheetDescription");
137
148
  export {
138
149
  j as Sheet,
150
+ B as SheetBody,
139
151
  D as SheetClose,
140
152
  O as SheetContent,
141
153
  H as SheetDescription,