@tedi-design-system/react 19.2.0-rc.5 → 19.2.0-rc.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/bundle-stats.html +1 -1
  2. package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.cjs.js +1 -1
  3. package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.es.js +1 -1
  4. package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
  5. package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.es.js +1 -1
  6. package/external/hoist-non-react-statics/external/react-is/index.cjs.js +1 -1
  7. package/external/hoist-non-react-statics/external/react-is/index.es.js +1 -1
  8. package/external/prop-types/external/react-is/cjs/react-is.development.cjs.js +1 -1
  9. package/external/prop-types/external/react-is/cjs/react-is.development.es.js +1 -1
  10. package/external/prop-types/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
  11. package/external/prop-types/external/react-is/cjs/react-is.production.min.es.js +1 -1
  12. package/external/prop-types/external/react-is/index.cjs.js +1 -1
  13. package/external/prop-types/external/react-is/index.es.js +1 -1
  14. package/package.json +1 -1
  15. package/src/tedi/components/content/carousel/components/carousel-indicators/carousel-indicators.cjs.js +1 -1
  16. package/src/tedi/components/content/carousel/components/carousel-indicators/carousel-indicators.es.js +18 -18
  17. package/src/tedi/components/content/carousel/use-carousel.cjs.js +1 -1
  18. package/src/tedi/components/content/carousel/use-carousel.d.ts +2 -1
  19. package/src/tedi/components/content/carousel/use-carousel.es.js +177 -163
  20. package/src/tedi/components/content/label/label.cjs.js +1 -1
  21. package/src/tedi/components/content/label/label.d.ts +22 -0
  22. package/src/tedi/components/content/label/label.es.js +30 -28
  23. package/src/tedi/components/form/checkbox/checkbox.cjs.js +1 -1
  24. package/src/tedi/components/form/checkbox/checkbox.es.js +32 -30
  25. package/src/tedi/components/form/choice-group/choice-group.cjs.js +1 -1
  26. package/src/tedi/components/form/choice-group/choice-group.es.js +80 -69
  27. package/src/tedi/components/form/choice-input.types.d.ts +7 -0
  28. package/src/tedi/components/form/date-field/date-field.cjs.js +1 -1
  29. package/src/tedi/components/form/date-field/date-field.d.ts +5 -0
  30. package/src/tedi/components/form/date-field/date-field.es.js +187 -184
  31. package/src/tedi/components/form/date-time-field/date-time-field.cjs.js +1 -1
  32. package/src/tedi/components/form/date-time-field/date-time-field.d.ts +5 -0
  33. package/src/tedi/components/form/date-time-field/date-time-field.es.js +103 -101
  34. package/src/tedi/components/form/form-label/form-label.cjs.js +1 -1
  35. package/src/tedi/components/form/form-label/form-label.d.ts +9 -0
  36. package/src/tedi/components/form/form-label/form-label.es.js +15 -14
  37. package/src/tedi/components/form/multi-value-field/multi-value-field.cjs.js +1 -1
  38. package/src/tedi/components/form/multi-value-field/multi-value-field.d.ts +7 -0
  39. package/src/tedi/components/form/multi-value-field/multi-value-field.es.js +41 -40
  40. package/src/tedi/components/form/number-field/number-field.cjs.js +1 -1
  41. package/src/tedi/components/form/number-field/number-field.es.js +54 -43
  42. package/src/tedi/components/form/radio/radio.cjs.js +1 -1
  43. package/src/tedi/components/form/radio/radio.es.js +30 -28
  44. package/src/tedi/components/form/select/select.cjs.js +1 -1
  45. package/src/tedi/components/form/select/select.es.js +79 -77
  46. package/src/tedi/components/form/slider/slider.cjs.js +1 -1
  47. package/src/tedi/components/form/slider/slider.d.ts +7 -0
  48. package/src/tedi/components/form/slider/slider.es.js +48 -47
  49. package/src/tedi/components/form/textfield/textfield.cjs.js +1 -1
  50. package/src/tedi/components/form/textfield/textfield.es.js +72 -61
  51. package/src/tedi/components/form/time-field/time-field.cjs.js +1 -1
  52. package/src/tedi/components/form/time-field/time-field.d.ts +5 -0
  53. package/src/tedi/components/form/time-field/time-field.es.js +87 -85
  54. package/src/tedi/components/form/toggle/toggle.cjs.js +1 -1
  55. package/src/tedi/components/form/toggle/toggle.d.ts +7 -0
  56. package/src/tedi/components/form/toggle/toggle.es.js +26 -24
@@ -1,94 +1,95 @@
1
- import { jsxs as vt, Fragment as Ft, jsx as D } from "react/jsx-runtime";
2
- import { useFloating as wt, useClick as Nt, useInteractions as kt, useDismiss as Pt, useRole as Ot, FloatingPortal as Et, FloatingFocusManager as Rt } from "../../../../../external/@floating-ui/react/dist/floating-ui.react.es.js";
1
+ import { jsxs as Ft, Fragment as wt, jsx as D } from "react/jsx-runtime";
2
+ import { useFloating as Nt, useClick as kt, useInteractions as Pt, useDismiss as Ot, useRole as Et, FloatingPortal as Rt, FloatingFocusManager as It } from "../../../../../external/@floating-ui/react/dist/floating-ui.react.es.js";
3
3
  import B from "../../../../../external/classnames/index.es.js";
4
4
  import F, { useState as _, useCallback as me, useEffect as T, useMemo as pe } from "react";
5
- import { Calendar as It } from "../../content/calendar/calendar.es.js";
6
- import { MultiValueField as Vt } from "../multi-value-field/multi-value-field.es.js";
7
- import { TextField as Bt } from "../textfield/textfield.es.js";
8
- import y from "./date-field.module.scss.es.js";
9
- import { getLocaleDateParts as Tt, buildDateRegexSource as $t, resolveRangeSelection as Lt, CALENDAR_POPOVER_OFFSET as Yt, CALENDAR_POPOVER_PADDING as We } from "./date-field-helpers.es.js";
10
- import { DatePickerModal as jt } from "./date-picker-modal/date-picker-modal.es.js";
11
- import { useBreakpointProps as Ht } from "../../../helpers/hooks/use-breakpoint-props.es.js";
12
- import { useLabels as Wt } from "../../../providers/label-provider/use-labels.es.js";
13
- import { et as St } from "../../../../../external/react-day-picker/dist/esm/locale/et.es.js";
14
- import Ut, { isBreakpointBelow as Se } from "../../../helpers/hooks/use-breakpoint.es.js";
15
- import { autoUpdate as qt } from "../../../../../external/@floating-ui/dom/dist/floating-ui.dom.es.js";
16
- import { offset as zt, flip as Gt, shift as Xt, size as Jt } from "../../../../../external/@floating-ui/react-dom/dist/floating-ui.react-dom.es.js";
17
- import { dateMatchModifiers as Kt } from "../../../../../external/react-day-picker/dist/esm/utils/dateMatchModifiers.es.js";
18
- const Qt = F.forwardRef((w, N) => {
19
- const { getCurrentBreakpointProps: Ue } = Ht(w.defaultServerBreakpoint), { getLabel: G } = Wt(), {
20
- useNativePicker: qe = !1,
5
+ import { Calendar as Vt } from "../../content/calendar/calendar.es.js";
6
+ import { MultiValueField as Bt } from "../multi-value-field/multi-value-field.es.js";
7
+ import { TextField as Tt } from "../textfield/textfield.es.js";
8
+ import b from "./date-field.module.scss.es.js";
9
+ import { getLocaleDateParts as $t, buildDateRegexSource as Lt, resolveRangeSelection as Yt, CALENDAR_POPOVER_OFFSET as jt, CALENDAR_POPOVER_PADDING as Se } from "./date-field-helpers.es.js";
10
+ import { DatePickerModal as Ht } from "./date-picker-modal/date-picker-modal.es.js";
11
+ import { useBreakpointProps as Wt } from "../../../helpers/hooks/use-breakpoint-props.es.js";
12
+ import { useLabels as St } from "../../../providers/label-provider/use-labels.es.js";
13
+ import { et as Ut } from "../../../../../external/react-day-picker/dist/esm/locale/et.es.js";
14
+ import qt, { isBreakpointBelow as Ue } from "../../../helpers/hooks/use-breakpoint.es.js";
15
+ import { autoUpdate as zt } from "../../../../../external/@floating-ui/dom/dist/floating-ui.dom.es.js";
16
+ import { offset as Gt, flip as Xt, shift as Jt, size as Kt } from "../../../../../external/@floating-ui/react-dom/dist/floating-ui.react-dom.es.js";
17
+ import { dateMatchModifiers as Qt } from "../../../../../external/react-day-picker/dist/esm/utils/dateMatchModifiers.es.js";
18
+ const Zt = F.forwardRef((w, N) => {
19
+ const { getCurrentBreakpointProps: qe } = Wt(w.defaultServerBreakpoint), { getLabel: G } = St(), {
20
+ useNativePicker: ze = !1,
21
21
  enableCalendar: m = !0,
22
22
  calendarTrigger: $ = "button",
23
23
  numberOfMonths: X,
24
24
  clearable: he = !0
25
- } = Ue(w), {
25
+ } = qe(w), {
26
26
  id: ge,
27
27
  mode: o = "single",
28
- label: ye,
28
+ label: be,
29
+ labelProps: ye,
29
30
  selected: L,
30
- onSelect: a,
31
+ onSelect: i,
31
32
  disabled: k,
32
33
  disabledMatchers: P,
33
- placeholder: ze,
34
- className: Ge,
34
+ placeholder: Ge,
35
+ className: Xe,
35
36
  formatDate: d,
36
37
  required: Y,
37
- showOutsideDays: be = !0,
38
+ showOutsideDays: De = !0,
38
39
  parseDate: J,
39
- monthYearSelectType: De,
40
- minYear: _e,
41
- maxYear: Ce,
42
- dayStatus: Me,
43
- tagsDirection: Xe,
44
- showNavigation: xe = !0,
40
+ monthYearSelectType: _e,
41
+ minYear: Ce,
42
+ maxYear: Me,
43
+ dayStatus: xe,
44
+ tagsDirection: Je,
45
+ showNavigation: Ae = !0,
45
46
  selectionLevel: O = "days",
46
47
  initialView: j,
47
- locale: Ae = St,
48
+ locale: ve = Ut,
48
49
  localeCode: H = "et-EE",
49
50
  initialMonth: W,
50
- closeOnSelect: Je,
51
- footer: ve,
51
+ closeOnSelect: Ke,
52
+ footer: Fe,
52
53
  defaultValue: S,
53
54
  minDate: K,
54
55
  maxDate: Q,
55
- disablePast: Fe,
56
- disableFuture: we,
56
+ disablePast: we,
57
+ disableFuture: Ne,
57
58
  shouldDisableMonth: Z,
58
59
  shouldDisableYear: ee,
59
60
  readOnly: E,
60
- availableDays: Ne,
61
- inputProps: i,
61
+ availableDays: ke,
62
+ inputProps: a,
62
63
  modal: te = !1,
63
- modalProps: Ke,
64
- modalTitle: Qe,
65
- disabledDateErrorMessage: Ze = G("dateField.disabledDateError"),
66
- invalidDateErrorMessage: et = G("dateField.invalidDateError"),
67
- useNativePicker: Zt,
68
- enableCalendar: er,
69
- calendarTrigger: tr,
70
- numberOfMonths: rr,
71
- defaultServerBreakpoint: ar,
72
- sm: ir,
73
- md: or,
74
- lg: nr,
75
- xl: sr,
76
- xxl: lr,
77
- ...ke
78
- } = w, c = qe && o === "single", Pe = Ut(w.defaultServerBreakpoint), A = Se(Pe, "md"), [tt, p] = _(L ?? S), [h, R] = _(!1), [re, Oe] = _(!1), [rt, Ee] = _(j ?? O), [ae, b] = _(""), [Re, u] = _(!1), [Ie, U] = _(!1), g = m && !c && !E && (te === !0 || typeof te == "string" && Se(Pe, te)), Ve = A && !g && typeof X == "number" && X > 1 ? 1 : X, { current: f } = F.useRef("selected" in w), n = f ? L : tt, ie = F.useRef(null), Be = F.useRef(null), at = F.useCallback(
64
+ modalProps: Qe,
65
+ modalTitle: Ze,
66
+ disabledDateErrorMessage: et = G("dateField.disabledDateError"),
67
+ invalidDateErrorMessage: tt = G("dateField.invalidDateError"),
68
+ useNativePicker: er,
69
+ enableCalendar: tr,
70
+ calendarTrigger: rr,
71
+ numberOfMonths: ar,
72
+ defaultServerBreakpoint: ir,
73
+ sm: or,
74
+ md: nr,
75
+ lg: sr,
76
+ xl: lr,
77
+ xxl: fr,
78
+ ...Pe
79
+ } = w, c = ze && o === "single", Oe = qt(w.defaultServerBreakpoint), A = Ue(Oe, "md"), [rt, p] = _(L ?? S), [h, R] = _(!1), [re, Ee] = _(!1), [at, Re] = _(j ?? O), [ae, y] = _(""), [Ie, u] = _(!1), [Ve, U] = _(!1), g = m && !c && !E && (te === !0 || typeof te == "string" && Ue(Oe, te)), Be = A && !g && typeof X == "number" && X > 1 ? 1 : X, { current: f } = F.useRef("selected" in w), n = f ? L : rt, ie = F.useRef(null), Te = F.useRef(null), it = F.useCallback(
79
80
  (e) => {
80
81
  ie.current = e, typeof N == "function" ? N(e) : N && (N.current = e);
81
82
  },
82
83
  [N]
83
- ), it = (e) => {
84
+ ), ot = (e) => {
84
85
  if (!e) return "";
85
86
  const t = e.getFullYear(), r = String(e.getMonth() + 1).padStart(2, "0"), s = String(e.getDate()).padStart(2, "0");
86
87
  return `${t}-${r}-${s}`;
87
- }, ot = c && n instanceof Date ? it(n) : "", oe = me((e, t) => e instanceof Date ? e : Array.isArray(e) && e.length > 0 ? [...e].sort((r, s) => r.getTime() - s.getTime())[0] : e && typeof e == "object" && "from" in e && e.from instanceof Date ? e.from : e && typeof e == "object" && "to" in e && e.to instanceof Date ? e.to : t ?? /* @__PURE__ */ new Date(), []), [nt, ne] = _(() => oe(n, W));
88
+ }, nt = c && n instanceof Date ? ot(n) : "", oe = me((e, t) => e instanceof Date ? e : Array.isArray(e) && e.length > 0 ? [...e].sort((r, s) => r.getTime() - s.getTime())[0] : e && typeof e == "object" && "from" in e && e.from instanceof Date ? e.from : e && typeof e == "object" && "to" in e && e.to instanceof Date ? e.to : t ?? /* @__PURE__ */ new Date(), []), [st, ne] = _(() => oe(n, W));
88
89
  T(() => {
89
90
  h || ne(oe(n, W));
90
91
  }, [n, W, h, oe]), T(() => {
91
- h && Ee(j ?? O);
92
+ h && Re(j ?? O);
92
93
  }, [h, O, j]), T(() => {
93
94
  f && p(L);
94
95
  }, [L, f]);
@@ -111,47 +112,47 @@ const Qt = F.forwardRef((w, N) => {
111
112
  return "";
112
113
  },
113
114
  [C]
114
- ), se = Je ?? o === "single", Te = o === "multiple" && Array.isArray(n) ? n.map((e, t) => ({
115
+ ), se = Ke ?? o === "single", $e = o === "multiple" && Array.isArray(n) ? n.map((e, t) => ({
115
116
  id: t,
116
117
  label: d ? d(e) : M(e),
117
118
  date: e
118
119
  })) : [], q = pe(() => {
119
120
  const e = [];
120
- return k && (Array.isArray(k) ? e.push(...k) : e.push(k)), P && (Array.isArray(P) ? e.push(...P) : e.push(P)), K && e.push({ before: K }), Q && e.push({ after: Q }), Fe && e.push({ before: /* @__PURE__ */ new Date() }), we && e.push({ after: /* @__PURE__ */ new Date() }), Z && e.push((t) => Z(t)), ee && e.push((t) => ee(t)), e;
121
+ return k && (Array.isArray(k) ? e.push(...k) : e.push(k)), P && (Array.isArray(P) ? e.push(...P) : e.push(P)), K && e.push({ before: K }), Q && e.push({ after: Q }), we && e.push({ before: /* @__PURE__ */ new Date() }), Ne && e.push({ after: /* @__PURE__ */ new Date() }), Z && e.push((t) => Z(t)), ee && e.push((t) => ee(t)), e;
121
122
  }, [
122
123
  k,
123
124
  P,
124
125
  K,
125
126
  Q,
126
- Fe,
127
127
  we,
128
+ Ne,
128
129
  Z,
129
130
  ee
130
131
  ]), v = me(
131
- (e) => Kt(e, q),
132
+ (e) => Qt(e, q),
132
133
  [q]
133
- ), st = (e, t, r, s) => {
134
- const l = o === "range" ? Lt(e, n, t) : e;
135
- if (u(!1), f || p(l), a == null || a(l, t, r, s), l) {
134
+ ), lt = (e, t, r, s) => {
135
+ const l = o === "range" ? Yt(e, n, t) : e;
136
+ if (u(!1), f || p(l), i == null || i(l, t, r, s), l) {
136
137
  const x = d ? d(l) : M(l);
137
- b(x);
138
+ y(x);
138
139
  } else
139
- b("");
140
+ y("");
140
141
  se && R(!1);
141
- }, lt = (e) => {
142
+ }, ft = (e) => {
142
143
  if (v(e)) return;
143
144
  const t = o === "range" ? { from: e, to: void 0 } : o === "multiple" ? [...Array.isArray(n) ? n : [], e] : e;
144
- u(!1), f || p(t), a == null || a(t, e, {}, {});
145
+ u(!1), f || p(t), i == null || i(t, e, {}, {});
145
146
  const r = d ? d(t) : M(t);
146
- b(r), se && R(!1);
147
- }, ft = pe(() => {
148
- const e = Tt(C), t = new RegExp(`^${$t(e)}$`), { fieldOrder: r } = e;
147
+ y(r), se && R(!1);
148
+ }, dt = pe(() => {
149
+ const e = $t(C), t = new RegExp(`^${Lt(e)}$`), { fieldOrder: r } = e;
149
150
  return (s) => {
150
151
  const l = s.match(t);
151
152
  if (!l) return;
152
153
  const x = {};
153
- r.forEach((xt, At) => {
154
- x[xt] = Number(l[At + 1]);
154
+ r.forEach((At, vt) => {
155
+ x[At] = Number(l[vt + 1]);
155
156
  });
156
157
  const { day: de, month: ce, year: ue } = x;
157
158
  if (de === void 0 || ce === void 0 || ue === void 0) return;
@@ -159,14 +160,14 @@ const Qt = F.forwardRef((w, N) => {
159
160
  if (!(isNaN(V.getTime()) || V.getFullYear() !== ue || V.getMonth() !== ce - 1 || V.getDate() !== de))
160
161
  return V;
161
162
  };
162
- }, [C]), $e = (e) => (J ?? (o === "single" ? ft : () => {
163
- }))(e), Le = (e) => o === "single" && e instanceof Date || o === "multiple" && Array.isArray(e) || o === "range" && !!e && !Array.isArray(e) && "from" in e, dt = (e) => {
164
- if (b(e), U(!1), e.trim() === "") {
165
- u(!1), n !== void 0 && (f || p(void 0), a == null || a(void 0, void 0, {}, {}));
163
+ }, [C]), Le = (e) => (J ?? (o === "single" ? dt : () => {
164
+ }))(e), Ye = (e) => o === "single" && e instanceof Date || o === "multiple" && Array.isArray(e) || o === "range" && !!e && !Array.isArray(e) && "from" in e, ct = (e) => {
165
+ if (y(e), U(!1), e.trim() === "") {
166
+ u(!1), n !== void 0 && (f || p(void 0), i == null || i(void 0, void 0, {}, {}));
166
167
  return;
167
168
  }
168
- const t = $e(e);
169
- if (!Le(t)) {
169
+ const t = Le(e);
170
+ if (!Ye(t)) {
170
171
  u(!1);
171
172
  return;
172
173
  }
@@ -175,8 +176,8 @@ const Qt = F.forwardRef((w, N) => {
175
176
  u(!0);
176
177
  return;
177
178
  }
178
- u(!1), f || p(t), a == null || a(t, t, {}, {}), t instanceof Date && ne(t), se && R(!1);
179
- }, ct = () => {
179
+ u(!1), f || p(t), i == null || i(t, t, {}, {}), t instanceof Date && ne(t), se && R(!1);
180
+ }, ut = () => {
180
181
  if (ae.trim() === "") {
181
182
  U(!1);
182
183
  return;
@@ -185,29 +186,29 @@ const Qt = F.forwardRef((w, N) => {
185
186
  U(!1);
186
187
  return;
187
188
  }
188
- U(!Le($e(ae)));
189
+ U(!Ye(Le(ae)));
189
190
  };
190
191
  T(() => {
191
192
  if (f) {
192
193
  const e = d ? d(n) : M(n);
193
- b(e);
194
+ y(e);
194
195
  }
195
196
  }, [n, f, d, M]), T(() => {
196
197
  if (!f && S) {
197
198
  const e = d ? d(S) : M(S);
198
- b(e);
199
+ y(e);
199
200
  }
200
201
  }, []);
201
- const ut = wt({
202
+ const mt = Nt({
202
203
  open: h,
203
204
  onOpenChange: R,
204
205
  placement: $ === "input" ? "bottom-start" : "bottom-end",
205
206
  middleware: [
206
- zt(Yt),
207
- Gt(),
208
- Xt({ padding: We }),
209
- Jt({
210
- padding: We,
207
+ Gt(jt),
208
+ Xt(),
209
+ Jt({ padding: Se }),
210
+ Kt({
211
+ padding: Se,
211
212
  apply({ availableWidth: e, elements: t }) {
212
213
  const r = t.floating;
213
214
  if (r.style.width = "", r.style.maxWidth = "", r.style.overflowX = "", A) return;
@@ -215,20 +216,20 @@ const Qt = F.forwardRef((w, N) => {
215
216
  }
216
217
  })
217
218
  ],
218
- whileElementsMounted: qt
219
- }), { refs: I, context: z, x: mt, y: pt, strategy: ht } = ut, gt = Nt(z), Ye = kt([
220
- ...m && !c && $ === "input" && !g ? [gt] : [],
221
- Pt(z, {
219
+ whileElementsMounted: zt
220
+ }), { refs: I, context: z, x: pt, y: ht, strategy: gt } = mt, bt = kt(z), je = Pt([
221
+ ...m && !c && $ === "input" && !g ? [bt] : [],
222
+ Ot(z, {
222
223
  outsidePress: (e) => {
223
224
  const t = e.target;
224
225
  return !(t != null && t.closest('[role="menu"], [role="listbox"]'));
225
226
  }
226
227
  }),
227
- Ot(z, { role: "dialog" })
228
+ Et(z, { role: "dialog" })
228
229
  ]);
229
230
  F.useEffect(() => {
230
231
  var t, r;
231
- const e = o === "multiple" ? ((t = Be.current) == null ? void 0 : t.wrapper) ?? null : ((r = ie.current) == null ? void 0 : r.input) ?? null;
232
+ const e = o === "multiple" ? ((t = Te.current) == null ? void 0 : t.wrapper) ?? null : ((r = ie.current) == null ? void 0 : r.input) ?? null;
232
233
  I.setPositionReference(e ?? I.reference.current);
233
234
  }, [o, h, I]);
234
235
  const yt = () => {
@@ -244,16 +245,16 @@ const Qt = F.forwardRef((w, N) => {
244
245
  e.focus();
245
246
  }
246
247
  }, le = () => {
247
- !m || E || (c ? yt() : g ? Oe(!0) : R((e) => !e));
248
- }, bt = (e) => {
249
- if (u(!1), f || p(e), a == null || a(e, e, {}, {}), e) {
248
+ !m || E || (c ? yt() : g ? Ee(!0) : R((e) => !e));
249
+ }, Dt = (e) => {
250
+ if (u(!1), f || p(e), i == null || i(e, e, {}, {}), e) {
250
251
  const t = d ? d(e) : M(e);
251
- b(t);
252
+ y(t);
252
253
  } else
253
- b("");
254
- }, Dt = (e) => {
254
+ y("");
255
+ }, _t = (e) => {
255
256
  if (!e) {
256
- u(!1), f || p(void 0), a == null || a(void 0, void 0, {}, {});
257
+ u(!1), f || p(void 0), i == null || i(void 0, void 0, {}, {});
257
258
  return;
258
259
  }
259
260
  const [t, r, s] = e.split("-").map(Number);
@@ -264,90 +265,92 @@ const Qt = F.forwardRef((w, N) => {
264
265
  u(!0);
265
266
  return;
266
267
  }
267
- u(!1), f || p(l), a == null || a(l, l, {}, {});
268
+ u(!1), f || p(l), i == null || i(l, l, {}, {});
268
269
  }
269
- }, _t = Ye.getReferenceProps(
270
+ }, Ct = je.getReferenceProps(
270
271
  g && $ === "input" ? { onClick: () => le() } : void 0
271
272
  ), {
272
- role: fr,
273
- "aria-expanded": dr,
274
- "aria-haspopup": cr,
275
- "aria-controls": Ct,
276
- ...Mt
277
- } = _t, je = g ? void 0 : Ct, fe = G("dateField.openCalendar"), He = {
273
+ role: dr,
274
+ "aria-expanded": cr,
275
+ "aria-haspopup": ur,
276
+ "aria-controls": Mt,
277
+ ...xt
278
+ } = Ct, He = g ? void 0 : Mt, fe = G("dateField.openCalendar"), We = {
278
279
  "aria-label": fe,
279
280
  "aria-expanded": g ? re : h,
280
281
  "aria-haspopup": "dialog",
281
- "aria-controls": je
282
+ "aria-controls": He
282
283
  };
283
- return /* @__PURE__ */ vt(Ft, { children: [
284
+ return /* @__PURE__ */ Ft(wt, { children: [
284
285
  /* @__PURE__ */ D(
285
286
  "div",
286
287
  {
287
- className: B(y["tedi-date-field__container"], Ge),
288
- ...Mt,
288
+ className: B(b["tedi-date-field__container"], Xe),
289
+ ...xt,
289
290
  ref: I.setReference,
290
291
  children: o === "multiple" ? /* @__PURE__ */ D(
291
- Vt,
292
+ Bt,
292
293
  {
293
- ...i,
294
- ref: Be,
294
+ ...a,
295
+ ref: Te,
295
296
  id: ge,
296
- label: ye,
297
- tagsDirection: Xe,
298
- values: Te.map((e) => e.label),
297
+ label: be,
298
+ labelProps: ye ?? (a == null ? void 0 : a.labelProps),
299
+ tagsDirection: Je,
300
+ values: $e.map((e) => e.label),
299
301
  icon: "calendar_today",
300
302
  onIconClick: le,
301
- iconButtonProps: m ? He : { "aria-label": fe },
303
+ iconButtonProps: m ? We : { "aria-label": fe },
302
304
  isClearable: he,
303
305
  required: Y,
304
306
  onChange: (e) => {
305
307
  if (!Array.isArray(n)) return;
306
- const t = Te.filter((r) => e.includes(r.label)).map((r) => r.date);
307
- f || p(t), a == null || a(t, {}, {}, {});
308
+ const t = $e.filter((r) => e.includes(r.label)).map((r) => r.date);
309
+ f || p(t), i == null || i(t, {}, {}, {});
308
310
  },
309
- className: B(y["tedi-date-field__textfield"], {
310
- [y["tedi-date-field__icon--disabled"]]: !m || E
311
+ className: B(b["tedi-date-field__textfield"], {
312
+ [b["tedi-date-field__icon--disabled"]]: !m || E
311
313
  })
312
314
  }
313
315
  ) : /* @__PURE__ */ D(
314
- Bt,
316
+ Tt,
315
317
  {
316
- ...i,
317
- ref: at,
318
+ ...a,
319
+ ref: it,
318
320
  id: ge,
319
- label: ye,
321
+ label: be,
322
+ labelProps: ye ?? (a == null ? void 0 : a.labelProps),
320
323
  readOnly: E,
321
- value: c ? ot : ae,
322
- placeholder: ze,
324
+ value: c ? nt : ae,
325
+ placeholder: Ge,
323
326
  icon: "calendar_today",
324
327
  isClearable: he,
325
328
  onIconClick: le,
326
- iconButtonProps: m && !c ? He : { "aria-label": fe },
327
- onChange: (e) => c ? Dt(e) : dt(e),
329
+ iconButtonProps: m && !c ? We : { "aria-label": fe },
330
+ onChange: (e) => c ? _t(e) : ct(e),
328
331
  onBlur: (e) => {
329
332
  var t;
330
- c || ct(), (t = i == null ? void 0 : i.onBlur) == null || t.call(i, e);
333
+ c || ut(), (t = a == null ? void 0 : a.onBlur) == null || t.call(a, e);
331
334
  },
332
335
  required: Y,
333
- invalid: Re || Ie || (i == null ? void 0 : i.invalid),
336
+ invalid: Ie || Ve || (a == null ? void 0 : a.invalid),
334
337
  helper: (() => {
335
- const e = i == null ? void 0 : i.helper, t = Re ? Ze : Ie ? et : null, r = t ? { text: t, type: "error" } : null;
338
+ const e = a == null ? void 0 : a.helper, t = Ie ? et : Ve ? tt : null, r = t ? { text: t, type: "error" } : null;
336
339
  return r ? e ? Array.isArray(e) ? [...e, r] : [e, r] : r : e;
337
340
  })(),
338
- className: B(y["tedi-date-field__textfield"], {
339
- [y["tedi-date-field__textfield--disabled"]]: i == null ? void 0 : i.disabled,
340
- [y["tedi-date-field__icon--disabled"]]: !m || E
341
+ className: B(b["tedi-date-field__textfield"], {
342
+ [b["tedi-date-field__textfield--disabled"]]: a == null ? void 0 : a.disabled,
343
+ [b["tedi-date-field__icon--disabled"]]: !m || E
341
344
  }),
342
345
  input: {
343
- ...i == null ? void 0 : i.input,
346
+ ...a == null ? void 0 : a.input,
344
347
  ...!J && o !== "single" && { readOnly: !0 },
345
348
  ...c && { type: "date" },
346
349
  ...m && !c && $ === "input" ? {
347
350
  role: "combobox",
348
351
  "aria-haspopup": "dialog",
349
352
  "aria-expanded": g ? re : h,
350
- "aria-controls": je
353
+ "aria-controls": He
351
354
  } : {}
352
355
  }
353
356
  }
@@ -355,77 +358,77 @@ const Qt = F.forwardRef((w, N) => {
355
358
  }
356
359
  ),
357
360
  g && /* @__PURE__ */ D(
358
- jt,
361
+ Ht,
359
362
  {
360
363
  open: re,
361
- onOpenChange: Oe,
364
+ onOpenChange: Ee,
362
365
  value: n,
363
- onConfirm: bt,
366
+ onConfirm: Dt,
364
367
  mode: o,
365
- numberOfMonths: Ve,
366
- locale: Ae,
368
+ numberOfMonths: Be,
369
+ locale: ve,
367
370
  localeCode: H,
368
- showOutsideDays: be,
371
+ showOutsideDays: De,
369
372
  disabledMatchers: q,
370
373
  required: Y,
371
- availableDays: Ne,
372
- footer: ve,
373
- monthYearSelectType: De,
374
- minYear: _e,
375
- maxYear: Ce,
376
- dayStatus: Me,
377
- showNavigation: xe,
374
+ availableDays: ke,
375
+ footer: Fe,
376
+ monthYearSelectType: _e,
377
+ minYear: Ce,
378
+ maxYear: Me,
379
+ dayStatus: xe,
380
+ showNavigation: Ae,
378
381
  selectionLevel: O,
379
382
  initialView: j,
380
383
  initialMonth: W,
381
- modalProps: Ke,
382
- ...ke,
383
- title: Qe
384
+ modalProps: Qe,
385
+ ...Pe,
386
+ title: Ze
384
387
  }
385
388
  ),
386
- m && !c && !g && /* @__PURE__ */ D(Et, { children: h && /* @__PURE__ */ D(Rt, { context: z, modal: !1, initialFocus: -1, children: /* @__PURE__ */ D(
389
+ m && !c && !g && /* @__PURE__ */ D(Rt, { children: h && /* @__PURE__ */ D(It, { context: z, modal: !1, initialFocus: -1, children: /* @__PURE__ */ D(
387
390
  "div",
388
391
  {
389
392
  ref: I.setFloating,
390
393
  className: B({
391
- [y["tedi-date-field__calendar-popover--fullwidth"]]: A
394
+ [b["tedi-date-field__calendar-popover--fullwidth"]]: A
392
395
  }),
393
- ...Ye.getFloatingProps({
396
+ ...je.getFloatingProps({
394
397
  style: {
395
- position: ht,
396
- top: pt ?? 0,
397
- left: A ? 0 : mt ?? 0,
398
+ position: gt,
399
+ top: ht ?? 0,
400
+ left: A ? 0 : pt ?? 0,
398
401
  right: A ? 0 : void 0
399
402
  }
400
403
  }),
401
404
  children: /* @__PURE__ */ D(
402
- It,
405
+ Vt,
403
406
  {
404
- ...ke,
405
- numberOfMonths: Ve,
406
- view: rt,
407
+ ...Pe,
408
+ numberOfMonths: Be,
409
+ view: at,
407
410
  selectionLevel: O,
408
- currentMonth: nt,
411
+ currentMonth: st,
409
412
  setCurrentMonth: ne,
410
- setView: Ee,
413
+ setView: Re,
411
414
  mode: o,
412
415
  value: n,
413
- locale: Ae,
416
+ locale: ve,
414
417
  localeCode: H,
415
- showOutsideDays: be,
418
+ showOutsideDays: De,
416
419
  disabledMatchers: q,
417
420
  required: Y,
418
- availableDays: Ne,
419
- footer: ve,
420
- monthYearSelectType: De,
421
- minYear: _e,
422
- maxYear: Ce,
423
- dayStatus: Me,
424
- showNavigation: xe,
425
- handleSelect: st,
426
- applyValue: lt,
427
- className: B(y["tedi-date-field__calendar"], {
428
- [y["tedi-date-field__calendar--fullwidth"]]: A
421
+ availableDays: ke,
422
+ footer: Fe,
423
+ monthYearSelectType: _e,
424
+ minYear: Ce,
425
+ maxYear: Me,
426
+ dayStatus: xe,
427
+ showNavigation: Ae,
428
+ handleSelect: lt,
429
+ applyValue: ft,
430
+ className: B(b["tedi-date-field__calendar"], {
431
+ [b["tedi-date-field__calendar--fullwidth"]]: A
429
432
  })
430
433
  }
431
434
  )
@@ -433,7 +436,7 @@ const Qt = F.forwardRef((w, N) => {
433
436
  ) }) })
434
437
  ] });
435
438
  });
436
- Qt.displayName = "DateField";
439
+ Zt.displayName = "DateField";
437
440
  export {
438
- Qt as DateField
441
+ Zt as DateField
439
442
  };