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,102 +1,104 @@
1
- import { jsxs as C, jsx as c } from "react/jsx-runtime";
1
+ import { jsxs as w, jsx as c } from "react/jsx-runtime";
2
2
  import * as o from "react";
3
3
  import { X as Z } from "lucide-react";
4
4
  import { CalendarMonth as _ } from "../../../icons/index.js";
5
- import { format as u, isValid as x, parse as I } from "date-fns";
5
+ import { format as h, isValid as I, parse as R } from "date-fns";
6
6
  import { cn as $, padValidDateString as F, maskDate as ee } from "../../../lib/utils.js";
7
7
  import { Input as te } from "../input.js";
8
8
  import { Popover as ne, PopoverTrigger as re, PopoverContent as oe } from "../popover.js";
9
9
  import { Calendar as ce } from "../calendar.js";
10
- import { Tooltip as T, TooltipTrigger as A, TooltipContent as E } from "../tooltip.js";
10
+ import { Tooltip as A, TooltipTrigger as E, TooltipContent as L } from "../tooltip.js";
11
11
  import { getDateFnsLocale as ie } from "../../../i18n/getDateFnsLocale.js";
12
12
  import { useImpactNovaI18n as le } from "../../../i18n/ImpactNovaI18nContext.js";
13
13
  const ae = o.forwardRef(
14
14
  ({
15
15
  value: t,
16
- onChange: f,
16
+ onChange: u,
17
17
  format: n = "MM/dd/yyyy",
18
- placeholder: L,
18
+ placeholder: b,
19
19
  minDate: j,
20
20
  maxDate: K,
21
21
  startMonth: B,
22
22
  endMonth: O,
23
23
  showFooter: d = !0,
24
- weekStartsOn: R,
25
- disabled: b,
24
+ weekStartsOn: v,
25
+ disabled: s,
26
26
  className: H,
27
27
  ...X
28
28
  }, q) => {
29
- const { locale: v, t: m } = le(), i = o.useMemo(() => ie(v), [v]), z = L ?? m("datePicker.selectDate"), g = o.useRef(null), y = o.useRef(null);
30
- o.useImperativeHandle(q, () => g.current);
31
- const [r, l] = o.useState(!1), D = o.useRef(!1), [N, a] = o.useState(t), [s, p] = o.useState(t ? u(t, n, { locale: i }) : ""), [G, w] = o.useState(t || /* @__PURE__ */ new Date());
29
+ const { locale: N, t: g } = le(), i = o.useMemo(() => ie(N), [N]), z = b ?? g("datePicker.selectDate"), y = o.useRef(null), D = o.useRef(null);
30
+ o.useImperativeHandle(q, () => y.current);
31
+ const [r, l] = o.useState(!1), k = o.useRef(!1), [V, a] = o.useState(t), [p, f] = o.useState(t ? h(t, n, { locale: i }) : ""), [G, x] = o.useState(t || /* @__PURE__ */ new Date());
32
32
  o.useEffect(() => {
33
- g.current && y.current !== null && (g.current.setSelectionRange(y.current, y.current), y.current = null);
34
- }, [s]), o.useEffect(() => {
35
- r || (p(t ? u(t, n, { locale: i }) : ""), a(t));
33
+ y.current && D.current !== null && (y.current.setSelectionRange(D.current, D.current), D.current = null);
34
+ }, [p]), o.useEffect(() => {
35
+ r || (f(t ? h(t, n, { locale: i }) : ""), a(t));
36
36
  }, [t, n, r, i]), o.useEffect(() => {
37
- r && (a(t), w(t || /* @__PURE__ */ new Date()));
37
+ r && (a(t), x(t || /* @__PURE__ */ new Date()));
38
38
  }, [r, t]);
39
39
  const J = (e) => {
40
- a(e), e && p(u(e, n, { locale: i })), d || (f?.(e), l(!1));
40
+ a(e), e && f(h(e, n, { locale: i })), d || (u?.(e), l(!1));
41
41
  }, Q = (e) => {
42
- f?.(e !== void 0 ? e : N), l(!1);
43
- }, V = () => {
44
- a(t), p(t ? u(t, n, { locale: i }) : ""), l(!1);
42
+ u?.(e !== void 0 ? e : V), l(!1);
45
43
  }, M = () => {
46
- a(void 0), p(""), f?.(void 0), d || l(!1);
44
+ a(t), f(t ? h(t, n, { locale: i }) : ""), l(!1);
45
+ }, S = () => {
46
+ a(void 0), f(""), u?.(void 0), d || l(!1);
47
47
  }, U = (e) => {
48
- const h = e.target.value, k = ee(h, n, s);
49
- if (p(k), k === "") {
50
- a(void 0), d || f?.(void 0);
48
+ const m = e.target.value, P = ee(m, n, p);
49
+ if (f(P), P === "") {
50
+ a(void 0), d || u?.(void 0);
51
51
  return;
52
52
  }
53
- const P = I(k, n, /* @__PURE__ */ new Date(), { locale: i });
54
- x(P) && k.length === n.length && (a(P), w(P), d || f?.(P));
53
+ const C = R(P, n, /* @__PURE__ */ new Date(), { locale: i });
54
+ I(C) && P.length === n.length && (a(C), x(C), d || u?.(C));
55
55
  }, W = () => {
56
56
  if (r) return;
57
- const e = F(s, n), h = I(e, n, /* @__PURE__ */ new Date(), { locale: i });
58
- !x(h) || e.length !== n.length ? (p(t ? u(t, n, { locale: i }) : ""), a(t)) : (p(e), d || f?.(h));
59
- }, S = (t ? u(t, n, { locale: i }) : "") !== s, Y = s.length === n.length && !x(I(s, n, /* @__PURE__ */ new Date(), { locale: i }));
60
- return /* @__PURE__ */ C(ne, { open: r, onOpenChange: l, children: [
61
- /* @__PURE__ */ c(re, { asChild: !0, children: /* @__PURE__ */ c("div", { "data-component": "date-picker", "data-state": r ? "open" : "closed", "data-pending": S || void 0, children: /* @__PURE__ */ c(
57
+ const e = F(p, n), m = R(e, n, /* @__PURE__ */ new Date(), { locale: i });
58
+ !I(m) || e.length !== n.length ? (f(t ? h(t, n, { locale: i }) : ""), a(t)) : (f(e), d || u?.(m));
59
+ }, T = (t ? h(t, n, { locale: i }) : "") !== p, Y = p.length === n.length && !I(R(p, n, /* @__PURE__ */ new Date(), { locale: i }));
60
+ return /* @__PURE__ */ w(ne, { open: s ? !1 : r, onOpenChange: (e) => {
61
+ s || l(e);
62
+ }, children: [
63
+ /* @__PURE__ */ c(re, { asChild: !0, children: /* @__PURE__ */ c("div", { "data-component": "date-picker", "data-state": r ? "open" : "closed", "data-pending": T || void 0, children: /* @__PURE__ */ c(
62
64
  te,
63
65
  {
64
- ref: g,
65
- value: s,
66
+ ref: y,
67
+ value: p,
66
68
  onChange: U,
67
69
  onBlur: W,
68
70
  onClick: (e) => r && e.stopPropagation(),
69
71
  onKeyDown: (e) => {
70
- (e.key === "Enter" || e.key === "ArrowDown") && !r && (e.preventDefault(), D.current = !0, l(!0)), e.key === "Escape" && r && (e.preventDefault(), V());
72
+ (e.key === "Enter" || e.key === "ArrowDown") && !r && !s && (e.preventDefault(), k.current = !0, l(!0)), e.key === "Escape" && r && (e.preventDefault(), M());
71
73
  },
72
74
  placeholder: r ? n : z,
73
- disabled: b,
75
+ disabled: s,
74
76
  "data-form-control": "input",
75
77
  className: $(
76
78
  "cursor-pointer",
77
- Y ? "text-destructive" : S ? "text-content-muted" : "",
79
+ Y ? "text-destructive" : T ? "text-content-muted" : "",
78
80
  H
79
81
  ),
80
- suffix: /* @__PURE__ */ C("div", { className: "flex items-center gap-1", children: [
81
- t && !b && /* @__PURE__ */ C(T, { children: [
82
- /* @__PURE__ */ c(A, { asChild: !0, children: /* @__PURE__ */ c(
82
+ suffix: /* @__PURE__ */ w("div", { className: "flex items-center gap-1", children: [
83
+ t && !s && /* @__PURE__ */ w(A, { children: [
84
+ /* @__PURE__ */ c(E, { asChild: !0, children: /* @__PURE__ */ c(
83
85
  Z,
84
86
  {
85
87
  className: "h-4 w-4 cursor-pointer hover:text-content",
86
88
  onClick: (e) => {
87
- e.stopPropagation(), M();
89
+ e.stopPropagation(), S();
88
90
  }
89
91
  }
90
92
  ) }),
91
- /* @__PURE__ */ c(E, { variant: "tertiary", side: "top", children: m("calendar.clear") })
93
+ /* @__PURE__ */ c(L, { variant: "tertiary", side: "top", children: g("calendar.clear") })
92
94
  ] }),
93
- /* @__PURE__ */ C(T, { children: [
94
- /* @__PURE__ */ c(A, { asChild: !0, children: /* @__PURE__ */ c("button", { type: "button", tabIndex: 0, "aria-label": m("datePicker.selectDate"), onClick: (e) => {
95
- e.stopPropagation(), l(!r);
95
+ /* @__PURE__ */ w(A, { children: [
96
+ /* @__PURE__ */ c(E, { asChild: !0, children: /* @__PURE__ */ c("button", { type: "button", tabIndex: 0, "aria-label": g("datePicker.selectDate"), onClick: (e) => {
97
+ e.stopPropagation(), s || l(!r);
96
98
  }, onKeyDown: (e) => {
97
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), D.current = !0, l(!r));
99
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), s || (k.current = !0, l(!r)));
98
100
  }, className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer", children: /* @__PURE__ */ c(_, { className: "h-4 w-4 text-secondary-foreground" }) }) }),
99
- /* @__PURE__ */ c(E, { variant: "tertiary", side: "top", children: m("datePicker.selectDate") })
101
+ /* @__PURE__ */ c(L, { variant: "tertiary", side: "top", children: g("datePicker.selectDate") })
100
102
  ] })
101
103
  ] }),
102
104
  ...X
@@ -108,25 +110,25 @@ const ae = o.forwardRef(
108
110
  className: "w-auto p-0",
109
111
  align: "start",
110
112
  onOpenAutoFocus: (e) => {
111
- D.current || e.preventDefault(), D.current = !1;
113
+ k.current || e.preventDefault(), k.current = !1;
112
114
  },
113
115
  children: /* @__PURE__ */ c(
114
116
  ce,
115
117
  {
116
118
  mode: "single",
117
- selected: N,
119
+ selected: V,
118
120
  onSelect: J,
119
121
  month: G,
120
- onMonthChange: w,
122
+ onMonthChange: x,
121
123
  disabled: { before: j, after: K },
122
124
  startMonth: B,
123
125
  endMonth: O,
124
126
  showFooter: d,
125
127
  onApply: Q,
126
- onCancel: V,
127
- onClear: M,
128
+ onCancel: M,
129
+ onClear: S,
128
130
  captionLayout: "dropdown",
129
- ...R !== void 0 ? { weekStartsOn: R } : {}
131
+ ...v !== void 0 ? { weekStartsOn: v } : {}
130
132
  }
131
133
  )
132
134
  }
@@ -1,18 +1,18 @@
1
- import { jsxs as m, jsx as a } from "react/jsx-runtime";
2
- import * as f from "react";
3
- import { X as be } from "lucide-react";
4
- import { CalendarMonth as ye, Info as J } from "../../../icons/index.js";
5
- import { format as p, isValid as g, parse as b } from "date-fns";
6
- import { cn as u, padValidDateString as E, maskDate as Q } from "../../../lib/utils.js";
1
+ import { jsxs as u, jsx as a } from "react/jsx-runtime";
2
+ import * as d from "react";
3
+ import { X as ye } from "lucide-react";
4
+ import { CalendarMonth as be, Info as J } from "../../../icons/index.js";
5
+ import { format as p, isValid as y, parse as b } from "date-fns";
6
+ import { cn as x, padValidDateString as E, maskDate as Q } from "../../../lib/utils.js";
7
7
  import { Popover as we, PopoverTrigger as De, PopoverContent as ke } from "../popover.js";
8
8
  import { Calendar as ve } from "../calendar.js";
9
9
  import { Tooltip as U, TooltipTrigger as W, TooltipContent as Y } from "../tooltip.js";
10
10
  import { getDateFnsLocale as Ne } from "../../../i18n/getDateFnsLocale.js";
11
11
  import { useImpactNovaI18n as Se } from "../../../i18n/ImpactNovaI18nContext.js";
12
- const Pe = f.forwardRef(
12
+ const Pe = d.forwardRef(
13
13
  ({
14
14
  value: n,
15
- onChange: d,
15
+ onChange: f,
16
16
  format: t = "MM/dd/yyyy",
17
17
  startPlaceholder: Z,
18
18
  endPlaceholder: $,
@@ -20,75 +20,75 @@ const Pe = f.forwardRef(
20
20
  maxDate: F,
21
21
  startMonth: ee,
22
22
  endMonth: te,
23
- showFooter: x = !0,
23
+ showFooter: h = !0,
24
24
  weekStartsOn: z,
25
- disabled: P,
25
+ disabled: m,
26
26
  label: B,
27
27
  helperText: V,
28
28
  helperTextPosition: j = "absolute",
29
29
  prefix: Re,
30
30
  prefixClick: Ie,
31
- isError: v,
31
+ isError: N,
32
32
  size: O,
33
33
  required: ne,
34
34
  className: oe,
35
35
  ...le
36
- }, se) => {
37
- const { locale: T, t: R } = Se(), o = f.useMemo(() => Ne(T), [T]), H = Z ?? R("datePicker.startDate"), X = $ ?? R("datePicker.endDate"), q = f.useRef(null), re = f.useRef(null);
38
- f.useRef(null), f.useRef(null), f.useImperativeHandle(se, () => q.current);
39
- const [i, y] = f.useState(!1), C = f.useRef(!1), [I, w] = f.useState(n), [D, N] = f.useState(n?.from ? p(n.from, t, { locale: o }) : ""), [k, S] = f.useState(n?.to ? p(n.to, t, { locale: o }) : ""), [ie, A] = f.useState(n?.from || /* @__PURE__ */ new Date());
40
- f.useEffect(() => {
41
- i || (N(n?.from ? p(n.from, t, { locale: o }) : ""), S(n?.to ? p(n.to, t, { locale: o }) : ""), w(n));
42
- }, [n, t, i, o]), f.useEffect(() => {
43
- i && (w(n), N(n?.from ? p(n.from, t, { locale: o }) : ""), S(n?.to ? p(n.to, t, { locale: o }) : ""), A(n?.from || /* @__PURE__ */ new Date()));
36
+ }, re) => {
37
+ const { locale: T, t: R } = Se(), o = d.useMemo(() => Ne(T), [T]), H = Z ?? R("datePicker.startDate"), X = $ ?? R("datePicker.endDate"), q = d.useRef(null), se = d.useRef(null);
38
+ d.useRef(null), d.useRef(null), d.useImperativeHandle(re, () => q.current);
39
+ const [i, w] = d.useState(!1), C = d.useRef(!1), [I, D] = d.useState(n), [k, S] = d.useState(n?.from ? p(n.from, t, { locale: o }) : ""), [v, P] = d.useState(n?.to ? p(n.to, t, { locale: o }) : ""), [ie, A] = d.useState(n?.from || /* @__PURE__ */ new Date());
40
+ d.useEffect(() => {
41
+ i || (S(n?.from ? p(n.from, t, { locale: o }) : ""), P(n?.to ? p(n.to, t, { locale: o }) : ""), D(n));
42
+ }, [n, t, i, o]), d.useEffect(() => {
43
+ i && (D(n), S(n?.from ? p(n.from, t, { locale: o }) : ""), P(n?.to ? p(n.to, t, { locale: o }) : ""), A(n?.from || /* @__PURE__ */ new Date()));
44
44
  }, [i, n, t, o]);
45
45
  const ce = (e) => {
46
- w(e), e?.from && N(p(e.from, t, { locale: o })), e?.to && S(p(e.to, t, { locale: o })), x || e?.from && e?.to && e.from.getTime() !== e.to.getTime() && (d?.(e), y(!1));
46
+ D(e), e?.from && S(p(e.from, t, { locale: o })), e?.to && P(p(e.to, t, { locale: o })), h || e?.from && e?.to && e.from.getTime() !== e.to.getTime() && (f?.(e), w(!1));
47
47
  }, ae = (e) => {
48
- let s = e !== void 0 ? e : I;
49
- s?.from && !s.to && (s = { from: s.from, to: s.from }), d?.(s), y(!1);
48
+ let r = e !== void 0 ? e : I;
49
+ r?.from && !r.to && (r = { from: r.from, to: r.from }), f?.(r), w(!1);
50
50
  }, K = () => {
51
- w(n), N(n?.from ? p(n.from, t, { locale: o }) : ""), S(n?.to ? p(n.to, t, { locale: o }) : ""), y(!1);
51
+ D(n), S(n?.from ? p(n.from, t, { locale: o }) : ""), P(n?.to ? p(n.to, t, { locale: o }) : ""), w(!1);
52
52
  }, L = () => {
53
- w(void 0), N(""), S(""), d?.(void 0), x || y(!1);
54
- }, de = (e) => {
55
- const s = e.target.value, c = Q(s, t, D);
56
- if (N(c), c === "") {
53
+ D(void 0), S(""), P(""), f?.(void 0), h || w(!1);
54
+ }, fe = (e) => {
55
+ const r = e.target.value, c = Q(r, t, k);
56
+ if (S(c), c === "") {
57
57
  const l = { from: void 0, to: I?.to };
58
- w(l), x || d?.(l);
58
+ D(l), h || f?.(l);
59
59
  return;
60
60
  }
61
- const r = b(c, t, /* @__PURE__ */ new Date(), { locale: o });
62
- if (g(r) && c.length === t.length) {
63
- const l = { from: r, to: I?.to };
64
- w(l), A(r), x || d?.(l);
61
+ const s = b(c, t, /* @__PURE__ */ new Date(), { locale: o });
62
+ if (y(s) && c.length === t.length) {
63
+ const l = { from: s, to: I?.to };
64
+ D(l), A(s), h || f?.(l);
65
65
  }
66
- }, fe = (e) => {
67
- const s = e.target.value, c = Q(s, t, k);
68
- if (S(c), c === "") {
66
+ }, de = (e) => {
67
+ const r = e.target.value, c = Q(r, t, v);
68
+ if (P(c), c === "") {
69
69
  const l = { from: I?.from, to: void 0 };
70
- w(l), x || d?.(l);
70
+ D(l), h || f?.(l);
71
71
  return;
72
72
  }
73
- const r = b(c, t, /* @__PURE__ */ new Date(), { locale: o });
74
- if (g(r) && c.length === t.length) {
75
- const l = { from: I?.from, to: r };
76
- w(l), r && A(r), x || d?.(l);
73
+ const s = b(c, t, /* @__PURE__ */ new Date(), { locale: o });
74
+ if (y(s) && c.length === t.length) {
75
+ const l = { from: I?.from, to: s };
76
+ D(l), s && A(s), h || f?.(l);
77
77
  }
78
78
  }, G = () => {
79
79
  if (i) return;
80
- const e = E(D, t), s = E(k, t), c = b(e, t, /* @__PURE__ */ new Date(), { locale: o }), r = b(s, t, /* @__PURE__ */ new Date(), { locale: o }), l = g(c) && e.length === t.length, h = g(r) && s.length === t.length;
81
- D && !l ? N(n?.from ? p(n.from, t, { locale: o }) : "") : l && N(e), k && !h ? S(n?.to ? p(n.to, t, { locale: o }) : "") : h && S(s), l && h && !x ? d?.({ from: c, to: r }) : l && !x ? d?.({ from: c, to: n?.to }) : h && !x && d?.({ from: n?.from, to: r });
82
- }, pe = n?.from ? p(n.from, t, { locale: o }) : "", me = n?.to ? p(n.to, t, { locale: o }) : "", ue = D !== pe, xe = k !== me, he = D.length === t.length && !g(b(D, t, /* @__PURE__ */ new Date(), { locale: o })), ge = k.length === t.length && !g(b(k, t, /* @__PURE__ */ new Date(), { locale: o }));
83
- return /* @__PURE__ */ m("div", { className: "flex w-full min-w-[240px] flex-col gap-[6px]", "data-component": "date-range-picker", "data-disabled": P || void 0, children: [
84
- /* @__PURE__ */ m("div", { className: "flex flex-col gap-[6px]", children: [
85
- B && /* @__PURE__ */ m(
80
+ const e = E(k, t), r = E(v, t), c = b(e, t, /* @__PURE__ */ new Date(), { locale: o }), s = b(r, t, /* @__PURE__ */ new Date(), { locale: o }), l = y(c) && e.length === t.length, g = y(s) && r.length === t.length;
81
+ k && !l ? S(n?.from ? p(n.from, t, { locale: o }) : "") : l && S(e), v && !g ? P(n?.to ? p(n.to, t, { locale: o }) : "") : g && P(r), l && g && !h ? f?.({ from: c, to: s }) : l && !h ? f?.({ from: c, to: n?.to }) : g && !h && f?.({ from: n?.from, to: s });
82
+ }, pe = n?.from ? p(n.from, t, { locale: o }) : "", me = n?.to ? p(n.to, t, { locale: o }) : "", ue = k !== pe, xe = v !== me, he = k.length === t.length && !y(b(k, t, /* @__PURE__ */ new Date(), { locale: o })), ge = v.length === t.length && !y(b(v, t, /* @__PURE__ */ new Date(), { locale: o }));
83
+ return /* @__PURE__ */ u("div", { className: "flex w-full min-w-[240px] flex-col gap-[6px]", "data-component": "date-range-picker", "data-disabled": m || void 0, children: [
84
+ /* @__PURE__ */ u("div", { className: "flex flex-col gap-[6px]", children: [
85
+ B && /* @__PURE__ */ u(
86
86
  "label",
87
87
  {
88
- className: u(
88
+ className: x(
89
89
  "text-xs font-medium leading-[18px] text-content-tertiary",
90
- P && "opacity-70",
91
- v && "text-destructive"
90
+ m && "opacity-70",
91
+ N && "text-destructive"
92
92
  ),
93
93
  children: [
94
94
  B,
@@ -97,51 +97,53 @@ const Pe = f.forwardRef(
97
97
  ]
98
98
  }
99
99
  ),
100
- /* @__PURE__ */ m(
100
+ /* @__PURE__ */ u(
101
101
  "div",
102
102
  {
103
- className: u(
103
+ className: x(
104
104
  "w-full",
105
105
  V && j === "absolute" && "relative"
106
106
  ),
107
107
  children: [
108
- /* @__PURE__ */ m(we, { open: i, onOpenChange: y, children: [
109
- /* @__PURE__ */ a(De, { asChild: !0, children: /* @__PURE__ */ m(
108
+ /* @__PURE__ */ u(we, { open: m ? !1 : i, onOpenChange: (e) => {
109
+ m || w(e);
110
+ }, children: [
111
+ /* @__PURE__ */ a(De, { asChild: !0, children: /* @__PURE__ */ u(
110
112
  "div",
111
113
  {
112
114
  "data-state": i ? "open" : "closed",
113
- className: u(
115
+ className: x(
114
116
  "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",
115
- v ? "border-destructive hover:border-destructive" : "border-field",
117
+ N ? "border-destructive hover:border-destructive" : "border-field",
116
118
  O === "sm" ? "h-6" : O === "md" ? "h-[28px]" : "h-8",
117
- P && "pointer-events-none opacity-100 bg-disabled-surface border-stroke text-disabled-foreground hover:border-stroke",
119
+ m && "pointer-events-none opacity-100 bg-disabled-surface border-stroke text-disabled-foreground hover:border-stroke",
118
120
  "cursor-pointer",
119
121
  oe
120
122
  ),
121
123
  children: [
122
- /* @__PURE__ */ m("div", { className: "flex items-center gap-4 flex-1 min-w-0", children: [
124
+ /* @__PURE__ */ u("div", { className: "flex items-center gap-4 flex-1 min-w-0", children: [
123
125
  /* @__PURE__ */ a(
124
126
  "input",
125
127
  {
126
128
  ref: q,
127
129
  type: "text",
128
- value: D,
129
- onChange: de,
130
+ value: k,
131
+ onChange: fe,
130
132
  onBlur: G,
131
133
  onClick: (e) => i && e.stopPropagation(),
132
134
  onKeyDown: (e) => {
133
135
  if (e.key === "Enter" && !i) {
134
136
  e.preventDefault();
135
- const s = E(D, t), c = E(k, t), r = b(s, t, /* @__PURE__ */ new Date(), { locale: o }), l = b(c, t, /* @__PURE__ */ new Date(), { locale: o }), h = g(r) && s.length === t.length, M = g(l) && c.length === t.length;
136
- h && M ? d?.({ from: r, to: l }) : h ? d?.({ from: r, to: n?.to }) : M && d?.({ from: n?.from, to: l });
137
+ const r = E(k, t), c = E(v, t), s = b(r, t, /* @__PURE__ */ new Date(), { locale: o }), l = b(c, t, /* @__PURE__ */ new Date(), { locale: o }), g = y(s) && r.length === t.length, M = y(l) && c.length === t.length;
138
+ g && M ? f?.({ from: s, to: l }) : g ? f?.({ from: s, to: n?.to }) : M && f?.({ from: n?.from, to: l });
137
139
  }
138
- e.key === "ArrowDown" && !i && (e.preventDefault(), C.current = !0, y(!0)), e.key === "Escape" && i && (e.preventDefault(), K());
140
+ e.key === "ArrowDown" && !i && !m && (e.preventDefault(), C.current = !0, w(!0)), e.key === "Escape" && i && (e.preventDefault(), K());
139
141
  },
140
142
  placeholder: i ? t : H,
141
- disabled: !!P,
143
+ disabled: !!m,
142
144
  "aria-label": H,
143
145
  "data-field": "start",
144
- className: u(
146
+ className: x(
145
147
  "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",
146
148
  he ? "text-destructive" : ue ? "text-content-muted" : ""
147
149
  ),
@@ -151,33 +153,33 @@ const Pe = f.forwardRef(
151
153
  /* @__PURE__ */ a(
152
154
  "input",
153
155
  {
154
- ref: re,
156
+ ref: se,
155
157
  type: "text",
156
- value: k,
157
- onChange: fe,
158
+ value: v,
159
+ onChange: de,
158
160
  onBlur: G,
159
161
  onClick: (e) => i && e.stopPropagation(),
160
162
  onKeyDown: (e) => {
161
163
  if (e.key === "Enter" && !i) {
162
164
  e.preventDefault();
163
- const s = E(D, t), c = E(k, t), r = b(s, t, /* @__PURE__ */ new Date(), { locale: o }), l = b(c, t, /* @__PURE__ */ new Date(), { locale: o }), h = g(r) && s.length === t.length, M = g(l) && c.length === t.length;
164
- h && M ? d?.({ from: r, to: l }) : h ? d?.({ from: r, to: n?.to }) : M && d?.({ from: n?.from, to: l });
165
+ const r = E(k, t), c = E(v, t), s = b(r, t, /* @__PURE__ */ new Date(), { locale: o }), l = b(c, t, /* @__PURE__ */ new Date(), { locale: o }), g = y(s) && r.length === t.length, M = y(l) && c.length === t.length;
166
+ g && M ? f?.({ from: s, to: l }) : g ? f?.({ from: s, to: n?.to }) : M && f?.({ from: n?.from, to: l });
165
167
  }
166
- e.key === "ArrowDown" && !i && (e.preventDefault(), C.current = !0, y(!0)), e.key === "Escape" && i && (e.preventDefault(), K());
168
+ e.key === "ArrowDown" && !i && !m && (e.preventDefault(), C.current = !0, w(!0)), e.key === "Escape" && i && (e.preventDefault(), K());
167
169
  },
168
170
  placeholder: i ? t : X,
169
- disabled: !!P,
171
+ disabled: !!m,
170
172
  "aria-label": X,
171
173
  "data-field": "end",
172
- className: u(
174
+ className: x(
173
175
  "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",
174
176
  ge ? "text-destructive" : xe ? "text-content-muted" : ""
175
177
  )
176
178
  }
177
179
  )
178
180
  ] }),
179
- /* @__PURE__ */ m("div", { className: "flex items-center gap-1 shrink-0", children: [
180
- n?.from && !P && /* @__PURE__ */ m(U, { children: [
181
+ /* @__PURE__ */ u("div", { className: "flex items-center gap-1 shrink-0", children: [
182
+ n?.from && !m && /* @__PURE__ */ u(U, { children: [
181
183
  /* @__PURE__ */ a(W, { asChild: !0, children: /* @__PURE__ */ a(
182
184
  "button",
183
185
  {
@@ -191,17 +193,17 @@ const Pe = f.forwardRef(
191
193
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), L());
192
194
  },
193
195
  className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer",
194
- children: /* @__PURE__ */ a(be, { className: "h-4 w-4 hover:text-content text-content-muted" })
196
+ children: /* @__PURE__ */ a(ye, { className: "h-4 w-4 hover:text-content text-content-muted" })
195
197
  }
196
198
  ) }),
197
199
  /* @__PURE__ */ a(Y, { variant: "tertiary", side: "top", children: R("calendar.clear") })
198
200
  ] }),
199
- /* @__PURE__ */ m(U, { children: [
201
+ /* @__PURE__ */ u(U, { children: [
200
202
  /* @__PURE__ */ a(W, { asChild: !0, children: /* @__PURE__ */ a("button", { type: "button", tabIndex: 0, "aria-label": R("datePicker.selectMonthRange"), onClick: (e) => {
201
- e.stopPropagation(), y(!i);
203
+ e.stopPropagation(), m || w(!i);
202
204
  }, onKeyDown: (e) => {
203
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), C.current = !0, y(!i));
204
- }, className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer", children: /* @__PURE__ */ a(ye, { className: "h-4 w-4 text-secondary-foreground" }) }) }),
205
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), m || (C.current = !0, w(!i)));
206
+ }, className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer", children: /* @__PURE__ */ a(be, { className: "h-4 w-4 text-secondary-foreground" }) }) }),
205
207
  /* @__PURE__ */ a(Y, { variant: "tertiary", side: "top", children: R("datePicker.selectMonthRange") })
206
208
  ] })
207
209
  ] })
@@ -227,7 +229,7 @@ const Pe = f.forwardRef(
227
229
  disabled: { before: _, after: F },
228
230
  startMonth: ee,
229
231
  endMonth: te,
230
- showFooter: x,
232
+ showFooter: h,
231
233
  onApply: ae,
232
234
  onCancel: K,
233
235
  onClear: L,
@@ -238,23 +240,23 @@ const Pe = f.forwardRef(
238
240
  }
239
241
  )
240
242
  ] }),
241
- V && j === "absolute" && /* @__PURE__ */ m("div", { className: u("absolute left-0 top-full z-10 mt-1 flex min-w-0 max-w-full items-center gap-[6px]", v && "text-destructive"), children: [
243
+ V && j === "absolute" && /* @__PURE__ */ u("div", { className: x("absolute left-0 top-full z-10 mt-1 flex min-w-0 max-w-full items-center gap-[6px]", N && "text-destructive"), children: [
242
244
  /* @__PURE__ */ a(
243
245
  J,
244
246
  {
245
247
  size: "xs",
246
- className: u(
248
+ className: x(
247
249
  "shrink-0",
248
- v ? "text-destructive" : "text-content-muted"
250
+ N ? "text-destructive" : "text-content-muted"
249
251
  )
250
252
  }
251
253
  ),
252
254
  /* @__PURE__ */ a(
253
255
  "p",
254
256
  {
255
- className: u(
257
+ className: x(
256
258
  "min-w-0 text-[12px] font-medium leading-[18px] text-navigation-muted",
257
- v && "text-destructive"
259
+ N && "text-destructive"
258
260
  ),
259
261
  children: V
260
262
  }
@@ -264,23 +266,23 @@ const Pe = f.forwardRef(
264
266
  }
265
267
  )
266
268
  ] }),
267
- V && j === "flow" && /* @__PURE__ */ m("div", { className: u("flex items-center gap-[6px]", v && "text-destructive"), children: [
269
+ V && j === "flow" && /* @__PURE__ */ u("div", { className: x("flex items-center gap-[6px]", N && "text-destructive"), children: [
268
270
  /* @__PURE__ */ a(
269
271
  J,
270
272
  {
271
273
  size: "xs",
272
- className: u(
274
+ className: x(
273
275
  "shrink-0",
274
- v ? "text-destructive" : "text-content-muted"
276
+ N ? "text-destructive" : "text-content-muted"
275
277
  )
276
278
  }
277
279
  ),
278
280
  /* @__PURE__ */ a(
279
281
  "p",
280
282
  {
281
- className: u(
283
+ className: x(
282
284
  "text-[12px] font-medium leading-[18px] text-navigation-muted",
283
- v && "text-destructive"
285
+ N && "text-destructive"
284
286
  ),
285
287
  children: V
286
288
  }