impact-nova 1.7.5 → 1.7.7

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 (45) hide show
  1. package/dist/components/ui/ag-grid-react/headers/components/truncated-text.d.ts +15 -0
  2. package/dist/components/ui/ag-grid-react/headers/components/truncated-text.js +27 -0
  3. package/dist/components/ui/ag-grid-react/headers/custom-header-group.js +22 -15
  4. package/dist/components/ui/ag-grid-react/headers/custom-header.js +47 -43
  5. package/dist/components/ui/breadcrumb.js +1 -1
  6. package/dist/components/ui/button-group.d.ts +3 -0
  7. package/dist/components/ui/button-group.js +129 -78
  8. package/dist/components/ui/checkbox.d.ts +3 -0
  9. package/dist/components/ui/checkbox.js +64 -53
  10. package/dist/components/ui/command-palette/index.d.ts +3 -0
  11. package/dist/components/ui/command-palette/index.js +18 -13
  12. package/dist/components/ui/command-palette/shortcut-overlay-context.d.ts +23 -0
  13. package/dist/components/ui/command-palette/shortcut-overlay-context.js +28 -0
  14. package/dist/components/ui/command-palette/shortcut-overlay.d.ts +19 -0
  15. package/dist/components/ui/command-palette/shortcut-overlay.js +151 -0
  16. package/dist/components/ui/date-picker/date-range-picker.js +239 -196
  17. package/dist/components/ui/date-picker/month-range-picker.js +226 -183
  18. package/dist/components/ui/date-picker/week-range-picker.js +265 -222
  19. package/dist/components/ui/dialog.js +6 -6
  20. package/dist/components/ui/filter-panel/filter-panel.js +16 -8
  21. package/dist/components/ui/filter-strip/filter-strip.d.ts +1 -1
  22. package/dist/components/ui/filter-strip/filter-strip.js +27 -26
  23. package/dist/components/ui/input.d.ts +3 -0
  24. package/dist/components/ui/input.js +107 -43
  25. package/dist/components/ui/notification-panel/notification-panel.d.ts +4 -4
  26. package/dist/components/ui/notification-panel/notification-panel.js +78 -16
  27. package/dist/components/ui/radio-group.d.ts +3 -0
  28. package/dist/components/ui/radio-group.js +101 -52
  29. package/dist/components/ui/select/select.js +579 -554
  30. package/dist/components/ui/textarea.d.ts +3 -0
  31. package/dist/components/ui/textarea.js +104 -58
  32. package/dist/components/ui/types/filter-panel.types.d.ts +2 -0
  33. package/dist/components/ui/types/filter-strip.types.d.ts +5 -0
  34. package/dist/components/ui/types/helper-text.types.d.ts +5 -0
  35. package/dist/components/ui/types/select.types.d.ts +6 -0
  36. package/dist/icons/assets/createNewDocument.svg.js +2 -2
  37. package/dist/icons/assets/drawBrush.svg.js +5 -0
  38. package/dist/icons/assets/info-badge.svg.js +5 -0
  39. package/dist/icons/assets/priority-alert.svg.js +5 -0
  40. package/dist/icons/assets/webp/sales.webp.js +4 -0
  41. package/dist/icons/index.d.ts +4 -0
  42. package/dist/icons/index.js +253 -245
  43. package/dist/impact-nova.css +1 -1
  44. package/dist/index.js +194 -189
  45. package/package.json +1 -1
@@ -1,257 +1,300 @@
1
- import { jsxs as h, jsx as s } from "react/jsx-runtime";
1
+ import { jsxs as d, jsx as r } from "react/jsx-runtime";
2
2
  import * as c from "react";
3
- import { X as ye } from "lucide-react";
4
- import { CalendarMonth as Re, Info as ve } from "../../../icons/index.js";
5
- import { format as l, isValid as P, parse as S } from "date-fns";
6
- import { cn as N, padValidDateString as U, maskDate as Z } from "../../../lib/utils.js";
7
- import { Popover as Pe, PopoverTrigger as Se, PopoverContent as Ne } from "../popover.js";
8
- import { Calendar as Ce } from "../calendar.js";
9
- import { Tooltip as $, TooltipTrigger as Y, TooltipContent as _ } from "../tooltip.js";
10
- import { resolveWeekSelection as Ie } from "../../../lib/fiscal-calendar.js";
11
- import { getDateFnsLocale as Ee } from "../../../i18n/getDateFnsLocale.js";
12
- import { useImpactNovaI18n as We } from "../../../i18n/ImpactNovaI18nContext.js";
13
- const a = (t) => t?.from ? t.to ? t.to.endDate : t.from.endDate : void 0, Ve = c.forwardRef(
3
+ import { X as Ne } from "lucide-react";
4
+ import { CalendarMonth as Re, Info as Z } from "../../../icons/index.js";
5
+ import { format as s, isValid as C, parse as P } from "date-fns";
6
+ import { cn as f, padValidDateString as $, maskDate as Y } from "../../../lib/utils.js";
7
+ import { Popover as Se, PopoverTrigger as Ce, PopoverContent as Pe } from "../popover.js";
8
+ import { Calendar as Ie } from "../calendar.js";
9
+ import { Tooltip as _, TooltipTrigger as F, TooltipContent as ee } from "../tooltip.js";
10
+ import { resolveWeekSelection as We } from "../../../lib/fiscal-calendar.js";
11
+ import { getDateFnsLocale as Ve } from "../../../i18n/getDateFnsLocale.js";
12
+ import { useImpactNovaI18n as Ee } from "../../../i18n/ImpactNovaI18nContext.js";
13
+ const a = (t) => t?.from ? t.to ? t.to.endDate : t.from.endDate : void 0, Ae = c.forwardRef(
14
14
  ({
15
15
  value: t,
16
- onChange: k,
16
+ onChange: w,
17
17
  format: n = "MM/dd/yyyy",
18
- placeholder: F,
19
- minDate: ee,
20
- maxDate: te,
21
- startMonth: ne,
22
- endMonth: oe,
23
- showFooter: D = !0,
24
- calendarType: A = "calendar",
25
- fiscalMode: L = "basic",
26
- selectionMode: j = "week",
27
- fiscalMonthPattern: K,
28
- fiscalYearStartMonth: M = 1,
29
- weekStartsOn: B = 1,
30
- disabled: y,
31
- className: re,
32
- isError: C,
33
- size: O,
34
- label: z,
35
- helperText: H,
36
- required: le,
37
- prefix: Te,
38
- prefixClick: Ae,
39
- ...se
40
- }, ce) => {
41
- const { locale: X, t: E } = We(), o = c.useMemo(() => Ee(X), [X]), q = F ?? E("datePicker.selectWeekRange"), G = c.useRef(null), ae = c.useRef(null);
42
- c.useRef(null), c.useRef(null), c.useImperativeHandle(ce, () => G.current);
43
- const [r, g] = c.useState(!1), I = c.useRef(!1), [w, d] = c.useState(t), [R, f] = c.useState(t?.from ? l(t.from.startDate, n, { locale: o }) : ""), [v, p] = c.useState(a(t) ? l(a(t), n, { locale: o }) : ""), [ie, V] = c.useState(t?.from?.startDate || /* @__PURE__ */ new Date());
18
+ placeholder: te,
19
+ minDate: ne,
20
+ maxDate: oe,
21
+ startMonth: le,
22
+ endMonth: re,
23
+ showFooter: b = !0,
24
+ calendarType: K = "calendar",
25
+ fiscalMode: M = "basic",
26
+ selectionMode: z = "week",
27
+ fiscalMonthPattern: B,
28
+ fiscalYearStartMonth: T = 1,
29
+ weekStartsOn: O = 1,
30
+ disabled: N,
31
+ className: se,
32
+ isError: D,
33
+ size: H,
34
+ label: X,
35
+ helperText: I,
36
+ helperTextPosition: A = "absolute",
37
+ required: ce,
38
+ prefix: Le,
39
+ prefixClick: je,
40
+ ...ae
41
+ }, ie) => {
42
+ const { locale: q, t: V } = Ee(), o = c.useMemo(() => Ve(q), [q]), G = te ?? V("datePicker.selectWeekRange"), J = c.useRef(null), de = c.useRef(null);
43
+ c.useRef(null), c.useRef(null), c.useImperativeHandle(ie, () => J.current);
44
+ const [l, g] = c.useState(!1), W = c.useRef(!1), [y, p] = c.useState(t), [R, m] = c.useState(t?.from ? s(t.from.startDate, n, { locale: o }) : ""), [S, u] = c.useState(a(t) ? s(a(t), n, { locale: o }) : ""), [fe, L] = c.useState(t?.from?.startDate || /* @__PURE__ */ new Date());
44
45
  c.useEffect(() => {
45
- r || (f(t?.from ? l(t.from.startDate, n, { locale: o }) : ""), p(a(t) ? l(a(t), n, { locale: o }) : ""), d(t));
46
- }, [t, n, r, o]), c.useEffect(() => {
47
- r && (d(t), f(t?.from ? l(t.from.startDate, n, { locale: o }) : ""), p(a(t) ? l(a(t), n, { locale: o }) : ""), V(t?.from?.startDate || /* @__PURE__ */ new Date()));
48
- }, [r, t, n, o]);
49
- const de = (e) => {
50
- d(e), e?.from ? (f(l(e.from.startDate, n, { locale: o })), p(l(a(e), n, { locale: o }))) : (f(""), p("")), !D && e?.from && e?.to && e.from.startDate.getTime() !== e.to.startDate.getTime() && (k?.(e), g(!1));
51
- }, fe = (e) => {
52
- k?.(e !== void 0 ? e : w), g(!1);
53
- }, T = () => {
54
- d(t), f(t?.from ? l(t.from.startDate, n, { locale: o }) : ""), p(a(t) ? l(a(t), n, { locale: o }) : ""), g(!1);
55
- }, J = () => {
56
- d(void 0), f(""), p(""), k?.(void 0), D || g(!1);
57
- }, W = (e) => Ie(e, {
58
- calendarType: A,
59
- fiscalMode: L,
60
- selectionMode: j,
61
- fiscalMonthPattern: K,
62
- fiscalYearStartMonth: M,
63
- weekStartsOn: B
64
- }), pe = (e) => {
65
- const x = e.target.value, i = Z(x, n, R);
66
- if (f(i), i === "") {
67
- const u = { from: void 0, to: w?.to };
68
- d(u), D || k?.(u);
46
+ l || (m(t?.from ? s(t.from.startDate, n, { locale: o }) : ""), u(a(t) ? s(a(t), n, { locale: o }) : ""), p(t));
47
+ }, [t, n, l, o]), c.useEffect(() => {
48
+ l && (p(t), m(t?.from ? s(t.from.startDate, n, { locale: o }) : ""), u(a(t) ? s(a(t), n, { locale: o }) : ""), L(t?.from?.startDate || /* @__PURE__ */ new Date()));
49
+ }, [l, t, n, o]);
50
+ const pe = (e) => {
51
+ p(e), e?.from ? (m(s(e.from.startDate, n, { locale: o })), u(s(a(e), n, { locale: o }))) : (m(""), u("")), !b && e?.from && e?.to && e.from.startDate.getTime() !== e.to.startDate.getTime() && (w?.(e), g(!1));
52
+ }, me = (e) => {
53
+ w?.(e !== void 0 ? e : y), g(!1);
54
+ }, j = () => {
55
+ p(t), m(t?.from ? s(t.from.startDate, n, { locale: o }) : ""), u(a(t) ? s(a(t), n, { locale: o }) : ""), g(!1);
56
+ }, Q = () => {
57
+ p(void 0), m(""), u(""), w?.(void 0), b || g(!1);
58
+ }, E = (e) => We(e, {
59
+ calendarType: K,
60
+ fiscalMode: M,
61
+ selectionMode: z,
62
+ fiscalMonthPattern: B,
63
+ fiscalYearStartMonth: T,
64
+ weekStartsOn: O
65
+ }), ue = (e) => {
66
+ const k = e.target.value, i = Y(k, n, R);
67
+ if (m(i), i === "") {
68
+ const h = { from: void 0, to: y?.to };
69
+ p(h), b || w?.(h);
69
70
  return;
70
71
  }
71
- const m = S(i, n, /* @__PURE__ */ new Date(), { locale: o });
72
- if (P(m) && i.length === n.length) {
73
- const b = { from: W(m), to: w?.to };
74
- d(b), p(l(a(b), n, { locale: o })), D || k?.(b);
72
+ const x = P(i, n, /* @__PURE__ */ new Date(), { locale: o });
73
+ if (C(x) && i.length === n.length) {
74
+ const v = { from: E(x), to: y?.to };
75
+ p(v), u(s(a(v), n, { locale: o })), b || w?.(v);
75
76
  }
76
- }, me = (e) => {
77
- const x = e.target.value, i = Z(x, n, v);
78
- if (p(i), i === "") {
79
- const u = { from: w?.from, to: void 0 };
80
- d(u), D || k?.(u);
77
+ }, xe = (e) => {
78
+ const k = e.target.value, i = Y(k, n, S);
79
+ if (u(i), i === "") {
80
+ const h = { from: y?.from, to: void 0 };
81
+ p(h), b || w?.(h);
81
82
  return;
82
83
  }
83
- const m = S(i, n, /* @__PURE__ */ new Date(), { locale: o });
84
- if (P(m) && i.length === n.length) {
85
- const u = W(m), b = { from: w?.from, to: u };
86
- d(b), w?.from && f(l(w.from.startDate, n, { locale: o })), m && V(m), D || k?.(b);
84
+ const x = P(i, n, /* @__PURE__ */ new Date(), { locale: o });
85
+ if (C(x) && i.length === n.length) {
86
+ const h = E(x), v = { from: y?.from, to: h };
87
+ p(v), y?.from && m(s(y.from.startDate, n, { locale: o })), x && L(x), b || w?.(v);
87
88
  }
88
- }, Q = () => {
89
- if (r) return;
90
- const e = U(R, n), x = U(v, n), i = S(e, n, /* @__PURE__ */ new Date(), { locale: o }), m = S(x, n, /* @__PURE__ */ new Date(), { locale: o }), u = P(i) && e.length === n.length, b = P(m) && x.length === n.length;
91
- if (!u || !b)
92
- f(t?.from ? l(t.from.startDate, n, { locale: o }) : ""), p(a(t) ? l(a(t), n, { locale: o }) : ""), d(t);
93
- else if (f(e), p(x), !D) {
94
- const we = W(i), be = W(m);
95
- k?.({ from: we, to: be });
89
+ }, U = () => {
90
+ if (l) return;
91
+ const e = $(R, n), k = $(S, n), i = P(e, n, /* @__PURE__ */ new Date(), { locale: o }), x = P(k, n, /* @__PURE__ */ new Date(), { locale: o }), h = C(i) && e.length === n.length, v = C(x) && k.length === n.length;
92
+ if (!h || !v)
93
+ m(t?.from ? s(t.from.startDate, n, { locale: o }) : ""), u(a(t) ? s(a(t), n, { locale: o }) : ""), p(t);
94
+ else if (m(e), u(k), !b) {
95
+ const ye = E(i), ve = E(x);
96
+ w?.({ from: ye, to: ve });
96
97
  }
97
- }, ue = t?.from ? l(t.from.startDate, n, { locale: o }) : "", he = a(t) ? l(a(t), n, { locale: o }) : "", ge = ue !== R, xe = he !== v, ke = R.length === n.length && !P(S(R, n, /* @__PURE__ */ new Date(), { locale: o })), De = v.length === n.length && !P(S(v, n, /* @__PURE__ */ new Date(), { locale: o }));
98
- return /* @__PURE__ */ h("div", { className: "flex w-full min-w-[240px] flex-col gap-[6px]", "data-component": "week-range-picker", "data-disabled": y || void 0, children: [
99
- /* @__PURE__ */ h("div", { className: "flex flex-col gap-[6px]", children: [
100
- z && /* @__PURE__ */ h(
98
+ }, he = t?.from ? s(t.from.startDate, n, { locale: o }) : "", ge = a(t) ? s(a(t), n, { locale: o }) : "", ke = he !== R, we = ge !== S, be = R.length === n.length && !C(P(R, n, /* @__PURE__ */ new Date(), { locale: o })), De = S.length === n.length && !C(P(S, n, /* @__PURE__ */ new Date(), { locale: o }));
99
+ return /* @__PURE__ */ d("div", { className: "flex w-full min-w-[240px] flex-col gap-[6px]", "data-component": "week-range-picker", "data-disabled": N || void 0, children: [
100
+ /* @__PURE__ */ d("div", { className: "flex flex-col gap-[6px]", children: [
101
+ X && /* @__PURE__ */ d(
101
102
  "label",
102
103
  {
103
- className: N(
104
+ className: f(
104
105
  "text-xs font-medium leading-[18px] text-content-tertiary",
105
- y && "opacity-70",
106
- C && "text-destructive"
106
+ N && "opacity-70",
107
+ D && "text-destructive"
107
108
  ),
108
109
  children: [
109
- z,
110
+ X,
110
111
  " ",
111
- le && /* @__PURE__ */ s("span", { className: "text-destructive", children: "*" })
112
+ ce && /* @__PURE__ */ r("span", { className: "text-destructive", children: "*" })
112
113
  ]
113
114
  }
114
115
  ),
115
- /* @__PURE__ */ h(Pe, { open: r, onOpenChange: g, children: [
116
- /* @__PURE__ */ s(Se, { asChild: !0, children: /* @__PURE__ */ h(
117
- "div",
118
- {
119
- "data-state": r ? "open" : "closed",
120
- className: N(
121
- "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",
122
- C ? "border-destructive hover:border-destructive" : "border-field",
123
- O === "sm" ? "h-6" : O === "md" ? "h-[28px]" : "h-8",
124
- y && "pointer-events-none opacity-100 bg-disabled-surface border-stroke text-disabled-foreground hover:border-stroke",
125
- "cursor-pointer",
126
- re
127
- ),
128
- children: [
129
- /* @__PURE__ */ h("div", { className: "flex items-center gap-4 flex-1 min-w-0", children: [
130
- /* @__PURE__ */ s(
131
- "input",
132
- {
133
- ref: G,
134
- type: "text",
135
- value: R,
136
- onChange: pe,
137
- onBlur: Q,
138
- onClick: (e) => r && e.stopPropagation(),
139
- onKeyDown: (e) => {
140
- (e.key === "Enter" || e.key === "ArrowDown") && !r && (e.preventDefault(), I.current = !0, g(!0)), e.key === "Escape" && r && (e.preventDefault(), T());
141
- },
142
- placeholder: r ? n : q,
143
- disabled: !!y,
144
- "aria-label": "Start Date",
145
- "data-field": "start",
146
- className: N(
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",
148
- ke ? "text-destructive" : ge ? "text-content-muted" : ""
149
- ),
150
- ...se
151
- }
152
- ),
153
- /* @__PURE__ */ s(
154
- "input",
155
- {
156
- ref: ae,
157
- type: "text",
158
- value: v,
159
- onChange: me,
160
- onBlur: Q,
161
- onClick: (e) => r && e.stopPropagation(),
162
- onKeyDown: (e) => {
163
- (e.key === "Enter" || e.key === "ArrowDown") && !r && (e.preventDefault(), I.current = !0, g(!0)), e.key === "Escape" && r && (e.preventDefault(), T());
164
- },
165
- placeholder: r ? n : q,
166
- disabled: !!y,
167
- "aria-label": "End Date",
168
- "data-field": "end",
169
- className: N(
170
- "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",
171
- De ? "text-destructive" : xe ? "text-content-muted" : ""
172
- )
173
- }
174
- )
175
- ] }),
176
- /* @__PURE__ */ h("div", { className: "flex items-center gap-1 shrink-0", children: [
177
- t?.from && !y && /* @__PURE__ */ h($, { children: [
178
- /* @__PURE__ */ s(Y, { asChild: !0, children: /* @__PURE__ */ s(
179
- ye,
116
+ /* @__PURE__ */ d(
117
+ "div",
118
+ {
119
+ className: f(
120
+ "w-full",
121
+ I && A === "absolute" && "relative"
122
+ ),
123
+ children: [
124
+ /* @__PURE__ */ d(Se, { open: l, onOpenChange: g, children: [
125
+ /* @__PURE__ */ r(Ce, { asChild: !0, children: /* @__PURE__ */ d(
126
+ "div",
127
+ {
128
+ "data-state": l ? "open" : "closed",
129
+ className: f(
130
+ "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",
131
+ D ? "border-destructive hover:border-destructive" : "border-field",
132
+ H === "sm" ? "h-6" : H === "md" ? "h-[28px]" : "h-8",
133
+ N && "pointer-events-none opacity-100 bg-disabled-surface border-stroke text-disabled-foreground hover:border-stroke",
134
+ "cursor-pointer",
135
+ se
136
+ ),
137
+ children: [
138
+ /* @__PURE__ */ d("div", { className: "flex items-center gap-4 flex-1 min-w-0", children: [
139
+ /* @__PURE__ */ r(
140
+ "input",
141
+ {
142
+ ref: J,
143
+ type: "text",
144
+ value: R,
145
+ onChange: ue,
146
+ onBlur: U,
147
+ onClick: (e) => l && e.stopPropagation(),
148
+ onKeyDown: (e) => {
149
+ (e.key === "Enter" || e.key === "ArrowDown") && !l && (e.preventDefault(), W.current = !0, g(!0)), e.key === "Escape" && l && (e.preventDefault(), j());
150
+ },
151
+ placeholder: l ? n : G,
152
+ disabled: !!N,
153
+ "aria-label": "Start Date",
154
+ "data-field": "start",
155
+ className: f(
156
+ "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",
157
+ be ? "text-destructive" : ke ? "text-content-muted" : ""
158
+ ),
159
+ ...ae
160
+ }
161
+ ),
162
+ /* @__PURE__ */ r(
163
+ "input",
164
+ {
165
+ ref: de,
166
+ type: "text",
167
+ value: S,
168
+ onChange: xe,
169
+ onBlur: U,
170
+ onClick: (e) => l && e.stopPropagation(),
171
+ onKeyDown: (e) => {
172
+ (e.key === "Enter" || e.key === "ArrowDown") && !l && (e.preventDefault(), W.current = !0, g(!0)), e.key === "Escape" && l && (e.preventDefault(), j());
173
+ },
174
+ placeholder: l ? n : G,
175
+ disabled: !!N,
176
+ "aria-label": "End Date",
177
+ "data-field": "end",
178
+ className: f(
179
+ "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",
180
+ De ? "text-destructive" : we ? "text-content-muted" : ""
181
+ )
182
+ }
183
+ )
184
+ ] }),
185
+ /* @__PURE__ */ d("div", { className: "flex items-center gap-1 shrink-0", children: [
186
+ t?.from && !N && /* @__PURE__ */ d(_, { children: [
187
+ /* @__PURE__ */ r(F, { asChild: !0, children: /* @__PURE__ */ r(
188
+ Ne,
189
+ {
190
+ className: "h-4 w-4 cursor-pointer hover:text-content text-content-muted",
191
+ onClick: (e) => {
192
+ e.stopPropagation(), Q();
193
+ }
194
+ }
195
+ ) }),
196
+ /* @__PURE__ */ r(ee, { variant: "tertiary", side: "top", children: V("calendar.clear") })
197
+ ] }),
198
+ /* @__PURE__ */ d(_, { children: [
199
+ /* @__PURE__ */ r(F, { asChild: !0, children: /* @__PURE__ */ r("button", { type: "button", tabIndex: 0, "aria-label": V("datePicker.selectWeekRange"), onClick: (e) => {
200
+ e.stopPropagation(), g(!l);
201
+ }, onKeyDown: (e) => {
202
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), W.current = !0, g(!l));
203
+ }, className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer", children: /* @__PURE__ */ r(Re, { className: "h-4 w-4 text-secondary-foreground" }) }) }),
204
+ /* @__PURE__ */ r(ee, { variant: "tertiary", side: "top", children: V("datePicker.selectWeekRange") })
205
+ ] })
206
+ ] })
207
+ ]
208
+ }
209
+ ) }),
210
+ /* @__PURE__ */ r(
211
+ Pe,
212
+ {
213
+ className: "w-auto p-0",
214
+ align: "start",
215
+ onOpenAutoFocus: (e) => {
216
+ W.current || e.preventDefault(), W.current = !1;
217
+ },
218
+ children: /* @__PURE__ */ r(
219
+ Ie,
180
220
  {
181
- className: "h-4 w-4 cursor-pointer hover:text-content text-content-muted",
182
- onClick: (e) => {
183
- e.stopPropagation(), J();
184
- }
221
+ pickerType: "week",
222
+ weekMode: "range",
223
+ selectedWeeks: y,
224
+ onWeekSelect: pe,
225
+ month: fe,
226
+ onMonthChange: L,
227
+ disabled: { before: ne, after: oe },
228
+ startMonth: le,
229
+ endMonth: re,
230
+ showFooter: b,
231
+ calendarType: K,
232
+ fiscalMode: M,
233
+ selectionMode: z,
234
+ fiscalMonthPattern: B,
235
+ fiscalYearStartMonth: T,
236
+ weekStartsOn: O,
237
+ onApply: me,
238
+ onCancel: j,
239
+ onClear: Q,
240
+ captionLayout: "dropdown"
185
241
  }
186
- ) }),
187
- /* @__PURE__ */ s(_, { variant: "tertiary", side: "top", children: E("calendar.clear") })
188
- ] }),
189
- /* @__PURE__ */ h($, { children: [
190
- /* @__PURE__ */ s(Y, { asChild: !0, children: /* @__PURE__ */ s("button", { type: "button", tabIndex: 0, "aria-label": E("datePicker.selectWeekRange"), onClick: (e) => {
191
- e.stopPropagation(), g(!r);
192
- }, onKeyDown: (e) => {
193
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), I.current = !0, g(!r));
194
- }, className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer", children: /* @__PURE__ */ s(Re, { className: "h-4 w-4 text-secondary-foreground" }) }) }),
195
- /* @__PURE__ */ s(_, { variant: "tertiary", side: "top", children: E("datePicker.selectWeekRange") })
196
- ] })
197
- ] })
198
- ]
199
- }
200
- ) }),
201
- /* @__PURE__ */ s(
202
- Ne,
203
- {
204
- className: "w-auto p-0",
205
- align: "start",
206
- onOpenAutoFocus: (e) => {
207
- I.current || e.preventDefault(), I.current = !1;
208
- },
209
- children: /* @__PURE__ */ s(
210
- Ce,
211
- {
212
- pickerType: "week",
213
- weekMode: "range",
214
- selectedWeeks: w,
215
- onWeekSelect: de,
216
- month: ie,
217
- onMonthChange: V,
218
- disabled: { before: ee, after: te },
219
- startMonth: ne,
220
- endMonth: oe,
221
- showFooter: D,
222
- calendarType: A,
223
- fiscalMode: L,
224
- selectionMode: j,
225
- fiscalMonthPattern: K,
226
- fiscalYearStartMonth: M,
227
- weekStartsOn: B,
228
- onApply: fe,
229
- onCancel: T,
230
- onClear: J,
231
- captionLayout: "dropdown"
232
- }
233
- )
234
- }
235
- )
236
- ] })
242
+ )
243
+ }
244
+ )
245
+ ] }),
246
+ I && A === "absolute" && /* @__PURE__ */ d("div", { className: f("absolute left-0 top-full z-10 mt-1 flex min-w-0 max-w-full items-center gap-[6px]", D && "text-destructive"), children: [
247
+ /* @__PURE__ */ r(
248
+ Z,
249
+ {
250
+ size: "xs",
251
+ className: f(
252
+ "shrink-0",
253
+ D ? "text-destructive" : "text-content-muted"
254
+ )
255
+ }
256
+ ),
257
+ /* @__PURE__ */ r(
258
+ "p",
259
+ {
260
+ className: f(
261
+ "min-w-0 text-[12px] font-medium leading-[18px] text-navigation-muted",
262
+ D && "text-destructive"
263
+ ),
264
+ children: I
265
+ }
266
+ )
267
+ ] })
268
+ ]
269
+ }
270
+ )
237
271
  ] }),
238
- H && /* @__PURE__ */ h("div", { className: N("flex items-center gap-[6px]", C && "text-destructive"), children: [
239
- !C && /* @__PURE__ */ s(ve, { size: 10, className: "shrink-0 text-content-muted" }),
240
- /* @__PURE__ */ s(
272
+ I && A === "flow" && /* @__PURE__ */ d("div", { className: f("flex items-center gap-[6px]", D && "text-destructive"), children: [
273
+ /* @__PURE__ */ r(
274
+ Z,
275
+ {
276
+ size: "xs",
277
+ className: f(
278
+ "shrink-0",
279
+ D ? "text-destructive" : "text-content-muted"
280
+ )
281
+ }
282
+ ),
283
+ /* @__PURE__ */ r(
241
284
  "p",
242
285
  {
243
- className: N(
244
- "text-[10px] leading-4 text-navigation-muted",
245
- C && "text-destructive"
286
+ className: f(
287
+ "text-[12px] font-medium leading-[18px] text-navigation-muted",
288
+ D && "text-destructive"
246
289
  ),
247
- children: H
290
+ children: I
248
291
  }
249
292
  )
250
293
  ] })
251
294
  ] });
252
295
  }
253
296
  );
254
- Ve.displayName = "WeekRangePicker";
297
+ Ae.displayName = "WeekRangePicker";
255
298
  export {
256
- Ve as WeekRangePicker
299
+ Ae as WeekRangePicker
257
300
  };
@@ -1,9 +1,9 @@
1
1
  import { jsxs as l, jsx as o } from "react/jsx-runtime";
2
2
  import * as n from "react";
3
3
  import * as a from "@radix-ui/react-dialog";
4
- import { X as y } from "lucide-react";
4
+ import { X as x } from "lucide-react";
5
5
  import { cn as i } from "../../lib/utils.js";
6
- import { Tooltip as u, TooltipTrigger as x, TooltipContent as N } from "./tooltip.js";
6
+ import { Tooltip as y, TooltipTrigger as u, TooltipContent as N } from "./tooltip.js";
7
7
  import { useImpactNovaI18n as v } from "../../i18n/ImpactNovaI18nContext.js";
8
8
  const B = a.Root, H = a.Trigger, D = a.Portal, I = a.Close, c = n.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ o(
9
9
  a.Overlay,
@@ -37,15 +37,15 @@ const b = n.forwardRef(({ className: e, children: t, hideClose: s, onOpenAutoFoc
37
37
  ...p,
38
38
  children: [
39
39
  t,
40
- !s && /* @__PURE__ */ l(u, { children: [
41
- /* @__PURE__ */ o(x, { asChild: !0, children: /* @__PURE__ */ l(
40
+ !s && /* @__PURE__ */ l(y, { children: [
41
+ /* @__PURE__ */ o(u, { asChild: !0, children: /* @__PURE__ */ l(
42
42
  a.Close,
43
43
  {
44
44
  "data-component": "dialog-close",
45
45
  className: "absolute right-4 top-4 rounded-sm opacity-50 ring-offset-canvas transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-focus-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-content-muted",
46
46
  "aria-label": d,
47
47
  children: [
48
- /* @__PURE__ */ o(y, { className: "h-4 w-4" }),
48
+ /* @__PURE__ */ o(x, { className: "h-4 w-4" }),
49
49
  /* @__PURE__ */ o("span", { className: "sr-only", children: d })
50
50
  ]
51
51
  }
@@ -90,7 +90,7 @@ const T = ({
90
90
  "div",
91
91
  {
92
92
  className: i(
93
- "flex flex-col-reverse sm:flex-row sm:justify-end sm:items-center sm:space-x-2 px-4 py-3 bg-canvas-elevated",
93
+ "flex flex-col-reverse sm:flex-row sm:justify-end sm:items-center sm:space-x-2 px-4 py-[9px] bg-canvas-elevated",
94
94
  e
95
95
  ),
96
96
  ...t