@slotted/react 0.1.0-beta.3 → 0.1.0-beta.4

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 (102) hide show
  1. package/dist/{accordion-D-YuMJzk.js → accordion-lCqrmQ3w.js} +43 -43
  2. package/dist/accordion.js +1 -1
  3. package/dist/calendar-BZ6PP7Ke.js +436 -0
  4. package/dist/calendar.js +1 -1
  5. package/dist/{collapsible-CGo49NNW.js → collapsible-F-K36XbF.js} +17 -17
  6. package/dist/collapsible.js +1 -1
  7. package/dist/{data-grid-BKaGMqIm.js → data-grid-Eb-a4jg3.js} +6 -6
  8. package/dist/data-grid.js +1 -1
  9. package/dist/date-field-Hr-OCU-H.js +290 -0
  10. package/dist/date-field.js +1 -1
  11. package/dist/date-picker-D3-y2Jxw.js +295 -0
  12. package/dist/date-picker.js +1 -1
  13. package/dist/{date-range-picker-CNOAtHwU.js → date-range-picker-y3b82Wmf.js} +2 -2
  14. package/dist/date-range-picker.js +1 -1
  15. package/dist/{datetime-picker-HDVlUhzy.js → datetime-picker-CIRHVLQp.js} +1 -1
  16. package/dist/datetime-picker.js +1 -1
  17. package/dist/{datetime-range-picker-IqOFJtdW.js → datetime-range-picker-DM-1m98z.js} +1 -1
  18. package/dist/datetime-range-picker.js +1 -1
  19. package/dist/{detail-panel-qOJiNuzr.js → detail-panel-CW53lUjp.js} +3 -3
  20. package/dist/detail-panel.js +1 -1
  21. package/dist/docs/calendar.json +7 -0
  22. package/dist/docs/calendar.md +1 -0
  23. package/dist/docs/collapsible.json +1 -1
  24. package/dist/docs/collapsible.md +1 -1
  25. package/dist/docs/date-field.json +8 -1
  26. package/dist/docs/date-field.md +2 -1
  27. package/dist/docs/date-picker.examples.md +29 -0
  28. package/dist/docs/date-picker.json +16 -1
  29. package/dist/docs/date-picker.md +2 -1
  30. package/dist/docs/guidelines/composition.md +10 -0
  31. package/dist/docs/guidelines/index.md +2 -0
  32. package/dist/docs/guidelines/list-pages.md +12 -1
  33. package/dist/docs/page.json +1 -0
  34. package/dist/docs/page.md +1 -0
  35. package/dist/docs/select.json +1 -1
  36. package/dist/docs/select.md +1 -1
  37. package/dist/docs/skills/compose-screen/SKILL.md +7 -0
  38. package/dist/docs/table.json +13 -0
  39. package/dist/docs/table.md +3 -1
  40. package/dist/docs/tabs.json +9 -1
  41. package/dist/docs/tabs.md +3 -1
  42. package/dist/docs/text-field.json +1 -1
  43. package/dist/docs/text-field.md +1 -1
  44. package/dist/{entity-picker-CPDd73JR.js → entity-picker-Dn1T7JCq.js} +1 -1
  45. package/dist/entity-picker.js +1 -1
  46. package/dist/{filter-bar-D_xDcAp2.js → filter-bar-CHyy1o--.js} +3 -3
  47. package/dist/filter-bar.js +1 -1
  48. package/dist/{import-export-center-DpY2DGBZ.js → import-export-center-jF37b909.js} +2 -2
  49. package/dist/import-export-center.js +1 -1
  50. package/dist/index.js +19 -19
  51. package/dist/{notification-center-Sz54IziY.js → notification-center-C1iWWl5Y.js} +1 -1
  52. package/dist/notification-center.js +1 -1
  53. package/dist/{page-kQgLctsA.js → page-IiYXk1sz.js} +32 -32
  54. package/dist/{page-header-CWEBfMGq.js → page-header-Bn4nIGfF.js} +1 -1
  55. package/dist/page-header.js +1 -1
  56. package/dist/page.js +1 -1
  57. package/dist/{select-DOFqPy26.js → select-M7Io4UL9.js} +273 -260
  58. package/dist/select.js +1 -1
  59. package/dist/styles.css +1 -1
  60. package/dist/{table-Cipi2c5X.js → table-U9eJYCuB.js} +167 -165
  61. package/dist/table.js +1 -1
  62. package/dist/tabs-BtHmjlnM.js +348 -0
  63. package/dist/tabs.js +1 -1
  64. package/dist/types/accordion/accordion.d.ts.map +1 -1
  65. package/dist/types/calendar/calendar.d.ts +1 -1
  66. package/dist/types/calendar/calendar.d.ts.map +1 -1
  67. package/dist/types/calendar/calendar.types.d.ts +9 -0
  68. package/dist/types/calendar/calendar.types.d.ts.map +1 -1
  69. package/dist/types/calendar/index.d.ts +1 -1
  70. package/dist/types/calendar/index.d.ts.map +1 -1
  71. package/dist/types/collapsible/collapsible-parts.d.ts.map +1 -1
  72. package/dist/types/date-field/date-field.d.ts +1 -1
  73. package/dist/types/date-field/date-field.d.ts.map +1 -1
  74. package/dist/types/date-field/date-field.types.d.ts +7 -0
  75. package/dist/types/date-field/date-field.types.d.ts.map +1 -1
  76. package/dist/types/date-picker/date-picker.d.ts +5 -1
  77. package/dist/types/date-picker/date-picker.d.ts.map +1 -1
  78. package/dist/types/date-picker/date-picker.types.d.ts +20 -2
  79. package/dist/types/date-picker/date-picker.types.d.ts.map +1 -1
  80. package/dist/types/date-picker/index.d.ts +1 -1
  81. package/dist/types/date-picker/index.d.ts.map +1 -1
  82. package/dist/types/page/page.d.ts.map +1 -1
  83. package/dist/types/select/select-items.d.ts.map +1 -1
  84. package/dist/types/select/select-parts.d.ts.map +1 -1
  85. package/dist/types/select/select.d.ts.map +1 -1
  86. package/dist/types/table/index.d.ts +1 -1
  87. package/dist/types/table/index.d.ts.map +1 -1
  88. package/dist/types/table/table-defaults.d.ts.map +1 -1
  89. package/dist/types/table/table.d.ts +1 -1
  90. package/dist/types/table/table.d.ts.map +1 -1
  91. package/dist/types/table/table.types.d.ts +15 -0
  92. package/dist/types/table/table.types.d.ts.map +1 -1
  93. package/dist/types/tabs/tabs-parts.d.ts.map +1 -1
  94. package/dist/types/tabs/tabs.d.ts +1 -1
  95. package/dist/types/tabs/tabs.d.ts.map +1 -1
  96. package/dist/types/tabs/tabs.types.d.ts +18 -0
  97. package/dist/types/tabs/tabs.types.d.ts.map +1 -1
  98. package/package.json +6 -6
  99. package/dist/calendar-B3mio8iQ.js +0 -387
  100. package/dist/date-field-CYcN6diW.js +0 -279
  101. package/dist/date-picker-4X-_2ltN.js +0 -264
  102. package/dist/tabs-DQ36APY-.js +0 -343
@@ -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 "./collapsible-CGo49NNW.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 "./collapsible-F-K36XbF.js";
2
2
  export { e as COLLAPSIBLE_TRIGGER_SELECTOR, a as Collapsible, c as CollapsibleActions, t as CollapsibleDefaultsProvider, i as CollapsibleHeader, o as CollapsiblePanel, n as CollapsibleTrigger, s as useCollapsible, r as useCollapsibleDefaults };
@@ -9,16 +9,16 @@ import { t as g } from "./text-field-DLfIZ0fk.js";
9
9
  import { a as _, d as ee, f as te, l as ne, r as re, t as ie } from "./popover-Be7JWbGJ.js";
10
10
  import { t as v } from "./visually-hidden-CE6u5JLW.js";
11
11
  import { i as ae, n as oe, o as se, r as ce, t as le } from "./result-state-CZsQfdN4.js";
12
- import { t as ue } from "./date-picker-4X-_2ltN.js";
13
- import { t as de } from "./date-field-CYcN6diW.js";
14
- import { t as fe } from "./date-range-picker-CNOAtHwU.js";
15
- import { t as pe } from "./datetime-picker-HDVlUhzy.js";
12
+ import { t as ue } from "./date-picker-D3-y2Jxw.js";
13
+ import { t as de } from "./date-field-Hr-OCU-H.js";
14
+ import { t as fe } from "./date-range-picker-y3b82Wmf.js";
15
+ import { t as pe } from "./datetime-picker-CIRHVLQp.js";
16
16
  import { t as me } from "./datetime-field-B8TrmsDK.js";
17
- import { t as he } from "./datetime-range-picker-IqOFJtdW.js";
17
+ import { t as he } from "./datetime-range-picker-DM-1m98z.js";
18
18
  import { a as ge, i as _e, n as ve, s as ye } from "./multi-select-DQ5ds0fX.js";
19
19
  import { t as be } from "./number-field-BFIAmv-z.js";
20
20
  import { a as xe, t as Se } from "./segmented-control-DmuOGiu6.js";
21
- import { c as Ce, i as we, n as Te, o as Ee, s as De } from "./select-DOFqPy26.js";
21
+ import { c as Ce, i as we, n as Te, o as Ee, s as De } from "./select-M7Io4UL9.js";
22
22
  import { t as Oe } from "./time-picker-CRQsMJbQ.js";
23
23
  import { t as ke } from "./time-field-DrhiCtUl.js";
24
24
  import { t as Ae } from "./time-range-picker-DlZJsj1e.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-BKaGMqIm.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-Eb-a4jg3.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 };
@@ -0,0 +1,290 @@
1
+ import { n as e, t } from "./icon-T9Yt4tnm.js";
2
+ import { n, r } from "./i18n-DpW8lqJ1.js";
3
+ import { b as i } from "./field-NJaCxl2h.js";
4
+ import { createControllable as a } from "@slotted/core/state";
5
+ import { createContext as o, useCallback as s, useContext as c, useEffect as l, useId as u, useImperativeHandle as d, useMemo as f, useRef as p, useState as m } from "react";
6
+ import { Fragment as ee, jsx as h, jsxs as te } from "react/jsx-runtime";
7
+ import { dateFieldMessages as ne } from "@slotted/core/i18n";
8
+ import { EMPTY_SEGMENTS as re, boundSegment as g, clearSegment as ie, commitTyping as ae, createDateFormat as oe, dateOf as _, fieldRange as se, isDateInRange as ce, isSameDate as le, parseISOYearMonth as ue, plainDate as de, segmentsOf as v, stepSegment as y, toISODate as fe, toISOYearMonth as pe, todayIn as me, typeDigit as he, yearMonthPattern as ge } from "@slotted/core/date";
9
+ //#region src/date-field/date-field-defaults.tsx
10
+ var _e = 20, b = o({
11
+ calendar: "gregory",
12
+ firstDayOfWeek: void 0,
13
+ size: "md",
14
+ timeZone: void 0,
15
+ variant: "outline",
16
+ yearPivot: 20
17
+ });
18
+ function x() {
19
+ return c(b);
20
+ }
21
+ function S({ children: e, ...t }) {
22
+ let n = x();
23
+ return /* @__PURE__ */ h(b.Provider, {
24
+ value: {
25
+ calendar: t.calendar ?? n.calendar,
26
+ firstDayOfWeek: t.firstDayOfWeek ?? n.firstDayOfWeek,
27
+ size: t.size ?? n.size,
28
+ timeZone: t.timeZone ?? n.timeZone,
29
+ variant: t.variant ?? n.variant,
30
+ yearPivot: t.yearPivot ?? n.yearPivot
31
+ },
32
+ children: e
33
+ });
34
+ }
35
+ //#endregion
36
+ //#region src/date-field/date-field.tsx
37
+ var C = {
38
+ day: 5,
39
+ month: 5,
40
+ year: 10
41
+ }, ve = de(2e3, 1, 1);
42
+ function w({ "aria-describedby": o, "aria-label": c, "aria-labelledby": se, calendar: _e, className: b, clearable: S = !1, defaultValue: w, disabled: ye, end: xe, firstDayOfWeek: Se, granularity: Ce, id: we, invalid: Te, isDateUnavailable: Ee, locale: De, max: Oe, messages: ke, min: Ae, name: je, onKeyDown: Me, onPaste: Ne, onValueChange: Pe, readOnly: Fe, ref: Ie, render: Le, required: Re, size: ze, start: Be, style: Ve, timeZone: He, value: T, variant: Ue, yearPivot: We, ...Ge }) {
43
+ let E = i(), Ke = E?.registerControl;
44
+ l(() => Ke?.(), [Ke]);
45
+ let D = x(), qe = n(), Je = r(ne, ke), O = p(null), Ye = u(), k = De ?? qe, A = Se ?? D.firstDayOfWeek, j = We ?? D.yearPivot, M = He ?? D.timeZone, Xe = _e ?? D.calendar, Ze = ze ?? E?.size ?? D.size, Qe = Ue ?? D.variant, N = ye ?? E?.disabled, P = Fe ?? E?.readOnly, $e = Te ?? E?.invalid, F = Re ?? E?.required, I = f(() => oe({
46
+ locale: k,
47
+ firstDayOfWeek: A,
48
+ yearPivot: j
49
+ }), [
50
+ A,
51
+ k,
52
+ j
53
+ ]), [L, et] = m(() => ve);
54
+ l(() => et(me(M)), [M]);
55
+ let [R, z] = m(() => v(T ?? w ?? null)), [B, V] = m(void 0), H = p(R), U = () => H.current;
56
+ l(() => {
57
+ T !== void 0 && (le(_(H.current), T) || (H.current = v(T), z(H.current)));
58
+ }, [T]);
59
+ let W = R, G = _(W), K = Ce === "month", q = f(() => K ? ge(I.pattern) : I.pattern, [I, K]), J = f(() => q.filter((e) => e.type !== "literal").map((e) => e.type), [q]), Y = s((e, t, n) => {
60
+ let r = K && e.day !== 1 ? {
61
+ ...e,
62
+ day: 1,
63
+ intendedDay: 1
64
+ } : e, i = _(H.current);
65
+ H.current = r, z(r), r.typing === null && a({
66
+ controlled: T,
67
+ initial: i,
68
+ equals: le,
69
+ onRequest: (e) => {
70
+ Pe?.(e.value, {
71
+ ...e,
72
+ segments: r
73
+ });
74
+ }
75
+ }).request(_(r), t, n);
76
+ }, [
77
+ K,
78
+ Pe,
79
+ T
80
+ ]), X = s((e) => {
81
+ V(e), O.current?.querySelector(`[data-part="segment"][data-field="${e}"]`)?.focus();
82
+ }, []), tt = s(() => {
83
+ let e = U(), t = J.find((t) => e[t] === null) ?? J[0];
84
+ t !== void 0 && X(t);
85
+ }, [J, X]), Z = s((e, t) => {
86
+ let n = J.indexOf(e) + t, r = J[n];
87
+ r !== void 0 && X(r);
88
+ }, [J, X]);
89
+ d(Ie, () => ({
90
+ focus: () => {
91
+ let e = J[0];
92
+ e !== void 0 && X(e);
93
+ },
94
+ clear: () => Y(re, "clear", void 0),
95
+ get activeField() {
96
+ return B;
97
+ }
98
+ }), [
99
+ B,
100
+ Y,
101
+ J,
102
+ X
103
+ ]);
104
+ let Q = N !== !0 && P !== !0, $ = (e) => {
105
+ e.preventDefault(), e.stopPropagation();
106
+ }, nt = (e) => (t) => {
107
+ if (Me?.(t), t.defaultPrevented) return;
108
+ let n = O.current !== null && getComputedStyle(O.current).direction === "rtl", r = n ? "ArrowLeft" : "ArrowRight", i = n ? "ArrowRight" : "ArrowLeft";
109
+ if (t.key === r) {
110
+ $(t), Z(e, 1);
111
+ return;
112
+ }
113
+ if (t.key === i) {
114
+ $(t), Z(e, -1);
115
+ return;
116
+ }
117
+ if (Q && !t.altKey) {
118
+ switch (t.key) {
119
+ case "ArrowUp":
120
+ $(t), Y(y(U(), e, 1, L), "keyboard", t);
121
+ return;
122
+ case "ArrowDown":
123
+ $(t), Y(y(U(), e, -1, L), "keyboard", t);
124
+ return;
125
+ case "PageUp":
126
+ $(t), Y(y(U(), e, C[e], L), "keyboard", t);
127
+ return;
128
+ case "PageDown":
129
+ $(t), Y(y(U(), e, -C[e], L), "keyboard", t);
130
+ return;
131
+ case "Home":
132
+ $(t), Y(g(U(), e, "min", L), "keyboard", t);
133
+ return;
134
+ case "Backspace":
135
+ case "Delete":
136
+ $(t), Y(ie(U(), e), "clear", t);
137
+ return;
138
+ case "End":
139
+ $(t), Y(g(U(), e, "max", L), "keyboard", t);
140
+ return;
141
+ }
142
+ if (/^\d$/.test(t.key)) {
143
+ $(t);
144
+ let n = he(U(), e, Number(t.key), I, L);
145
+ Y(n.segments, "keyboard", t), n.advance && Z(e, 1);
146
+ }
147
+ }
148
+ }, rt = (e) => {
149
+ if (Ne?.(e), e.defaultPrevented || !Q) return;
150
+ let t = e.clipboardData.getData("text/plain"), n = K ? ue(t) : null, r = n === null ? I.parse(t) : de(n.year, n.month, 1);
151
+ r !== null && (e.preventDefault(), Y(v(r), "keyboard", e));
152
+ }, it = () => {
153
+ V(void 0);
154
+ let e = U();
155
+ e.typing !== null && Y(ae(e, I, L), "blur", void 0);
156
+ }, at = (e) => {
157
+ e.target?.closest("[data-part=\"segment\"], button, a, input, select, textarea") ?? (e.preventDefault(), tt());
158
+ }, ot = (e) => {
159
+ Y(re, "clear", e);
160
+ let t = J[0];
161
+ t !== void 0 && X(t);
162
+ }, st = `${Ye}-value`, ct = G === null ? void 0 : K ? I.monthYear(G) : I.describe(G), lt = G !== null && Ee?.(G) === !0, ut = G !== null && !ce(G, Ae, Oe), dt = $e === !0 || lt || ut, ft = J.every((e) => W[e] === null), pt = S && !ft && Q, mt = /* @__PURE__ */ te(ee, { children: [
163
+ Be === void 0 ? null : /* @__PURE__ */ h("span", {
164
+ "data-part": "start",
165
+ children: Be
166
+ }),
167
+ /* @__PURE__ */ h("div", {
168
+ "aria-describedby": [o, E?.describedBy].filter(Boolean).join(" ") || void 0,
169
+ "aria-disabled": N === !0 || void 0,
170
+ "aria-invalid": dt ? !0 : void 0,
171
+ "aria-label": c,
172
+ "aria-labelledby": c === void 0 ? [se ?? E?.ids.label, st].filter(Boolean).join(" ") : void 0,
173
+ "aria-readonly": P === !0 || void 0,
174
+ "aria-required": F === !0 || void 0,
175
+ "data-part": "segments",
176
+ id: we ?? E?.ids.control,
177
+ onPaste: rt,
178
+ role: "group",
179
+ children: q.map((e, t) => {
180
+ if (e.type === "literal") return /* @__PURE__ */ h("span", {
181
+ "aria-hidden": "true",
182
+ "data-part": "literal",
183
+ children: e.value
184
+ }, `literal-${String(t)}`);
185
+ let n = e.type;
186
+ return /* @__PURE__ */ h(be, {
187
+ disabled: N === !0,
188
+ field: n,
189
+ format: I,
190
+ onBlur: it,
191
+ onFocus: () => V(n),
192
+ onKeyDown: nt(n),
193
+ placeholder: e.value,
194
+ readOnly: P === !0,
195
+ reference: L,
196
+ segments: W,
197
+ tabIndex: n === (B ?? J[0]) ? 0 : -1
198
+ }, n);
199
+ })
200
+ }),
201
+ /* @__PURE__ */ h("span", {
202
+ "data-part": "value-text",
203
+ hidden: !0,
204
+ id: st,
205
+ children: ct
206
+ }),
207
+ pt ? /* @__PURE__ */ h("button", {
208
+ "aria-label": Je("clear"),
209
+ "data-part": "clear",
210
+ onClick: ot,
211
+ type: "button",
212
+ children: /* @__PURE__ */ h(t, { children: /* @__PURE__ */ h(e, { name: "x" }) })
213
+ }) : null,
214
+ xe === void 0 ? null : /* @__PURE__ */ h("span", {
215
+ "data-part": "end",
216
+ children: xe
217
+ }),
218
+ /* @__PURE__ */ h("input", {
219
+ "data-part": "hidden-input",
220
+ name: je,
221
+ readOnly: !0,
222
+ type: "hidden",
223
+ value: G === null ? "" : K ? pe({
224
+ year: G.year,
225
+ month: G.month
226
+ }) : fe(G)
227
+ })
228
+ ] }), ht = {
229
+ ...Ge,
230
+ children: mt,
231
+ className: b,
232
+ style: Ve,
233
+ ...N === !0 ? { "data-disabled": "" } : {},
234
+ ...dt ? { "data-invalid": "" } : {},
235
+ ...P === !0 ? { "data-readonly": "" } : {},
236
+ ...F === !0 ? { "data-required": "" } : {},
237
+ "data-calendar": Xe,
238
+ "data-part": "root",
239
+ "data-size": Ze,
240
+ "data-ui": "date-field",
241
+ "data-variant": Qe,
242
+ onMouseDown: at,
243
+ ref: O
244
+ };
245
+ return Le === void 0 ? /* @__PURE__ */ h("div", { ...ht }) : Le(ht);
246
+ }
247
+ function ye({ field: e, format: t, reference: n, segments: r }) {
248
+ let i = r[e];
249
+ if (i === null) return t.pattern.find((t) => t.type === e)?.value ?? "";
250
+ let a = r.typing;
251
+ return a !== null && a.field === e ? String(i).padStart(a.digits, "0") : t.formatField({
252
+ year: r.year ?? n.year,
253
+ month: r.month ?? n.month,
254
+ day: r.day ?? n.day
255
+ }, e);
256
+ }
257
+ function be({ disabled: e, field: t, format: n, onBlur: r, onFocus: i, onKeyDown: a, placeholder: o, readOnly: s, reference: c, segments: l, tabIndex: u }) {
258
+ let d = l[t], f = se(t, {
259
+ year: l.year ?? c.year,
260
+ month: l.month ?? c.month
261
+ }), p = d === null ? void 0 : t === "month" ? n.monthNames("long")[d - 1] ?? String(d) : String(d);
262
+ return /* @__PURE__ */ h("div", {
263
+ "aria-disabled": e ? !0 : void 0,
264
+ "aria-label": o,
265
+ "aria-readonly": s ? !0 : void 0,
266
+ "aria-valuemax": f.max,
267
+ "aria-valuemin": f.min,
268
+ "aria-valuenow": d ?? void 0,
269
+ "aria-valuetext": p,
270
+ "data-field": t,
271
+ "data-part": "segment",
272
+ ...d === null ? { "data-placeholder": "" } : {},
273
+ onBlur: r,
274
+ onFocus: i,
275
+ onKeyDown: a,
276
+ onMouseDown: (e) => {
277
+ e.preventDefault(), e.currentTarget.focus();
278
+ },
279
+ role: "spinbutton",
280
+ tabIndex: e ? -1 : u,
281
+ children: ye({
282
+ field: t,
283
+ format: n,
284
+ reference: c,
285
+ segments: l
286
+ })
287
+ });
288
+ }
289
+ //#endregion
290
+ export { x as i, _e as n, S as r, w as t };
@@ -1,2 +1,2 @@
1
- import { i as e, n as t, r as n, t as r } from "./date-field-CYcN6diW.js";
1
+ import { i as e, n as t, r as n, t as r } from "./date-field-Hr-OCU-H.js";
2
2
  export { t as DATE_FIELD_YEAR_PIVOT, r as DateField, n as DateFieldDefaultsProvider, e as useDateFieldDefaults };
@@ -0,0 +1,295 @@
1
+ import { n as e, t } from "./icon-T9Yt4tnm.js";
2
+ import { n, r } from "./i18n-DpW8lqJ1.js";
3
+ import { n as i, r as a, t as ee } from "./calendar-BZ6PP7Ke.js";
4
+ import { b as o } from "./field-NJaCxl2h.js";
5
+ import { t as te } from "./date-field-Hr-OCU-H.js";
6
+ import { tabbables as ne } from "@slotted/core/focus";
7
+ import { createControllable as s } from "@slotted/core/state";
8
+ import { createContext as c, useCallback as re, useContext as ie, useEffect as l, useId as ae, useImperativeHandle as oe, useMemo as se, useRef as u, useState as d } from "react";
9
+ import { Fragment as ce, jsx as f, jsxs as p } from "react/jsx-runtime";
10
+ import { createPresence as le } from "@slotted/core/presence";
11
+ import { createPortalRoot as ue } from "@slotted/core/portal";
12
+ import { createDismissableLayer as de } from "@slotted/core/dismissable-layer";
13
+ import { createPositioner as fe } from "@slotted/core/positioner";
14
+ import { createPortal as pe } from "react-dom";
15
+ import { datePickerMessages as me } from "@slotted/core/i18n";
16
+ import { createDateFormat as he, firstDayOf as m, isDateInRange as ge, isPlainDate as _e, lastDayOf as ve, yearMonthOf as h } from "@slotted/core/date";
17
+ //#region src/date-picker/date-picker-defaults.tsx
18
+ var g = c({
19
+ calendar: "gregory",
20
+ closeOnSelect: "auto",
21
+ placement: "bottom-start",
22
+ size: "md",
23
+ timeZone: void 0,
24
+ variant: "outline"
25
+ });
26
+ function _() {
27
+ return ie(g);
28
+ }
29
+ function ye({ children: e, ...t }) {
30
+ let n = _();
31
+ return /* @__PURE__ */ f(g.Provider, {
32
+ value: {
33
+ calendar: t.calendar ?? n.calendar,
34
+ closeOnSelect: t.closeOnSelect ?? n.closeOnSelect,
35
+ placement: t.placement ?? n.placement,
36
+ size: t.size ?? n.size,
37
+ timeZone: t.timeZone ?? n.timeZone,
38
+ variant: t.variant ?? n.variant
39
+ },
40
+ children: e
41
+ });
42
+ }
43
+ //#endregion
44
+ //#region src/date-picker/date-picker.tsx
45
+ var be = "(max-width: 480px) and (pointer: coarse)";
46
+ function v(e) {
47
+ return e.granularity === "month" ? /* @__PURE__ */ f(xe, { ...e }) : /* @__PURE__ */ f(y, { ...e });
48
+ }
49
+ function xe({ defaultValue: e, granularity: t, max: n, min: r, onValueChange: i, value: a, ...ee }) {
50
+ let o = (e) => e === null ? null : m(e);
51
+ return /* @__PURE__ */ f(y, {
52
+ ...ee,
53
+ granularity: "month",
54
+ ...a === void 0 ? {} : { value: o(a) },
55
+ ...e === void 0 ? {} : { defaultValue: o(e) },
56
+ ...r === void 0 ? {} : { min: m(r) },
57
+ ...n === void 0 ? {} : { max: ve(n) },
58
+ onValueChange: (e, t) => {
59
+ if (i === void 0) return;
60
+ let n = (e) => _e(e) ? h(e) : null, r = Object.create(t, {
61
+ previous: {
62
+ enumerable: !0,
63
+ value: n(t.previous)
64
+ },
65
+ value: {
66
+ enumerable: !0,
67
+ value: n(e)
68
+ }
69
+ });
70
+ i(r.value, r);
71
+ }
72
+ });
73
+ }
74
+ function y({ calendar: c, className: ie, clearable: m = !1, closeOnSelect: _e, defaultOpen: ve = !1, defaultValue: h, defaultView: g, disabled: ye, firstDayOfWeek: v, fixedWeeks: xe = !0, footer: y, granularity: b, invalid: Se, isDateUnavailable: x, locale: Ce, max: S, messages: we, min: C, months: Te, name: Ee, onKeyDown: De, onOpenChange: w, onValueChange: T, open: E, placement: Oe, presets: D, readOnly: ke, ref: Ae, render: O, required: je, selectionMode: k = "single", size: Me, style: Ne, timeZone: Pe, value: A, variant: Fe, weekNumbers: Ie, yearPivot: j, ...Le }) {
75
+ let M = o(), N = b === "month", P = _(), Re = n(), ze = r(me, we), F = u(null), Be = u(null), I = u(null), Ve = ae(), [L, He] = d(null), [R, Ue] = d(null), [We, Ge] = d("unmounted"), [Ke, qe] = d(!1), [z, Je] = d(!1), [Ye, Xe] = d(ve), B = u(!1), V = E ?? Ye, [Ze, Qe] = d(h ?? null), H = A ?? Ze, U = N ? "month" : "day", [W, $e] = d(g ?? U), G = Ce ?? Re, et = Pe ?? P.timeZone, tt = c ?? P.calendar, nt = Me ?? M?.size ?? P.size, rt = Fe ?? P.variant, it = Oe ?? P.placement, at = _e ?? P.closeOnSelect, K = ye ?? M?.disabled, q = ke ?? M?.readOnly, ot = Se ?? (i(A ?? Ze).some((e) => !ge(e, C, S) || x?.(e) === !0) ? !0 : M?.invalid), J = je ?? M?.required, st = K !== !0 && q !== !0, ct = se(() => he({ locale: G }), [G]), Y = re((e, t, n) => {
76
+ s({
77
+ controlled: E,
78
+ initial: V,
79
+ onRequest: (e) => {
80
+ w?.(e.value, e), B.current = e.value && !e.cancelled;
81
+ }
82
+ }).request(e, t, n) && Xe(e);
83
+ }, [
84
+ V,
85
+ w,
86
+ E
87
+ ]), X = re((e, t) => {
88
+ s({
89
+ controlled: A,
90
+ initial: H,
91
+ equals: () => !1,
92
+ onRequest: (e) => T?.(e.value, e)
93
+ }).request(e, t.reason, t.source) && Qe(e);
94
+ }, [
95
+ H,
96
+ T,
97
+ A
98
+ ]), [lt] = d(() => h ?? null);
99
+ l(() => {
100
+ let e = F.current?.closest("form");
101
+ if (e == null) return;
102
+ let t = (e) => X(lt, {
103
+ reason: "programmatic",
104
+ source: e
105
+ });
106
+ return e.addEventListener("reset", t), () => e.removeEventListener("reset", t);
107
+ }, [lt, X]);
108
+ let Z = u(null);
109
+ l(() => {
110
+ let e = le({
111
+ present: V,
112
+ onStatusChange: Ge
113
+ });
114
+ return Z.current = e, Ge(e.status), () => {
115
+ e.destroy(), Z.current = null;
116
+ };
117
+ }, []), l(() => Z.current?.sync(V), [V]), l(() => Z.current?.setNode(L), [L]);
118
+ let Q = We !== "unmounted";
119
+ l(() => {
120
+ if (!Q) {
121
+ Ue(null);
122
+ return;
123
+ }
124
+ let e = ue({
125
+ origin: I.current,
126
+ disabled: !1
127
+ });
128
+ return Ue(e.container), () => e.release();
129
+ }, [Q]), l(() => {
130
+ if (typeof window > "u" || typeof window.matchMedia != "function") return;
131
+ let e = window.matchMedia(be), t = () => Je(e.matches);
132
+ return t(), e.addEventListener("change", t), () => e.removeEventListener("change", t);
133
+ }, []), l(() => {
134
+ if (L === null || F.current === null || z) return;
135
+ let e = !0, t = F.current.querySelector("[data-part=\"control\"]") ?? F.current, [n, r = "center"] = it.split("-"), i = fe(t, L, {
136
+ align: r === void 0 ? "center" : r,
137
+ side: n
138
+ });
139
+ return i.update().then(() => {
140
+ e && qe(!0);
141
+ }), () => {
142
+ e = !1, i.destroy(), qe(!1);
143
+ };
144
+ }, [
145
+ L,
146
+ it,
147
+ z
148
+ ]);
149
+ let $ = u(W);
150
+ $.current = W, l(() => {
151
+ if (L === null || !V) return;
152
+ let e = I.current === null ? [] : [I.current], t = de(L, {
153
+ branches: e,
154
+ escape: !0,
155
+ focusOutside: !1,
156
+ modal: !1,
157
+ outsidePress: !0,
158
+ scrollLock: !1,
159
+ onDismiss: (e) => {
160
+ if (e.reason === "escape" && $.current !== U) {
161
+ $e($.current === "year" ? "month" : "day");
162
+ return;
163
+ }
164
+ Y(!1, e.reason === "escape" ? "escape" : "outsidePress", e.source), e.reason === "escape" && I.current?.focus({ preventScroll: !0 });
165
+ }
166
+ });
167
+ return () => t.destroy();
168
+ }, [
169
+ V,
170
+ L,
171
+ U,
172
+ Y
173
+ ]), l(() => {
174
+ L !== null && R !== null && V && B.current && R.contains(L) && (B.current = !1, L.querySelector("[data-part=\"day\"][tabindex=\"0\"], [data-part=\"period\"][tabindex=\"0\"]")?.focus({ preventScroll: !0 }));
175
+ }, [
176
+ R,
177
+ V,
178
+ L
179
+ ]);
180
+ let ut = (e) => {
181
+ if (e.key !== "Tab" || e.altKey || e.ctrlKey || e.metaKey) return;
182
+ let t = ne(e.currentTarget), n = t[0], r = t[t.length - 1];
183
+ if (n === void 0 || r === void 0) return;
184
+ let i = e.currentTarget.ownerDocument.activeElement;
185
+ e.shiftKey && i === n ? (e.preventDefault(), r.focus()) : !e.shiftKey && i === r && (e.preventDefault(), n.focus());
186
+ };
187
+ oe(Ae, () => ({
188
+ focus: () => Be.current?.focus(),
189
+ open: () => Y(!0, "keyboard", void 0),
190
+ close: () => Y(!1, "keyboard", void 0)
191
+ }), [Y]);
192
+ let dt = i(H), ft = dt.length === 0 ? ze("choose") : ze("change", { date: dt.map((e) => N ? ct.monthYear(e) : ct.describe(e)).join(" – ") }), pt = at === "always" || at === "auto" && k === "single", mt = (e) => {
193
+ De?.(e), !e.defaultPrevented && st && e.altKey && e.key === "ArrowDown" && (e.preventDefault(), Y(!0, "keyboard", e));
194
+ }, ht = a(H) || Array.isArray(H) ? void 0 : H ?? null, gt = Q ? /* @__PURE__ */ f("div", {
195
+ "data-part": "positioner",
196
+ "data-presentation": z ? "sheet" : "popover",
197
+ "data-ui": "date-picker",
198
+ ref: He,
199
+ ...V ? { "data-open": "" } : {},
200
+ ...Ke ? { "data-positioned": "" } : {},
201
+ children: /* @__PURE__ */ p("div", {
202
+ "aria-label": ft,
203
+ "data-part": "content",
204
+ id: Ve,
205
+ onKeyDown: ut,
206
+ role: "dialog",
207
+ children: [
208
+ D === void 0 ? null : /* @__PURE__ */ f("div", {
209
+ "data-part": "presets",
210
+ children: D
211
+ }),
212
+ /* @__PURE__ */ f(ee, {
213
+ fixedWeeks: xe,
214
+ granularity: b,
215
+ isDateUnavailable: x,
216
+ locale: G,
217
+ max: S,
218
+ min: C,
219
+ months: Te,
220
+ onValueChange: (e, t) => {
221
+ X(e, t), pt && (Y(!1, "select", t.source), I.current?.focus({ preventScroll: !0 }));
222
+ },
223
+ onViewChange: $e,
224
+ readOnly: q,
225
+ selectionMode: k,
226
+ timeZone: et,
227
+ value: H,
228
+ view: W,
229
+ weekNumbers: Ie,
230
+ ...v === void 0 ? {} : { firstDayOfWeek: v }
231
+ }),
232
+ y === void 0 ? null : /* @__PURE__ */ f("div", {
233
+ "data-part": "footer",
234
+ children: y
235
+ })
236
+ ]
237
+ })
238
+ }) : null, _t = /* @__PURE__ */ p(ce, { children: [/* @__PURE__ */ f("div", {
239
+ "data-part": "control",
240
+ onKeyDown: mt,
241
+ children: /* @__PURE__ */ f(te, {
242
+ calendar: tt,
243
+ clearable: m,
244
+ disabled: K,
245
+ granularity: b,
246
+ end: /* @__PURE__ */ f("button", {
247
+ "aria-controls": V ? Ve : void 0,
248
+ "aria-expanded": V,
249
+ "aria-haspopup": "dialog",
250
+ "aria-label": ft,
251
+ "data-part": "trigger",
252
+ disabled: !st,
253
+ onClick: (e) => Y(!V, "pointer", e),
254
+ ref: I,
255
+ type: "button",
256
+ children: /* @__PURE__ */ f(t, { children: /* @__PURE__ */ f(e, { name: "calendar" }) })
257
+ }),
258
+ invalid: ot,
259
+ isDateUnavailable: x,
260
+ locale: G,
261
+ max: S,
262
+ min: C,
263
+ name: Ee,
264
+ onValueChange: (e, t) => X(e, t),
265
+ readOnly: q,
266
+ ref: Be,
267
+ required: J,
268
+ size: nt,
269
+ timeZone: et,
270
+ variant: rt,
271
+ ...v === void 0 ? {} : { firstDayOfWeek: v },
272
+ ...j === void 0 ? {} : { yearPivot: j },
273
+ ...ht === void 0 ? {} : { value: ht }
274
+ })
275
+ }), R === null ? gt : null] }), vt = {
276
+ ...Le,
277
+ children: _t,
278
+ className: ie,
279
+ style: Ne,
280
+ ...K === !0 ? { "data-disabled": "" } : {},
281
+ ...ot === !0 ? { "data-invalid": "" } : {},
282
+ ...q === !0 ? { "data-readonly": "" } : {},
283
+ ...J === !0 ? { "data-required": "" } : {},
284
+ ...V ? { "data-open": "" } : {},
285
+ "data-calendar": tt,
286
+ "data-part": "root",
287
+ "data-size": nt,
288
+ "data-ui": "date-picker",
289
+ "data-variant": rt,
290
+ ref: F
291
+ };
292
+ return /* @__PURE__ */ p(ce, { children: [O === void 0 ? /* @__PURE__ */ f("div", { ...vt }) : O(vt), R === null ? null : pe(gt, R)] });
293
+ }
294
+ //#endregion
295
+ export { ye as n, _ as r, v as t };
@@ -1,2 +1,2 @@
1
- import { n as e, r as t, t as n } from "./date-picker-4X-_2ltN.js";
1
+ import { n as e, r as t, t as n } from "./date-picker-D3-y2Jxw.js";
2
2
  export { n as DatePicker, e as DatePickerDefaultsProvider, t as useDatePickerDefaults };
@@ -1,8 +1,8 @@
1
1
  import { n as e, t } from "./icon-T9Yt4tnm.js";
2
2
  import { n, r } from "./i18n-DpW8lqJ1.js";
3
- import { i, t as a } from "./calendar-B3mio8iQ.js";
3
+ import { i, t as a } from "./calendar-BZ6PP7Ke.js";
4
4
  import { b as ee } from "./field-NJaCxl2h.js";
5
- import { t as o } from "./date-field-CYcN6diW.js";
5
+ import { t as o } from "./date-field-Hr-OCU-H.js";
6
6
  import { tabbables as te } from "@slotted/core/focus";
7
7
  import { createControllable as s } from "@slotted/core/state";
8
8
  import { createContext as c, useCallback as l, useContext as u, useEffect as d, useId as ne, useImperativeHandle as re, useMemo as f, useRef as p, useState as m } from "react";
@@ -1,2 +1,2 @@
1
- import { i as e, n as t, r as n, t as r } from "./date-range-picker-CNOAtHwU.js";
1
+ import { i as e, n as t, r as n, t as r } from "./date-range-picker-y3b82Wmf.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, t } from "./icon-T9Yt4tnm.js";
2
2
  import { n, r } from "./i18n-DpW8lqJ1.js";
3
- import { t as i } from "./calendar-B3mio8iQ.js";
3
+ import { t as i } from "./calendar-BZ6PP7Ke.js";
4
4
  import { b as ee } from "./field-NJaCxl2h.js";
5
5
  import { t as te } from "./datetime-field-B8TrmsDK.js";
6
6
  import { tabbables as ne } from "@slotted/core/focus";
@@ -1,2 +1,2 @@
1
- import { i as e, n as t, r as n, t as r } from "./datetime-picker-HDVlUhzy.js";
1
+ import { i as e, n as t, r as n, t as r } from "./datetime-picker-CIRHVLQp.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, t } from "./icon-T9Yt4tnm.js";
2
2
  import { n, r } from "./i18n-DpW8lqJ1.js";
3
- import { t as i } from "./calendar-B3mio8iQ.js";
3
+ import { t as i } from "./calendar-BZ6PP7Ke.js";
4
4
  import { b as a } from "./field-NJaCxl2h.js";
5
5
  import { t as o } from "./datetime-field-B8TrmsDK.js";
6
6
  import { createControllable as s } from "@slotted/core/state";
@@ -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-IqOFJtdW.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-DM-1m98z.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 };