impact-nova 1.1.1 → 1.1.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.
Files changed (36) hide show
  1. package/dist/components/ui/accordion.js +37 -33
  2. package/dist/components/ui/alert.d.ts +2 -0
  3. package/dist/components/ui/alert.js +46 -31
  4. package/dist/components/ui/breadcrumb.d.ts +7 -2
  5. package/dist/components/ui/breadcrumb.js +98 -77
  6. package/dist/components/ui/calendar.js +198 -178
  7. package/dist/components/ui/date-picker/date-picker.js +94 -87
  8. package/dist/components/ui/date-picker/date-range-picker.js +124 -117
  9. package/dist/components/ui/date-picker/month-picker.js +98 -91
  10. package/dist/components/ui/date-picker/month-range-picker.js +118 -111
  11. package/dist/components/ui/date-picker/multi-date-picker.js +76 -69
  12. package/dist/components/ui/date-picker/multi-month-picker.js +72 -65
  13. package/dist/components/ui/date-picker/multi-week-picker.js +88 -81
  14. package/dist/components/ui/date-picker/week-picker.js +107 -100
  15. package/dist/components/ui/date-picker/week-range-picker.js +144 -137
  16. package/dist/components/ui/dialog.js +65 -61
  17. package/dist/components/ui/drawer.d.ts +3 -1
  18. package/dist/components/ui/drawer.js +44 -29
  19. package/dist/components/ui/file-upload.d.ts +2 -1
  20. package/dist/components/ui/file-upload.js +159 -135
  21. package/dist/components/ui/filter-panel/filter-panel.js +89 -70
  22. package/dist/components/ui/filter-strip/filter-summary.js +117 -104
  23. package/dist/components/ui/filter-strip/filter-tag-list.js +81 -65
  24. package/dist/components/ui/popover.js +52 -48
  25. package/dist/components/ui/prompt.d.ts +2 -1
  26. package/dist/components/ui/prompt.js +81 -64
  27. package/dist/components/ui/sheet.js +91 -84
  28. package/dist/components/ui/sidebar.js +9 -8
  29. package/dist/components/ui/tabs.d.ts +2 -0
  30. package/dist/components/ui/tabs.js +58 -55
  31. package/dist/components/ui/tag.js +21 -20
  32. package/dist/components/ui/toast.js +41 -37
  33. package/dist/components/ui/tooltip.js +1 -1
  34. package/dist/impact-nova.css +1 -1
  35. package/dist/index.js +250 -248
  36. package/package.json +1 -1
@@ -1,140 +1,147 @@
1
- import { jsxs as b, jsx as p } from "react/jsx-runtime";
1
+ import { jsxs as g, jsx as r } from "react/jsx-runtime";
2
2
  import * as o from "react";
3
- import { X as U } from "lucide-react";
4
- import { CalendarMonth as Z } from "../../../icons/index.js";
5
- import { isValid as y, parse as D, format as j } from "date-fns";
6
- import { cn as _, padValidDateString as Y, maskDate as F } from "../../../lib/utils.js";
7
- import { Input as ee } from "../input.js";
8
- import { Popover as ne, PopoverTrigger as te, PopoverContent as oe } from "../popover.js";
9
- import { Calendar as se } from "../calendar.js";
10
- import { resolveWeekSelection as re } from "../../../lib/fiscal-calendar.js";
11
- const l = (e, s = "MM/dd/yyyy") => {
12
- const t = j(e.startDate, s), h = j(e.endDate, s);
13
- return `${t} - ${h}`;
14
- }, ie = o.forwardRef(
3
+ import { X as Y } from "lucide-react";
4
+ import { CalendarMonth as F } from "../../../icons/index.js";
5
+ import { isValid as C, parse as w, format as j } from "date-fns";
6
+ import { cn as ee, padValidDateString as ne, maskDate as te } from "../../../lib/utils.js";
7
+ import { Input as re } from "../input.js";
8
+ import { Popover as oe, PopoverTrigger as ie, PopoverContent as se } from "../popover.js";
9
+ import { Calendar as ce } from "../calendar.js";
10
+ import { Tooltip as v, TooltipTrigger as B, TooltipContent as E } from "../tooltip.js";
11
+ import { resolveWeekSelection as le } from "../../../lib/fiscal-calendar.js";
12
+ const p = (e, i = "MM/dd/yyyy") => {
13
+ const t = j(e.startDate, i), k = j(e.endDate, i);
14
+ return `${t} - ${k}`;
15
+ }, pe = o.forwardRef(
15
16
  ({
16
17
  value: e,
17
- onChange: s,
18
+ onChange: i,
18
19
  format: t = "MM/dd/yyyy",
19
- placeholder: h = "Select Week",
20
- minDate: B,
21
- maxDate: E,
22
- startMonth: L,
23
- endMonth: O,
24
- showFooter: f = !0,
25
- calendarType: w = "calendar",
20
+ placeholder: k = "Select Week",
21
+ minDate: L,
22
+ maxDate: O,
23
+ startMonth: $,
24
+ endMonth: H,
25
+ showFooter: d = !0,
26
+ calendarType: D = "calendar",
26
27
  fiscalMode: W = "basic",
27
28
  selectionMode: S = "week",
28
29
  fiscalMonthPattern: x,
29
- fiscalYearStartMonth: C = 1,
30
- weekStartsOn: P = 1,
30
+ fiscalYearStartMonth: P = 1,
31
+ weekStartsOn: T = 1,
31
32
  disabled: V,
32
- className: $,
33
- ...H
34
- }, X) => {
33
+ className: X,
34
+ ...q
35
+ }, z) => {
35
36
  const I = o.useRef(null);
36
- o.useRef(null), o.useImperativeHandle(X, () => I.current);
37
- const [r, u] = o.useState(!1), [N, i] = o.useState(e), [d, c] = o.useState(e ? l(e, t) : ""), [q, k] = o.useState(e?.startDate || /* @__PURE__ */ new Date());
37
+ o.useRef(null), o.useImperativeHandle(z, () => I.current);
38
+ const [s, h] = o.useState(!1), [N, c] = o.useState(e), [a, l] = o.useState(e ? p(e, t) : ""), [G, m] = o.useState(e?.startDate || /* @__PURE__ */ new Date());
38
39
  o.useEffect(() => {
39
- !r && e && (c(l(e, t)), i(e));
40
- }, [r, e, t]), o.useEffect(() => {
41
- r && (i(e), k(e?.startDate || /* @__PURE__ */ new Date()), c(e ? l(e, t) : ""));
42
- }, [r, e, t]);
43
- const v = (n) => {
44
- i(n), n && c(l(n, t)), f || (s?.(n), u(!1));
45
- }, z = (n) => {
46
- s?.(n !== void 0 ? n : N), u(!1);
47
- }, G = () => {
48
- i(e), c(e ? l(e, t) : ""), u(!1);
40
+ !s && e && (l(p(e, t)), c(e));
41
+ }, [s, e, t]), o.useEffect(() => {
42
+ s && (c(e), m(e?.startDate || /* @__PURE__ */ new Date()), l(e ? p(e, t) : ""));
43
+ }, [s, e, t]);
44
+ const J = (n) => {
45
+ c(n), n && l(p(n, t)), d || (i?.(n), h(!1));
46
+ }, K = (n) => {
47
+ i?.(n !== void 0 ? n : N), h(!1);
48
+ }, Q = () => {
49
+ c(e), l(e ? p(e, t) : ""), h(!1);
49
50
  }, A = () => {
50
- i(void 0), c(""), s?.(void 0), f || u(!1);
51
- }, M = (n) => re(n, {
52
- calendarType: w,
51
+ c(void 0), l(""), i?.(void 0), d || h(!1);
52
+ }, M = (n) => le(n, {
53
+ calendarType: D,
53
54
  fiscalMode: W,
54
55
  selectionMode: S,
55
56
  fiscalMonthPattern: x,
56
- fiscalYearStartMonth: C,
57
- weekStartsOn: P
58
- }), J = (n) => {
59
- const g = n.target.value, a = F(g, t, d);
60
- if (c(a), a === "") {
61
- i(void 0), f || s?.(void 0);
57
+ fiscalYearStartMonth: P,
58
+ weekStartsOn: T
59
+ }), U = (n) => {
60
+ const u = n.target.value, f = te(u, t, a);
61
+ if (l(f), f === "") {
62
+ c(void 0), d || i?.(void 0);
62
63
  return;
63
64
  }
64
- const m = D(a, t, /* @__PURE__ */ new Date());
65
- if (y(m) && a.length === t.length) {
66
- const T = M(m);
67
- i(T), k(m), f || s?.(T);
65
+ const y = w(f, t, /* @__PURE__ */ new Date());
66
+ if (C(y) && f.length === t.length) {
67
+ const b = M(y);
68
+ c(b), m(y), d || i?.(b);
68
69
  }
69
- }, K = () => {
70
- if (r) return;
71
- const n = Y(d, t), g = D(n, t, /* @__PURE__ */ new Date());
72
- if (!y(g) || n.length !== t.length)
73
- c(e ? l(e, t) : ""), i(e);
74
- else if (c(n), !f) {
75
- const a = M(g);
76
- s?.(a);
70
+ }, Z = () => {
71
+ if (s) return;
72
+ const n = ne(a, t), u = w(n, t, /* @__PURE__ */ new Date());
73
+ if (!C(u) || n.length !== t.length)
74
+ l(e ? p(e, t) : ""), c(e);
75
+ else if (l(n), !d) {
76
+ const f = M(u);
77
+ i?.(f);
77
78
  }
78
- }, R = (e ? l(e, t) : "") !== d, Q = d.length === t.length && !y(D(d, t, /* @__PURE__ */ new Date()));
79
- return /* @__PURE__ */ b(ne, { open: r, onOpenChange: u, children: [
80
- /* @__PURE__ */ p(te, { asChild: !0, children: /* @__PURE__ */ p("div", { "data-component": "week-picker", "data-state": r ? "open" : "closed", "data-pending": R || void 0, children: /* @__PURE__ */ p(
81
- ee,
79
+ }, R = (e ? p(e, t) : "") !== a, _ = a.length === t.length && !C(w(a, t, /* @__PURE__ */ new Date()));
80
+ return /* @__PURE__ */ g(oe, { open: s, onOpenChange: h, children: [
81
+ /* @__PURE__ */ r(ie, { asChild: !0, children: /* @__PURE__ */ r("div", { "data-component": "week-picker", "data-state": s ? "open" : "closed", "data-pending": R || void 0, children: /* @__PURE__ */ r(
82
+ re,
82
83
  {
83
84
  ref: I,
84
- value: d,
85
- onChange: J,
86
- onBlur: K,
87
- onClick: (n) => r && n.stopPropagation(),
88
- placeholder: r ? t : h,
85
+ value: a,
86
+ onChange: U,
87
+ onBlur: Z,
88
+ onClick: (n) => s && n.stopPropagation(),
89
+ placeholder: s ? t : k,
89
90
  disabled: V,
90
91
  "data-form-control": "input",
91
- className: _(
92
+ className: ee(
92
93
  "cursor-pointer",
93
- Q ? "text-destructive" : R ? "text-muted-foreground" : "",
94
- $
94
+ _ ? "text-destructive" : R ? "text-muted-foreground" : "",
95
+ X
95
96
  ),
96
- suffix: /* @__PURE__ */ b("div", { className: "flex items-center gap-1", children: [
97
- e && !V && /* @__PURE__ */ p(
98
- U,
99
- {
100
- className: "h-4 w-4 cursor-pointer hover:text-foreground",
101
- onClick: (n) => {
102
- n.stopPropagation(), A();
97
+ suffix: /* @__PURE__ */ g("div", { className: "flex items-center gap-1", children: [
98
+ e && !V && /* @__PURE__ */ g(v, { children: [
99
+ /* @__PURE__ */ r(B, { asChild: !0, children: /* @__PURE__ */ r(
100
+ Y,
101
+ {
102
+ className: "h-4 w-4 cursor-pointer hover:text-foreground",
103
+ onClick: (n) => {
104
+ n.stopPropagation(), A();
105
+ }
103
106
  }
104
- }
105
- ),
106
- /* @__PURE__ */ p(Z, { className: "h-4 w-4 text-secondary-foreground" })
107
+ ) }),
108
+ /* @__PURE__ */ r(E, { variant: "tertiary", side: "top", children: "Clear" })
109
+ ] }),
110
+ /* @__PURE__ */ g(v, { children: [
111
+ /* @__PURE__ */ r(B, { asChild: !0, children: /* @__PURE__ */ r(F, { className: "h-4 w-4 text-secondary-foreground" }) }),
112
+ /* @__PURE__ */ r(E, { variant: "tertiary", side: "top", children: "Pick a week" })
113
+ ] })
107
114
  ] }),
108
- ...H
115
+ ...q
109
116
  }
110
117
  ) }) }),
111
- /* @__PURE__ */ p(
112
- oe,
118
+ /* @__PURE__ */ r(
119
+ se,
113
120
  {
114
121
  className: "w-auto p-0",
115
122
  align: "start",
116
123
  onOpenAutoFocus: (n) => n.preventDefault(),
117
- children: /* @__PURE__ */ p(
118
- se,
124
+ children: /* @__PURE__ */ r(
125
+ ce,
119
126
  {
120
127
  pickerType: "week",
121
128
  weekMode: "single",
122
129
  selectedWeeks: N,
123
- onWeekSelect: v,
124
- month: q,
125
- onMonthChange: k,
126
- disabled: { before: B, after: E },
127
- startMonth: L,
128
- endMonth: O,
129
- showFooter: f,
130
- calendarType: w,
130
+ onWeekSelect: J,
131
+ month: G,
132
+ onMonthChange: m,
133
+ disabled: { before: L, after: O },
134
+ startMonth: $,
135
+ endMonth: H,
136
+ showFooter: d,
137
+ calendarType: D,
131
138
  fiscalMode: W,
132
139
  selectionMode: S,
133
140
  fiscalMonthPattern: x,
134
- fiscalYearStartMonth: C,
135
- weekStartsOn: P,
136
- onApply: z,
137
- onCancel: G,
141
+ fiscalYearStartMonth: P,
142
+ weekStartsOn: T,
143
+ onApply: K,
144
+ onCancel: Q,
138
145
  onClear: A,
139
146
  captionLayout: "dropdown"
140
147
  }
@@ -144,7 +151,7 @@ const l = (e, s = "MM/dd/yyyy") => {
144
151
  ] });
145
152
  }
146
153
  );
147
- ie.displayName = "WeekPicker";
154
+ pe.displayName = "WeekPicker";
148
155
  export {
149
- ie as WeekPicker
156
+ pe as WeekPicker
150
157
  };
@@ -1,211 +1,218 @@
1
- import { jsxs as b, jsx as f } from "react/jsx-runtime";
2
- import * as o from "react";
3
- import { X as pe } from "lucide-react";
4
- import { CalendarMonth as me, Info as ue } from "../../../icons/index.js";
5
- import { format as x, isValid as S, parse as R } from "date-fns";
6
- import { cn as N, padValidDateString as X, maskDate as q } from "../../../lib/utils.js";
7
- import { Popover as ge, PopoverTrigger as xe, PopoverContent as he } from "../popover.js";
8
- import { Calendar as be } from "../calendar.js";
9
- import { resolveWeekSelection as we } from "../../../lib/fiscal-calendar.js";
10
- const g = (e, r = "MM/dd/yyyy") => {
11
- const t = x(e.startDate, r), W = x(e.endDate, r);
1
+ import { jsxs as p, jsx as o } from "react/jsx-runtime";
2
+ import * as r from "react";
3
+ import { X as he } from "lucide-react";
4
+ import { CalendarMonth as ge, Info as xe } from "../../../icons/index.js";
5
+ import { format as x, isValid as S, parse as C } from "date-fns";
6
+ import { cn as R, padValidDateString as X, maskDate as q } from "../../../lib/utils.js";
7
+ import { Popover as be, PopoverTrigger as we, PopoverContent as ye } from "../popover.js";
8
+ import { Calendar as ke } from "../calendar.js";
9
+ import { Tooltip as G, TooltipTrigger as J, TooltipContent as K } from "../tooltip.js";
10
+ import { resolveWeekSelection as De } from "../../../lib/fiscal-calendar.js";
11
+ const g = (e, i = "MM/dd/yyyy") => {
12
+ const t = x(e.startDate, i), W = x(e.endDate, i);
12
13
  return `${t} - ${W}`;
13
- }, ke = o.forwardRef(
14
+ }, Se = r.forwardRef(
14
15
  ({
15
16
  value: e,
16
- onChange: r,
17
+ onChange: i,
17
18
  format: t = "MM/dd/yyyy",
18
19
  placeholder: W = "Select Week Range",
19
- minDate: G,
20
- maxDate: J,
21
- startMonth: K,
22
- endMonth: Q,
23
- showFooter: p = !0,
24
- calendarType: E = "calendar",
20
+ minDate: Q,
21
+ maxDate: U,
22
+ startMonth: Z,
23
+ endMonth: Y,
24
+ showFooter: m = !0,
25
+ calendarType: T = "calendar",
25
26
  fiscalMode: v = "basic",
26
- selectionMode: A = "week",
27
- fiscalMonthPattern: M,
28
- fiscalYearStartMonth: T = 1,
27
+ selectionMode: E = "week",
28
+ fiscalMonthPattern: A,
29
+ fiscalYearStartMonth: M = 1,
29
30
  weekStartsOn: j = 1,
30
31
  disabled: w,
31
- className: U,
32
- isError: C,
32
+ className: _,
33
+ isError: N,
33
34
  size: B,
34
35
  label: L,
35
36
  helperText: O,
36
- required: Z,
37
- prefix: ye,
38
- prefixClick: De,
39
- ...Y
40
- }, _) => {
41
- const $ = o.useRef(null), F = o.useRef(null);
42
- o.useRef(null), o.useRef(null), o.useImperativeHandle(_, () => $.current);
43
- const [i, I] = o.useState(!1), [k, c] = o.useState(e), [y, m] = o.useState(e?.from ? x(e.from.startDate, t) : ""), [D, u] = o.useState(e?.to ? x(e.to.endDate, t) : ""), [ee, P] = o.useState(e?.from?.startDate || /* @__PURE__ */ new Date());
44
- o.useEffect(() => {
45
- !i && e && (m(e?.from ? x(e.from.startDate, t) : ""), u(e?.to ? x(e.to.endDate, t) : ""), c(e));
46
- }, [e, t, i]), o.useEffect(() => {
47
- i && (c(e), m(e?.from ? x(e.from.startDate, t) : ""), u(e?.to ? x(e.to.endDate, t) : ""), P(e?.from?.startDate || /* @__PURE__ */ new Date()));
48
- }, [i, e, t]);
49
- const te = (n) => {
50
- c(n), n?.from && m(g(n.from, t)), n?.to && u(g(n.to, t)), !p && n?.from && n?.to && n.from.startDate.getTime() !== n.to.startDate.getTime() && (r?.(n), I(!1));
51
- }, ne = (n) => {
52
- r?.(n !== void 0 ? n : k), I(!1);
53
- }, oe = () => {
54
- c(e), m(e?.from ? g(e.from, t) : ""), u(e?.to ? g(e.to, t) : ""), I(!1);
37
+ required: F,
38
+ prefix: Ce,
39
+ prefixClick: Re,
40
+ ...ee
41
+ }, te) => {
42
+ const $ = r.useRef(null), ne = r.useRef(null);
43
+ r.useRef(null), r.useRef(null), r.useImperativeHandle(te, () => $.current);
44
+ const [d, I] = r.useState(!1), [y, c] = r.useState(e), [k, u] = r.useState(e?.from ? x(e.from.startDate, t) : ""), [D, h] = r.useState(e?.to ? x(e.to.endDate, t) : ""), [oe, V] = r.useState(e?.from?.startDate || /* @__PURE__ */ new Date());
45
+ r.useEffect(() => {
46
+ !d && e && (u(e?.from ? x(e.from.startDate, t) : ""), h(e?.to ? x(e.to.endDate, t) : ""), c(e));
47
+ }, [e, t, d]), r.useEffect(() => {
48
+ d && (c(e), u(e?.from ? x(e.from.startDate, t) : ""), h(e?.to ? x(e.to.endDate, t) : ""), V(e?.from?.startDate || /* @__PURE__ */ new Date()));
49
+ }, [d, e, t]);
50
+ const re = (n) => {
51
+ c(n), n?.from && u(g(n.from, t)), n?.to && h(g(n.to, t)), !m && n?.from && n?.to && n.from.startDate.getTime() !== n.to.startDate.getTime() && (i?.(n), I(!1));
52
+ }, se = (n) => {
53
+ i?.(n !== void 0 ? n : y), I(!1);
54
+ }, ie = () => {
55
+ c(e), u(e?.from ? g(e.from, t) : ""), h(e?.to ? g(e.to, t) : ""), I(!1);
55
56
  }, z = () => {
56
- c(void 0), m(""), u(""), r?.(void 0), p || I(!1);
57
- }, V = (n) => we(n, {
58
- calendarType: E,
57
+ c(void 0), u(""), h(""), i?.(void 0), m || I(!1);
58
+ }, P = (n) => De(n, {
59
+ calendarType: T,
59
60
  fiscalMode: v,
60
- selectionMode: A,
61
- fiscalMonthPattern: M,
62
- fiscalYearStartMonth: T,
61
+ selectionMode: E,
62
+ fiscalMonthPattern: A,
63
+ fiscalYearStartMonth: M,
63
64
  weekStartsOn: j
64
- }), se = (n) => {
65
- const a = n.target.value, s = q(a, t, y);
66
- if (m(s), s === "") {
67
- const l = { from: void 0, to: k?.to };
68
- c(l), p || r?.(l);
65
+ }), de = (n) => {
66
+ const f = n.target.value, s = q(f, t, k);
67
+ if (u(s), s === "") {
68
+ const a = { from: void 0, to: y?.to };
69
+ c(a), m || i?.(a);
69
70
  return;
70
71
  }
71
- const d = R(s, t, /* @__PURE__ */ new Date());
72
- if (S(d) && s.length === t.length) {
73
- const h = { from: V(d), to: k?.to };
74
- c(h), p || r?.(h);
72
+ const l = C(s, t, /* @__PURE__ */ new Date());
73
+ if (S(l) && s.length === t.length) {
74
+ const b = { from: P(l), to: y?.to };
75
+ c(b), m || i?.(b);
75
76
  }
76
- }, re = (n) => {
77
- const a = n.target.value, s = q(a, t, D);
78
- if (u(s), s === "") {
79
- const l = { from: k?.from, to: void 0 };
80
- c(l), p || r?.(l);
77
+ }, ce = (n) => {
78
+ const f = n.target.value, s = q(f, t, D);
79
+ if (h(s), s === "") {
80
+ const a = { from: y?.from, to: void 0 };
81
+ c(a), m || i?.(a);
81
82
  return;
82
83
  }
83
- const d = R(s, t, /* @__PURE__ */ new Date());
84
- if (S(d) && s.length === t.length) {
85
- const l = V(d), h = { from: k?.from, to: l };
86
- c(h), d && P(d), p || r?.(h);
84
+ const l = C(s, t, /* @__PURE__ */ new Date());
85
+ if (S(l) && s.length === t.length) {
86
+ const a = P(l), b = { from: y?.from, to: a };
87
+ c(b), l && V(l), m || i?.(b);
87
88
  }
88
89
  }, H = () => {
89
- if (i) return;
90
- const n = X(y, t), a = X(D, t), s = R(n, t, /* @__PURE__ */ new Date()), d = R(a, t, /* @__PURE__ */ new Date()), l = S(s) && n.length === t.length, h = S(d) && a.length === t.length;
91
- if (!l || !h)
92
- m(e?.from ? g(e.from, t) : ""), u(e?.to ? g(e.to, t) : ""), c(e);
93
- else if (m(n), u(a), !p) {
94
- const fe = V(s), ae = V(d);
95
- r?.({ from: fe, to: ae });
90
+ if (d) return;
91
+ const n = X(k, t), f = X(D, t), s = C(n, t, /* @__PURE__ */ new Date()), l = C(f, t, /* @__PURE__ */ new Date()), a = S(s) && n.length === t.length, b = S(l) && f.length === t.length;
92
+ if (!a || !b)
93
+ u(e?.from ? g(e.from, t) : ""), h(e?.to ? g(e.to, t) : ""), c(e);
94
+ else if (u(n), h(f), !m) {
95
+ const me = P(s), ue = P(l);
96
+ i?.({ from: me, to: ue });
96
97
  }
97
- }, ie = (e?.from ? g(e.from, t) : "") !== y, ce = (e?.to ? g(e.to, t) : "") !== D, de = y.length === t.length && !S(R(y, t, /* @__PURE__ */ new Date())), le = D.length === t.length && !S(R(D, t, /* @__PURE__ */ new Date()));
98
- return /* @__PURE__ */ b("div", { className: "w-full space-y-1.5 min-w-[240px]", "data-component": "week-range-picker", "data-disabled": w || void 0, children: [
99
- L && /* @__PURE__ */ b(
98
+ }, le = (e?.from ? g(e.from, t) : "") !== k, ae = (e?.to ? g(e.to, t) : "") !== D, fe = k.length === t.length && !S(C(k, t, /* @__PURE__ */ new Date())), pe = D.length === t.length && !S(C(D, t, /* @__PURE__ */ new Date()));
99
+ return /* @__PURE__ */ p("div", { className: "w-full space-y-1.5 min-w-[240px]", "data-component": "week-range-picker", "data-disabled": w || void 0, children: [
100
+ L && /* @__PURE__ */ p(
100
101
  "label",
101
102
  {
102
- className: N(
103
+ className: R(
103
104
  "text-xs font-medium leading-[18px] text-[#60697d]",
104
105
  w && "opacity-70",
105
- C && "text-destructive"
106
+ N && "text-destructive"
106
107
  ),
107
108
  children: [
108
109
  L,
109
110
  " ",
110
- Z && /* @__PURE__ */ f("span", { className: "text-destructive", children: "*" })
111
+ F && /* @__PURE__ */ o("span", { className: "text-destructive", children: "*" })
111
112
  ]
112
113
  }
113
114
  ),
114
- /* @__PURE__ */ b(ge, { open: i, onOpenChange: I, children: [
115
- /* @__PURE__ */ f(xe, { asChild: !0, children: /* @__PURE__ */ b(
115
+ /* @__PURE__ */ p(be, { open: d, onOpenChange: I, children: [
116
+ /* @__PURE__ */ o(we, { asChild: !0, children: /* @__PURE__ */ p(
116
117
  "div",
117
118
  {
118
- "data-state": i ? "open" : "closed",
119
- className: N(
119
+ "data-state": d ? "open" : "closed",
120
+ className: R(
120
121
  "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",
121
- C ? "border-destructive hover:border-destructive" : "border-input",
122
+ N ? "border-destructive hover:border-destructive" : "border-input",
122
123
  B === "sm" ? "h-6" : B === "md" ? "h-[28px]" : "h-8",
123
124
  w && "pointer-events-none opacity-100 bg-disabled-secondary-bg border-border text-disabled-text hover:border-border",
124
125
  "cursor-pointer",
125
- U
126
+ _
126
127
  ),
127
128
  children: [
128
- /* @__PURE__ */ b("div", { className: "flex items-center gap-4 flex-1 min-w-0", children: [
129
- /* @__PURE__ */ f(
129
+ /* @__PURE__ */ p("div", { className: "flex items-center gap-4 flex-1 min-w-0", children: [
130
+ /* @__PURE__ */ o(
130
131
  "input",
131
132
  {
132
133
  ref: $,
133
134
  type: "text",
134
- value: y,
135
- onChange: se,
135
+ value: k,
136
+ onChange: de,
136
137
  onBlur: H,
137
- onClick: (n) => i && n.stopPropagation(),
138
- placeholder: i ? t : W,
138
+ onClick: (n) => d && n.stopPropagation(),
139
+ placeholder: d ? t : W,
139
140
  disabled: !!w,
140
141
  "data-field": "start",
141
- className: N(
142
+ className: R(
142
143
  "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",
143
- de ? "text-destructive" : ie ? "text-muted-foreground" : ""
144
+ fe ? "text-destructive" : le ? "text-muted-foreground" : ""
144
145
  ),
145
- ...Y
146
+ ...ee
146
147
  }
147
148
  ),
148
- /* @__PURE__ */ f(
149
+ /* @__PURE__ */ o(
149
150
  "input",
150
151
  {
151
- ref: F,
152
+ ref: ne,
152
153
  type: "text",
153
154
  value: D,
154
- onChange: re,
155
+ onChange: ce,
155
156
  onBlur: H,
156
- onClick: (n) => i && n.stopPropagation(),
157
- placeholder: i ? t : W,
157
+ onClick: (n) => d && n.stopPropagation(),
158
+ placeholder: d ? t : W,
158
159
  disabled: !!w,
159
160
  "data-field": "end",
160
- className: N(
161
+ className: R(
161
162
  "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",
162
- le ? "text-destructive" : ce ? "text-muted-foreground" : ""
163
+ pe ? "text-destructive" : ae ? "text-muted-foreground" : ""
163
164
  )
164
165
  }
165
166
  )
166
167
  ] }),
167
- /* @__PURE__ */ b("div", { className: "flex items-center gap-1 shrink-0", children: [
168
- e?.from && !w && /* @__PURE__ */ f(
169
- pe,
170
- {
171
- className: "h-4 w-4 cursor-pointer hover:text-foreground text-muted-foreground",
172
- onClick: (n) => {
173
- n.stopPropagation(), z();
168
+ /* @__PURE__ */ p("div", { className: "flex items-center gap-1 shrink-0", children: [
169
+ e?.from && !w && /* @__PURE__ */ p(G, { children: [
170
+ /* @__PURE__ */ o(J, { asChild: !0, children: /* @__PURE__ */ o(
171
+ he,
172
+ {
173
+ className: "h-4 w-4 cursor-pointer hover:text-foreground text-muted-foreground",
174
+ onClick: (n) => {
175
+ n.stopPropagation(), z();
176
+ }
174
177
  }
175
- }
176
- ),
177
- /* @__PURE__ */ f(me, { className: "h-4 w-4 text-secondary-foreground" })
178
+ ) }),
179
+ /* @__PURE__ */ o(K, { variant: "tertiary", side: "top", children: "Clear" })
180
+ ] }),
181
+ /* @__PURE__ */ p(G, { children: [
182
+ /* @__PURE__ */ o(J, { asChild: !0, children: /* @__PURE__ */ o(ge, { className: "h-4 w-4 text-secondary-foreground" }) }),
183
+ /* @__PURE__ */ o(K, { variant: "tertiary", side: "top", children: "Pick a range" })
184
+ ] })
178
185
  ] })
179
186
  ]
180
187
  }
181
188
  ) }),
182
- /* @__PURE__ */ f(
183
- he,
189
+ /* @__PURE__ */ o(
190
+ ye,
184
191
  {
185
192
  className: "w-auto p-0",
186
193
  align: "start",
187
194
  onOpenAutoFocus: (n) => n.preventDefault(),
188
- children: /* @__PURE__ */ f(
189
- be,
195
+ children: /* @__PURE__ */ o(
196
+ ke,
190
197
  {
191
198
  pickerType: "week",
192
199
  weekMode: "range",
193
- selectedWeeks: k,
194
- onWeekSelect: te,
195
- month: ee,
196
- onMonthChange: P,
197
- disabled: { before: G, after: J },
198
- startMonth: K,
199
- endMonth: Q,
200
- showFooter: p,
201
- calendarType: E,
200
+ selectedWeeks: y,
201
+ onWeekSelect: re,
202
+ month: oe,
203
+ onMonthChange: V,
204
+ disabled: { before: Q, after: U },
205
+ startMonth: Z,
206
+ endMonth: Y,
207
+ showFooter: m,
208
+ calendarType: T,
202
209
  fiscalMode: v,
203
- selectionMode: A,
204
- fiscalMonthPattern: M,
205
- fiscalYearStartMonth: T,
210
+ selectionMode: E,
211
+ fiscalMonthPattern: A,
212
+ fiscalYearStartMonth: M,
206
213
  weekStartsOn: j,
207
- onApply: ne,
208
- onCancel: oe,
214
+ onApply: se,
215
+ onCancel: ie,
209
216
  onClear: z,
210
217
  captionLayout: "dropdown"
211
218
  }
@@ -213,14 +220,14 @@ const g = (e, r = "MM/dd/yyyy") => {
213
220
  }
214
221
  )
215
222
  ] }),
216
- O && /* @__PURE__ */ b("div", { className: N("flex items-center gap-1", C && "text-destructive"), children: [
217
- !C && /* @__PURE__ */ f(ue, { size: 10, className: "shrink-0 text-muted-foreground" }),
218
- /* @__PURE__ */ f(
223
+ O && /* @__PURE__ */ p("div", { className: R("flex items-center gap-1", N && "text-destructive"), children: [
224
+ !N && /* @__PURE__ */ o(xe, { size: 10, className: "shrink-0 text-muted-foreground" }),
225
+ /* @__PURE__ */ o(
219
226
  "p",
220
227
  {
221
- className: N(
228
+ className: R(
222
229
  "text-[10px] text-[#7a8294]",
223
- C && "text-destructive"
230
+ N && "text-destructive"
224
231
  ),
225
232
  children: O
226
233
  }
@@ -229,7 +236,7 @@ const g = (e, r = "MM/dd/yyyy") => {
229
236
  ] });
230
237
  }
231
238
  );
232
- ke.displayName = "WeekRangePicker";
239
+ Se.displayName = "WeekRangePicker";
233
240
  export {
234
- ke as WeekRangePicker
241
+ Se as WeekRangePicker
235
242
  };