impact-nova 0.1.13 → 1.0.0

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 (115) hide show
  1. package/dist/components/layout/dashboard-layout.d.ts +21 -6
  2. package/dist/components/ui/accordion-nested-list/accordion-nested-list.js +32 -33
  3. package/dist/components/ui/accordion.js +25 -23
  4. package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.d.ts +5 -0
  5. package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.js +50 -52
  6. package/dist/components/ui/ag-grid-react/cell-renderers/input-display-renderer.d.ts +1 -1
  7. package/dist/components/ui/ag-grid-react/cell-renderers/split-cell-renderer.js +34 -34
  8. package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.js +8 -11
  9. package/dist/components/ui/ag-grid-react/headers/column-menu/column-settings-menu.js +17 -17
  10. package/dist/components/ui/ag-grid-react/headers/header-search-input.js +3 -3
  11. package/dist/components/ui/alert-dialog.js +45 -40
  12. package/dist/components/ui/alert.d.ts +21 -4
  13. package/dist/components/ui/alert.js +45 -25
  14. package/dist/components/ui/avatar.js +19 -16
  15. package/dist/components/ui/badge.js +8 -1
  16. package/dist/components/ui/breadcrumb.js +1 -0
  17. package/dist/components/ui/button-group.d.ts +1 -1
  18. package/dist/components/ui/button-group.js +27 -32
  19. package/dist/components/ui/button-variants.d.ts +1 -1
  20. package/dist/components/ui/button.d.ts +11 -0
  21. package/dist/components/ui/button.js +11 -9
  22. package/dist/components/ui/calendar.d.ts +14 -2
  23. package/dist/components/ui/calendar.js +443 -376
  24. package/dist/components/ui/card.js +7 -6
  25. package/dist/components/ui/checkbox.js +64 -48
  26. package/dist/components/ui/chips.d.ts +1 -0
  27. package/dist/components/ui/chips.js +27 -19
  28. package/dist/components/ui/data-table/data-table-column-list.d.ts +4 -1
  29. package/dist/components/ui/data-table/data-table-column-list.js +58 -54
  30. package/dist/components/ui/data-table/data-table-sheet.d.ts +1 -1
  31. package/dist/components/ui/data-table/data-table-sheet.js +43 -40
  32. package/dist/components/ui/data-table/data-table-view-options.js +17 -17
  33. package/dist/components/ui/data-table/data-table.js +21 -20
  34. package/dist/components/ui/date-picker/date-picker.js +83 -87
  35. package/dist/components/ui/date-picker/date-range-picker.js +129 -125
  36. package/dist/components/ui/date-picker/month-picker.js +90 -93
  37. package/dist/components/ui/date-picker/month-range-picker.js +132 -129
  38. package/dist/components/ui/date-picker/multi-date-picker.js +37 -38
  39. package/dist/components/ui/date-picker/multi-month-picker.js +29 -30
  40. package/dist/components/ui/date-picker/multi-week-picker.js +49 -38
  41. package/dist/components/ui/date-picker/week-picker.js +116 -112
  42. package/dist/components/ui/date-picker/week-range-picker.js +153 -142
  43. package/dist/components/ui/dialog.js +15 -6
  44. package/dist/components/ui/drawer.js +16 -13
  45. package/dist/components/ui/dropdown-menu.js +4 -2
  46. package/dist/components/ui/dynamic-layout.d.ts +2 -2
  47. package/dist/components/ui/dynamic-layout.js +18 -15
  48. package/dist/components/ui/empty-container.js +69 -64
  49. package/dist/components/ui/file-upload.js +113 -106
  50. package/dist/components/ui/filter-panel/filter-panel.js +49 -46
  51. package/dist/components/ui/filter-strip/filter-strip.js +41 -37
  52. package/dist/components/ui/header.js +26 -25
  53. package/dist/components/ui/horizontal-scroller/horizontal-scroller.js +43 -40
  54. package/dist/components/ui/hover-card.js +6 -5
  55. package/dist/components/ui/input.d.ts +1 -1
  56. package/dist/components/ui/input.js +79 -68
  57. package/dist/components/ui/loader.d.ts +1 -0
  58. package/dist/components/ui/loader.js +23 -13
  59. package/dist/components/ui/nested-list/components/NestedListContent.d.ts +1 -3
  60. package/dist/components/ui/nested-list/components/NestedListContent.js +16 -15
  61. package/dist/components/ui/nested-list/components/SortableItem.js +116 -80
  62. package/dist/components/ui/nested-list/hooks/useNestedListDragDrop.d.ts +13 -1
  63. package/dist/components/ui/nested-list/hooks/useNestedListDragDrop.js +162 -112
  64. package/dist/components/ui/nested-list/nested-list.js +182 -189
  65. package/dist/components/ui/notification-panel/notification-item.js +19 -17
  66. package/dist/components/ui/notification-panel/notification-list.js +21 -21
  67. package/dist/components/ui/notification-panel/notification-panel.js +25 -25
  68. package/dist/components/ui/popover.js +37 -34
  69. package/dist/components/ui/progress.js +12 -10
  70. package/dist/components/ui/prompt.js +29 -27
  71. package/dist/components/ui/radio-group.js +55 -46
  72. package/dist/components/ui/select/components/Submenu.d.ts +1 -2
  73. package/dist/components/ui/select/components/Submenu.js +52 -48
  74. package/dist/components/ui/select/select.js +321 -324
  75. package/dist/components/ui/sheet.js +18 -15
  76. package/dist/components/ui/sidebar.d.ts +2 -2
  77. package/dist/components/ui/sidebar.js +3 -3
  78. package/dist/components/ui/skeleton.d.ts +2 -1
  79. package/dist/components/ui/skeleton.js +12 -11
  80. package/dist/components/ui/slider.js +39 -12
  81. package/dist/components/ui/smart-input.js +44 -39
  82. package/dist/components/ui/stepper.js +33 -29
  83. package/dist/components/ui/switch.js +6 -4
  84. package/dist/components/ui/tabs.js +50 -45
  85. package/dist/components/ui/tag-group.d.ts +2 -1
  86. package/dist/components/ui/tag-group.js +29 -25
  87. package/dist/components/ui/tag.d.ts +1 -0
  88. package/dist/components/ui/tag.js +26 -20
  89. package/dist/components/ui/textarea.js +18 -17
  90. package/dist/components/ui/toast.d.ts +1 -1
  91. package/dist/components/ui/toast.js +47 -41
  92. package/dist/components/ui/toaster.js +42 -42
  93. package/dist/components/ui/tooltip.js +18 -16
  94. package/dist/components/ui/types/date-picker.types.d.ts +33 -0
  95. package/dist/components/ui/types/empty-container.types.d.ts +5 -0
  96. package/dist/components/ui/types/nested-list.types.d.ts +1 -0
  97. package/dist/components/ui/types/select.types.d.ts +0 -1
  98. package/dist/icons/assets/bookmark.svg.js +4 -0
  99. package/dist/icons/assets/bookmark.svg2.js +5 -0
  100. package/dist/icons/assets/bookmarkFilled.svg.js +4 -0
  101. package/dist/icons/assets/bookmarkFilled.svg2.js +5 -0
  102. package/dist/icons/assets/download.svg.js +4 -0
  103. package/dist/icons/assets/download.svg2.js +5 -0
  104. package/dist/icons/index.d.ts +20 -6
  105. package/dist/icons/index.js +398 -370
  106. package/dist/impact-nova.css +1 -1
  107. package/dist/index.d.ts +1 -0
  108. package/dist/index.js +318 -314
  109. package/dist/lib/fiscal-calendar.d.ts +62 -0
  110. package/dist/lib/fiscal-calendar.js +99 -0
  111. package/package.json +5 -5
  112. package/dist/components/ui/select/hooks/useClickOutside.d.ts +0 -15
  113. package/dist/components/ui/select/hooks/useClickOutside.js +0 -43
  114. package/dist/components/ui/select/hooks/useMenuPosition.d.ts +0 -2
  115. package/dist/components/ui/select/hooks/useMenuPosition.js +0 -89
@@ -1,114 +1,111 @@
1
- import { jsxs as P, jsx as o } from "react/jsx-runtime";
2
- import * as r from "react";
3
- import { X as B } from "lucide-react";
4
- import { CalendarMonth as E } from "../../../icons/index.js";
5
- import { parse as T, isValid as j } from "date-fns";
6
- import { cn as R, maskDate as $ } from "../../../lib/utils.js";
7
- import { Input as X } from "../input.js";
8
- import { Popover as q, PopoverTrigger as z, PopoverContent as G } from "../popover.js";
9
- import { Calendar as H } from "../calendar.js";
10
- const f = (e) => `${(e.month + 1).toString().padStart(2, "0")}/${e.year}`, J = r.forwardRef(
1
+ import { jsxs as C, jsx as a } from "react/jsx-runtime";
2
+ import * as s from "react";
3
+ import { X as E } from "lucide-react";
4
+ import { CalendarMonth as R } from "../../../icons/index.js";
5
+ import { parse as $, isValid as X } from "date-fns";
6
+ import { cn as q, maskDate as z } from "../../../lib/utils.js";
7
+ import { Input as G } from "../input.js";
8
+ import { Popover as H, PopoverTrigger as J, PopoverContent as K } from "../popover.js";
9
+ import { Calendar as L } from "../calendar.js";
10
+ const d = (t) => `${(t.month + 1).toString().padStart(2, "0")}/${t.year}`, Q = s.forwardRef(
11
11
  ({
12
- value: e,
13
- onChange: a,
14
- placeholder: C = "Select Month",
15
- minDate: k,
16
- maxDate: S,
17
- fromYear: D,
12
+ value: t,
13
+ onChange: i,
14
+ placeholder: D = "Select Month",
15
+ minDate: P,
16
+ maxDate: x,
17
+ fromYear: k,
18
18
  toYear: w,
19
- showFooter: i = !0,
20
- disabled: u,
21
- className: x,
22
- ...I
23
- }, N) => {
24
- const [l, p] = r.useState(!1), [c, s] = r.useState(e), [M, h] = r.useState(e ? f(e) : ""), [A, m] = r.useState(() => e ? new Date(e.year, e.month, 1) : /* @__PURE__ */ new Date());
25
- r.useEffect(() => {
26
- h(e ? f(e) : "");
27
- }, [e]), r.useEffect(() => {
28
- console.log("[MonthPicker] useEffect - open:", l, "value:", e, "pendingMonth:", c), l && (s(e), m(e ? new Date(e.year, e.month, 1) : /* @__PURE__ */ new Date()));
29
- }, [l]);
30
- const Y = (n) => {
31
- console.log("[MonthPicker] handleSelect called:", n), s(n), i || (console.log("[MonthPicker] No footer - applying immediately"), a?.(n), p(!1));
32
- }, O = (n) => {
33
- const t = n;
34
- h(t ? f(t) : "");
35
- }, V = (n) => {
36
- const t = n !== void 0 ? n : c;
37
- console.log("[MonthPicker] handleApply called, appliedMonth:", n, "pendingMonth:", c, "using:", t), a?.(t), p(!1);
19
+ showFooter: r = !0,
20
+ disabled: M,
21
+ className: N,
22
+ ...A
23
+ }, V) => {
24
+ const [n, p] = s.useState(!1), [o, c] = s.useState(t), [h, l] = s.useState(t ? d(t) : ""), [Y, u] = s.useState(() => t ? new Date(t.year, t.month, 1) : /* @__PURE__ */ new Date());
25
+ s.useEffect(() => {
26
+ l(t ? d(t) : "");
27
+ }, [t]), s.useEffect(() => {
28
+ n && (c(t), u(t ? new Date(t.year, t.month, 1) : /* @__PURE__ */ new Date()));
29
+ }, [n]);
30
+ const I = (e) => {
31
+ c(e), r || (i?.(e), p(!1));
32
+ }, T = (e) => {
33
+ i?.(e !== void 0 ? e : o), p(!1);
38
34
  }, v = () => {
39
- console.log("[MonthPicker] handleCancel called"), s(e), p(!1);
40
- }, g = () => {
41
- console.log("[MonthPicker] handleClear called"), s(void 0), h(""), a?.(void 0), i || p(!1);
42
- };
43
- return /* @__PURE__ */ P(q, { open: l, onOpenChange: p, children: [
44
- /* @__PURE__ */ o(z, { asChild: !0, children: /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(
45
- X,
35
+ c(t), p(!1);
36
+ }, y = () => {
37
+ c(void 0), l(""), i?.(void 0), r || p(!1);
38
+ }, O = (e) => {
39
+ const m = z(e.target.value, "MM/yyyy");
40
+ if (l(m), m === "") {
41
+ c(void 0), r || i?.(void 0);
42
+ return;
43
+ }
44
+ const f = $(m, "MM/yyyy", /* @__PURE__ */ new Date());
45
+ if (X(f)) {
46
+ const S = { month: f.getMonth(), year: f.getFullYear() };
47
+ c(S), u(f), r || i?.(S);
48
+ }
49
+ }, j = () => {
50
+ if (!n) {
51
+ if (h === "") {
52
+ y();
53
+ return;
54
+ }
55
+ l(o ? d(o) : "");
56
+ }
57
+ }, g = r && n && (o ? d(o) : "") !== h, B = r && n ? o ? d(o) : "" : h;
58
+ return /* @__PURE__ */ C(H, { open: n, onOpenChange: p, children: [
59
+ /* @__PURE__ */ a(J, { asChild: !0, children: /* @__PURE__ */ a("div", { "data-component": "month-picker", "data-state": n ? "open" : "closed", "data-pending": g || void 0, children: /* @__PURE__ */ a(
60
+ G,
46
61
  {
47
- ref: N,
48
- value: M,
49
- onChange: (n) => {
50
- const t = $(n.target.value, "MM/yyyy");
51
- if (h(t), t === "") {
52
- s(void 0), i || a?.(void 0);
53
- return;
54
- }
55
- const d = T(t, "MM/yyyy", /* @__PURE__ */ new Date());
56
- if (j(d)) {
57
- const y = { month: d.getMonth(), year: d.getFullYear() };
58
- s(y), m(d), i || a?.(y);
59
- }
60
- },
61
- onBlur: () => {
62
- if (M === "") {
63
- g();
64
- return;
65
- }
66
- h(c ? f(c) : "");
67
- },
68
- onClick: (n) => l && n.stopPropagation(),
69
- placeholder: l ? "MM/YYYY" : C,
70
- disabled: u,
71
- className: R("cursor-pointer", x),
72
- suffix: /* @__PURE__ */ P("div", { className: "flex items-center gap-1", children: [
73
- e && !u && /* @__PURE__ */ o(
74
- B,
62
+ ref: V,
63
+ value: B,
64
+ onChange: O,
65
+ onBlur: j,
66
+ onClick: (e) => n && e.stopPropagation(),
67
+ placeholder: n ? "MM/YYYY" : D,
68
+ disabled: M,
69
+ "data-form-control": "input",
70
+ className: q("cursor-pointer", g && "text-muted-foreground", N),
71
+ suffix: /* @__PURE__ */ C("div", { className: "flex items-center gap-1", children: [
72
+ t && !M && /* @__PURE__ */ a(
73
+ E,
75
74
  {
76
75
  className: "h-4 w-4 cursor-pointer hover:text-foreground",
77
- onClick: (n) => {
78
- n.stopPropagation(), g();
76
+ onClick: (e) => {
77
+ e.stopPropagation(), y();
79
78
  }
80
79
  }
81
80
  ),
82
- /* @__PURE__ */ o(E, { className: "h-4 w-4 text-secondary-foreground" })
81
+ /* @__PURE__ */ a(R, { className: "h-4 w-4 text-secondary-foreground" })
83
82
  ] }),
84
- ...I
83
+ ...A
85
84
  }
86
85
  ) }) }),
87
- /* @__PURE__ */ o(
88
- G,
86
+ /* @__PURE__ */ a(
87
+ K,
89
88
  {
90
89
  className: "w-auto p-0",
91
90
  align: "start",
92
- onOpenAutoFocus: (n) => n.preventDefault(),
93
- onInteractOutside: (n) => n.preventDefault(),
94
- children: /* @__PURE__ */ o(
95
- H,
91
+ onOpenAutoFocus: (e) => e.preventDefault(),
92
+ children: /* @__PURE__ */ a(
93
+ L,
96
94
  {
97
95
  pickerType: "month",
98
96
  monthMode: "single",
99
- selectedMonths: c,
100
- onMonthSelect: Y,
101
- onPendingChange: O,
102
- month: A,
103
- onMonthChange: m,
104
- fromDate: k,
105
- toDate: S,
106
- fromYear: D,
97
+ selectedMonths: o,
98
+ onMonthSelect: I,
99
+ month: Y,
100
+ onMonthChange: u,
101
+ fromDate: P,
102
+ toDate: x,
103
+ fromYear: k,
107
104
  toYear: w,
108
- showFooter: i,
109
- onApply: V,
105
+ showFooter: r,
106
+ onApply: T,
110
107
  onCancel: v,
111
- onClear: g
108
+ onClear: y
112
109
  }
113
110
  )
114
111
  }
@@ -116,7 +113,7 @@ const f = (e) => `${(e.month + 1).toString().padStart(2, "0")}/${e.year}`, J = r
116
113
  ] });
117
114
  }
118
115
  );
119
- J.displayName = "MonthPicker";
116
+ Q.displayName = "MonthPicker";
120
117
  export {
121
- J as MonthPicker
118
+ Q as MonthPicker
122
119
  };
@@ -1,198 +1,201 @@
1
- import { jsxs as f, jsx as o } from "react/jsx-runtime";
2
- import * as c from "react";
3
- import { X as L } from "lucide-react";
4
- import { CalendarMonth as Q, Info as U } from "../../../icons/index.js";
5
- import { parse as S, isValid as v } from "date-fns";
6
- import { cn as w, maskDate as D } from "../../../lib/utils.js";
7
- import { Popover as W, PopoverTrigger as Z, PopoverContent as F } from "../popover.js";
8
- import { Calendar as _ } from "../calendar.js";
9
- const m = (e) => `${(e.month + 1).toString().padStart(2, "0")}/${e.year}`, ee = c.forwardRef(
1
+ import { jsxs as p, jsx as a } from "react/jsx-runtime";
2
+ import * as f from "react";
3
+ import { X as _ } from "lucide-react";
4
+ import { CalendarMonth as F, Info as tt } from "../../../icons/index.js";
5
+ import { parse as R, isValid as I } from "date-fns";
6
+ import { cn as u, maskDate as v } from "../../../lib/utils.js";
7
+ import { Popover as et, PopoverTrigger as ot, PopoverContent as nt } from "../popover.js";
8
+ import { Calendar as rt } from "../calendar.js";
9
+ const s = (t) => `${(t.month + 1).toString().padStart(2, "0")}/${t.year}`, at = f.forwardRef(
10
10
  ({
11
- value: e,
12
- onChange: a,
13
- placeholder: te = "Select Month Range",
14
- minDate: Y,
15
- maxDate: I,
16
- fromYear: V,
17
- toYear: A,
18
- showFooter: p = !0,
11
+ value: t,
12
+ onChange: m,
13
+ placeholder: st = "Select Month Range",
14
+ minDate: V,
15
+ maxDate: A,
16
+ fromYear: E,
17
+ toYear: j,
18
+ showFooter: r = !0,
19
19
  disabled: h,
20
- className: O,
21
- isError: g,
22
- size: R,
23
- label: P,
24
- helperText: k,
25
- required: j,
26
- prefix: ne,
27
- prefixClick: oe,
28
- ...B
29
- }, E) => {
30
- const [s, u] = c.useState(!1), [d, l] = c.useState(e), [T, y] = c.useState(e?.from ? m(e.from) : ""), [$, x] = c.useState(e?.to ? m(e.to) : ""), [z, b] = c.useState(() => e?.from ? new Date(e.from.year, e.from.month, 1) : /* @__PURE__ */ new Date());
31
- c.useEffect(() => {
32
- y(e?.from ? m(e.from) : ""), x(e?.to ? m(e.to) : "");
33
- }, [e]), c.useEffect(() => {
34
- console.log("[MonthRangePicker] useEffect - open:", s, "value:", e, "pendingRange:", d), s && (l(e), b(e?.from ? new Date(e.from.year, e.from.month, 1) : /* @__PURE__ */ new Date()));
35
- }, [s]);
36
- const X = (t) => {
37
- console.log("[MonthRangePicker] handleSelect called:", t), l(t), !p && t?.from && t?.to && (console.log("[MonthRangePicker] No footer - applying immediately"), a?.(t), u(!1));
38
- }, q = (t) => {
39
- const n = t;
40
- y(n?.from ? m(n.from) : ""), x(n?.to ? m(n.to) : "");
41
- }, G = (t) => {
42
- const n = t !== void 0 ? t : d;
43
- console.log("[MonthRangePicker] handleApply called, appliedRange:", t, "pendingRange:", d, "using:", n), a?.(n), u(!1);
44
- }, H = () => {
45
- console.log("[MonthRangePicker] handleCancel called"), l(e), u(!1);
46
- }, C = () => {
47
- console.log("[MonthRangePicker] handleClear called"), l(void 0), y(""), x(""), a?.(void 0), p || u(!1);
48
- }, J = (t) => {
49
- const n = D(t.target.value, "MM/yyyy");
50
- if (y(n), n === "") {
51
- const i = { from: void 0, to: e?.to };
52
- l(i), p || a?.(i);
20
+ className: B,
21
+ isError: y,
22
+ size: S,
23
+ label: N,
24
+ helperText: C,
25
+ required: O,
26
+ prefix: dt,
27
+ prefixClick: it,
28
+ ...T
29
+ }, $) => {
30
+ const [n, x] = f.useState(!1), [o, c] = f.useState(t), [z, M] = f.useState(t?.from ? s(t.from) : ""), [X, b] = f.useState(t?.to ? s(t.to) : ""), [q, w] = f.useState(() => t?.from ? new Date(t.from.year, t.from.month, 1) : /* @__PURE__ */ new Date());
31
+ f.useEffect(() => {
32
+ M(t?.from ? s(t.from) : ""), b(t?.to ? s(t.to) : "");
33
+ }, [t]), f.useEffect(() => {
34
+ n && (c(t), w(t?.from ? new Date(t.from.year, t.from.month, 1) : /* @__PURE__ */ new Date()));
35
+ }, [n]);
36
+ const G = (e) => {
37
+ c(e), !r && e?.from && e?.to && (e.from.month !== e.to.month || e.from.year !== e.to.year) && (m?.(e), x(!1));
38
+ }, H = (e) => {
39
+ m?.(e !== void 0 ? e : o), x(!1);
40
+ }, J = () => {
41
+ c(t), x(!1);
42
+ }, D = () => {
43
+ c(void 0), M(""), b(""), m?.(void 0), r || x(!1);
44
+ }, K = (e) => {
45
+ const d = v(e.target.value, "MM/yyyy");
46
+ if (M(d), d === "") {
47
+ const l = { from: void 0, to: t?.to };
48
+ c(l), r || m?.(l);
53
49
  return;
54
50
  }
55
- const r = S(n, "MM/yyyy", /* @__PURE__ */ new Date());
56
- if (v(r)) {
57
- const M = { from: { month: r.getMonth(), year: r.getFullYear() }, to: e?.to };
58
- l(M), b(r), p || a?.(M);
51
+ const i = R(d, "MM/yyyy", /* @__PURE__ */ new Date());
52
+ if (I(i)) {
53
+ const g = { from: { month: i.getMonth(), year: i.getFullYear() }, to: t?.to };
54
+ c(g), w(i), r || m?.(g);
59
55
  }
60
- }, K = (t) => {
61
- const n = D(t.target.value, "MM/yyyy");
62
- if (x(n), n === "") {
63
- const i = { from: e?.from, to: void 0 };
64
- l(i), p || a?.(i);
56
+ }, L = (e) => {
57
+ const d = v(e.target.value, "MM/yyyy");
58
+ if (b(d), d === "") {
59
+ const l = { from: t?.from, to: void 0 };
60
+ c(l), r || m?.(l);
65
61
  return;
66
62
  }
67
- const r = S(n, "MM/yyyy", /* @__PURE__ */ new Date());
68
- if (v(r)) {
69
- const i = { month: r.getMonth(), year: r.getFullYear() }, M = { from: e?.from, to: i };
70
- l(M), b(r), p || a?.(M);
63
+ const i = R(d, "MM/yyyy", /* @__PURE__ */ new Date());
64
+ if (I(i)) {
65
+ const l = { month: i.getMonth(), year: i.getFullYear() }, g = { from: t?.from, to: l };
66
+ c(g), w(i), r || m?.(g);
71
67
  }
72
- }, N = () => {
73
- y(d?.from ? m(d.from) : ""), x(d?.to ? m(d.to) : "");
74
- };
75
- return /* @__PURE__ */ f("div", { className: "w-full space-y-1.5 min-w-[240px]", children: [
76
- P && /* @__PURE__ */ f(
68
+ }, k = () => {
69
+ n || (M(o?.from ? s(o.from) : ""), b(o?.to ? s(o.to) : ""));
70
+ }, Q = t?.from ? s(t.from) : "", U = t?.to ? s(t.to) : "", P = r && n ? o?.from ? s(o.from) : "" : z, Y = r && n ? o?.to && (o.to.month !== o.from?.month || o.to.year !== o.from?.year) ? s(o.to) : "" : X, W = r && n && P !== Q, Z = r && n && Y !== U;
71
+ return /* @__PURE__ */ p("div", { className: "w-full space-y-1.5 min-w-[240px]", "data-component": "month-range-picker", "data-disabled": h || void 0, children: [
72
+ N && /* @__PURE__ */ p(
77
73
  "label",
78
74
  {
79
- className: w(
75
+ className: u(
80
76
  "text-xs font-medium leading-[18px] text-[#60697d]",
81
77
  h && "opacity-70",
82
- g && "text-destructive"
78
+ y && "text-destructive"
83
79
  ),
84
80
  children: [
85
- P,
81
+ N,
86
82
  " ",
87
- j && /* @__PURE__ */ o("span", { className: "text-destructive", children: "*" })
83
+ O && /* @__PURE__ */ a("span", { className: "text-destructive", children: "*" })
88
84
  ]
89
85
  }
90
86
  ),
91
- /* @__PURE__ */ f(W, { open: s, onOpenChange: u, children: [
92
- /* @__PURE__ */ o(Z, { asChild: !0, children: /* @__PURE__ */ f(
87
+ /* @__PURE__ */ p(et, { open: n, onOpenChange: x, children: [
88
+ /* @__PURE__ */ a(ot, { asChild: !0, children: /* @__PURE__ */ p(
93
89
  "div",
94
90
  {
95
- className: w(
96
- "flex w-full items-center justify-between gap-2 rounded-md border bg-transparent px-3 text-sm shadow-sm transition-colors hover:border-primary disabled:cursor-not-allowed disabled:bg-disabled-secondary-bg disabled:text-disabled-text disabled:border-border",
97
- g ? "border-destructive hover:border-destructive" : "border-input",
98
- R === "sm" ? "h-6" : R === "md" ? "h-[28px]" : "h-8",
91
+ "data-state": n ? "open" : "closed",
92
+ className: u(
93
+ "flex w-full items-center justify-between gap-2 rounded-md border bg-white px-3 text-sm shadow-sm transition-colors hover:border-primary disabled:cursor-not-allowed disabled:bg-disabled-secondary-bg disabled:text-disabled-text disabled:border-border",
94
+ y ? "border-destructive hover:border-destructive" : "border-input",
95
+ S === "sm" ? "h-6" : S === "md" ? "h-[28px]" : "h-8",
99
96
  h && "pointer-events-none opacity-100 bg-disabled-secondary-bg border-border text-disabled-text hover:border-border",
100
97
  "cursor-pointer",
101
- O
98
+ B
102
99
  ),
103
100
  children: [
104
- /* @__PURE__ */ f("div", { className: "flex items-center gap-4 flex-1 min-w-0", children: [
105
- /* @__PURE__ */ o(
101
+ /* @__PURE__ */ p("div", { className: "flex items-center gap-4 flex-1 min-w-0", children: [
102
+ /* @__PURE__ */ a(
106
103
  "input",
107
104
  {
108
- ref: E,
105
+ ref: $,
109
106
  type: "text",
110
- value: T,
111
- onChange: J,
112
- onBlur: N,
113
- onClick: (t) => s && t.stopPropagation(),
114
- placeholder: s ? "MM/YYYY" : "Start Month",
107
+ value: P,
108
+ onChange: K,
109
+ onBlur: k,
110
+ onClick: (e) => n && e.stopPropagation(),
111
+ placeholder: n ? "MM/YYYY" : "Start Month",
115
112
  disabled: !!h,
116
- className: "flex-1 min-w-0 bg-transparent p-0 text-sm font-medium outline-none placeholder:font-medium placeholder:text-[#dfe2e7] disabled:cursor-not-allowed disabled:opacity-50",
117
- ...B
113
+ "data-field": "start",
114
+ className: u(
115
+ "flex-1 min-w-0 bg-transparent p-0 text-sm font-medium outline-none placeholder:font-medium placeholder:text-[#dfe2e7] disabled:cursor-not-allowed disabled:opacity-50",
116
+ W && "text-muted-foreground"
117
+ ),
118
+ ...T
118
119
  }
119
120
  ),
120
- /* @__PURE__ */ o(
121
+ /* @__PURE__ */ a(
121
122
  "input",
122
123
  {
123
124
  type: "text",
124
- value: $,
125
- onChange: K,
126
- onBlur: N,
127
- onClick: (t) => s && t.stopPropagation(),
128
- placeholder: s ? "MM/YYYY" : "End Month",
125
+ value: Y,
126
+ onChange: L,
127
+ onBlur: k,
128
+ onClick: (e) => n && e.stopPropagation(),
129
+ placeholder: n ? "MM/YYYY" : "End Month",
129
130
  disabled: !!h,
130
- className: "flex-1 min-w-0 bg-transparent p-0 text-sm font-medium outline-none placeholder:font-medium placeholder:text-[#dfe2e7] disabled:cursor-not-allowed disabled:opacity-50"
131
+ "data-field": "end",
132
+ className: u(
133
+ "flex-1 min-w-0 bg-transparent p-0 text-sm font-medium outline-none placeholder:font-medium placeholder:text-[#dfe2e7] disabled:cursor-not-allowed disabled:opacity-50",
134
+ Z && "text-muted-foreground"
135
+ )
131
136
  }
132
137
  )
133
138
  ] }),
134
- /* @__PURE__ */ f("div", { className: "flex items-center gap-1 shrink-0", children: [
135
- e?.from && !h && /* @__PURE__ */ o(
136
- L,
139
+ /* @__PURE__ */ p("div", { className: "flex items-center gap-1 shrink-0", children: [
140
+ t?.from && !h && /* @__PURE__ */ a(
141
+ _,
137
142
  {
138
143
  className: "h-4 w-4 cursor-pointer hover:text-foreground text-muted-foreground",
139
- onClick: (t) => {
140
- t.stopPropagation(), C();
144
+ onClick: (e) => {
145
+ e.stopPropagation(), D();
141
146
  }
142
147
  }
143
148
  ),
144
- /* @__PURE__ */ o(Q, { className: "h-4 w-4 text-secondary-foreground" })
149
+ /* @__PURE__ */ a(F, { className: "h-4 w-4 text-secondary-foreground" })
145
150
  ] })
146
151
  ]
147
152
  }
148
153
  ) }),
149
- /* @__PURE__ */ o(
150
- F,
154
+ /* @__PURE__ */ a(
155
+ nt,
151
156
  {
152
157
  className: "w-auto p-0",
153
158
  align: "start",
154
- onOpenAutoFocus: (t) => t.preventDefault(),
155
- onInteractOutside: (t) => t.preventDefault(),
156
- children: /* @__PURE__ */ o(
157
- _,
159
+ onOpenAutoFocus: (e) => e.preventDefault(),
160
+ children: /* @__PURE__ */ a(
161
+ rt,
158
162
  {
159
163
  pickerType: "month",
160
164
  monthMode: "range",
161
- selectedMonths: d,
162
- onMonthSelect: X,
163
- onPendingChange: q,
164
- month: z,
165
- onMonthChange: b,
166
- fromDate: Y,
167
- toDate: I,
168
- fromYear: V,
169
- toYear: A,
170
- showFooter: p,
171
- onApply: G,
172
- onCancel: H,
173
- onClear: C
165
+ selectedMonths: o,
166
+ onMonthSelect: G,
167
+ month: q,
168
+ onMonthChange: w,
169
+ fromDate: V,
170
+ toDate: A,
171
+ fromYear: E,
172
+ toYear: j,
173
+ showFooter: r,
174
+ onApply: H,
175
+ onCancel: J,
176
+ onClear: D
174
177
  }
175
178
  )
176
179
  }
177
180
  )
178
181
  ] }),
179
- k && /* @__PURE__ */ f("div", { className: w("flex items-center gap-1", g && "text-destructive"), children: [
180
- !g && /* @__PURE__ */ o(U, { size: 10, className: "shrink-0 text-muted-foreground" }),
181
- /* @__PURE__ */ o(
182
+ C && /* @__PURE__ */ p("div", { className: u("flex items-center gap-1", y && "text-destructive"), children: [
183
+ !y && /* @__PURE__ */ a(tt, { size: 10, className: "shrink-0 text-muted-foreground" }),
184
+ /* @__PURE__ */ a(
182
185
  "p",
183
186
  {
184
- className: w(
187
+ className: u(
185
188
  "text-[10px] text-[#7a8294]",
186
- g && "text-destructive"
189
+ y && "text-destructive"
187
190
  ),
188
- children: k
191
+ children: C
189
192
  }
190
193
  )
191
194
  ] })
192
195
  ] });
193
196
  }
194
197
  );
195
- ee.displayName = "MonthRangePicker";
198
+ at.displayName = "MonthRangePicker";
196
199
  export {
197
- ee as MonthRangePicker
200
+ at as MonthRangePicker
198
201
  };