@handijitcom/ui 2.0.1 → 3.0.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 (107) hide show
  1. package/README.md +67 -62
  2. package/build/calendar.cjs +1 -1
  3. package/build/calendar.cjs.map +1 -1
  4. package/build/calendar.css +1 -1
  5. package/build/calendar.js +109 -111
  6. package/build/calendar.js.map +1 -1
  7. package/build/chat.cjs +1 -1
  8. package/build/chat.cjs.map +1 -1
  9. package/build/chat.css +1 -1
  10. package/build/chat.js +2 -2
  11. package/build/chat.js.map +1 -1
  12. package/build/components/Alert/style.css +1 -1
  13. package/build/components/Avatar/index.cjs.map +1 -1
  14. package/build/components/Avatar/index.d.cts +1 -1
  15. package/build/components/Avatar/index.d.ts +1 -1
  16. package/build/components/Avatar/index.js.map +1 -1
  17. package/build/components/Avatar/style.css +1 -1
  18. package/build/components/Badge/index.cjs +1 -1
  19. package/build/components/Badge/index.cjs.map +1 -1
  20. package/build/components/Badge/index.d.cts +4 -2
  21. package/build/components/Badge/index.d.ts +4 -2
  22. package/build/components/Badge/index.js +1 -1
  23. package/build/components/Badge/index.js.map +1 -1
  24. package/build/components/Badge/style.css +1 -1
  25. package/build/components/BrandSurface/index.cjs +2 -0
  26. package/build/components/BrandSurface/index.cjs.map +1 -0
  27. package/build/components/BrandSurface/index.d.cts +46 -0
  28. package/build/components/BrandSurface/index.d.ts +46 -0
  29. package/build/components/BrandSurface/index.js +128 -0
  30. package/build/components/BrandSurface/index.js.map +1 -0
  31. package/build/components/BrandSurface/style.css +1 -0
  32. package/build/components/Button/index.cjs +1 -1
  33. package/build/components/Button/index.js +1 -1
  34. package/build/components/Button/style.css +1 -1
  35. package/build/components/CodeBadge/style.css +1 -1
  36. package/build/components/CopyField/style.css +1 -1
  37. package/build/components/DataTable/style.css +1 -1
  38. package/build/components/Eyebrow/index.cjs.map +1 -1
  39. package/build/components/Eyebrow/index.d.cts +1 -1
  40. package/build/components/Eyebrow/index.d.ts +1 -1
  41. package/build/components/Eyebrow/index.js.map +1 -1
  42. package/build/components/Eyebrow/style.css +1 -1
  43. package/build/components/Modal/style.css +1 -1
  44. package/build/components/Progress/index.cjs +1 -1
  45. package/build/components/Progress/index.cjs.map +1 -1
  46. package/build/components/Progress/index.d.cts +2 -2
  47. package/build/components/Progress/index.d.ts +2 -2
  48. package/build/components/Progress/index.js +1 -1
  49. package/build/components/Progress/index.js.map +1 -1
  50. package/build/components/Progress/style.css +1 -1
  51. package/build/components/Rating/style.css +1 -1
  52. package/build/components/RatingInput/style.css +1 -1
  53. package/build/components/Stat/style.css +1 -1
  54. package/build/components/StatStrip/index.cjs +1 -1
  55. package/build/components/StatStrip/index.cjs.map +1 -1
  56. package/build/components/StatStrip/index.d.cts +3 -3
  57. package/build/components/StatStrip/index.d.ts +3 -3
  58. package/build/components/StatStrip/index.js +1 -1
  59. package/build/components/StatStrip/index.js.map +1 -1
  60. package/build/components/StatStrip/style.css +1 -1
  61. package/build/components/StatusDot/index.cjs +1 -1
  62. package/build/components/StatusDot/index.cjs.map +1 -1
  63. package/build/components/StatusDot/index.d.cts +5 -3
  64. package/build/components/StatusDot/index.d.ts +5 -3
  65. package/build/components/StatusDot/index.js +1 -1
  66. package/build/components/StatusDot/index.js.map +1 -1
  67. package/build/components/StatusDot/style.css +1 -1
  68. package/build/components/TagInput/style.css +1 -1
  69. package/build/components/Textarea/style.css +1 -1
  70. package/build/components/Timeline/style.css +1 -1
  71. package/build/components/Toast/style.css +1 -1
  72. package/build/design/index.cjs +84 -178
  73. package/build/design/index.cjs.map +1 -1
  74. package/build/design/index.d.cts +72 -63
  75. package/build/design/index.d.mts +72 -63
  76. package/build/design/index.mjs +84 -178
  77. package/build/design/index.mjs.map +1 -1
  78. package/build/design/index.umd.cjs +1 -1
  79. package/build/design/index.umd.cjs.map +1 -1
  80. package/build/design/tokens.css +62 -177
  81. package/build/design/tokens.json +66 -168
  82. package/build/design/tokens.scss +48 -178
  83. package/build/enums/ui-variant.enum.cjs +1 -1
  84. package/build/enums/ui-variant.enum.cjs.map +1 -1
  85. package/build/enums/ui-variant.enum.d.cts +2 -2
  86. package/build/enums/ui-variant.enum.d.ts +2 -2
  87. package/build/enums/ui-variant.enum.js +1 -1
  88. package/build/enums/ui-variant.enum.js.map +1 -1
  89. package/build/index.cjs +1 -1
  90. package/build/index.d.cts +1 -1
  91. package/build/index.d.ts +1 -1
  92. package/build/index.js +11 -11
  93. package/build/scss/_mixins.scss +8 -10
  94. package/build/scss/_variables.scss +19 -39
  95. package/build/styles.css +21 -21
  96. package/build/types/calendar/Calendar/index.d.cts +1 -1
  97. package/build/types/calendar/Calendar/index.d.ts +1 -1
  98. package/build/types/calendar/core/types.d.cts +3 -2
  99. package/build/types/calendar/core/types.d.ts +3 -2
  100. package/package.json +11 -11
  101. package/build/components/Band/index.cjs +0 -2
  102. package/build/components/Band/index.cjs.map +0 -1
  103. package/build/components/Band/index.d.cts +0 -45
  104. package/build/components/Band/index.d.ts +0 -45
  105. package/build/components/Band/index.js +0 -126
  106. package/build/components/Band/index.js.map +0 -1
  107. package/build/components/Band/style.css +0 -1
package/build/calendar.js CHANGED
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { jsxs as L, jsx as p, Fragment as ye } from "react/jsx-runtime";
3
- import { useState as be, useRef as z, useCallback as se, useEffect as we, memo as ke, useId as Ae, useMemo as W } from "react";
3
+ import { useState as be, useRef as j, useCallback as se, useEffect as ke, memo as we, useId as Ae, useMemo as W } from "react";
4
4
  import { useUi as Ee, useAnnounce as Le } from "@handijitcom/ui";
5
- const R = (...e) => {
5
+ const K = (...e) => {
6
6
  let t = "";
7
7
  for (const n of e)
8
8
  n && (t = t === "" ? n : `${t} ${n}`);
@@ -15,7 +15,7 @@ const R = (...e) => {
15
15
  }, Me = (e, t, ...n) => t ? t(...n) : ce(e), Oe = 1440, Z = (e) => {
16
16
  const [t, n] = e.split(":");
17
17
  return Number(t) * 60 + Number(n ?? 0);
18
- }, ee = (e) => `${String(Math.floor(e / 60)).padStart(2, "0")}:${String(e % 60).padStart(2, "0")}`, X = (e) => e.slice(0, 10), j = (e) => Z(e.slice(11, 16)), ne = (e, t) => `${e}T${ee(t)}`, ie = (e, t) => `${ee(e)}–${ee(t)}`, q = (e, t, n) => Math.min(Math.max(e, t), n), _e = (e, t) => `${e}|${t ?? ""}`, Re = (e, t) => t && t.length > 0 ? e.flatMap(
18
+ }, ee = (e) => `${String(Math.floor(e / 60)).padStart(2, "0")}:${String(e % 60).padStart(2, "0")}`, U = (e) => e.slice(0, 10), X = (e) => Z(e.slice(11, 16)), ne = (e, t) => `${e}T${ee(t)}`, ie = (e, t) => `${ee(e)}–${ee(t)}`, Q = (e, t, n) => Math.min(Math.max(e, t), n), _e = (e, t) => `${e}|${t ?? ""}`, Ke = (e, t) => t && t.length > 0 ? e.flatMap(
19
19
  (n, o) => t.map((s, a) => ({
20
20
  index: o * t.length + a,
21
21
  day: n,
@@ -23,9 +23,9 @@ const R = (...e) => {
23
23
  label: `${n.label}, ${s.label}`
24
24
  }))
25
25
  ) : e.map((n, o) => ({ index: o, day: n, label: n.label })), Ne = (e, t) => {
26
- const n = X(e.start), o = X(e.end);
27
- return n <= t && (t < o || t === o && j(e.end) > 0);
28
- }, re = (e) => X(e.start) === X(e.end), Ke = (e) => {
26
+ const n = U(e.start), o = U(e.end);
27
+ return n <= t && (t < o || t === o && X(e.end) > 0);
28
+ }, re = (e) => U(e.start) === U(e.end), Re = (e) => {
29
29
  e.sort((a, r) => a.startMin - r.startMin || r.endMin - a.endMin);
30
30
  let t = [], n = [], o = -1;
31
31
  const s = () => {
@@ -41,14 +41,14 @@ const R = (...e) => {
41
41
  }
42
42
  s();
43
43
  }, Ie = (e, t, n, o, s) => {
44
- var k;
44
+ var w;
45
45
  const a = new Map(
46
46
  t.map((h) => {
47
47
  var c;
48
48
  return [_e(h.day.date, (c = h.resource) == null ? void 0 : c.id), h];
49
49
  })
50
50
  ), r = t.some((h) => h.resource), l = t.map(() => []), _ = (h, c) => {
51
- const M = c.day.date, i = X(h.start) === M ? j(h.start) : 0, f = X(h.end) === M ? j(h.end) : Oe;
51
+ const M = c.day.date, i = U(h.start) === M ? X(h.start) : 0, f = U(h.end) === M ? X(h.end) : Oe;
52
52
  f <= n || i >= o || l[c.index].push({
53
53
  key: `${h.id}@${c.index}`,
54
54
  event: h,
@@ -64,30 +64,30 @@ const R = (...e) => {
64
64
  const c = r ? h.resourceId : void 0;
65
65
  if (!(r && c === void 0)) {
66
66
  if (re(h)) {
67
- const M = a.get(_e(X(h.start), c));
67
+ const M = a.get(_e(U(h.start), c));
68
68
  M && _(h, M);
69
69
  continue;
70
70
  }
71
71
  for (const M of t)
72
- ((k = M.resource) == null ? void 0 : k.id) === c && Ne(h, M.day.date) && _(h, M);
72
+ ((w = M.resource) == null ? void 0 : w.id) === c && Ne(h, M.day.date) && _(h, M);
73
73
  }
74
74
  }
75
- for (const h of l) Ke(h);
75
+ for (const h of l) Re(h);
76
76
  return l;
77
77
  }, Se = (e, t, n) => {
78
78
  const o = new Map(t.map((r, l) => [r.date, l])), s = t.map(() => []), a = (r, l) => s[l].push({
79
79
  key: `${r.id}@${l}`,
80
80
  event: r,
81
81
  column: l,
82
- startMin: j(r.start),
83
- endMin: j(r.end),
82
+ startMin: X(r.start),
83
+ endMin: X(r.end),
84
84
  lane: 0,
85
85
  lanes: 1,
86
86
  isMovable: n && !r.isLocked && re(r)
87
87
  });
88
88
  for (const r of e) {
89
89
  if (re(r)) {
90
- const l = o.get(X(r.start));
90
+ const l = o.get(U(r.start));
91
91
  l !== void 0 && a(r, l);
92
92
  continue;
93
93
  }
@@ -103,7 +103,7 @@ const R = (...e) => {
103
103
  }, Pe = (e, t, n) => (e ?? []).flatMap((o, s) => {
104
104
  const a = Math.max(Z(o.start), t), r = Math.min(Z(o.end), n);
105
105
  return r > a ? [{ key: `${s}`, label: o.label, startMin: a, endMin: r }] : [];
106
- }), Q = (e, t, n, o, s) => {
106
+ }), q = (e, t, n, o, s) => {
107
107
  if (s.view === "month")
108
108
  return o < 0 || o >= s.columnCount ? void 0 : { column: o, startMin: e.startMin, endMin: e.endMin };
109
109
  if (t) {
@@ -111,16 +111,16 @@ const R = (...e) => {
111
111
  return {
112
112
  column: e.column,
113
113
  startMin: e.startMin,
114
- endMin: q(e.endMin + n, l, s.rangeEnd)
114
+ endMin: Q(e.endMin + n, l, s.rangeEnd)
115
115
  };
116
116
  }
117
- const a = e.endMin - e.startMin, r = q(
117
+ const a = e.endMin - e.startMin, r = Q(
118
118
  e.startMin + n,
119
119
  s.rangeStart,
120
120
  s.rangeEnd - a
121
121
  );
122
122
  return {
123
- column: q(o, 0, s.columnCount - 1),
123
+ column: Q(o, 0, s.columnCount - 1),
124
124
  startMin: r,
125
125
  endMin: r + a
126
126
  };
@@ -134,7 +134,7 @@ const R = (...e) => {
134
134
  end: ne(l, t.endMin),
135
135
  resourceId: ((_ = r == null ? void 0 : r.resource) == null ? void 0 : _.id) ?? e.event.resourceId
136
136
  };
137
- }, Ue = (e) => e === "ArrowUp" || e === "ArrowDown" || e === "ArrowLeft" || e === "ArrowRight", Xe = (e, t, n) => {
137
+ }, Fe = (e) => e === "ArrowUp" || e === "ArrowDown" || e === "ArrowLeft" || e === "ArrowRight", Ue = (e, t, n) => {
138
138
  if (n === "ArrowUp" || n === "ArrowDown") {
139
139
  const s = e[t.column], a = s.findIndex((r) => r.key === t.key);
140
140
  return s[a + (n === "ArrowDown" ? 1 : -1)];
@@ -147,31 +147,31 @@ const R = (...e) => {
147
147
  (r, l) => Math.abs(l.startMin - t.startMin) < Math.abs(r.startMin - t.startMin) ? l : r
148
148
  );
149
149
  }
150
- }, je = (e, t, n, o) => {
150
+ }, Xe = (e, t, n, o) => {
151
151
  const s = t === "ArrowUp" || t === "ArrowDown", a = t === "ArrowDown" || t === "ArrowRight" ? 1 : -1;
152
152
  if (o.view === "month")
153
- return n ? void 0 : Q(e, !1, 0, e.column + a * (s ? 7 : 1), o);
153
+ return n ? void 0 : q(e, !1, 0, e.column + a * (s ? 7 : 1), o);
154
154
  if (!(n && !s))
155
- return s ? Q(e, n, a * o.slotMinutes, e.column, o) : Q(e, !1, 0, e.column + a, o);
156
- }, ze = 4, te = 7, Be = ({
155
+ return s ? q(e, n, a * o.slotMinutes, e.column, o) : q(e, !1, 0, e.column + a, o);
156
+ }, je = 4, te = 7, ze = ({
157
157
  bodyRef: e,
158
158
  bounds: t,
159
159
  onDrop: n
160
160
  }) => {
161
- const [o, s] = be(null), a = z(null), r = z(!1), l = z({ bounds: t, onDrop: n });
161
+ const [o, s] = be(null), a = j(null), r = j(!1), l = j({ bounds: t, onDrop: n });
162
162
  l.current = { bounds: t, onDrop: n };
163
163
  const _ = (c, M) => {
164
164
  var A;
165
165
  const i = (A = e.current) == null ? void 0 : A.getBoundingClientRect(), { bounds: f } = l.current;
166
166
  if (!i || i.width === 0 || i.height === 0) return;
167
167
  if (f.view === "time") {
168
- const T = (f.rangeEnd - f.rangeStart) / i.height, x = (c.clientY - M.y) * T, b = Math.round(x / f.slotMinutes) * f.slotMinutes, w = Math.floor((c.clientX - i.left) / i.width * f.columnCount);
169
- return Q(M.item, M.isResize, b, w, f);
168
+ const T = (f.rangeEnd - f.rangeStart) / i.height, x = (c.clientY - M.y) * T, b = Math.round(x / f.slotMinutes) * f.slotMinutes, k = Math.floor((c.clientX - i.left) / i.width * f.columnCount);
169
+ return q(M.item, M.isResize, b, k, f);
170
170
  }
171
171
  const N = Math.ceil(f.columnCount / te), D = Math.floor((c.clientX - i.left) / i.width * te), C = Math.floor((c.clientY - i.top) / i.height * N);
172
172
  if (!(D < 0 || D >= te || C < 0 || C >= N))
173
- return Q(M.item, !1, 0, C * te + D, f);
174
- }, k = se(
173
+ return q(M.item, !1, 0, C * te + D, f);
174
+ }, w = se(
175
175
  (c, M, i) => {
176
176
  var b;
177
177
  if (r.current = !1, M.button !== 0 || !c.isMovable) return;
@@ -188,19 +188,19 @@ const R = (...e) => {
188
188
  r.current = !0, window.setTimeout(() => {
189
189
  r.current = !1;
190
190
  }, 0);
191
- }, C = (w) => {
192
- const K = Math.hypot(w.clientX - f.x, w.clientY - f.y);
193
- if (!f.isStarted && K < ze) return;
191
+ }, C = (k) => {
192
+ const R = Math.hypot(k.clientX - f.x, k.clientY - f.y);
193
+ if (!f.isStarted && R < je) return;
194
194
  f.isStarted = !0;
195
- const I = _(w, f);
195
+ const I = _(k, f);
196
196
  s(I ? { key: f.item.key, isResize: f.isResize, target: I } : null);
197
- }, A = (w) => {
197
+ }, A = (k) => {
198
198
  if (N(), !f.isStarted) return;
199
199
  D();
200
- const K = _(w, f);
201
- K && l.current.onDrop(f.item, K);
202
- }, T = () => N(), x = (w) => {
203
- w.key !== "Escape" || !f.isStarted || (w.preventDefault(), w.stopPropagation(), D(), N());
200
+ const R = _(k, f);
201
+ R && l.current.onDrop(f.item, R);
202
+ }, T = () => N(), x = (k) => {
203
+ k.key !== "Escape" || !f.isStarted || (k.preventDefault(), k.stopPropagation(), D(), N());
204
204
  };
205
205
  window.addEventListener("pointermove", C), window.addEventListener("pointerup", A), window.addEventListener("pointercancel", T), window.addEventListener("keydown", x, !0), a.current = N;
206
206
  },
@@ -208,28 +208,27 @@ const R = (...e) => {
208
208
  // eslint-disable-next-line react-hooks/exhaustive-deps
209
209
  []
210
210
  );
211
- we(() => () => {
211
+ ke(() => () => {
212
212
  var c;
213
213
  return (c = a.current) == null ? void 0 : c.call(a);
214
214
  }, []);
215
215
  const h = se(() => r.current, []);
216
- return { preview: o, begin: k, isClickSwallowed: h };
217
- }, Fe = "ui-calendar-YEgbk", Ge = "ui-srOnly-6NUr9", Je = "ui-scroller-IkPuv", He = "ui-time-DPj2K", Ve = "ui-corner-7ggOq", We = "ui-headers-c6s18", qe = "ui-header-vuk-c", Qe = "ui-resource-i6zVF", Ze = "ui-resource__detail-ssEve", et = "ui-gutter-YjM1s", tt = "ui-gutter__hour-oyYrg", nt = "ui-gutter__band-D6P6s", rt = "ui-band-GkAex", ot = "ui-columns-aXu-3", at = "ui-column-BsLn7", st = "ui-event-uQH1A", ct = "ui-event__body-jClWr", it = "ui-event__time-8Nt0z", lt = "ui-event__handle-cXUkS", dt = "ui-preview-FsJaC", ut = "ui-preview__title-GkNhx", ht = "ui-month-aEknN", ft = "ui-weekdays-VJ6EQ", mt = "ui-cells-jQJ7X", gt = "ui-cell-c3itR", pt = "ui-cell__day-40ADs", vt = "ui-cell__more-e3wMw", d = {
218
- calendar: Fe,
219
- srOnly: Ge,
220
- scroller: Je,
216
+ return { preview: o, begin: w, isClickSwallowed: h };
217
+ }, Be = "ui-calendar-YEgbk", Je = "ui-srOnly-6NUr9", Ge = "ui-scroller-IkPuv", He = "ui-time-DPj2K", Ve = "ui-corner-7ggOq", We = "ui-headers-c6s18", Qe = "ui-header-vuk-c", qe = "ui-resource-i6zVF", Ze = "ui-resource__detail-ssEve", et = "ui-gutter-YjM1s", tt = "ui-gutter__hour-oyYrg", nt = "ui-gutter__band-D6P6s", rt = "ui-band-GkAex", ot = "ui-columns-aXu-3", at = "ui-column-BsLn7", st = "ui-event-uQH1A", ct = "ui-event__body-jClWr", it = "ui-event__time-8Nt0z", lt = "ui-event__handle-cXUkS", dt = "ui-preview-FsJaC", ut = "ui-preview__title-GkNhx", ht = "ui-month-aEknN", ft = "ui-weekdays-VJ6EQ", mt = "ui-cells-jQJ7X", gt = "ui-cell-c3itR", pt = "ui-cell__day-40ADs", vt = "ui-cell__more-e3wMw", d = {
218
+ calendar: Be,
219
+ srOnly: Je,
220
+ scroller: Ge,
221
221
  time: He,
222
222
  "time--bands": "ui-time--bands-7Kndf",
223
223
  corner: Ve,
224
224
  headers: We,
225
- header: qe,
226
- resource: Qe,
225
+ header: Qe,
226
+ resource: qe,
227
227
  "header--today": "ui-header--today-eLJzT",
228
228
  resource__detail: Ze,
229
229
  "resource--primary": "ui-resource--primary--iCwp",
230
230
  "resource--neutral": "ui-resource--neutral-cxIaY",
231
- "resource--success": "ui-resource--success-qhCEv",
232
- "resource--warning": "ui-resource--warning-GR4eo",
231
+ "resource--ink": "ui-resource--ink-uNsDF",
233
232
  "resource--danger": "ui-resource--danger-S8dwG",
234
233
  "resource--info": "ui-resource--info-hZjna",
235
234
  gutter: et,
@@ -243,8 +242,7 @@ const R = (...e) => {
243
242
  event: st,
244
243
  "event--primary": "ui-event--primary-ykXcJ",
245
244
  "event--neutral": "ui-event--neutral-uTBTX",
246
- "event--success": "ui-event--success-vosp6",
247
- "event--warning": "ui-event--warning-scg6H",
245
+ "event--ink": "ui-event--ink-bChwl",
248
246
  "event--danger": "ui-event--danger-UY-OD",
249
247
  "event--info": "ui-event--info-SHlJD",
250
248
  "event--time": "ui-event--time-cg0iK",
@@ -282,15 +280,15 @@ const R = (...e) => {
282
280
  rangeLength: r,
283
281
  columnLabel: l,
284
282
  cancelledLabel: _,
285
- renderEvent: k,
283
+ renderEvent: w,
286
284
  handlers: h
287
285
  }) => {
288
- const { event: c } = e, M = t === "time" ? ie(j(c.start), j(c.end)) : ee(j(c.start));
286
+ const { event: c } = e, M = t === "time" ? ie(X(c.start), X(c.end)) : ee(X(c.start));
289
287
  return /* @__PURE__ */ L(
290
288
  "button",
291
289
  {
292
290
  type: "button",
293
- className: R(
291
+ className: K(
294
292
  d.event,
295
293
  d[`event--${t}`],
296
294
  d[`event--${c.tone ?? "primary"}`],
@@ -308,7 +306,7 @@ const R = (...e) => {
308
306
  children: [
309
307
  c.isCancelled && /* @__PURE__ */ p("span", { className: d.srOnly, children: `${_}: ` }),
310
308
  /* @__PURE__ */ p("span", { className: d.event__time, children: M }),
311
- /* @__PURE__ */ p("span", { className: d.event__body, children: k ? k(c) : c.title }),
309
+ /* @__PURE__ */ p("span", { className: d.event__body, children: w ? w(c) : c.title }),
312
310
  /* @__PURE__ */ p("span", { className: d.srOnly, children: `, ${l}` }),
313
311
  s && /* @__PURE__ */ p(
314
312
  "span",
@@ -323,7 +321,7 @@ const R = (...e) => {
323
321
  ]
324
322
  }
325
323
  );
326
- }, Ce = /* @__PURE__ */ ke(_t), yt = 7, bt = ({
324
+ }, Ce = /* @__PURE__ */ we(_t), yt = 7, bt = ({
327
325
  days: e,
328
326
  shown: t,
329
327
  hiddenCounts: n,
@@ -333,7 +331,7 @@ const R = (...e) => {
333
331
  activeKey: r,
334
332
  preview: l,
335
333
  cancelledLabel: _,
336
- formatMore: k,
334
+ formatMore: w,
337
335
  renderEvent: h,
338
336
  handlers: c,
339
337
  onDaySelect: M
@@ -352,7 +350,7 @@ const R = (...e) => {
352
350
  {
353
351
  role: "group",
354
352
  "aria-label": i.label,
355
- className: R(
353
+ className: K(
356
354
  d.cell,
357
355
  i.isOff && d["cell--off"],
358
356
  i.isOutside && d["cell--outside"],
@@ -363,7 +361,7 @@ const R = (...e) => {
363
361
  "button",
364
362
  {
365
363
  type: "button",
366
- className: R(d.cell__day, i.isToday && d["cell__day--today"]),
364
+ className: K(d.cell__day, i.isToday && d["cell__day--today"]),
367
365
  "aria-label": i.label,
368
366
  "aria-current": i.isToday ? "date" : void 0,
369
367
  "aria-pressed": s === void 0 ? void 0 : i.date === s,
@@ -373,7 +371,7 @@ const R = (...e) => {
373
371
  ) : /* @__PURE__ */ p(
374
372
  "span",
375
373
  {
376
- className: R(d.cell__day, i.isToday && d["cell__day--today"]),
374
+ className: K(d.cell__day, i.isToday && d["cell__day--today"]),
377
375
  "aria-hidden": !0,
378
376
  children: D
379
377
  }
@@ -401,9 +399,9 @@ const R = (...e) => {
401
399
  type: "button",
402
400
  className: d.cell__more,
403
401
  onClick: () => M(i.date),
404
- children: k(N)
402
+ children: w(N)
405
403
  }
406
- ) : /* @__PURE__ */ p("span", { className: d.cell__more, children: k(N) }))
404
+ ) : /* @__PURE__ */ p("span", { className: d.cell__more, children: w(N) }))
407
405
  ]
408
406
  },
409
407
  i.date
@@ -411,10 +409,10 @@ const R = (...e) => {
411
409
  }) })
412
410
  ]
413
411
  }
414
- ), wt = ({ day: e, span: t }) => /* @__PURE__ */ p(
412
+ ), kt = ({ day: e, span: t }) => /* @__PURE__ */ p(
415
413
  "div",
416
414
  {
417
- className: R(d.header, e.isToday && d["header--today"]),
415
+ className: K(d.header, e.isToday && d["header--today"]),
418
416
  style: { gridColumn: `span ${t}` },
419
417
  "aria-current": e.isToday ? "date" : void 0,
420
418
  children: e.shortLabel ? /* @__PURE__ */ L(ye, { children: [
@@ -422,13 +420,13 @@ const R = (...e) => {
422
420
  /* @__PURE__ */ p("span", { className: d.srOnly, children: e.label })
423
421
  ] }) : e.label
424
422
  }
425
- ), kt = ({
423
+ ), wt = ({
426
424
  resource: e,
427
425
  renderResource: t
428
426
  }) => /* @__PURE__ */ p(
429
427
  "div",
430
428
  {
431
- className: R(d.resource, e.tone && d[`resource--${e.tone}`]),
429
+ className: K(d.resource, e.tone && d[`resource--${e.tone}`]),
432
430
  "data-tone": e.tone,
433
431
  children: t ? t(e) : /* @__PURE__ */ L(ye, { children: [
434
432
  e.label,
@@ -445,7 +443,7 @@ const R = (...e) => {
445
443
  rangeStart: r,
446
444
  rangeEnd: l,
447
445
  slotMinutes: _,
448
- bodyRef: k,
446
+ bodyRef: w,
449
447
  activeKey: h,
450
448
  preview: c,
451
449
  isEditable: M,
@@ -457,16 +455,16 @@ const R = (...e) => {
457
455
  onSlotSelect: A,
458
456
  onExternalDrop: T
459
457
  }) => {
460
- const x = l - r, b = (n == null ? void 0 : n.length) ?? 0, w = b > 0, K = Array.from(
458
+ const x = l - r, b = (n == null ? void 0 : n.length) ?? 0, k = b > 0, R = Array.from(
461
459
  { length: Math.floor((l - 1) / 60) - Math.ceil(r / 60) + 1 },
462
460
  (u, m) => (Math.ceil(r / 60) + m) * 60
463
- ), I = (u) => `${u / x * 100}%`, S = (u) => I(u - r), J = c ? a.flat().find((u) => u.key === c.key) : void 0, B = (u, m, O) => {
464
- var F;
465
- const E = m.getBoundingClientRect(), oe = E.height > 0 ? q((O - E.top) / E.height, 0, 1) : 0, Y = Math.floor(oe * x / _) * _, U = q(r + Y, r, l - _);
461
+ ), I = (u) => `${u / x * 100}%`, S = (u) => I(u - r), G = c ? a.flat().find((u) => u.key === c.key) : void 0, z = (u, m, O) => {
462
+ var B;
463
+ const E = m.getBoundingClientRect(), oe = E.height > 0 ? Q((O - E.top) / E.height, 0, 1) : 0, Y = Math.floor(oe * x / _) * _, F = Q(r + Y, r, l - _);
466
464
  return {
467
- start: ne(u.day.date, U),
468
- end: ne(u.day.date, U + _),
469
- resourceId: (F = u.resource) == null ? void 0 : F.id
465
+ start: ne(u.day.date, F),
466
+ end: ne(u.day.date, F + _),
467
+ resourceId: (B = u.resource) == null ? void 0 : B.id
470
468
  };
471
469
  }, P = {
472
470
  "--ui-calendar-columns": o.length,
@@ -483,12 +481,12 @@ const R = (...e) => {
483
481
  {
484
482
  className: d.scroller,
485
483
  ...a.some((u) => u.length > 0) ? {} : { tabIndex: 0, role: "region", "aria-label": e },
486
- children: /* @__PURE__ */ L("div", { className: R(d.time, s.length > 0 && d["time--bands"]), style: P, children: [
484
+ children: /* @__PURE__ */ L("div", { className: K(d.time, s.length > 0 && d["time--bands"]), style: P, children: [
487
485
  /* @__PURE__ */ p("div", { className: d.corner }),
488
486
  /* @__PURE__ */ L("div", { className: d.headers, children: [
489
- t.map((u) => /* @__PURE__ */ p(wt, { day: u, span: w ? b : 1 }, u.date)),
490
- w && o.map((u) => /* @__PURE__ */ p(
491
- kt,
487
+ t.map((u) => /* @__PURE__ */ p(kt, { day: u, span: k ? b : 1 }, u.date)),
488
+ k && o.map((u) => /* @__PURE__ */ p(
489
+ wt,
492
490
  {
493
491
  resource: u.resource,
494
492
  renderResource: N
@@ -497,7 +495,7 @@ const R = (...e) => {
497
495
  ))
498
496
  ] }),
499
497
  /* @__PURE__ */ L("div", { className: d.gutter, "aria-hidden": !0, children: [
500
- K.map((u) => /* @__PURE__ */ p("span", { className: d.gutter__hour, style: { top: S(u) }, children: ee(u) }, u)),
498
+ R.map((u) => /* @__PURE__ */ p("span", { className: d.gutter__hour, style: { top: S(u) }, children: ee(u) }, u)),
501
499
  s.map((u) => /* @__PURE__ */ p(
502
500
  "span",
503
501
  {
@@ -508,21 +506,21 @@ const R = (...e) => {
508
506
  u.key
509
507
  ))
510
508
  ] }),
511
- /* @__PURE__ */ p("div", { ref: k, className: d.columns, children: o.map((u) => /* @__PURE__ */ L(
509
+ /* @__PURE__ */ p("div", { ref: w, className: d.columns, children: o.map((u) => /* @__PURE__ */ L(
512
510
  "div",
513
511
  {
514
512
  role: "group",
515
513
  "aria-label": u.label,
516
- className: R(d.column, u.day.isOff && d["column--off"]),
514
+ className: K(d.column, u.day.isOff && d["column--off"]),
517
515
  onClick: A ? (m) => {
518
- m.target !== m.currentTarget || C() || A(B(u, m.currentTarget, m.clientY));
516
+ m.target !== m.currentTarget || C() || A(z(u, m.currentTarget, m.clientY));
519
517
  } : void 0,
520
518
  onDragOver: T ? (m) => {
521
519
  m.preventDefault(), m.dataTransfer.dropEffect = "move";
522
520
  } : void 0,
523
521
  onDrop: T ? (m) => {
524
522
  m.preventDefault(), T({
525
- ...B(u, m.currentTarget, m.clientY),
523
+ ...z(u, m.currentTarget, m.clientY),
526
524
  data: m.dataTransfer.getData("text/plain")
527
525
  });
528
526
  } : void 0,
@@ -530,7 +528,7 @@ const R = (...e) => {
530
528
  s.map((m, O) => /* @__PURE__ */ p(
531
529
  "div",
532
530
  {
533
- className: R(d.band, O % 2 === 1 && d["band--alternate"]),
531
+ className: K(d.band, O % 2 === 1 && d["band--alternate"]),
534
532
  style: {
535
533
  top: S(m.startMin),
536
534
  height: I(m.endMin - m.startMin)
@@ -556,7 +554,7 @@ const R = (...e) => {
556
554
  },
557
555
  m.key
558
556
  )),
559
- c && J && c.target.column === u.index && /* @__PURE__ */ L(
557
+ c && G && c.target.column === u.index && /* @__PURE__ */ L(
560
558
  "div",
561
559
  {
562
560
  className: d.preview,
@@ -567,7 +565,7 @@ const R = (...e) => {
567
565
  "aria-hidden": !0,
568
566
  children: [
569
567
  ie(c.target.startMin, c.target.endMin),
570
- /* @__PURE__ */ p("span", { className: d.preview__title, children: J.event.title })
568
+ /* @__PURE__ */ p("span", { className: d.preview__title, children: G.event.title })
571
569
  ]
572
570
  }
573
571
  )
@@ -589,7 +587,7 @@ const R = (...e) => {
589
587
  bands: r,
590
588
  startTime: l = "08:00",
591
589
  endTime: _ = "20:00",
592
- slotMinutes: k = 30,
590
+ slotMinutes: w = 30,
593
591
  weekdays: h,
594
592
  maxEventsPerDay: c = Ct,
595
593
  selectedDate: M,
@@ -603,28 +601,28 @@ const R = (...e) => {
603
601
  testId: x
604
602
  }) => {
605
603
  var me, ge, pe;
606
- const { labels: b } = Ee(), w = Le(), K = Ae(), I = z(null), S = z(null), [J, B] = be(), P = z(null), u = !!i, m = Z(l), O = Z(_), E = W(() => Re(t, s), [t, s]), oe = W(
604
+ const { labels: b } = Ee(), k = Le(), R = Ae(), I = j(null), S = j(null), [G, z] = be(), P = j(null), u = !!i, m = Z(l), O = Z(_), E = W(() => Ke(t, s), [t, s]), oe = W(
607
605
  () => Pe(r, m, O),
608
606
  [r, m, O]
609
607
  ), Y = W(
610
608
  () => o === "time" ? Ie(n, E, m, O, u) : Se(n, t, u),
611
609
  [o, n, E, t, m, O, u]
612
- ), U = W(
610
+ ), F = W(
613
611
  () => o === "month" ? Y.map((g) => g.slice(0, c)) : Y,
614
612
  [o, Y, c]
615
- ), F = {
613
+ ), B = {
616
614
  view: o,
617
615
  columnCount: o === "time" ? E.length : t.length,
618
616
  rangeStart: m,
619
617
  rangeEnd: O,
620
- slotMinutes: k
621
- }, le = U.flat(), de = le.some((g) => g.key === J) ? J : (me = le[0]) == null ? void 0 : me.key, De = (g) => o === "time" ? E[g.column].label : t[g.column].label, H = z({ view: o, columns: E, days: t, onEventChange: i, onEventOpen: f, focusable: U, bounds: F });
622
- H.current = { view: o, columns: E, days: t, onEventChange: i, onEventOpen: f, focusable: U, bounds: F };
618
+ slotMinutes: w
619
+ }, le = F.flat(), de = le.some((g) => g.key === G) ? G : (me = le[0]) == null ? void 0 : me.key, De = (g) => o === "time" ? E[g.column].label : t[g.column].label, H = j({ view: o, columns: E, days: t, onEventChange: i, onEventOpen: f, focusable: F, bounds: B });
620
+ H.current = { view: o, columns: E, days: t, onEventChange: i, onEventOpen: f, focusable: F, bounds: B };
623
621
  const ae = se((g, v) => {
624
622
  const y = H.current, $ = Ye(g, v, y.view, y.columns, y.days);
625
623
  if (!(!$ || !y.onEventChange))
626
624
  return y.onEventChange($), $;
627
- }, []), V = Be({ bodyRef: S, bounds: F, onDrop: ae }), ue = (g) => {
625
+ }, []), V = ze({ bodyRef: S, bounds: B, onDrop: ae }), ue = (g) => {
628
626
  const y = [...I.current.querySelectorAll("[data-key]")].find(
629
627
  ($) => $.dataset.key === g
630
628
  );
@@ -638,37 +636,37 @@ const R = (...e) => {
638
636
  var y, $;
639
637
  V.isClickSwallowed() || ($ = (y = H.current).onEventOpen) == null || $.call(y, g.event.id);
640
638
  },
641
- onFocus: (g) => B(g.key),
639
+ onFocus: (g) => z(g.key),
642
640
  onKeyDown: (g, v) => {
643
- if (P.current = null, !Ue(v.key)) return;
641
+ if (P.current = null, !Fe(v.key)) return;
644
642
  const y = H.current;
645
643
  if (v.metaKey || v.ctrlKey) {
646
644
  if (v.preventDefault(), !g.isMovable) return;
647
- const G = je(g, v.key, v.shiftKey, y.bounds);
648
- if (!G) return;
645
+ const J = Xe(g, v.key, v.shiftKey, y.bounds);
646
+ if (!J) return;
649
647
  P.current = {
650
- key: `${g.event.id}@${G.column}`,
648
+ key: `${g.event.id}@${J.column}`,
651
649
  before: g.event
652
- }, ae(g, G) || (P.current = null);
650
+ }, ae(g, J) || (P.current = null);
653
651
  return;
654
652
  }
655
- const $ = Xe(y.focusable, g, v.key);
656
- $ && (v.preventDefault(), B($.key), ue($.key));
653
+ const $ = Ue(y.focusable, g, v.key);
654
+ $ && (v.preventDefault(), z($.key), ue($.key));
657
655
  }
658
656
  }),
659
657
  // `drag.begin` and `drag.isClickSwallowed` are stable; the rest is read through `latest`.
660
658
  // eslint-disable-next-line react-hooks/exhaustive-deps
661
659
  [ae]
662
660
  );
663
- we(() => {
664
- var G;
661
+ ke(() => {
662
+ var J;
665
663
  const g = P.current;
666
664
  if (!g) return;
667
665
  const v = Y.flat().find((xe) => xe.key === g.key), { before: y } = g;
668
- v !== void 0 && (v.event.start !== y.start || v.event.end !== y.end || v.event.resourceId !== y.resourceId) && (P.current = null, B(v.key), ue(v.key), w(
666
+ v !== void 0 && (v.event.start !== y.start || v.event.end !== y.end || v.event.resourceId !== y.resourceId) && (P.current = null, z(v.key), ue(v.key), k(
669
667
  Me(
670
668
  "Calendar.moved",
671
- (G = b == null ? void 0 : b.calendar) == null ? void 0 : G.moved,
669
+ (J = b == null ? void 0 : b.calendar) == null ? void 0 : J.moved,
672
670
  v.event.title,
673
671
  `${De(v)}, ${ie(v.startMin, v.endMin)}`
674
672
  )
@@ -679,13 +677,13 @@ const R = (...e) => {
679
677
  "div",
680
678
  {
681
679
  ref: I,
682
- className: R(d.calendar, T),
680
+ className: K(d.calendar, T),
683
681
  role: "group",
684
682
  "aria-label": e,
685
- "aria-describedby": K,
683
+ "aria-describedby": R,
686
684
  "data-testid": x,
687
685
  children: [
688
- /* @__PURE__ */ p("span", { id: K, className: d.srOnly, children: $e }),
686
+ /* @__PURE__ */ p("span", { id: R, className: d.srOnly, children: $e }),
689
687
  o === "time" ? /* @__PURE__ */ p(
690
688
  Nt,
691
689
  {
@@ -697,7 +695,7 @@ const R = (...e) => {
697
695
  placed: Y,
698
696
  rangeStart: m,
699
697
  rangeEnd: O,
700
- slotMinutes: k,
698
+ slotMinutes: w,
701
699
  bodyRef: S,
702
700
  activeKey: de,
703
701
  preview: V.preview,
@@ -714,8 +712,8 @@ const R = (...e) => {
714
712
  bt,
715
713
  {
716
714
  days: t,
717
- shown: U,
718
- hiddenCounts: Y.map((g, v) => g.length - U[v].length),
715
+ shown: F,
716
+ hiddenCounts: Y.map((g, v) => g.length - F[v].length),
719
717
  weekdays: h,
720
718
  selectedDate: M,
721
719
  bodyRef: S,
@@ -734,7 +732,7 @@ const R = (...e) => {
734
732
  ]
735
733
  }
736
734
  );
737
- }, Et = /* @__PURE__ */ ke(/* @__PURE__ */ Te(Dt, "Calendar"));
735
+ }, Et = /* @__PURE__ */ we(/* @__PURE__ */ Te(Dt, "Calendar"));
738
736
  export {
739
737
  Et as Calendar
740
738
  };