impact-nova 2.1.0-alpha.9 → 2.2.0

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 (72) hide show
  1. package/dist/components/data/ag-grid-react/cell-renderers/editors/split-cell-editor.js +73 -94
  2. package/dist/components/data/ag-grid-react/cell-renderers/editors/split-cell-focus.d.ts +53 -0
  3. package/dist/components/data/ag-grid-react/cell-renderers/editors/split-cell-focus.js +98 -0
  4. package/dist/components/data/ag-grid-react/headers/column-menu/column-settings-menu.js +15 -13
  5. package/dist/components/data/ag-grid-react/headers/custom-header.js +56 -58
  6. package/dist/components/data/ag-grid-react/headers/custom-inner-header-group.d.ts +12 -0
  7. package/dist/components/data/ag-grid-react/headers/custom-inner-header-group.js +31 -0
  8. package/dist/components/data/ag-grid-react/headers/header-search-active-state.d.ts +10 -0
  9. package/dist/components/data/ag-grid-react/headers/header-search-active-state.js +38 -0
  10. package/dist/components/data/ag-grid-react/index.js +166 -163
  11. package/dist/components/data/ag-grid-react/notify-column-indicator-sync.d.ts +3 -4
  12. package/dist/components/data/ag-grid-react/theme.js +0 -2
  13. package/dist/components/data/data-table/data-table-column-list.js +1 -1
  14. package/dist/components/data/data-table/data-table-saved-views.js +1 -1
  15. package/dist/components/data/nested-list/components/SortableItem.d.ts +3 -1
  16. package/dist/components/data/nested-list/components/SortableItem.js +111 -109
  17. package/dist/components/data-display/calendar/calendar-footer-emphasis.d.ts +28 -0
  18. package/dist/components/data-display/calendar/calendar-footer-emphasis.js +8 -0
  19. package/dist/components/data-display/calendar/calendar-footer.d.ts +4 -1
  20. package/dist/components/data-display/calendar/calendar-footer.js +60 -38
  21. package/dist/components/data-display/calendar/calendar.js +86 -82
  22. package/dist/components/data-display/calendar/calendar.types.d.ts +2 -0
  23. package/dist/components/data-display/calendar/use-calendar-state.d.ts +3 -0
  24. package/dist/components/flows/filter-strip/filter-strip.js +36 -29
  25. package/dist/components/flows/filter-strip/filter-summary.js +2 -2
  26. package/dist/components/forms/date-picker/date-input-behavior.d.ts +118 -0
  27. package/dist/components/forms/date-picker/date-input-behavior.js +164 -0
  28. package/dist/components/forms/date-picker/date-picker.js +202 -138
  29. package/dist/components/forms/date-picker/date-range-picker.js +302 -215
  30. package/dist/components/forms/date-picker/month-picker.js +160 -119
  31. package/dist/components/forms/date-picker/month-range-picker.js +302 -245
  32. package/dist/components/forms/date-picker/multi-date-picker.js +94 -80
  33. package/dist/components/forms/date-picker/multi-month-picker.js +97 -83
  34. package/dist/components/forms/date-picker/multi-week-picker.js +107 -93
  35. package/dist/components/forms/date-picker/week-picker.js +230 -140
  36. package/dist/components/forms/date-picker/week-range-picker.js +332 -226
  37. package/dist/components/forms/file-upload/file-upload.js +312 -174
  38. package/dist/components/forms/file-upload/file-upload.types.d.ts +17 -2
  39. package/dist/components/layout/dynamic-layout/dynamic-layout.variants.d.ts +1 -1
  40. package/dist/components/layout/header/header.js +45 -38
  41. package/dist/components/layout/horizontal-scroller/index.d.ts +1 -0
  42. package/dist/components/layout/horizontal-scroller/index.js +3 -2
  43. package/dist/components/ui/local-raster-icons/assets/excel-error-icon.webp.js +4 -0
  44. package/dist/components/ui/local-raster-icons/assets/file-upload-error.webp.js +4 -0
  45. package/dist/components/ui/local-raster-icons/rasterIcons.d.ts +2 -0
  46. package/dist/components/ui/local-raster-icons/rasterIcons.js +32 -22
  47. package/dist/components/ui/show.d.ts +10 -0
  48. package/dist/components/ui/show.js +7 -0
  49. package/dist/components/ui/show.types.d.ts +5 -0
  50. package/dist/i18n/defaultMessages.d.ts +17 -0
  51. package/dist/i18n/defaultMessages.js +29 -17
  52. package/dist/i18n/index.d.ts +1 -1
  53. package/dist/i18n/locales/de.js +12 -0
  54. package/dist/i18n/locales/es.js +12 -0
  55. package/dist/i18n/locales/hi.js +12 -0
  56. package/dist/i18n/locales/kn.js +12 -0
  57. package/dist/impact-nova-base.scss +6 -2
  58. package/dist/impact-nova-components.css +141 -16
  59. package/dist/impact-nova-tokens.scss +12 -0
  60. package/dist/impact-nova.css +1 -1
  61. package/dist/index.d.ts +2 -0
  62. package/dist/index.js +273 -271
  63. package/dist/lib/utils.js +40 -24
  64. package/dist/llms/rules/ag-grid.js +1 -1
  65. package/dist/llms/rules/installation.js +1 -1
  66. package/dist/llms/rules/requirements.js +1 -1
  67. package/dist/tailwind.config.js +36 -4
  68. package/dist/theme/tailwind-colors.js +3 -1
  69. package/package.json +11 -3
  70. package/tailwind.config.d.ts +3 -0
  71. package/dist/components/data/ag-grid-react/headers/custom-header-group.d.ts +0 -10
  72. package/dist/components/data/ag-grid-react/headers/custom-header-group.js +0 -58
@@ -0,0 +1,164 @@
1
+ import { parse as g, isValid as h } from "date-fns";
2
+ import * as u from "react";
3
+ import { resolveRangeFooterFlashTarget as D } from "../../data-display/calendar/calendar-footer-emphasis.js";
4
+ import { padValidDateString as v, maskDate as y } from "../../../lib/utils.js";
5
+ function w(e, t, n) {
6
+ return y(e, t, n);
7
+ }
8
+ function f(e, t, n) {
9
+ const r = v(e, t), s = g(r, t, /* @__PURE__ */ new Date(), n ? { locale: n } : {}), i = h(s) && r.length === t.length;
10
+ return {
11
+ padded: r,
12
+ parsed: i ? s : void 0,
13
+ isComplete: e.length === t.length,
14
+ isValid: i
15
+ };
16
+ }
17
+ function C(e, t, n) {
18
+ return !e || e.length !== t.length ? !1 : !f(e, t, n).isValid;
19
+ }
20
+ function p(e, t) {
21
+ const n = document.activeElement;
22
+ return n instanceof Node ? !!(e.current?.contains(n) || t.current?.contains(n)) : !1;
23
+ }
24
+ function T(e) {
25
+ return (t) => {
26
+ if (!e.disabled) {
27
+ if (t) {
28
+ e.setOpen(!0);
29
+ return;
30
+ }
31
+ e.showFooter || queueMicrotask(() => {
32
+ p(e.containerRef, e.popoverContentRef) || e.setOpen(!1);
33
+ });
34
+ }
35
+ };
36
+ }
37
+ function k(e, t) {
38
+ const n = e.target;
39
+ return n instanceof Node ? !!t.current?.contains(n) : !1;
40
+ }
41
+ function O(e, t, n, r) {
42
+ return e ? {
43
+ onInteractOutside: (a) => {
44
+ a.preventDefault();
45
+ },
46
+ onPointerDownOutside: (a) => {
47
+ a.preventDefault(), !(r && k(a, r)) && t && n && n(t.current.resolveFlash());
48
+ },
49
+ onEscapeKeyDown: t ? (a) => {
50
+ a.preventDefault(), t.current.onDismiss();
51
+ } : void 0
52
+ } : {};
53
+ }
54
+ function E(e) {
55
+ const {
56
+ startInput: t,
57
+ endInput: n,
58
+ committedStart: r,
59
+ committedEnd: s,
60
+ committedRange: i,
61
+ computeEffectiveRange: a,
62
+ rangesEqual: o
63
+ } = e, c = a(), d = D(c), l = t !== r || n !== s, m = !o(c, i);
64
+ return d === "apply" && (l || m) ? "apply" : "cancel";
65
+ }
66
+ function S() {
67
+ return u.useRef({
68
+ onDismiss: () => {
69
+ },
70
+ resolveFlash: () => "cancel"
71
+ });
72
+ }
73
+ function V(e, t, n, r) {
74
+ const [s, i] = u.useState({ key: 0, target: "cancel" }), a = u.useRef(t);
75
+ u.useLayoutEffect(() => {
76
+ a.current !== t && (a.current = t, i({ key: 0, target: "cancel" }));
77
+ }, [t]);
78
+ const o = u.useCallback(
79
+ (d) => {
80
+ e && i((l) => ({ key: l.key + 1, target: d }));
81
+ },
82
+ [e]
83
+ ), c = O(
84
+ e,
85
+ n,
86
+ o,
87
+ r
88
+ );
89
+ return {
90
+ footerFlashKey: s.key,
91
+ footerFlashTarget: s.key > 0 ? s.target : void 0,
92
+ triggerFooterFlash: o,
93
+ popoverHandlers: c
94
+ };
95
+ }
96
+ function B(e, t, n) {
97
+ queueMicrotask(() => {
98
+ p(e, t) || n();
99
+ });
100
+ }
101
+ function F(e, t, n, r) {
102
+ if (!e)
103
+ return { display: "", parsed: void 0, resetToCommitted: !1 };
104
+ const s = f(e, t, r);
105
+ return s.isValid ? {
106
+ display: s.padded,
107
+ parsed: s.parsed,
108
+ resetToCommitted: !1
109
+ } : e.length < t.length ? { display: e, parsed: void 0, resetToCommitted: !1 } : { display: n, parsed: void 0, resetToCommitted: !0 };
110
+ }
111
+ function q(e, t, n, r) {
112
+ const s = F(e, t, n, r);
113
+ return {
114
+ ...s,
115
+ isPartial: !!e && e.length < t.length && !s.resetToCommitted
116
+ };
117
+ }
118
+ function b(e, t, n) {
119
+ const r = f(e, t, n);
120
+ return r.isValid && r.parsed ? { parsed: r.parsed, shouldOpenPopover: !1 } : { parsed: void 0, shouldOpenPopover: !0 };
121
+ }
122
+ function M(e, t, n) {
123
+ return e === void 0 || t === void 0 ? { from: e, to: t, swapped: !1 } : n(e, t) <= 0 ? { from: e, to: t, swapped: !1 } : { from: t, to: e, swapped: !0 };
124
+ }
125
+ function X(e, t) {
126
+ return e.year * 12 + e.month - (t.year * 12 + t.month);
127
+ }
128
+ function x(e, t) {
129
+ return e.getTime() - t.getTime();
130
+ }
131
+ function N(e) {
132
+ if (!e || typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches)
133
+ return;
134
+ const t = e.querySelector('[data-field="start"]'), n = e.querySelector('[data-field="end"]');
135
+ if (!t || !n) return;
136
+ const r = { duration: 280, easing: "ease-out", fill: "none" };
137
+ typeof t.animate != "function" || typeof n.animate != "function" || (t.animate(
138
+ [{ transform: "translateX(3px)" }, { transform: "translateX(0)" }],
139
+ r
140
+ ), n.animate(
141
+ [{ transform: "translateX(-3px)" }, { transform: "translateX(0)" }],
142
+ r
143
+ ));
144
+ }
145
+ export {
146
+ x as compareDates,
147
+ X as compareMonthSelection,
148
+ T as createRangePickerOpenChangeHandler,
149
+ B as deferRangeInputBlur,
150
+ N as flashRangeReorder,
151
+ C as isDateInputInvalid,
152
+ k as isEventOnPickerSurface,
153
+ p as isFocusInsidePicker,
154
+ w as maskDateInput,
155
+ M as normalizeOrderedRange,
156
+ f as parseDateInput,
157
+ O as preventOutsideDismissWhenFooter,
158
+ F as resolveDateInputOnBlur,
159
+ b as resolveDateInputOnEnter,
160
+ q as resolveRangeFieldBlur,
161
+ E as resolveRangePickerDismissFlash,
162
+ S as usePickerDismissActionsRef,
163
+ V as usePickerFooterDismissNudge
164
+ };
@@ -1,158 +1,222 @@
1
- import { jsxs as w, jsx as r } from "react/jsx-runtime";
2
- import * as p from "react";
3
- import { Cross as F, CalendarMonth as ee } from "impact-nova-icons";
4
- import { format as x, isValid as b, parse as P } from "date-fns";
5
- import { cn as ne, maskDate as te, padValidDateString as re } from "../../../lib/utils.js";
6
- import { Input as oe } from "../input/input.js";
7
- import { Popover as le, PopoverAnchor as ie, PopoverContent as ae } from "../../feedback/popover/popover.js";
8
- import { Calendar as ce } from "../../data-display/calendar/calendar.js";
9
- import { Tooltip as E, TooltipTrigger as T, TooltipContent as j } from "../../feedback/tooltip/tooltip.js";
10
- import { useImpactNovaI18n as se } from "../../../i18n/use-impact-nova-i18n.js";
11
- import { getDateFnsLocale as pe } from "../../../i18n/getDateFnsLocale.js";
12
- import { createComponent as ue } from "../../../lib/primitives/create-component.js";
13
- import { coerceSingleDateApply as de, coerceSingleDate as fe } from "./calendar-selection-adapters.js";
14
- import { buildDateBoundsMatcher as he } from "../../../lib/date-bounds-matcher.js";
15
- const Se = ue(
1
+ import { jsxs as x, jsx as i } from "react/jsx-runtime";
2
+ import * as r from "react";
3
+ import { Cross as se, CalendarMonth as ce } from "impact-nova-icons";
4
+ import { format as S } from "date-fns";
5
+ import { cn as le } from "../../../lib/utils.js";
6
+ import { usePickerDismissActionsRef as ae, usePickerFooterDismissNudge as pe, isDateInputInvalid as ue, maskDateInput as fe, parseDateInput as de, resolveDateInputOnBlur as me, resolveDateInputOnEnter as he } from "./date-input-behavior.js";
7
+ import { Input as De } from "../input/input.js";
8
+ import { Popover as ge, PopoverAnchor as ye, PopoverContent as ke } from "../../feedback/popover/popover.js";
9
+ import { Calendar as ve } from "../../data-display/calendar/calendar.js";
10
+ import { Tooltip as j, TooltipTrigger as B, TooltipContent as K } from "../../feedback/tooltip/tooltip.js";
11
+ import { useImpactNovaI18n as Ce } from "../../../i18n/use-impact-nova-i18n.js";
12
+ import { getDateFnsLocale as Ie } from "../../../i18n/getDateFnsLocale.js";
13
+ import { createComponent as Pe } from "../../../lib/primitives/create-component.js";
14
+ import { coerceSingleDateApply as Me, coerceSingleDate as xe } from "./calendar-selection-adapters.js";
15
+ import { buildDateBoundsMatcher as Re } from "../../../lib/date-bounds-matcher.js";
16
+ const He = Pe(
16
17
  "DatePicker",
17
18
  ({
18
- value: t,
19
- onChange: f,
20
- format: o = "MM/dd/yyyy",
21
- placeholder: L,
22
- minDate: B,
23
- maxDate: K,
24
- startMonth: z,
25
- endMonth: O,
26
- showFooter: h = !0,
27
- weekStartsOn: I,
28
- disabled: s,
29
- className: H,
30
- ...q
31
- }, G) => {
32
- const { locale: S, t: m } = se(), g = p.useMemo(() => pe(S), [S]), J = L ?? m("datePicker.selectDate"), D = p.useRef(null), y = p.useRef(null);
33
- p.useImperativeHandle(G, () => D.current);
34
- const [l, Q] = p.useState(!1), v = p.useRef(!1), [C, i] = p.useState(null), k = t ? x(t, o, { locale: g }) : "", u = C?.input ?? k, N = l ? C?.pending ?? t : t, U = C?.viewMonth ?? t ?? /* @__PURE__ */ new Date(), a = (e) => {
35
- s || (i(e ? {
36
- input: k,
37
- pending: t,
38
- viewMonth: t ?? /* @__PURE__ */ new Date()
39
- } : null), Q(e));
19
+ value: n,
20
+ onChange: u,
21
+ format: l = "MM/dd/yyyy",
22
+ placeholder: z,
23
+ minDate: H,
24
+ maxDate: q,
25
+ startMonth: G,
26
+ endMonth: J,
27
+ showFooter: c = !0,
28
+ weekStartsOn: T,
29
+ disabled: a,
30
+ className: Q,
31
+ ...U
32
+ }, W) => {
33
+ const { locale: w, t: m } = Ce(), f = r.useMemo(() => Ie(w), [w]), X = z ?? m("datePicker.selectDate"), I = r.useRef(null), A = r.useRef(null), P = r.useRef(null);
34
+ r.useImperativeHandle(W, () => I.current);
35
+ const [o, E] = r.useState(!1), N = ae(), { footerFlashKey: Y, footerFlashTarget: Z, popoverHandlers: _ } = pe(c, o, N, A), g = r.useRef(!1), [R, s] = r.useState(null), y = n ? S(n, l, { locale: f }) : "", d = R?.input ?? y, k = o ? R?.pending ?? n : n, $ = R?.viewMonth ?? n ?? /* @__PURE__ */ new Date(), p = r.useCallback(() => {
36
+ s(null), E(!1);
37
+ }, []), h = (e) => {
38
+ if (!a) {
39
+ if (e) {
40
+ s({
41
+ input: y,
42
+ pending: n,
43
+ viewMonth: n ?? /* @__PURE__ */ new Date()
44
+ }), E(!0);
45
+ return;
46
+ }
47
+ c || p();
48
+ }
40
49
  };
41
- p.useEffect(() => {
42
- D.current && y.current !== null && (D.current.setSelectionRange(y.current, y.current), y.current = null);
43
- }, [u]);
44
- const W = (e) => {
45
- const n = fe(e), d = n ? x(n, o, { locale: g }) : "";
46
- i(
47
- (c) => c ? { ...c, pending: n, input: d, viewMonth: n ?? c.viewMonth } : null
48
- ), n && !h && (f?.(n), a(!1));
49
- }, X = (e) => {
50
- const n = de(e, N);
51
- f?.(n), a(!1);
52
- }, R = () => {
53
- a(!1);
54
- }, A = () => {
55
- f?.(void 0), h ? i(
50
+ r.useEffect(() => {
51
+ I.current && P.current !== null && (I.current.setSelectionRange(P.current, P.current), P.current = null);
52
+ }, [d]);
53
+ const F = (e) => {
54
+ const t = xe(e), D = t ? S(t, l, { locale: f }) : "";
55
+ s(
56
+ (v) => v ? { ...v, pending: t, input: D, viewMonth: t ?? v.viewMonth } : null
57
+ ), t && !c && (u?.(t), p());
58
+ }, L = (e) => {
59
+ const t = Me(e, k);
60
+ u?.(t), p();
61
+ }, b = () => {
62
+ p();
63
+ }, O = () => {
64
+ u?.(void 0), c ? s(
56
65
  (e) => e ? { ...e, pending: void 0, input: "" } : null
57
- ) : a(!1);
58
- }, Y = (e) => {
59
- const n = e.target.value, d = te(n, o, u);
60
- if (i((M) => ({ ...M ?? {
61
- input: k,
62
- pending: t,
63
- viewMonth: t ?? /* @__PURE__ */ new Date()
64
- }, input: d })), d === "") {
65
- h || f?.(void 0);
66
+ ) : p();
67
+ }, M = r.useCallback(
68
+ () => ({
69
+ input: y,
70
+ pending: n,
71
+ viewMonth: n ?? /* @__PURE__ */ new Date()
72
+ }),
73
+ [y, n]
74
+ ), ee = (e) => {
75
+ const t = fe(e.target.value, l, d);
76
+ if (s((C) => ({ ...C ?? M(), input: t })), t === "") {
77
+ s((C) => ({ ...C ?? M(), input: "", pending: void 0 })), c || u?.(void 0);
78
+ return;
79
+ }
80
+ const { parsed: D, isValid: v } = de(t, l, f);
81
+ v && D && (s((C) => ({
82
+ ...C ?? M(),
83
+ input: t,
84
+ pending: D,
85
+ viewMonth: D
86
+ })), c || u?.(D));
87
+ }, te = r.useCallback(
88
+ (e) => {
89
+ u?.(e), p();
90
+ },
91
+ [u, p]
92
+ ), ne = () => {
93
+ if (o) return;
94
+ const e = me(
95
+ d,
96
+ l,
97
+ y,
98
+ f
99
+ );
100
+ if (e.resetToCommitted) {
101
+ s(null);
102
+ return;
103
+ }
104
+ if (e.parsed) {
105
+ s((t) => ({
106
+ ...t ?? M(),
107
+ input: e.display,
108
+ pending: e.parsed,
109
+ viewMonth: e.parsed
110
+ })), c || (u?.(e.parsed), s(null));
111
+ return;
112
+ }
113
+ s(null);
114
+ }, re = () => {
115
+ if (o && c) {
116
+ L();
66
117
  return;
67
118
  }
68
- const c = P(d, o, /* @__PURE__ */ new Date(), { locale: g });
69
- b(c) && d.length === o.length && (i((M) => ({ ...M ?? {
70
- input: d,
71
- pending: t,
72
- viewMonth: c
73
- }, pending: c, viewMonth: c })), h || f?.(c));
74
- }, Z = () => {
75
- if (l) return;
76
- const e = re(u, o), n = P(e, o, /* @__PURE__ */ new Date(), { locale: g });
77
- !b(n) || e.length !== o.length ? i(null) : h || (f?.(n), i(null));
78
- }, V = (t ? x(t, o, { locale: g }) : "") !== u, _ = u.length === o.length && !b(P(u, o, /* @__PURE__ */ new Date(), { locale: g }));
79
- return /* @__PURE__ */ w(le, { open: s ? !1 : l, onOpenChange: a, children: [
80
- /* @__PURE__ */ r(ie, { asChild: !0, children: /* @__PURE__ */ r("div", { "data-component": "date-picker", "data-state": l ? "open" : "closed", "data-pending": V || void 0, children: /* @__PURE__ */ r(
81
- oe,
119
+ const e = he(d, l, f);
120
+ if (e.parsed) {
121
+ c && te(e.parsed);
122
+ return;
123
+ }
124
+ o || (g.current = !0, h(!0));
125
+ }, V = (n ? S(n, l, { locale: f }) : "") !== d, ie = ue(d, l, f), oe = r.useCallback(() => k && (!n || k.getTime() !== n.getTime()) ? "apply" : "cancel", [k, n]);
126
+ return r.useLayoutEffect(() => {
127
+ N.current = {
128
+ onDismiss: b,
129
+ resolveFlash: oe
130
+ };
131
+ }), /* @__PURE__ */ x(ge, { open: a ? !1 : o, onOpenChange: h, children: [
132
+ /* @__PURE__ */ i(ye, { asChild: !0, children: /* @__PURE__ */ i(
133
+ "div",
82
134
  {
83
- ref: D,
84
- value: u,
85
- onChange: Y,
86
- onBlur: Z,
87
- onClick: () => !s && a(!0),
88
- onKeyDown: (e) => {
89
- (e.key === "Enter" || e.key === "ArrowDown") && !l && !s && (e.preventDefault(), v.current = !0, a(!0)), e.key === "Escape" && l && (e.preventDefault(), R());
90
- },
91
- placeholder: l ? o : J,
92
- disabled: s,
93
- "data-form-control": "input",
94
- className: ne(
95
- "cursor-pointer",
96
- _ ? "text-destructive" : V ? "text-content-placeholder" : "",
97
- H
98
- ),
99
- suffix: /* @__PURE__ */ w("div", { className: "flex items-center gap-1", children: [
100
- t && !s && /* @__PURE__ */ w(E, { children: [
101
- /* @__PURE__ */ r(T, { asChild: !0, children: /* @__PURE__ */ r(
102
- "button",
103
- {
104
- type: "button",
105
- tabIndex: 0,
106
- "aria-label": m("calendar.clear"),
107
- onClick: (e) => {
108
- e.stopPropagation(), A();
109
- },
110
- className: "inline-flex size-4 items-center justify-center bg-transparent border-none p-0 cursor-pointer",
111
- children: /* @__PURE__ */ r(F, { className: "size-3 hover:text-content" })
112
- }
113
- ) }),
114
- /* @__PURE__ */ r(j, { variant: "tertiary", side: "top", children: m("calendar.clear") })
115
- ] }),
116
- /* @__PURE__ */ w(E, { children: [
117
- /* @__PURE__ */ r(T, { asChild: !0, children: /* @__PURE__ */ r("button", { type: "button", tabIndex: 0, "aria-label": m("datePicker.selectDate"), onClick: (e) => {
118
- e.stopPropagation(), s || a(!l);
119
- }, onKeyDown: (e) => {
120
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), s || (v.current = !0, a(!l)));
121
- }, className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer", children: /* @__PURE__ */ r(ee, { className: "h-4 w-4 text-secondary-foreground" }) }) }),
122
- /* @__PURE__ */ r(j, { variant: "tertiary", side: "top", children: m("datePicker.selectDate") })
123
- ] })
124
- ] }),
125
- ...q
135
+ ref: A,
136
+ "data-component": "date-picker",
137
+ "data-state": o ? "open" : "closed",
138
+ "data-pending": V || void 0,
139
+ children: /* @__PURE__ */ i(
140
+ De,
141
+ {
142
+ ref: I,
143
+ value: d,
144
+ onChange: ee,
145
+ onBlur: ne,
146
+ onClick: () => !a && h(!0),
147
+ onKeyDown: (e) => {
148
+ e.key === "Enter" && !a && (e.preventDefault(), re()), e.key === "ArrowDown" && !o && !a && (e.preventDefault(), g.current = !0, h(!0)), e.key === "Escape" && o && (e.preventDefault(), b());
149
+ },
150
+ placeholder: o ? l : X,
151
+ disabled: a,
152
+ "data-form-control": "input",
153
+ className: le(
154
+ "cursor-pointer",
155
+ ie ? "text-destructive" : V ? "text-content-placeholder" : "",
156
+ Q
157
+ ),
158
+ suffix: /* @__PURE__ */ x("div", { className: "flex items-center gap-1", children: [
159
+ n && !a && /* @__PURE__ */ x(j, { children: [
160
+ /* @__PURE__ */ i(B, { asChild: !0, children: /* @__PURE__ */ i(
161
+ "button",
162
+ {
163
+ type: "button",
164
+ tabIndex: 0,
165
+ "aria-label": m("calendar.clear"),
166
+ onClick: (e) => {
167
+ e.stopPropagation(), O();
168
+ },
169
+ className: "inline-flex size-4 items-center justify-center bg-transparent border-none p-0 cursor-pointer",
170
+ children: /* @__PURE__ */ i(se, { className: "size-3 hover:text-content" })
171
+ }
172
+ ) }),
173
+ /* @__PURE__ */ i(K, { variant: "tertiary", side: "top", children: m("calendar.clear") })
174
+ ] }),
175
+ /* @__PURE__ */ x(j, { children: [
176
+ /* @__PURE__ */ i(B, { asChild: !0, children: /* @__PURE__ */ i("button", { type: "button", tabIndex: 0, "aria-label": m("datePicker.selectDate"), onClick: (e) => {
177
+ e.stopPropagation(), a || (o ? p() : h(!0));
178
+ }, onKeyDown: (e) => {
179
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), a || (g.current = !0, o ? p() : h(!0)));
180
+ }, className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer", children: /* @__PURE__ */ i(ce, { className: "h-4 w-4 text-secondary-foreground" }) }) }),
181
+ /* @__PURE__ */ i(K, { variant: "tertiary", side: "top", children: m("datePicker.selectDate") })
182
+ ] })
183
+ ] }),
184
+ ...U
185
+ }
186
+ )
126
187
  }
127
- ) }) }),
128
- /* @__PURE__ */ r(
129
- ae,
188
+ ) }),
189
+ /* @__PURE__ */ i(
190
+ ke,
130
191
  {
131
192
  className: "w-auto p-0",
132
193
  align: "start",
133
194
  "aria-label": m("datePicker.selectDate"),
134
195
  onOpenAutoFocus: (e) => {
135
- v.current || e.preventDefault(), v.current = !1;
196
+ g.current || e.preventDefault(), g.current = !1;
136
197
  },
137
- children: /* @__PURE__ */ r(
138
- ce,
198
+ ..._,
199
+ children: /* @__PURE__ */ i(
200
+ ve,
139
201
  {
140
202
  mode: "single",
141
- selected: N,
142
- onSelect: W,
143
- month: U,
144
- onMonthChange: (e) => i(
145
- (n) => n ? { ...n, viewMonth: e } : null
203
+ selected: k,
204
+ footerFlashKey: Y,
205
+ footerFlashTarget: Z,
206
+ onSelect: F,
207
+ month: $,
208
+ onMonthChange: (e) => s(
209
+ (t) => t ? { ...t, viewMonth: e } : null
146
210
  ),
147
- disabled: he(B, K),
148
- startMonth: z,
149
- endMonth: O,
150
- showFooter: h,
151
- onApply: X,
152
- onCancel: R,
153
- onClear: A,
211
+ disabled: Re(H, q),
212
+ startMonth: G,
213
+ endMonth: J,
214
+ showFooter: c,
215
+ onApply: L,
216
+ onCancel: b,
217
+ onClear: O,
154
218
  captionLayout: "dropdown",
155
- ...I !== void 0 ? { weekStartsOn: I } : {}
219
+ ...T !== void 0 ? { weekStartsOn: T } : {}
156
220
  }
157
221
  )
158
222
  }
@@ -161,5 +225,5 @@ const Se = ue(
161
225
  }
162
226
  );
163
227
  export {
164
- Se as DatePicker
228
+ He as DatePicker
165
229
  };