impact-nova 2.5.5 → 2.5.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 (93) hide show
  1. package/dist/components/data-display/calendar/calendar-apply-validation.js +45 -33
  2. package/dist/components/data-display/calendar/calendar-day-picker-components.js +62 -54
  3. package/dist/components/data-display/calendar/calendar-day-picker-view.d.ts +1 -1
  4. package/dist/components/data-display/calendar/calendar-day-picker-view.js +88 -85
  5. package/dist/components/data-display/calendar/calendar-week-utils.js +23 -22
  6. package/dist/components/data-display/calendar/use-calendar-state.d.ts +1 -1
  7. package/dist/components/data-display/calendar/use-calendar-state.js +47 -47
  8. package/dist/components/flows/guidance/guidance-error-boundary.js +22 -14
  9. package/dist/components/flows/guidance/guidance-layer.js +34 -32
  10. package/dist/components/flows/guidance/help-center/assets/whats-new-guide-icon.svg.js +4 -0
  11. package/dist/components/flows/guidance/help-center/filter-help-center-guides.js +10 -7
  12. package/dist/components/flows/guidance/help-center/guide-catalog-section.d.ts +7 -0
  13. package/dist/components/flows/guidance/help-center/guide-catalog-section.js +24 -0
  14. package/dist/components/flows/guidance/help-center/guide-catalog-utils.d.ts +3 -0
  15. package/dist/components/flows/guidance/help-center/guide-catalog-utils.js +19 -0
  16. package/dist/components/flows/guidance/help-center/guide-catalog.d.ts +1 -1
  17. package/dist/components/flows/guidance/help-center/guide-catalog.js +89 -79
  18. package/dist/components/flows/guidance/help-center/help-center-guide-labels.d.ts +6 -0
  19. package/dist/components/flows/guidance/help-center/help-center-guide-labels.js +33 -0
  20. package/dist/components/flows/guidance/help-center/help-center-guide-row.d.ts +12 -0
  21. package/dist/components/flows/guidance/help-center/help-center-guide-row.js +57 -0
  22. package/dist/components/flows/guidance/help-center/help-center-guide-type-icons.d.ts +9 -0
  23. package/dist/components/flows/guidance/help-center/help-center-guide-type-icons.js +114 -0
  24. package/dist/components/flows/guidance/help-center/help-center-header.d.ts +1 -1
  25. package/dist/components/flows/guidance/help-center/help-center-header.js +20 -16
  26. package/dist/components/flows/guidance/help-center/help-center.constants.d.ts +1 -1
  27. package/dist/components/flows/guidance/help-center/help-center.constants.js +1 -1
  28. package/dist/components/flows/guidance/help-center/help-center.d.ts +3 -1
  29. package/dist/components/flows/guidance/help-center/help-center.js +74 -51
  30. package/dist/components/flows/guidance/help-center/help-center.types.d.ts +9 -1
  31. package/dist/components/flows/guidance/help-center/renderHelpCenterGuideTypeIcon.d.ts +4 -0
  32. package/dist/components/flows/guidance/help-center/renderHelpCenterGuideTypeIcon.js +18 -0
  33. package/dist/components/flows/guidance/help-center.d.ts +4 -2
  34. package/dist/components/flows/guidance/help-center.js +23 -14
  35. package/dist/components/flows/guidance/hooks/useGuidanceOverlayGeometry.js +19 -17
  36. package/dist/components/flows/guidance/index.d.ts +1 -1
  37. package/dist/components/flows/guidance/renderers/announcement-renderer.d.ts +1 -1
  38. package/dist/components/flows/guidance/renderers/announcement-renderer.js +20 -12
  39. package/dist/components/flows/guidance/renderers/guidance-card-shared.d.ts +9 -11
  40. package/dist/components/flows/guidance/renderers/guidance-card-shared.js +124 -177
  41. package/dist/components/flows/guidance/renderers/guidance-renderer-shared.d.ts +1 -1
  42. package/dist/components/flows/guidance/renderers/guidance-renderer-shared.js +57 -72
  43. package/dist/components/flows/guidance/renderers/guidance-tour-overlay.js +23 -23
  44. package/dist/components/flows/wizard/wizard.js +41 -38
  45. package/dist/components/layout/horizontal-scroller/horizontal-scroller.js +35 -53
  46. package/dist/form-engine/field-dependency-graph.d.ts +1 -4
  47. package/dist/form-engine/field-dependency-graph.js +53 -57
  48. package/dist/form-engine/field-groups.d.ts +15 -0
  49. package/dist/form-engine/field-groups.js +60 -0
  50. package/dist/form-engine/index.d.ts +3 -2
  51. package/dist/form-engine/index.js +17 -14
  52. package/dist/form-engine/types.d.ts +17 -0
  53. package/dist/form-react/Fields/RichTextField.d.ts +3 -0
  54. package/dist/form-react/Fields/RichTextField.js +214 -0
  55. package/dist/form-react/Fields/SelectField.js +27 -28
  56. package/dist/form-react/Fields/SliderRangeField.d.ts +3 -0
  57. package/dist/form-react/Fields/SliderRangeField.js +69 -0
  58. package/dist/form-react/ReactHooksForm.js +149 -87
  59. package/dist/form-react/fields.d.ts +2 -0
  60. package/dist/form-react/fields.js +22 -18
  61. package/dist/form-react/hooks/useCascadingForm.d.ts +1 -2
  62. package/dist/form-react/hooks/useCascadingForm.js +59 -67
  63. package/dist/form-react/hooks/useFieldVisibility.d.ts +1 -2
  64. package/dist/form-react/hooks/useFieldVisibility.js +36 -43
  65. package/dist/form-react/hooks/useFormSteps.d.ts +29 -0
  66. package/dist/form-react/hooks/useFormSteps.js +96 -0
  67. package/dist/form-react/hooks/useReactHookForm.js +17 -18
  68. package/dist/form-react/hooks/useSelectOptions.d.ts +1 -1
  69. package/dist/form-react/hooks/useSelectOptions.js +80 -83
  70. package/dist/form-react/index.d.ts +5 -3
  71. package/dist/form-react/index.js +93 -88
  72. package/dist/form-react/registry/defaultFieldRegistrations.d.ts +1 -1
  73. package/dist/form-react/registry/defaultFieldRegistrations.js +36 -26
  74. package/dist/form-react/types/fields.types.d.ts +34 -15
  75. package/dist/form-react/types/fieldsOutput.types.d.ts +5 -1
  76. package/dist/form-react/types/reactHookForm.types.d.ts +31 -2
  77. package/dist/form-react/utils/date.utils.d.ts +3 -1
  78. package/dist/form-react/utils/date.utils.js +84 -55
  79. package/dist/form-react/utils/fieldDefaults.utils.js +28 -13
  80. package/dist/i18n/defaultMessages.d.ts +10 -0
  81. package/dist/i18n/defaultMessages.js +17 -7
  82. package/dist/i18n/locales/de.js +13 -3
  83. package/dist/i18n/locales/es.js +13 -3
  84. package/dist/i18n/locales/hi.js +13 -3
  85. package/dist/i18n/locales/kn.js +13 -3
  86. package/dist/impact-nova.css +1 -1
  87. package/dist/lib/guidance/engine/guidance-engine.d.ts +7 -5
  88. package/dist/lib/guidance/engine/guidance-engine.js +115 -47
  89. package/dist/lib/guidance/triggers/trigger-registry.js +6 -6
  90. package/dist/lib/guidance/types/guidance.types.d.ts +11 -1
  91. package/dist/llms/rules/installation.js +1 -1
  92. package/dist/llms/rules/requirements.js +1 -1
  93. package/package.json +17 -2
@@ -1,33 +1,40 @@
1
- import { isMonthDisabled as y } from "./calendar-month-utils.js";
2
- function s(u, o, n) {
3
- const c = new Date(u.getFullYear(), u.getMonth(), u.getDate());
4
- if (o) {
5
- const l = new Date(o.getFullYear(), o.getMonth(), o.getDate());
6
- if (c < l) return !0;
1
+ import { isMonthDisabled as g } from "./calendar-month-utils.js";
2
+ function u(n) {
3
+ return new Date(n.getFullYear(), n.getMonth(), n.getDate());
4
+ }
5
+ function d(n, s, o) {
6
+ const i = u(n);
7
+ if (s) {
8
+ const f = u(s);
9
+ if (i < f) return !0;
7
10
  }
8
- if (n) {
9
- const l = new Date(n.getFullYear(), n.getMonth(), n.getDate());
10
- if (c > l) return !0;
11
+ if (o) {
12
+ const f = u(o);
13
+ if (i > f) return !0;
11
14
  }
12
15
  return !1;
13
16
  }
14
- function h(u) {
17
+ function p(n, s, o, i) {
18
+ const f = u(n), m = u(s);
19
+ return !!(o && m < u(o) || i && f > u(i));
20
+ }
21
+ function D(n) {
15
22
  const {
16
- showFooter: o,
17
- pickerType: n,
18
- disabled: c,
19
- pendingSelection: l,
20
- pendingWeekSelection: g,
21
- pendingMonthSelection: m
22
- } = u;
23
- if (!o) return !1;
24
- const f = c;
25
- if (!f || typeof f != "object" || !("before" in f) && !("after" in f)) return !1;
26
- const i = f.before, a = f.after;
27
- if (n === "month") {
28
- const e = m;
23
+ showFooter: s,
24
+ pickerType: o,
25
+ disabled: i,
26
+ pendingSelection: f,
27
+ pendingWeekSelection: m,
28
+ pendingMonthSelection: y
29
+ } = n;
30
+ if (!s) return !1;
31
+ const a = i;
32
+ if (!a || typeof a != "object" || !("before" in a) && !("after" in a)) return !1;
33
+ const c = a.before, l = a.after;
34
+ if (o === "month") {
35
+ const e = y;
29
36
  if (!e) return !1;
30
- const r = (t) => y(t.year, t.month, c);
37
+ const r = (t) => g(t.year, t.month, i);
31
38
  if (Array.isArray(e)) return e.some(r);
32
39
  if ("from" in e) {
33
40
  const t = e;
@@ -35,10 +42,15 @@ function h(u) {
35
42
  }
36
43
  return r(e);
37
44
  }
38
- if (n === "week") {
39
- const e = g;
45
+ if (o === "week") {
46
+ const e = m;
40
47
  if (!e) return !1;
41
- const r = (t) => s(t.startDate, i, a) || s(t.endDate, i, a);
48
+ const r = (t) => p(
49
+ t.startDate,
50
+ t.endDate,
51
+ c,
52
+ l
53
+ );
42
54
  if (Array.isArray(e)) return e.some(r);
43
55
  if ("from" in e) {
44
56
  const t = e;
@@ -46,20 +58,20 @@ function h(u) {
46
58
  }
47
59
  return r(e);
48
60
  }
49
- if (n === "date") {
50
- const e = l;
61
+ if (o === "date") {
62
+ const e = f;
51
63
  if (!e) return !1;
52
64
  if (Array.isArray(e))
53
- return e.some((r) => s(r, i, a));
65
+ return e.some((r) => d(r, c, l));
54
66
  if (e instanceof Date)
55
- return s(e, i, a);
67
+ return d(e, c, l);
56
68
  if ("from" in e) {
57
69
  const r = e;
58
- if (r.from && s(r.from, i, a) || r.to && s(r.to, i, a)) return !0;
70
+ if (r.from && d(r.from, c, l) || r.to && d(r.to, c, l)) return !0;
59
71
  }
60
72
  }
61
73
  return !1;
62
74
  }
63
75
  export {
64
- h as isCalendarApplyDisabled
76
+ D as isCalendarApplyDisabled
65
77
  };
@@ -1,10 +1,10 @@
1
1
  import { jsx as n, jsxs as R } from "react/jsx-runtime";
2
- import * as p from "react";
2
+ import * as u from "react";
3
3
  import "react-day-picker";
4
- import { ChevronRight as C } from "impact-nova-icons";
5
- import { cn as s } from "../../../lib/utils.js";
6
- import { Button as N } from "../../primitives/button/button.js";
7
- import { Select as D } from "../../forms/select/select.js";
4
+ import { ChevronRight as N } from "impact-nova-icons";
5
+ import { cn as d } from "../../../lib/utils.js";
6
+ import { Button as D } from "../../primitives/button/button.js";
7
+ import { Select as w } from "../../forms/select/select.js";
8
8
  import { CalendarCaptionHeader as Y } from "./calendar-caption-header.js";
9
9
  import { CalendarDayButton as z } from "./calendar-day-button.js";
10
10
  import { PanelIndexContext as h } from "./calendar-panel-context.js";
@@ -12,49 +12,49 @@ import { CalendarWeekNumberCell as O } from "./calendar-week-number-cell.js";
12
12
  import { getAvailableMonths as A } from "./calendar-month-utils.js";
13
13
  import { isCalendarPaddingWeek as F } from "./calendar-padding-week.utils.js";
14
14
  function _({
15
- buttonVariant: u,
16
- pickerType: f,
17
- currentMonth: d,
18
- monthsFull: w,
19
- resolvedStartMonth: b,
20
- resolvedEndMonth: k,
21
- availableYears: v,
15
+ buttonVariant: f,
16
+ pickerType: p,
17
+ currentMonth: c,
18
+ monthsFull: b,
19
+ resolvedStartMonth: k,
20
+ resolvedEndMonth: P,
21
+ availableYears: g,
22
22
  weekStartsOn: I,
23
- previousMonthLabel: g,
23
+ previousMonthLabel: v,
24
24
  nextMonthLabel: x,
25
25
  monthPlaceholder: M,
26
- yearPlaceholder: P,
26
+ yearPlaceholder: W,
27
27
  weekNumberLabel: S,
28
- weekLabel: W,
28
+ weekLabel: y,
29
29
  onMonthChange: m,
30
- onWeekSelect: y,
30
+ onWeekSelect: C,
31
31
  components: B
32
32
  }) {
33
33
  return {
34
- Root: ({ className: e, rootRef: t, ...a }) => /* @__PURE__ */ n("div", { "data-slot": "calendar", ref: t, className: s(e), ...a }),
34
+ Root: ({ className: e, rootRef: t, ...a }) => /* @__PURE__ */ n("div", { "data-slot": "calendar", ref: t, className: d(e), ...a }),
35
35
  Chevron: ({ className: e, orientation: t, ...a }) => t === "left" ? /* @__PURE__ */ n(
36
- C,
36
+ N,
37
37
  {
38
38
  size: 16,
39
- className: s("rotate-180 text-content", e),
39
+ className: d("rotate-180 text-content", e),
40
40
  ...a
41
41
  }
42
- ) : t === "right" ? /* @__PURE__ */ n(C, { size: 16, className: s("text-content", e), ...a }) : /* @__PURE__ */ n("span", {}),
42
+ ) : t === "right" ? /* @__PURE__ */ n(N, { size: 16, className: d("text-content", e), ...a }) : /* @__PURE__ */ n("span", {}),
43
43
  PreviousMonthButton: (e) => /* @__PURE__ */ n(
44
- N,
44
+ D,
45
45
  {
46
- variant: u,
46
+ variant: f,
47
47
  size: "icon",
48
48
  className: "h-7 w-7",
49
- "aria-label": g,
50
- title: g,
49
+ "aria-label": v,
50
+ title: v,
51
51
  ...e
52
52
  }
53
53
  ),
54
54
  NextMonthButton: (e) => /* @__PURE__ */ n(
55
- N,
55
+ D,
56
56
  {
57
- variant: u,
57
+ variant: f,
58
58
  size: "icon",
59
59
  className: "h-7 w-7",
60
60
  "aria-label": x,
@@ -64,28 +64,28 @@ function _({
64
64
  ),
65
65
  MonthCaption: ({ displayIndex: e, calendarMonth: t, ...a }) => /* @__PURE__ */ n(h.Provider, { value: e, children: /* @__PURE__ */ n("div", { ...a }) }),
66
66
  Month: ({ calendarMonth: e, displayIndex: t, className: a, children: l, ...r }) => {
67
- const o = p.Children.toArray(l), i = o[o.length - 1], c = o.slice(0, -1);
68
- return /* @__PURE__ */ R("div", { className: s(a), ...r, children: [
69
- c.length > 0 ? /* @__PURE__ */ n(Y, { children: c }) : null,
70
- i
67
+ const o = u.Children.toArray(l), s = o[o.length - 1], i = o.slice(0, -1);
68
+ return /* @__PURE__ */ R("div", { className: d(a), ...r, children: [
69
+ i.length > 0 ? /* @__PURE__ */ n(Y, { children: i }) : null,
70
+ s
71
71
  ] });
72
72
  },
73
- Months: ({ className: e, children: t, ...a }) => /* @__PURE__ */ n("div", { "data-slot": "day-months", className: s(e), ...a, children: t }),
73
+ Months: ({ className: e, children: t, ...a }) => /* @__PURE__ */ n("div", { "data-slot": "day-months", className: d(e), ...a, children: t }),
74
74
  MonthsDropdown: ({ value: e }) => {
75
- const t = p.useContext(h), a = t > 0, r = new Date(d.getFullYear(), d.getMonth() + t, 1).getFullYear(), o = A(
75
+ const t = u.useContext(h), a = t > 0, r = new Date(c.getFullYear(), c.getMonth() + t, 1).getFullYear(), o = A(
76
76
  r,
77
- w,
78
77
  b,
79
- k
78
+ k,
79
+ P
80
80
  );
81
81
  return /* @__PURE__ */ n(
82
- D,
82
+ w,
83
83
  {
84
- value: o.find((i) => i.value === e?.toString()),
85
- onChange: (i) => {
86
- if (i && "value" in i) {
87
- const c = parseInt(i.value);
88
- m(a ? new Date(r, c - 1, 1) : new Date(r, c, 1));
84
+ value: o.find((s) => s.value === e?.toString()),
85
+ onChange: (s) => {
86
+ if (s && "value" in s) {
87
+ const i = parseInt(s.value);
88
+ m(a ? new Date(r, i - 1, 1) : new Date(r, i, 1));
89
89
  }
90
90
  },
91
91
  scrollToSelectedOnOpen: !0,
@@ -99,43 +99,51 @@ function _({
99
99
  );
100
100
  },
101
101
  YearsDropdown: ({ value: e }) => {
102
- const a = p.useContext(h) > 0;
102
+ const a = u.useContext(h) > 0;
103
103
  return /* @__PURE__ */ n(
104
- D,
104
+ w,
105
105
  {
106
- value: v.find((l) => l.value === e?.toString()),
106
+ value: g.find((l) => l.value === e?.toString()),
107
107
  onChange: (l) => {
108
108
  if (l && "value" in l) {
109
109
  const r = parseInt(l.value);
110
110
  if (a) {
111
111
  const o = new Date(
112
- d.getFullYear(),
113
- d.getMonth() + 1,
112
+ c.getFullYear(),
113
+ c.getMonth() + 1,
114
114
  1
115
115
  ).getMonth();
116
116
  m(new Date(r, o - 1, 1));
117
117
  } else
118
- m(new Date(r, d.getMonth(), 1));
118
+ m(new Date(r, c.getMonth(), 1));
119
119
  }
120
120
  },
121
121
  scrollToSelectedOnOpen: !0,
122
- options: v,
122
+ options: g,
123
123
  className: "w-[84px] shrink-0",
124
124
  menuWidth: "140px",
125
125
  isSearchable: !0,
126
126
  isClearable: !1,
127
- placeholder: P
127
+ placeholder: W
128
128
  }
129
129
  );
130
130
  },
131
- DayButton: (e) => /* @__PURE__ */ n(z, { ...e, pickerType: f }),
131
+ DayButton: (e) => /* @__PURE__ */ n(z, { ...e, pickerType: p }),
132
132
  Week: ({ week: e, className: t, children: a, ...l }) => {
133
- const r = F(e);
133
+ const r = F(e), o = p === "week";
134
134
  return /* @__PURE__ */ n(
135
135
  "tr",
136
136
  {
137
- className: s(t, r && "invisible"),
137
+ className: d(
138
+ t,
139
+ r && "invisible",
140
+ o && !r && "cursor-pointer"
141
+ ),
138
142
  "aria-hidden": r || void 0,
143
+ onClick: o && !r ? (s) => {
144
+ const i = s.target;
145
+ i.closest("button") || i.closest("[data-week-number]") || C(e);
146
+ } : void 0,
139
147
  ...l,
140
148
  children: a
141
149
  }
@@ -146,10 +154,10 @@ function _({
146
154
  {
147
155
  week: e,
148
156
  weekStartsOn: I,
149
- pickerType: f,
157
+ pickerType: p,
150
158
  weekNumberLabel: S,
151
- weekLabel: W,
152
- onWeekSelect: y,
159
+ weekLabel: y,
160
+ onWeekSelect: C,
153
161
  ...t
154
162
  }
155
163
  ),
@@ -30,7 +30,7 @@ export interface CalendarDayPickerViewProps extends Omit<CalendarProps, "showFoo
30
30
  dateFnsLocale: DayPickerProps["locale"];
31
31
  intlLocale: string;
32
32
  weekRangeModifiers?: DayPickerProps["modifiers"];
33
- onSelect: (date: Date | Date[] | DateRange | undefined) => void;
33
+ onSelect: (date: Date | Date[] | DateRange | undefined, triggerDate?: Date) => void;
34
34
  onMonthChange: (month: Date) => void;
35
35
  onWeekSelect: (input: WeekPickerInput) => void;
36
36
  previousMonthLabel: string;
@@ -1,106 +1,109 @@
1
- import { jsx as J } from "react/jsx-runtime";
1
+ import { jsx as Q } from "react/jsx-runtime";
2
2
  import "react";
3
- import { DayPicker as K } from "react-day-picker";
4
- import { cn as Q } from "../../../lib/utils.js";
5
- import { useCalendarDayPickerConfig as R } from "./use-calendar-day-picker-config.js";
6
- function E({
7
- className: u,
3
+ import { DayPicker as R } from "react-day-picker";
4
+ import { cn as U } from "../../../lib/utils.js";
5
+ import { useCalendarDayPickerConfig as W } from "./use-calendar-day-picker-config.js";
6
+ function T({
7
+ className: p,
8
8
  pickerType: t,
9
- mode: r,
10
- weekMode: o,
11
- calendarType: a,
9
+ mode: o,
10
+ weekMode: a,
11
+ calendarType: e,
12
12
  showOutsideDays: n,
13
- fixedWeeks: e,
14
- captionLayout: p,
15
- buttonVariant: d,
16
- weekStartsOn: s,
17
- formatters: g,
18
- classNames: f,
19
- components: w,
20
- selected: b,
21
- showFooter: P,
13
+ fixedWeeks: s,
14
+ captionLayout: g,
15
+ buttonVariant: f,
16
+ weekStartsOn: i,
17
+ formatters: w,
18
+ classNames: b,
19
+ components: D,
20
+ selected: P,
21
+ showFooter: v,
22
22
  pendingSelection: y,
23
- selectedDaysFromWeeks: D,
24
- currentMonth: i,
25
- monthsFull: h,
26
- resolvedStartMonth: m,
27
- resolvedEndMonth: c,
28
- availableYears: k,
29
- dateFnsLocale: v,
30
- intlLocale: C,
31
- weekRangeModifiers: N,
32
- onSelect: _,
33
- onMonthChange: l,
34
- onWeekSelect: S,
35
- previousMonthLabel: x,
36
- nextMonthLabel: L,
37
- monthPlaceholder: O,
38
- yearPlaceholder: j,
39
- weekNumberLabel: V,
40
- weekLabel: q,
41
- formatWeekNumber: z,
42
- disabled: A,
43
- ...B
23
+ selectedDaysFromWeeks: h,
24
+ currentMonth: m,
25
+ monthsFull: k,
26
+ resolvedStartMonth: c,
27
+ resolvedEndMonth: l,
28
+ availableYears: C,
29
+ dateFnsLocale: N,
30
+ intlLocale: S,
31
+ weekRangeModifiers: _,
32
+ onSelect: x,
33
+ onMonthChange: u,
34
+ onWeekSelect: L,
35
+ previousMonthLabel: O,
36
+ nextMonthLabel: j,
37
+ monthPlaceholder: V,
38
+ yearPlaceholder: q,
39
+ weekNumberLabel: z,
40
+ weekLabel: A,
41
+ formatWeekNumber: B,
42
+ disabled: F,
43
+ ...G
44
44
  }) {
45
- const { dayPickerClassNames: F, dayPickerComponents: G } = R({
46
- buttonVariant: d,
45
+ const { dayPickerClassNames: H, dayPickerComponents: I } = W({
46
+ buttonVariant: f,
47
47
  pickerType: t,
48
- calendarType: a,
48
+ calendarType: e,
49
49
  showOutsideDays: n,
50
- classNames: f,
51
- currentMonth: i,
52
- monthsFull: h,
53
- resolvedStartMonth: m,
54
- resolvedEndMonth: c,
55
- availableYears: k,
56
- weekStartsOn: s,
57
- previousMonthLabel: x,
58
- nextMonthLabel: L,
59
- monthPlaceholder: O,
60
- yearPlaceholder: j,
61
- weekNumberLabel: V,
62
- weekLabel: q,
63
- onMonthChange: l,
64
- onWeekSelect: S,
65
- components: w
66
- }), H = r === "range" || r === "multiple" || o === "range" || o === "multiple" ? 2 : 1;
67
- return /* @__PURE__ */ J(
68
- K,
50
+ classNames: b,
51
+ currentMonth: m,
52
+ monthsFull: k,
53
+ resolvedStartMonth: c,
54
+ resolvedEndMonth: l,
55
+ availableYears: C,
56
+ weekStartsOn: i,
57
+ previousMonthLabel: O,
58
+ nextMonthLabel: j,
59
+ monthPlaceholder: V,
60
+ yearPlaceholder: q,
61
+ weekNumberLabel: z,
62
+ weekLabel: A,
63
+ onMonthChange: u,
64
+ onWeekSelect: L,
65
+ components: D
66
+ }), J = o === "range" || o === "multiple" || a === "range" || a === "multiple" ? 2 : 1;
67
+ return /* @__PURE__ */ Q(
68
+ R,
69
69
  {
70
- mode: t === "week" ? "multiple" : r,
71
- selected: t === "week" ? D : P ? y : b,
72
- onSelect: _,
73
- month: i,
74
- onMonthChange: l,
75
- fixedWeeks: e,
76
- showOutsideDays: e || a === "fiscal" || n,
77
- weekStartsOn: s,
78
- modifiers: t === "week" ? N : void 0,
79
- locale: v,
80
- className: Q(
70
+ mode: t === "week" ? "multiple" : o,
71
+ selected: t === "week" ? h : v ? y : P,
72
+ onSelect: (...r) => {
73
+ const [K, d] = r;
74
+ x(K, d instanceof Date ? d : void 0);
75
+ },
76
+ month: m,
77
+ onMonthChange: u,
78
+ fixedWeeks: s,
79
+ showOutsideDays: s || e === "fiscal" || n,
80
+ weekStartsOn: i,
81
+ modifiers: t === "week" ? _ : void 0,
82
+ locale: N,
83
+ className: U(
81
84
  "bg-canvas group/calendar p-2 [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
82
85
  String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
83
86
  String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
84
- u
87
+ p
85
88
  ),
86
- captionLayout: p,
89
+ captionLayout: g,
87
90
  navLayout: "around",
88
- startMonth: m,
89
- endMonth: c,
90
- disabled: A,
91
- numberOfMonths: H,
91
+ startMonth: c,
92
+ endMonth: l,
93
+ disabled: F,
94
+ numberOfMonths: J,
92
95
  showWeekNumber: !0,
93
96
  formatters: {
94
- formatMonthDropdown: (I) => I.toLocaleString(C, { month: "short" }),
95
- formatWeekNumber: z,
96
- ...g
97
+ formatMonthDropdown: (r) => r.toLocaleString(S, { month: "short" }),
98
+ formatWeekNumber: B,
99
+ ...w
97
100
  },
98
- classNames: F,
99
- components: G,
100
- ...B
101
+ classNames: H,
102
+ components: I,
103
+ ...G
101
104
  }
102
105
  );
103
106
  }
104
107
  export {
105
- E as CalendarDayPickerView
108
+ T as CalendarDayPickerView
106
109
  };
@@ -1,5 +1,5 @@
1
1
  import { resolveWeekSelection as T } from "../../../lib/fiscal-calendar.js";
2
- function h(t, s) {
2
+ function m(t, s) {
3
3
  return t.year === s.year && t.month === s.month && t.weekOfMonth === s.weekOfMonth;
4
4
  }
5
5
  function W(t, s) {
@@ -10,21 +10,22 @@ function A(t, s, o) {
10
10
  if (o === "single") return t;
11
11
  if (o === "multiple") {
12
12
  const i = s || [];
13
- return i.some((f) => h(f, t)) ? i.filter((f) => !h(f, t)) : [...i, t];
13
+ return i.some((f) => m(f, t)) ? i.filter((f) => !m(f, t)) : [...i, t];
14
14
  }
15
15
  const e = s;
16
16
  if (!e?.from || e.to) return { from: t };
17
- const r = { from: e.from, to: t };
18
- return t.startDate < e.from.startDate && (r.from = t, r.to = e.from), r;
17
+ if (m(t, e.from)) return e;
18
+ const n = { from: e.from, to: t };
19
+ return t.startDate < e.from.startDate && (n.from = t, n.to = e.from), n;
19
20
  }
20
21
  function _(t) {
21
22
  if (!t) return;
22
23
  const s = [], o = (e) => {
23
- const r = new Date(e.startDate);
24
- r.setHours(0, 0, 0, 0);
24
+ const n = new Date(e.startDate);
25
+ n.setHours(0, 0, 0, 0);
25
26
  const i = new Date(e.endDate);
26
- for (i.setHours(0, 0, 0, 0); r <= i; )
27
- s.push(new Date(r)), r.setDate(r.getDate() + 1);
27
+ for (i.setHours(0, 0, 0, 0); n <= i; )
28
+ s.push(new Date(n)), n.setDate(n.getDate() + 1);
28
29
  };
29
30
  if (Array.isArray(t))
30
31
  t.forEach(o);
@@ -35,8 +36,8 @@ function _(t) {
35
36
  else {
36
37
  const e = new Date(t.from.startDate);
37
38
  e.setHours(0, 0, 0, 0);
38
- const r = new Date(t.to.endDate);
39
- for (r.setHours(0, 0, 0, 0); e <= r; )
39
+ const n = new Date(t.to.endDate);
40
+ for (n.setHours(0, 0, 0, 0); e <= n; )
40
41
  s.push(new Date(e)), e.setDate(e.getDate() + 1);
41
42
  }
42
43
  } else
@@ -46,28 +47,28 @@ function _(t) {
46
47
  function E(t, s, o) {
47
48
  if (!t || t.length === 0)
48
49
  return { range_start: [], range_middle: [], range_end: [] };
49
- const e = [...t].sort((n, a) => n.getTime() - a.getTime()), r = [], i = [], u = [], f = /* @__PURE__ */ new Set(), m = /* @__PURE__ */ new Set();
50
- s === "multiple" && Array.isArray(o) && o.forEach((n) => {
51
- f.add(n.startDate.toISOString().split("T")[0]), m.add(n.endDate.toISOString().split("T")[0]);
50
+ const e = [...t].sort((r, a) => r.getTime() - a.getTime()), n = [], i = [], u = [], f = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set();
51
+ s === "multiple" && Array.isArray(o) && o.forEach((r) => {
52
+ f.add(r.startDate.toISOString().split("T")[0]), l.add(r.endDate.toISOString().split("T")[0]);
52
53
  });
53
- const d = (n, a) => {
54
+ const d = (r, a) => {
54
55
  if (a === 0) return !1;
55
56
  const c = e[a - 1];
56
- return n.getTime() - c.getTime() <= 1440 * 60 * 1e3;
57
- }, p = (n, a) => a === e.length - 1 ? !1 : e[a + 1].getTime() - n.getTime() <= 1440 * 60 * 1e3;
58
- return e.forEach((n, a) => {
59
- const c = n.toISOString().split("T")[0], D = f.has(c), S = m.has(c), l = d(n, a), g = p(n, a);
57
+ return r.getTime() - c.getTime() <= 1440 * 60 * 1e3;
58
+ }, p = (r, a) => a === e.length - 1 ? !1 : e[a + 1].getTime() - r.getTime() <= 1440 * 60 * 1e3;
59
+ return e.forEach((r, a) => {
60
+ const c = r.toISOString().split("T")[0], D = f.has(c), S = l.has(c), g = d(r, a), h = p(r, a);
60
61
  if (s === "multiple") {
61
- D ? r.push(n) : S ? u.push(n) : i.push(n);
62
+ D ? n.push(r) : S ? u.push(r) : i.push(r);
62
63
  return;
63
64
  }
64
- !l && !g ? (r.push(n), u.push(n)) : l ? g ? i.push(n) : u.push(n) : r.push(n);
65
- }), { range_start: r, range_middle: i, range_end: u };
65
+ !g && !h ? (n.push(r), u.push(r)) : g ? h ? i.push(r) : u.push(r) : n.push(r);
66
+ }), { range_start: n, range_middle: i, range_end: u };
66
67
  }
67
68
  export {
68
69
  W as calculateWeekSelection,
69
70
  E as computeWeekRangeModifiers,
70
- h as isSameWeek,
71
+ m as isSameWeek,
71
72
  A as nextWeekSelection,
72
73
  _ as weekSelectionsToDates
73
74
  };
@@ -53,7 +53,7 @@ export declare function useCalendarState({ showFooter, selected, onSelect, picke
53
53
  range_middle: Date[];
54
54
  range_end: Date[];
55
55
  };
56
- handleInternalSelect: (date: Date | Date[] | DateRange | undefined) => void;
56
+ handleInternalSelect: (date: Date | Date[] | DateRange | undefined, triggerDate?: Date) => void;
57
57
  handleApply: () => void;
58
58
  handleCancel: () => void;
59
59
  handleClear: () => void;