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

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 (71) hide show
  1. package/dist/calendar-CE3aMhdR.js +568 -0
  2. package/dist/calendar.js +1 -1
  3. package/dist/{data-grid-C5YmAqdN.js → data-grid-BKuD1dvr.js} +4 -4
  4. package/dist/data-grid.js +1 -1
  5. package/dist/{date-picker-DQbj3FON.js → date-picker-CF3WQxYe.js} +1 -1
  6. package/dist/date-picker.js +1 -1
  7. package/dist/{date-range-picker-B16hMhJf.js → date-range-picker-CvFs-nHN.js} +1 -1
  8. package/dist/date-range-picker.js +1 -1
  9. package/dist/{datetime-picker-C9pxH7Xf.js → datetime-picker-lWc4HT6a.js} +1 -1
  10. package/dist/datetime-picker.js +1 -1
  11. package/dist/{datetime-range-picker-Cmn7o_Qv.js → datetime-range-picker-ynZUZreq.js} +1 -1
  12. package/dist/datetime-range-picker.js +1 -1
  13. package/dist/docs/calendar.json +42 -2
  14. package/dist/docs/calendar.md +7 -1
  15. package/dist/docs/message.json +15 -0
  16. package/dist/docs/message.md +2 -1
  17. package/dist/docs/table.json +12 -0
  18. package/dist/docs/table.md +2 -0
  19. package/dist/{filter-bar-Cfwk-3Eu.js → filter-bar-DUXtlPRn.js} +2 -2
  20. package/dist/filter-bar.js +1 -1
  21. package/dist/{import-export-center-BH1bNw_E.js → import-export-center-D0ckqmhq.js} +1 -1
  22. package/dist/import-export-center.js +1 -1
  23. package/dist/index.js +39 -39
  24. package/dist/{message-CdcUyh3g.js → message-D1Dd6Y2k.js} +6 -5
  25. package/dist/message.js +1 -1
  26. package/dist/roving-focus-BXshJYlW.js +149 -0
  27. package/dist/roving-focus.js +2 -2
  28. package/dist/styles/calendar.css +1 -1
  29. package/dist/styles/data-grid.css +1 -1
  30. package/dist/styles/date-picker.css +1 -1
  31. package/dist/styles/date-range-picker.css +1 -1
  32. package/dist/styles/datetime-picker.css +1 -1
  33. package/dist/styles/datetime-range-picker.css +1 -1
  34. package/dist/styles/filter-bar.css +1 -1
  35. package/dist/styles/import-export-center.css +2 -2
  36. package/dist/styles/index.css +3 -3
  37. package/dist/styles/message.css +1 -1
  38. package/dist/styles/table.css +2 -2
  39. package/dist/styles.css +1 -1
  40. package/dist/{table-CnXBp9j9.js → table-B04FiwYZ.js} +353 -351
  41. package/dist/table.js +1 -1
  42. package/dist/types/calendar/calendar-day-cell.d.ts +30 -0
  43. package/dist/types/calendar/calendar-day-cell.d.ts.map +1 -0
  44. package/dist/types/calendar/calendar-month-table.d.ts +18 -0
  45. package/dist/types/calendar/calendar-month-table.d.ts.map +1 -0
  46. package/dist/types/calendar/calendar-periods.d.ts +24 -0
  47. package/dist/types/calendar/calendar-periods.d.ts.map +1 -0
  48. package/dist/types/calendar/calendar.d.ts +1 -1
  49. package/dist/types/calendar/calendar.d.ts.map +1 -1
  50. package/dist/types/calendar/calendar.types.d.ts +23 -0
  51. package/dist/types/calendar/calendar.types.d.ts.map +1 -1
  52. package/dist/types/calendar/index.d.ts +1 -1
  53. package/dist/types/calendar/index.d.ts.map +1 -1
  54. package/dist/types/message/message-parts.d.ts +1 -1
  55. package/dist/types/message/message-parts.d.ts.map +1 -1
  56. package/dist/types/message/message.types.d.ts +2 -0
  57. package/dist/types/message/message.types.d.ts.map +1 -1
  58. package/dist/types/roving-focus/index.d.ts +2 -0
  59. package/dist/types/roving-focus/index.d.ts.map +1 -1
  60. package/dist/types/roving-focus/roving-grid.d.ts +27 -0
  61. package/dist/types/roving-focus/roving-grid.d.ts.map +1 -0
  62. package/dist/types/table/index.d.ts +1 -1
  63. package/dist/types/table/index.d.ts.map +1 -1
  64. package/dist/types/table/table-defaults.d.ts.map +1 -1
  65. package/dist/types/table/table.d.ts +1 -1
  66. package/dist/types/table/table.d.ts.map +1 -1
  67. package/dist/types/table/table.types.d.ts +10 -0
  68. package/dist/types/table/table.types.d.ts.map +1 -1
  69. package/package.json +6 -6
  70. package/dist/calendar-D8FhdXWc.js +0 -537
  71. package/dist/roving-focus-C5-rVFzI.js +0 -89
@@ -0,0 +1,568 @@
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-selected": b ? !0 : void 0,
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
+ "data-part": "period",
284
+ "data-part-period": "",
285
+ onClick: (t) => {
286
+ r ? i(l, t) : a({
287
+ ...e,
288
+ month: l,
289
+ day: 1
290
+ }, "day", t);
291
+ },
292
+ type: "button",
293
+ ...d ? {
294
+ "aria-selected": !0,
295
+ "data-selected": ""
296
+ } : {},
297
+ ...r ? f : {},
298
+ children: s
299
+ }, s);
300
+ })
301
+ }) : /* @__PURE__ */ v("div", {
302
+ "data-part": "years",
303
+ "data-part-years": "",
304
+ children: c.map((t) => /* @__PURE__ */ v("button", {
305
+ "data-part": "period",
306
+ "data-part-period": "",
307
+ onClick: (n) => a({
308
+ ...e,
309
+ year: t,
310
+ day: 1
311
+ }, "month", n),
312
+ type: "button",
313
+ ...e.year === t ? {
314
+ "aria-selected": !0,
315
+ "data-selected": ""
316
+ } : {},
317
+ children: t
318
+ }, t))
319
+ });
320
+ }
321
+ //#endregion
322
+ //#region src/calendar/calendar.tsx
323
+ var Se = {
324
+ day: 7,
325
+ month: 4,
326
+ year: 4
327
+ }, N = 12;
328
+ 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 }) {
329
+ 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({
330
+ locale: Ke,
331
+ firstDayOfWeek: qe
332
+ }), [qe, Ke]), [U, $e] = _(null);
333
+ m(() => $e(ce(Je)), [Je]);
334
+ 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);
335
+ m(() => {
336
+ T(dt.current, Q) || (dt.current = Q, De?.(Q));
337
+ }, [De, Q]);
338
+ let [ft, pt] = _(() => ({
339
+ year: K.year,
340
+ month: K.month
341
+ })), mt = f((e, t) => {
342
+ let n = t.year * 12 + (t.month - 1), r = e.year * 12 + (e.month - 1);
343
+ if (r >= n && r < n + B) return t;
344
+ let i = n + Math.floor((r - n) / B) * B;
345
+ return {
346
+ year: Math.floor(i / 12),
347
+ month: i % 12 + 1
348
+ };
349
+ }, [B]);
350
+ m(() => {
351
+ if (U === null || rt) return;
352
+ let e = re(U, F, P);
353
+ at((t) => T(t, K) ? e : t), pt((t) => t.year === K.year && t.month === K.month ? {
354
+ year: e.year,
355
+ month: e.month
356
+ } : t);
357
+ }, [U]);
358
+ let ht = f((e, t, n) => {
359
+ l({
360
+ controlled: I,
361
+ initial: W,
362
+ equals: ve,
363
+ onRequest: (e) => Oe?.(e.value, e)
364
+ }).request(e, t, n) && tt(e);
365
+ }, [
366
+ W,
367
+ Oe,
368
+ I
369
+ ]), $ = f((e, t, n) => {
370
+ let r = re(e, F, P), i = l({
371
+ controlled: p,
372
+ initial: q,
373
+ equals: (e, t) => T(e, t),
374
+ onRequest: (e) => Te?.(e.value, e)
375
+ });
376
+ J.current = t === "keyboard", i.request(r, t, n) && at(r);
377
+ }, [
378
+ q,
379
+ p,
380
+ P,
381
+ F,
382
+ Te
383
+ ]);
384
+ m(() => {
385
+ pt((e) => mt(q, e));
386
+ }, [q, mt]);
387
+ let gt = f((e) => {
388
+ Ve === void 0 && st(e), ke?.(e);
389
+ }, [ke, Ve]);
390
+ m(() => {
391
+ if (!J.current) return;
392
+ let e = z.current, t = e?.querySelector("[data-part=\"cell\"]:not([data-outside-month]) [data-part=\"day\"][tabindex=\"0\"], [data-part=\"period\"][tabindex=\"0\"]");
393
+ if (t == null) {
394
+ e?.querySelector("[data-part=\"day\"][tabindex=\"0\"]") ?? (J.current = !1);
395
+ return;
396
+ }
397
+ J.current = !1, t.focus();
398
+ }), te(Ne, () => ({
399
+ focus: () => {
400
+ z.current?.querySelector("[data-part=\"day\"][tabindex=\"0\"], [data-part=\"period\"][tabindex=\"0\"]")?.focus();
401
+ },
402
+ focusDate: (e) => $(e, "keyboard", void 0)
403
+ }), [$]);
404
+ let _t = f((e) => he?.(e) === !0, [he]), vt = f((e) => !_t(e) && (!ie(e, F, P) || A?.(e) === !0), [
405
+ _t,
406
+ A,
407
+ P,
408
+ F
409
+ ]), yt = (e, t, n) => {
410
+ !V || _t(e) || vt(e) || (ht(ge(e, W, Le), t, n), $(e, t, n));
411
+ }, 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) => {
412
+ if (!V || bt(e, t)) return;
413
+ let i = E(e, t, 1);
414
+ ht(i, n, r), $(i, n, r);
415
+ }, St = W === null || Array.isArray(W) || k(W) ? null : {
416
+ year: W.year,
417
+ month: W.month
418
+ }, Ct = (e) => {
419
+ if (Ee?.(e), e.defaultPrevented) return;
420
+ let t = z.current !== null && getComputedStyle(z.current).direction === "rtl", n = t ? "ArrowLeft" : "ArrowRight", r = t ? "ArrowRight" : "ArrowLeft", i = () => {
421
+ e.preventDefault(), e.stopPropagation();
422
+ }, a = (t) => {
423
+ i(), $(t, "keyboard", e);
424
+ };
425
+ if (Y && X === "month") {
426
+ let t = (e) => {
427
+ let t = q.year * 12 + (q.month - 1) + e;
428
+ return E(Math.floor(t / 12), t % 12 + 1, 1);
429
+ }, o = Se.month;
430
+ switch (e.key) {
431
+ case n: return a(t(1));
432
+ case r: return a(t(-1));
433
+ case "ArrowUp": return a(t(-o));
434
+ case "ArrowDown": return a(t(o));
435
+ case "Home": return a(E(q.year, 1, 1));
436
+ case "End": return a(E(q.year, 12, 1));
437
+ case "PageUp": return a(t(-12));
438
+ case "PageDown": return a(t(12));
439
+ case "Enter":
440
+ case " ":
441
+ i(), xt(q.year, q.month, "keyboard", e);
442
+ return;
443
+ }
444
+ }
445
+ switch (e.key) {
446
+ case n: return a(x(q, 1));
447
+ case r: return a(x(q, -1));
448
+ case "ArrowUp": return a(x(q, -7));
449
+ case "ArrowDown": return a(x(q, 7));
450
+ case "Home": return a(oe(q, H.firstDayOfWeek));
451
+ case "End": return a(w(q, H.firstDayOfWeek));
452
+ case "PageUp": return a(e.shiftKey ? O(q, -1).date : D(q, -1).date);
453
+ case "PageDown": return a(e.shiftKey ? O(q, 1).date : D(q, 1).date);
454
+ case "Enter":
455
+ case " ":
456
+ i(), yt(q, "keyboard", e);
457
+ return;
458
+ case "Escape":
459
+ if (X === "day" || Y && X === "month") return;
460
+ i(), gt(X === "year" ? "month" : "day");
461
+ return;
462
+ default: return;
463
+ }
464
+ }, wt = (e) => (t) => {
465
+ if (X === "day") {
466
+ $(D(q, e * B).date, "pointer", t);
467
+ return;
468
+ }
469
+ $(X === "month" ? O(q, e).date : O(q, e * N).date, "pointer", t);
470
+ }, 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", {
471
+ "data-part": "grids",
472
+ "data-part-grids": "",
473
+ children: le(ft, B).map((e) => /* @__PURE__ */ v(be, {
474
+ editable: V,
475
+ firstDayOfWeek: H.firstDayOfWeek,
476
+ fixedWeeks: Xe,
477
+ focused: q,
478
+ format: H,
479
+ filled: j === "fill",
480
+ headingId: ae ? Ge : void 0,
481
+ inert: _t,
482
+ month: e,
483
+ onHover: ut,
484
+ dayLabel: de,
485
+ marks: Ae,
486
+ renderDay: Fe,
487
+ renderDayTooltip: Ie,
488
+ markName: (e) => e.count === void 0 ? R("marked") : R("markCount", { count: e.count }),
489
+ onSelect: yt,
490
+ outsideDays: Ze,
491
+ pending: Z,
492
+ today: U,
493
+ unavailable: vt,
494
+ value: W,
495
+ weekNumbers: Ye
496
+ }, `${String(e.year)}-${String(e.month)}`))
497
+ }) : /* @__PURE__ */ v(xe, {
498
+ focused: q,
499
+ format: H,
500
+ held: St,
501
+ monthly: Y,
502
+ onMonth: (e, t) => xt(q.year, e, "pointer", t),
503
+ onWalkDown: (e, t, n) => {
504
+ $(e, "pointer", n), gt(t);
505
+ },
506
+ refused: (e) => bt(q.year, e),
507
+ view: X,
508
+ years: ue(q.year, N)
509
+ }), [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, {
510
+ editable: V,
511
+ heading: Et,
512
+ headingId: Ge,
513
+ nextName: kt,
514
+ onTurn: wt,
515
+ onWalkUp: () => gt(X === "day" ? "month" : "year"),
516
+ previousName: Ot,
517
+ view: X
518
+ }) : null, Dt] }), jt = c({
519
+ ...Ue,
520
+ children: At,
521
+ className: r,
522
+ onKeyDown: Ct,
523
+ style: Re,
524
+ ...s === !0 ? { "data-disabled": "" } : {},
525
+ ...pe === !0 ? { "data-invalid": "" } : {},
526
+ ...Me === !0 ? { "data-readonly": "" } : {},
527
+ ...Ye ? { "data-week-numbers": "" } : {},
528
+ ...B > 1 ? { "data-months": String(B) } : {},
529
+ ...j === "fill" ? { "data-layout": "fill" } : {},
530
+ ...M ? { "data-lines": "" } : {},
531
+ ...se === "start" ? { "data-day-align": "start" } : {},
532
+ ...Be === "disc" ? { "data-today-mark": "disc" } : {},
533
+ "data-calendar": Qe,
534
+ "data-columns": String(Se[X]),
535
+ "data-part": "root",
536
+ "data-ui": "calendar",
537
+ "data-view": X,
538
+ ref: z
539
+ });
540
+ return Pe === void 0 ? /* @__PURE__ */ v("div", { ...jt }) : Pe(jt);
541
+ }
542
+ //#endregion
543
+ //#region src/calendar/calendar-day.tsx
544
+ function F(e) {
545
+ return /* @__PURE__ */ v("span", {
546
+ ...e,
547
+ "data-part": "day-marks",
548
+ "data-part-day-marks": ""
549
+ });
550
+ }
551
+ function Ce({ hollow: e = !1, tone: t, ...n }) {
552
+ return /* @__PURE__ */ v("span", {
553
+ ...n,
554
+ "data-part": "day-mark",
555
+ "data-part-day-mark": "",
556
+ ...e ? { "data-hollow": "" } : {},
557
+ ...t === void 0 ? {} : { "data-tone": t }
558
+ });
559
+ }
560
+ function we(e) {
561
+ return /* @__PURE__ */ v("span", {
562
+ ...e,
563
+ "data-part": "day-value",
564
+ "data-part-day-value": ""
565
+ });
566
+ }
567
+ //#endregion
568
+ 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-CE3aMhdR.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-CF3WQxYe.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-CvFs-nHN.js";
15
+ import { t as pe } from "./datetime-picker-lWc4HT6a.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-ynZUZreq.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-BKuD1dvr.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 };
@@ -1,6 +1,6 @@
1
1
  import { n as e, r as t } from "./i18n-D7xXDd8-.js";
2
2
  import { n, t as r } from "./icon-D04-_QFA.js";
3
- import { a as i, i as a, o as ee } from "./calendar-D8FhdXWc.js";
3
+ import { a as i, i as a, o as ee } from "./calendar-CE3aMhdR.js";
4
4
  import { b as o } from "./field-vOVzvq5t.js";
5
5
  import { t as te } from "./date-field-CxubN_3u.js";
6
6
  import { keyedProps as ne } from "@slotted/core/selector-key";
@@ -1,2 +1,2 @@
1
- import { n as e, r as t, t as n } from "./date-picker-DQbj3FON.js";
1
+ import { n as e, r as t, t as n } from "./date-picker-CF3WQxYe.js";
2
2
  export { n as DatePicker, e as DatePickerDefaultsProvider, t as useDatePickerDefaults };
@@ -1,6 +1,6 @@
1
1
  import { n as e, r as t } from "./i18n-D7xXDd8-.js";
2
2
  import { n, t as r } from "./icon-D04-_QFA.js";
3
- import { i, s as ee } from "./calendar-D8FhdXWc.js";
3
+ import { i, s as ee } from "./calendar-CE3aMhdR.js";
4
4
  import { b as te } from "./field-vOVzvq5t.js";
5
5
  import { t as a } from "./date-field-CxubN_3u.js";
6
6
  import { keyedProps as ne } from "@slotted/core/selector-key";
@@ -1,2 +1,2 @@
1
- import { i as e, n as t, r as n, t as r } from "./date-range-picker-B16hMhJf.js";
1
+ import { i as e, n as t, r as n, t as r } from "./date-range-picker-CvFs-nHN.js";
2
2
  export { r as DateRangePicker, n as DateRangePickerDefaultsProvider, t as DateRangePickerPreset, e as useDateRangePickerDefaults };
@@ -1,6 +1,6 @@
1
1
  import { n as e, r as t } from "./i18n-D7xXDd8-.js";
2
2
  import { n, t as r } from "./icon-D04-_QFA.js";
3
- import { i } from "./calendar-D8FhdXWc.js";
3
+ import { i } from "./calendar-CE3aMhdR.js";
4
4
  import { b as ee } from "./field-vOVzvq5t.js";
5
5
  import { t as te } from "./datetime-field-GMIqBuTa.js";
6
6
  import { keyedProps as ne } from "@slotted/core/selector-key";
@@ -1,2 +1,2 @@
1
- import { i as e, n as t, r as n, t as r } from "./datetime-picker-C9pxH7Xf.js";
1
+ import { i as e, n as t, r as n, t as r } from "./datetime-picker-lWc4HT6a.js";
2
2
  export { t as DATE_TIME_PICKER_MAX_OPTIONS, r as DateTimePicker, n as DateTimePickerDefaultsProvider, e as useDateTimePickerDefaults };
@@ -1,6 +1,6 @@
1
1
  import { n as e, r as t } from "./i18n-D7xXDd8-.js";
2
2
  import { n, t as r } from "./icon-D04-_QFA.js";
3
- import { i } from "./calendar-D8FhdXWc.js";
3
+ import { i } from "./calendar-CE3aMhdR.js";
4
4
  import { b as a } from "./field-vOVzvq5t.js";
5
5
  import { t as o } from "./datetime-field-GMIqBuTa.js";
6
6
  import { keyedProps as s } from "@slotted/core/selector-key";
@@ -1,2 +1,2 @@
1
- import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c } from "./datetime-range-picker-Cmn7o_Qv.js";
1
+ import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c } from "./datetime-range-picker-ynZUZreq.js";
2
2
  export { n as DATETIME_RANGE_PICKER_MAX_OPTIONS, e as DATETIME_RANGE_PICKER_MONTHS, a as DATETIME_RANGE_PICKER_STEP, c as DateTimeRangePicker, s as DateTimeRangePickerDefaultsProvider, i as DateTimeRangePickerPreset, t as dateTimeRangePickerLengthLabel, o as isSameDateTimeRange, r as useDateTimeRangePickerDefaults };