impact-nova 2.4.0 → 2.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/dist/components/data/data-table/data-table-column-list.js +16 -16
  2. package/dist/components/data/data-table/data-table-sheet-layout.d.ts +26 -0
  3. package/dist/components/data/data-table/data-table-sheet-layout.js +71 -0
  4. package/dist/components/data/data-table/data-table-sheet.d.ts +2 -0
  5. package/dist/components/data/data-table/index.d.ts +1 -0
  6. package/dist/components/data/data-table/index.js +40 -34
  7. package/dist/components/data/expandable-list-item/expandable-list-item-attributes.js +2 -3
  8. package/dist/components/data/expandable-list-item/expandable-list-item-metrics.js +2 -3
  9. package/dist/components/data/nested-list/hooks/useNestedListHandlers.d.ts +3 -2
  10. package/dist/components/data/nested-list/hooks/useNestedListHandlers.js +129 -130
  11. package/dist/components/data/nested-list/hooks/useNestedListState.d.ts +2 -3
  12. package/dist/components/data/nested-list/hooks/useNestedListState.js +118 -117
  13. package/dist/components/data/nested-list/nested-list.js +219 -221
  14. package/dist/components/feedback/tooltip/tab-tooltip-render.js +2 -3
  15. package/dist/components/flows/accordion-nested-list/accordion-nested-list.js +80 -65
  16. package/dist/components/flows/command-palette/shortcut-settings.js +10 -10
  17. package/dist/components/flows/filter-panel/filter-panel.js +4 -4
  18. package/dist/components/forms/date-picker/month-picker.js +136 -109
  19. package/dist/components/forms/select/components/SelectTriggerValue.js +2 -3
  20. package/dist/components/forms/select/components/Submenu.js +2 -3
  21. package/dist/impact-nova.css +1 -1
  22. package/dist/index.js +170 -164
  23. package/dist/llms/rules/ag-grid.js +1 -1
  24. package/dist/llms/rules/installation.js +1 -1
  25. package/dist/llms/rules/real-world-patterns.js +1 -1
  26. package/dist/llms/rules/requirements.js +1 -1
  27. package/package.json +1 -1
@@ -1,103 +1,118 @@
1
- import { jsxs as d, jsx as r } from "react/jsx-runtime";
2
- import { useState as H, useCallback as u, useMemo as J } from "react";
1
+ import { jsxs as d, jsx as t } from "react/jsx-runtime";
2
+ import { useState as H, useCallback as f, useMemo as J } from "react";
3
3
  import { AccordionItem as K, AccordionTrigger as Q, AccordionContent as R, Accordion as N } from "../../primitives/accordion/accordion.js";
4
- import { Button as g } from "../../primitives/button/button.js";
4
+ import { Button as y } from "../../primitives/button/button.js";
5
5
  import { NestedList as U } from "../../data/nested-list/nested-list.js";
6
6
  import { useAccordionNestedListState as X } from "./hooks/useAccordionNestedListState.js";
7
7
  import { SelectionMode as Y } from "../../data/nested-list/nested-list.types.js";
8
8
  import { cn as Z } from "../../../lib/utils.js";
9
9
  import { useImpactNovaI18n as $ } from "../../../i18n/use-impact-nova-i18n.js";
10
- const se = ({
10
+ const ce = ({
11
11
  sections: l,
12
12
  onChange: m,
13
13
  onSubmit: h,
14
- onCancel: f,
14
+ onCancel: u,
15
15
  enableApplyDiscard: C = !0,
16
- submitButtonLabel: L,
17
- cancelButtonLabel: S,
18
- className: x = "",
19
- enableSearch: B = !0,
20
- enableDragDrop: k = !0,
21
- enableSelectAll: D = !0,
22
- selectionMode: I = Y.CASCADE_DOWN,
23
- searchPlaceholder: V,
24
- value: j,
25
- onValueChange: P,
26
- isMultiExpanded: n = !0,
27
- defaultCollapseAll: w = !1,
28
- validateApply: s
16
+ submitButtonLabel: g,
17
+ cancelButtonLabel: L,
18
+ className: S = "",
19
+ enableSearch: k = !0,
20
+ enableDragDrop: w = !0,
21
+ enableSelectAll: B = !0,
22
+ selectionMode: D = Y.CASCADE_DOWN,
23
+ searchPlaceholder: I,
24
+ value: V,
25
+ onValueChange: j,
26
+ isMultiExpanded: r = !0,
27
+ defaultCollapseAll: P = !1,
28
+ validateApply: c
29
29
  }) => {
30
- const { t: i } = $(), M = L ?? i("nestedList.apply"), O = S ?? i("nestedList.reset"), T = V ?? i("nestedList.searchPlaceholder"), {
31
- currentSections: a,
32
- hasChanges: c,
30
+ const { t: i } = $(), M = g ?? i("nestedList.apply"), O = L ?? i("nestedList.reset"), T = I ?? i("nestedList.searchPlaceholder"), {
31
+ currentSections: n,
32
+ hasChanges: o,
33
33
  setCurrentSection: p,
34
- saveAllSections: A,
35
- discardAllSections: b
36
- } = X({ sections: l }), [W, _] = H(() => w ? n ? [] : "" : l.length > 0 ? n ? [l[0].id] : l[0].id : n ? [] : ""), t = j ?? W, v = P ?? _, q = u(
37
- (e, o) => {
38
- p(e, o), m?.(e, o);
34
+ saveAllSections: x,
35
+ discardAllSections: v
36
+ } = X({ sections: l }), [W, _] = H(() => P ? r ? [] : "" : l.length > 0 ? r ? [l[0].id] : l[0].id : r ? [] : ""), a = V ?? W, b = j ?? _, q = f(
37
+ (e, s) => {
38
+ p(e, s), m?.(e, s);
39
39
  },
40
40
  [m, p]
41
- ), z = u(() => {
42
- A(), h?.(a);
43
- }, [a, h, A]), F = u(() => {
44
- b(), f?.();
45
- }, [b, f]), G = J(() => c ? s ? s(a) : !0 : !1, [c, s, a]), y = l.map((e) => /* @__PURE__ */ d(K, { value: e.id, children: [
46
- /* @__PURE__ */ r(Q, { children: e.label }),
47
- /* @__PURE__ */ r(R, { className: "min-h-0 h-full", children: /* @__PURE__ */ r("div", { className: "h-full min-h-0 pb-2", children: /* @__PURE__ */ r(
48
- U,
49
- {
50
- items: a[e.id] || [],
51
- onChange: (o) => q(e.id, o),
52
- enableApplyDiscard: !1,
53
- enableSearch: B,
54
- enableDragDrop: k,
55
- enableSelectAll: D,
56
- selectionMode: e.selectionMode ?? I,
57
- searchPlaceholder: T,
58
- className: "h-full"
59
- }
60
- ) }) })
61
- ] }, e.id));
41
+ ), z = f(() => {
42
+ x(), h?.(n);
43
+ }, [n, h, x]), F = f(() => {
44
+ v(), u?.();
45
+ }, [v, u]), G = J(() => o ? c ? c(n) : !0 : !1, [o, c, n]), A = l.map((e) => /* @__PURE__ */ d(
46
+ K,
47
+ {
48
+ value: e.id,
49
+ className: "flex flex-col border-b-0 data-[state=open]:flex-1 data-[state=open]:min-h-0",
50
+ children: [
51
+ /* @__PURE__ */ t(Q, { className: "shrink-0", children: e.label }),
52
+ /* @__PURE__ */ t(
53
+ R,
54
+ {
55
+ className: "flex min-h-0 flex-1 flex-col px-0 pb-2 pt-0",
56
+ surfaceClassName: "overflow-hidden data-[state=open]:flex data-[state=open]:flex-1 data-[state=open]:min-h-0 data-[state=open]:flex-col data-[state=open]:overflow-hidden data-[state=open]:h-full data-[state=open]:animate-none",
57
+ children: /* @__PURE__ */ t(
58
+ U,
59
+ {
60
+ items: n[e.id] || [],
61
+ onChange: (s) => q(e.id, s),
62
+ enableApplyDiscard: !1,
63
+ enableSearch: k,
64
+ enableDragDrop: w,
65
+ enableSelectAll: B,
66
+ selectionMode: e.selectionMode ?? D,
67
+ searchPlaceholder: T,
68
+ className: "flex-1 min-h-0"
69
+ }
70
+ )
71
+ }
72
+ )
73
+ ]
74
+ },
75
+ e.id
76
+ ));
62
77
  return /* @__PURE__ */ d(
63
78
  "div",
64
79
  {
65
- className: Z("flex flex-col h-full", x),
80
+ className: Z("flex min-h-0 flex-col", S),
66
81
  "data-component": "accordion-nested-list",
67
- "data-has-changes": c ? "" : void 0,
82
+ "data-has-changes": o ? "" : void 0,
68
83
  children: [
69
- /* @__PURE__ */ r("div", { className: "flex-1 min-h-0 overflow-y-auto", children: n ? /* @__PURE__ */ r(
84
+ /* @__PURE__ */ t("div", { className: "flex min-h-0 flex-1 flex-col overflow-hidden", children: r ? /* @__PURE__ */ t(
70
85
  N,
71
86
  {
72
87
  type: "multiple",
73
- value: Array.isArray(t) ? t : t ? [t] : [],
74
- onValueChange: v,
75
- className: "space-y-4",
76
- children: y
88
+ value: Array.isArray(a) ? a : a ? [a] : [],
89
+ onValueChange: b,
90
+ className: "flex min-h-0 flex-1 flex-col overflow-hidden space-y-4",
91
+ children: A
77
92
  }
78
- ) : /* @__PURE__ */ r(
93
+ ) : /* @__PURE__ */ t(
79
94
  N,
80
95
  {
81
96
  type: "single",
82
97
  collapsible: !0,
83
- value: Array.isArray(t) ? t[0] ?? "" : t,
84
- onValueChange: v,
85
- className: "space-y-4",
86
- children: y
98
+ value: Array.isArray(a) ? a[0] ?? "" : a,
99
+ onValueChange: b,
100
+ className: "flex min-h-0 flex-1 flex-col overflow-hidden space-y-4",
101
+ children: A
87
102
  }
88
103
  ) }),
89
104
  C && /* @__PURE__ */ d("div", { className: "flex-shrink-0 flex justify-end gap-2 pt-4 border-t mt-4", children: [
90
- /* @__PURE__ */ r(
91
- g,
105
+ /* @__PURE__ */ t(
106
+ y,
92
107
  {
93
108
  variant: "tertiary",
94
109
  onClick: F,
95
- disabled: !c,
110
+ disabled: !o,
96
111
  children: O
97
112
  }
98
113
  ),
99
- /* @__PURE__ */ r(
100
- g,
114
+ /* @__PURE__ */ t(
115
+ y,
101
116
  {
102
117
  variant: "default",
103
118
  onClick: z,
@@ -111,5 +126,5 @@ const se = ({
111
126
  );
112
127
  };
113
128
  export {
114
- se as AccordionNestedList
129
+ ce as AccordionNestedList
115
130
  };
@@ -2,17 +2,17 @@ import { jsx as r, jsxs as h, Fragment as z } from "react/jsx-runtime";
2
2
  import * as o from "react";
3
3
  import { Person as G, Monitor as U, PriorityAlert as q, Locked as O, Reset as B } from "impact-nova-icons";
4
4
  import { cn as p } from "../../../lib/utils.js";
5
- import { Kbd as $ } from "../../primitives/kbd/kbd.js";
6
- import { keybindingToString as H } from "../../primitives/kbd/keybinding-display.js";
7
5
  import { OverflowTooltip as A } from "../../feedback/tooltip/overflow-tooltip.js";
8
- import { ModuleRegistry as V, AllCommunityModule as J } from "ag-grid-community";
9
- import { AllEnterpriseModule as Q } from "ag-grid-enterprise";
10
- import { DataTable as X, DataTableContent as Y } from "../../data/data-table/data-table.js";
6
+ import { ModuleRegistry as $, AllCommunityModule as H } from "ag-grid-community";
7
+ import { AllEnterpriseModule as V } from "ag-grid-enterprise";
8
+ import { DataTable as J, DataTableContent as Q } from "../../data/data-table/data-table.js";
11
9
  import { AG_CELL_NO_PADDING as F } from "../../data/ag-grid-react/cell-renderers/index.js";
10
+ import { Kbd as X } from "../../primitives/kbd/kbd.js";
11
+ import { keybindingToString as Y } from "../../primitives/kbd/keybinding-display.js";
12
12
  import { useCommandPalette as Z } from "./use-command-palette.js";
13
13
  import { COMMAND_SOURCE_LABELS as m, keybindingFromEvent as W, isReservedShortcut as ee } from "./utils.js";
14
14
  import { BadgeCellRenderer as te } from "../../data/ag-grid-react/cell-renderers/badge-cell-renderer.js";
15
- V.registerModules([J, Q]);
15
+ $.registerModules([H, V]);
16
16
  function re(a) {
17
17
  const t = a.data;
18
18
  return t ? /* @__PURE__ */ h("div", { className: "flex items-center gap-2 min-w-0 h-full", children: [
@@ -69,7 +69,7 @@ function ne(a) {
69
69
  "flex items-center justify-end h-full w-full text-end",
70
70
  t.customisable ? "cursor-pointer" : "cursor-default opacity-70"
71
71
  ),
72
- children: /* @__PURE__ */ r($, { keybinding: t.keybinding, size: "sm" })
72
+ children: /* @__PURE__ */ r(X, { keybinding: t.keybinding, size: "sm" })
73
73
  }
74
74
  ) : t.customisable ? /* @__PURE__ */ r(
75
75
  "button",
@@ -133,7 +133,7 @@ function le({
133
133
  description: e.description || "",
134
134
  category: e.category || "General",
135
135
  keybinding: i,
136
- keybindingDisplay: i ? H(i) : "",
136
+ keybindingDisplay: i ? Y(i) : "",
137
137
  scope: e.scope,
138
138
  source: D,
139
139
  sourceColor: T ? "primary" : "neutral",
@@ -278,10 +278,10 @@ function le({
278
278
  u?.type === "conflict" ? /* @__PURE__ */ r(q, { className: "h-3.5 w-3.5 shrink-0" }) : u?.type === "reserved" ? /* @__PURE__ */ r(O, { className: "h-3.5 w-3.5 shrink-0" }) : c ? /* @__PURE__ */ r("span", { className: "shrink-0 text-base", children: "⌨️" }) : null,
279
279
  /* @__PURE__ */ r("span", { children: u ? u.text : L })
280
280
  ] }) : null;
281
- return /* @__PURE__ */ h(X, { className: p("flex flex-col w-full h-full border-t-0", a), children: [
281
+ return /* @__PURE__ */ h(J, { className: p("flex flex-col w-full h-full border-t-0", a), children: [
282
282
  s ? s(E) : E,
283
283
  /* @__PURE__ */ r(
284
- Y,
284
+ Q,
285
285
  {
286
286
  rowData: y,
287
287
  columnDefs: I,
@@ -6,8 +6,8 @@ import { cn as o } from "../../../lib/utils.js";
6
6
  import { MultiColorFilter as F, Cross as P, InfoBadge as u } from "impact-nova-icons";
7
7
  import { Button as D } from "../../primitives/button/button.js";
8
8
  import { Tooltip as c, TooltipTrigger as f, TooltipContent as h } from "../../feedback/tooltip/tooltip.js";
9
- import { Kbd as S } from "../../primitives/kbd/kbd.js";
10
- import { OverflowTooltip as j } from "../../feedback/tooltip/overflow-tooltip.js";
9
+ import { OverflowTooltip as S } from "../../feedback/tooltip/overflow-tooltip.js";
10
+ import { Kbd as j } from "../../primitives/kbd/kbd.js";
11
11
  import { useImpactNovaI18n as v } from "../../../i18n/use-impact-nova-i18n.js";
12
12
  import { useOverlayHostDismissNestedLayersOnNavigation as I } from "../../../lib/overlay/overlay-portal-context.js";
13
13
  import { preventDismissOnTooltipOutside as x } from "../../../lib/overlay/prevent-dismiss-on-tooltip-outside.js";
@@ -145,14 +145,14 @@ const O = ({
145
145
  ),
146
146
  /* @__PURE__ */ a("div", { className: "flex items-center gap-1 min-w-0", children: [
147
147
  /* @__PURE__ */ e(
148
- j,
148
+ S,
149
149
  {
150
150
  triggerClassName: "truncate font-['Manrope'] block min-w-0",
151
151
  content: t.tooltipKeybinding ? /* @__PURE__ */ a("span", { className: "flex items-center gap-2", children: [
152
152
  t.label,
153
153
  " ",
154
154
  /* @__PURE__ */ e(
155
- S,
155
+ j,
156
156
  {
157
157
  keybinding: t.tooltipKeybinding,
158
158
  size: "sm"
@@ -1,189 +1,216 @@
1
- import { jsxs as k, jsx as s } from "react/jsx-runtime";
1
+ import { jsxs as P, jsx as s } from "react/jsx-runtime";
2
2
  import * as o from "react";
3
- import { Cross as _, CalendarMonth as ee } from "impact-nova-icons";
4
- import { cn as te } from "../../../lib/utils.js";
5
- import { usePickerDismissActionsRef as ne, usePickerFooterDismissNudge as re, isDateInputInvalid as oe, resolveSingleValueDismissFlash as se, compareMonthSelection as ie, handlePickerSurfacePointerDown as ae, resolveDateInputOnBlur as ce, maskDateInput as le, parseDateInput as pe, resolveDateInputOnEnter as fe } from "./date-input-behavior.js";
6
- import { Input as de } from "../input/input.js";
7
- import { Popover as ue, PopoverAnchor as me, PopoverContent as he } from "../../feedback/popover/popover.js";
8
- import { Calendar as ye } from "../../data-display/calendar/calendar.js";
9
- import { Tooltip as w, TooltipTrigger as E, TooltipContent as V } from "../../feedback/tooltip/tooltip.js";
10
- import { useImpactNovaI18n as Me } from "../../../i18n/use-impact-nova-i18n.js";
11
- import { coerceSingleMonthApply as De, coerceSingleMonth as ge } from "./calendar-selection-adapters.js";
12
- import { buildDateBoundsMatcher as ke } from "../../../lib/date-bounds-matcher.js";
13
- const m = (t) => `${(t.month + 1).toString().padStart(2, "0")}/${t.year}`, Ie = o.forwardRef(
3
+ import { Cross as ne, CalendarMonth as re } from "impact-nova-icons";
4
+ import { cn as oe } from "../../../lib/utils.js";
5
+ import { usePickerDismissActionsRef as se, usePickerFooterDismissNudge as ie, isDateInputInvalid as ae, resolveSingleValueDismissFlash as ce, compareMonthSelection as le, handlePickerSurfacePointerDown as pe, maskDateInput as fe, parseDateInput as ue, resolveDateInputOnEnter as de, resolveDateInputOnBlur as me } from "./date-input-behavior.js";
6
+ import { Input as he } from "../input/input.js";
7
+ import { Popover as ye, PopoverAnchor as ge, PopoverContent as Me } from "../../feedback/popover/popover.js";
8
+ import { Calendar as De } from "../../data-display/calendar/calendar.js";
9
+ import { Tooltip as T, TooltipTrigger as O, TooltipContent as V } from "../../feedback/tooltip/tooltip.js";
10
+ import { useImpactNovaI18n as ke } from "../../../i18n/use-impact-nova-i18n.js";
11
+ import { coerceSingleMonthApply as Pe, coerceSingleMonth as Ie } from "./calendar-selection-adapters.js";
12
+ import { buildDateBoundsMatcher as Ce } from "../../../lib/date-bounds-matcher.js";
13
+ const h = (t) => `${(t.month + 1).toString().padStart(2, "0")}/${t.year}`, Se = o.forwardRef(
14
14
  ({
15
15
  value: t,
16
16
  onChange: p,
17
- placeholder: v,
18
- minDate: b,
19
- maxDate: O,
20
- startMonth: B,
21
- endMonth: F,
22
- showFooter: i = !0,
23
- disabled: f,
17
+ placeholder: B,
18
+ minDate: F,
19
+ maxDate: j,
20
+ startMonth: v,
21
+ endMonth: K,
22
+ showFooter: c = !0,
23
+ disabled: i,
24
24
  className: Y,
25
- ...j
26
- }, K) => {
27
- const { t: d } = Me(), z = v ?? d("datePicker.selectMonth"), I = o.useRef(null), C = o.useRef(null);
28
- o.useImperativeHandle(K, () => I.current);
29
- const [r, a] = o.useState(!1), R = ne(), { footerFlashKey: H, footerFlashTarget: $, popoverHandlers: L } = re(i, r, R, C), [y, c] = o.useState(t), [u, l] = o.useState(t ? m(t) : ""), [q, P] = o.useState(t ? new Date(t.year, t.month) : /* @__PURE__ */ new Date());
25
+ onBlur: z,
26
+ ...H
27
+ }, $) => {
28
+ const { t: u } = ke(), L = B ?? u("datePicker.selectMonth"), I = o.useRef(null), x = o.useRef(null);
29
+ o.useImperativeHandle($, () => I.current);
30
+ const [r, R] = o.useState(!1), f = o.useCallback(() => {
31
+ R(!1);
32
+ }, []), d = (e) => {
33
+ if (!i) {
34
+ if (e) {
35
+ R(!0);
36
+ return;
37
+ }
38
+ f();
39
+ }
40
+ }, b = se(), { footerFlashKey: q, footerFlashTarget: G, popoverHandlers: J } = ie(c, r, b, x), [M, a] = o.useState(t), [m, l] = o.useState(t ? h(t) : ""), [Q, C] = o.useState(t ? new Date(t.year, t.month) : /* @__PURE__ */ new Date());
30
41
  o.useEffect(() => {
31
- r || (l(t ? m(t) : ""), c(t));
42
+ r || (l(t ? h(t) : ""), a(t));
32
43
  }, [r, t]), o.useEffect(() => {
33
- r && (c(t), P(t ? new Date(t.year, t.month) : /* @__PURE__ */ new Date()), l(t ? m(t) : ""));
44
+ r && (a(t), C(t ? new Date(t.year, t.month) : /* @__PURE__ */ new Date()), l(t ? h(t) : ""));
34
45
  }, [r, t]);
35
- const G = (e) => {
36
- const n = ge(e);
37
- c(n), n && l(m(n)), i || (p?.(n), a(!1));
38
- }, x = (e) => {
39
- const n = De(e, y);
40
- p?.(n), a(!1);
46
+ const U = (e) => {
47
+ const n = Ie(e);
48
+ a(n), n && l(h(n)), c || (p?.(n), f());
49
+ }, w = (e) => {
50
+ const n = Pe(e, M);
51
+ p?.(n), f();
41
52
  }, S = () => {
42
- c(t), l(t ? m(t) : ""), a(!1);
43
- }, A = () => {
44
- c(void 0), l(""), p?.(void 0), i || a(!1);
45
- }, h = "MM/yyyy", M = t ? m(t) : "", D = o.useRef(!1), J = (e) => {
46
- const n = le(e.target.value, h, u);
53
+ a(t), l(t ? h(t) : ""), f();
54
+ }, N = () => {
55
+ a(void 0), l(""), p?.(void 0), c || f();
56
+ }, y = "MM/yyyy", D = t ? h(t) : "", g = o.useRef(!1), W = (e) => {
57
+ const n = fe(e.target.value, y, m);
47
58
  if (l(n), n === "") {
48
- c(void 0), i || p?.(void 0);
59
+ a(void 0), c || p?.(void 0);
49
60
  return;
50
61
  }
51
- const { parsed: g, isValid: Z } = pe(n, h);
52
- if (Z && g) {
53
- const T = { month: g.getMonth(), year: g.getFullYear() };
54
- c(T), P(g), i || p?.(T);
62
+ const { parsed: k, isValid: te } = ue(n, y);
63
+ if (te && k) {
64
+ const E = { month: k.getMonth(), year: k.getFullYear() };
65
+ a(E), C(k), c || p?.(E);
55
66
  }
56
- }, Q = () => {
67
+ }, X = () => {
57
68
  if (r) return;
58
- const e = ce(u, h, M);
69
+ const e = me(m, y, D);
59
70
  if (e.resetToCommitted) {
60
- l(M), c(t);
71
+ l(D), a(t);
61
72
  return;
62
73
  }
63
74
  if (e.parsed) {
64
75
  const n = { month: e.parsed.getMonth(), year: e.parsed.getFullYear() };
65
- l(e.display), c(n), i || p?.(n);
76
+ l(e.display), a(n), c || p?.(n);
66
77
  return;
67
78
  }
68
- l(M), c(t);
69
- }, U = () => {
70
- if (r && i) {
71
- x();
79
+ l(D), a(t);
80
+ }, Z = () => {
81
+ if (r && c) {
82
+ w();
72
83
  return;
73
84
  }
74
- const e = fe(u, h);
85
+ const e = de(m, y);
75
86
  if (e.parsed) {
76
87
  const n = {
77
88
  month: e.parsed.getMonth(),
78
89
  year: e.parsed.getFullYear()
79
90
  };
80
- i && (p?.(n), a(!1));
91
+ c && (p?.(n), f());
81
92
  return;
82
93
  }
83
- r || (D.current = !0, a(!0));
84
- }, N = M !== u, W = oe(u, h), X = o.useCallback(
85
- () => se(
86
- y,
94
+ r || (g.current = !0, d(!0));
95
+ }, A = D !== m, _ = ae(m, y), ee = o.useCallback(
96
+ () => ce(
97
+ M,
87
98
  t,
88
- (e, n) => ie(e, n) === 0
99
+ (e, n) => le(e, n) === 0
89
100
  ),
90
- [y, t]
101
+ [M, t]
91
102
  );
92
103
  return o.useLayoutEffect(() => {
93
- R.current = {
104
+ b.current = {
94
105
  onDismiss: S,
95
- resolveFlash: X
106
+ resolveFlash: ee
96
107
  };
97
- }), /* @__PURE__ */ k(ue, { open: f ? !1 : r, onOpenChange: (e) => {
98
- f || !e && i || a(e);
99
- }, children: [
100
- /* @__PURE__ */ s(me, { asChild: !0, children: /* @__PURE__ */ s(
108
+ }), /* @__PURE__ */ P(ye, { open: i ? !1 : r, onOpenChange: d, children: [
109
+ /* @__PURE__ */ s(ge, { asChild: !0, children: /* @__PURE__ */ s(
101
110
  "div",
102
111
  {
103
- ref: C,
112
+ ref: x,
104
113
  "data-component": "month-picker",
105
114
  "data-state": r ? "open" : "closed",
106
- "data-pending": N || void 0,
107
- onPointerDown: (e) => ae({
108
- disabled: f,
115
+ "data-pending": A || void 0,
116
+ onPointerDown: (e) => pe({
117
+ disabled: i,
109
118
  event: e,
110
- onOpen: () => a(!0),
119
+ onOpen: () => d(!0),
111
120
  focusField: () => I.current?.focus()
112
121
  }),
113
122
  children: /* @__PURE__ */ s(
114
- de,
123
+ he,
115
124
  {
116
125
  ref: I,
117
- value: u,
118
- onChange: J,
119
- onBlur: Q,
120
- onClick: () => !f && a(!0),
126
+ value: m,
127
+ onChange: W,
128
+ onBlur: (e) => {
129
+ X(), z?.(e);
130
+ },
131
+ onClick: () => !i && d(!0),
121
132
  onKeyDown: (e) => {
122
- e.key === "Enter" && !f && (e.preventDefault(), U()), e.key === "ArrowDown" && !r && !f && (e.preventDefault(), D.current = !0, a(!0)), e.key === "Escape" && r && (e.preventDefault(), S());
133
+ e.key === "Enter" && !i && (e.preventDefault(), Z()), e.key === "ArrowDown" && !r && !i && (e.preventDefault(), g.current = !0, d(!0)), e.key === "Escape" && r && (e.preventDefault(), S());
123
134
  },
124
- placeholder: r ? d("datePicker.monthYearFormat") : z,
125
- disabled: f,
135
+ placeholder: r ? u("datePicker.monthYearFormat") : L,
136
+ disabled: i,
126
137
  "data-form-control": "input",
127
- className: te(
138
+ className: oe(
128
139
  "cursor-pointer",
129
- W ? "text-destructive" : N ? "text-content-placeholder" : "",
140
+ _ ? "text-destructive" : A ? "text-content-placeholder" : "",
130
141
  Y
131
142
  ),
132
- suffix: /* @__PURE__ */ k("div", { className: "flex items-center gap-1", children: [
133
- t && !f && /* @__PURE__ */ k(w, { children: [
134
- /* @__PURE__ */ s(E, { asChild: !0, children: /* @__PURE__ */ s(
143
+ suffix: /* @__PURE__ */ P("div", { className: "flex items-center gap-1", children: [
144
+ t && !i && /* @__PURE__ */ P(T, { children: [
145
+ /* @__PURE__ */ s(O, { asChild: !0, children: /* @__PURE__ */ s(
135
146
  "button",
136
147
  {
137
148
  type: "button",
138
149
  tabIndex: 0,
139
- "aria-label": d("calendar.clear"),
150
+ "aria-label": u("calendar.clear"),
140
151
  onClick: (e) => {
141
- e.stopPropagation(), A();
152
+ e.stopPropagation(), N();
142
153
  },
143
154
  className: "inline-flex size-4 items-center justify-center bg-transparent border-none p-0 cursor-pointer",
144
- children: /* @__PURE__ */ s(_, { className: "size-3 hover:text-content" })
155
+ children: /* @__PURE__ */ s(ne, { className: "size-3 hover:text-content" })
145
156
  }
146
157
  ) }),
147
- /* @__PURE__ */ s(V, { variant: "tertiary", side: "top", children: d("calendar.clear") })
158
+ /* @__PURE__ */ s(V, { variant: "tertiary", side: "top", children: u("calendar.clear") })
148
159
  ] }),
149
- /* @__PURE__ */ k(w, { children: [
150
- /* @__PURE__ */ s(E, { asChild: !0, children: /* @__PURE__ */ s(ee, { className: "h-4 w-4 text-secondary-foreground" }) }),
151
- /* @__PURE__ */ s(V, { variant: "tertiary", side: "top", children: d("datePicker.selectMonth") })
160
+ /* @__PURE__ */ P(T, { children: [
161
+ /* @__PURE__ */ s(O, { asChild: !0, children: /* @__PURE__ */ s(
162
+ "button",
163
+ {
164
+ type: "button",
165
+ tabIndex: 0,
166
+ "data-component": "calendar-trigger",
167
+ "aria-label": u("datePicker.selectMonth"),
168
+ onClick: (e) => {
169
+ e.stopPropagation(), i || (r ? f() : d(!0));
170
+ },
171
+ onKeyDown: (e) => {
172
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), i || (g.current = !0, r ? f() : d(!0)));
173
+ },
174
+ className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer",
175
+ children: /* @__PURE__ */ s(re, { className: "h-4 w-4 text-secondary-foreground" })
176
+ }
177
+ ) }),
178
+ /* @__PURE__ */ s(V, { variant: "tertiary", side: "top", children: u("datePicker.selectMonth") })
152
179
  ] })
153
180
  ] }),
154
- ...j
181
+ ...H
155
182
  }
156
183
  )
157
184
  }
158
185
  ) }),
159
186
  /* @__PURE__ */ s(
160
- he,
187
+ Me,
161
188
  {
162
189
  className: "w-auto p-0",
163
190
  align: "start",
164
- "aria-label": d("datePicker.selectMonth"),
191
+ "aria-label": u("datePicker.selectMonth"),
165
192
  onOpenAutoFocus: (e) => {
166
- D.current || e.preventDefault(), D.current = !1;
193
+ g.current || e.preventDefault(), g.current = !1;
167
194
  },
168
- ...L,
195
+ ...J,
169
196
  children: /* @__PURE__ */ s(
170
- ye,
197
+ De,
171
198
  {
172
199
  pickerType: "month",
173
200
  monthMode: "single",
174
- selectedMonths: y,
175
- footerFlashKey: H,
176
- footerFlashTarget: $,
177
- onMonthSelect: G,
178
- month: q,
179
- onMonthChange: P,
180
- disabled: ke(b, O),
181
- startMonth: B,
182
- endMonth: F,
183
- showFooter: i,
184
- onApply: x,
201
+ selectedMonths: M,
202
+ footerFlashKey: q,
203
+ footerFlashTarget: G,
204
+ onMonthSelect: U,
205
+ month: Q,
206
+ onMonthChange: C,
207
+ disabled: Ce(F, j),
208
+ startMonth: v,
209
+ endMonth: K,
210
+ showFooter: c,
211
+ onApply: w,
185
212
  onCancel: S,
186
- onClear: A
213
+ onClear: N
187
214
  }
188
215
  )
189
216
  }
@@ -191,7 +218,7 @@ const m = (t) => `${(t.month + 1).toString().padStart(2, "0")}/${t.year}`, Ie =
191
218
  ] });
192
219
  }
193
220
  );
194
- Ie.displayName = "MonthPicker";
221
+ Se.displayName = "MonthPicker";
195
222
  export {
196
- Ie as MonthPicker
223
+ Se as MonthPicker
197
224
  };
@@ -1,9 +1,8 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
2
  import { cn as x } from "../../../../lib/utils.js";
3
- import "react";
4
3
  import { OverflowTooltip as m } from "../../../feedback/tooltip/overflow-tooltip.js";
5
4
  import { isInvertedSelection as h, isOptionArray as d } from "../utils/select.js";
6
- function C({
5
+ function w({
7
6
  isMulti: u,
8
7
  isDisabled: p,
9
8
  internalValue: o,
@@ -53,5 +52,5 @@ function C({
53
52
  );
54
53
  }
55
54
  export {
56
- C as SelectTriggerValue
55
+ w as SelectTriggerValue
57
56
  };