@slotted/react 0.1.0-beta.37 → 0.1.0-beta.39

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 (92) hide show
  1. package/dist/calendar-CX0wN5Bh.js +564 -0
  2. package/dist/calendar.js +1 -1
  3. package/dist/{data-grid-C5YmAqdN.js → data-grid-Cx0ZOf_e.js} +4 -4
  4. package/dist/data-grid.js +1 -1
  5. package/dist/{data-list-DovwQEMt.js → data-list-Cb2sNA6I.js} +218 -214
  6. package/dist/data-list.js +1 -1
  7. package/dist/{date-picker-DQbj3FON.js → date-picker-CLXTtQGe.js} +1 -1
  8. package/dist/date-picker.js +1 -1
  9. package/dist/{date-range-picker-B16hMhJf.js → date-range-picker-Br0neGyT.js} +1 -1
  10. package/dist/date-range-picker.js +1 -1
  11. package/dist/{datetime-picker-C9pxH7Xf.js → datetime-picker-CR-H_BLu.js} +1 -1
  12. package/dist/datetime-picker.js +1 -1
  13. package/dist/{datetime-range-picker-Cmn7o_Qv.js → datetime-range-picker-BLo58OIk.js} +1 -1
  14. package/dist/datetime-range-picker.js +1 -1
  15. package/dist/docs/calendar.json +44 -4
  16. package/dist/docs/calendar.md +7 -1
  17. package/dist/docs/dialog.json +1 -0
  18. package/dist/docs/dialog.md +1 -1
  19. package/dist/docs/drawer.json +1 -0
  20. package/dist/docs/drawer.md +1 -1
  21. package/dist/docs/list-item.json +1 -1
  22. package/dist/docs/message.json +15 -0
  23. package/dist/docs/message.md +2 -1
  24. package/dist/docs/section.json +1 -1
  25. package/dist/docs/table.json +12 -0
  26. package/dist/docs/table.md +2 -0
  27. package/dist/{filter-bar-Cfwk-3Eu.js → filter-bar-b8bRNPs9.js} +2 -2
  28. package/dist/filter-bar.js +1 -1
  29. package/dist/{import-export-center-BH1bNw_E.js → import-export-center-C_oNc-RM.js} +1 -1
  30. package/dist/import-export-center.js +1 -1
  31. package/dist/index.js +40 -40
  32. package/dist/{message-CdcUyh3g.js → message-D1Dd6Y2k.js} +6 -5
  33. package/dist/message.js +1 -1
  34. package/dist/roving-focus-BXshJYlW.js +149 -0
  35. package/dist/roving-focus.js +2 -2
  36. package/dist/styles/action-sheet.css +1 -1
  37. package/dist/styles/calendar.css +1 -1
  38. package/dist/styles/column-manager.css +1 -1
  39. package/dist/styles/command-palette.css +1 -1
  40. package/dist/styles/data-grid.css +1 -1
  41. package/dist/styles/data-list.css +1 -1
  42. package/dist/styles/date-picker.css +1 -1
  43. package/dist/styles/date-range-picker.css +1 -1
  44. package/dist/styles/datetime-picker.css +1 -1
  45. package/dist/styles/datetime-range-picker.css +1 -1
  46. package/dist/styles/detail-panel.css +1 -1
  47. package/dist/styles/dialog.css +1 -1
  48. package/dist/styles/drawer.css +1 -1
  49. package/dist/styles/event-calendar.css +1 -1
  50. package/dist/styles/filter-bar.css +2 -2
  51. package/dist/styles/import-export-center.css +2 -2
  52. package/dist/styles/index.css +7 -7
  53. package/dist/styles/list-item.css +1 -1
  54. package/dist/styles/media-viewer.css +1 -1
  55. package/dist/styles/message.css +1 -1
  56. package/dist/styles/section.css +1 -1
  57. package/dist/styles/table.css +2 -2
  58. package/dist/styles/upload.css +1 -1
  59. package/dist/styles.css +1 -1
  60. package/dist/{table-CnXBp9j9.js → table-DqwYPHGS.js} +353 -351
  61. package/dist/table.js +1 -1
  62. package/dist/types/calendar/calendar-day-cell.d.ts +30 -0
  63. package/dist/types/calendar/calendar-day-cell.d.ts.map +1 -0
  64. package/dist/types/calendar/calendar-month-table.d.ts +18 -0
  65. package/dist/types/calendar/calendar-month-table.d.ts.map +1 -0
  66. package/dist/types/calendar/calendar-periods.d.ts +24 -0
  67. package/dist/types/calendar/calendar-periods.d.ts.map +1 -0
  68. package/dist/types/calendar/calendar.d.ts +1 -1
  69. package/dist/types/calendar/calendar.d.ts.map +1 -1
  70. package/dist/types/calendar/calendar.types.d.ts +23 -0
  71. package/dist/types/calendar/calendar.types.d.ts.map +1 -1
  72. package/dist/types/calendar/index.d.ts +1 -1
  73. package/dist/types/calendar/index.d.ts.map +1 -1
  74. package/dist/types/data-list/data-list.d.ts.map +1 -1
  75. package/dist/types/message/message-parts.d.ts +1 -1
  76. package/dist/types/message/message-parts.d.ts.map +1 -1
  77. package/dist/types/message/message.types.d.ts +2 -0
  78. package/dist/types/message/message.types.d.ts.map +1 -1
  79. package/dist/types/roving-focus/index.d.ts +2 -0
  80. package/dist/types/roving-focus/index.d.ts.map +1 -1
  81. package/dist/types/roving-focus/roving-grid.d.ts +27 -0
  82. package/dist/types/roving-focus/roving-grid.d.ts.map +1 -0
  83. package/dist/types/table/index.d.ts +1 -1
  84. package/dist/types/table/index.d.ts.map +1 -1
  85. package/dist/types/table/table-defaults.d.ts.map +1 -1
  86. package/dist/types/table/table.d.ts +1 -1
  87. package/dist/types/table/table.d.ts.map +1 -1
  88. package/dist/types/table/table.types.d.ts +10 -0
  89. package/dist/types/table/table.types.d.ts.map +1 -1
  90. package/package.json +7 -6
  91. package/dist/calendar-D8FhdXWc.js +0 -537
  92. package/dist/roving-focus-C5-rVFzI.js +0 -89
@@ -0,0 +1,564 @@
1
+ import { n as e, r as t } from "./i18n-D7xXDd8-.js";
2
+ import { n, t as r } from "./icon-D04-_QFA.js";
3
+ /* empty css */
4
+ import { a as i, i as a, n as o, r as s } from "./tooltip-DrFiRlH8.js";
5
+ import { keyedProps as c } from "@slotted/core/selector-key";
6
+ import { createControllable as l } from "@slotted/core/state";
7
+ import { createContext as u, createElement as d, useCallback as f, useContext as p, useEffect as m, useId as ee, useImperativeHandle as te, useMemo as h, useRef as g, useState as _ } from "react";
8
+ import { Fragment as ne, jsx as v, jsxs as y } from "react/jsx-runtime";
9
+ import { calendarMessages as b } from "@slotted/core/i18n";
10
+ import { addDays as x, clampDate as re, compareDate as S, createDateFormat as C, endOfWeek as w, isDateInRange as ie, isSameDate as T, monthGrid as ae, plainDate as E, startOfWeek as oe, stepMonth as D, stepYear as O, toISODate as se, todayIn as ce, visibleMonths as le, yearPage as ue } from "@slotted/core/date";
11
+ //#region src/calendar/calendar-defaults.tsx
12
+ var de = u({
13
+ calendar: "gregory",
14
+ firstDayOfWeek: void 0,
15
+ fixedWeeks: !1,
16
+ months: 1,
17
+ outsideDays: void 0,
18
+ timeZone: void 0,
19
+ weekNumbers: !1
20
+ });
21
+ function fe() {
22
+ return p(de);
23
+ }
24
+ function pe({ children: e, ...t }) {
25
+ let n = fe();
26
+ return /* @__PURE__ */ v(de.Provider, {
27
+ value: {
28
+ calendar: t.calendar ?? n.calendar,
29
+ firstDayOfWeek: t.firstDayOfWeek ?? n.firstDayOfWeek,
30
+ fixedWeeks: t.fixedWeeks ?? n.fixedWeeks,
31
+ months: t.months ?? n.months,
32
+ outsideDays: t.outsideDays ?? n.outsideDays,
33
+ timeZone: t.timeZone ?? n.timeZone,
34
+ weekNumbers: t.weekNumbers ?? n.weekNumbers
35
+ },
36
+ children: e
37
+ });
38
+ }
39
+ //#endregion
40
+ //#region src/calendar/calendar-header.tsx
41
+ function me({ editable: e, heading: t, headingId: i, nextName: a, onTurn: o, onWalkUp: s, previousName: c, view: l }) {
42
+ return /* @__PURE__ */ y("div", {
43
+ "data-part": "header",
44
+ "data-part-header": "",
45
+ children: [
46
+ /* @__PURE__ */ v("button", {
47
+ "aria-label": c,
48
+ "data-part": "previous",
49
+ "data-part-previous": "",
50
+ disabled: !e,
51
+ onClick: o(-1),
52
+ type: "button",
53
+ children: /* @__PURE__ */ v(r, {
54
+ directional: !0,
55
+ children: /* @__PURE__ */ v(n, { name: "chevron-right" })
56
+ })
57
+ }),
58
+ /* @__PURE__ */ y("button", {
59
+ "aria-live": "polite",
60
+ "data-part": "heading",
61
+ "data-part-heading": "",
62
+ disabled: !e || l === "year",
63
+ id: i,
64
+ onClick: s,
65
+ type: "button",
66
+ children: [t, l === "year" ? null : /* @__PURE__ */ v(r, { children: /* @__PURE__ */ v(n, { name: "chevron-down" }) })]
67
+ }),
68
+ /* @__PURE__ */ v("button", {
69
+ "aria-label": a,
70
+ "data-part": "next",
71
+ "data-part-next": "",
72
+ disabled: !e,
73
+ onClick: o(1),
74
+ type: "button",
75
+ children: /* @__PURE__ */ v(r, {
76
+ directional: !0,
77
+ children: /* @__PURE__ */ v(n, { name: "chevron-right" })
78
+ })
79
+ })
80
+ ]
81
+ });
82
+ }
83
+ //#endregion
84
+ //#region src/calendar/calendar-day-button.tsx
85
+ function he({ tooltip: e, ...t }) {
86
+ return e == null || e === !1 ? /* @__PURE__ */ v("span", { ...t }) : /* @__PURE__ */ y(i, { children: [/* @__PURE__ */ v(a, {
87
+ ...t,
88
+ render: (e) => /* @__PURE__ */ v("span", { ...e })
89
+ }), /* @__PURE__ */ v(s, { children: /* @__PURE__ */ v(o, { children: e }) })] });
90
+ }
91
+ //#endregion
92
+ //#region src/calendar/calendar-selection.ts
93
+ function k(e) {
94
+ return e !== null && !Array.isArray(e) && "start" in e;
95
+ }
96
+ function A(e) {
97
+ return e === null ? [] : Array.isArray(e) ? e : k(e) ? [e.start, e.end].filter((e) => e !== null) : [e];
98
+ }
99
+ function j(e, t) {
100
+ if (!k(t)) return null;
101
+ let { start: n, end: r } = t;
102
+ return n !== null && T(e, n) ? "start" : r !== null && T(e, r) ? "end" : n === null || r === null ? null : S(e, n) > 0 && S(e, r) < 0 ? "inside" : null;
103
+ }
104
+ function M(e, t) {
105
+ if (k(t)) {
106
+ let n = j(e, t);
107
+ return n === "start" || n === "end";
108
+ }
109
+ return A(t).some((t) => T(t, e));
110
+ }
111
+ function ge(e, t, n) {
112
+ if (n === "single") return M(e, t) ? null : e;
113
+ if (n === "multiple") {
114
+ let n = A(t), r = n.filter((t) => !T(t, e));
115
+ return r.length === n.length ? [...n, e].sort(S) : r;
116
+ }
117
+ let r = k(t) ? t : {
118
+ start: null,
119
+ end: null
120
+ };
121
+ return r.start === null || r.end !== null ? {
122
+ start: e,
123
+ end: null
124
+ } : S(e, r.start) < 0 ? {
125
+ start: e,
126
+ end: r.start
127
+ } : {
128
+ start: r.start,
129
+ end: e
130
+ };
131
+ }
132
+ function _e(e, t) {
133
+ return t === null || !k(e) || e.start === null || e.end !== null ? null : S(t, e.start) < 0 ? {
134
+ start: t,
135
+ end: e.start
136
+ } : {
137
+ start: e.start,
138
+ end: t
139
+ };
140
+ }
141
+ function ve(e, t) {
142
+ if (k(e) || k(t)) return !k(e) || !k(t) ? !1 : T(e.start, t.start) && T(e.end, t.end);
143
+ let n = A(e), r = A(t);
144
+ return n.length === r.length && n.every((e, t) => T(e, r[t] ?? null));
145
+ }
146
+ //#endregion
147
+ //#region src/calendar/calendar-day-cell.tsx
148
+ function ye({ day: e, dayLabel: t, editable: n, filled: r, focused: i, inert: a, markName: o, marks: s, onHover: c, onSelect: l, outsideDays: u, pending: d, renderDay: f, renderDayTooltip: p, today: m, unavailable: ee, value: te }) {
149
+ let { date: h, outsideMonth: g } = e;
150
+ if (g && u === "hidden") return /* @__PURE__ */ v("td", {
151
+ "data-outside-month": "",
152
+ "data-part": "cell",
153
+ "data-part-cell": ""
154
+ });
155
+ let _ = a(h), ne = _ || ee(h) || g && u === "shown", b = M(h, te), x = j(h, d ?? te), re = d !== null && x !== null && !b, S = T(h, i), C = s?.get(se(h)), w = {
156
+ outside: g,
157
+ selected: b,
158
+ today: m !== null && T(h, m),
159
+ unavailable: ee(h)
160
+ }, ie = {
161
+ "aria-disabled": ne ? !0 : void 0,
162
+ "aria-pressed": b,
163
+ role: "button",
164
+ ...t === void 0 ? {} : { "aria-label": t(h) }
165
+ };
166
+ return /* @__PURE__ */ v("td", {
167
+ "data-part": "cell",
168
+ "data-part-cell": "",
169
+ ...g ? { "data-outside-month": "" } : {},
170
+ ..._ ? { "data-inert": "" } : {},
171
+ ...w.unavailable ? { "data-unavailable": "" } : {},
172
+ ...b ? { "data-selected": "" } : {},
173
+ ...x === "start" ? { "data-range-start": "" } : {},
174
+ ...x === "end" ? { "data-range-end": "" } : {},
175
+ ...x === "inside" ? { "data-in-range": "" } : {},
176
+ ...re ? { "data-preview": "" } : {},
177
+ children: /* @__PURE__ */ y(he, {
178
+ "data-part": "day",
179
+ "data-part-day": "",
180
+ ...w.today ? { "data-today": "" } : {},
181
+ onClick: (e) => {
182
+ ne || l(h, "pointer", e);
183
+ },
184
+ onPointerEnter: () => c(h),
185
+ onPointerLeave: () => c(null),
186
+ tabIndex: S && n ? 0 : -1,
187
+ tooltip: _ ? null : p?.(h, w),
188
+ ..._ ? {} : ie,
189
+ children: [
190
+ r && /* @__PURE__ */ v("span", {
191
+ "data-part": "day-number",
192
+ "data-part-day-number": "",
193
+ children: h.day
194
+ }),
195
+ !r && h.day,
196
+ f !== void 0 && /* @__PURE__ */ v("span", {
197
+ "data-part": "day-content",
198
+ "data-part-day-content": "",
199
+ children: f(h, w)
200
+ }),
201
+ C !== void 0 && /* @__PURE__ */ v("span", {
202
+ "data-part": "mark",
203
+ "data-part-mark": "",
204
+ ...C.tone === void 0 ? {} : { "data-tone": C.tone },
205
+ children: /* @__PURE__ */ v("span", {
206
+ "data-ui": "visually-hidden",
207
+ "data-ui-visually-hidden": "",
208
+ children: `, ${o(C)}`
209
+ })
210
+ })
211
+ ]
212
+ })
213
+ });
214
+ }
215
+ //#endregion
216
+ //#region src/calendar/calendar-month-table.tsx
217
+ function be({ firstDayOfWeek: e, fixedWeeks: t, format: n, headingId: r, month: i, weekNumbers: a, ...o }) {
218
+ let s = ae({
219
+ ...i,
220
+ firstDayOfWeek: e,
221
+ fixedWeeks: t
222
+ }), c = n.monthYear(E(i.year, i.month, 1)), l = n.weekdayNames("long"), u = n.weekdayNames(o.filled ? "short" : "narrow");
223
+ return /* @__PURE__ */ y("table", {
224
+ "aria-labelledby": r,
225
+ "data-part": "grid",
226
+ "data-part-grid": "",
227
+ role: "grid",
228
+ children: [
229
+ /* @__PURE__ */ v("caption", {
230
+ "data-part": "grid-caption",
231
+ "data-part-grid-caption": "",
232
+ children: c
233
+ }),
234
+ /* @__PURE__ */ v("thead", { children: /* @__PURE__ */ y("tr", {
235
+ "data-part": "week-headers",
236
+ "data-part-week-headers": "",
237
+ children: [a && /* @__PURE__ */ v("th", {
238
+ "aria-hidden": "true",
239
+ "data-part": "week-number",
240
+ "data-part-week-number": ""
241
+ }), u.map((e, t) => /* @__PURE__ */ v("th", {
242
+ abbr: l[t],
243
+ "data-part": "week-header",
244
+ "data-part-week-header": "",
245
+ scope: "col",
246
+ children: e
247
+ }, l[t]))]
248
+ }) }),
249
+ /* @__PURE__ */ v("tbody", { children: s.map((e) => /* @__PURE__ */ y("tr", {
250
+ "data-part": "week",
251
+ "data-part-week": "",
252
+ children: [a && /* @__PURE__ */ v("th", {
253
+ "data-part": "week-number",
254
+ "data-part-week-number": "",
255
+ scope: "row",
256
+ children: e.weekNumber
257
+ }), e.days.map((e) => /* @__PURE__ */ d(ye, {
258
+ ...o,
259
+ day: e,
260
+ key: `${String(e.date.month)}-${String(e.date.day)}`
261
+ }))]
262
+ }, e.weekNumber)) })
263
+ ]
264
+ });
265
+ }
266
+ //#endregion
267
+ //#region src/calendar/calendar-periods.tsx
268
+ function xe({ focused: e, format: t, held: n, monthly: r, onMonth: i, onWalkDown: a, refused: o, view: s, years: c }) {
269
+ return s === "month" ? /* @__PURE__ */ v("div", {
270
+ "data-part": "months",
271
+ "data-part-months": "",
272
+ children: t.monthNames("short").map((s, c) => {
273
+ let l = c + 1, u = e.month === l, d = r ? n?.year === e.year && n.month === l : u, f = {
274
+ "aria-label": t.monthYear(E(e.year, l, 1)),
275
+ tabIndex: u ? 0 : -1,
276
+ ...o(l) ? {
277
+ "aria-disabled": !0,
278
+ "data-unavailable": ""
279
+ } : {},
280
+ ...u ? { "data-focused": "" } : {}
281
+ };
282
+ return /* @__PURE__ */ v("button", {
283
+ "aria-pressed": d,
284
+ "data-part": "period",
285
+ "data-part-period": "",
286
+ onClick: (t) => {
287
+ r ? i(l, t) : a({
288
+ ...e,
289
+ month: l,
290
+ day: 1
291
+ }, "day", t);
292
+ },
293
+ type: "button",
294
+ ...d ? { "data-selected": "" } : {},
295
+ ...r ? f : {},
296
+ children: s
297
+ }, s);
298
+ })
299
+ }) : /* @__PURE__ */ v("div", {
300
+ "data-part": "years",
301
+ "data-part-years": "",
302
+ children: c.map((t) => /* @__PURE__ */ v("button", {
303
+ "aria-pressed": e.year === t,
304
+ "data-part": "period",
305
+ "data-part-period": "",
306
+ onClick: (n) => a({
307
+ ...e,
308
+ year: t,
309
+ day: 1
310
+ }, "month", n),
311
+ type: "button",
312
+ ...e.year === t ? { "data-selected": "" } : {},
313
+ children: t
314
+ }, t))
315
+ });
316
+ }
317
+ //#endregion
318
+ //#region src/calendar/calendar.tsx
319
+ var Se = {
320
+ day: 7,
321
+ month: 4,
322
+ year: 4
323
+ }, N = 12;
324
+ function P({ calendar: n, className: r, defaultFocusedDate: i, defaultValue: a, defaultView: o, disabled: s, firstDayOfWeek: u, fixedWeeks: d, focusedDate: p, granularity: S, header: ae = !0, dayAlign: se = "center", dayLabel: de, invalid: pe, isDateInert: he, isDateUnavailable: A, layout: j = "cells", lines: M = !1, locale: ye, max: P, min: F, messages: Ce, months: we, onFocusedDateChange: Te, onKeyDown: Ee, onPreviewChange: De, onValueChange: Oe, onViewChange: ke, marks: Ae, outsideDays: je, readOnly: Me, ref: Ne, render: Pe, renderDay: Fe, renderDayTooltip: Ie, selectionMode: Le = "single", style: Re, timeZone: ze, todayMark: Be = "dot", value: I, view: Ve, weekNumbers: He, ...Ue }) {
325
+ let L = fe(), We = e(), R = t(b, Ce), z = g(null), Ge = ee(), Ke = ye ?? We, qe = u ?? L.firstDayOfWeek, Je = ze ?? L.timeZone, B = Math.max(1, we ?? L.months), Ye = He ?? L.weekNumbers, Xe = d ?? L.fixedWeeks, Ze = je ?? L.outsideDays ?? (B > 1 ? "hidden" : "shown"), Qe = n ?? L.calendar, V = s !== !0 && Me !== !0, H = h(() => C({
326
+ locale: Ke,
327
+ firstDayOfWeek: qe
328
+ }), [qe, Ke]), [U, $e] = _(null);
329
+ m(() => $e(ce(Je)), [Je]);
330
+ let [et, tt] = _(a ?? null), W = I ?? et, G = a ?? I ?? null, nt = G === null ? null : Array.isArray(G) ? G[0] ?? null : "start" in G ? G.start : G, rt = i !== void 0 || p !== void 0 || nt !== null, K = i ?? p ?? nt ?? E(2026, 1, 1), [it, at] = _(K), q = p ?? it, J = g(!1), Y = S === "month", [ot, st] = _(o ?? (Y ? "month" : "day")), ct = Ve ?? ot, X = Y && ct === "day" ? "month" : ct, [lt, ut] = _(null), Z = Le === "range" && V ? _e(W, lt ?? q) : null, Q = Z === null ? null : k(W) && W.start !== null && T(Z.start, W.start) ? Z.end : Z.start, dt = g(null);
331
+ m(() => {
332
+ T(dt.current, Q) || (dt.current = Q, De?.(Q));
333
+ }, [De, Q]);
334
+ let [ft, pt] = _(() => ({
335
+ year: K.year,
336
+ month: K.month
337
+ })), mt = f((e, t) => {
338
+ let n = t.year * 12 + (t.month - 1), r = e.year * 12 + (e.month - 1);
339
+ if (r >= n && r < n + B) return t;
340
+ let i = n + Math.floor((r - n) / B) * B;
341
+ return {
342
+ year: Math.floor(i / 12),
343
+ month: i % 12 + 1
344
+ };
345
+ }, [B]);
346
+ m(() => {
347
+ if (U === null || rt) return;
348
+ let e = re(U, F, P);
349
+ at((t) => T(t, K) ? e : t), pt((t) => t.year === K.year && t.month === K.month ? {
350
+ year: e.year,
351
+ month: e.month
352
+ } : t);
353
+ }, [U]);
354
+ let ht = f((e, t, n) => {
355
+ l({
356
+ controlled: I,
357
+ initial: W,
358
+ equals: ve,
359
+ onRequest: (e) => Oe?.(e.value, e)
360
+ }).request(e, t, n) && tt(e);
361
+ }, [
362
+ W,
363
+ Oe,
364
+ I
365
+ ]), $ = f((e, t, n) => {
366
+ let r = re(e, F, P), i = l({
367
+ controlled: p,
368
+ initial: q,
369
+ equals: (e, t) => T(e, t),
370
+ onRequest: (e) => Te?.(e.value, e)
371
+ });
372
+ J.current = t === "keyboard", i.request(r, t, n) && at(r);
373
+ }, [
374
+ q,
375
+ p,
376
+ P,
377
+ F,
378
+ Te
379
+ ]);
380
+ m(() => {
381
+ pt((e) => mt(q, e));
382
+ }, [q, mt]);
383
+ let gt = f((e) => {
384
+ Ve === void 0 && st(e), ke?.(e);
385
+ }, [ke, Ve]);
386
+ m(() => {
387
+ if (!J.current) return;
388
+ let e = z.current, t = e?.querySelector("[data-part=\"cell\"]:not([data-outside-month]) [data-part=\"day\"][tabindex=\"0\"], [data-part=\"period\"][tabindex=\"0\"]");
389
+ if (t == null) {
390
+ e?.querySelector("[data-part=\"day\"][tabindex=\"0\"]") ?? (J.current = !1);
391
+ return;
392
+ }
393
+ J.current = !1, t.focus();
394
+ }), te(Ne, () => ({
395
+ focus: () => {
396
+ z.current?.querySelector("[data-part=\"day\"][tabindex=\"0\"], [data-part=\"period\"][tabindex=\"0\"]")?.focus();
397
+ },
398
+ focusDate: (e) => $(e, "keyboard", void 0)
399
+ }), [$]);
400
+ let _t = f((e) => he?.(e) === !0, [he]), vt = f((e) => !_t(e) && (!ie(e, F, P) || A?.(e) === !0), [
401
+ _t,
402
+ A,
403
+ P,
404
+ F
405
+ ]), yt = (e, t, n) => {
406
+ !V || _t(e) || vt(e) || (ht(ge(e, W, Le), t, n), $(e, t, n));
407
+ }, bt = (e, t) => F !== void 0 && e * 12 + t < F.year * 12 + F.month || P !== void 0 && e * 12 + t > P.year * 12 + P.month, xt = (e, t, n, r) => {
408
+ if (!V || bt(e, t)) return;
409
+ let i = E(e, t, 1);
410
+ ht(i, n, r), $(i, n, r);
411
+ }, St = W === null || Array.isArray(W) || k(W) ? null : {
412
+ year: W.year,
413
+ month: W.month
414
+ }, Ct = (e) => {
415
+ if (Ee?.(e), e.defaultPrevented) return;
416
+ let t = z.current !== null && getComputedStyle(z.current).direction === "rtl", n = t ? "ArrowLeft" : "ArrowRight", r = t ? "ArrowRight" : "ArrowLeft", i = () => {
417
+ e.preventDefault(), e.stopPropagation();
418
+ }, a = (t) => {
419
+ i(), $(t, "keyboard", e);
420
+ };
421
+ if (Y && X === "month") {
422
+ let t = (e) => {
423
+ let t = q.year * 12 + (q.month - 1) + e;
424
+ return E(Math.floor(t / 12), t % 12 + 1, 1);
425
+ }, o = Se.month;
426
+ switch (e.key) {
427
+ case n: return a(t(1));
428
+ case r: return a(t(-1));
429
+ case "ArrowUp": return a(t(-o));
430
+ case "ArrowDown": return a(t(o));
431
+ case "Home": return a(E(q.year, 1, 1));
432
+ case "End": return a(E(q.year, 12, 1));
433
+ case "PageUp": return a(t(-12));
434
+ case "PageDown": return a(t(12));
435
+ case "Enter":
436
+ case " ":
437
+ i(), xt(q.year, q.month, "keyboard", e);
438
+ return;
439
+ }
440
+ }
441
+ switch (e.key) {
442
+ case n: return a(x(q, 1));
443
+ case r: return a(x(q, -1));
444
+ case "ArrowUp": return a(x(q, -7));
445
+ case "ArrowDown": return a(x(q, 7));
446
+ case "Home": return a(oe(q, H.firstDayOfWeek));
447
+ case "End": return a(w(q, H.firstDayOfWeek));
448
+ case "PageUp": return a(e.shiftKey ? O(q, -1).date : D(q, -1).date);
449
+ case "PageDown": return a(e.shiftKey ? O(q, 1).date : D(q, 1).date);
450
+ case "Enter":
451
+ case " ":
452
+ i(), yt(q, "keyboard", e);
453
+ return;
454
+ case "Escape":
455
+ if (X === "day" || Y && X === "month") return;
456
+ i(), gt(X === "year" ? "month" : "day");
457
+ return;
458
+ default: return;
459
+ }
460
+ }, wt = (e) => (t) => {
461
+ if (X === "day") {
462
+ $(D(q, e * B).date, "pointer", t);
463
+ return;
464
+ }
465
+ $(X === "month" ? O(q, e).date : O(q, e * N).date, "pointer", t);
466
+ }, Tt = E(ft.year, ft.month, 1), Et = X === "day" ? B === 1 ? H.monthYear(Tt) : `${H.monthYear(Tt, "short")} – ${H.monthYear(D(Tt, B - 1).date, "short")}` : X === "month" ? String(q.year) : `${String(ue(q.year, N)[0] ?? q.year)} – ${String(ue(q.year, N).at(-1) ?? q.year)}`, Dt = X === "day" ? /* @__PURE__ */ v("div", {
467
+ "data-part": "grids",
468
+ "data-part-grids": "",
469
+ children: le(ft, B).map((e) => /* @__PURE__ */ v(be, {
470
+ editable: V,
471
+ firstDayOfWeek: H.firstDayOfWeek,
472
+ fixedWeeks: Xe,
473
+ focused: q,
474
+ format: H,
475
+ filled: j === "fill",
476
+ headingId: ae ? Ge : void 0,
477
+ inert: _t,
478
+ month: e,
479
+ onHover: ut,
480
+ dayLabel: de,
481
+ marks: Ae,
482
+ renderDay: Fe,
483
+ renderDayTooltip: Ie,
484
+ markName: (e) => e.count === void 0 ? R("marked") : R("markCount", { count: e.count }),
485
+ onSelect: yt,
486
+ outsideDays: Ze,
487
+ pending: Z,
488
+ today: U,
489
+ unavailable: vt,
490
+ value: W,
491
+ weekNumbers: Ye
492
+ }, `${String(e.year)}-${String(e.month)}`))
493
+ }) : /* @__PURE__ */ v(xe, {
494
+ focused: q,
495
+ format: H,
496
+ held: St,
497
+ monthly: Y,
498
+ onMonth: (e, t) => xt(q.year, e, "pointer", t),
499
+ onWalkDown: (e, t, n) => {
500
+ $(e, "pointer", n), gt(t);
501
+ },
502
+ refused: (e) => bt(q.year, e),
503
+ view: X,
504
+ years: ue(q.year, N)
505
+ }), [Ot, kt] = X === "day" ? [R("previousMonth"), R("nextMonth")] : X === "month" ? [R("previousYear"), R("nextYear")] : [R("previousYears"), R("nextYears")], At = /* @__PURE__ */ y(ne, { children: [ae ? /* @__PURE__ */ v(me, {
506
+ editable: V,
507
+ heading: Et,
508
+ headingId: Ge,
509
+ nextName: kt,
510
+ onTurn: wt,
511
+ onWalkUp: () => gt(X === "day" ? "month" : "year"),
512
+ previousName: Ot,
513
+ view: X
514
+ }) : null, Dt] }), jt = c({
515
+ ...Ue,
516
+ children: At,
517
+ className: r,
518
+ onKeyDown: Ct,
519
+ style: Re,
520
+ ...s === !0 ? { "data-disabled": "" } : {},
521
+ ...pe === !0 ? { "data-invalid": "" } : {},
522
+ ...Me === !0 ? { "data-readonly": "" } : {},
523
+ ...Ye ? { "data-week-numbers": "" } : {},
524
+ ...B > 1 ? { "data-months": String(B) } : {},
525
+ ...j === "fill" ? { "data-layout": "fill" } : {},
526
+ ...M ? { "data-lines": "" } : {},
527
+ ...se === "start" ? { "data-day-align": "start" } : {},
528
+ ...Be === "disc" ? { "data-today-mark": "disc" } : {},
529
+ "data-calendar": Qe,
530
+ "data-columns": String(Se[X]),
531
+ "data-part": "root",
532
+ "data-ui": "calendar",
533
+ "data-view": X,
534
+ ref: z
535
+ });
536
+ return Pe === void 0 ? /* @__PURE__ */ v("div", { ...jt }) : Pe(jt);
537
+ }
538
+ //#endregion
539
+ //#region src/calendar/calendar-day.tsx
540
+ function F(e) {
541
+ return /* @__PURE__ */ v("span", {
542
+ ...e,
543
+ "data-part": "day-marks",
544
+ "data-part-day-marks": ""
545
+ });
546
+ }
547
+ function Ce({ hollow: e = !1, tone: t, ...n }) {
548
+ return /* @__PURE__ */ v("span", {
549
+ ...n,
550
+ "data-part": "day-mark",
551
+ "data-part-day-mark": "",
552
+ ...e ? { "data-hollow": "" } : {},
553
+ ...t === void 0 ? {} : { "data-tone": t }
554
+ });
555
+ }
556
+ function we(e) {
557
+ return /* @__PURE__ */ v("span", {
558
+ ...e,
559
+ "data-part": "day-value",
560
+ "data-part-day-value": ""
561
+ });
562
+ }
563
+ //#endregion
564
+ export { A as a, M as c, pe as d, fe as f, P as i, ge as l, F as n, k as o, we as r, ve as s, Ce as t, j as u };
package/dist/calendar.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as e, c as t, d as n, f as r, i, l as a, n as o, o as s, r as c, s as l, t as u, u as d } from "./calendar-D8FhdXWc.js";
1
+ import { a as e, c as t, d as n, f as r, i, l as a, n as o, o as s, r as c, s as l, t as u, u as d } from "./calendar-CX0wN5Bh.js";
2
2
  export { i as Calendar, u as CalendarDayMark, o as CalendarDayMarks, c as CalendarDayValue, n as CalendarDefaultsProvider, e as asDates, s as isRange, l as isSameValue, t as isSelected, a as nextValue, d as rangeStateOf, r as useCalendarDefaults };
@@ -9,12 +9,12 @@ import { t as g } from "./text-field-Cnjc7LB5.js";
9
9
  import { a as _, d as ee, f as te, l as ne, r as re, t as ie } from "./popover-BfEn2wdZ.js";
10
10
  import { t as v } from "./visually-hidden-BUSrFZ1_.js";
11
11
  import { i as ae, n as oe, o as se, r as ce, t as le } from "./result-state-BMYhelu1.js";
12
- import { t as ue } from "./date-picker-DQbj3FON.js";
12
+ import { t as ue } from "./date-picker-CLXTtQGe.js";
13
13
  import { t as de } from "./date-field-CxubN_3u.js";
14
- import { t as fe } from "./date-range-picker-B16hMhJf.js";
15
- import { t as pe } from "./datetime-picker-C9pxH7Xf.js";
14
+ import { t as fe } from "./date-range-picker-Br0neGyT.js";
15
+ import { t as pe } from "./datetime-picker-CR-H_BLu.js";
16
16
  import { t as me } from "./datetime-field-GMIqBuTa.js";
17
- import { t as he } from "./datetime-range-picker-Cmn7o_Qv.js";
17
+ import { t as he } from "./datetime-range-picker-BLo58OIk.js";
18
18
  import { a as ge, i as _e, n as ve, s as ye } from "./multi-select-DEd_92BC.js";
19
19
  import { t as be } from "./number-field-BJKoidAE.js";
20
20
  import { a as xe, t as Se } from "./segmented-control-D52GeOlS.js";
package/dist/data-grid.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./data-grid-C5YmAqdN.js";
1
+ import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./data-grid-Cx0ZOf_e.js";
2
2
  export { e as DRAG_COLUMN, n as DataGrid, i as DataGridDefaultsProvider, r as EXPANDER_COLUMN, a as SELECTION_COLUMN, t as useDataGridDefaults, o as usePersistedGridView };