@slotted/react 0.1.0-beta.7 → 0.1.0-beta.8

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 (50) hide show
  1. package/dist/{action-sheet-CaUaP0K2.js → action-sheet-DD477dAw.js} +1 -1
  2. package/dist/action-sheet.js +1 -1
  3. package/dist/{calendar-BZ6PP7Ke.js → calendar-xcoBnHpK.js} +17 -17
  4. package/dist/calendar.js +1 -1
  5. package/dist/{column-manager-CFtJxQWS.js → column-manager-DonEo9wp.js} +1 -1
  6. package/dist/column-manager.js +1 -1
  7. package/dist/{command-palette-D1C1GDWC.js → command-palette-Dw03scvF.js} +244 -241
  8. package/dist/command-palette.js +1 -1
  9. package/dist/{data-grid-CjFQ2U6v.js → data-grid-B93D5XsR.js} +9 -9
  10. package/dist/data-grid.js +1 -1
  11. package/dist/{date-field-BxEpqAPg.js → date-field-DEauLQVL.js} +80 -80
  12. package/dist/date-field.js +1 -1
  13. package/dist/{date-picker-DRk9SZp1.js → date-picker-C22jlzUv.js} +2 -2
  14. package/dist/date-picker.js +1 -1
  15. package/dist/{date-range-picker-6Yz7avTS.js → date-range-picker-BUKoddmL.js} +2 -2
  16. package/dist/date-range-picker.js +1 -1
  17. package/dist/{datetime-field-D2f9u6im.js → datetime-field-Bptwvuip.js} +33 -33
  18. package/dist/datetime-field.js +1 -1
  19. package/dist/{datetime-picker-STqSWMkH.js → datetime-picker-BiarFWN3.js} +2 -2
  20. package/dist/datetime-picker.js +1 -1
  21. package/dist/{datetime-range-picker-DQNQwr3K.js → datetime-range-picker--JtLnGQ2.js} +2 -2
  22. package/dist/datetime-range-picker.js +1 -1
  23. package/dist/{dialog-yT-x3B9s.js → dialog-Ds0LJWE_.js} +156 -139
  24. package/dist/dialog.js +1 -1
  25. package/dist/docs/calendar.json +1 -1
  26. package/dist/{drawer-B_EgvFeX.js → drawer-DZ_29U6H.js} +4 -1
  27. package/dist/drawer.js +1 -1
  28. package/dist/{event-calendar-VUGigZIP.js → event-calendar-CPAun_ab.js} +1 -1
  29. package/dist/event-calendar.js +1 -1
  30. package/dist/{filter-bar-BzSOD3ad.js → filter-bar-BKKqH0ui.js} +4 -4
  31. package/dist/filter-bar.js +1 -1
  32. package/dist/{import-export-center-BuEBO1CB.js → import-export-center-Bg1Iavoa.js} +1 -1
  33. package/dist/import-export-center.js +1 -1
  34. package/dist/index.js +21 -21
  35. package/dist/styles.css +1 -1
  36. package/dist/{table-C1kLS0-9.js → table-BTSOjlTn.js} +6 -6
  37. package/dist/table.js +1 -1
  38. package/dist/{time-field-BI9n607q.js → time-field-DeKrogZG.js} +2 -2
  39. package/dist/time-field.js +1 -1
  40. package/dist/{time-picker-D6SlQWNF.js → time-picker-C0-O0oMU.js} +1 -1
  41. package/dist/time-picker.js +1 -1
  42. package/dist/{time-range-picker-CcV3_45h.js → time-range-picker-Fdb70Zj_.js} +1 -1
  43. package/dist/time-range-picker.js +1 -1
  44. package/dist/types/calendar/calendar.d.ts.map +1 -1
  45. package/dist/types/command-palette/command-palette.d.ts.map +1 -1
  46. package/dist/types/dialog/dialog-parts.d.ts.map +1 -1
  47. package/dist/types/drawer/drawer-parts.d.ts.map +1 -1
  48. package/dist/{upload-CXDjxuS8.js → upload-DGmsz9Hw.js} +1 -1
  49. package/dist/upload.js +1 -1
  50. package/package.json +11 -8
@@ -4,7 +4,7 @@ import { a as i } from "./kbd-defaults-CDgRhiep.js";
4
4
  /* empty css */
5
5
  /* empty css */
6
6
  import { t as a } from "./highlight-0Qw23QPp.js";
7
- import { d as o, o as s, p as c } from "./dialog-yT-x3B9s.js";
7
+ import { d as o, o as s, p as c } from "./dialog-Ds0LJWE_.js";
8
8
  import { t as l } from "./kbd-eFSWTKxN.js";
9
9
  import { createControllable as u } from "@slotted/core/state";
10
10
  import { createContext 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";
@@ -63,164 +63,164 @@ function ye(e, t) {
63
63
  function x(e, t) {
64
64
  return `${e}-${t.replace(/[^\w-]/g, (e) => `_${e.charCodeAt(0).toString(16)}`)}`;
65
65
  }
66
- function be({ autoHighlight: o, children: d, className: p, clearOnClose: me, closeOnSelect: he, container: b, defaultHighlightedId: be, defaultOpen: xe, defaultPages: Se, defaultQuery: Ce, defaultRecent: we, disabled: Te, empty: Ee, footer: De, groups: Oe, highlightMatch: ke, highlightedId: S, hotkey: Ae, inputProps: je, items: Me, limit: Ne, loading: Pe, locale: Fe, loop: Ie, messages: Le, onHighlightedIdChange: Re, onOpenChange: ze, onPagesChange: Be, onQueryChange: Ve, onRecentChange: He, onSelect: Ue, open: C, outsidePress: We, pages: w, presentation: Ge, query: T, rank: E, recent: Ke, recentLimit: qe, ref: Je, renderItem: Ye, size: Xe, style: Ze, ...Qe }) {
67
- let D = ge(), O = {
68
- presentation: Ge ?? D.presentation,
69
- size: Xe ?? D.size,
70
- outsidePress: We ?? D.outsidePress,
71
- loop: Ie ?? D.loop,
72
- autoHighlight: o ?? D.autoHighlight,
73
- closeOnSelect: he ?? D.closeOnSelect,
74
- clearOnClose: me ?? D.clearOnClose,
75
- highlightMatch: ke ?? D.highlightMatch,
76
- hotkey: Ae === void 0 ? D.hotkey : Ae,
77
- recentLimit: qe ?? D.recentLimit,
78
- loading: Pe ?? !1,
66
+ function be({ autoHighlight: o, children: d, className: p, clearOnClose: me, closeOnSelect: he, container: b, defaultHighlightedId: be, defaultOpen: xe, defaultPages: Se, defaultQuery: Ce, defaultRecent: we, disabled: Te, empty: Ee, footer: S, groups: De, highlightMatch: Oe, highlightedId: C, hotkey: ke, inputProps: Ae, items: je, limit: Me, loading: Ne, locale: Pe, loop: Fe, messages: Ie, onHighlightedIdChange: Le, onOpenChange: Re, onPagesChange: ze, onQueryChange: Be, onRecentChange: Ve, onSelect: He, open: w, outsidePress: Ue, pages: T, presentation: We, query: E, rank: D, recent: Ge, recentLimit: Ke, ref: qe, renderItem: Je, size: Ye, style: Xe, ...Ze }) {
67
+ let O = ge(), k = {
68
+ presentation: We ?? O.presentation,
69
+ size: Ye ?? O.size,
70
+ outsidePress: Ue ?? O.outsidePress,
71
+ loop: Fe ?? O.loop,
72
+ autoHighlight: o ?? O.autoHighlight,
73
+ closeOnSelect: he ?? O.closeOnSelect,
74
+ clearOnClose: me ?? O.clearOnClose,
75
+ highlightMatch: Oe ?? O.highlightMatch,
76
+ hotkey: ke === void 0 ? O.hotkey : ke,
77
+ recentLimit: Ke ?? O.recentLimit,
78
+ loading: Ne ?? !1,
79
79
  disabled: Te ?? !1
80
- }, k = r(ie, Le), $e = n(), et = Fe ?? $e, A = O.presentation === "inline", j = i(void 0), M = ee(), tt = `${M}-list`, [nt, rt] = _(xe ?? !1), [it, at] = _(Ce ?? ""), [ot, st] = _(be ?? null), [ct, lt] = _(Se ?? []), [ut, dt] = _(we ?? []), N = A ? !0 : C ?? nt, P = T ?? it, F = S === void 0 ? ot : S, I = w ?? ct, L = Ke ?? ut, R = g({
81
- currentHighlighted: F,
82
- currentOpen: N,
83
- currentPages: I,
84
- currentQuery: P,
85
- currentRecent: L,
86
- highlightedId: S,
87
- onHighlightedIdChange: Re,
88
- onOpenChange: ze,
89
- onPagesChange: Be,
90
- onQueryChange: Ve,
91
- onRecentChange: He,
92
- open: C,
93
- pages: w,
94
- query: T,
95
- recent: Ke
80
+ }, A = r(ie, Ie), Qe = n(), $e = Pe ?? Qe, j = k.presentation === "inline", M = i(void 0), N = ee(), et = `${N}-list`, [tt, nt] = _(xe ?? !1), [rt, it] = _(Ce ?? ""), [at, ot] = _(be ?? null), [st, ct] = _(Se ?? []), [lt, ut] = _(we ?? []), P = j ? !0 : w ?? tt, F = E ?? rt, I = C === void 0 ? at : C, L = T ?? st, R = Ge ?? lt, z = g({
81
+ currentHighlighted: I,
82
+ currentOpen: P,
83
+ currentPages: L,
84
+ currentQuery: F,
85
+ currentRecent: R,
86
+ highlightedId: C,
87
+ onHighlightedIdChange: Le,
88
+ onOpenChange: Re,
89
+ onPagesChange: ze,
90
+ onQueryChange: Be,
91
+ onRecentChange: Ve,
92
+ open: w,
93
+ pages: T,
94
+ query: E,
95
+ recent: Ge
96
96
  });
97
- R.current = {
98
- currentHighlighted: F,
99
- currentOpen: N,
100
- currentPages: I,
101
- currentQuery: P,
102
- currentRecent: L,
103
- highlightedId: S,
104
- onHighlightedIdChange: Re,
105
- onOpenChange: ze,
106
- onPagesChange: Be,
107
- onQueryChange: Ve,
108
- onRecentChange: He,
109
- open: C,
110
- pages: w,
111
- query: T,
112
- recent: Ke
97
+ z.current = {
98
+ currentHighlighted: I,
99
+ currentOpen: P,
100
+ currentPages: L,
101
+ currentQuery: F,
102
+ currentRecent: R,
103
+ highlightedId: C,
104
+ onHighlightedIdChange: Le,
105
+ onOpenChange: Re,
106
+ onPagesChange: ze,
107
+ onQueryChange: Be,
108
+ onRecentChange: Ve,
109
+ open: w,
110
+ pages: T,
111
+ query: E,
112
+ recent: Ge
113
113
  };
114
- let z = f((e, t, n) => {
115
- let r = R.current;
116
- e !== r.currentHighlighted && u({
114
+ let dt = g(null), B = f((e, t, n) => {
115
+ let r = z.current;
116
+ e !== r.currentHighlighted && (dt.current = t === "pointer" ? e : null, u({
117
117
  controlled: r.highlightedId,
118
118
  initial: r.currentHighlighted,
119
119
  onRequest: (e) => r.onHighlightedIdChange?.(e.value, e)
120
- }).request(e, t, n) && st(e);
121
- }, []), B = f((e, t, n) => {
122
- let r = R.current;
120
+ }).request(e, t, n) && ot(e));
121
+ }, []), V = f((e, t, n) => {
122
+ let r = z.current;
123
123
  e !== r.currentQuery && u({
124
124
  controlled: r.query,
125
125
  initial: r.currentQuery,
126
126
  onRequest: (e) => r.onQueryChange?.(e.value, e)
127
- }).request(e, t, n) && at(e);
128
- }, []), V = f((e, t, n) => {
129
- let r = R.current;
127
+ }).request(e, t, n) && it(e);
128
+ }, []), H = f((e, t, n) => {
129
+ let r = z.current;
130
130
  e.length === r.currentPages.length && e.every((e, t) => e === r.currentPages[t]) || u({
131
131
  controlled: r.pages,
132
132
  initial: r.currentPages,
133
133
  onRequest: (e) => r.onPagesChange?.(e.value, e),
134
134
  equals: () => !1
135
- }).request(e, t, n) && lt(e);
135
+ }).request(e, t, n) && ct(e);
136
136
  }, []), ft = f((e, t) => {
137
- let n = R.current;
137
+ let n = z.current;
138
138
  u({
139
139
  controlled: n.recent,
140
140
  initial: n.currentRecent,
141
141
  onRequest: (e) => n.onRecentChange?.(e.value, e),
142
142
  equals: (e, t) => e.length === t.length && e.every((e, n) => e === t[n])
143
- }).request(e, "select", t) && dt(e);
144
- }, []), H = g(null), U = f((e, t, n) => {
145
- let r = R.current;
146
- A || e === r.currentOpen || u({
143
+ }).request(e, "select", t) && ut(e);
144
+ }, []), U = g(null), W = f((e, t, n) => {
145
+ let r = z.current;
146
+ j || e === r.currentOpen || u({
147
147
  controlled: r.open,
148
148
  initial: r.currentOpen,
149
149
  onRequest: (e) => r.onOpenChange?.(e.value, e)
150
- }).request(e, t, n) && rt(e);
151
- }, [A]), pt = g(N);
150
+ }).request(e, t, n) && nt(e);
151
+ }, [j]), pt = g(P);
152
152
  m(() => {
153
- pt.current && !N && O.clearOnClose && (B("", "programmatic"), V([], "programmatic"), z(null, "programmatic")), pt.current = N;
153
+ pt.current && !P && k.clearOnClose && (V("", "programmatic"), H([], "programmatic"), B(null, "programmatic")), pt.current = P;
154
154
  }, [
155
- N,
156
- O.clearOnClose,
157
- z,
158
- V,
159
- B
155
+ P,
156
+ k.clearOnClose,
157
+ B,
158
+ H,
159
+ V
160
160
  ]);
161
- let mt = h(() => E === void 0 ? de({ locale: et }) : E, [et, E]), W = h(() => pe({
162
- items: Me,
163
- query: P,
164
- pages: I,
165
- recent: L,
166
- groups: Oe,
161
+ let mt = h(() => D === void 0 ? de({ locale: $e }) : D, [$e, D]), G = h(() => pe({
162
+ items: je,
163
+ query: F,
164
+ pages: L,
165
+ recent: R,
166
+ groups: De,
167
167
  rank: mt,
168
- limit: Ne
168
+ limit: Me
169
169
  }), [
170
- I,
171
- P,
172
170
  L,
173
- Oe,
171
+ F,
172
+ R,
173
+ De,
174
+ je,
174
175
  Me,
175
- Ne,
176
176
  mt
177
- ]), G = h(() => W.rows.map((e) => e.id), [W]), K = h(() => W.rows.map((e) => e.disabled !== !0), [W]);
177
+ ]), K = h(() => G.rows.map((e) => e.id), [G]), q = h(() => G.rows.map((e) => e.disabled !== !0), [G]);
178
178
  m(() => {
179
- if (!N) return;
180
- let e = F === null ? -1 : G.indexOf(F);
181
- if (e !== -1 && K[e] === !0) return;
182
- let t = O.autoHighlight ? ue({
183
- enabled: K,
179
+ if (!P) return;
180
+ let e = I === null ? -1 : K.indexOf(I);
181
+ if (e !== -1 && q[e] === !0) return;
182
+ let t = k.autoHighlight ? ue({
183
+ enabled: q,
184
184
  from: -1,
185
185
  intent: "first",
186
186
  loop: !1
187
187
  }) : -1;
188
- z(t === -1 ? null : G[t] ?? null, "programmatic");
188
+ B(t === -1 ? null : K[t] ?? null, "programmatic");
189
189
  }, [
190
- F,
191
- N,
190
+ I,
191
+ P,
192
+ q,
193
+ k.autoHighlight,
192
194
  K,
193
- O.autoHighlight,
194
- G,
195
- z
195
+ B
196
196
  ]);
197
- let q = g(null);
197
+ let J = g(null);
198
198
  m(() => {
199
- if (F === null) return;
200
- let e = q.current?.querySelector(`#${CSS.escape(x(M, F))}`);
199
+ if (I === null || I === dt.current) return;
200
+ let e = J.current?.querySelector(`#${CSS.escape(x(N, I))}`);
201
201
  typeof e?.scrollIntoView == "function" && e.scrollIntoView({ block: "nearest" });
202
- }, [M, F]);
203
- let [ht, gt] = _(() => /* @__PURE__ */ new Set()), [_t, J] = _(null), Y = g({
204
- onSelect: Ue,
205
- resolved: O,
206
- setOpen: U,
207
- setPages: V,
208
- setQuery: B,
202
+ }, [N, I]);
203
+ let [ht, gt] = _(() => /* @__PURE__ */ new Set()), [_t, Y] = _(null), X = g({
204
+ onSelect: He,
205
+ resolved: k,
206
+ setOpen: W,
207
+ setPages: H,
208
+ setQuery: V,
209
209
  setRecent: ft
210
210
  });
211
- Y.current = {
212
- onSelect: Ue,
213
- resolved: O,
214
- setOpen: U,
215
- setPages: V,
216
- setQuery: B,
211
+ X.current = {
212
+ onSelect: He,
213
+ resolved: k,
214
+ setOpen: W,
215
+ setPages: H,
216
+ setQuery: V,
217
217
  setRecent: ft
218
218
  };
219
219
  let vt = f((e, t, n) => {
220
- let { onSelect: r, resolved: i, setOpen: a, setPages: o } = Y.current;
220
+ let { onSelect: r, resolved: i, setOpen: a, setPages: o } = X.current;
221
221
  if (e.disabled === !0 || ht.has(e.id)) return;
222
222
  if (e.children !== void 0) {
223
- o([...R.current.currentPages, e.id], t === "pointer" ? "pointer" : "select", n), Y.current.setQuery("", "select", n);
223
+ o([...z.current.currentPages, e.id], t === "pointer" ? "pointer" : "select", n), X.current.setQuery("", "select", n);
224
224
  return;
225
225
  }
226
226
  let s = !1, c = {
@@ -231,16 +231,16 @@ function be({ autoHighlight: o, children: d, className: p, clearOnClose: me, clo
231
231
  s = !0;
232
232
  }
233
233
  }, l = () => {
234
- Y.current.setRecent(fe(R.current.currentRecent, e.id, i.recentLimit), n), r?.(e, c), i.closeOnSelect && !s && a(!1, "select", n);
234
+ X.current.setRecent(fe(z.current.currentRecent, e.id, i.recentLimit), n), r?.(e, c), i.closeOnSelect && !s && a(!1, "select", n);
235
235
  }, u;
236
236
  try {
237
237
  u = e.onSelect?.(c);
238
238
  } catch (e) {
239
- J(e instanceof Error ? e.message : String(e));
239
+ Y(e instanceof Error ? e.message : String(e));
240
240
  return;
241
241
  }
242
242
  if (u instanceof Promise) {
243
- J(null), gt((t) => new Set(t).add(e.id)), u.then(() => {
243
+ Y(null), gt((t) => new Set(t).add(e.id)), u.then(() => {
244
244
  gt((t) => {
245
245
  let n = new Set(t);
246
246
  return n.delete(e.id), n;
@@ -249,44 +249,44 @@ function be({ autoHighlight: o, children: d, className: p, clearOnClose: me, clo
249
249
  gt((t) => {
250
250
  let n = new Set(t);
251
251
  return n.delete(e.id), n;
252
- }), J(t instanceof Error ? t.message : String(t));
252
+ }), Y(t instanceof Error ? t.message : String(t));
253
253
  });
254
254
  return;
255
255
  }
256
256
  l();
257
- }, [ht]), yt = f((e) => e === null ? void 0 : W.rows.find((t) => t.id === e), [W]), X = (e, t) => {
258
- let n = F === null ? -1 : G.indexOf(F), r = e === "pageDown" || e === "pageUp", i = ue({
259
- enabled: K,
257
+ }, [ht]), yt = f((e) => e === null ? void 0 : G.rows.find((t) => t.id === e), [G]), Z = (e, t) => {
258
+ let n = I === null ? -1 : K.indexOf(I), r = e === "pageDown" || e === "pageUp", i = ue({
259
+ enabled: q,
260
260
  from: n,
261
261
  intent: e,
262
- loop: O.loop && !r
262
+ loop: k.loop && !r
263
263
  });
264
- t.preventDefault(), i !== -1 && z(G[i] ?? null, "keyboard", t);
264
+ t.preventDefault(), i !== -1 && B(K[i] ?? null, "keyboard", t);
265
265
  }, bt = (e) => {
266
266
  if (!e.nativeEvent.isComposing) switch (e.key) {
267
267
  case "ArrowDown":
268
- X("next", e);
268
+ Z("next", e);
269
269
  return;
270
270
  case "ArrowUp":
271
- X("previous", e);
271
+ Z("previous", e);
272
272
  return;
273
273
  case "PageDown":
274
- X("pageDown", e);
274
+ Z("pageDown", e);
275
275
  return;
276
276
  case "PageUp":
277
- X("pageUp", e);
277
+ Z("pageUp", e);
278
278
  return;
279
279
  case "Home":
280
- e.ctrlKey && X("first", e);
280
+ e.ctrlKey && Z("first", e);
281
281
  return;
282
282
  case "End":
283
- e.ctrlKey && X("last", e);
283
+ e.ctrlKey && Z("last", e);
284
284
  return;
285
285
  case "Enter": {
286
- let t = yt(F);
286
+ let t = yt(I);
287
287
  if (t === void 0) return;
288
288
  if (t.href !== void 0 && (e.metaKey || e.ctrlKey || e.shiftKey)) {
289
- (q.current?.querySelector(`#${CSS.escape(x(M, t.id))}`))?.dispatchEvent(new globalThis.MouseEvent("click", {
289
+ (J.current?.querySelector(`#${CSS.escape(x(N, t.id))}`))?.dispatchEvent(new globalThis.MouseEvent("click", {
290
290
  bubbles: !0,
291
291
  cancelable: !0,
292
292
  metaKey: e.metaKey,
@@ -296,7 +296,7 @@ function be({ autoHighlight: o, children: d, className: p, clearOnClose: me, clo
296
296
  return;
297
297
  }
298
298
  if (e.preventDefault(), t.href !== void 0) {
299
- let n = q.current?.querySelector(`#${CSS.escape(x(M, t.id))}`);
299
+ let n = J.current?.querySelector(`#${CSS.escape(x(N, t.id))}`);
300
300
  vt(t, "keyboard", e), n?.click();
301
301
  return;
302
302
  }
@@ -304,90 +304,90 @@ function be({ autoHighlight: o, children: d, className: p, clearOnClose: me, clo
304
304
  return;
305
305
  }
306
306
  case "Escape":
307
- if (P !== "") {
308
- e.preventDefault(), e.stopPropagation(), B("", "clear", e);
307
+ if (F !== "") {
308
+ e.preventDefault(), e.stopPropagation(), V("", "clear", e);
309
309
  return;
310
310
  }
311
- if (I.length > 0) {
312
- e.preventDefault(), e.stopPropagation(), V(I.slice(0, -1), "keyboard", e);
311
+ if (L.length > 0) {
312
+ e.preventDefault(), e.stopPropagation(), H(L.slice(0, -1), "keyboard", e);
313
313
  return;
314
314
  }
315
- A || (e.preventDefault(), U(!1, "escape", e));
315
+ j || (e.preventDefault(), W(!1, "escape", e));
316
316
  return;
317
317
  case "Backspace":
318
- P === "" && I.length > 0 && (e.preventDefault(), V(I.slice(0, -1), "keyboard", e));
318
+ F === "" && L.length > 0 && (e.preventDefault(), H(L.slice(0, -1), "keyboard", e));
319
319
  return;
320
320
  default: return;
321
321
  }
322
- }, Z = f(() => {
323
- let e = H.current;
322
+ }, Q = f(() => {
323
+ let e = U.current;
324
324
  e !== null && (e.focus(), e.select());
325
325
  }, []);
326
326
  m(() => {
327
- let e = O.hotkey;
328
- if (e === null || A || O.disabled) return;
327
+ let e = k.hotkey;
328
+ if (e === null || j || k.disabled) return;
329
329
  let t = ce(e)[0]?.every((e) => ![
330
330
  "mod",
331
331
  "meta",
332
332
  "ctrl",
333
333
  "alt"
334
334
  ].includes(ae(e) ?? "")), n = (n) => {
335
- if (se(n, e, j) && !(t === !0 && oe(n))) {
336
- if (n.preventDefault(), R.current.currentOpen) {
337
- Z();
335
+ if (se(n, e, M) && !(t === !0 && oe(n))) {
336
+ if (n.preventDefault(), z.current.currentOpen) {
337
+ Q();
338
338
  return;
339
339
  }
340
- U(!0, "keyboard", n);
340
+ W(!0, "keyboard", n);
341
341
  }
342
342
  };
343
343
  return document.addEventListener("keydown", n, !0), () => document.removeEventListener("keydown", n, !0);
344
344
  }, [
345
- Z,
346
- A,
345
+ Q,
347
346
  j,
348
- O.disabled,
349
- O.hotkey,
350
- U
347
+ M,
348
+ k.disabled,
349
+ k.hotkey,
350
+ W
351
351
  ]);
352
- let xt = O.loading ? k("loading") : _t === null ? k("count", { count: W.count }) : k("error", { message: _t });
352
+ let xt = k.loading ? A("loading") : _t === null ? A("count", { count: G.count }) : A("error", { message: _t });
353
353
  m(() => {
354
- N && le(H.current?.ownerDocument).announce(xt);
355
- }, [N, xt]), m(() => {
356
- J(null);
357
- }, [P, I]), te(Je, () => ({
358
- open: () => U(!0, "programmatic"),
359
- close: () => U(!1, "programmatic"),
360
- toggle: () => U(!R.current.currentOpen, "programmatic"),
361
- focus: Z,
362
- setQuery: (e) => B(e, "programmatic"),
363
- scrollToId: (e) => z(e, "programmatic"),
354
+ P && le(U.current?.ownerDocument).announce(xt);
355
+ }, [P, xt]), m(() => {
356
+ Y(null);
357
+ }, [F, L]), te(qe, () => ({
358
+ open: () => W(!0, "programmatic"),
359
+ close: () => W(!1, "programmatic"),
360
+ toggle: () => W(!z.current.currentOpen, "programmatic"),
361
+ focus: Q,
362
+ setQuery: (e) => V(e, "programmatic"),
363
+ scrollToId: (e) => B(e, "programmatic"),
364
364
  get input() {
365
- return H.current;
365
+ return U.current;
366
366
  }
367
367
  }), [
368
- Z,
369
- z,
370
- U,
371
- B
368
+ Q,
369
+ B,
370
+ W,
371
+ V
372
372
  ]);
373
373
  let [St, Ct] = _(null), [wt, Tt] = _(null);
374
374
  m(() => {
375
- if (St === null || b !== void 0 || A) return;
375
+ if (St === null || b !== void 0 || j) return;
376
376
  let e = re({ origin: St });
377
377
  return Tt(e.container), () => {
378
378
  Tt(null), e.release();
379
379
  };
380
380
  }, [
381
381
  b,
382
- A,
382
+ j,
383
383
  St
384
384
  ]);
385
385
  let Et = (n) => {
386
- let r = F === n.id, i = n.disabled === !0, o = ht.has(n.id), s = x(M, n.id), c = O.highlightMatch && P.trim() !== "" ? /* @__PURE__ */ v(a, {
387
- locale: et,
388
- query: P,
386
+ let r = I === n.id, i = n.disabled === !0, o = ht.has(n.id), s = x(N, n.id), c = k.highlightMatch && F.trim() !== "" ? /* @__PURE__ */ v(a, {
387
+ locale: $e,
388
+ query: F,
389
389
  text: n.label
390
- }) : n.label, u = n.children === void 0 ? n.shortcut : void 0, d = Ye === void 0 ? /* @__PURE__ */ y(ne, { children: [
390
+ }) : n.label, u = n.children === void 0 ? n.shortcut : void 0, d = Je === void 0 ? /* @__PURE__ */ y(ne, { children: [
391
391
  /* @__PURE__ */ v("span", {
392
392
  "data-part": "icon",
393
393
  children: n.icon
@@ -428,16 +428,16 @@ function be({ autoHighlight: o, children: d, className: p, clearOnClose: me, clo
428
428
  "data-part": "busy",
429
429
  "data-ui": "spinner"
430
430
  }) : null
431
- ] }) : Ye(n, {
431
+ ] }) : Je(n, {
432
432
  current: r,
433
433
  disabled: i,
434
434
  pending: o,
435
435
  label: c,
436
- query: P
436
+ query: F
437
437
  }), f = {
438
438
  "aria-disabled": i ? !0 : void 0,
439
439
  "aria-busy": o ? !0 : void 0,
440
- "aria-keyshortcuts": u === void 0 ? void 0 : ye(u, j),
440
+ "aria-keyshortcuts": u === void 0 ? void 0 : ye(u, M),
441
441
  "aria-selected": r,
442
442
  "data-part": "item",
443
443
  ...r ? { "data-current": "" } : {},
@@ -448,7 +448,7 @@ function be({ autoHighlight: o, children: d, className: p, clearOnClose: me, clo
448
448
  role: "option",
449
449
  title: n.label,
450
450
  onPointerMove: (e) => {
451
- i || z(n.id, "pointer", e);
451
+ i || e.pointerType === "touch" || B(n.id, "pointer", e);
452
452
  },
453
453
  onClick: (e) => {
454
454
  if (i || o) {
@@ -468,12 +468,12 @@ function be({ autoHighlight: o, children: d, className: p, clearOnClose: me, clo
468
468
  children: d
469
469
  }, n.id);
470
470
  }, Dt = (e, t) => {
471
- let n = e.recent ? k("recent") : e.label, r = e.items.map(Et), i = t === 0 ? null : /* @__PURE__ */ v("div", {
471
+ let n = e.recent ? A("recent") : e.label, r = e.items.map(Et), i = t === 0 ? null : /* @__PURE__ */ v("div", {
472
472
  "data-part": "separator",
473
473
  role: "separator"
474
474
  }, `sep-${t}`);
475
475
  if (n === void 0) return [i, ...r];
476
- let a = `${M}-group-${t}`;
476
+ let a = `${N}-group-${t}`;
477
477
  return [i, /* @__PURE__ */ y("div", {
478
478
  "aria-labelledby": a,
479
479
  "data-part": "group",
@@ -485,10 +485,10 @@ function be({ autoHighlight: o, children: d, className: p, clearOnClose: me, clo
485
485
  children: n
486
486
  }), r]
487
487
  }, `group-${t}`)];
488
- }, Ot = De === null ? null : /* @__PURE__ */ v("div", {
488
+ }, Ot = S === null ? null : /* @__PURE__ */ v("div", {
489
489
  "aria-hidden": "true",
490
490
  "data-part": "footer",
491
- children: De === void 0 ? /* @__PURE__ */ y(ne, { children: [
491
+ children: S === void 0 ? /* @__PURE__ */ y(ne, { children: [
492
492
  /* @__PURE__ */ y("span", {
493
493
  "data-part": "hint",
494
494
  children: [
@@ -504,7 +504,7 @@ function be({ autoHighlight: o, children: d, className: p, clearOnClose: me, clo
504
504
  size: "inherit",
505
505
  variant: "outline"
506
506
  }),
507
- /* @__PURE__ */ v("span", { children: k("hintNavigate") })
507
+ /* @__PURE__ */ v("span", { children: A("hintNavigate") })
508
508
  ]
509
509
  }),
510
510
  /* @__PURE__ */ y("span", {
@@ -514,45 +514,48 @@ function be({ autoHighlight: o, children: d, className: p, clearOnClose: me, clo
514
514
  separator: "",
515
515
  size: "inherit",
516
516
  variant: "outline"
517
- }), /* @__PURE__ */ v("span", { children: k("hintSelect") })]
517
+ }), /* @__PURE__ */ v("span", { children: A("hintSelect") })]
518
518
  }),
519
- I.length === 0 ? null : /* @__PURE__ */ y("span", {
519
+ L.length === 0 ? null : /* @__PURE__ */ y("span", {
520
520
  "data-part": "hint",
521
521
  children: [/* @__PURE__ */ v(l, {
522
522
  keys: "backspace",
523
523
  separator: "",
524
524
  size: "inherit",
525
525
  variant: "outline"
526
- }), /* @__PURE__ */ v("span", { children: k("hintBack") })]
526
+ }), /* @__PURE__ */ v("span", { children: A("hintBack") })]
527
527
  }),
528
- A ? null : /* @__PURE__ */ y("span", {
528
+ j ? null : /* @__PURE__ */ y("span", {
529
529
  "data-part": "hint",
530
530
  children: [/* @__PURE__ */ v(l, {
531
531
  keys: "escape",
532
532
  separator: "",
533
533
  size: "inherit",
534
534
  variant: "outline"
535
- }), /* @__PURE__ */ v("span", { children: k("hintClose") })]
535
+ }), /* @__PURE__ */ v("span", { children: A("hintClose") })]
536
536
  })
537
- ] }) : De
538
- }), { onChange: kt, onKeyDown: At, ref: Q, ...$ } = je ?? {}, jt = !O.loading && W.count === 0, Mt = /* @__PURE__ */ y("div", {
539
- ...Qe,
537
+ ] }) : S
538
+ }), { onChange: kt, onKeyDown: At, ref: $, ...jt } = Ae ?? {}, Mt = !k.loading && G.count === 0, Nt = /* @__PURE__ */ y("div", {
539
+ ...Ze,
540
540
  className: p,
541
541
  "data-ui": "command-palette",
542
542
  "data-part": "root",
543
- "data-presentation": O.presentation,
544
- "data-size": O.size,
545
- ...N ? { "data-open": "" } : {},
546
- ...O.loading ? { "data-loading": "" } : {},
547
- ...O.disabled ? { "data-disabled": "" } : {},
548
- ...P === "" ? {} : { "data-query": "" },
549
- ...jt ? { "data-empty": "" } : {},
550
- style: Ze,
543
+ "data-presentation": k.presentation,
544
+ "data-size": k.size,
545
+ ...P ? { "data-open": "" } : {},
546
+ ...k.loading ? { "data-loading": "" } : {},
547
+ ...k.disabled ? { "data-disabled": "" } : {},
548
+ ...F === "" ? {} : { "data-query": "" },
549
+ ...Mt ? { "data-empty": "" } : {},
550
+ onMouseDown: ve(Ze.onMouseDown, (e) => {
551
+ e.target !== U.current && e.preventDefault();
552
+ }),
553
+ style: Xe,
551
554
  children: [
552
555
  /* @__PURE__ */ y("div", {
553
556
  "data-part": "header",
554
557
  children: [
555
- O.loading ? /* @__PURE__ */ v("span", {
558
+ k.loading ? /* @__PURE__ */ v("span", {
556
559
  "aria-hidden": "true",
557
560
  "data-part": "busy",
558
561
  "data-ui": "spinner"
@@ -561,68 +564,68 @@ function be({ autoHighlight: o, children: d, className: p, clearOnClose: me, clo
561
564
  "data-part": "search",
562
565
  children: /* @__PURE__ */ v(t, { children: /* @__PURE__ */ v(e, { name: "search" }) })
563
566
  }),
564
- W.trail.length === 0 ? null : /* @__PURE__ */ v("ol", {
565
- "aria-label": k("back"),
567
+ G.trail.length === 0 ? null : /* @__PURE__ */ v("ol", {
568
+ "aria-label": A("back"),
566
569
  "data-part": "pages",
567
- children: W.trail.map((n, r) => /* @__PURE__ */ y("li", { children: [r === 0 ? null : /* @__PURE__ */ v(t, {
570
+ children: G.trail.map((n, r) => /* @__PURE__ */ y("li", { children: [r === 0 ? null : /* @__PURE__ */ v(t, {
568
571
  directional: !0,
569
572
  children: /* @__PURE__ */ v(e, { name: "chevron-right" })
570
573
  }), /* @__PURE__ */ v("button", {
571
574
  "data-part": "page",
572
- onClick: (e) => V(I.slice(0, r + 1), "pointer", e),
575
+ onClick: (e) => H(L.slice(0, r + 1), "pointer", e),
573
576
  type: "button",
574
577
  children: /* @__PURE__ */ v("span", { children: n.label })
575
578
  })] }, n.id))
576
579
  }),
577
580
  /* @__PURE__ */ v("input", {
578
- ...$,
579
- "aria-activedescendant": F === null ? void 0 : x(M, F),
581
+ ...jt,
582
+ "aria-activedescendant": I === null ? void 0 : x(N, I),
580
583
  "aria-autocomplete": "list",
581
- "aria-controls": tt,
584
+ "aria-controls": et,
582
585
  "aria-expanded": "true",
583
- "aria-label": $["aria-label"] ?? k("input"),
586
+ "aria-label": jt["aria-label"] ?? A("input"),
584
587
  autoComplete: "off",
585
588
  "data-part": "input",
586
- disabled: O.disabled,
587
- onChange: ve(kt, (e) => B(e.target.value, "keyboard", e)),
589
+ disabled: k.disabled,
590
+ onChange: ve(kt, (e) => V(e.target.value, "keyboard", e)),
588
591
  onKeyDown: ve(At, bt),
589
- placeholder: $.placeholder ?? k("placeholder"),
592
+ placeholder: jt.placeholder ?? A("placeholder"),
590
593
  ref: (e) => {
591
- H.current = e, typeof Q == "function" ? Q(e) : Q != null && (Q.current = e);
594
+ U.current = e, typeof $ == "function" ? $(e) : $ != null && ($.current = e);
592
595
  },
593
596
  role: "combobox",
594
597
  spellCheck: !1,
595
598
  type: "text",
596
- value: P
599
+ value: F
597
600
  }),
598
601
  /* @__PURE__ */ v("button", {
599
- "aria-label": k("clear"),
602
+ "aria-label": A("clear"),
600
603
  "data-part": "clear",
601
604
  onClick: (e) => {
602
- B("", "clear", e), H.current?.focus();
605
+ V("", "clear", e), U.current?.focus();
603
606
  },
604
607
  tabIndex: -1,
605
608
  type: "button",
606
609
  children: /* @__PURE__ */ v(t, { children: /* @__PURE__ */ v(e, { name: "x" }) })
607
610
  }),
608
- A ? null : /* @__PURE__ */ v("button", {
611
+ j ? null : /* @__PURE__ */ v("button", {
609
612
  "data-part": "close",
610
- onClick: (e) => U(!1, "dismiss", e),
613
+ onClick: (e) => W(!1, "dismiss", e),
611
614
  type: "button",
612
- children: k("close")
615
+ children: A("close")
613
616
  })
614
617
  ]
615
618
  }),
616
619
  /* @__PURE__ */ y("div", {
617
- "aria-busy": O.loading ? !0 : void 0,
618
- "aria-label": k("input"),
620
+ "aria-busy": k.loading ? !0 : void 0,
621
+ "aria-label": A("input"),
619
622
  "data-part": "list",
620
- ...O.loading ? { "data-loading": "" } : {},
621
- id: tt,
622
- ref: q,
623
+ ...k.loading ? { "data-loading": "" } : {},
624
+ id: et,
625
+ ref: J,
623
626
  role: "listbox",
624
627
  children: [
625
- O.loading && W.count === 0 ? /* @__PURE__ */ v("div", {
628
+ k.loading && G.count === 0 ? /* @__PURE__ */ v("div", {
626
629
  "aria-hidden": "true",
627
630
  "data-part": "placeholder",
628
631
  children: [
@@ -636,11 +639,11 @@ function be({ autoHighlight: o, children: d, className: p, clearOnClose: me, clo
636
639
  "data-ui": "skeleton"
637
640
  }) }, e))
638
641
  }) : null,
639
- jt ? /* @__PURE__ */ v("div", {
642
+ Mt ? /* @__PURE__ */ v("div", {
640
643
  "data-part": "empty",
641
- children: Ee ?? k("empty")
644
+ children: Ee ?? A("empty")
642
645
  }) : null,
643
- W.sections.flatMap(Dt)
646
+ G.sections.flatMap(Dt)
644
647
  ]
645
648
  }),
646
649
  /* @__PURE__ */ v("div", {
@@ -650,27 +653,27 @@ function be({ autoHighlight: o, children: d, className: p, clearOnClose: me, clo
650
653
  }),
651
654
  Ot
652
655
  ]
653
- }), Nt = {
654
- presentation: O.presentation,
655
- disabled: O.disabled
656
+ }), Pt = {
657
+ presentation: k.presentation,
658
+ disabled: k.disabled
656
659
  };
657
- if (A) return /* @__PURE__ */ y(_e.Provider, {
658
- value: Nt,
659
- children: [d, Mt]
660
+ if (j) return /* @__PURE__ */ y(_e.Provider, {
661
+ value: Pt,
662
+ children: [d, Nt]
660
663
  });
661
- let Pt = b === void 0 ? /* @__PURE__ */ v("span", {
664
+ let Ft = b === void 0 ? /* @__PURE__ */ v("span", {
662
665
  hidden: !0,
663
666
  ref: Ct
664
- }) : null, Ft = b === void 0 ? wt : b;
667
+ }) : null, It = b === void 0 ? wt : b;
665
668
  return /* @__PURE__ */ y(_e.Provider, {
666
- value: Nt,
667
- children: [Pt, /* @__PURE__ */ y(c, {
668
- container: Ft,
669
+ value: Pt,
670
+ children: [Ft, /* @__PURE__ */ y(c, {
671
+ container: It,
669
672
  escape: "none",
670
673
  fullScreen: "narrow",
671
- initialFocus: H,
674
+ initialFocus: U,
672
675
  onOpenChange: (e, t) => {
673
- let n = t.reason === "outsidePress" || t.reason === "escape" || t.reason === "pointer" || t.reason === "keyboard" ? t.reason : "dismiss", r = R.current;
676
+ let n = t.reason === "outsidePress" || t.reason === "escape" || t.reason === "pointer" || t.reason === "keyboard" ? t.reason : "dismiss", r = z.current;
674
677
  if (!u({
675
678
  controlled: r.open,
676
679
  initial: r.currentOpen,
@@ -679,16 +682,16 @@ function be({ autoHighlight: o, children: d, className: p, clearOnClose: me, clo
679
682
  t.cancel();
680
683
  return;
681
684
  }
682
- rt(e);
685
+ nt(e);
683
686
  },
684
- open: N,
685
- outsidePress: O.outsidePress,
687
+ open: P,
688
+ outsidePress: k.outsidePress,
686
689
  placement: "top",
687
- size: O.size,
690
+ size: k.size,
688
691
  surface: "plain",
689
692
  children: [d, /* @__PURE__ */ v(s, {
690
- "aria-label": k("label"),
691
- children: Mt
693
+ "aria-label": A("label"),
694
+ children: Nt
692
695
  })]
693
696
  })]
694
697
  });