impact-nova 1.6.0 → 1.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { jsxs as c, jsx as t } from "react/jsx-runtime";
1
+ import { jsxs as c, jsx as r } from "react/jsx-runtime";
2
2
  import * as s from "react";
3
3
  import { X } from "lucide-react";
4
4
  import { CalendarMonth as q } from "../../../icons/index.js";
@@ -11,97 +11,97 @@ import { Tooltip as C, TooltipTrigger as M, TooltipContent as P } from "../toolt
11
11
  import { getDateFnsLocale as K } from "../../../i18n/getDateFnsLocale.js";
12
12
  import { useImpactNovaI18n as Q } from "../../../i18n/ImpactNovaI18nContext.js";
13
13
  const U = (e, o = "MM/dd/yyyy", n) => {
14
- const l = g(e.startDate, o, n ? { locale: n } : {}), d = g(e.endDate, o, n ? { locale: n } : {});
15
- return `${l} - ${d}`;
14
+ const l = g(e.startDate, o, n ? { locale: n } : {}), p = g(e.endDate, o, n ? { locale: n } : {});
15
+ return `${l} - ${p}`;
16
16
  }, Y = s.forwardRef(
17
17
  ({
18
18
  value: e,
19
19
  onChange: o,
20
20
  format: n = "MM/dd/yyyy",
21
21
  placeholder: l,
22
- minDate: d,
22
+ minDate: p,
23
23
  maxDate: T,
24
24
  startMonth: W,
25
25
  endMonth: w,
26
- showFooter: p = !0,
26
+ showFooter: d = !0,
27
27
  calendarType: x = "calendar",
28
28
  fiscalMode: N = "basic",
29
29
  selectionMode: S = "week",
30
30
  fiscalMonthPattern: A,
31
31
  fiscalYearStartMonth: v = 1,
32
32
  weekStartsOn: D = 1,
33
- disabled: f,
33
+ disabled: m,
34
34
  className: L,
35
35
  ...O
36
36
  }, I) => {
37
- const { locale: h, t: m } = Q(), $ = s.useMemo(() => K(h), [h]), b = l ?? m("datePicker.selectWeeks"), [y, a] = s.useState(!1), [k, i] = s.useState(e);
37
+ const { locale: h, t: f } = Q(), $ = s.useMemo(() => K(h), [h]), j = l ?? f("datePicker.selectWeeks"), [y, a] = s.useState(!1), [k, i] = s.useState(e);
38
38
  s.useEffect(() => {
39
39
  i(e);
40
40
  }, [y, e]);
41
- const j = (r) => {
42
- i(r), p || o?.(r);
43
- }, R = (r) => {
44
- o?.(r !== void 0 ? r : k), a(!1);
41
+ const R = (t) => {
42
+ i(t), d || o?.(t);
43
+ }, b = (t) => {
44
+ o?.(t !== void 0 ? t : k), a(!1);
45
45
  }, E = () => {
46
46
  i(e), a(!1);
47
47
  }, u = () => {
48
- i(void 0), o?.(void 0), p || a(!1);
48
+ i(void 0), o?.(void 0), d || a(!1);
49
49
  }, V = e && e.length > 0 ? e.length === 1 ? U(e[0], n, $) : `${e.length} weeks selected` : "";
50
- return /* @__PURE__ */ c(F, { open: y, onOpenChange: a, children: [
51
- /* @__PURE__ */ t(G, { asChild: !0, children: /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
50
+ return /* @__PURE__ */ c(F, { open: y, onOpenChange: (t) => !m && a(t), children: [
51
+ /* @__PURE__ */ r(G, { asChild: !0, children: /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(
52
52
  B,
53
53
  {
54
54
  ref: I,
55
55
  value: V,
56
- placeholder: b,
56
+ placeholder: j,
57
57
  readOnly: !0,
58
- disabled: f,
58
+ disabled: m,
59
59
  className: z("cursor-pointer", L),
60
60
  suffix: /* @__PURE__ */ c("div", { className: "flex items-center gap-1", children: [
61
- e && e.length > 0 && !f && /* @__PURE__ */ c(C, { children: [
62
- /* @__PURE__ */ t(M, { asChild: !0, children: /* @__PURE__ */ t(
61
+ e && e.length > 0 && !m && /* @__PURE__ */ c(C, { children: [
62
+ /* @__PURE__ */ r(M, { asChild: !0, children: /* @__PURE__ */ r(
63
63
  X,
64
64
  {
65
65
  className: "h-4 w-4 cursor-pointer hover:text-content",
66
- onClick: (r) => {
67
- r.stopPropagation(), u();
66
+ onClick: (t) => {
67
+ t.stopPropagation(), u();
68
68
  }
69
69
  }
70
70
  ) }),
71
- /* @__PURE__ */ t(P, { variant: "tertiary", side: "top", children: m("calendar.clear") })
71
+ /* @__PURE__ */ r(P, { variant: "tertiary", side: "top", children: f("calendar.clear") })
72
72
  ] }),
73
73
  /* @__PURE__ */ c(C, { children: [
74
- /* @__PURE__ */ t(M, { asChild: !0, children: /* @__PURE__ */ t(q, { className: "h-4 w-4 text-secondary-foreground" }) }),
75
- /* @__PURE__ */ t(P, { variant: "tertiary", side: "top", children: m("datePicker.selectWeeks") })
74
+ /* @__PURE__ */ r(M, { asChild: !0, children: /* @__PURE__ */ r(q, { className: "h-4 w-4 text-secondary-foreground" }) }),
75
+ /* @__PURE__ */ r(P, { variant: "tertiary", side: "top", children: f("datePicker.selectWeeks") })
76
76
  ] })
77
77
  ] }),
78
78
  ...O
79
79
  }
80
80
  ) }) }),
81
- /* @__PURE__ */ t(
81
+ /* @__PURE__ */ r(
82
82
  H,
83
83
  {
84
84
  className: "w-auto p-0",
85
85
  align: "start",
86
- onOpenAutoFocus: (r) => r.preventDefault(),
87
- children: /* @__PURE__ */ t(
86
+ onOpenAutoFocus: (t) => t.preventDefault(),
87
+ children: /* @__PURE__ */ r(
88
88
  J,
89
89
  {
90
90
  pickerType: "week",
91
91
  weekMode: "multiple",
92
92
  selectedWeeks: k,
93
- onWeekSelect: j,
94
- disabled: { before: d, after: T },
93
+ onWeekSelect: R,
94
+ disabled: { before: p, after: T },
95
95
  startMonth: W,
96
96
  endMonth: w,
97
- showFooter: p,
97
+ showFooter: d,
98
98
  calendarType: x,
99
99
  fiscalMode: N,
100
100
  selectionMode: S,
101
101
  fiscalMonthPattern: A,
102
102
  fiscalYearStartMonth: v,
103
103
  weekStartsOn: D,
104
- onApply: R,
104
+ onApply: b,
105
105
  onCancel: E,
106
106
  onClear: u,
107
107
  captionLayout: "dropdown"
@@ -2,17 +2,17 @@ import { jsxs as g, jsx as r } from "react/jsx-runtime";
2
2
  import * as i from "react";
3
3
  import { X as te } from "lucide-react";
4
4
  import { CalendarMonth as oe } from "../../../icons/index.js";
5
- import { isValid as w, parse as P, format as E } from "date-fns";
5
+ import { isValid as P, parse as x, format as O } from "date-fns";
6
6
  import { cn as re, padValidDateString as ie, maskDate as se } from "../../../lib/utils.js";
7
7
  import { Input as ce } from "../input.js";
8
8
  import { Popover as le, PopoverTrigger as pe, PopoverContent as ae } from "../popover.js";
9
9
  import { Calendar as de } from "../calendar.js";
10
- import { Tooltip as O, TooltipTrigger as $, TooltipContent as H } from "../tooltip.js";
10
+ import { Tooltip as $, TooltipTrigger as b, TooltipContent as H } from "../tooltip.js";
11
11
  import { resolveWeekSelection as fe } from "../../../lib/fiscal-calendar.js";
12
12
  import { getDateFnsLocale as he } from "../../../i18n/getDateFnsLocale.js";
13
13
  import { useImpactNovaI18n as ue } from "../../../i18n/ImpactNovaI18nContext.js";
14
14
  const a = (e, s = "MM/dd/yyyy", n) => {
15
- const k = E(e.startDate, s, n ? { locale: n } : {}), y = E(e.endDate, s, n ? { locale: n } : {});
15
+ const k = O(e.startDate, s, n ? { locale: n } : {}), y = O(e.endDate, s, n ? { locale: n } : {});
16
16
  return `${k} - ${y}`;
17
17
  }, me = i.forwardRef(
18
18
  ({
@@ -25,23 +25,23 @@ const a = (e, s = "MM/dd/yyyy", n) => {
25
25
  startMonth: q,
26
26
  endMonth: z,
27
27
  showFooter: d = !0,
28
- calendarType: x = "calendar",
29
- fiscalMode: S = "basic",
30
- selectionMode: I = "week",
31
- fiscalMonthPattern: N,
32
- fiscalYearStartMonth: T = 1,
33
- weekStartsOn: V = 1,
34
- disabled: M,
28
+ calendarType: S = "calendar",
29
+ fiscalMode: I = "basic",
30
+ selectionMode: N = "week",
31
+ fiscalMonthPattern: T,
32
+ fiscalYearStartMonth: V = 1,
33
+ weekStartsOn: M = 1,
34
+ disabled: D,
35
35
  className: G,
36
36
  ...J
37
37
  }, K) => {
38
- const { locale: A, t: D } = ue(), o = i.useMemo(() => he(A), [A]), Q = k ?? D("datePicker.selectWeek"), L = i.useRef(null);
38
+ const { locale: A, t: C } = ue(), o = i.useMemo(() => he(A), [A]), Q = k ?? C("datePicker.selectWeek"), L = i.useRef(null);
39
39
  i.useRef(null), i.useImperativeHandle(K, () => L.current);
40
- const [c, u] = i.useState(!1), [R, l] = i.useState(e), [f, p] = i.useState(e ? a(e, n, o) : ""), [U, C] = i.useState(e?.startDate || /* @__PURE__ */ new Date());
40
+ const [c, u] = i.useState(!1), [R, l] = i.useState(e), [f, p] = i.useState(e ? a(e, n, o) : ""), [U, W] = i.useState(e?.startDate || /* @__PURE__ */ new Date());
41
41
  i.useEffect(() => {
42
42
  c || (p(e ? a(e, n, o) : ""), l(e));
43
43
  }, [c, e, n, o]), i.useEffect(() => {
44
- c && (l(e), C(e?.startDate || /* @__PURE__ */ new Date()), p(e ? a(e, n, o) : ""));
44
+ c && (l(e), W(e?.startDate || /* @__PURE__ */ new Date()), p(e ? a(e, n, o) : ""));
45
45
  }, [c, e, n, o]);
46
46
  const Z = (t) => {
47
47
  l(t), t && p(a(t, n, o)), d || (s?.(t), u(!1));
@@ -51,36 +51,36 @@ const a = (e, s = "MM/dd/yyyy", n) => {
51
51
  l(e), p(e ? a(e, n, o) : ""), u(!1);
52
52
  }, v = () => {
53
53
  l(void 0), p(""), s?.(void 0), d || u(!1);
54
- }, b = (t) => fe(t, {
55
- calendarType: x,
56
- fiscalMode: S,
57
- selectionMode: I,
58
- fiscalMonthPattern: N,
59
- fiscalYearStartMonth: T,
60
- weekStartsOn: V
54
+ }, j = (t) => fe(t, {
55
+ calendarType: S,
56
+ fiscalMode: I,
57
+ selectionMode: N,
58
+ fiscalMonthPattern: T,
59
+ fiscalYearStartMonth: V,
60
+ weekStartsOn: M
61
61
  }), F = (t) => {
62
62
  const m = t.target.value, h = se(m, n, f);
63
63
  if (p(h), h === "") {
64
64
  l(void 0), d || s?.(void 0);
65
65
  return;
66
66
  }
67
- const W = P(h, n, /* @__PURE__ */ new Date(), { locale: o });
68
- if (w(W) && h.length === n.length) {
69
- const B = b(W);
70
- l(B), C(W), d || s?.(B);
67
+ const w = x(h, n, /* @__PURE__ */ new Date(), { locale: o });
68
+ if (P(w) && h.length === n.length) {
69
+ const E = j(w);
70
+ l(E), W(w), d || s?.(E);
71
71
  }
72
72
  }, ee = () => {
73
73
  if (c) return;
74
- const t = ie(f, n), m = P(t, n, /* @__PURE__ */ new Date(), { locale: o });
75
- if (!w(m) || t.length !== n.length)
74
+ const t = ie(f, n), m = x(t, n, /* @__PURE__ */ new Date(), { locale: o });
75
+ if (!P(m) || t.length !== n.length)
76
76
  p(e ? a(e, n, o) : ""), l(e);
77
77
  else if (p(t), !d) {
78
- const h = b(m);
78
+ const h = j(m);
79
79
  s?.(h);
80
80
  }
81
- }, j = (e ? a(e, n, o) : "") !== f, ne = f.length === n.length && !w(P(f, n, /* @__PURE__ */ new Date(), { locale: o }));
82
- return /* @__PURE__ */ g(le, { open: c, onOpenChange: u, children: [
83
- /* @__PURE__ */ r(pe, { asChild: !0, children: /* @__PURE__ */ r("div", { "data-component": "week-picker", "data-state": c ? "open" : "closed", "data-pending": j || void 0, children: /* @__PURE__ */ r(
81
+ }, B = (e ? a(e, n, o) : "") !== f, ne = f.length === n.length && !P(x(f, n, /* @__PURE__ */ new Date(), { locale: o }));
82
+ return /* @__PURE__ */ g(le, { open: c, onOpenChange: (t) => !D && u(t), children: [
83
+ /* @__PURE__ */ r(pe, { asChild: !0, children: /* @__PURE__ */ r("div", { "data-component": "week-picker", "data-state": c ? "open" : "closed", "data-pending": B || void 0, children: /* @__PURE__ */ r(
84
84
  ce,
85
85
  {
86
86
  ref: L,
@@ -89,16 +89,16 @@ const a = (e, s = "MM/dd/yyyy", n) => {
89
89
  onBlur: ee,
90
90
  onClick: (t) => c && t.stopPropagation(),
91
91
  placeholder: c ? n : Q,
92
- disabled: M,
92
+ disabled: D,
93
93
  "data-form-control": "input",
94
94
  className: re(
95
95
  "cursor-pointer",
96
- ne ? "text-destructive" : j ? "text-content-muted" : "",
96
+ ne ? "text-destructive" : B ? "text-content-muted" : "",
97
97
  G
98
98
  ),
99
99
  suffix: /* @__PURE__ */ g("div", { className: "flex items-center gap-1", children: [
100
- e && !M && /* @__PURE__ */ g(O, { children: [
101
- /* @__PURE__ */ r($, { asChild: !0, children: /* @__PURE__ */ r(
100
+ e && !D && /* @__PURE__ */ g($, { children: [
101
+ /* @__PURE__ */ r(b, { asChild: !0, children: /* @__PURE__ */ r(
102
102
  te,
103
103
  {
104
104
  className: "h-4 w-4 cursor-pointer hover:text-content",
@@ -107,11 +107,11 @@ const a = (e, s = "MM/dd/yyyy", n) => {
107
107
  }
108
108
  }
109
109
  ) }),
110
- /* @__PURE__ */ r(H, { variant: "tertiary", side: "top", children: D("calendar.clear") })
110
+ /* @__PURE__ */ r(H, { variant: "tertiary", side: "top", children: C("calendar.clear") })
111
111
  ] }),
112
- /* @__PURE__ */ g(O, { children: [
113
- /* @__PURE__ */ r($, { asChild: !0, children: /* @__PURE__ */ r(oe, { className: "h-4 w-4 text-secondary-foreground" }) }),
114
- /* @__PURE__ */ r(H, { variant: "tertiary", side: "top", children: D("datePicker.selectWeek") })
112
+ /* @__PURE__ */ g($, { children: [
113
+ /* @__PURE__ */ r(b, { asChild: !0, children: /* @__PURE__ */ r(oe, { className: "h-4 w-4 text-secondary-foreground" }) }),
114
+ /* @__PURE__ */ r(H, { variant: "tertiary", side: "top", children: C("datePicker.selectWeek") })
115
115
  ] })
116
116
  ] }),
117
117
  ...J
@@ -131,17 +131,17 @@ const a = (e, s = "MM/dd/yyyy", n) => {
131
131
  selectedWeeks: R,
132
132
  onWeekSelect: Z,
133
133
  month: U,
134
- onMonthChange: C,
134
+ onMonthChange: W,
135
135
  disabled: { before: y, after: X },
136
136
  startMonth: q,
137
137
  endMonth: z,
138
138
  showFooter: d,
139
- calendarType: x,
140
- fiscalMode: S,
141
- selectionMode: I,
142
- fiscalMonthPattern: N,
143
- fiscalYearStartMonth: T,
144
- weekStartsOn: V,
139
+ calendarType: S,
140
+ fiscalMode: I,
141
+ selectionMode: N,
142
+ fiscalMonthPattern: T,
143
+ fiscalYearStartMonth: V,
144
+ weekStartsOn: M,
145
145
  onApply: _,
146
146
  onCancel: Y,
147
147
  onClear: v,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impact-nova",
3
- "version": "1.6.0",
3
+ "version": "1.6.2",
4
4
  "description": "Enterprise-grade React design system built with React 19, Vite, Tailwind CSS, and Radix UI. Built-in internationalization (i18n) and comprehensive UI component library for scalable, accessible, and performant applications.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",