impact-nova 2.6.2 → 2.6.3

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,22 +1,24 @@
1
- import { jsxs as m, jsx as o, Fragment as $ } from "react/jsx-runtime";
1
+ import { jsxs as u, jsx as o, Fragment as z } from "react/jsx-runtime";
2
2
  import * as f from "react";
3
- import { createPortal as z } from "react-dom";
3
+ import { createPortal as $ } from "react-dom";
4
4
  import { GuidanceStepPanel as A } from "./guidance-card-shared.js";
5
5
  import { useGuidanceOverlayGeometry as T } from "../hooks/useGuidanceOverlayGeometry.js";
6
6
  import { useAdvanceOnTargetClick as G, buildHighlightRectForTarget as M, computePopoverPosition as P } from "./guidance-renderer-shared.js";
7
- const H = 220, h = `motion-safe:transition-[top,left,width,height] motion-safe:duration-[${H}ms] motion-safe:ease-[cubic-bezier(0.22,1,0.36,1)]`;
7
+ const H = 220, g = `motion-safe:transition-[top,left,width,height] motion-safe:duration-[${H}ms] motion-safe:ease-[cubic-bezier(0.22,1,0.36,1)]`;
8
8
  function L({
9
9
  highlightRect: e,
10
- blocksPointerEvents: i = !0
10
+ blocksPointerEvents: l = !0
11
11
  }) {
12
- const a = typeof window < "u" ? window.innerWidth : 0, l = typeof window < "u" ? window.innerHeight : 0, d = Math.max(0, e.y), u = Math.max(0, e.x), r = Math.min(
12
+ if (!l)
13
+ return null;
14
+ const a = typeof window < "u" ? window.innerWidth : 0, i = typeof window < "u" ? window.innerHeight : 0, d = Math.max(0, e.y), m = Math.max(0, e.x), r = Math.min(
13
15
  a,
14
16
  e.x + e.width
15
17
  ), c = Math.min(
16
- l,
18
+ i,
17
19
  e.y + e.height
18
- ), s = Math.max(0, c - d), n = i ? `pointer-events-auto absolute bg-[var(--guidance-backdrop-bg)] opacity-[var(--guidance-backdrop-opacity,0.4)] ${h}` : `pointer-events-none absolute bg-[var(--guidance-backdrop-bg)] opacity-[var(--guidance-backdrop-opacity,0.4)] ${h}`;
19
- return /* @__PURE__ */ m($, { children: [
20
+ ), s = Math.max(0, c - d), n = `pointer-events-auto absolute ${g}`;
21
+ return /* @__PURE__ */ u(z, { children: [
20
22
  /* @__PURE__ */ o(
21
23
  "div",
22
24
  {
@@ -33,7 +35,7 @@ function L({
33
35
  top: c,
34
36
  left: 0,
35
37
  width: a,
36
- height: Math.max(0, l - c)
38
+ height: Math.max(0, i - c)
37
39
  },
38
40
  "aria-hidden": "true"
39
41
  }
@@ -45,7 +47,7 @@ function L({
45
47
  style: {
46
48
  top: d,
47
49
  left: 0,
48
- width: u,
50
+ width: m,
49
51
  height: s
50
52
  },
51
53
  "aria-hidden": "true"
@@ -70,14 +72,14 @@ const w = 12, R = Math.ceil(
70
72
  16 + w * Math.SQRT2 / 2
71
73
  );
72
74
  function _(e) {
73
- const i = w / 2, a = e.placement === "left" || e.placement === "right", l = a ? e.highlightRect.y + e.highlightRect.height / 2 : e.highlightRect.x + e.highlightRect.width / 2, d = a ? e.popoverTop : e.popoverLeft, u = a ? e.popoverHeight : e.popoverWidth, r = l - d - i, c = R, s = u - R - w;
75
+ const l = w / 2, a = e.placement === "left" || e.placement === "right", i = a ? e.highlightRect.y + e.highlightRect.height / 2 : e.highlightRect.x + e.highlightRect.width / 2, d = a ? e.popoverTop : e.popoverLeft, m = a ? e.popoverHeight : e.popoverWidth, r = i - d - l, c = R, s = m - R - w;
74
76
  return s < c || r < c || r > s ? null : r;
75
77
  }
76
78
  function B({
77
79
  placement: e,
78
- offset: i
80
+ offset: l
79
81
  }) {
80
- const a = e === "left" || e === "right" ? { top: i } : { left: i }, l = {
82
+ const a = e === "left" || e === "right" ? { top: l } : { left: l }, i = {
81
83
  bottom: "left-0 top-0 -translate-y-1/2 border-l border-t",
82
84
  top: "bottom-0 left-0 translate-y-1/2 border-b border-r",
83
85
  right: "left-0 top-0 -translate-x-1/2 border-b border-l",
@@ -87,31 +89,31 @@ function B({
87
89
  "span",
88
90
  {
89
91
  "aria-hidden": "true",
90
- className: `pointer-events-none absolute z-0 size-3 rotate-45 border border-[var(--color-border-accent-muted)] bg-[var(--color-border-accent-muted)] ${l}`,
92
+ className: `pointer-events-none absolute z-0 size-3 rotate-45 border border-[var(--color-border-accent-muted)] bg-[var(--color-border-accent-muted)] ${i}`,
91
93
  style: a
92
94
  }
93
95
  );
94
96
  }
95
97
  function j({
96
98
  instruction: e,
97
- overlayComponent: i,
99
+ overlayComponent: l,
98
100
  onNext: a,
99
- onSkip: l,
101
+ onSkip: i,
100
102
  onDismiss: d,
101
- onBack: u
103
+ onBack: m
102
104
  }) {
103
- const r = e.target?.element, c = T(r, e.stepId), s = e.stepIndex + 1 >= e.totalSteps, n = G(e, a), y = n || e.advanceOn === "auto", k = f.useRef(null), x = f.useRef(null), [v, E] = f.useState({ width: 400, height: 240 }), S = f.useCallback(() => {
105
+ const r = e.target?.element, c = T(r, e.stepId), s = e.stepIndex + 1 >= e.totalSteps, n = G(e, a), y = n || e.advanceOn === "auto", x = f.useRef(null), k = f.useRef(null), [v, E] = f.useState({ width: 400, height: 240 }), S = f.useCallback(() => {
104
106
  r?.click();
105
107
  }, [r]);
106
108
  if (f.useLayoutEffect(() => {
107
- const g = x.current;
108
- g?.parentElement === document.body && document.body.appendChild(g);
109
+ const p = k.current;
110
+ p?.parentElement === document.body && document.body.appendChild(p);
109
111
  }, [e.stepId, y]), f.useLayoutEffect(() => {
110
- const g = k.current;
111
- if (!g)
112
+ const p = x.current;
113
+ if (!p)
112
114
  return;
113
115
  const C = () => {
114
- const b = g.getBoundingClientRect();
116
+ const b = p.getBoundingClientRect();
115
117
  b.width > 0 && b.height > 0 && E({
116
118
  width: b.width,
117
119
  height: b.height
@@ -119,7 +121,7 @@ function j({
119
121
  };
120
122
  C();
121
123
  const N = new ResizeObserver(C);
122
- return N.observe(g), () => {
124
+ return N.observe(p), () => {
123
125
  N.disconnect();
124
126
  };
125
127
  }, [e.stepId, e.content.title, e.content.body]), !c || !r || typeof document > "u")
@@ -127,35 +129,35 @@ function j({
127
129
  const t = M(r);
128
130
  if (!t)
129
131
  return null;
130
- const p = P({
132
+ const h = P({
131
133
  targetRect: t,
132
134
  popoverWidth: v.width,
133
135
  popoverHeight: v.height,
134
136
  preferredPlacement: e.placement
135
137
  }), O = _({
136
- placement: p.placement,
137
- popoverTop: p.top,
138
- popoverLeft: p.left,
138
+ placement: h.placement,
139
+ popoverTop: h.top,
140
+ popoverLeft: h.left,
139
141
  highlightRect: t,
140
142
  popoverWidth: v.width,
141
143
  popoverHeight: v.height
142
144
  }), I = `guidance-mask-${e.stepId}`;
143
- return z(
144
- /* @__PURE__ */ m(
145
+ return $(
146
+ /* @__PURE__ */ u(
145
147
  "div",
146
148
  {
147
- ref: x,
148
- "data-component": i,
149
+ ref: k,
150
+ "data-component": l,
149
151
  className: "fixed inset-0 z-[60] pointer-events-none",
150
152
  role: "presentation",
151
153
  children: [
152
- /* @__PURE__ */ m(
154
+ /* @__PURE__ */ u(
153
155
  "svg",
154
156
  {
155
- className: `pointer-events-none absolute inset-0 size-full ${h}`,
157
+ className: `pointer-events-none absolute inset-0 size-full ${g}`,
156
158
  "aria-hidden": "true",
157
159
  children: [
158
- /* @__PURE__ */ o("defs", { children: /* @__PURE__ */ m("mask", { id: I, children: [
160
+ /* @__PURE__ */ o("defs", { children: /* @__PURE__ */ u("mask", { id: I, children: [
159
161
  /* @__PURE__ */ o("rect", { width: "100%", height: "100%", fill: "white" }),
160
162
  /* @__PURE__ */ o(
161
163
  "rect",
@@ -166,7 +168,7 @@ function j({
166
168
  height: t.height,
167
169
  rx: "8",
168
170
  fill: "black",
169
- className: h
171
+ className: g
170
172
  }
171
173
  )
172
174
  ] }) }),
@@ -207,7 +209,7 @@ function j({
207
209
  "button",
208
210
  {
209
211
  type: "button",
210
- className: `absolute z-10 cursor-pointer border-0 bg-transparent p-0 pointer-events-auto ${h}`,
212
+ className: `absolute z-10 cursor-pointer border-0 bg-transparent p-0 pointer-events-auto ${g}`,
211
213
  style: {
212
214
  top: t.y,
213
215
  left: t.x,
@@ -221,7 +223,7 @@ function j({
221
223
  /* @__PURE__ */ o(
222
224
  "div",
223
225
  {
224
- className: `pointer-events-none absolute rounded-lg ring-2 ring-[var(--guidance-highlight-ring,var(--color-primary))] ${h}`,
226
+ className: `pointer-events-none absolute rounded-lg ring-2 ring-[var(--guidance-highlight-ring,var(--color-primary))] ${g}`,
225
227
  style: {
226
228
  top: t.y,
227
229
  left: t.x,
@@ -230,14 +232,14 @@ function j({
230
232
  }
231
233
  }
232
234
  ),
233
- /* @__PURE__ */ m(
235
+ /* @__PURE__ */ u(
234
236
  "div",
235
237
  {
236
- ref: k,
237
- className: `pointer-events-auto absolute z-20 w-[min(400px,calc(100vw-2rem))] ${h}`,
238
+ ref: x,
239
+ className: `pointer-events-auto absolute z-20 w-[min(400px,calc(100vw-2rem))] ${g}`,
238
240
  style: {
239
- top: p.top,
240
- left: p.left
241
+ top: h.top,
242
+ left: h.left
241
243
  },
242
244
  role: "dialog",
243
245
  "aria-labelledby": `guidance-tour-title-${e.stepId}`,
@@ -246,7 +248,7 @@ function j({
246
248
  O !== null ? /* @__PURE__ */ o(
247
249
  B,
248
250
  {
249
- placement: p.placement,
251
+ placement: h.placement,
250
252
  offset: O
251
253
  }
252
254
  ) : null,
@@ -260,9 +262,9 @@ function j({
260
262
  totalSteps: e.totalSteps,
261
263
  skippable: e.skippable,
262
264
  primaryActionLabel: s ? "Done" : "Next",
263
- onSkip: l,
265
+ onSkip: i,
264
266
  onDismiss: d,
265
- onBack: u,
267
+ onBack: m,
266
268
  canGoBack: e.canGoBack,
267
269
  advanceOn: e.advanceOn,
268
270
  onPrimaryAction: a,
@@ -1,42 +1,42 @@
1
1
  import { jsx as a } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import { Controller as S } from "react-hook-form";
4
- import { DateRangePicker as v } from "../../components/forms/date-picker/date-range-picker.js";
5
- import { toLocalDate as c } from "../utils/calendar-boundary.js";
6
- import { resolveDateRangeMinMax as P } from "../utils/date.utils.js";
7
- const Y = ({
4
+ import { DateRangePicker as F } from "../../components/forms/date-picker/date-range-picker.js";
5
+ import { toLocalDate as d } from "../utils/calendar-boundary.js";
6
+ import { resolveDateRangeMinMax as P, handleDateFnsFormat as x } from "../utils/date.utils.js";
7
+ const q = ({
8
8
  field: r,
9
- validationRules: d,
9
+ validationRules: c,
10
10
  isDisabled: l,
11
11
  formHelpers: n
12
12
  }) => {
13
13
  const t = r.fieldType === "date_range" ? r : null;
14
14
  if (!t) return null;
15
- const h = n.form.control, { minDate: m, maxDate: u, startMonth: p, endMonth: g } = P(t);
15
+ const m = n.form.control, { minDate: h, maxDate: u, startMonth: p, endMonth: f } = P(t), g = t.dateFormat ? x(t.dateFormat) : void 0;
16
16
  return /* @__PURE__ */ a(
17
17
  S,
18
18
  {
19
19
  name: r.id,
20
- control: h,
20
+ control: m,
21
21
  disabled: l,
22
- rules: d,
23
- render: ({ field: f, fieldState: s }) => {
24
- const i = !!s.error, o = f.value;
22
+ rules: c,
23
+ render: ({ field: D, fieldState: s }) => {
24
+ const i = !!s.error, o = D.value;
25
25
  return /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
26
- v,
26
+ F,
27
27
  {
28
28
  label: r.label,
29
- minDate: m,
29
+ minDate: h,
30
30
  maxDate: u,
31
31
  startMonth: p,
32
- endMonth: g,
32
+ endMonth: f,
33
33
  value: {
34
- from: o?.start ? c(o.start) : void 0,
35
- to: o?.end ? c(o.end) : void 0
34
+ from: o?.start ? d(o.start) : void 0,
35
+ to: o?.end ? d(o.end) : void 0
36
36
  },
37
37
  onChange: (e) => {
38
- const M = e?.from ? `${e.from.getFullYear()}-${String(e.from.getMonth() + 1).padStart(2, "0")}-${String(e.from.getDate()).padStart(2, "0")}` : null, D = e?.to ? `${e.to.getFullYear()}-${String(e.to.getMonth() + 1).padStart(2, "0")}-${String(e.to.getDate()).padStart(2, "0")}` : null;
39
- n.setValue(r.id, { start: M, end: D });
38
+ const M = e?.from ? `${e.from.getFullYear()}-${String(e.from.getMonth() + 1).padStart(2, "0")}-${String(e.from.getDate()).padStart(2, "0")}` : null, v = e?.to ? `${e.to.getFullYear()}-${String(e.to.getMonth() + 1).padStart(2, "0")}-${String(e.to.getDate()).padStart(2, "0")}` : null;
39
+ n.setValue(r.id, { start: M, end: v });
40
40
  },
41
41
  startPlaceholder: t.startPlaceholder || "Start Date",
42
42
  endPlaceholder: t.endPlaceholder || "End Date",
@@ -51,7 +51,8 @@ const Y = ({
51
51
  fiscalYearStartMonth: t.fiscalYearStartMonth,
52
52
  fiscalMonthPattern: t.fiscalMonthPattern,
53
53
  showPresets: t.showPresets,
54
- autoNavigateToAvailable: t.autoNavigateToAvailable
54
+ autoNavigateToAvailable: t.autoNavigateToAvailable,
55
+ format: g
55
56
  }
56
57
  ) });
57
58
  }
@@ -59,5 +60,5 @@ const Y = ({
59
60
  );
60
61
  };
61
62
  export {
62
- Y as DateRangeField
63
+ q as DateRangeField
63
64
  };
@@ -1,58 +1,58 @@
1
1
  import { jsx as c } from "react/jsx-runtime";
2
- import { Controller as T } from "react-hook-form";
3
- import { WeekRangePicker as b } from "../../components/forms/date-picker/week-range-picker.js";
2
+ import { Controller as b } from "react-hook-form";
3
+ import { WeekRangePicker as x } from "../../components/forms/date-picker/week-range-picker.js";
4
4
  import { toLocalDate as M } from "../utils/calendar-boundary.js";
5
- import { resolveWeekSelection as x } from "../../lib/fiscal-calendar/week-selection.js";
6
- import { resolveWeekRangeMinMax as Y } from "../utils/date.utils.js";
7
- const S = (e, a) => x(e, {
8
- calendarKind: a.calendarKind,
9
- fiscalMode: a.fiscalMode ?? "basic",
10
- granularity: a.granularity,
11
- fiscalMonthPattern: a.fiscalMonthPattern,
12
- fiscalYearStartMonth: a.fiscalYearStartMonth ?? 1,
13
- weekStartsOn: a.weekStartsOn,
14
- fiscalConfig: a.fiscalConfig
15
- }), B = ({
16
- field: e,
17
- validationRules: a,
5
+ import { resolveWeekSelection as Y } from "../../lib/fiscal-calendar/week-selection.js";
6
+ import { resolveWeekRangeMinMax as $, handleDateFnsFormat as y } from "../utils/date.utils.js";
7
+ const S = (a, e) => Y(a, {
8
+ calendarKind: e.calendarKind,
9
+ fiscalMode: e.fiscalMode ?? "basic",
10
+ granularity: e.granularity,
11
+ fiscalMonthPattern: e.fiscalMonthPattern,
12
+ fiscalYearStartMonth: e.fiscalYearStartMonth ?? 1,
13
+ weekStartsOn: e.weekStartsOn,
14
+ fiscalConfig: e.fiscalConfig
15
+ }), A = ({
16
+ field: a,
17
+ validationRules: e,
18
18
  isDisabled: p,
19
19
  formHelpers: d
20
20
  }) => {
21
- const t = e.fieldType === "week_range" ? e : null;
21
+ const t = a.fieldType === "week_range" ? a : null;
22
22
  if (!t) return null;
23
- const { minDate: u, maxDate: m, startMonth: D, endMonth: k } = Y(t), v = d.form.control;
23
+ const { minDate: m, maxDate: u, startMonth: D, endMonth: k } = $(t), v = t.dateFormat ? y(t.dateFormat) : void 0, w = d.form.control;
24
24
  return /* @__PURE__ */ c(
25
- T,
25
+ b,
26
26
  {
27
- name: e.id,
28
- control: v,
29
- rules: a,
30
- render: ({ field: w, fieldState: h }) => {
31
- const g = !!h.error, r = w.value, s = r?.start ? M(r.start) ?? null : null, i = r?.end ? M(r.end) ?? null : null, C = !!(s && i);
27
+ name: a.id,
28
+ control: w,
29
+ rules: e,
30
+ render: ({ field: F, fieldState: h }) => {
31
+ const g = !!h.error, o = F.value, s = o?.start ? M(o.start) ?? null : null, i = o?.end ? M(o.end) ?? null : null, C = !!(s && i);
32
32
  return /* @__PURE__ */ c("div", { children: /* @__PURE__ */ c(
33
- b,
33
+ x,
34
34
  {
35
- label: e.label,
35
+ label: a.label,
36
36
  value: C && s && i ? {
37
37
  from: S(s, t),
38
38
  to: S(i, t)
39
39
  } : void 0,
40
- onChange: (o) => {
41
- const f = o?.from ? { from: o.from, to: o.to ?? o.from } : void 0, n = f?.from?.startDate, l = f?.to?.endDate, F = n ? `${n.getFullYear()}-${String(n.getMonth() + 1).padStart(2, "0")}-${String(n.getDate()).padStart(2, "0")}` : null, P = l ? `${l.getFullYear()}-${String(l.getMonth() + 1).padStart(2, "0")}-${String(l.getDate()).padStart(2, "0")}` : null;
42
- d.setValue(e.id, { start: F, end: P });
40
+ onChange: (r) => {
41
+ const f = r?.from ? { from: r.from, to: r.to ?? r.from } : void 0, n = f?.from?.startDate, l = f?.to?.endDate, P = n ? `${n.getFullYear()}-${String(n.getMonth() + 1).padStart(2, "0")}-${String(n.getDate()).padStart(2, "0")}` : null, T = l ? `${l.getFullYear()}-${String(l.getMonth() + 1).padStart(2, "0")}-${String(l.getDate()).padStart(2, "0")}` : null;
42
+ d.setValue(a.id, { start: P, end: T });
43
43
  },
44
44
  placeholder: t.placeholder,
45
- startMonth: u ?? D,
46
- endMonth: m ?? k,
47
- required: e.isRequired,
45
+ startMonth: m ?? D,
46
+ endMonth: u ?? k,
47
+ required: a.isRequired,
48
48
  disabled: p,
49
49
  error: g,
50
- helperText: g ? h.error?.message : e.helpText,
50
+ helperText: g ? h.error?.message : a.helpText,
51
51
  calendarKind: t.calendarKind,
52
52
  fiscalMode: t.fiscalMode,
53
53
  weekStartsOn: t.weekStartsOn,
54
- minDate: u,
55
- maxDate: m,
54
+ minDate: m,
55
+ maxDate: u,
56
56
  granularity: t.granularity,
57
57
  fiscalMonthPattern: t.fiscalMonthPattern,
58
58
  fiscalYearStartMonth: t.fiscalYearStartMonth,
@@ -60,7 +60,7 @@ const S = (e, a) => x(e, {
60
60
  showFooter: t.showFooter,
61
61
  showPeriodBoundaries: t.showPeriodBoundaries,
62
62
  autoNavigateToAvailable: t.autoNavigateToAvailable,
63
- format: t.dateFormat
63
+ format: v
64
64
  }
65
65
  ) });
66
66
  }
@@ -68,5 +68,5 @@ const S = (e, a) => x(e, {
68
68
  );
69
69
  };
70
70
  export {
71
- B as WeekRangeField
71
+ A as WeekRangeField
72
72
  };