impact-nova 2.2.0 → 2.2.2

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 (63) hide show
  1. package/README.md +6 -0
  2. package/dist/components/data/ag-grid-react/ag-grid-header-dom.d.ts +8 -0
  3. package/dist/components/data/ag-grid-react/ag-grid-header-dom.js +11 -0
  4. package/dist/components/data/ag-grid-react/ag-grid-tooltip-overflow.d.ts +4 -1
  5. package/dist/components/data/ag-grid-react/ag-grid-tooltip-overflow.js +14 -3
  6. package/dist/components/data/ag-grid-react/headers/column-menu/column-header-settings-menu.d.ts +19 -0
  7. package/dist/components/data/ag-grid-react/headers/column-menu/column-header-settings-menu.js +74 -0
  8. package/dist/components/data/ag-grid-react/headers/column-menu/column-settings-menu.d.ts +4 -5
  9. package/dist/components/data/ag-grid-react/headers/column-menu/column-settings-menu.js +110 -144
  10. package/dist/components/data/ag-grid-react/headers/components/header-info.d.ts +2 -1
  11. package/dist/components/data/ag-grid-react/headers/components/header-info.js +73 -70
  12. package/dist/components/data/ag-grid-react/headers/context/grid-header-context.d.ts +0 -8
  13. package/dist/components/data/ag-grid-react/headers/custom-header.js +112 -118
  14. package/dist/components/data/ag-grid-react/headers/custom-inner-header-group.js +27 -23
  15. package/dist/components/data/ag-grid-react/headers/resolve-header-info-params.d.ts +10 -0
  16. package/dist/components/data/ag-grid-react/headers/resolve-header-info-params.js +19 -0
  17. package/dist/components/data/ag-grid-react/index.js +169 -210
  18. package/dist/components/data/ag-grid-react/info-system-story-columns.d.ts +12 -0
  19. package/dist/components/data/ag-grid-react/merge-column-group-defs.d.ts +3 -0
  20. package/dist/components/data/ag-grid-react/merge-column-group-defs.js +27 -0
  21. package/dist/components/data/ag-grid-react/use-ag-grid-truncation-tooltip.d.ts +2 -1
  22. package/dist/components/data/ag-grid-react/use-ag-grid-truncation-tooltip.js +7 -7
  23. package/dist/components/data/data-table/data-table-view-menu.d.ts +1 -0
  24. package/dist/components/data/expandable-list-item/expandable-list-item-attributes.js +7 -6
  25. package/dist/components/feedback/dialog/dialog.js +107 -61
  26. package/dist/components/feedback/dropdown-menu/dropdown-menu.d.ts +1 -0
  27. package/dist/components/feedback/dropdown-menu/dropdown-menu.js +83 -76
  28. package/dist/components/feedback/popover/popover.d.ts +5 -2
  29. package/dist/components/feedback/popover/popover.js +43 -40
  30. package/dist/components/feedback/sheet/sheet.js +149 -102
  31. package/dist/components/feedback/tooltip/tab-tooltip-render.js +3 -2
  32. package/dist/components/forms/date-picker/date-input-behavior.d.ts +10 -4
  33. package/dist/components/forms/date-picker/date-input-behavior.js +86 -67
  34. package/dist/components/forms/date-picker/date-picker.js +59 -52
  35. package/dist/components/forms/date-picker/date-range-picker.js +26 -25
  36. package/dist/components/forms/date-picker/month-picker.js +76 -69
  37. package/dist/components/forms/date-picker/month-range-picker.js +41 -40
  38. package/dist/components/forms/date-picker/multi-date-picker.js +31 -31
  39. package/dist/components/forms/date-picker/multi-month-picker.js +27 -27
  40. package/dist/components/forms/date-picker/multi-week-picker.js +37 -37
  41. package/dist/components/forms/date-picker/week-picker.js +85 -78
  42. package/dist/components/forms/date-picker/week-range-picker.js +67 -66
  43. package/dist/components/forms/select/components/SelectMenuPanel.js +19 -15
  44. package/dist/components/forms/select/components/SelectOptionRow.js +110 -90
  45. package/dist/components/forms/select/components/Submenu.js +39 -34
  46. package/dist/components/forms/select/hooks/useSelectOpenEffects.js +65 -70
  47. package/dist/components/forms/select/select.js +228 -223
  48. package/dist/components/forms/select/select.types.d.ts +8 -0
  49. package/dist/impact-nova-components.css +59 -15
  50. package/dist/impact-nova.css +1 -1
  51. package/dist/lib/overlay/merge-element-refs.d.ts +2 -0
  52. package/dist/lib/overlay/merge-element-refs.js +17 -0
  53. package/dist/lib/overlay/overlay-host.constants.d.ts +4 -0
  54. package/dist/lib/overlay/overlay-host.constants.js +5 -0
  55. package/dist/lib/overlay/overlay-portal-context.d.ts +26 -0
  56. package/dist/lib/overlay/overlay-portal-context.js +65 -0
  57. package/dist/lib/overlay/use-overlay-portal-container-state.d.ts +5 -0
  58. package/dist/lib/overlay/use-overlay-portal-container-state.js +13 -0
  59. package/dist/llms/rules/installation.js +1 -1
  60. package/dist/llms/rules/requirements.js +1 -1
  61. package/package.json +26 -11
  62. package/dist/components/forms/select/components/LabelWithSequence.d.ts +0 -13
  63. package/dist/components/forms/select/components/LabelWithSequence.js +0 -18
@@ -1,19 +1,19 @@
1
1
  import { jsx as u, jsxs as T } from "react/jsx-runtime";
2
2
  import * as l from "react";
3
3
  import { Cross as Me, CalendarMonth as Ge } from "impact-nova-icons";
4
- import { format as k } from "date-fns";
4
+ import { format as g } from "date-fns";
5
5
  import { cn as G } from "../../../lib/utils.js";
6
- import { usePickerDismissActionsRef as Je, usePickerFooterDismissNudge as Qe, createRangePickerOpenChangeHandler as Ue, parseDateInput as J, normalizeOrderedRange as Xe, compareDates as Ze, flashRangeReorder as _e, isDateInputInvalid as ne, resolveRangeFieldBlur as V, resolveRangePickerDismissFlash as $e, deferRangeInputBlur as Ye, maskDateInput as se, resolveDateInputOnBlur as O } from "./date-input-behavior.js";
6
+ import { usePickerDismissActionsRef as Je, usePickerFooterDismissNudge as Qe, createRangePickerOpenChangeHandler as Ue, parseDateInput as J, normalizeOrderedRange as Xe, compareDates as Ze, flashRangeReorder as _e, isDateInputInvalid as oe, resolveRangeFieldBlur as V, resolveRangePickerDismissFlash as $e, deferRangeInputBlur as Ye, maskDateInput as se, resolveDateInputOnBlur as O } from "./date-input-behavior.js";
7
7
  import { useFieldChrome as Fe } from "../../../lib/primitives/use-field-chrome.js";
8
8
  import { Popover as et, PopoverAnchor as tt, PopoverContent as rt } from "../../feedback/popover/popover.js";
9
- import { Calendar as ot } from "../../data-display/calendar/calendar.js";
10
- import { buildDateBoundsMatcher as nt } from "../../../lib/date-bounds-matcher.js";
9
+ import { Calendar as nt } from "../../data-display/calendar/calendar.js";
10
+ import { buildDateBoundsMatcher as ot } from "../../../lib/date-bounds-matcher.js";
11
11
  import { Tooltip as ie, TooltipTrigger as le, TooltipContent as ae } from "../../feedback/tooltip/tooltip.js";
12
12
  import { resolveWeekSelection as st } from "../../../lib/fiscal-calendar.js";
13
13
  import { useImpactNovaI18n as it } from "../../../i18n/use-impact-nova-i18n.js";
14
14
  import { getDateFnsLocale as lt } from "../../../i18n/getDateFnsLocale.js";
15
15
  import { coerceWeekRangeApply as at, isWeekRangeSelection as ct } from "./calendar-selection-adapters.js";
16
- const x = (t) => t?.from ? t.to ? t.to.endDate : t.from.endDate : void 0, B = (t) => t?.from ? { from: t.from, to: t.to } : void 0;
16
+ const x = (t) => t?.from ? t.to ? t.to.endDate : t.from.endDate : void 0, S = (t) => t?.from ? { from: t.from, to: t.to } : void 0;
17
17
  function ce(t, a) {
18
18
  return !t && !a ? !0 : !t || !a ? !1 : t.startDate.getTime() === a.startDate.getTime();
19
19
  }
@@ -24,13 +24,13 @@ const dt = l.forwardRef(
24
24
  ({
25
25
  value: t,
26
26
  onChange: a,
27
- format: n = "MM/dd/yyyy",
27
+ format: o = "MM/dd/yyyy",
28
28
  placeholder: fe,
29
29
  minDate: de,
30
30
  maxDate: pe,
31
31
  startMonth: me,
32
32
  endMonth: ue,
33
- showFooter: g = !0,
33
+ showFooter: k = !0,
34
34
  calendarType: L = "calendar",
35
35
  fiscalMode: j = "basic",
36
36
  selectionMode: K = "week",
@@ -38,8 +38,8 @@ const dt = l.forwardRef(
38
38
  fiscalYearStartMonth: z = 1,
39
39
  weekStartsOn: H = 1,
40
40
  disabled: d,
41
- className: ke,
42
- error: ge,
41
+ className: ge,
42
+ error: ke,
43
43
  isError: Re,
44
44
  size: Q,
45
45
  label: De,
@@ -50,7 +50,7 @@ const dt = l.forwardRef(
50
50
  prefixClick: mt,
51
51
  ...xe
52
52
  }, be) => {
53
- const U = ge ?? Re, Ce = Fe({
53
+ const U = ke ?? Re, Ce = Fe({
54
54
  label: De,
55
55
  helperText: he,
56
56
  helperTextPosition: ye,
@@ -60,30 +60,30 @@ const dt = l.forwardRef(
60
60
  rootClassName: "w-full min-w-[240px]"
61
61
  }), { locale: X, t: E } = it(), s = l.useMemo(() => lt(X), [X]), Z = fe ?? E("datePicker.selectWeekRange"), _ = l.useRef(null), Ie = l.useRef(null), $ = l.useRef(null), N = l.useRef(null), M = l.useRef(null);
62
62
  l.useImperativeHandle(be, () => _.current);
63
- const [p, R] = l.useState(!1), Y = Je(), { footerFlashKey: we, footerFlashTarget: Ee, popoverHandlers: We } = Qe(g, p, Y, $), W = l.useRef(!1), [c, D] = l.useState(t), [m, h] = l.useState(t?.from ? k(t.from.startDate, n, { locale: s }) : ""), [y, v] = l.useState(x(t) ? k(x(t), n, { locale: s }) : ""), [Pe, P] = l.useState(t?.from?.startDate || /* @__PURE__ */ new Date());
63
+ const [p, R] = l.useState(!1), Y = Je(), { footerFlashKey: we, footerFlashTarget: Ee, popoverHandlers: We } = Qe(k, p, Y, $), W = l.useRef(!1), [c, D] = l.useState(t), [m, h] = l.useState(t?.from ? g(t.from.startDate, o, { locale: s }) : ""), [y, v] = l.useState(x(t) ? g(x(t), o, { locale: s }) : ""), [Pe, P] = l.useState(t?.from?.startDate || /* @__PURE__ */ new Date());
64
64
  l.useEffect(() => {
65
- h(t?.from ? k(t.from.startDate, n, { locale: s }) : ""), v(x(t) ? k(x(t), n, { locale: s }) : ""), D(t);
66
- }, [t, n, s]);
65
+ h(t?.from ? g(t.from.startDate, o, { locale: s }) : ""), v(x(t) ? g(x(t), o, { locale: s }) : ""), D(t);
66
+ }, [t, o, s]);
67
67
  const Te = l.useCallback(
68
68
  (e) => Ue({
69
69
  disabled: d ?? void 0,
70
- showFooter: g,
70
+ showFooter: k,
71
71
  containerRef: N,
72
72
  popoverContentRef: M,
73
73
  setOpen: R
74
74
  })(e),
75
- [d, g]
75
+ [d, k]
76
76
  ), F = l.useRef(!1);
77
77
  l.useEffect(() => {
78
78
  if (p && !F.current) {
79
- const e = J(m, n, s);
79
+ const e = J(m, o, s);
80
80
  e.parsed ? P(e.parsed) : c?.from ? P(c.from.startDate) : t?.from && P(t.from.startDate);
81
81
  }
82
82
  F.current = p;
83
- }, [p, m, n, s, c?.from, t?.from]);
83
+ }, [p, m, o, s, c?.from, t?.from]);
84
84
  const Se = (e) => {
85
85
  const r = ct(e) ? e : void 0;
86
- D(r), r?.from ? (h(k(r.from.startDate, n, { locale: s })), v(k(x(r), n, { locale: s }))) : (h(""), v("")), !g && r?.from && r?.to && r.from.startDate.getTime() !== r.to.startDate.getTime() && (a?.(r), R(!1));
86
+ D(r), r?.from ? (h(g(r.from.startDate, o, { locale: s })), v(g(x(r), o, { locale: s }))) : (h(""), v("")), !k && r?.from && r?.to && r.from.startDate.getTime() !== r.to.startDate.getTime() && (a?.(r), R(!1));
87
87
  }, b = l.useCallback(
88
88
  (e) => st(e, {
89
89
  calendarType: L,
@@ -101,89 +101,90 @@ const dt = l.forwardRef(
101
101
  z,
102
102
  H
103
103
  ]
104
- ), S = l.useCallback((e, r) => {
105
- const o = Xe(
104
+ ), B = l.useCallback((e, r) => {
105
+ const n = Xe(
106
106
  e,
107
107
  r,
108
108
  (i, f) => Ze(i.startDate, f.startDate)
109
109
  );
110
- return o.swapped && (o.from && h(k(o.from.startDate, n, { locale: s })), o.to && v(k(x({ from: o.from, to: o.to }), n, { locale: s })), _e(N.current)), { from: o.from, to: o.to };
111
- }, [n, s]), ee = (e) => {
112
- const r = at(e, B(c)), o = S(r?.from, r?.to), i = o.from ? { from: o.from, to: o.to } : void 0;
110
+ return n.swapped && (n.from && h(g(n.from.startDate, o, { locale: s })), n.to && v(g(x({ from: n.from, to: n.to }), o, { locale: s })), _e(N.current)), { from: n.from, to: n.to };
111
+ }, [o, s]), ee = (e) => {
112
+ const r = at(e, S(c)), n = B(r?.from, r?.to), i = n.from ? { from: n.from, to: n.to } : void 0;
113
113
  D(i), a?.(i), R(!1);
114
114
  }, A = () => {
115
- D(t), h(t?.from ? k(t.from.startDate, n, { locale: s }) : ""), v(x(t) ? k(x(t), n, { locale: s }) : ""), R(!1);
115
+ D(t), h(t?.from ? g(t.from.startDate, o, { locale: s }) : ""), v(x(t) ? g(x(t), o, { locale: s }) : ""), R(!1);
116
116
  }, te = () => {
117
- D(void 0), h(""), v(""), a?.(void 0), g || R(!1);
117
+ D(void 0), h(""), v(""), a?.(void 0), k || R(!1);
118
118
  }, Be = (e) => {
119
- const r = se(e.target.value, n, m);
119
+ const r = se(e.target.value, o, m);
120
120
  if (h(r), r === "") {
121
121
  const f = { to: c?.to };
122
- D(f), g || a?.(void 0);
122
+ D(f), k || a?.(void 0);
123
123
  return;
124
124
  }
125
- const { parsed: o, isValid: i } = J(r, n, s);
126
- if (i && o) {
127
- const w = { from: b(o), to: c?.to };
128
- D(w), c?.to && v(k(x(w), n, { locale: s })), P(o), g || a?.(B(w));
125
+ const { parsed: n, isValid: i } = J(r, o, s);
126
+ if (i && n) {
127
+ const w = { from: b(n), to: c?.to };
128
+ D(w), c?.to && v(g(x(w), o, { locale: s })), P(n), k || a?.(S(w));
129
129
  }
130
130
  }, Ne = (e) => {
131
- const r = se(e.target.value, n, y);
131
+ const r = se(e.target.value, o, y);
132
132
  if (v(r), r === "") {
133
133
  const f = { from: c?.from };
134
- D(f), g || a?.(B(f));
134
+ D(f), k || a?.(S(f));
135
135
  return;
136
136
  }
137
- const { parsed: o, isValid: i } = J(r, n, s);
138
- if (i && o) {
139
- const f = b(o), w = { from: c?.from, to: f };
140
- D(w), c?.from && h(k(c.from.startDate, n, { locale: s })), P(o), g || a?.(B(w));
137
+ const { parsed: n, isValid: i } = J(r, o, s);
138
+ if (i && n) {
139
+ const f = b(n), w = { from: c?.from, to: f };
140
+ D(w), c?.from && h(g(c.from.startDate, o, { locale: s })), P(n), k || a?.(S(w));
141
141
  }
142
142
  }, Ae = () => {
143
- const e = O(m, n, C, s), r = O(y, n, I, s);
143
+ const e = O(m, o, C, s), r = O(y, o, I, s);
144
144
  e.resetToCommitted ? h(C) : e.parsed && h(e.display), r.resetToCommitted ? v(I) : r.parsed && v(r.display);
145
- let o = e.parsed ? b(e.parsed) : c?.from, i = r.parsed ? b(r.parsed) : c?.to;
146
- o && i && ({ from: o, to: i } = S(o, i));
147
- const f = o ? { from: o, to: i } : void 0;
145
+ let n = e.parsed ? b(e.parsed) : c?.from, i = r.parsed ? b(r.parsed) : c?.to;
146
+ n && i && ({ from: n, to: i } = B(n, i));
147
+ const f = n ? { from: n, to: i } : void 0;
148
148
  f ? (D(f), a?.(f)) : !m && !y && (D(void 0), a?.(void 0));
149
149
  }, re = () => {
150
150
  Ye(
151
151
  N,
152
152
  M,
153
153
  () => {
154
- const e = V(m, n, C, s), r = V(y, n, I, s);
154
+ const e = V(m, o, C, s), r = V(y, o, I, s);
155
155
  e.resetToCommitted ? h(C) : e.parsed && h(e.display), r.resetToCommitted ? v(I) : r.parsed && v(r.display);
156
- let o = e.parsed ? b(e.parsed) : e.resetToCommitted ? t?.from : c?.from, i = r.parsed ? b(r.parsed) : r.resetToCommitted ? t?.to : c?.to;
157
- o && i && ({ from: o, to: i } = S(o, i));
158
- const f = o || i ? { from: o, to: i } : void 0;
159
- D(f), g || (f ? a?.(f) : !m && !y && a?.(void 0));
156
+ let n = e.parsed ? b(e.parsed) : e.resetToCommitted ? t?.from : c?.from, i = r.parsed ? b(r.parsed) : r.resetToCommitted ? t?.to : c?.to;
157
+ n && i && ({ from: n, to: i } = B(n, i));
158
+ const f = n || i ? { from: n, to: i } : void 0;
159
+ D(f), k || (f ? a?.(f) : !m && !y && a?.(void 0));
160
160
  }
161
161
  );
162
- }, oe = () => {
163
- if (p && g) {
162
+ }, ne = () => {
163
+ if (p && k) {
164
164
  ee();
165
165
  return;
166
166
  }
167
167
  if (!p) {
168
- if (g) {
168
+ if (k) {
169
169
  Ae();
170
170
  return;
171
171
  }
172
- const e = O(m, n, C, s), r = O(y, n, I, s);
172
+ const e = O(m, o, C, s), r = O(y, o, I, s);
173
173
  if (e.parsed || r.parsed) return;
174
174
  W.current = !0, R(!0);
175
175
  }
176
- }, C = t?.from ? k(t.from.startDate, n, { locale: s }) : "", I = x(t) ? k(x(t), n, { locale: s }) : "", Ve = C !== m, Oe = I !== y, Le = ne(m, n, s), je = ne(y, n, s), Ke = "Start Date", qe = "End Date", ze = l.useCallback(() => {
177
- const e = V(m, n, C, s), r = V(y, n, I, s);
178
- let o = e.parsed ? b(e.parsed) : e.resetToCommitted ? t?.from : c?.from, i = r.parsed ? b(r.parsed) : r.resetToCommitted ? t?.to : c?.to;
179
- o && i && ({ from: o, to: i } = S(o, i));
180
- const f = o || i ? { from: o, to: i } : void 0;
176
+ }, C = t?.from ? g(t.from.startDate, o, { locale: s }) : "", I = x(t) ? g(x(t), o, { locale: s }) : "", Ve = C !== m, Oe = I !== y, Le = oe(m, o, s), je = oe(y, o, s), Ke = "Start Date", qe = "End Date", ze = l.useCallback(() => {
177
+ const e = V(m, o, C, s), r = V(y, o, I, s);
178
+ let n = e.parsed ? b(e.parsed) : e.resetToCommitted ? t?.from : c?.from, i = r.parsed ? b(r.parsed) : r.resetToCommitted ? t?.to : c?.to;
179
+ n && i && ({ from: n, to: i } = B(n, i));
180
+ const f = n || i ? { from: n, to: i } : void 0;
181
181
  return $e({
182
182
  startInput: m,
183
183
  endInput: y,
184
184
  committedStart: C,
185
185
  committedEnd: I,
186
186
  committedRange: t,
187
+ pendingRange: S(c),
187
188
  computeEffectiveRange: () => f,
188
189
  rangesEqual: (w, He) => ft(w, He)
189
190
  });
@@ -194,9 +195,9 @@ const dt = l.forwardRef(
194
195
  I,
195
196
  t,
196
197
  c,
197
- n,
198
+ o,
198
199
  s,
199
- S,
200
+ B,
200
201
  b
201
202
  ]);
202
203
  return l.useLayoutEffect(() => {
@@ -223,7 +224,7 @@ const dt = l.forwardRef(
223
224
  Q === "sm" ? "h-6" : Q === "md" ? "h-[28px]" : "h-8",
224
225
  d && "pointer-events-none opacity-100 bg-disabled-surface border-stroke text-disabled-foreground hover:border-stroke",
225
226
  "cursor-pointer",
226
- ke
227
+ ge
227
228
  ),
228
229
  children: [
229
230
  /* @__PURE__ */ T("div", { className: "flex items-center gap-4 flex-1 min-w-0", children: [
@@ -237,9 +238,9 @@ const dt = l.forwardRef(
237
238
  onBlur: re,
238
239
  onClick: () => !d && R(!0),
239
240
  onKeyDown: (e) => {
240
- e.key === "Enter" && !d && (e.preventDefault(), oe()), e.key === "ArrowDown" && !p && !d && (e.preventDefault(), W.current = !0, R(!0)), e.key === "Escape" && p && (e.preventDefault(), A());
241
+ e.key === "Enter" && !d && (e.preventDefault(), ne()), e.key === "ArrowDown" && !p && !d && (e.preventDefault(), W.current = !0, R(!0)), e.key === "Escape" && p && (e.preventDefault(), A());
241
242
  },
242
- placeholder: p ? n : Z,
243
+ placeholder: p ? o : Z,
243
244
  disabled: !!d,
244
245
  "aria-label": Ke,
245
246
  "data-field": "start",
@@ -260,9 +261,9 @@ const dt = l.forwardRef(
260
261
  onBlur: re,
261
262
  onClick: () => !d && R(!0),
262
263
  onKeyDown: (e) => {
263
- e.key === "Enter" && !d && (e.preventDefault(), oe()), e.key === "ArrowDown" && !p && !d && (e.preventDefault(), W.current = !0, R(!0)), e.key === "Escape" && p && (e.preventDefault(), A());
264
+ e.key === "Enter" && !d && (e.preventDefault(), ne()), e.key === "ArrowDown" && !p && !d && (e.preventDefault(), W.current = !0, R(!0)), e.key === "Escape" && p && (e.preventDefault(), A());
264
265
  },
265
- placeholder: p ? n : Z,
266
+ placeholder: p ? o : Z,
266
267
  disabled: !!d,
267
268
  "aria-label": qe,
268
269
  "data-field": "end",
@@ -314,20 +315,20 @@ const dt = l.forwardRef(
314
315
  },
315
316
  ...We,
316
317
  children: /* @__PURE__ */ u(
317
- ot,
318
+ nt,
318
319
  {
319
320
  pickerType: "week",
320
321
  weekMode: "range",
321
- selectedWeeks: B(c),
322
+ selectedWeeks: S(c),
322
323
  footerFlashKey: we,
323
324
  footerFlashTarget: Ee,
324
325
  onWeekSelect: Se,
325
326
  month: Pe,
326
327
  onMonthChange: P,
327
- disabled: nt(de, pe),
328
+ disabled: ot(de, pe),
328
329
  startMonth: me,
329
330
  endMonth: ue,
330
- showFooter: g,
331
+ showFooter: k,
331
332
  calendarType: L,
332
333
  fiscalMode: j,
333
334
  selectionMode: K,
@@ -1,17 +1,20 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import * as i from "@radix-ui/react-popover";
3
- import { cn as r } from "../../../../lib/utils.js";
4
- function f({
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import * as a from "@radix-ui/react-popover";
3
+ import { cn as i } from "../../../../lib/utils.js";
4
+ import { useOverlayPortalContainer as m } from "../../../../lib/overlay/overlay-portal-context.js";
5
+ import { OVERLAY_NESTED_FLOATING_INSTANT_HIDE_CLASS as v } from "../../../../lib/overlay/overlay-host.constants.js";
6
+ function g({
5
7
  menuRef: n,
6
- menuMinHeight: o,
8
+ menuMinHeight: t,
7
9
  menuWidth: l,
8
- isReadOnly: a,
10
+ isReadOnly: r,
9
11
  id: d,
10
12
  menuLabel: s,
11
13
  children: p
12
14
  }) {
13
- return /* @__PURE__ */ t(i.Portal, { children: /* @__PURE__ */ t(
14
- i.Content,
15
+ const c = m();
16
+ return /* @__PURE__ */ o(a.Portal, { container: c, children: /* @__PURE__ */ o(
17
+ a.Content,
15
18
  {
16
19
  ref: n,
17
20
  side: "bottom",
@@ -27,21 +30,22 @@ function f({
27
30
  minWidth: "var(--radix-popover-trigger-width)",
28
31
  maxHeight: "min(320px, var(--radix-popover-content-available-height, 320px))"
29
32
  },
30
- className: r(
33
+ className: i(
31
34
  "z-50 flex flex-col overflow-hidden rounded-[12px] p-0 text-base shadow-elevation-select focus:outline-none sm:text-sm border-none pointer-events-auto",
32
- a ? "bg-disabled-surface" : "bg-canvas-elevated"
35
+ r ? "bg-disabled-surface" : "bg-canvas-elevated",
36
+ v
33
37
  ),
34
38
  "data-testid": `select-menu-${d || "default"}`,
35
39
  "data-component": "select-menu",
36
- children: /* @__PURE__ */ t(
40
+ children: /* @__PURE__ */ o(
37
41
  "div",
38
42
  {
39
- className: r(
43
+ className: i(
40
44
  "flex min-h-0 flex-1 flex-col overflow-hidden rounded-[12px]",
41
- a ? "bg-disabled-surface" : "bg-canvas-elevated"
45
+ r ? "bg-disabled-surface" : "bg-canvas-elevated"
42
46
  ),
43
47
  style: {
44
- minHeight: o ? `${o}px` : void 0
48
+ minHeight: t ? `${t}px` : void 0
45
49
  },
46
50
  children: p
47
51
  }
@@ -50,5 +54,5 @@ function f({
50
54
  ) });
51
55
  }
52
56
  export {
53
- f as SelectMenuPanel
57
+ g as SelectMenuPanel
54
58
  };
@@ -1,136 +1,156 @@
1
- import { jsxs as h, jsx as r } from "react/jsx-runtime";
2
- import { memo as z } from "react";
3
- import { Checkmark as E, ChevronRight as W } from "impact-nova-icons";
4
- import { cn as x } from "../../../../lib/utils.js";
5
- import { selectOptionVariants as Y } from "../select.variants.js";
6
- import { isSelected as B } from "../utils/select.js";
7
- import { LabelWithSequence as F } from "./LabelWithSequence.js";
8
- import { Submenu as G } from "./Submenu.js";
9
- function H({
1
+ import { jsxs as w, jsx as t } from "react/jsx-runtime";
2
+ import { memo as Y } from "react";
3
+ import { Checkmark as F, ChevronRight as H } from "impact-nova-icons";
4
+ import { Badge as J } from "../../../data-display/badge/badge.js";
5
+ import { cn as o } from "../../../../lib/utils.js";
6
+ import { selectOptionVariants as K } from "../select.variants.js";
7
+ import { isSelected as L } from "../utils/select.js";
8
+ import { Submenu as Q } from "./Submenu.js";
9
+ function T({
10
10
  option: e,
11
11
  virtualRow: s,
12
- measureElement: S,
13
- selectFieldId: y,
14
- id: k,
15
- isMulti: l,
16
- isReadOnly: m,
17
- enableGroups: n,
18
- enableSubMenus: t,
19
- showSequence: j,
20
- selected: a,
21
- isOptDisabled: c,
22
- indeterminate: f,
23
- selectedCount: p,
24
- isParentSelectable: g,
25
- highlighted: C,
26
- activeSubmenu: I,
27
- setActiveSubmenu: N,
28
- optionLabel: v,
29
- optionLabelString: b,
30
- sequence: V,
31
- internalValue: q,
32
- renderOption: w,
33
- onSelect: $,
12
+ measureElement: j,
13
+ selectFieldId: C,
14
+ id: v,
15
+ isMulti: f,
16
+ isReadOnly: u,
17
+ enableGroups: c,
18
+ enableSubMenus: a,
19
+ showSequence: I,
20
+ selected: r,
21
+ isOptDisabled: n,
22
+ indeterminate: h,
23
+ selectedCount: N,
24
+ isParentSelectable: $,
25
+ highlighted: z,
26
+ activeSubmenu: B,
27
+ setActiveSubmenu: y,
28
+ optionLabel: V,
29
+ optionLabelString: E,
30
+ sequence: d,
31
+ internalValue: G,
32
+ renderOption: S,
33
+ onSelect: b,
34
34
  getGroupStats: P
35
35
  }) {
36
- const u = k || "default", o = String(e.value || "");
37
- return /* @__PURE__ */ h(
36
+ const x = v || "default", p = String(e.value || ""), l = c && e.isGroup, g = a && e.isSubmenuParent, k = I && !l && !g;
37
+ return /* @__PURE__ */ w(
38
38
  "div",
39
39
  {
40
40
  "data-index": s.index,
41
- ref: S,
41
+ ref: j,
42
42
  className: "absolute start-0 w-full pb-[2px]",
43
43
  style: {
44
44
  transform: `translateY(${s.start}px)`,
45
45
  width: "100%"
46
46
  },
47
- "data-testid": `select-option-wrapper-${u}-${o}`,
47
+ "data-testid": `select-option-wrapper-${x}-${p}`,
48
48
  children: [
49
- /* @__PURE__ */ r(
49
+ /* @__PURE__ */ t(
50
50
  "div",
51
51
  {
52
- id: `${y}-option-${s.index}`,
53
- className: x(
54
- Y({
55
- disabled: c,
56
- readOnly: m,
57
- selected: a && !c && !(n && e.isGroup) && !(t && e.isSubmenuParent),
58
- highlighted: C && !c
52
+ id: `${C}-option-${s.index}`,
53
+ className: o(
54
+ K({
55
+ disabled: n,
56
+ readOnly: u,
57
+ selected: r && !n && !(c && e.isGroup) && !(a && e.isSubmenuParent),
58
+ highlighted: z && !n
59
59
  })
60
60
  ),
61
61
  style: {
62
62
  paddingInlineStart: `${e.depth * 16 + 12}px`
63
63
  },
64
64
  onClick: () => {
65
- c || (n && e.isGroup || t && e.isSubmenuParent) && !g || $(e);
65
+ n || (c && e.isGroup || a && e.isSubmenuParent) && !$ || b(e);
66
66
  },
67
67
  onMouseEnter: () => {
68
- t && e.isSubmenuParent ? N(e.value) : N(null);
68
+ a && e.isSubmenuParent ? y(e.value) : y(null);
69
69
  },
70
- "data-testid": `select-option-${u}-${o}`,
71
- "data-state": a ? "checked" : "unchecked",
72
- "data-disabled": c || void 0,
70
+ "data-testid": `select-option-${x}-${p}`,
71
+ "data-state": r ? "checked" : "unchecked",
72
+ "data-disabled": n || void 0,
73
73
  "data-component": "select-option",
74
74
  role: "option",
75
- "aria-selected": a,
76
- "aria-disabled": c || void 0,
77
- children: w ? w(
75
+ "aria-selected": r,
76
+ "aria-disabled": n || void 0,
77
+ children: S ? S(
78
78
  {
79
79
  onClick: () => {
80
80
  },
81
81
  className: "w-full",
82
- selected: a,
83
- disabled: c
82
+ selected: r,
83
+ disabled: n
84
84
  },
85
85
  e
86
- ) : /* @__PURE__ */ h("div", { className: "flex items-center flex-1 overflow-hidden", children: [
87
- l && (n && e.isGroup || t && e.isSubmenuParent ? g : !0) && /* @__PURE__ */ r(
86
+ ) : /* @__PURE__ */ w("div", { className: "flex items-center flex-1 overflow-hidden", children: [
87
+ f && (c && e.isGroup || a && e.isSubmenuParent ? $ : !0) && /* @__PURE__ */ t(
88
88
  "span",
89
89
  {
90
90
  "aria-hidden": "true",
91
- className: x(
91
+ className: o(
92
92
  "mr-[7px] flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px] border border-stroke-field bg-canvas-elevated",
93
- (a || f) && "border-brand bg-accent text-brand",
94
- (c || m) && "opacity-50"
93
+ (r || h) && "border-brand bg-accent text-brand",
94
+ (n || u) && "opacity-50"
95
95
  ),
96
- children: a && !f ? /* @__PURE__ */ r(E, { className: "h-3.5 w-3.5" }) : f ? /* @__PURE__ */ r("span", { className: "block h-0.5 w-2.5 bg-current" }) : null
96
+ children: r && !h ? /* @__PURE__ */ t(F, { className: "h-3.5 w-3.5" }) : h ? /* @__PURE__ */ t("span", { className: "block h-0.5 w-2.5 bg-current" }) : null
97
97
  }
98
98
  ),
99
- j && !(n && e.isGroup) && !(t && e.isSubmenuParent) ? /* @__PURE__ */ r(F, { label: v, sequence: V }) : /* @__PURE__ */ h("div", { className: "flex items-center gap-2 overflow-hidden w-full", children: [
100
- /* @__PURE__ */ r(
101
- "span",
102
- {
103
- className: x(
104
- "block truncate",
105
- n && e.isGroup ? "text-xs font-semibold text-content-icon uppercase tracking-wider" : a && !(t && e.isSubmenuParent) ? "font-medium" : "font-normal",
106
- !(n && e.isGroup) && "text-[14px]"
99
+ /* @__PURE__ */ w(
100
+ "div",
101
+ {
102
+ className: o(
103
+ "flex min-w-0 flex-1 items-center overflow-hidden",
104
+ k ? "justify-between gap-2" : "gap-2"
105
+ ),
106
+ children: [
107
+ /* @__PURE__ */ t(
108
+ "span",
109
+ {
110
+ className: o(
111
+ "block min-w-0 truncate",
112
+ k && "flex-1",
113
+ l ? "text-xs font-semibold text-content-icon uppercase tracking-wider" : r && !g ? "font-medium" : "font-normal",
114
+ !l && "text-[14px]"
115
+ ),
116
+ "data-testid": `select-option-label-${x}-${p}`,
117
+ "data-state": r ? "checked" : "unchecked",
118
+ title: E,
119
+ children: V
120
+ }
107
121
  ),
108
- "data-testid": `select-option-label-${u}-${o}`,
109
- "data-state": a ? "checked" : "unchecked",
110
- title: b,
111
- children: v
112
- }
113
- ),
114
- (n && e.isGroup || t && e.isSubmenuParent) && p > 0 && /* @__PURE__ */ r("span", { className: "inline-flex items-center justify-center px-1.5 py-0.5 rounded-full text-xs font-medium bg-brand-tint text-brand-on-subtle", children: p })
115
- ] }),
116
- t && e.isSubmenuParent && /* @__PURE__ */ r(W, { size: "12px", className: "text-content-icon" })
122
+ (l || g) && N > 0 && /* @__PURE__ */ t("span", { className: "inline-flex shrink-0 items-center justify-center rounded-full bg-brand-tint px-1.5 py-0.5 text-xs font-medium text-brand-on-subtle", children: N }),
123
+ k && /* @__PURE__ */ t("span", { className: "flex h-5 w-6 shrink-0 items-center justify-center", children: d !== void 0 && d > 0 ? /* @__PURE__ */ t(
124
+ J,
125
+ {
126
+ variant: "outline",
127
+ color: "primary",
128
+ size: "sm",
129
+ "data-testid": `select-option-sequence-${d}`,
130
+ children: d.toString()
131
+ }
132
+ ) : null })
133
+ ]
134
+ }
135
+ ),
136
+ a && e.isSubmenuParent && /* @__PURE__ */ t(H, { size: "12px", className: "text-content-icon" })
117
137
  ] })
118
138
  }
119
139
  ),
120
- t && I === e.value && e.isSubmenuParent && /* @__PURE__ */ r(
121
- G,
140
+ a && B === e.value && e.isSubmenuParent && /* @__PURE__ */ t(
141
+ Q,
122
142
  {
123
143
  parentOption: e,
124
- isMulti: !!l,
125
- isReadOnly: !!m,
126
- isSelected: (d) => B(d, q, !!l),
127
- getIndeterminateState: (d) => {
128
- const i = P(d);
129
- return i ? i.selected > 0 && i.selected < i.total : !1;
144
+ isMulti: !!f,
145
+ isReadOnly: !!u,
146
+ isSelected: (i) => L(i, G, !!f),
147
+ getIndeterminateState: (i) => {
148
+ const m = P(i);
149
+ return m ? m.selected > 0 && m.selected < m.total : !1;
130
150
  },
131
- getSelectedCount: (d) => P(d)?.selected || 0,
132
- handleSelect: $,
133
- id: k
151
+ getSelectedCount: (i) => P(i)?.selected || 0,
152
+ handleSelect: b,
153
+ id: v
134
154
  }
135
155
  )
136
156
  ]
@@ -138,8 +158,8 @@ function H({
138
158
  s.key
139
159
  );
140
160
  }
141
- const _ = z(H);
161
+ const O = Y(T);
142
162
  export {
143
- _ as SelectOptionRow,
144
- H as SelectOptionRowInner
163
+ O as SelectOptionRow,
164
+ T as SelectOptionRowInner
145
165
  };