impact-nova 1.8.1 → 1.8.3

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 (29) hide show
  1. package/dist/components/ui/ag-grid-react/cell-renderers/default-text-cell-renderer.d.ts +6 -0
  2. package/dist/components/ui/ag-grid-react/cell-renderers/default-text-cell-renderer.js +9 -0
  3. package/dist/components/ui/ag-grid-react/headers/custom-header-group.d.ts +5 -6
  4. package/dist/components/ui/ag-grid-react/headers/custom-header-group.js +19 -19
  5. package/dist/components/ui/ag-grid-react/index.d.ts +1 -1
  6. package/dist/components/ui/ag-grid-react/index.js +164 -165
  7. package/dist/components/ui/button-group.d.ts +10 -6
  8. package/dist/components/ui/button-group.js +1 -2
  9. package/dist/components/ui/calendar.js +2 -3
  10. package/dist/components/ui/combobox.d.ts +1 -0
  11. package/dist/components/ui/combobox.js +116 -102
  12. package/dist/components/ui/date-picker/date-picker.js +52 -50
  13. package/dist/components/ui/date-picker/date-range-picker.js +92 -90
  14. package/dist/components/ui/date-picker/month-picker.js +57 -55
  15. package/dist/components/ui/date-picker/month-range-picker.js +84 -82
  16. package/dist/components/ui/date-picker/multi-date-picker.js +45 -43
  17. package/dist/components/ui/date-picker/week-range-picker.js +77 -75
  18. package/dist/components/ui/expandable-sku/expandable-sku.js +10 -10
  19. package/dist/components/ui/filter-strip/filter-tag-list.d.ts +8 -1
  20. package/dist/components/ui/filter-strip/filter-tag-list.js +99 -85
  21. package/dist/components/ui/input.js +12 -13
  22. package/dist/components/ui/smart-input.d.ts +2 -2
  23. package/dist/components/ui/smart-input.js +52 -51
  24. package/dist/components/ui/textarea.d.ts +10 -8
  25. package/dist/components/ui/textarea.js +52 -52
  26. package/dist/components/ui/types/ag-grid.types.d.ts +5 -0
  27. package/dist/components/ui/types/button-group.types.d.ts +1 -1
  28. package/dist/index.js +425 -426
  29. package/package.json +1 -1
@@ -1,11 +1,11 @@
1
- import { jsxs as M, jsx as n } from "react/jsx-runtime";
1
+ import { jsxs as g, jsx as n } from "react/jsx-runtime";
2
2
  import * as o from "react";
3
- import { X as K } from "lucide-react";
4
- import { CalendarMonth as L } from "../../../icons/index.js";
5
- import { isValid as u, parse as C } from "date-fns";
6
- import { cn as Q, padValidDateString as U, maskDate as W } from "../../../lib/utils.js";
7
- import { Input as Z } from "../input.js";
8
- import { Popover as _, PopoverTrigger as F, PopoverContent as v } from "../popover.js";
3
+ import { X as L } from "lucide-react";
4
+ import { CalendarMonth as Q } from "../../../icons/index.js";
5
+ import { isValid as C, parse as P } from "date-fns";
6
+ import { cn as U, padValidDateString as W, maskDate as Z } from "../../../lib/utils.js";
7
+ import { Input as _ } from "../input.js";
8
+ import { Popover as b, PopoverTrigger as F, PopoverContent as v } from "../popover.js";
9
9
  import { Calendar as tt } from "../calendar.js";
10
10
  import { Tooltip as I, TooltipTrigger as T, TooltipContent as N } from "../tooltip.js";
11
11
  import { useImpactNovaI18n as et } from "../../../i18n/ImpactNovaI18nContext.js";
@@ -18,69 +18,71 @@ const c = (t) => `${(t.month + 1).toString().padStart(2, "0")}/${t.year}`, nt =
18
18
  maxDate: R,
19
19
  startMonth: O,
20
20
  endMonth: Y,
21
- showFooter: d = !0,
22
- disabled: P,
21
+ showFooter: p = !0,
22
+ disabled: m,
23
23
  className: j,
24
24
  ...B
25
25
  }, E) => {
26
- const { t: m } = et(), $ = V ?? m("datePicker.selectMonth"), w = o.useRef(null);
26
+ const { t: y } = et(), $ = V ?? y("datePicker.selectMonth"), w = o.useRef(null);
27
27
  o.useRef(null), o.useImperativeHandle(E, () => w.current);
28
- const [r, f] = o.useState(!1), [S, a] = o.useState(t), [l, i] = o.useState(t ? c(t) : ""), [b, g] = o.useState(t ? new Date(t.year, t.month) : /* @__PURE__ */ new Date());
28
+ const [r, h] = o.useState(!1), [S, a] = o.useState(t), [l, i] = o.useState(t ? c(t) : ""), [H, u] = o.useState(t ? new Date(t.year, t.month) : /* @__PURE__ */ new Date());
29
29
  o.useEffect(() => {
30
30
  r || (i(t ? c(t) : ""), a(t));
31
31
  }, [r, t]), o.useEffect(() => {
32
- r && (a(t), g(t ? new Date(t.year, t.month) : /* @__PURE__ */ new Date()), i(t ? c(t) : ""));
32
+ r && (a(t), u(t ? new Date(t.year, t.month) : /* @__PURE__ */ new Date()), i(t ? c(t) : ""));
33
33
  }, [r, t]);
34
- const H = (e) => {
35
- a(e), e && i(c(e)), d || (s?.(e), f(!1));
36
- }, X = (e) => {
37
- s?.(e !== void 0 ? e : S), f(!1);
38
- }, q = () => {
39
- a(t), i(t ? c(t) : ""), f(!1);
34
+ const X = (e) => {
35
+ a(e), e && i(c(e)), p || (s?.(e), h(!1));
36
+ }, q = (e) => {
37
+ s?.(e !== void 0 ? e : S), h(!1);
38
+ }, z = () => {
39
+ a(t), i(t ? c(t) : ""), h(!1);
40
40
  }, k = () => {
41
- a(void 0), i(""), s?.(void 0), d || f(!1);
42
- }, z = (e) => {
43
- const p = e.target.value, h = W(p, "MM/yyyy", l);
44
- if (i(h), h === "") {
45
- a(void 0), d || s?.(void 0);
41
+ a(void 0), i(""), s?.(void 0), p || h(!1);
42
+ }, G = (e) => {
43
+ const d = e.target.value, f = Z(d, "MM/yyyy", l);
44
+ if (i(f), f === "") {
45
+ a(void 0), p || s?.(void 0);
46
46
  return;
47
47
  }
48
- const y = C(h, "MM/yyyy", /* @__PURE__ */ new Date());
49
- if (u(y) && h.length === 7) {
50
- const x = { month: y.getMonth(), year: y.getFullYear() };
51
- a(x), g(y), d || s?.(x);
48
+ const M = P(f, "MM/yyyy", /* @__PURE__ */ new Date());
49
+ if (C(M) && f.length === 7) {
50
+ const x = { month: M.getMonth(), year: M.getFullYear() };
51
+ a(x), u(M), p || s?.(x);
52
52
  }
53
- }, G = () => {
53
+ }, J = () => {
54
54
  if (r) return;
55
- const e = U(l, "MM/yyyy"), p = C(e, "MM/yyyy", /* @__PURE__ */ new Date());
56
- if (!u(p) || e.length !== 7)
55
+ const e = W(l, "MM/yyyy"), d = P(e, "MM/yyyy", /* @__PURE__ */ new Date());
56
+ if (!C(d) || e.length !== 7)
57
57
  i(t ? c(t) : ""), a(t);
58
- else if (i(e), !d) {
59
- const h = { month: p.getMonth(), year: p.getFullYear() };
60
- s?.(h);
58
+ else if (i(e), !p) {
59
+ const f = { month: d.getMonth(), year: d.getFullYear() };
60
+ s?.(f);
61
61
  }
62
- }, D = (t ? c(t) : "") !== l, J = l.length === 7 && !u(C(l, "MM/yyyy", /* @__PURE__ */ new Date()));
63
- return /* @__PURE__ */ M(_, { open: r, onOpenChange: f, children: [
62
+ }, D = (t ? c(t) : "") !== l, K = l.length === 7 && !C(P(l, "MM/yyyy", /* @__PURE__ */ new Date()));
63
+ return /* @__PURE__ */ g(b, { open: m ? !1 : r, onOpenChange: (e) => {
64
+ m || h(e);
65
+ }, children: [
64
66
  /* @__PURE__ */ n(F, { asChild: !0, children: /* @__PURE__ */ n("div", { "data-component": "month-picker", "data-state": r ? "open" : "closed", "data-pending": D || void 0, children: /* @__PURE__ */ n(
65
- Z,
67
+ _,
66
68
  {
67
69
  ref: w,
68
70
  value: l,
69
- onChange: z,
70
- onBlur: G,
71
+ onChange: G,
72
+ onBlur: J,
71
73
  onClick: (e) => r && e.stopPropagation(),
72
- placeholder: r ? m("datePicker.monthYearFormat") : $,
73
- disabled: P,
74
+ placeholder: r ? y("datePicker.monthYearFormat") : $,
75
+ disabled: m,
74
76
  "data-form-control": "input",
75
- className: Q(
77
+ className: U(
76
78
  "cursor-pointer",
77
- J ? "text-destructive" : D ? "text-content-muted" : "",
79
+ K ? "text-destructive" : D ? "text-content-muted" : "",
78
80
  j
79
81
  ),
80
- suffix: /* @__PURE__ */ M("div", { className: "flex items-center gap-1", children: [
81
- t && !P && /* @__PURE__ */ M(I, { children: [
82
+ suffix: /* @__PURE__ */ g("div", { className: "flex items-center gap-1", children: [
83
+ t && !m && /* @__PURE__ */ g(I, { children: [
82
84
  /* @__PURE__ */ n(T, { asChild: !0, children: /* @__PURE__ */ n(
83
- K,
85
+ L,
84
86
  {
85
87
  className: "h-4 w-4 cursor-pointer hover:text-content",
86
88
  onClick: (e) => {
@@ -88,11 +90,11 @@ const c = (t) => `${(t.month + 1).toString().padStart(2, "0")}/${t.year}`, nt =
88
90
  }
89
91
  }
90
92
  ) }),
91
- /* @__PURE__ */ n(N, { variant: "tertiary", side: "top", children: m("calendar.clear") })
93
+ /* @__PURE__ */ n(N, { variant: "tertiary", side: "top", children: y("calendar.clear") })
92
94
  ] }),
93
- /* @__PURE__ */ M(I, { children: [
94
- /* @__PURE__ */ n(T, { asChild: !0, children: /* @__PURE__ */ n(L, { className: "h-4 w-4 text-secondary-foreground" }) }),
95
- /* @__PURE__ */ n(N, { variant: "tertiary", side: "top", children: m("datePicker.selectMonth") })
95
+ /* @__PURE__ */ g(I, { children: [
96
+ /* @__PURE__ */ n(T, { asChild: !0, children: /* @__PURE__ */ n(Q, { className: "h-4 w-4 text-secondary-foreground" }) }),
97
+ /* @__PURE__ */ n(N, { variant: "tertiary", side: "top", children: y("datePicker.selectMonth") })
96
98
  ] })
97
99
  ] }),
98
100
  ...B
@@ -110,15 +112,15 @@ const c = (t) => `${(t.month + 1).toString().padStart(2, "0")}/${t.year}`, nt =
110
112
  pickerType: "month",
111
113
  monthMode: "single",
112
114
  selectedMonths: S,
113
- onMonthSelect: H,
114
- month: b,
115
- onMonthChange: g,
115
+ onMonthSelect: X,
116
+ month: H,
117
+ onMonthChange: u,
116
118
  disabled: { before: A, after: R },
117
119
  startMonth: O,
118
120
  endMonth: Y,
119
- showFooter: d,
120
- onApply: X,
121
- onCancel: q,
121
+ showFooter: p,
122
+ onApply: q,
123
+ onCancel: z,
122
124
  onClear: k
123
125
  }
124
126
  )
@@ -1,17 +1,17 @@
1
- import { jsxs as u, jsx as d } from "react/jsx-runtime";
1
+ import { jsxs as h, jsx as d } from "react/jsx-runtime";
2
2
  import * as p from "react";
3
3
  import { X as ht } from "lucide-react";
4
4
  import { CalendarMonth as gt, Info as G } from "../../../icons/index.js";
5
- import { isValid as x, parse as M } from "date-fns";
6
- import { cn as h, padValidDateString as R, maskDate as J } from "../../../lib/utils.js";
5
+ import { isValid as M, parse as Y } from "date-fns";
6
+ import { cn as g, padValidDateString as R, maskDate as J } from "../../../lib/utils.js";
7
7
  import { Popover as xt, PopoverTrigger as Mt, PopoverContent as Yt } from "../popover.js";
8
8
  import { Calendar as yt } from "../calendar.js";
9
9
  import { Tooltip as L, TooltipTrigger as Q, TooltipContent as U } from "../tooltip.js";
10
- import { useImpactNovaI18n as bt } from "../../../i18n/ImpactNovaI18nContext.js";
10
+ import { useImpactNovaI18n as wt } from "../../../i18n/ImpactNovaI18nContext.js";
11
11
  const m = (e, i = "MM/YYYY") => {
12
12
  const A = (e.month + 1).toString().padStart(2, "0");
13
13
  return i === "YYYY/MM" ? `${e.year}/${A}` : `${A}/${e.year}`;
14
- }, wt = p.forwardRef(
14
+ }, bt = p.forwardRef(
15
15
  ({
16
16
  value: e,
17
17
  onChange: i,
@@ -20,10 +20,10 @@ const m = (e, i = "MM/YYYY") => {
20
20
  maxDate: W,
21
21
  startMonth: Z,
22
22
  endMonth: _,
23
- showFooter: g = !0,
24
- disabled: P,
23
+ showFooter: x = !0,
24
+ disabled: u,
25
25
  className: F,
26
- isError: D,
26
+ isError: S,
27
27
  size: B,
28
28
  label: O,
29
29
  helperText: E,
@@ -34,74 +34,74 @@ const m = (e, i = "MM/YYYY") => {
34
34
  displayFormat: a = "MM/YYYY",
35
35
  ...et
36
36
  }, nt) => {
37
- const { t: Y } = bt();
38
- A ?? Y("datePicker.selectMonthRange");
37
+ const { t: y } = wt();
38
+ A ?? y("datePicker.selectMonthRange");
39
39
  const T = p.useRef(null), ot = p.useRef(null), c = p.useMemo(
40
40
  () => a === "YYYY/MM" ? "yyyy/MM" : "MM/yyyy",
41
41
  [a]
42
42
  );
43
43
  p.useImperativeHandle(nt, () => T.current);
44
- const [s, y] = p.useState(!1), V = p.useRef(!1), [v, b] = p.useState(e), [w, S] = p.useState(e?.from ? m(e.from, a) : ""), [k, N] = p.useState(e?.to ? m(e.to, a) : ""), [rt, j] = p.useState(() => e?.from ? new Date(e.from.year, e.from.month, 1) : I || /* @__PURE__ */ new Date());
44
+ const [s, w] = p.useState(!1), V = p.useRef(!1), [v, b] = p.useState(e), [k, N] = p.useState(e?.from ? m(e.from, a) : ""), [D, P] = p.useState(e?.to ? m(e.to, a) : ""), [rt, j] = p.useState(() => e?.from ? new Date(e.from.year, e.from.month, 1) : I || /* @__PURE__ */ new Date());
45
45
  p.useEffect(() => {
46
- s || (S(e?.from ? m(e.from, a) : ""), N(e?.to ? m(e.to, a) : ""), b(e));
46
+ s || (N(e?.from ? m(e.from, a) : ""), P(e?.to ? m(e.to, a) : ""), b(e));
47
47
  }, [s, e, a]), p.useEffect(() => {
48
- s && (b(e), S(e?.from ? m(e.from, a) : ""), N(e?.to ? m(e.to, a) : ""), j(e?.from ? new Date(e.from.year, e.from.month, 1) : I || /* @__PURE__ */ new Date()));
48
+ s && (b(e), N(e?.from ? m(e.from, a) : ""), P(e?.to ? m(e.to, a) : ""), j(e?.from ? new Date(e.from.year, e.from.month, 1) : I || /* @__PURE__ */ new Date()));
49
49
  }, [s, e, a, I]);
50
50
  const at = (t) => {
51
- b(t), t?.from && S(m(t.from, a)), t?.to && N(m(t.to, a)), !g && t?.from && t?.to && (t.from.month !== t.to.month || t.from.year !== t.to.year) && (i?.(t), y(!1));
51
+ b(t), t?.from && N(m(t.from, a)), t?.to && P(m(t.to, a)), !x && t?.from && t?.to && (t.from.month !== t.to.month || t.from.year !== t.to.year) && (i?.(t), w(!1));
52
52
  }, st = (t) => {
53
- i?.(t !== void 0 ? t : v), y(!1);
53
+ i?.(t !== void 0 ? t : v), w(!1);
54
54
  }, $ = () => {
55
- b(e), S(e?.from ? m(e.from, a) : ""), N(e?.to ? m(e.to, a) : ""), y(!1);
55
+ b(e), N(e?.from ? m(e.from, a) : ""), P(e?.to ? m(e.to, a) : ""), w(!1);
56
56
  }, z = () => {
57
- b(void 0), S(""), N(""), i?.(void 0), g || y(!1);
57
+ b(void 0), N(""), P(""), i?.(void 0), x || w(!1);
58
58
  }, it = (t) => {
59
- const f = t.target.value, r = J(f, c, w);
60
- if (S(r), r === "") {
59
+ const f = t.target.value, r = J(f, c, k);
60
+ if (N(r), r === "") {
61
61
  const o = { from: void 0, to: v?.to };
62
- b(o), g || i?.(o);
62
+ b(o), x || i?.(o);
63
63
  return;
64
64
  }
65
- const n = M(r, c, /* @__PURE__ */ new Date());
66
- if (x(n) && r.length === 7) {
65
+ const n = Y(r, c, /* @__PURE__ */ new Date());
66
+ if (M(n) && r.length === 7) {
67
67
  const l = { from: { month: n.getMonth(), year: n.getFullYear() }, to: v?.to };
68
- b(l), j(n), g || i?.(l);
68
+ b(l), j(n), x || i?.(l);
69
69
  }
70
70
  }, ct = (t) => {
71
- const f = t.target.value, r = J(f, c, k);
72
- if (N(r), r === "") {
71
+ const f = t.target.value, r = J(f, c, D);
72
+ if (P(r), r === "") {
73
73
  const o = { from: v?.from, to: void 0 };
74
- b(o), g || i?.(o);
74
+ b(o), x || i?.(o);
75
75
  return;
76
76
  }
77
- const n = M(r, c, /* @__PURE__ */ new Date());
78
- if (x(n) && r.length === 7) {
77
+ const n = Y(r, c, /* @__PURE__ */ new Date());
78
+ if (M(n) && r.length === 7) {
79
79
  const o = { month: n.getMonth(), year: n.getFullYear() }, l = { from: v?.from, to: o };
80
- b(l), j(n), g || i?.(l);
80
+ b(l), j(n), x || i?.(l);
81
81
  }
82
82
  }, H = () => {
83
83
  if (s) return;
84
- const t = R(w, c), f = R(k, c), r = M(t, c, /* @__PURE__ */ new Date()), n = M(f, c, /* @__PURE__ */ new Date()), o = x(r) && t.length === 7, l = x(n) && f.length === 7;
85
- w && !o ? S(e?.from ? m(e.from, a) : "") : o && S(t), k && !l ? N(e?.to ? m(e.to, a) : "") : l && N(f), o && l && !g ? i?.({
84
+ const t = R(k, c), f = R(D, c), r = Y(t, c, /* @__PURE__ */ new Date()), n = Y(f, c, /* @__PURE__ */ new Date()), o = M(r) && t.length === 7, l = M(n) && f.length === 7;
85
+ k && !o ? N(e?.from ? m(e.from, a) : "") : o && N(t), D && !l ? P(e?.to ? m(e.to, a) : "") : l && P(f), o && l && !x ? i?.({
86
86
  from: { month: r.getMonth(), year: r.getFullYear() },
87
87
  to: { month: n.getMonth(), year: n.getFullYear() }
88
- }) : o && !g ? i?.({
88
+ }) : o && !x ? i?.({
89
89
  from: { month: r.getMonth(), year: r.getFullYear() },
90
90
  to: e?.to
91
- }) : l && !g && i?.({
91
+ }) : l && !x && i?.({
92
92
  from: e?.from,
93
93
  to: { month: n.getMonth(), year: n.getFullYear() }
94
94
  });
95
- }, dt = e?.from ? m(e.from, a) : "", lt = e?.to ? m(e.to, a) : "", ft = w !== dt, mt = k !== lt, pt = w.length === 7 && !x(M(w, c, /* @__PURE__ */ new Date())), ut = k.length === 7 && !x(M(k, c, /* @__PURE__ */ new Date())), X = Y("datePicker.startMonth"), q = Y("datePicker.endMonth");
96
- return /* @__PURE__ */ u("div", { className: "flex w-full min-w-[240px] flex-col gap-[6px]", "data-component": "month-range-picker", "data-disabled": P || void 0, children: [
97
- /* @__PURE__ */ u("div", { className: "flex flex-col gap-[6px]", children: [
98
- O && /* @__PURE__ */ u(
95
+ }, dt = e?.from ? m(e.from, a) : "", lt = e?.to ? m(e.to, a) : "", ft = k !== dt, mt = D !== lt, pt = k.length === 7 && !M(Y(k, c, /* @__PURE__ */ new Date())), ut = D.length === 7 && !M(Y(D, c, /* @__PURE__ */ new Date())), X = y("datePicker.startMonth"), q = y("datePicker.endMonth");
96
+ return /* @__PURE__ */ h("div", { className: "flex w-full min-w-[240px] flex-col gap-[6px]", "data-component": "month-range-picker", "data-disabled": u || void 0, children: [
97
+ /* @__PURE__ */ h("div", { className: "flex flex-col gap-[6px]", children: [
98
+ O && /* @__PURE__ */ h(
99
99
  "label",
100
100
  {
101
- className: h(
101
+ className: g(
102
102
  "text-xs font-medium leading-[18px] text-content-tertiary",
103
- P && "opacity-70",
104
- D && "text-destructive"
103
+ u && "opacity-70",
104
+ S && "text-destructive"
105
105
  ),
106
106
  children: [
107
107
  O,
@@ -110,42 +110,44 @@ const m = (e, i = "MM/YYYY") => {
110
110
  ]
111
111
  }
112
112
  ),
113
- /* @__PURE__ */ u(
113
+ /* @__PURE__ */ h(
114
114
  "div",
115
115
  {
116
- className: h(
116
+ className: g(
117
117
  "w-full",
118
118
  E && K === "absolute" && "relative"
119
119
  ),
120
120
  children: [
121
- /* @__PURE__ */ u(xt, { open: s, onOpenChange: y, children: [
122
- /* @__PURE__ */ d(Mt, { asChild: !0, children: /* @__PURE__ */ u(
121
+ /* @__PURE__ */ h(xt, { open: u ? !1 : s, onOpenChange: (t) => {
122
+ u || w(t);
123
+ }, children: [
124
+ /* @__PURE__ */ d(Mt, { asChild: !0, children: /* @__PURE__ */ h(
123
125
  "div",
124
126
  {
125
127
  "data-state": s ? "open" : "closed",
126
- className: h(
128
+ className: g(
127
129
  "flex w-full items-center justify-between gap-2 rounded-md border bg-canvas-elevated px-3 text-sm shadow-sm transition-colors hover:border-brand disabled:cursor-not-allowed disabled:bg-disabled-surface disabled:text-disabled-foreground disabled:border-stroke",
128
- D ? "border-destructive hover:border-destructive" : "border-field",
130
+ S ? "border-destructive hover:border-destructive" : "border-field",
129
131
  B === "sm" ? "h-6" : B === "md" ? "h-[28px]" : "h-8",
130
- P && "pointer-events-none opacity-100 bg-disabled-surface border-stroke text-disabled-foreground hover:border-stroke",
132
+ u && "pointer-events-none opacity-100 bg-disabled-surface border-stroke text-disabled-foreground hover:border-stroke",
131
133
  "cursor-pointer",
132
134
  F
133
135
  ),
134
136
  children: [
135
- /* @__PURE__ */ u("div", { className: "flex items-center gap-4 flex-1 min-w-0", children: [
137
+ /* @__PURE__ */ h("div", { className: "flex items-center gap-4 flex-1 min-w-0", children: [
136
138
  /* @__PURE__ */ d(
137
139
  "input",
138
140
  {
139
141
  ref: T,
140
142
  type: "text",
141
- value: w,
143
+ value: k,
142
144
  onChange: it,
143
145
  onBlur: H,
144
146
  onClick: (t) => s && t.stopPropagation(),
145
147
  onKeyDown: (t) => {
146
148
  if (t.key === "Enter" && !s) {
147
149
  t.preventDefault();
148
- const f = R(w, c), r = R(k, c), n = M(f, c, /* @__PURE__ */ new Date()), o = M(r, c, /* @__PURE__ */ new Date()), l = x(n) && f.length === 7, C = x(o) && r.length === 7;
150
+ const f = R(k, c), r = R(D, c), n = Y(f, c, /* @__PURE__ */ new Date()), o = Y(r, c, /* @__PURE__ */ new Date()), l = M(n) && f.length === 7, C = M(o) && r.length === 7;
149
151
  l && C ? i?.({
150
152
  from: { month: n.getMonth(), year: n.getFullYear() },
151
153
  to: { month: o.getMonth(), year: o.getFullYear() }
@@ -157,13 +159,13 @@ const m = (e, i = "MM/YYYY") => {
157
159
  to: { month: o.getMonth(), year: o.getFullYear() }
158
160
  });
159
161
  }
160
- t.key === "ArrowDown" && !s && (t.preventDefault(), V.current = !0, y(!0)), t.key === "Escape" && s && (t.preventDefault(), $());
162
+ t.key === "ArrowDown" && !s && !u && (t.preventDefault(), V.current = !0, w(!0)), t.key === "Escape" && s && (t.preventDefault(), $());
161
163
  },
162
- placeholder: s ? a === "YYYY/MM" ? "YYYY/MM" : Y("datePicker.monthYearFormat") : X,
163
- disabled: !!P,
164
+ placeholder: s ? a === "YYYY/MM" ? "YYYY/MM" : y("datePicker.monthYearFormat") : X,
165
+ disabled: !!u,
164
166
  "aria-label": X,
165
167
  "data-field": "start",
166
- className: h(
168
+ className: g(
167
169
  "flex-1 min-w-0 bg-transparent p-0 text-sm font-medium outline-none placeholder:font-medium placeholder:text-content-empty disabled:cursor-not-allowed disabled:opacity-50",
168
170
  pt ? "text-destructive" : ft ? "text-content-muted" : ""
169
171
  ),
@@ -175,14 +177,14 @@ const m = (e, i = "MM/YYYY") => {
175
177
  {
176
178
  ref: ot,
177
179
  type: "text",
178
- value: k,
180
+ value: D,
179
181
  onChange: ct,
180
182
  onBlur: H,
181
183
  onClick: (t) => s && t.stopPropagation(),
182
184
  onKeyDown: (t) => {
183
185
  if (t.key === "Enter" && !s) {
184
186
  t.preventDefault();
185
- const f = R(w, c), r = R(k, c), n = M(f, c, /* @__PURE__ */ new Date()), o = M(r, c, /* @__PURE__ */ new Date()), l = x(n) && f.length === 7, C = x(o) && r.length === 7;
187
+ const f = R(k, c), r = R(D, c), n = Y(f, c, /* @__PURE__ */ new Date()), o = Y(r, c, /* @__PURE__ */ new Date()), l = M(n) && f.length === 7, C = M(o) && r.length === 7;
186
188
  l && C ? i?.({
187
189
  from: { month: n.getMonth(), year: n.getFullYear() },
188
190
  to: { month: o.getMonth(), year: o.getFullYear() }
@@ -194,27 +196,27 @@ const m = (e, i = "MM/YYYY") => {
194
196
  to: { month: o.getMonth(), year: o.getFullYear() }
195
197
  });
196
198
  }
197
- t.key === "ArrowDown" && !s && (t.preventDefault(), V.current = !0, y(!0)), t.key === "Escape" && s && (t.preventDefault(), $());
199
+ t.key === "ArrowDown" && !s && !u && (t.preventDefault(), V.current = !0, w(!0)), t.key === "Escape" && s && (t.preventDefault(), $());
198
200
  },
199
- placeholder: s ? a === "YYYY/MM" ? "YYYY/MM" : Y("datePicker.monthYearFormat") : q,
200
- disabled: !!P,
201
+ placeholder: s ? a === "YYYY/MM" ? "YYYY/MM" : y("datePicker.monthYearFormat") : q,
202
+ disabled: !!u,
201
203
  "aria-label": q,
202
204
  "data-field": "end",
203
- className: h(
205
+ className: g(
204
206
  "flex-1 min-w-0 bg-transparent p-0 text-sm font-medium outline-none placeholder:font-medium placeholder:text-content-empty disabled:cursor-not-allowed disabled:opacity-50",
205
207
  ut ? "text-destructive" : mt ? "text-content-muted" : ""
206
208
  )
207
209
  }
208
210
  )
209
211
  ] }),
210
- /* @__PURE__ */ u("div", { className: "flex items-center gap-1 shrink-0", children: [
211
- e?.from && !P && /* @__PURE__ */ u(L, { children: [
212
+ /* @__PURE__ */ h("div", { className: "flex items-center gap-1 shrink-0", children: [
213
+ e?.from && !u && /* @__PURE__ */ h(L, { children: [
212
214
  /* @__PURE__ */ d(Q, { asChild: !0, children: /* @__PURE__ */ d(
213
215
  "button",
214
216
  {
215
217
  type: "button",
216
218
  tabIndex: 0,
217
- "aria-label": Y("calendar.clear"),
219
+ "aria-label": y("calendar.clear"),
218
220
  onClick: (t) => {
219
221
  t.stopPropagation(), z();
220
222
  },
@@ -225,15 +227,15 @@ const m = (e, i = "MM/YYYY") => {
225
227
  children: /* @__PURE__ */ d(ht, { className: "h-4 w-4 hover:text-content text-content-muted" })
226
228
  }
227
229
  ) }),
228
- /* @__PURE__ */ d(U, { variant: "tertiary", side: "top", children: Y("calendar.clear") })
230
+ /* @__PURE__ */ d(U, { variant: "tertiary", side: "top", children: y("calendar.clear") })
229
231
  ] }),
230
- /* @__PURE__ */ u(L, { children: [
231
- /* @__PURE__ */ d(Q, { asChild: !0, children: /* @__PURE__ */ d("button", { type: "button", tabIndex: 0, "aria-label": Y("datePicker.selectMonthRange"), onClick: (t) => {
232
- t.stopPropagation(), y(!s);
232
+ /* @__PURE__ */ h(L, { children: [
233
+ /* @__PURE__ */ d(Q, { asChild: !0, children: /* @__PURE__ */ d("button", { type: "button", tabIndex: 0, "aria-label": y("datePicker.selectMonthRange"), onClick: (t) => {
234
+ t.stopPropagation(), u || w(!s);
233
235
  }, onKeyDown: (t) => {
234
- (t.key === "Enter" || t.key === " ") && (t.preventDefault(), t.stopPropagation(), V.current = !0, y(!s));
236
+ (t.key === "Enter" || t.key === " ") && (t.preventDefault(), t.stopPropagation(), u || (V.current = !0, w(!s)));
235
237
  }, className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer", children: /* @__PURE__ */ d(gt, { className: "h-4 w-4 text-secondary-foreground" }) }) }),
236
- /* @__PURE__ */ d(U, { variant: "tertiary", side: "top", children: Y("datePicker.selectMonthRange") })
238
+ /* @__PURE__ */ d(U, { variant: "tertiary", side: "top", children: y("datePicker.selectMonthRange") })
237
239
  ] })
238
240
  ] })
239
241
  ]
@@ -259,7 +261,7 @@ const m = (e, i = "MM/YYYY") => {
259
261
  disabled: { before: I, after: W },
260
262
  startMonth: Z,
261
263
  endMonth: _,
262
- showFooter: g,
264
+ showFooter: x,
263
265
  onApply: st,
264
266
  onCancel: $,
265
267
  onClear: z
@@ -268,23 +270,23 @@ const m = (e, i = "MM/YYYY") => {
268
270
  }
269
271
  )
270
272
  ] }),
271
- E && K === "absolute" && /* @__PURE__ */ u("div", { className: h("absolute left-0 top-full z-10 mt-1 flex min-w-0 max-w-full items-center gap-[6px]", D && "text-destructive"), children: [
273
+ E && K === "absolute" && /* @__PURE__ */ h("div", { className: g("absolute left-0 top-full z-10 mt-1 flex min-w-0 max-w-full items-center gap-[6px]", S && "text-destructive"), children: [
272
274
  /* @__PURE__ */ d(
273
275
  G,
274
276
  {
275
277
  size: "xs",
276
- className: h(
278
+ className: g(
277
279
  "shrink-0",
278
- D ? "text-destructive" : "text-content-muted"
280
+ S ? "text-destructive" : "text-content-muted"
279
281
  )
280
282
  }
281
283
  ),
282
284
  /* @__PURE__ */ d(
283
285
  "p",
284
286
  {
285
- className: h(
287
+ className: g(
286
288
  "min-w-0 text-[12px] font-medium leading-[18px] text-navigation-muted",
287
- D && "text-destructive"
289
+ S && "text-destructive"
288
290
  ),
289
291
  children: E
290
292
  }
@@ -294,23 +296,23 @@ const m = (e, i = "MM/YYYY") => {
294
296
  }
295
297
  )
296
298
  ] }),
297
- E && K === "flow" && /* @__PURE__ */ u("div", { className: h("flex items-center gap-[6px]", D && "text-destructive"), children: [
299
+ E && K === "flow" && /* @__PURE__ */ h("div", { className: g("flex items-center gap-[6px]", S && "text-destructive"), children: [
298
300
  /* @__PURE__ */ d(
299
301
  G,
300
302
  {
301
303
  size: "xs",
302
- className: h(
304
+ className: g(
303
305
  "shrink-0",
304
- D ? "text-destructive" : "text-content-muted"
306
+ S ? "text-destructive" : "text-content-muted"
305
307
  )
306
308
  }
307
309
  ),
308
310
  /* @__PURE__ */ d(
309
311
  "p",
310
312
  {
311
- className: h(
313
+ className: g(
312
314
  "text-[12px] font-medium leading-[18px] text-navigation-muted",
313
- D && "text-destructive"
315
+ S && "text-destructive"
314
316
  ),
315
317
  children: E
316
318
  }
@@ -319,7 +321,7 @@ const m = (e, i = "MM/YYYY") => {
319
321
  ] });
320
322
  }
321
323
  );
322
- wt.displayName = "MonthRangePicker";
324
+ bt.displayName = "MonthRangePicker";
323
325
  export {
324
- wt as MonthRangePicker
326
+ bt as MonthRangePicker
325
327
  };