@tedi-design-system/react 19.0.0-rc.12 → 19.0.0-rc.13

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.
@@ -1,19 +1,19 @@
1
- import { jsxs as q, jsx as i, Fragment as fe } from "react/jsx-runtime";
2
- import { useFloating as me, useClick as ue, useDismiss as pe, useRole as ge, useInteractions as he, FloatingPortal as ke, FloatingFocusManager as ve } from "../../../../../external/@floating-ui/react/dist/floating-ui.react.es.js";
1
+ import { jsxs as q, jsx as i, Fragment as me } from "react/jsx-runtime";
2
+ import { useFloating as ue, useClick as pe, useDismiss as ge, useRole as he, useInteractions as ke, FloatingPortal as ve, FloatingFocusManager as be } from "../../../../../external/@floating-ui/react/dist/floating-ui.react.es.js";
3
3
  import y from "../../../../../external/classnames/index.es.js";
4
- import be, { useState as N, useEffect as z } from "react";
4
+ import Ce, { useState as N, useEffect as z } from "react";
5
5
  import { TextField as A } from "../textfield/textfield.es.js";
6
- import { TimePicker as Ce } from "../time-picker/time-picker.es.js";
6
+ import { TimePicker as xe } from "../time-picker/time-picker.es.js";
7
7
  import d from "./time-field.module.scss.es.js";
8
- import { normalizeTime as xe, TIMEPICKER_OFFSET as _e } from "./time-field-helpers.es.js";
9
- import { TimePickerModal as Fe } from "./time-picker-modal/time-picker-modal.es.js";
10
- import { useBreakpointProps as Pe } from "../../../helpers/hooks/use-breakpoint-props.es.js";
11
- import Te, { isBreakpointBelow as we } from "../../../helpers/hooks/use-breakpoint.es.js";
8
+ import { normalizeTime as _e, TIMEPICKER_OFFSET as Fe } from "./time-field-helpers.es.js";
9
+ import { TimePickerModal as Pe } from "./time-picker-modal/time-picker-modal.es.js";
10
+ import { useBreakpointProps as Te } from "../../../helpers/hooks/use-breakpoint-props.es.js";
11
+ import we, { isBreakpointBelow as Ie } from "../../../helpers/hooks/use-breakpoint.es.js";
12
12
  import { Dropdown as b } from "../../overlays/dropdown/dropdown.es.js";
13
- import { autoUpdate as Ie } from "../../../../../external/@floating-ui/dom/dist/floating-ui.dom.es.js";
14
- import { offset as ye, flip as Ne, shift as Be } from "../../../../../external/@floating-ui/react-dom/dist/floating-ui.react-dom.es.js";
15
- const Oe = (C) => {
16
- const { getCurrentBreakpointProps: K } = Pe(C.defaultServerBreakpoint), {
13
+ import { autoUpdate as ye } from "../../../../../external/@floating-ui/dom/dist/floating-ui.dom.es.js";
14
+ import { offset as Ne, flip as Be, shift as Oe } from "../../../../../external/@floating-ui/react-dom/dist/floating-ui.react-dom.es.js";
15
+ const Me = (C) => {
16
+ const { getCurrentBreakpointProps: K } = Te(C.defaultServerBreakpoint), {
17
17
  id: G,
18
18
  label: H,
19
19
  value: c,
@@ -33,32 +33,33 @@ const Oe = (C) => {
33
33
  useNativePicker: X = !1,
34
34
  timePickerTrigger: M = "button",
35
35
  showPicker: o = !0,
36
- availableTimesVariant: F = "grid-buttons"
37
- } = K(C), R = c !== void 0, [Y, V] = N(c ?? J ?? ""), f = R ? c : Y, [P, T] = N(!1), [Z, E] = N(!1), m = M === "input", l = X, $ = Te(), u = !l && o && !h && !s && (_ === !0 || typeof _ == "string" && we($, _)), ee = me({
36
+ availableTimesVariant: F = "grid-buttons",
37
+ clearable: Y = !0
38
+ } = K(C), R = c !== void 0, [Z, V] = N(c ?? J ?? ""), f = R ? c : Z, [P, T] = N(!1), [$, E] = N(!1), m = M === "input", l = X, ee = we(), u = !l && o && !h && !s && (_ === !0 || typeof _ == "string" && Ie(ee, _)), te = ue({
38
39
  open: P,
39
40
  onOpenChange: T,
40
41
  placement: m ? "bottom-start" : "bottom-end",
41
- middleware: [ye(_e), Ne(), Be()],
42
- whileElementsMounted: Ie
43
- }), { refs: w, context: k, x: te, y: ie, strategy: oe } = ee, ne = ue(k), re = pe(k), le = ge(k, { role: "listbox" }), U = o && m && !h && !s && !l && !u, D = he([...U ? [ne] : [], re, le]), p = (e) => {
42
+ middleware: [Ne(Fe), Be(), Oe()],
43
+ whileElementsMounted: ye
44
+ }), { refs: w, context: k, x: ie, y: oe, strategy: ne } = te, re = pe(k), le = ge(k), se = he(k, { role: "listbox" }), U = o && m && !h && !s && !l && !u, D = ke([...U ? [re] : [], le, se]), p = (e) => {
44
45
  const n = e.trim();
45
46
  R || V(n), x == null || x(n);
46
- }, se = (e) => {
47
+ }, ae = (e) => {
47
48
  var v;
48
49
  const n = e.target.value ?? "";
49
50
  (v = t == null ? void 0 : t.onBlur) == null || v.call(t, e);
50
- const r = xe(n);
51
+ const r = _e(n);
51
52
  r !== null && r !== n && p(r);
52
53
  };
53
54
  z(() => {
54
55
  c !== void 0 && V(c);
55
56
  }, [c]);
56
- const g = be.useRef(null);
57
+ const g = Ce.useRef(null);
57
58
  z(() => {
58
59
  var e;
59
60
  (e = g.current) != null && e.inner && w.setReference(g.current.inner);
60
61
  }, [w]);
61
- const ae = () => {
62
+ const de = () => {
62
63
  var n;
63
64
  const e = (n = g.current) == null ? void 0 : n.input;
64
65
  if (e) {
@@ -68,8 +69,8 @@ const Oe = (C) => {
68
69
  }
69
70
  e.focus();
70
71
  }
71
- }, de = () => T((e) => !e), S = () => E(!0), ce = () => {
72
- !o || s || (l ? ae() : u ? S() : M === "button" && de());
72
+ }, ce = () => T((e) => !e), S = () => E(!0), fe = () => {
73
+ !o || s || (l ? de() : u ? S() : M === "button" && ce());
73
74
  }, j = u && m && !h ? () => {
74
75
  S();
75
76
  } : void 0, I = {
@@ -81,11 +82,11 @@ const Oe = (C) => {
81
82
  readOnly: h || !l && m,
82
83
  disabled: s || (t == null ? void 0 : t.disabled),
83
84
  icon: o ? "schedule" : { name: "schedule", color: "inherit" },
84
- isClearable: !0,
85
+ isClearable: Y,
85
86
  required: L,
86
- onIconClick: o ? ce : void 0,
87
+ onIconClick: o ? fe : void 0,
87
88
  onChange: p,
88
- onBlur: se,
89
+ onBlur: ae,
89
90
  className: y(
90
91
  d["tedi-time-field__textfield"],
91
92
  { [d["tedi-time-field__icon--disabled"]]: !o || s },
@@ -125,7 +126,7 @@ const Oe = (C) => {
125
126
  /* @__PURE__ */ i(b.Content, { children: a.map((r, v) => /* @__PURE__ */ i(b.Item, { index: v, active: r === f, onClick: () => p(r), children: r }, r)) })
126
127
  ] });
127
128
  }
128
- return /* @__PURE__ */ q(fe, { children: [
129
+ return /* @__PURE__ */ q(me, { children: [
129
130
  /* @__PURE__ */ i(
130
131
  "div",
131
132
  {
@@ -137,9 +138,9 @@ const Oe = (C) => {
137
138
  }
138
139
  ),
139
140
  u && /* @__PURE__ */ i(
140
- Fe,
141
+ Pe,
141
142
  {
142
- open: Z,
143
+ open: $,
143
144
  onOpenChange: E,
144
145
  value: f,
145
146
  onConfirm: p,
@@ -149,19 +150,19 @@ const Oe = (C) => {
149
150
  modalProps: W
150
151
  }
151
152
  ),
152
- !l && o && !s && !u && /* @__PURE__ */ i(ke, { children: P && /* @__PURE__ */ i(ve, { context: k, modal: !1, initialFocus: -1, children: /* @__PURE__ */ i(
153
+ !l && o && !s && !u && /* @__PURE__ */ i(ve, { children: P && /* @__PURE__ */ i(be, { context: k, modal: !1, initialFocus: -1, children: /* @__PURE__ */ i(
153
154
  "div",
154
155
  {
155
156
  ref: w.setFloating,
156
157
  ...D.getFloatingProps({
157
158
  style: {
158
- position: oe,
159
- top: ie ?? 0,
160
- left: te ?? 0
159
+ position: ne,
160
+ top: oe ?? 0,
161
+ left: ie ?? 0
161
162
  }
162
163
  }),
163
164
  children: /* @__PURE__ */ i(
164
- Ce,
165
+ xe,
165
166
  {
166
167
  value: f,
167
168
  stepMinutes: B,
@@ -177,7 +178,7 @@ const Oe = (C) => {
177
178
  ) }) })
178
179
  ] });
179
180
  };
180
- Oe.displayName = "TimeField";
181
+ Me.displayName = "TimeField";
181
182
  export {
182
- Oe as TimeField
183
+ Me as TimeField
183
184
  };