impact-nova 2.1.0-alpha.9 → 2.2.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 (75) hide show
  1. package/README.md +6 -0
  2. package/dist/components/data/ag-grid-react/cell-renderers/editors/split-cell-editor.js +73 -94
  3. package/dist/components/data/ag-grid-react/cell-renderers/editors/split-cell-focus.d.ts +53 -0
  4. package/dist/components/data/ag-grid-react/cell-renderers/editors/split-cell-focus.js +98 -0
  5. package/dist/components/data/ag-grid-react/headers/column-menu/column-settings-menu.js +15 -13
  6. package/dist/components/data/ag-grid-react/headers/custom-header.js +56 -58
  7. package/dist/components/data/ag-grid-react/headers/custom-inner-header-group.d.ts +12 -0
  8. package/dist/components/data/ag-grid-react/headers/custom-inner-header-group.js +31 -0
  9. package/dist/components/data/ag-grid-react/headers/header-search-active-state.d.ts +10 -0
  10. package/dist/components/data/ag-grid-react/headers/header-search-active-state.js +38 -0
  11. package/dist/components/data/ag-grid-react/index.js +166 -163
  12. package/dist/components/data/ag-grid-react/notify-column-indicator-sync.d.ts +3 -4
  13. package/dist/components/data/ag-grid-react/theme.js +0 -2
  14. package/dist/components/data/data-table/data-table-column-list.js +1 -1
  15. package/dist/components/data/data-table/data-table-saved-views.js +1 -1
  16. package/dist/components/data/expandable-list-item/expandable-list-item-attributes.js +7 -6
  17. package/dist/components/data/nested-list/components/SortableItem.d.ts +3 -1
  18. package/dist/components/data/nested-list/components/SortableItem.js +111 -109
  19. package/dist/components/data-display/calendar/calendar-footer-emphasis.d.ts +28 -0
  20. package/dist/components/data-display/calendar/calendar-footer-emphasis.js +8 -0
  21. package/dist/components/data-display/calendar/calendar-footer.d.ts +4 -1
  22. package/dist/components/data-display/calendar/calendar-footer.js +60 -38
  23. package/dist/components/data-display/calendar/calendar.js +86 -82
  24. package/dist/components/data-display/calendar/calendar.types.d.ts +2 -0
  25. package/dist/components/data-display/calendar/use-calendar-state.d.ts +3 -0
  26. package/dist/components/feedback/tooltip/tab-tooltip-render.js +3 -2
  27. package/dist/components/flows/filter-strip/filter-strip.js +36 -29
  28. package/dist/components/flows/filter-strip/filter-summary.js +2 -2
  29. package/dist/components/forms/date-picker/date-input-behavior.d.ts +118 -0
  30. package/dist/components/forms/date-picker/date-input-behavior.js +164 -0
  31. package/dist/components/forms/date-picker/date-picker.js +202 -138
  32. package/dist/components/forms/date-picker/date-range-picker.js +302 -215
  33. package/dist/components/forms/date-picker/month-picker.js +160 -119
  34. package/dist/components/forms/date-picker/month-range-picker.js +302 -245
  35. package/dist/components/forms/date-picker/multi-date-picker.js +94 -80
  36. package/dist/components/forms/date-picker/multi-month-picker.js +97 -83
  37. package/dist/components/forms/date-picker/multi-week-picker.js +107 -93
  38. package/dist/components/forms/date-picker/week-picker.js +230 -140
  39. package/dist/components/forms/date-picker/week-range-picker.js +332 -226
  40. package/dist/components/forms/file-upload/file-upload.js +312 -174
  41. package/dist/components/forms/file-upload/file-upload.types.d.ts +17 -2
  42. package/dist/components/layout/dynamic-layout/dynamic-layout.variants.d.ts +1 -1
  43. package/dist/components/layout/header/header.js +45 -38
  44. package/dist/components/layout/horizontal-scroller/index.d.ts +1 -0
  45. package/dist/components/layout/horizontal-scroller/index.js +3 -2
  46. package/dist/components/ui/local-raster-icons/assets/excel-error-icon.webp.js +4 -0
  47. package/dist/components/ui/local-raster-icons/assets/file-upload-error.webp.js +4 -0
  48. package/dist/components/ui/local-raster-icons/rasterIcons.d.ts +2 -0
  49. package/dist/components/ui/local-raster-icons/rasterIcons.js +32 -22
  50. package/dist/components/ui/show.d.ts +10 -0
  51. package/dist/components/ui/show.js +7 -0
  52. package/dist/components/ui/show.types.d.ts +5 -0
  53. package/dist/i18n/defaultMessages.d.ts +17 -0
  54. package/dist/i18n/defaultMessages.js +29 -17
  55. package/dist/i18n/index.d.ts +1 -1
  56. package/dist/i18n/locales/de.js +12 -0
  57. package/dist/i18n/locales/es.js +12 -0
  58. package/dist/i18n/locales/hi.js +12 -0
  59. package/dist/i18n/locales/kn.js +12 -0
  60. package/dist/impact-nova-base.scss +6 -2
  61. package/dist/impact-nova-components.css +141 -16
  62. package/dist/impact-nova-tokens.scss +12 -0
  63. package/dist/impact-nova.css +1 -1
  64. package/dist/index.d.ts +2 -0
  65. package/dist/index.js +273 -271
  66. package/dist/lib/utils.js +40 -24
  67. package/dist/llms/rules/ag-grid.js +1 -1
  68. package/dist/llms/rules/installation.js +1 -1
  69. package/dist/llms/rules/requirements.js +1 -1
  70. package/dist/tailwind.config.js +36 -4
  71. package/dist/theme/tailwind-colors.js +3 -1
  72. package/package.json +15 -6
  73. package/tailwind.config.d.ts +3 -0
  74. package/dist/components/data/ag-grid-react/headers/custom-header-group.d.ts +0 -10
  75. package/dist/components/data/ag-grid-react/headers/custom-header-group.js +0 -58
@@ -1,238 +1,325 @@
1
- import { jsx as d, jsxs as S } from "react/jsx-runtime";
2
- import * as m from "react";
3
- import { Cross as we, CalendarMonth as xe } from "impact-nova-icons";
4
- import { format as p, isValid as y, parse as D } from "date-fns";
5
- import { cn as A, padValidDateString as I, maskDate as q } from "../../../lib/utils.js";
6
- import { useFieldChrome as ke } from "../../../lib/primitives/use-field-chrome.js";
7
- import { Popover as Ee, PopoverAnchor as Pe, PopoverContent as Re } from "../../feedback/popover/popover.js";
8
- import { Calendar as Se } from "../../data-display/calendar/calendar.js";
9
- import { Tooltip as G, TooltipTrigger as J, TooltipContent as Q } from "../../feedback/tooltip/tooltip.js";
10
- import { useImpactNovaI18n as Ie } from "../../../i18n/use-impact-nova-i18n.js";
11
- import { getDateFnsLocale as Ve } from "../../../i18n/getDateFnsLocale.js";
12
- import { coerceDateRangeApply as Ce, coerceDateRange as Ne } from "./calendar-selection-adapters.js";
13
- import { buildDateBoundsMatcher as Me } from "../../../lib/date-bounds-matcher.js";
14
- const ve = m.forwardRef(
1
+ import { jsx as u, jsxs as E } from "react/jsx-runtime";
2
+ import * as a from "react";
3
+ import { Cross as Ve, CalendarMonth as Oe } from "impact-nova-icons";
4
+ import { format as x } from "date-fns";
5
+ import { cn as O } from "../../../lib/utils.js";
6
+ import { usePickerDismissActionsRef as Ke, usePickerFooterDismissNudge as je, createRangePickerOpenChangeHandler as Le, parseDateInput as K, normalizeOrderedRange as qe, flashRangeReorder as ze, isDateInputInvalid as $, resolveRangeFieldBlur as N, resolveRangePickerDismissFlash as He, compareDates as j, deferRangeInputBlur as Ge, maskDateInput as F, resolveDateInputOnBlur as S } from "./date-input-behavior.js";
7
+ import { useFieldChrome as Je } from "../../../lib/primitives/use-field-chrome.js";
8
+ import { Popover as Qe, PopoverAnchor as Ue, PopoverContent as We } from "../../feedback/popover/popover.js";
9
+ import { Calendar as Xe } from "../../data-display/calendar/calendar.js";
10
+ import { Tooltip as ee, TooltipTrigger as te, TooltipContent as re } from "../../feedback/tooltip/tooltip.js";
11
+ import { useImpactNovaI18n as Ye } from "../../../i18n/use-impact-nova-i18n.js";
12
+ import { getDateFnsLocale as Ze } from "../../../i18n/getDateFnsLocale.js";
13
+ import { coerceDateRangeApply as _e, coerceDateRange as $e } from "./calendar-selection-adapters.js";
14
+ import { buildDateBoundsMatcher as Fe } from "../../../lib/date-bounds-matcher.js";
15
+ function et(r, c) {
16
+ if (!r && !c) return !0;
17
+ if (!r || !c) return !1;
18
+ const n = !r.from && !c.from || r.from && c.from && j(r.from, c.from) === 0, A = !r.to && !c.to || r.to && c.to && j(r.to, c.to) === 0;
19
+ return !!(n && A);
20
+ }
21
+ const tt = a.forwardRef(
15
22
  ({
16
- value: n,
17
- onChange: a,
18
- format: e = "MM/dd/yyyy",
19
- startPlaceholder: U,
20
- endPlaceholder: W,
21
- minDate: X,
22
- maxDate: Y,
23
- startMonth: Z,
24
- endMonth: _,
25
- showFooter: h = !0,
26
- weekStartsOn: T,
23
+ value: r,
24
+ onChange: c,
25
+ format: n = "MM/dd/yyyy",
26
+ startPlaceholder: A,
27
+ endPlaceholder: oe,
28
+ minDate: ne,
29
+ maxDate: se,
30
+ startMonth: ie,
31
+ endMonth: le,
32
+ showFooter: g = !0,
33
+ weekStartsOn: L,
27
34
  disabled: f,
28
- label: $,
29
- helperText: F,
30
- helperTextPosition: ee = "absolute",
31
- prefix: Ae,
32
- prefixClick: Te,
33
- isError: te,
34
- error: ne,
35
- size: j,
36
- required: oe,
37
- className: re,
38
- ...le
39
- }, se) => {
40
- const { locale: K, t: P } = Ie(), r = m.useMemo(() => Ve(K), [K]), B = U ?? P("datePicker.startDate"), L = W ?? P("datePicker.endDate"), z = ne ?? te, ie = ke({
41
- label: $,
42
- helperText: F,
43
- helperTextPosition: ee,
44
- error: z,
45
- required: oe,
35
+ label: ae,
36
+ helperText: ce,
37
+ helperTextPosition: fe = "absolute",
38
+ prefix: rt,
39
+ prefixClick: ot,
40
+ isError: de,
41
+ error: pe,
42
+ size: q,
43
+ required: me,
44
+ className: ue,
45
+ ...ge
46
+ }, he) => {
47
+ const { locale: z, t: b } = Ye(), s = a.useMemo(() => Ze(z), [z]), H = A ?? b("datePicker.startDate"), G = oe ?? b("datePicker.endDate"), J = pe ?? de, ye = Je({
48
+ label: ae,
49
+ helperText: ce,
50
+ helperTextPosition: fe,
51
+ error: J,
52
+ required: me,
46
53
  disabled: f ?? void 0,
47
54
  rootClassName: "w-full min-w-[240px]"
48
- }), O = m.useRef(null), ce = m.useRef(null);
49
- m.useImperativeHandle(se, () => O.current);
50
- const [c, u] = m.useState(!1), V = m.useRef(!1), [R, b] = m.useState(n), [w, k] = m.useState(n?.from ? p(n.from, e, { locale: r }) : ""), [x, E] = m.useState(n?.to ? p(n.to, e, { locale: r }) : ""), [ae, N] = m.useState(n?.from || /* @__PURE__ */ new Date());
51
- m.useEffect(() => {
52
- c || (k(n?.from ? p(n.from, e, { locale: r }) : ""), E(n?.to ? p(n.to, e, { locale: r }) : ""), b(n));
53
- }, [n, e, c, r]), m.useEffect(() => {
54
- c && (b(n), k(n?.from ? p(n.from, e, { locale: r }) : ""), E(n?.to ? p(n.to, e, { locale: r }) : ""), N(n?.from || /* @__PURE__ */ new Date()));
55
- }, [c, n, e, r]);
56
- const fe = (t) => {
57
- const o = Ne(t);
58
- b(o), o?.from && k(p(o.from, e, { locale: r })), o?.to && E(p(o.to, e, { locale: r })), h || o?.from && o?.to && o.from.getTime() !== o.to.getTime() && (a?.(o), u(!1));
59
- }, de = (t) => {
60
- let o = Ce(t, R);
61
- o?.from && !o.to && (o = { from: o.from, to: o.from }), a?.(o), u(!1);
62
- }, M = () => {
63
- b(n), k(n?.from ? p(n.from, e, { locale: r }) : ""), E(n?.to ? p(n.to, e, { locale: r }) : ""), u(!1);
64
- }, v = () => {
65
- b(void 0), k(""), E(""), a?.(void 0), h || u(!1);
66
- }, pe = (t) => {
67
- const o = t.target.value, s = q(o, e, w);
68
- if (k(s), s === "") {
69
- const l = { from: void 0, to: R?.to };
70
- b(l), h || a?.(l);
55
+ }), Q = a.useRef(null), Re = a.useRef(null), U = a.useRef(null), T = a.useRef(null), M = a.useRef(null);
56
+ a.useImperativeHandle(he, () => Q.current);
57
+ const [d, h] = a.useState(!1), W = Ke(), { footerFlashKey: xe, footerFlashTarget: De, popoverHandlers: ke } = je(g, d, W, U), I = a.useRef(!1), [p, y] = a.useState(r), [m, D] = a.useState(r?.from ? x(r.from, n, { locale: s }) : ""), [R, k] = a.useState(r?.to ? x(r.to, n, { locale: s }) : ""), [ve, P] = a.useState(r?.from || /* @__PURE__ */ new Date()), v = r?.from ? x(r.from, n, { locale: s }) : "", C = r?.to ? x(r.to, n, { locale: s }) : "";
58
+ a.useEffect(() => {
59
+ D(r?.from ? x(r.from, n, { locale: s }) : ""), k(r?.to ? x(r.to, n, { locale: s }) : ""), y(r);
60
+ }, [r, n, s]);
61
+ const Ce = a.useCallback(
62
+ (e) => Le({
63
+ disabled: f ?? void 0,
64
+ showFooter: g,
65
+ containerRef: T,
66
+ popoverContentRef: M,
67
+ setOpen: h
68
+ })(e),
69
+ [f, g]
70
+ ), X = a.useRef(!1);
71
+ a.useEffect(() => {
72
+ if (d && !X.current) {
73
+ const e = K(m, n, s);
74
+ e.parsed ? P(e.parsed) : p?.from ? P(p.from) : r?.from && P(r.from);
75
+ }
76
+ X.current = d;
77
+ }, [d, m, n, s, p?.from, r?.from]);
78
+ const be = (e) => {
79
+ const t = $e(e);
80
+ y(t), t?.from && D(x(t.from, n, { locale: s })), t?.to && k(x(t.to, n, { locale: s })), g || t?.from && t?.to && t.from.getTime() !== t.to.getTime() && (c?.(t), h(!1));
81
+ }, w = a.useCallback((e, t) => {
82
+ const o = qe(e, t, j);
83
+ return o.swapped && (o.from && D(x(o.from, n, { locale: s })), o.to && k(x(o.to, n, { locale: s })), ze(T.current)), { from: o.from, to: o.to };
84
+ }, [n, s]), Y = (e) => {
85
+ let t = _e(e, p);
86
+ t?.from && !t.to && (t = { from: t.from, to: t.from });
87
+ const o = w(t?.from, t?.to);
88
+ y({ from: o.from, to: o.to }), c?.({ from: o.from, to: o.to }), h(!1);
89
+ }, B = () => {
90
+ y(r), D(r?.from ? x(r.from, n, { locale: s }) : ""), k(r?.to ? x(r.to, n, { locale: s }) : ""), h(!1);
91
+ }, V = () => {
92
+ y(void 0), D(""), k(""), c?.(void 0), g || h(!1);
93
+ }, Ie = (e) => {
94
+ const t = F(e.target.value, n, m);
95
+ if (D(t), t === "") {
96
+ const l = { from: void 0, to: p?.to };
97
+ y(l), g || c?.(l);
71
98
  return;
72
99
  }
73
- const i = D(s, e, /* @__PURE__ */ new Date(), { locale: r });
74
- if (y(i) && s.length === e.length) {
75
- const l = { from: i, to: R?.to };
76
- b(l), N(i), h || a?.(l);
100
+ const { parsed: o, isValid: i } = K(t, n, s);
101
+ if (i && o) {
102
+ const l = { from: o, to: p?.to };
103
+ y(l), P(o), g || c?.(l);
77
104
  }
78
- }, me = (t) => {
79
- const o = t.target.value, s = q(o, e, x);
80
- if (E(s), s === "") {
81
- const l = { from: R?.from, to: void 0 };
82
- b(l), h || a?.(l);
105
+ }, Pe = (e) => {
106
+ const t = F(e.target.value, n, R);
107
+ if (k(t), t === "") {
108
+ const l = { from: p?.from, to: void 0 };
109
+ y(l), g || c?.(l);
83
110
  return;
84
111
  }
85
- const i = D(s, e, /* @__PURE__ */ new Date(), { locale: r });
86
- if (y(i) && s.length === e.length) {
87
- const l = { from: R?.from, to: i };
88
- b(l), i && N(i), h || a?.(l);
112
+ const { parsed: o, isValid: i } = K(t, n, s);
113
+ if (i && o) {
114
+ const l = { from: p?.from, to: o };
115
+ y(l), P(o), g || c?.(l);
89
116
  }
90
- }, H = () => {
91
- if (c) return;
92
- const t = I(w, e), o = I(x, e), s = D(t, e, /* @__PURE__ */ new Date(), { locale: r }), i = D(o, e, /* @__PURE__ */ new Date(), { locale: r }), l = y(s) && t.length === e.length, g = y(i) && o.length === e.length;
93
- w && !l ? k(n?.from ? p(n.from, e, { locale: r }) : "") : l && k(t), x && !g ? E(n?.to ? p(n.to, e, { locale: r }) : "") : g && E(o), l && g && !h ? a?.({ from: s, to: i }) : l && !h ? a?.({ from: s, to: n?.to }) : g && !h && a?.({ from: n?.from, to: i });
94
- }, ue = n?.from ? p(n.from, e, { locale: r }) : "", he = n?.to ? p(n.to, e, { locale: r }) : "", ge = w !== ue, ye = x !== he, De = w.length === e.length && !y(D(w, e, /* @__PURE__ */ new Date(), { locale: r })), be = x.length === e.length && !y(D(x, e, /* @__PURE__ */ new Date(), { locale: r }));
95
- return /* @__PURE__ */ d("div", { "data-component": "date-range-picker", "data-disabled": f || void 0, children: ie.wrapControl(
96
- /* @__PURE__ */ S(Ee, { open: f ? !1 : c, onOpenChange: (t) => {
97
- f || u(t);
98
- }, children: [
99
- /* @__PURE__ */ d(Pe, { asChild: !0, children: /* @__PURE__ */ S(
100
- "div",
101
- {
102
- "data-state": c ? "open" : "closed",
103
- className: A(
104
- "flex w-full items-center justify-between gap-2 rounded-md border bg-canvas-elevated px-3 text-sm shadow-sm transition-colors hover:border-brand disabled:cursor-not-allowed disabled:bg-disabled-surface disabled:text-disabled-foreground disabled:border-stroke",
105
- z ? "border-destructive hover:border-destructive" : "border-field",
106
- j === "sm" ? "h-6" : j === "md" ? "h-[28px]" : "h-8",
107
- f && "pointer-events-none opacity-100 bg-disabled-surface border-stroke text-disabled-foreground hover:border-stroke",
108
- "cursor-pointer",
109
- re
110
- ),
111
- children: [
112
- /* @__PURE__ */ S("div", { className: "flex items-center gap-4 flex-1 min-w-0", children: [
113
- /* @__PURE__ */ d(
114
- "input",
115
- {
116
- ref: O,
117
- type: "text",
118
- value: w,
119
- onChange: pe,
120
- onBlur: H,
121
- onClick: () => !f && u(!0),
122
- onKeyDown: (t) => {
123
- if (t.key === "Enter" && !c) {
124
- t.preventDefault();
125
- const o = I(w, e), s = I(x, e), i = D(o, e, /* @__PURE__ */ new Date(), { locale: r }), l = D(s, e, /* @__PURE__ */ new Date(), { locale: r }), g = y(i) && o.length === e.length, C = y(l) && s.length === e.length;
126
- g && C ? a?.({ from: i, to: l }) : g ? a?.({ from: i, to: n?.to }) : C && a?.({ from: n?.from, to: l });
117
+ }, Z = () => {
118
+ Ge(
119
+ T,
120
+ M,
121
+ () => {
122
+ const e = N(m, n, v, s), t = N(R, n, C, s);
123
+ e.resetToCommitted ? D(v) : e.parsed && D(e.display), t.resetToCommitted ? k(C) : t.parsed && k(t.display);
124
+ let o = e.parsed ? e.parsed : e.resetToCommitted ? r?.from : p?.from, i = t.parsed ? t.parsed : t.resetToCommitted ? r?.to : p?.to;
125
+ o && i && ({ from: o, to: i } = w(o, i));
126
+ const l = o || i ? { from: o, to: i } : void 0;
127
+ y(l), g || (l ? c?.(l) : !m && !R && c?.(void 0));
128
+ }
129
+ );
130
+ }, Ee = () => {
131
+ const e = S(m, n, v, s), t = S(R, n, C, s);
132
+ e.resetToCommitted ? D(v) : e.parsed && D(e.display), t.resetToCommitted ? k(C) : t.parsed && k(t.display);
133
+ let o = e.parsed ?? p?.from ?? r?.from, i = t.parsed ?? p?.to ?? r?.to;
134
+ o && i && ({ from: o, to: i } = w(o, i));
135
+ const l = o || i ? { from: o, to: i } : void 0;
136
+ l ? (y(l), c?.(l)) : !m && !R && (y(void 0), c?.(void 0));
137
+ }, _ = () => {
138
+ if (d && g) {
139
+ Y();
140
+ return;
141
+ }
142
+ if (!d) {
143
+ if (g) {
144
+ Ee();
145
+ return;
146
+ }
147
+ const e = S(m, n, v, s), t = S(R, n, C, s);
148
+ if (e.parsed || t.parsed) return;
149
+ I.current = !0, h(!0);
150
+ }
151
+ }, we = m !== v, Te = R !== C, Be = $(m, n, s), Ne = $(R, n, s), Se = a.useCallback(() => {
152
+ const e = N(m, n, v, s), t = N(R, n, C, s);
153
+ let o = e.parsed ? e.parsed : e.resetToCommitted ? r?.from : p?.from, i = t.parsed ? t.parsed : t.resetToCommitted ? r?.to : p?.to;
154
+ o && i && ({ from: o, to: i } = w(o, i));
155
+ const l = o || i ? { from: o, to: i } : void 0;
156
+ return He({
157
+ startInput: m,
158
+ endInput: R,
159
+ committedStart: v,
160
+ committedEnd: C,
161
+ committedRange: r,
162
+ computeEffectiveRange: () => l,
163
+ rangesEqual: (Ae, Me) => et(Ae, Me)
164
+ });
165
+ }, [
166
+ m,
167
+ R,
168
+ v,
169
+ C,
170
+ r,
171
+ p,
172
+ n,
173
+ s,
174
+ w
175
+ ]);
176
+ return a.useLayoutEffect(() => {
177
+ W.current = {
178
+ onDismiss: B,
179
+ resolveFlash: Se
180
+ };
181
+ }), /* @__PURE__ */ u(
182
+ "div",
183
+ {
184
+ ref: U,
185
+ "data-component": "date-range-picker",
186
+ "data-disabled": f || void 0,
187
+ children: ye.wrapControl(
188
+ /* @__PURE__ */ E(Qe, { open: f ? !1 : d, onOpenChange: Ce, children: [
189
+ /* @__PURE__ */ u(Ue, { asChild: !0, children: /* @__PURE__ */ E(
190
+ "div",
191
+ {
192
+ ref: T,
193
+ "data-state": d ? "open" : "closed",
194
+ className: O(
195
+ "flex w-full items-center justify-between gap-2 rounded-md border bg-canvas-elevated px-3 text-sm shadow-sm transition-colors hover:border-brand disabled:cursor-not-allowed disabled:bg-disabled-surface disabled:text-disabled-foreground disabled:border-stroke",
196
+ J ? "border-destructive hover:border-destructive" : "border-field",
197
+ q === "sm" ? "h-6" : q === "md" ? "h-[28px]" : "h-8",
198
+ f && "pointer-events-none opacity-100 bg-disabled-surface border-stroke text-disabled-foreground hover:border-stroke",
199
+ "cursor-pointer",
200
+ ue
201
+ ),
202
+ children: [
203
+ /* @__PURE__ */ E("div", { className: "flex items-center gap-4 flex-1 min-w-0", children: [
204
+ /* @__PURE__ */ u(
205
+ "input",
206
+ {
207
+ ref: Q,
208
+ type: "text",
209
+ value: m,
210
+ onChange: Ie,
211
+ onBlur: Z,
212
+ onClick: () => !f && h(!0),
213
+ onKeyDown: (e) => {
214
+ e.key === "Enter" && !f && (e.preventDefault(), _()), e.key === "ArrowDown" && !d && !f && (e.preventDefault(), I.current = !0, h(!0)), e.key === "Escape" && d && (e.preventDefault(), B());
215
+ },
216
+ placeholder: d ? n : H,
217
+ disabled: !!f,
218
+ "aria-label": H,
219
+ "data-field": "start",
220
+ className: O(
221
+ "flex-1 min-w-0 bg-transparent p-0 text-sm font-medium outline-none placeholder:font-medium placeholder:text-content-empty disabled:cursor-not-allowed disabled:opacity-50",
222
+ Be ? "text-destructive" : we ? "text-content-placeholder" : ""
223
+ ),
224
+ ...ge
127
225
  }
128
- t.key === "ArrowDown" && !c && !f && (t.preventDefault(), V.current = !0, u(!0)), t.key === "Escape" && c && (t.preventDefault(), M());
129
- },
130
- placeholder: c ? e : B,
131
- disabled: !!f,
132
- "aria-label": B,
133
- "data-field": "start",
134
- className: A(
135
- "flex-1 min-w-0 bg-transparent p-0 text-sm font-medium outline-none placeholder:font-medium placeholder:text-content-empty disabled:cursor-not-allowed disabled:opacity-50",
136
- De ? "text-destructive" : ge ? "text-content-placeholder" : ""
137
226
  ),
138
- ...le
139
- }
140
- ),
141
- /* @__PURE__ */ d(
142
- "input",
143
- {
144
- ref: ce,
145
- type: "text",
146
- value: x,
147
- onChange: me,
148
- onBlur: H,
149
- onClick: () => !f && u(!0),
150
- onKeyDown: (t) => {
151
- if (t.key === "Enter" && !c) {
152
- t.preventDefault();
153
- const o = I(w, e), s = I(x, e), i = D(o, e, /* @__PURE__ */ new Date(), { locale: r }), l = D(s, e, /* @__PURE__ */ new Date(), { locale: r }), g = y(i) && o.length === e.length, C = y(l) && s.length === e.length;
154
- g && C ? a?.({ from: i, to: l }) : g ? a?.({ from: i, to: n?.to }) : C && a?.({ from: n?.from, to: l });
227
+ /* @__PURE__ */ u(
228
+ "input",
229
+ {
230
+ ref: Re,
231
+ type: "text",
232
+ value: R,
233
+ onChange: Pe,
234
+ onBlur: Z,
235
+ onClick: () => !f && h(!0),
236
+ onKeyDown: (e) => {
237
+ e.key === "Enter" && !f && (e.preventDefault(), _()), e.key === "ArrowDown" && !d && !f && (e.preventDefault(), I.current = !0, h(!0)), e.key === "Escape" && d && (e.preventDefault(), B());
238
+ },
239
+ placeholder: d ? n : G,
240
+ disabled: !!f,
241
+ "aria-label": G,
242
+ "data-field": "end",
243
+ className: O(
244
+ "flex-1 min-w-0 bg-transparent p-0 text-sm font-medium outline-none placeholder:font-medium placeholder:text-content-empty disabled:cursor-not-allowed disabled:opacity-50",
245
+ Ne ? "text-destructive" : Te ? "text-content-placeholder" : ""
246
+ )
155
247
  }
156
- t.key === "ArrowDown" && !c && !f && (t.preventDefault(), V.current = !0, u(!0)), t.key === "Escape" && c && (t.preventDefault(), M());
157
- },
158
- placeholder: c ? e : L,
159
- disabled: !!f,
160
- "aria-label": L,
161
- "data-field": "end",
162
- className: A(
163
- "flex-1 min-w-0 bg-transparent p-0 text-sm font-medium outline-none placeholder:font-medium placeholder:text-content-empty disabled:cursor-not-allowed disabled:opacity-50",
164
- be ? "text-destructive" : ye ? "text-content-placeholder" : ""
165
248
  )
249
+ ] }),
250
+ /* @__PURE__ */ E("div", { className: "flex items-center gap-1 shrink-0", children: [
251
+ r?.from && !f && /* @__PURE__ */ E(ee, { children: [
252
+ /* @__PURE__ */ u(te, { asChild: !0, children: /* @__PURE__ */ u(
253
+ "button",
254
+ {
255
+ type: "button",
256
+ tabIndex: 0,
257
+ "aria-label": b("calendar.clear"),
258
+ onClick: (e) => {
259
+ e.stopPropagation(), V();
260
+ },
261
+ onKeyDown: (e) => {
262
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), V());
263
+ },
264
+ className: "inline-flex size-4 items-center justify-center bg-transparent border-none p-0 cursor-pointer",
265
+ children: /* @__PURE__ */ u(Ve, { className: "size-3 hover:text-content text-content-icon" })
266
+ }
267
+ ) }),
268
+ /* @__PURE__ */ u(re, { variant: "tertiary", side: "top", children: b("calendar.clear") })
269
+ ] }),
270
+ /* @__PURE__ */ E(ee, { children: [
271
+ /* @__PURE__ */ u(te, { asChild: !0, children: /* @__PURE__ */ u("button", { type: "button", tabIndex: 0, "aria-label": b("datePicker.selectMonthRange"), onClick: (e) => {
272
+ e.stopPropagation(), f || h(!d);
273
+ }, onKeyDown: (e) => {
274
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), f || (I.current = !0, h(!d)));
275
+ }, className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer", children: /* @__PURE__ */ u(Oe, { className: "h-4 w-4 text-secondary-foreground" }) }) }),
276
+ /* @__PURE__ */ u(re, { variant: "tertiary", side: "top", children: b("datePicker.selectMonthRange") })
277
+ ] })
278
+ ] })
279
+ ]
280
+ }
281
+ ) }),
282
+ /* @__PURE__ */ u(
283
+ We,
284
+ {
285
+ ref: M,
286
+ className: "w-auto p-0",
287
+ align: "start",
288
+ "aria-label": b("datePicker.selectDateRange"),
289
+ onOpenAutoFocus: (e) => {
290
+ I.current || e.preventDefault(), I.current = !1;
291
+ },
292
+ ...ke,
293
+ children: /* @__PURE__ */ u(
294
+ Xe,
295
+ {
296
+ mode: "range",
297
+ selected: p,
298
+ footerFlashKey: xe,
299
+ footerFlashTarget: De,
300
+ onSelect: be,
301
+ month: ve,
302
+ onMonthChange: P,
303
+ disabled: Fe(ne, se),
304
+ startMonth: ie,
305
+ endMonth: le,
306
+ showFooter: g,
307
+ onApply: Y,
308
+ onCancel: B,
309
+ onClear: V,
310
+ captionLayout: "dropdown",
311
+ ...L !== void 0 ? { weekStartsOn: L } : {}
166
312
  }
167
313
  )
168
- ] }),
169
- /* @__PURE__ */ S("div", { className: "flex items-center gap-1 shrink-0", children: [
170
- n?.from && !f && /* @__PURE__ */ S(G, { children: [
171
- /* @__PURE__ */ d(J, { asChild: !0, children: /* @__PURE__ */ d(
172
- "button",
173
- {
174
- type: "button",
175
- tabIndex: 0,
176
- "aria-label": P("calendar.clear"),
177
- onClick: (t) => {
178
- t.stopPropagation(), v();
179
- },
180
- onKeyDown: (t) => {
181
- (t.key === "Enter" || t.key === " ") && (t.preventDefault(), t.stopPropagation(), v());
182
- },
183
- className: "inline-flex size-4 items-center justify-center bg-transparent border-none p-0 cursor-pointer",
184
- children: /* @__PURE__ */ d(we, { className: "size-3 hover:text-content text-content-icon" })
185
- }
186
- ) }),
187
- /* @__PURE__ */ d(Q, { variant: "tertiary", side: "top", children: P("calendar.clear") })
188
- ] }),
189
- /* @__PURE__ */ S(G, { children: [
190
- /* @__PURE__ */ d(J, { asChild: !0, children: /* @__PURE__ */ d("button", { type: "button", tabIndex: 0, "aria-label": P("datePicker.selectMonthRange"), onClick: (t) => {
191
- t.stopPropagation(), f || u(!c);
192
- }, onKeyDown: (t) => {
193
- (t.key === "Enter" || t.key === " ") && (t.preventDefault(), t.stopPropagation(), f || (V.current = !0, u(!c)));
194
- }, className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer", children: /* @__PURE__ */ d(xe, { className: "h-4 w-4 text-secondary-foreground" }) }) }),
195
- /* @__PURE__ */ d(Q, { variant: "tertiary", side: "top", children: P("datePicker.selectMonthRange") })
196
- ] })
197
- ] })
198
- ]
199
- }
200
- ) }),
201
- /* @__PURE__ */ d(
202
- Re,
203
- {
204
- className: "w-auto p-0",
205
- align: "start",
206
- "aria-label": P("datePicker.selectDateRange"),
207
- onOpenAutoFocus: (t) => {
208
- V.current || t.preventDefault(), V.current = !1;
209
- },
210
- children: /* @__PURE__ */ d(
211
- Se,
212
- {
213
- mode: "range",
214
- selected: R,
215
- onSelect: fe,
216
- month: ae,
217
- onMonthChange: N,
218
- disabled: Me(X, Y),
219
- startMonth: Z,
220
- endMonth: _,
221
- showFooter: h,
222
- onApply: de,
223
- onCancel: M,
224
- onClear: v,
225
- captionLayout: "dropdown",
226
- ...T !== void 0 ? { weekStartsOn: T } : {}
227
314
  }
228
315
  )
229
- }
316
+ ] })
230
317
  )
231
- ] })
232
- ) });
318
+ }
319
+ );
233
320
  }
234
321
  );
235
- ve.displayName = "DateRangePicker";
322
+ tt.displayName = "DateRangePicker";
236
323
  export {
237
- ve as DateRangePicker
324
+ tt as DateRangePicker
238
325
  };