@yuno-payments/dashboard-design-system 2.0.2 → 2.0.4-beta.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,29 +1,35 @@
1
- import { j as e } from "../../_virtual/jsx-runtime.js";
1
+ import { j as a } from "../../_virtual/jsx-runtime.js";
2
2
  import "react";
3
- import { DayPicker as s } from "../../node_modules/react-day-picker/dist/index.esm.js";
4
- import { cn as t } from "../../lib/utils.js";
5
- import { buttonVariants as a } from "./button.js";
6
- import i from "../../node_modules/lucide-react/dist/esm/icons/chevron-right.js";
7
- import c from "../../node_modules/lucide-react/dist/esm/icons/chevron-left.js";
8
- function l({
9
- className: r,
10
- classNames: o,
11
- showOutsideDays: n = !0,
12
- ...d
3
+ import { DayPicker as i } from "../../node_modules/react-day-picker/dist/index.esm.js";
4
+ import { cn as e } from "../../lib/utils.js";
5
+ import { buttonVariants as r } from "./button.js";
6
+ import c from "../../node_modules/lucide-react/dist/esm/icons/chevron-right.js";
7
+ import l from "../../node_modules/lucide-react/dist/esm/icons/chevron-left.js";
8
+ function m({
9
+ className: o,
10
+ classNames: n,
11
+ showOutsideDays: d = !0,
12
+ ...t
13
13
  }) {
14
- return /* @__PURE__ */ e.jsx(
15
- s,
14
+ const s = t.captionLayout === "dropdown" || t.captionLayout === "dropdown-buttons";
15
+ return /* @__PURE__ */ a.jsx(
16
+ i,
16
17
  {
17
- showOutsideDays: n,
18
- className: t("p-3", r),
18
+ showOutsideDays: d,
19
+ className: e("p-3", o),
19
20
  classNames: {
20
21
  months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
21
22
  month: "space-y-4",
22
23
  caption: "flex justify-center pt-1 relative items-center",
23
- caption_label: "text-sm font-medium",
24
+ caption_label: e("text-sm font-medium", s && "hidden"),
25
+ caption_dropdowns: "flex gap-1 items-center",
26
+ dropdown: "appearance-none bg-transparent border border-input rounded-md px-2 py-1 text-sm cursor-pointer focus:outline-none focus:ring-2 focus:ring-ring",
27
+ dropdown_month: "",
28
+ dropdown_year: "",
29
+ vhidden: "sr-only",
24
30
  nav: "space-x-1 flex items-center",
25
- nav_button: t(
26
- a({ variant: "outline" }),
31
+ nav_button: e(
32
+ r({ variant: "outline" }),
27
33
  "h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"
28
34
  ),
29
35
  nav_button_previous: "absolute left-1",
@@ -33,8 +39,8 @@ function l({
33
39
  head_cell: "text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",
34
40
  row: "flex w-full mt-2",
35
41
  cell: "h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",
36
- day: t(
37
- a({ variant: "ghost" }),
42
+ day: e(
43
+ r({ variant: "ghost" }),
38
44
  "h-9 w-9 p-0 font-normal aria-selected:opacity-100"
39
45
  ),
40
46
  day_range_end: "day-range-end",
@@ -44,17 +50,17 @@ function l({
44
50
  day_disabled: "text-muted-foreground opacity-50",
45
51
  day_range_middle: "aria-selected:bg-accent aria-selected:text-accent-foreground",
46
52
  day_hidden: "invisible",
47
- ...o
53
+ ...n
48
54
  },
49
55
  components: {
50
- IconLeft: () => /* @__PURE__ */ e.jsx(c, { className: "h-4 w-4" }),
51
- IconRight: () => /* @__PURE__ */ e.jsx(i, { className: "h-4 w-4" })
56
+ IconLeft: () => /* @__PURE__ */ a.jsx(l, { className: "h-4 w-4" }),
57
+ IconRight: () => /* @__PURE__ */ a.jsx(c, { className: "h-4 w-4" })
52
58
  },
53
- ...d
59
+ ...t
54
60
  }
55
61
  );
56
62
  }
57
- l.displayName = "Calendar";
63
+ m.displayName = "Calendar";
58
64
  export {
59
- l as Calendar
65
+ m as Calendar
60
66
  };
@@ -16,5 +16,10 @@ export interface DatePickerProps {
16
16
  required?: boolean;
17
17
  orientation?: "vertical" | "horizontal" | "responsive";
18
18
  id?: string;
19
+ captionLayout?: "dropdown" | "buttons" | "dropdown-buttons";
20
+ fromYear?: number;
21
+ toYear?: number;
22
+ fromMonth?: Date;
23
+ toMonth?: Date;
19
24
  }
20
- export declare function DatePicker({ date, onChange, placeholder, disabled, className, iconPosition, minDate, maxDate, dateFormat, label, error, description, info, requiredIndicator, required, orientation, id, }: DatePickerProps): import("react/jsx-runtime").JSX.Element;
25
+ export declare function DatePicker({ date, onChange, placeholder, disabled, className, iconPosition, minDate, maxDate, dateFormat, label, error, description, info, requiredIndicator, required, orientation, id, captionLayout, fromYear, toYear, fromMonth, toMonth, }: DatePickerProps): import("react/jsx-runtime").JSX.Element;
@@ -1,97 +1,111 @@
1
1
  import { j as e } from "../../_virtual/jsx-runtime.js";
2
- import { useId as D } from "react";
3
- import { cn as p } from "../../lib/utils.js";
4
- import { Button as F } from "./button.js";
5
- import { Calendar as b } from "./calendar.js";
6
- import { Popover as k, PopoverTrigger as E, PopoverContent as $ } from "./popover.js";
7
- import { Field as I, FieldDescription as M, FieldError as B } from "./field.js";
8
- import S from "../../node_modules/lucide-react/dist/esm/icons/calendar.js";
9
- import L from "../../node_modules/lucide-react/dist/esm/icons/chevron-down.js";
10
- import { Label as R } from "../../components/atoms/label/label.js";
11
- import { format as T } from "../../node_modules/date-fns/format.js";
12
- function X({
2
+ import { useId as I } from "react";
3
+ import { cn as u } from "../../lib/utils.js";
4
+ import { Button as M } from "./button.js";
5
+ import { Calendar as B } from "./calendar.js";
6
+ import { Popover as S, PopoverTrigger as D, PopoverContent as L } from "./popover.js";
7
+ import { Field as R, FieldDescription as T, FieldError as z } from "./field.js";
8
+ import A from "../../node_modules/lucide-react/dist/esm/icons/calendar.js";
9
+ import G from "../../node_modules/lucide-react/dist/esm/icons/chevron-down.js";
10
+ import { Label as H } from "../../components/atoms/label/label.js";
11
+ import { format as J } from "../../node_modules/date-fns/format.js";
12
+ function ee({
13
13
  date: s,
14
- onChange: h,
15
- placeholder: u = "Pick a date",
16
- disabled: c = !1,
17
- className: d,
18
- iconPosition: m = "start",
19
- minDate: j,
20
- maxDate: v,
14
+ onChange: j,
15
+ placeholder: v = "Pick a date",
16
+ disabled: m = !1,
17
+ className: f,
18
+ iconPosition: p = "start",
19
+ minDate: i,
20
+ maxDate: a,
21
21
  dateFormat: w = "MMM d, yyyy",
22
- label: i,
22
+ label: l,
23
23
  error: t,
24
24
  description: o,
25
- info: a,
26
- requiredIndicator: n,
25
+ info: n,
26
+ requiredIndicator: d,
27
27
  required: y = !1,
28
28
  orientation: g = "vertical",
29
- id: C
29
+ id: C,
30
+ captionLayout: b,
31
+ fromYear: N,
32
+ toYear: P,
33
+ fromMonth: F,
34
+ toMonth: k
30
35
  }) {
31
- const N = D(), r = C || N, l = !!t, P = m === "start", f = m === "end", x = /* @__PURE__ */ e.jsxs(k, { children: [
32
- /* @__PURE__ */ e.jsx(E, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
33
- F,
36
+ const E = I(), r = C || E, c = !!t, $ = p === "start", x = p === "end", h = /* @__PURE__ */ e.jsxs(S, { children: [
37
+ /* @__PURE__ */ e.jsx(D, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
38
+ M,
34
39
  {
35
40
  variant: "outline",
36
- className: p(
41
+ className: u(
37
42
  "w-full text-left font-normal h-9",
38
- f ? "justify-between" : "justify-start",
43
+ x ? "justify-between" : "justify-start",
39
44
  !s && "text-muted-foreground",
40
- l && "border-destructive focus-visible:border-destructive",
41
- d
45
+ c && "border-destructive focus-visible:border-destructive",
46
+ f
42
47
  ),
43
- disabled: c,
44
- "aria-invalid": l ? !0 : void 0,
48
+ disabled: m,
49
+ "aria-invalid": c ? !0 : void 0,
45
50
  "aria-describedby": o || t ? `${r}-description` : void 0,
46
51
  id: r,
47
52
  children: [
48
53
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
49
- P && /* @__PURE__ */ e.jsx(S, { className: "h-4 w-4" }),
50
- s ? T(s, w) : /* @__PURE__ */ e.jsx("span", { children: u })
54
+ $ && /* @__PURE__ */ e.jsx(A, { className: "h-4 w-4" }),
55
+ s ? J(s, w) : /* @__PURE__ */ e.jsx("span", { children: v })
51
56
  ] }),
52
- f && /* @__PURE__ */ e.jsx(L, { className: "h-4 w-4 opacity-50" })
57
+ x && /* @__PURE__ */ e.jsx(G, { className: "h-4 w-4 opacity-50" })
53
58
  ]
54
59
  }
55
60
  ) }),
56
- /* @__PURE__ */ e.jsx($, { className: "w-auto p-0", children: /* @__PURE__ */ e.jsx(
57
- b,
61
+ /* @__PURE__ */ e.jsx(L, { className: "w-auto p-0", children: /* @__PURE__ */ e.jsx(
62
+ B,
58
63
  {
59
64
  mode: "single",
60
65
  selected: s,
61
- onSelect: h,
66
+ onSelect: j,
62
67
  initialFocus: !0,
63
- fromDate: j,
64
- toDate: v
68
+ fromDate: i,
69
+ toDate: a,
70
+ disabled: [
71
+ ...i ? [{ before: i }] : [],
72
+ ...a ? [{ after: a }] : []
73
+ ],
74
+ captionLayout: b,
75
+ fromYear: N,
76
+ toYear: P,
77
+ fromMonth: F,
78
+ toMonth: k
65
79
  }
66
80
  ) })
67
81
  ] });
68
- return i || t || o || a || n ? /* @__PURE__ */ e.jsxs(
69
- I,
82
+ return l || t || o || n || d ? /* @__PURE__ */ e.jsxs(
83
+ R,
70
84
  {
71
85
  orientation: g,
72
- "data-invalid": l,
73
- className: p("w-full", d),
86
+ "data-invalid": c,
87
+ className: u("w-full", f),
74
88
  children: [
75
- (i || a || n) && /* @__PURE__ */ e.jsx(
76
- R,
89
+ (l || n || d) && /* @__PURE__ */ e.jsx(
90
+ H,
77
91
  {
78
92
  htmlFor: r,
79
- info: a,
80
- requiredIndicator: n,
93
+ info: n,
94
+ requiredIndicator: d,
81
95
  required: y,
82
- disabled: c,
83
- children: i
96
+ disabled: m,
97
+ children: l
84
98
  }
85
99
  ),
86
100
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2 flex-1", children: [
87
- x,
88
- o && !t && /* @__PURE__ */ e.jsx(M, { id: `${r}-description`, children: o }),
89
- t && /* @__PURE__ */ e.jsx(B, { id: `${r}-description`, children: t })
101
+ h,
102
+ o && !t && /* @__PURE__ */ e.jsx(T, { id: `${r}-description`, children: o }),
103
+ t && /* @__PURE__ */ e.jsx(z, { id: `${r}-description`, children: t })
90
104
  ] })
91
105
  ]
92
106
  }
93
- ) : x;
107
+ ) : h;
94
108
  }
95
109
  export {
96
- X as DatePicker
110
+ ee as DatePicker
97
111
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuno-payments/dashboard-design-system",
3
- "version": "2.0.2",
3
+ "version": "2.0.4-beta.2",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "2.0.2",
3
- "generatedAt": "2026-03-17T14:43:03.524Z",
2
+ "version": "2.0.4-beta.2",
3
+ "generatedAt": "2026-03-19T00:50:25.015Z",
4
4
  "components": [
5
5
  {
6
6
  "name": "AccessDeniedAlert",
@@ -801,8 +801,8 @@
801
801
  "code": "<DatePicker placeholder=\"Pick a date\" disabled />"
802
802
  },
803
803
  {
804
- "name": "FormWithIndicators",
805
- "code": "<DatePicker placeholder=\"Pick a date\" disabled={false} />"
804
+ "name": "DropdownNavigation",
805
+ "code": "<DatePicker disabled={false} />"
806
806
  }
807
807
  ]
808
808
  },