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.
- package/dist/components/ui/calendar.js +352 -347
- package/dist/components/ui/command-palette/command-palette.js +53 -50
- package/dist/components/ui/command-palette/shortcut-settings.js +53 -52
- package/dist/components/ui/date-picker/multi-week-picker.js +30 -30
- package/dist/components/ui/date-picker/week-picker.js +45 -45
- package/package.json +1 -1
|
@@ -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
|
|
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
|
|
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 =
|
|
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:
|
|
29
|
-
fiscalMode:
|
|
30
|
-
selectionMode:
|
|
31
|
-
fiscalMonthPattern:
|
|
32
|
-
fiscalYearStartMonth:
|
|
33
|
-
weekStartsOn:
|
|
34
|
-
disabled:
|
|
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:
|
|
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,
|
|
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),
|
|
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
|
-
},
|
|
55
|
-
calendarType:
|
|
56
|
-
fiscalMode:
|
|
57
|
-
selectionMode:
|
|
58
|
-
fiscalMonthPattern:
|
|
59
|
-
fiscalYearStartMonth:
|
|
60
|
-
weekStartsOn:
|
|
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
|
|
68
|
-
if (w
|
|
69
|
-
const
|
|
70
|
-
l(
|
|
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 =
|
|
75
|
-
if (!
|
|
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 =
|
|
78
|
+
const h = j(m);
|
|
79
79
|
s?.(h);
|
|
80
80
|
}
|
|
81
|
-
},
|
|
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":
|
|
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:
|
|
92
|
+
disabled: D,
|
|
93
93
|
"data-form-control": "input",
|
|
94
94
|
className: re(
|
|
95
95
|
"cursor-pointer",
|
|
96
|
-
ne ? "text-destructive" :
|
|
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 && !
|
|
101
|
-
/* @__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:
|
|
110
|
+
/* @__PURE__ */ r(H, { variant: "tertiary", side: "top", children: C("calendar.clear") })
|
|
111
111
|
] }),
|
|
112
|
-
/* @__PURE__ */ g(
|
|
113
|
-
/* @__PURE__ */ r(
|
|
114
|
-
/* @__PURE__ */ r(H, { variant: "tertiary", side: "top", children:
|
|
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:
|
|
134
|
+
onMonthChange: W,
|
|
135
135
|
disabled: { before: y, after: X },
|
|
136
136
|
startMonth: q,
|
|
137
137
|
endMonth: z,
|
|
138
138
|
showFooter: d,
|
|
139
|
-
calendarType:
|
|
140
|
-
fiscalMode:
|
|
141
|
-
selectionMode:
|
|
142
|
-
fiscalMonthPattern:
|
|
143
|
-
fiscalYearStartMonth:
|
|
144
|
-
weekStartsOn:
|
|
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.
|
|
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",
|