impact-nova 1.6.0 → 1.6.1

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.
@@ -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.1",
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",